A_CheckRings is an action that calls a state depending on the total number of rings currently held by all players in the game. Var1 determines the minimum ring requirement to allow the state to be called with – i.e if the number of rings currently held by all players 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.
Code – A_CheckRings
// Function: A_CheckRings
// Description: Calls a state depending on the ammount of rings currently owned by all players.
// var1 = if player rings >= var1 call state
// var2 = state number
void A_CheckRings(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
INT32 i, cntr = 0;
if (LUA_CallAction("A_CheckRings", actor))
for (i = 0; i < MAXPLAYERS; i++)
cntr += players[i].health-1;
if (cntr >= locvar1)