A_RingDrain is an action that removes a specified number of rings from the actor's target player. If the actor doesn't have a target, or is not targeting a player, this action will do nothing. The number of rings to remove is specified by Var1; if this exceeds the number of rings the player currently holds, the player will lose all rings.
This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.
Code – A_RingDrain
// Function: A_RingDrain
// Description: Drain targeted player's rings.
// var1 = ammount of drained rings
// var2 = unused
void A_RingDrain(mobj_t *actor)
INT32 locvar1 = var1;
if (LUA_CallAction("A_RingDrain", actor))
if (!actor->target || !actor->target->player)
CONS_Printf("A_RingDrain: No player targeted!\n");
player = actor->target->player;
P_GivePlayerRings(player, -min(locvar1, player->rings));