A MonsterRefire: Difference between revisions
Marisa Heit (talk | contribs) (Add return type) |
m (Fix an extraneous line break in the page that looked odd) |
||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:A_MonsterRefire}} |
{{DISPLAYTITLE:A_MonsterRefire}} |
||
state '''A_MonsterRefire''' (int ''chancecontinue'', str "''abortstate''") |
state '''A_MonsterRefire''' (int ''chancecontinue'', str "''abortstate''") |
||
Revision as of 14:31, 24 January 2017
state A_MonsterRefire (int chancecontinue, str "abortstate")
A_CPosRefire
(no parameters)
A_CrusaderRefire
(no parameters)
A_SentinelRefire
(no parameters)
A_SpidRefire
(no parameters)
Calls A_FaceTarget and then checks whether the monster should abort its attack sequence and go back to abortstate. If the target is out of sight or dead, has a chancecontinue/256 chance to continue nonetheless.
The monster-specific functions use the following parameters:
- A_CPosRefire: 40, "See"
- A_CrusaderRefire: 0, "See"
- A_SpidRefire: 10, "See"
- A_SentinelRefire: 30, "See"
All these functions jump to the “See” state if the attack is to be aborted. The loop has to be explicitly coded in the actor definition. A_SentinelRefire also has a 10/256 chance of aborting the attack even if the target is still in sight. A_CrusaderRefire is restricted to Crusader and derived classes.
Example
ACTOR SuperZombie : ZombieMan replaces ZombieMan { States { Missile: POSS E 10 A_FaceTarget POSS FE 2 Bright A_PosAttack POSS F 1 A_MonsterRefire(130, "See") // About 50% chance to jump to "See" if target is out of sight. Goto Missile+1 // Looping back to the attack state to allow the actual refire! } }