A_RingBox is an action that gives the player a certain amount of rings and plays the actor's SeeSound
. The amount of rings is determined by the actor's ReactionTime
attribute. It can be any number, including negatives (the player's ring count will not go lower than zero, however). In SRB2, this action is used by the Super Ring Monitor, which gives the player 10 rings.
Object property |
Use
|
SeeSound |
Sound to play
|
ReactionTime |
Number of rings to award
|
Code – A_RingBox
|
|
// Function: A_RingBox
//
// Description: Awards the player 10 rings.
//
// var1 = unused
// var2 = unused
//
void A_RingBox(mobj_t *actor)
{
player_t *player;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_RingBox", actor))
return;
#endif
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
P_GivePlayerRings(player, actor->info->reactiontime);
if (actor->info->seesound)
S_StartSound(player->mo, actor->info->seesound);
}
|
|