Skip to content

Instantly share code, notes, and snippets.

@mzabsky
Created January 9, 2024 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzabsky/20b8858f22be92593fb91a9aaec6fc2a to your computer and use it in GitHub Desktop.
Save mzabsky/20b8858f22be92593fb91a9aaec6fc2a to your computer and use it in GitHub Desktop.
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