- made most of the EV_* functions part of FLevelLocals.

This commit is contained in:
Christoph Oelckers 2019-01-26 08:28:45 +01:00
commit 10feb446fa
13 changed files with 282 additions and 351 deletions

View file

@ -3074,9 +3074,10 @@ void A_BossDeath(AActor *self)
// Do generic special death actions first
bool checked = false;
for (unsigned i = 0; i < level.info->specialactions.Size(); i++)
auto Level = &level;
for (unsigned i = 0; i < Level->info->specialactions.Size(); i++)
{
FSpecialAction *sa = &level.info->specialactions[i];
FSpecialAction *sa = &Level->info->specialactions[i];
if (type == sa->Type || mytype == sa->Type)
{
@ -3094,7 +3095,7 @@ void A_BossDeath(AActor *self)
// [RH] These all depend on the presence of level flags now
// rather than being hard-coded to specific levels/episodes.
if ((level.flags & (LEVEL_MAP07SPECIAL|
if ((Level->flags & (LEVEL_MAP07SPECIAL|
LEVEL_BRUISERSPECIAL|
LEVEL_CYBORGSPECIAL|
LEVEL_SPIDERSPECIAL|
@ -3104,13 +3105,13 @@ void A_BossDeath(AActor *self)
return;
if ((i_compatflags & COMPATF_ANYBOSSDEATH) || ( // [GZ] Added for UAC_DEAD
((level.flags & LEVEL_MAP07SPECIAL) && (type == NAME_Fatso || type == NAME_Arachnotron)) ||
((level.flags & LEVEL_BRUISERSPECIAL) && (type == NAME_BaronOfHell)) ||
((level.flags & LEVEL_CYBORGSPECIAL) && (type == NAME_Cyberdemon)) ||
((level.flags & LEVEL_SPIDERSPECIAL) && (type == NAME_SpiderMastermind)) ||
((level.flags & LEVEL_HEADSPECIAL) && (type == NAME_Ironlich)) ||
((level.flags & LEVEL_MINOTAURSPECIAL) && (type == NAME_Minotaur)) ||
((level.flags & LEVEL_SORCERER2SPECIAL) && (type == NAME_Sorcerer2))
((Level->flags & LEVEL_MAP07SPECIAL) && (type == NAME_Fatso || type == NAME_Arachnotron)) ||
((Level->flags & LEVEL_BRUISERSPECIAL) && (type == NAME_BaronOfHell)) ||
((Level->flags & LEVEL_CYBORGSPECIAL) && (type == NAME_Cyberdemon)) ||
((Level->flags & LEVEL_SPIDERSPECIAL) && (type == NAME_SpiderMastermind)) ||
((Level->flags & LEVEL_HEADSPECIAL) && (type == NAME_Ironlich)) ||
((Level->flags & LEVEL_MINOTAURSPECIAL) && (type == NAME_Minotaur)) ||
((Level->flags & LEVEL_SORCERER2SPECIAL) && (type == NAME_Sorcerer2))
))
;
else
@ -3122,43 +3123,43 @@ void A_BossDeath(AActor *self)
}
// victory!
if (level.flags & LEVEL_SPECKILLMONSTERS)
if (Level->flags & LEVEL_SPECKILLMONSTERS)
{ // Kill any remaining monsters
P_Massacre ();
}
if (level.flags & LEVEL_MAP07SPECIAL)
if (Level->flags & LEVEL_MAP07SPECIAL)
{
if (type == NAME_Fatso)
{
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
Level->EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
return;
}
if (type == NAME_Arachnotron)
{
EV_DoFloor (DFloor::floorRaiseByTexture, NULL, 667, 1., 0, -1, 0, false);
Level->EV_DoFloor (DFloor::floorRaiseByTexture, NULL, 667, 1., 0, -1, 0, false);
return;
}
}
else
{
switch (level.flags & LEVEL_SPECACTIONSMASK)
switch (Level->flags & LEVEL_SPECACTIONSMASK)
{
case LEVEL_SPECLOWERFLOOR:
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
Level->EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
return;
case LEVEL_SPECLOWERFLOORTOHIGHEST:
EV_DoFloor (DFloor::floorLowerToHighest, NULL, 666, 1., 0, -1, 0, false);
Level->EV_DoFloor (DFloor::floorLowerToHighest, NULL, 666, 1., 0, -1, 0, false);
return;
case LEVEL_SPECOPENDOOR:
EV_DoDoor (DDoor::doorOpen, NULL, NULL, 666, 8., 0, 0, 0);
Level->EV_DoDoor (DDoor::doorOpen, NULL, NULL, 666, 8., 0, 0, 0);
return;
}
}
// [RH] If noexit, then don't end the level.
// [RH] If noexit, then don't end the Level->
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
return;