This action is designed only for Objects of type
MT_EGGMOBILE2 (Egg Slimer), and will not have the same effect for other types of Objects.
A_Boss2TakeDamage is an action that is used by the Egg Slimer whenever it is damaged by the player. The actor changes its reaction time and
movecount values, which the Egg Slimer uses to change direction (if not in pinch phase) and become temporarily invincible, respectively. Var1 determines the duration in tics the actor remains invincible; if set to 0, this defaults to a value of
TICRATE (or a full second).
A_Pain is also called by this action to play the actor's
Code – A_Boss2TakeDamage
// Function: A_Boss2TakeDamage
// Description: Special function for Boss 2 so you can't just sit and destroy him.
// var1 = Invincibility duration
// var2 = unused
void A_Boss2TakeDamage(mobj_t *actor)
INT32 locvar1 = var1;
if (LUA_CallAction("A_Boss2TakeDamage", actor))
actor->reactiontime = 1; // turn around
if (locvar1 == 0) // old A_Invincibilerize behavior
actor->movecount = TICRATE;
actor->movecount = locvar1; // become flashing invulnerable for this long.