Skip to content

Commit

Permalink
- Exhumed: Split out player mask code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Mar 24, 2023
1 parent 62c045a commit 16561c2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions source/games/exhumed/src/player.cpp
Expand Up @@ -842,6 +842,22 @@ static void doPlayerInvincibility(Player* const pPlayer)
//
//---------------------------------------------------------------------------

static void doPlayerMask(Player* const pPlayer)
{
pPlayer->nMaskAmount--;

if (pPlayer->nMaskAmount == 150 && pPlayer->nPlayer == nLocalPlayer)
{
PlayAlert(GStrings("TXT_EX_MASKEX"));
}
}

//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------

static void doPlayerQuake(Player* const pPlayer)
{
pPlayer->nQuake = -pPlayer->nQuake;
Expand Down Expand Up @@ -1379,12 +1395,7 @@ void AIPlayer::Tick(RunListEvent* ev)
if (pPlayer->nHealth > 0)
{
if (pPlayer->nMaskAmount > 0)
{
pPlayer->nMaskAmount--;
if (pPlayer->nMaskAmount == 150 && nPlayer == nLocalPlayer) {
PlayAlert(GStrings("TXT_EX_MASKEX"));
}
}
doPlayerMask(pPlayer);

if (!pPlayer->invincibility)
{
Expand Down

0 comments on commit 16561c2

Please sign in to comment.