Skip to content

Commit

Permalink
- workaround to allow playing SW's Last Warrior mod in one go.
Browse files Browse the repository at this point in the history
This disables the boss's death in L4 ending the game and just advances to the next level.
This seems to be the intent with this mod as the second episode starting at L5 is not defined and the first episode's subtitle advertises the full game.
  • Loading branch information
coelckers committed Jul 25, 2021
1 parent 1a5a2ab commit 1fde9f2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions source/core/g_mapinfo.cpp
Expand Up @@ -645,6 +645,7 @@ MapFlagHandlers[] =
{ "sw_bossmeter_sumo", MITYPE_SETFLAGG,LEVEL_SW_BOSSMETER_SUMO, 0, GAMEFLAG_SW },
{ "sw_bossmeter_zilla", MITYPE_SETFLAGG,LEVEL_SW_BOSSMETER_ZILLA, 0, GAMEFLAG_SW },
{ "sw_deathexit_serpent", MITYPE_SETFLAGG,LEVEL_SW_DEATHEXIT_SERPENT, 0, GAMEFLAG_SW },
{ "sw_deathexit_serpent_next", MITYPE_SETFLAGG,LEVEL_SW_DEATHEXIT_SERPENT | LEVEL_SW_DEATHEXIT_SERPENT_NEXT, 0, GAMEFLAG_SW },
{ "sw_deathexit_sumo", MITYPE_SETFLAGG,LEVEL_SW_DEATHEXIT_SUMO, 0, GAMEFLAG_SW },
{ "sw_deathexit_zilla", MITYPE_SETFLAGG,LEVEL_SW_DEATHEXIT_ZILLA, 0, GAMEFLAG_SW },
{ "sw_spawnmines", MITYPE_SETFLAGG,LEVEL_SW_SPAWNMINES, 0, GAMEFLAG_SW },
Expand Down
5 changes: 5 additions & 0 deletions source/core/maphack.cpp
Expand Up @@ -38,6 +38,7 @@
#include "c_dispatch.h"
#include "md4.h"
#include "hw_sections.h"
#include "mapinfo.h"

static TArray<usermaphack_t> usermaphacks;
TArray<int> blockingpairs[MAXWALLS];
Expand Down Expand Up @@ -249,6 +250,10 @@ static int32_t LoadMapHack(const char *filename)
}
}
}
else if (sc.Compare("sw_serp_continue")) // This is a hack for SW's Last Warrior mod to continue from L4 to L5.
{
currentLevel->gameflags |= LEVEL_SW_DEATHEXIT_SERPENT_NEXT;
}

else if (sc.Compare("angleoff") || sc.Compare("angoff"))
{
Expand Down
1 change: 1 addition & 0 deletions source/core/mapinfo.cpp
Expand Up @@ -71,6 +71,7 @@ CCMD(listmaps)

MapRecord *FindMapByName(const char *nm)
{
if (!nm || !*nm) return nullptr;
for (auto& map : mapList)
{
if (map->labelName.CompareNoCase(nm) == 0)
Expand Down
3 changes: 2 additions & 1 deletion source/core/mapinfo.h
Expand Up @@ -51,8 +51,9 @@ enum EMapGameFlags
LEVEL_SW_DEATHEXIT_SERPENT = 1024,
LEVEL_SW_DEATHEXIT_SUMO = 2048,
LEVEL_SW_DEATHEXIT_ZILLA = 4096,
LEVEL_SW_DEATHEXIT_SERPENT_NEXT = 8192,

LEVEL_WT_BOSSSPAWN = 8192,
LEVEL_WT_BOSSSPAWN = 16384,


};
Expand Down
2 changes: 1 addition & 1 deletion source/games/sw/src/player.cpp
Expand Up @@ -7202,7 +7202,7 @@ domovethings(void)
{
FinishTimer = 0;
MapRecord *map = nullptr;
if (FinishAnim == ANIM_SUMO)
if (FinishAnim == ANIM_SUMO || FinishAnim == ANIM_SERP)
{
map = FindNextMap(currentLevel);
}
Expand Down
9 changes: 7 additions & 2 deletions source/games/sw/src/weapon.cpp
Expand Up @@ -5327,8 +5327,13 @@ ActorHealth(short SpriteNum, short amt)
if (u->Health < u->MaxHealth/2)
{
FinishAnim = ANIM_SERP;
ChangeLevel(nullptr, g_nextskill);
return true;
// Hack for Last Warrior which apparently needs to continue with the next level here.
if (!(currentLevel->gameflags & LEVEL_SW_DEATHEXIT_SERPENT_NEXT))
{
ChangeLevel(nullptr, g_nextskill);
return true;
}
else FinishTimer = 1;
}
}

Expand Down
@@ -0,0 +1,2 @@
// SW's Last Warrior level 4. Do not make the serpent's death end the game. The menu has no second episode so this needs to continue.
sw_serp_continue

0 comments on commit 1fde9f2

Please sign in to comment.