A JumpIfInventory

From ECWolf Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

A_JumpIfInventory (string item, int amount, state frame)

The calling actor jumps to the specified state if the actor is carrying at least amount of the given item.

Example

actor ReloadingPistol : Pistol //A pistol that reloads every 8 shots. uses the "LoadPistol" actor.
{
	states
	{
		Fire:
			PISG A 0 A_JumpIfInventory("PistolFired", 8, "LoadPistol")
			PISG B 3
			PISG C 3 Bright
			PISG D 3 A_GunAttack
			PISG E 3 A_GiveInventory("PistolFired", 1)
			goto ready
		LoadPistol:
			PISG F 3 //Reloading frames
			PISG G 3
			PISG H 3 A_TakeInventory("PistolFired", 8)
			goto ready
	}
}