Commit ddb266f0 authored by Dino Bollinger's avatar Dino Bollinger
Browse files

SW: Clean up boss music code. Remove unnecessary calls and checks

parent a29f2436
......@@ -809,15 +809,11 @@ int DoSerpMove(short SpriteNum)
int DoDeathSpecial(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
static SWBOOL alreadydid = FALSE;
DoMatchEverything(NULL, sp->lotag, ON);
if (!SW_SHAREWARE && gs.MusicOn && !alreadydid)
{
PlaySong(0, RedBookSong[Level], TRUE, TRUE);
alreadydid = TRUE;
}
if (!SW_SHAREWARE && gs.MusicOn)
PlaySong(0, RedBookSong[Level], TRUE, FALSE);
BossSpriteNum[0] = -2;
return 0;
......
......@@ -786,7 +786,6 @@ int DoSumoDeathMelt(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
static SWBOOL alreadydid = FALSE;
PlaySound(DIGI_SUMOFART, &sp->x, &sp->y, &sp->z, v3df_follow);
......@@ -795,11 +794,8 @@ int DoSumoDeathMelt(short SpriteNum)
u->ID = 0;
DoMatchEverything(NULL, sp->lotag, ON);
if (!SW_SHAREWARE && gs.MusicOn && !alreadydid)
{
PlaySong(0, RedBookSong[Level], TRUE, TRUE);
alreadydid = TRUE;
}
if (!SW_SHAREWARE && gs.MusicOn)
PlaySong(0, RedBookSong[Level], TRUE, FALSE);
BossSpriteNum[1] = -2; // Sprite is gone, set it back to keep it valid!
......@@ -817,8 +813,6 @@ BossHealthMeter(void)
int y;
extern SWBOOL NoMeters;
short health;
SWBOOL bosswasseen;
static SWBOOL triedplay = FALSE;
if (NoMeters) return;
......@@ -854,12 +848,8 @@ BossHealthMeter(void)
if (BossSpriteNum[0] <= -1 && BossSpriteNum[1] <= -1 && BossSpriteNum[2] <= -1)
return;
// Frank, good optimization for other levels, but it broke level 20. :(
// I kept this but had to add a fix.
bosswasseen = serpwasseen|sumowasseen|zillawasseen;
// Only show the meter when you can see the boss
if ((Level == 20 && (!serpwasseen || !sumowasseen || !zillawasseen)) || !bosswasseen)
if (!serpwasseen || !sumowasseen || !zillawasseen)
{
for (i=0; i<3; i++)
{
......@@ -875,7 +865,7 @@ BossHealthMeter(void)
serpwasseen = TRUE;
if (!SW_SHAREWARE && gs.MusicOn)
{
PlaySong(0, 13, TRUE, TRUE);
PlaySong(0, 13, TRUE, FALSE);
}
}
else if (i == 1 && !sumowasseen)
......@@ -883,7 +873,7 @@ BossHealthMeter(void)
sumowasseen = TRUE;
if (!SW_SHAREWARE && gs.MusicOn)
{
PlaySong(0, 13, TRUE, TRUE);
PlaySong(0, 13, TRUE, FALSE);
}
}
else if (i == 2 && !zillawasseen)
......@@ -891,7 +881,7 @@ BossHealthMeter(void)
zillawasseen = TRUE;
if (!SW_SHAREWARE && gs.MusicOn)
{
PlaySong(0, 13, TRUE, TRUE);
PlaySong(0, 13, TRUE, FALSE);
}
}
}
......@@ -910,13 +900,6 @@ BossHealthMeter(void)
if (i == 2 && (!zillawasseen || BossSpriteNum[2] < 0))
continue;
// This is needed because of possible saved game situation
if (!SW_SHAREWARE && !triedplay)
{
PlaySong(0, 13, TRUE, FALSE);
triedplay = TRUE; // Only try once, then give up
}
sp = &sprite[BossSpriteNum[i]];
u = User[BossSpriteNum[i]];
......
......@@ -765,7 +765,6 @@ int DoZillaDeathMelt(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
static SWBOOL alreadydid = FALSE;
if (RANDOM_RANGE(1000) > 800)
SpawnGrenadeExp(SpriteNum);
......@@ -774,11 +773,8 @@ int DoZillaDeathMelt(short SpriteNum)
RESET(u->Flags, SPR_JUMPING|SPR_FALLING|SPR_MOVED);
//DoMatchEverything(NULL, sp->lotag, ON);
if (!SW_SHAREWARE && gs.MusicOn && !alreadydid)
{
PlaySong(0, RedBookSong[Level], TRUE, TRUE);
alreadydid = TRUE;
}
if (!SW_SHAREWARE && gs.MusicOn)
PlaySong(0, RedBookSong[Level], TRUE, FALSE);
//KeepActorOnFloor(SpriteNum);
getzsofslope(sp->sectnum, sp->x, sp->y, &u->hiz, &u->loz);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment