A_FirePlasma

From ZDoom Wiki
Jump to navigation Jump to search

A_FirePlasma

DoomWiki.org
For more information on this article, visit the A_FirePlasma page on the Doom Wiki.


(no parameters)

Fires a PlasmaBall, activates the Flash state sequence and sometimes randomly offsets the Flash sequence by 1 frame.

ZScript definition

Note: The ZScript definition below is for reference and may be different in the current version of GZDoom.The most up-to-date version of this code can be found on GZDoom GitHub.


	action void 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));
			}
			
		}
		
		SpawnPlayerMissile ("PlasmaBall");
	}

Examples

Fire state from Plasmagun:

 Fire:
   PLSG A 3 A_FirePlasma
   PLSG B 20 A_ReFire
   Goto Ready