summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Haley2010-09-16 17:33:30 +0000
committerJames Haley2010-09-16 17:33:30 +0000
commit9c7d3ca93d47193d16f51290757cd9ace1d5581c (patch)
treeda449a9886d0f174af6ac14e534d7ea9fc7e7578
parent8bc7af8cbbf6ef3c68880c05f37604a4a49db071 (diff)
downloadchocolate-doom-9c7d3ca93d47193d16f51290757cd9ace1d5581c.tar.gz
chocolate-doom-9c7d3ca93d47193d16f51290757cd9ace1d5581c.tar.bz2
chocolate-doom-9c7d3ca93d47193d16f51290757cd9ace1d5581c.zip
Started work on normal single-player exit lines.
Subversion-branch: /branches/strife-branch Subversion-revision: 2094
-rw-r--r--src/strife/hu_stuff.h4
-rw-r--r--src/strife/p_spec.c911
2 files changed, 481 insertions, 434 deletions
diff --git a/src/strife/hu_stuff.h b/src/strife/hu_stuff.h
index f6836d1e..f5a0e53b 100644
--- a/src/strife/hu_stuff.h
+++ b/src/strife/hu_stuff.h
@@ -28,7 +28,6 @@
#include "d_event.h"
-
//
// Globally visible constants.
//
@@ -64,5 +63,8 @@ void HU_Erase(void);
extern char *chat_macros[10];
extern char* pnameprefixes[][16]; // villsa [STRIFE]
+// haleyjd [STRIFE] externalized:
+extern char *mapnames[];
+
#endif
diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c
index 3b7e9602..c13450cf 100644
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -55,6 +55,9 @@
// Data.
#include "sounds.h"
+// [STRIFE]
+#include "hu_stuff.h"
+
//
// Animating textures and planes
@@ -585,471 +588,513 @@ P_FindMinSurroundingLight
//
void
P_CrossSpecialLine
-( int linenum,
- int side,
- mobj_t* thing )
+( int linenum,
+ int side,
+ mobj_t* thing )
{
- line_t* line;
- int ok;
+ line_t* line;
+ int ok;
line = &lines[linenum];
-
+
// Triggers that other things can activate
if (!thing->player)
{
- // Things that should NOT trigger specials...
- switch(thing->type)
- {
+ // Things that should NOT trigger specials...
+ switch(thing->type)
+ {
// villsa [STRIFE] unused
- //case MT_ROCKET:
- //case MT_PLASMA:
- //case MT_BFG:
- //case MT_TROOPSHOT:
- //case MT_HEADSHOT:
- //case MT_BRUISERSHOT:
- //return;
- //break;
-
- default: break;
- }
-
- ok = 0;
- switch(line->special)
- {
- case 39: // TELEPORT TRIGGER
- case 97: // TELEPORT RETRIGGER
- case 125: // TELEPORT MONSTERONLY TRIGGER
- case 126: // TELEPORT MONSTERONLY RETRIGGER
- case 4: // RAISE DOOR
- case 10: // PLAT DOWN-WAIT-UP-STAY TRIGGER
- case 88: // PLAT DOWN-WAIT-UP-STAY RETRIGGER
- ok = 1;
- break;
- }
- if (!ok)
- return;
+ //case MT_ROCKET:
+ //case MT_PLASMA:
+ //case MT_BFG:
+ //case MT_TROOPSHOT:
+ //case MT_HEADSHOT:
+ //case MT_BRUISERSHOT:
+ //return;
+ //break;
+
+ default: break;
+ }
+
+ ok = 0;
+
+ // [STRIFE] Added several line types. Removed none.
+ switch(line->special)
+ {
+ case 97: // TELEPORT RETRIGGER
+ case 185: // haleyjd: STRIFE-TODO: Identify type
+ case 195: // haleyjd: STRIFE-TODO: Identify type
+ case 231: // haleyjd: STRIFE-TODO: Identify type
+ case 125: // TELEPORT MONSTERONLY TRIGGER
+ case 126: // TELEPORT MONSTERONLY RETRIGGER
+ case 182: // haleyjd: STRIFE-TODO: Identify type
+ case 10: // PLAT DOWN-WAIT-UP-STAY TRIGGER
+ case 39: // TELEPORT TRIGGER
+ case 88: // PLAT DOWN-WAIT-UP-STAY RETRIGGER
+ case 4: // RAISE DOOR
+ ok = 1;
+ break;
+ }
+ if (!ok)
+ return;
}
// Note: could use some const's here.
switch (line->special)
{
- // TRIGGERS.
- // All from here to RETRIGGERS.
- case 2:
- // Open Door
- EV_DoDoor(line,open);
- line->special = 0;
- break;
+ // TRIGGERS.
+ // All from here to RETRIGGERS.
+ case 2:
+ // Open Door
+ EV_DoDoor(line,open);
+ line->special = 0;
+ break;
- case 3:
- // Close Door
- EV_DoDoor(line,close);
- line->special = 0;
- break;
+ case 3:
+ // Close Door
+ EV_DoDoor(line,close);
+ line->special = 0;
+ break;
- case 4:
- // Raise Door
- EV_DoDoor(line,normal);
- line->special = 0;
- break;
-
- case 5:
- // Raise Floor
- EV_DoFloor(line,raiseFloor);
- line->special = 0;
- break;
-
- case 6:
- // Fast Ceiling Crush & Raise
- EV_DoCeiling(line,fastCrushAndRaise);
- line->special = 0;
- break;
-
- case 8:
- // Build Stairs
- EV_BuildStairs(line,build8);
- line->special = 0;
- break;
-
- case 10:
- // PlatDownWaitUp
- EV_DoPlat(line,downWaitUpStay,0);
- line->special = 0;
- break;
-
- case 12:
- // Light Turn On - brightest near
- EV_LightTurnOn(line,0);
- line->special = 0;
- break;
-
- case 13:
- // Light Turn On 255
- EV_LightTurnOn(line,255);
- line->special = 0;
- break;
-
- case 16:
- // Close Door 30
- EV_DoDoor(line,close30ThenOpen);
- line->special = 0;
- break;
-
- case 17:
- // Start Light Strobing
- EV_StartLightStrobing(line);
- line->special = 0;
- break;
-
- case 19:
- // Lower Floor
- EV_DoFloor(line,lowerFloor);
- line->special = 0;
- break;
-
- case 22:
- // Raise floor to nearest height and change texture
- EV_DoPlat(line,raiseToNearestAndChange,0);
- line->special = 0;
- break;
-
- case 25:
- // Ceiling Crush and Raise
- EV_DoCeiling(line,crushAndRaise);
- line->special = 0;
- break;
-
- case 30:
- // Raise floor to shortest texture height
- // on either side of lines.
- EV_DoFloor(line,raiseToTexture);
- line->special = 0;
- break;
-
- case 35:
- // Lights Very Dark
- EV_LightTurnOn(line,35);
- line->special = 0;
- break;
-
- case 36:
- // Lower Floor (TURBO)
- EV_DoFloor(line,turboLower);
- line->special = 0;
- break;
-
- case 37:
- // LowerAndChange
- EV_DoFloor(line,lowerAndChange);
- line->special = 0;
- break;
-
- case 38:
- // Lower Floor To Lowest
- EV_DoFloor( line, lowerFloorToLowest );
- line->special = 0;
- break;
-
- case 39:
- // TELEPORT!
- EV_Teleport( line, side, thing );
- line->special = 0;
- break;
+ case 4:
+ // Raise Door
+ EV_DoDoor(line,normal);
+ line->special = 0;
+ break;
- /*case 40:
- // RaiseCeilingLowerFloor
- EV_DoCeiling( line, raiseToHighest );
- EV_DoFloor( line, lowerFloorToLowest );
- line->special = 0;
- break;*/
-
- case 44:
- // Ceiling Crush
- EV_DoCeiling( line, lowerAndCrush );
- line->special = 0;
- break;
-
- case 52:
- // EXIT!
- G_ExitLevel (0);
- break;
-
- case 53:
- // Perpetual Platform Raise
- EV_DoPlat(line,perpetualRaise,0);
- line->special = 0;
- break;
-
- case 54:
- // Platform Stop
- EV_StopPlat(line);
- line->special = 0;
- break;
+ case 5:
+ // Raise Floor
+ EV_DoFloor(line,raiseFloor);
+ line->special = 0;
+ break;
- case 56:
- // Raise Floor Crush
- EV_DoFloor(line,raiseFloorCrush);
- line->special = 0;
- break;
+ case 6:
+ // Fast Ceiling Crush & Raise
+ EV_DoCeiling(line,fastCrushAndRaise);
+ line->special = 0;
+ break;
- case 57:
- // Ceiling Crush Stop
- EV_CeilingCrushStop(line);
- line->special = 0;
- break;
-
- case 58:
- // Raise Floor 24
- EV_DoFloor(line,raiseFloor24);
- line->special = 0;
- break;
+ case 8:
+ // Build Stairs
+ EV_BuildStairs(line,build8);
+ line->special = 0;
+ break;
- case 59:
- // Raise Floor 24 And Change
- EV_DoFloor(line,raiseFloor24AndChange);
- line->special = 0;
- break;
-
- case 104:
- // Turn lights off in sector(tag)
- EV_TurnTagLightsOff(line);
- line->special = 0;
- break;
-
- case 108:
- // Blazing Door Raise (faster than TURBO!)
- EV_DoDoor (line,blazeRaise);
- line->special = 0;
- break;
-
- case 109:
- // Blazing Door Open (faster than TURBO!)
- EV_DoDoor (line,blazeOpen);
- line->special = 0;
- break;
-
- case 100:
- // Build Stairs Turbo 16
- EV_BuildStairs(line,turbo16);
- line->special = 0;
- break;
-
- case 110:
- // Blazing Door Close (faster than TURBO!)
- EV_DoDoor (line,blazeClose);
- line->special = 0;
- break;
+ case 10:
+ // PlatDownWaitUp
+ EV_DoPlat(line,downWaitUpStay,0);
+ line->special = 0;
+ break;
- case 119:
- // Raise floor to nearest surr. floor
- EV_DoFloor(line,raiseFloorToNearest);
- line->special = 0;
- break;
-
- case 121:
- // Blazing PlatDownWaitUpStay
- EV_DoPlat(line,blazeDWUS,0);
- line->special = 0;
- break;
-
- case 124:
- // Secret EXIT
- //G_SecretExitLevel ();
- break;
-
- case 125:
- // TELEPORT MonsterONLY
- if (!thing->player)
- {
- EV_Teleport( line, side, thing );
- line->special = 0;
- }
- break;
-
- case 130:
- // Raise Floor Turbo
- EV_DoFloor(line,raiseFloorTurbo);
- line->special = 0;
- break;
-
- case 141:
- // Silent Ceiling Crush & Raise
- EV_DoCeiling(line,silentCrushAndRaise);
- line->special = 0;
- break;
-
- // RETRIGGERS. All from here till end.
- case 72:
- // Ceiling Crush
- EV_DoCeiling( line, lowerAndCrush );
- break;
+ case 12:
+ // Light Turn On - brightest near
+ EV_LightTurnOn(line,0);
+ line->special = 0;
+ break;
- case 73:
- // Ceiling Crush and Raise
- EV_DoCeiling(line,crushAndRaise);
- break;
+ case 13:
+ // Light Turn On 255
+ EV_LightTurnOn(line,255);
+ line->special = 0;
+ break;
- case 74:
- // Ceiling Crush Stop
- EV_CeilingCrushStop(line);
- break;
-
- case 75:
- // Close Door
- EV_DoDoor(line,close);
- break;
-
- case 76:
- // Close Door 30
- EV_DoDoor(line,close30ThenOpen);
- break;
-
- case 77:
- // Fast Ceiling Crush & Raise
- EV_DoCeiling(line,fastCrushAndRaise);
- break;
-
- case 79:
- // Lights Very Dark
- EV_LightTurnOn(line,35);
- break;
-
- case 80:
- // Light Turn On - brightest near
- EV_LightTurnOn(line,0);
- break;
-
- case 81:
- // Light Turn On 255
- EV_LightTurnOn(line,255);
- break;
-
- case 82:
- // Lower Floor To Lowest
- EV_DoFloor( line, lowerFloorToLowest );
- break;
-
- case 83:
- // Lower Floor
- EV_DoFloor(line,lowerFloor);
- break;
+ case 16:
+ // Close Door 30
+ EV_DoDoor(line,close30ThenOpen);
+ line->special = 0;
+ break;
- case 84:
- // LowerAndChange
- EV_DoFloor(line,lowerAndChange);
- break;
+ case 17:
+ // Start Light Strobing
+ EV_StartLightStrobing(line);
+ line->special = 0;
+ break;
- case 86:
- // Open Door
- EV_DoDoor(line,open);
- break;
-
- case 87:
- // Perpetual Platform Raise
- EV_DoPlat(line,perpetualRaise,0);
- break;
-
- case 88:
- // PlatDownWaitUp
- EV_DoPlat(line,downWaitUpStay,0);
- break;
-
- case 89:
- // Platform Stop
- EV_StopPlat(line);
- break;
-
- case 90:
- // Raise Door
- EV_DoDoor(line,normal);
- break;
-
- case 91:
- // Raise Floor
- EV_DoFloor(line,raiseFloor);
- break;
-
- case 92:
- // Raise Floor 24
- EV_DoFloor(line,raiseFloor24);
- break;
-
- case 93:
- // Raise Floor 24 And Change
- EV_DoFloor(line,raiseFloor24AndChange);
- break;
-
- case 94:
- // Raise Floor Crush
- EV_DoFloor(line,raiseFloorCrush);
- break;
-
- case 95:
- // Raise floor to nearest height
- // and change texture.
- EV_DoPlat(line,raiseToNearestAndChange,0);
- break;
-
- case 96:
- // Raise floor to shortest texture height
- // on either side of lines.
- EV_DoFloor(line,raiseToTexture);
- break;
-
- case 97:
- // TELEPORT!
- EV_Teleport( line, side, thing );
- break;
-
- case 98:
- // Lower Floor (TURBO)
- EV_DoFloor(line,turboLower);
- break;
+ case 19:
+ // Lower Floor
+ EV_DoFloor(line,lowerFloor);
+ line->special = 0;
+ break;
- case 105:
- // Blazing Door Raise (faster than TURBO!)
- EV_DoDoor (line,blazeRaise);
- break;
-
- case 106:
- // Blazing Door Open (faster than TURBO!)
- EV_DoDoor (line,blazeOpen);
- break;
+ case 22:
+ // Raise floor to nearest height and change texture
+ EV_DoPlat(line,raiseToNearestAndChange,0);
+ line->special = 0;
+ break;
- case 107:
- // Blazing Door Close (faster than TURBO!)
- EV_DoDoor (line,blazeClose);
- break;
+ case 25:
+ // Ceiling Crush and Raise
+ EV_DoCeiling(line,crushAndRaise);
+ line->special = 0;
+ break;
- case 120:
- // Blazing PlatDownWaitUpStay.
- EV_DoPlat(line,blazeDWUS,0);
- break;
-
- case 126:
- // TELEPORT MonsterONLY.
- if (!thing->player)
- EV_Teleport( line, side, thing );
- break;
-
- case 128:
- // Raise To Nearest Floor
- EV_DoFloor(line,raiseFloorToNearest);
- break;
-
- case 129:
- // Raise Floor Turbo
- EV_DoFloor(line,raiseFloorTurbo);
- break;
+ case 30:
+ // Raise floor to shortest texture height
+ // on either side of lines.
+ EV_DoFloor(line,raiseToTexture);
+ line->special = 0;
+ break;
+
+ case 35:
+ // Lights Very Dark
+ EV_LightTurnOn(line,35);
+ line->special = 0;
+ break;
+
+ case 36:
+ // Lower Floor (TURBO)
+ EV_DoFloor(line,turboLower);
+ line->special = 0;
+ break;
+
+ case 37:
+ // LowerAndChange
+ EV_DoFloor(line,lowerAndChange);
+ line->special = 0;
+ break;
+
+ case 38:
+ // Lower Floor To Lowest
+ EV_DoFloor( line, lowerFloorToLowest );
+ line->special = 0;
+ break;
+
+ case 39:
+ // TELEPORT!
+ EV_Teleport( line, side, thing );
+ line->special = 0;
+ break;
+
+ /*case 40:
+ // RaiseCeilingLowerFloor
+ EV_DoCeiling( line, raiseToHighest );
+ EV_DoFloor( line, lowerFloorToLowest );
+ line->special = 0;
+ break;*/
+
+ case 44:
+ // Ceiling Crush
+ EV_DoCeiling( line, lowerAndCrush );
+ line->special = 0;
+ break;
+
+ case 52:
+ // EXIT!
+ G_ExitLevel (0);
+ break;
+
+ case 53:
+ // Perpetual Platform Raise
+ EV_DoPlat(line,perpetualRaise,0);
+ line->special = 0;
+ break;
+
+ case 54:
+ // Platform Stop
+ EV_StopPlat(line);
+ line->special = 0;
+ break;
+
+ case 56:
+ // Raise Floor Crush
+ EV_DoFloor(line,raiseFloorCrush);
+ line->special = 0;
+ break;
+
+ case 57:
+ // Ceiling Crush Stop
+ EV_CeilingCrushStop(line);
+ line->special = 0;
+ break;
+
+ case 58:
+ // Raise Floor 24
+ EV_DoFloor(line,raiseFloor24);
+ line->special = 0;
+ break;
+
+ case 59:
+ // Raise Floor 24 And Change
+ EV_DoFloor(line,raiseFloor24AndChange);
+ line->special = 0;
+ break;
+
+ case 104:
+ // Turn lights off in sector(tag)
+ EV_TurnTagLightsOff(line);
+ line->special = 0;
+ break;
+
+ case 108:
+ // Blazing Door Raise (faster than TURBO!)
+ EV_DoDoor (line,blazeRaise);
+ line->special = 0;
+ break;
+
+ case 109:
+ // Blazing Door Open (faster than TURBO!)
+ EV_DoDoor (line,blazeOpen);
+ line->special = 0;
+ break;
+
+ case 100:
+ // Build Stairs Turbo 16
+ EV_BuildStairs(line,turbo16);
+ line->special = 0;
+ break;
+
+ case 110:
+ // Blazing Door Close (faster than TURBO!)
+ EV_DoDoor (line,blazeClose);
+ line->special = 0;
+ break;
+
+ case 119:
+ // Raise floor to nearest surr. floor
+ EV_DoFloor(line,raiseFloorToNearest);
+ line->special = 0;
+ break;
+
+ case 121:
+ // Blazing PlatDownWaitUpStay
+ EV_DoPlat(line,blazeDWUS,0);
+ line->special = 0;
+ break;
+
+ case 124:
+ // Secret EXIT
+ //G_SecretExitLevel ();
+ break;
+
+ case 125:
+ // TELEPORT MonsterONLY
+ if (!thing->player)
+ {
+ EV_Teleport( line, side, thing );
+ line->special = 0;
+ }
+ break;
+
+ case 130:
+ // Raise Floor Turbo
+ EV_DoFloor(line,raiseFloorTurbo);
+ line->special = 0;
+ break;
+
+ case 141:
+ // Silent Ceiling Crush & Raise
+ EV_DoCeiling(line,silentCrushAndRaise);
+ line->special = 0;
+ break;
+
+ // RETRIGGERS. All from here till end.
+ case 72:
+ // Ceiling Crush
+ EV_DoCeiling( line, lowerAndCrush );
+ break;
+
+ case 73:
+ // Ceiling Crush and Raise
+ EV_DoCeiling(line,crushAndRaise);
+ break;
+
+ case 74:
+ // Ceiling Crush Stop
+ EV_CeilingCrushStop(line);
+ break;
+
+ case 75:
+ // Close Door
+ EV_DoDoor(line,close);
+ break;
+
+ case 76:
+ // Close Door 30
+ EV_DoDoor(line,close30ThenOpen);
+ break;
+
+ case 77:
+ // Fast Ceiling Crush & Raise
+ EV_DoCeiling(line,fastCrushAndRaise);
+ break;
+
+ case 79:
+ // Lights Very Dark
+ EV_LightTurnOn(line,35);
+ break;
+
+ case 80:
+ // Light Turn On - brightest near
+ EV_LightTurnOn(line,0);
+ break;
+
+ case 81:
+ // Light Turn On 255
+ EV_LightTurnOn(line,255);
+ break;
+
+ case 82:
+ // Lower Floor To Lowest
+ EV_DoFloor( line, lowerFloorToLowest );
+ break;
+
+ case 83:
+ // Lower Floor
+ EV_DoFloor(line,lowerFloor);
+ break;
+
+ case 84:
+ // LowerAndChange
+ EV_DoFloor(line,lowerAndChange);
+ break;
+
+ case 86:
+ // Open Door
+ EV_DoDoor(line,open);
+ break;
+
+ case 87:
+ // Perpetual Platform Raise
+ EV_DoPlat(line,perpetualRaise,0);
+ break;
+
+ case 88:
+ // PlatDownWaitUp
+ EV_DoPlat(line,downWaitUpStay,0);
+ break;
+
+ case 89:
+ // Platform Stop
+ EV_StopPlat(line);
+ break;
+
+ case 90:
+ // Raise Door
+ EV_DoDoor(line,normal);
+ break;
+
+ case 91:
+ // Raise Floor
+ EV_DoFloor(line,raiseFloor);
+ break;
+
+ case 92:
+ // Raise Floor 24
+ EV_DoFloor(line,raiseFloor24);
+ break;
+
+ case 93:
+ // Raise Floor 24 And Change
+ EV_DoFloor(line,raiseFloor24AndChange);
+ break;
+
+ case 94:
+ // Raise Floor Crush
+ EV_DoFloor(line,raiseFloorCrush);
+ break;
+
+ case 95:
+ // Raise floor to nearest height
+ // and change texture.
+ EV_DoPlat(line,raiseToNearestAndChange,0);
+ break;
+
+ case 96:
+ // Raise floor to shortest texture height
+ // on either side of lines.
+ EV_DoFloor(line,raiseToTexture);
+ break;
+
+ case 97:
+ // TELEPORT!
+ EV_Teleport( line, side, thing );
+ break;
+
+ case 98:
+ // Lower Floor (TURBO)
+ EV_DoFloor(line,turboLower);
+ break;
+
+ case 105:
+ // Blazing Door Raise (faster than TURBO!)
+ EV_DoDoor (line,blazeRaise);
+ break;
+
+ case 106:
+ // Blazing Door Open (faster than TURBO!)
+ EV_DoDoor (line,blazeOpen);
+ break;
+
+ case 107:
+ // Blazing Door Close (faster than TURBO!)
+ EV_DoDoor (line,blazeClose);
+ break;
+
+ case 120:
+ // Blazing PlatDownWaitUpStay.
+ EV_DoPlat(line,blazeDWUS,0);
+ break;
+
+ case 126:
+ // TELEPORT MonsterONLY.
+ if (!thing->player)
+ EV_Teleport( line, side, thing );
+ break;
+
+ case 128:
+ // Raise To Nearest Floor
+ EV_DoFloor(line,raiseFloorToNearest);
+ break;
+
+ case 129:
+ // Raise Floor Turbo
+ EV_DoFloor(line,raiseFloorTurbo);
+ break;
+
+ case 145:
+ // haleyjd [STRIFE] Exit Level to Spot
+ thing->momx = thing->momy = thing->momz = 0;
+ {
+ int map = line->tag / 100; // seems to be wrong, double-check later...
+ int spot = line->tag % 100;
+ char msgbuf[90];
+
+ if(thing->player->weaponowned[wp_sigil])
+ {
+ if(map == 3)
+ map = 30;
+ else if(map == 7)
+ map = 10;
+ }
+
+ DEH_snprintf(msgbuf, sizeof(msgbuf), "Entering%s", mapnames[map] + 8);
+ thing->player->message = msgbuf;
+
+ if(netgame && deathmatch)
+ {
+ if(levelTimer && levelTimeCount != 0)
+ {
+ DEH_snprintf(msgbuf, sizeof(msgbuf), "%d min left",
+ (levelTimeCount/TICRATE)/60);
+ return;
+ }
+ // TODO: raise switch from floor.
+ }
+ else
+ {
+ // TODO: normal single player exit
+ }
+ }
+ break;
- case 174:
- // villsa [STRIFE] Split Open
+ case 174:
+ // villsa [STRIFE] Split Open
EV_DoDoor(line, splitOpen);
line->special = 0;
break;
- case 183:
+ case 183:
// villsa [STRIFE] Split Raise Nearest
EV_DoDoor(line, splitRaiseNearest);
line->special = 0;