Created
January 9, 2024 18:51
-
-
Save mzabsky/20b8858f22be92593fb91a9aaec6fc2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HM_GlobalEventHandler global; | |
.... | |
action void HM_A_FirePlasma() | |
{ | |
if (player == null) | |
{ | |
return; | |
} | |
Weapon weap = player.ReadyWeapon; | |
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite) | |
{ | |
if (!weap.DepleteAmmo (weap.bAltFire, true, 1)) | |
return; | |
State flash = weap.FindState('Flash'); | |
if (flash != null) | |
{ | |
player.SetSafeFlash(weap, flash, random[FirePlasma](0, 1)); | |
} | |
} | |
let powerLimit = player.mo.GetAmmoCapacity("Cell") * 2 / 3; | |
int ammoCost = 1; | |
//Class<Actor> projectileType; | |
if(global.IsPerkActive("highvoltage") && self.CountInv("Cell") > powerLimit) | |
{ | |
//projectileType = "HM_PowerPlasmaBall"; | |
ammoCost *= 2; | |
} | |
else | |
{ | |
//projectileType = "HM_PlasmaBall"; | |
} | |
SpawnPlayerMissile ("HM_PowerPlasmaBall"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment