summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Haley2010-08-25 03:05:19 +0000
committerJames Haley2010-08-25 03:05:19 +0000
commit8f24f63be140a34c9ac19463832bed0e7fabba67 (patch)
treef9329434390f661d4d0521f7064b0eb863d208eb /src
parent22200650762b044b2f55026b91a175716d2a73f2 (diff)
downloadchocolate-doom-8f24f63be140a34c9ac19463832bed0e7fabba67.tar.gz
chocolate-doom-8f24f63be140a34c9ac19463832bed0e7fabba67.tar.bz2
chocolate-doom-8f24f63be140a34c9ac19463832bed0e7fabba67.zip
Added riftSpots and fleshed out Strife level exit behavior as far as
setting of destmap, riftdest, and riftangle (previously unknown variable dword_9F138). Added functions G_RiftExitLevel, G_RiftPlayer, and G_RiftCheat. Removed G_WorldDone and secretexit variable. Subversion-branch: /branches/strife-branch Subversion-revision: 1967
Diffstat (limited to 'src')
-rw-r--r--src/strife/doomstat.h4
-rw-r--r--src/strife/g_game.c126
-rw-r--r--src/strife/g_game.h4
-rw-r--r--src/strife/p_enemy.c4
-rw-r--r--src/strife/p_local.h1
-rw-r--r--src/strife/p_setup.c82
-rw-r--r--src/strife/p_spec.c6
-rw-r--r--src/strife/p_switch.c2
8 files changed, 171 insertions, 58 deletions
diff --git a/src/strife/doomstat.h b/src/strife/doomstat.h
index 40147833..43d90458 100644
--- a/src/strife/doomstat.h
+++ b/src/strife/doomstat.h
@@ -235,6 +235,10 @@ extern mapthing_t* deathmatch_p;
// Player spawn spots.
extern mapthing_t playerstarts[MAXPLAYERS];
+// haleyjd 08/24/10: [STRIFE] rift spots
+#define MAXRIFTSPOTS 16
+extern mapthing_t riftSpots[MAXRIFTSPOTS];
+
// Intermission stats.
// Parameters for world map / intermission.
extern wbstartstruct_t wminfo;
diff --git a/src/strife/g_game.c b/src/strife/g_game.c
index 0198f5db..5bc4bd9b 100644
--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -108,7 +108,12 @@ gamestate_t gamestate;
skill_t gameskill;
boolean respawnmonsters;
int gameepisode;
-int gamemap;
+int gamemap;
+
+// haleyjd 08/24/10: [STRIFE] New variables
+int destmap; // current destination map when exiting
+int riftdest; // destination spot for player
+angle_t riftangle; // player angle saved during exit
// If non-zero, exit the level after this number of minutes.
@@ -920,7 +925,6 @@ void G_Ticker (void)
}
// Have we just finished displaying an intermission screen?
-
// haleyjd 08/23/10: [STRIFE] No intermission.
/*
if (oldgamestate == GS_INTERMISSION && gamestate != GS_INTERMISSION)
@@ -938,7 +942,7 @@ void G_Ticker (void)
P_Ticker ();
ST_Ticker ();
AM_Ticker ();
- HU_Ticker ();
+ HU_Ticker ();
break;
// haleyjd 08/23/10: [STRIFE] No intermission.
@@ -1188,12 +1192,49 @@ void G_ScreenShot (void)
//
// G_DoCompleted
//
-boolean secretexit;
+//boolean secretexit;
extern char* pagename;
-
-void G_ExitLevel (void)
-{
- secretexit = false;
+
+//
+// G_RiftExitLevel
+//
+// haleyjd 08/24/10: [STRIFE] New function
+// * Called from some exit linedefs to exit to a specific riftspot in the
+// given destination map.
+//
+void G_RiftExitLevel(int map, int spot, angle_t angle)
+{
+ gameaction = ga_completed;
+ // STRIFE-TODO: special handling for post-Sigil map changes
+ /*
+ if(players[0].weaponowned[wp_sigil])
+ {
+ if(map == 3) // Front Base -> Abandoned Front Base
+ map = 30;
+ if(map == 7) // Castle -> New Front Base
+ map = 10;
+ }
+ */
+ // no rifting in deathmatch games
+ if(deathmatch)
+ spot = 0;
+ riftangle = angle;
+ riftdest = spot;
+ destmap = map;
+}
+
+//
+// G_ExitLevel
+//
+// haleyjd 08/24/10: [STRIFE]:
+// * Default to next map in numeric order; init destmap and riftdest.
+//
+void G_ExitLevel (int dest)
+{
+ if(dest == 0)
+ dest = gamemap + 1;
+ destmap = dest;
+ riftdest = 0;
gameaction = ga_completed;
}
@@ -1224,18 +1265,22 @@ void G_SecretExitLevel (void)
//
void G_DoCompleted (void)
{
- // STRIFE-TODO: save automap powerup state (possibly inlined from G_PlayerFinishLevel)
- // set destmap, stonecold
+ // STRIFE-TODO: save automap powerup state (possibly inlined from G_PlayerFinishLevel);
+ // set stonecold to 0
if (automapactive)
AM_Stop ();
// STRIFE-TODO: needs call to G_DoSaveGame for hubs
+ // if(!deathmatch)
+ // G_DoSaveGame(savepath2);
gameaction = ga_worlddone;
}
+// haleyjd 08/24/10: [STRIFE] No secret exits.
+/*
//
// G_WorldDone
//
@@ -1244,7 +1289,7 @@ void G_WorldDone (void)
gameaction = ga_worlddone;
if (secretexit)
- players[consoleplayer].didsecret = true;
+ players[consoleplayer].didsecret = true;
if ( gamemode == commercial )
{
@@ -1263,16 +1308,54 @@ void G_WorldDone (void)
}
}
}
-
+*/
+
+//
+// G_RiftPlayer
+//
+// haleyjd 08/24/10: [STRIFE] New function
+// Teleports the player to the appropriate rift spot.
+//
+void G_RiftPlayer(void)
+{
+ if(riftdest)
+ {
+ P_TeleportMove(players[0].mo,
+ riftSpots[riftdest - 1].x << FRACBITS,
+ riftSpots[riftdest - 1].y << FRACBITS);
+ players[0].mo->angle = riftangle;
+ players[0].mo->health = players[0].health;
+ }
+}
+
+//
+// G_RiftCheat
+//
+// haleyjd 08/24/10: [STRIFE] New function
+// Called from the cheat code to jump to a rift spot.
+//
+boolean G_RiftCheat(int riftSpotNum)
+{
+ return P_TeleportMove(players[0].mo,
+ riftSpots[riftSpotNum - 1].x << FRACBITS,
+ riftSpots[riftSpotNum - 1].y << FRACBITS);
+}
+
+//
+// G_DoWorldDone
+//
+// haleyjd 08/24/10: [STRIFE] Added destmap -> gamemap set.
+// STRIFE-TODO: Load hub save and other changes.
+//
void G_DoWorldDone (void)
{
gamestate = GS_LEVEL;
- gamemap = wminfo.next+1;
+ gamemap = destmap;
G_DoLoadLevel ();
gameaction = ga_nothing;
viewactive = true;
}
-
+
//
@@ -1450,7 +1533,12 @@ void G_DoNewGame (void)
// The sky texture to be used instead of the F_SKY1 dummy.
extern int skytexture;
-
+//
+// G_InitNew
+//
+// haleyjd 08/24/10: [STRIFE]:
+// * Added riftdest initialization
+//
void
G_InitNew
( skill_t skill,
@@ -1508,7 +1596,8 @@ G_InitNew
respawnmonsters = true;
else
respawnmonsters = false;
-
+
+ // STRIFE-TODO: (broken) Strife skill level mobjinfo/states tweaking
if (fastparm || (skill == sk_nightmare && gameskill != sk_nightmare) )
{
for (i=S_SARG_RUN1 ; i<=S_SARG_PAIN2 ; i++)
@@ -1539,6 +1628,7 @@ G_InitNew
gameepisode = episode;
gamemap = map;
gameskill = skill;
+ riftdest = 0; // haleyjd 08/24/10: [STRIFE] init riftdest to zero on new game
viewactive = true;
@@ -1552,6 +1642,7 @@ G_InitNew
// restore from a saved game. This was fixed before the Doom
// source release, but this IS the way Vanilla DOS Doom behaves.
+ // STRIFE-TODO: Strife skies (of which there are but two)
if (gamemode == commercial)
{
if (gamemap < 12)
@@ -1585,7 +1676,8 @@ G_InitNew
skytexture = R_TextureNumForName(skytexturename);
-
+ // STRIFE-TODO:
+ // G_LoadPath(gamemap)
G_DoLoadLevel ();
}
diff --git a/src/strife/g_game.h b/src/strife/g_game.h
index 03215c43..2f811dec 100644
--- a/src/strife/g_game.h
+++ b/src/strife/g_game.h
@@ -65,10 +65,10 @@ void G_PlayDemo (char* name);
void G_TimeDemo (char* name);
boolean G_CheckDemoStatus (void);
-void G_ExitLevel (void);
+void G_ExitLevel (int dest);
//void G_SecretExitLevel (void);
-void G_WorldDone (void);
+//void G_WorldDone (void);
// Read current data from inputs and build a player movement command.
diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index 10846d20..8c7d60c6 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -1766,7 +1766,7 @@ void A_BossDeath (mobj_t* mo)
}
}
- G_ExitLevel ();
+ G_ExitLevel (0);
}
@@ -1909,7 +1909,7 @@ void A_BrainExplode (mobj_t* mo)
void A_BrainDie (mobj_t* mo)
{
- G_ExitLevel ();
+ G_ExitLevel (0);
}
void A_BrainSpit (mobj_t* mo)
diff --git a/src/strife/p_local.h b/src/strife/p_local.h
index 5ffefa3a..652ff8e1 100644
--- a/src/strife/p_local.h
+++ b/src/strife/p_local.h
@@ -262,7 +262,6 @@ extern fixed_t bmaporgy; // origin of block map
extern mobj_t** blocklinks; // for thing chains
-
//
// P_INTER
//
diff --git a/src/strife/p_setup.c b/src/strife/p_setup.c
index 2a3a8f85..8a8bfd9c 100644
--- a/src/strife/p_setup.c
+++ b/src/strife/p_setup.c
@@ -114,6 +114,8 @@ mapthing_t deathmatchstarts[MAX_DEATHMATCH_STARTS];
mapthing_t* deathmatch_p;
mapthing_t playerstarts[MAXPLAYERS];
+// haleyjd 08/24/10: [STRIFE] rift spots for player spawning
+mapthing_t riftSpots[MAXRIFTSPOTS];
@@ -319,6 +321,8 @@ void P_LoadNodes (int lump)
//
// P_LoadThings
//
+// haleyjd 08/24/10: [STRIFE]:
+// * Added code to record rift spots
void P_LoadThings (int lump)
{
byte *data;
@@ -330,42 +334,56 @@ void P_LoadThings (int lump)
data = W_CacheLumpNum (lump,PU_STATIC);
numthings = W_LumpLength (lump) / sizeof(mapthing_t);
-
+
mt = (mapthing_t *)data;
for (i=0 ; i<numthings ; i++, mt++)
{
- spawn = true;
+ spawn = true;
- // Do not spawn cool, new monsters if !commercial
- if (gamemode != commercial)
- {
- switch (SHORT(mt->type))
- {
- case 68: // Arachnotron
- case 64: // Archvile
- case 88: // Boss Brain
- case 89: // Boss Shooter
- case 69: // Hell Knight
- case 67: // Mancubus
- case 71: // Pain Elemental
- case 65: // Former Human Commando
- case 66: // Revenant
- case 84: // Wolf SS
- spawn = false;
- break;
- }
- }
- if (spawn == false)
- break;
-
- // Do spawn all other stuff.
- spawnthing.x = SHORT(mt->x);
- spawnthing.y = SHORT(mt->y);
- spawnthing.angle = SHORT(mt->angle);
- spawnthing.type = SHORT(mt->type);
- spawnthing.options = SHORT(mt->options);
-
- P_SpawnMapThing(&spawnthing);
+ // Do not spawn cool, new monsters if !commercial
+ // STRIFE-TODO: replace with isregistered stuff
+ if (gamemode != commercial)
+ {
+ switch (SHORT(mt->type))
+ {
+ case 68: // Arachnotron
+ case 64: // Archvile
+ case 88: // Boss Brain
+ case 89: // Boss Shooter
+ case 69: // Hell Knight
+ case 67: // Mancubus
+ case 71: // Pain Elemental
+ case 65: // Former Human Commando
+ case 66: // Revenant
+ case 84: // Wolf SS
+ spawn = false;
+ break;
+ }
+ }
+ if (spawn == false)
+ break;
+
+ // Do spawn all other stuff.
+ spawnthing.x = SHORT(mt->x);
+ spawnthing.y = SHORT(mt->y);
+ spawnthing.angle = SHORT(mt->angle);
+ spawnthing.type = SHORT(mt->type);
+ spawnthing.options = SHORT(mt->options);
+
+ // haleyjd 08/24/2010: Special Strife checks
+ if(spawnthing.type >= 118 && spawnthing.type < 128)
+ {
+ // initialize riftSpots
+ int riftSpotNum = spawnthing.type - 118;
+ riftSpots[riftSpotNum] = spawnthing;
+ riftSpots[riftSpotNum].type = 1;
+ }
+ else if(spawnthing.type >= 9001 && spawnthing.type < 9011)
+ {
+ // STRIFE-TODO: mystery array of 90xx objects
+ }
+ else
+ P_SpawnMapThing(&spawnthing);
}
W_ReleaseLumpNum(lump);
diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c
index 13ac0c8a..46a459ea 100644
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -694,7 +694,7 @@ P_CrossSpecialLine
case 52:
// EXIT!
- G_ExitLevel ();
+ G_ExitLevel (0);
break;
case 53:
@@ -1077,7 +1077,7 @@ void P_PlayerInSpecialSector (player_t* player)
P_DamageMobj (player->mo, NULL, NULL, 20);
if (player->health <= 10)
- G_ExitLevel();
+ G_ExitLevel(0);
break;
default:
@@ -1111,7 +1111,7 @@ void P_UpdateSpecials (void)
{
levelTimeCount--;
if (!levelTimeCount)
- G_ExitLevel();
+ G_ExitLevel(0);
}
// ANIMATE FLATS AND TEXTURES GLOBALLY
diff --git a/src/strife/p_switch.c b/src/strife/p_switch.c
index 839cb912..862e1598 100644
--- a/src/strife/p_switch.c
+++ b/src/strife/p_switch.c
@@ -361,7 +361,7 @@ P_UseSpecialLine
case 11:
// Exit level
P_ChangeSwitchTexture(line,0);
- G_ExitLevel ();
+ G_ExitLevel (0);
break;
case 14: