A_Invincibility is an action that makes the target player invincible for a short period of time and plays the invincibility music (INVINC
). In Mario mode, MINVNC
is played instead. If the target player is currently in Super form, the music will not be changed.
Code – A_Invincibility
|
|
// Function: A_Invincibility
//
// Description: Awards the player invincibility.
//
// var1 = unused
// var2 = unused
//
void A_Invincibility(mobj_t *actor)
{
player_t *player;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_Invincibility", actor))
return;
#endif
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
player->powers[pw_invulnerability] = invulntics + 1;
if (P_IsLocalPlayer(player) && !player->powers[pw_super])
{
if (mariomode)
G_GhostAddColor(GHC_INVINCIBLE);
P_PlayJingle(player, (mariomode) ? JT_MINV : JT_INV);
strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14);
S_StartCaption(sfx_None, -1, player->powers[pw_invulnerability]);
}
}
|
|