A MonsterRefire

From ZDoom Wiki
Revision as of 09:55, 21 May 2009 by Hirogen2 (talk | contribs) (display style)
Jump to navigation Jump to search

A_CPosRefire

A_SpidRefire

A_SentinelRefire

(no parameters)


Checks whether the monster should loop its attack sequence. If the target is out of sight, the attack is terminated with a small random factor to continue it. This random factor is slightly higher for A_CPosRefire than for A_SpidRefire.

A_SentinelRefire is similar, but it also has a small chance of the attack being terminated even if the target is still visible.

All these functions jump to the “Seestate if the attack is to be aborted. The loop has to be explicitly coded in the actor definition.

Example

ACTOR SuperZombie : ZombieMan replaces ZombieMan
{
	States
	{
	Missile:
		POSS E 10 A_FaceTarget
		POSS FE 2 BRIGHT A_PosAttack
		POSS F 1 A_CPosRefire //ENDS the loop if target is out of sight.
		Goto Missile+1        //Be sure to loop your missile state, or this will not work!
	}
}