A_CheckTargetRings is an action that calls a state depending on the number of rings currently held by the actor's target. If the actor doesn't have a target, or is not targeting a player, this action will do nothing. Var1 determines the minimum ring requirement to allow the state to be called with – i.e if the number of rings currently held by by the actor's target is greater 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.
This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.
Due to a bug in v2.1, this action actually compares Var1 with the player's total health (number of rings + 1), rather than the player's ring count directly. To adjust to this properly, simply add 1 to the value set for Var1.
Code – A_CheckTargetRings
// Function: A_CheckTargetRings
// Description: Calls a state depending on the ammount of rings currently owned by targeted players.
// var1 = if player rings >= var1 call state
// var2 = state number
void A_CheckTargetRings(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_CheckTargetRings", actor))
if (!(actor->target) || !(actor->target->player))
if (actor->target->player->health >= locvar1)