A_CheckHealth is an action that calls a state depending on the actor's current health. Var1 determines the highest amount of health points to allow the state to be called with – i.e. if the actor's health is less than or equal to Var1, the state is called. Var2 determines the state to call when this action is successful; see List of states for a full list. In SRB2, this action is used by Brak Eggman to trigger the destruction of the bordering walls in ERZ3 when in pinch phase (health <= 3).
This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.
Code – A_CheckHealth
// Function: A_CheckHealth
// Description: Calls a state depending on the object's current health.
// var1 = if health <= var1 call state
// var2 = state number
void A_CheckHealth(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_CheckHealth", actor))
if (actor->health <= locvar1)