A_GravityBox is an action that reverses the target player's gravity for an amount of time set by the actor's ReactionTime
and plays the actor's ActiveSound
. In SRB2, this action is used by the Gravity Boots monitor.
Object property |
Use
|
ActiveSound |
Sound to play
|
ReactionTime |
Amount of time set for reverse gravity to last
|
Code – A_GravityBox
|
|
// Function: A_GravityBox
//
// Description: Awards the player gravity boots.
//
// var1 = unused
// var2 = unused
//
void A_GravityBox(mobj_t *actor)
{
player_t *player;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_GravityBox", actor))
return;
#endif
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
S_StartSound(player, actor->info->activesound);
player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1);
}
|
|