summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
authorJames Haley2010-09-17 01:52:09 +0000
committerJames Haley2010-09-17 01:52:09 +0000
commit67ff06d6e49c0b7cf378ec0542896f8e99605994 (patch)
treec1dcdc5349e27487e0405f88ea204cf98406d1c0 /src/strife
parent96736b3926e90e09ad6f42e1ba9fcbdecccc7180 (diff)
downloadchocolate-doom-67ff06d6e49c0b7cf378ec0542896f8e99605994.tar.gz
chocolate-doom-67ff06d6e49c0b7cf378ec0542896f8e99605994.tar.bz2
chocolate-doom-67ff06d6e49c0b7cf378ec0542896f8e99605994.zip
Vetted all existing floor types and modified/added ones which changed.
Finished up line type 145, WR Exit Level to Spot, and added the G_RiftPlayer call to G_DoWorldDone. Subversion-branch: /branches/strife-branch Subversion-revision: 2096
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/g_game.c15
-rw-r--r--src/strife/p_floor.c366
-rw-r--r--src/strife/p_spec.c32
-rw-r--r--src/strife/p_spec.h7
4 files changed, 234 insertions, 186 deletions
diff --git a/src/strife/g_game.c b/src/strife/g_game.c
index a1a54f1c..97671a1f 100644
--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -1556,7 +1556,22 @@ void G_DoWorldDone (void)
{
gamestate = GS_LEVEL;
gamemap = destmap;
+
+ // STRIFE-TODO: hubs bullshit
+
G_DoLoadLevel ();
+
+ if(!deathmatch)
+ {
+ // STRIFE-TODO: powerup transfers etc
+
+ G_RiftPlayer();
+
+ // STRIFE-TODO:
+ // G_DoSaveGame(...);
+ // M_SaveMisObj();
+ }
+
gameaction = ga_nothing;
viewactive = true;
}
diff --git a/src/strife/p_floor.c b/src/strife/p_floor.c
index 8f434fe6..8c676452 100644
--- a/src/strife/p_floor.c
+++ b/src/strife/p_floor.c
@@ -263,189 +263,205 @@ void T_MoveFloor(floormove_t* floor)
//
// HANDLE FLOOR TYPES
//
+// haleyjd 09/16/2010: [STRIFE] Modifications to floortypes:
+// * raiseFloor24 was changed into raiseFloor64
+// * turboLower does not appear to adjust the floor height (STRIFE-TODO: verify)
+// * raiseFloor512AndChange type was added.
+//
int
EV_DoFloor
-( line_t* line,
- floor_e floortype )
+( line_t* line,
+ floor_e floortype )
{
- int secnum;
- int rtn;
- int i;
- sector_t* sec;
- floormove_t* floor;
+ int secnum;
+ int rtn;
+ int i;
+ sector_t* sec;
+ floormove_t* floor;
secnum = -1;
rtn = 0;
while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
{
- sec = &sectors[secnum];
-
- // ALREADY MOVING? IF SO, KEEP GOING...
- if (sec->specialdata)
- continue;
-
- // new floor thinker
- rtn = 1;
- floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
- P_AddThinker (&floor->thinker);
- sec->specialdata = floor;
- floor->thinker.function.acp1 = (actionf_p1) T_MoveFloor;
- floor->type = floortype;
- floor->crush = false;
-
- switch(floortype)
- {
- case lowerFloor:
- floor->direction = -1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight =
- P_FindHighestFloorSurrounding(sec);
- break;
-
- case lowerFloorToLowest:
- floor->direction = -1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight =
- P_FindLowestFloorSurrounding(sec);
- break;
-
- case turboLower:
- floor->direction = -1;
- floor->sector = sec;
- floor->speed = FLOORSPEED * 4;
- floor->floordestheight =
- P_FindHighestFloorSurrounding(sec);
- if (floor->floordestheight != sec->floorheight)
- floor->floordestheight += 8*FRACUNIT;
- break;
-
- case raiseFloorCrush:
- floor->crush = true;
- case raiseFloor:
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight =
- P_FindLowestCeilingSurrounding(sec);
- if (floor->floordestheight > sec->ceilingheight)
- floor->floordestheight = sec->ceilingheight;
- floor->floordestheight -= (8*FRACUNIT)*
- (floortype == raiseFloorCrush);
- break;
-
- case raiseFloorTurbo:
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED*4;
- floor->floordestheight =
- P_FindNextHighestFloor(sec,sec->floorheight);
- break;
-
- case raiseFloorToNearest:
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight =
- P_FindNextHighestFloor(sec,sec->floorheight);
- break;
-
- case raiseFloor24:
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight = floor->sector->floorheight +
- 24 * FRACUNIT;
- break;
- case raiseFloor512:
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight = floor->sector->floorheight +
- 512 * FRACUNIT;
- break;
-
- case raiseFloor24AndChange:
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight = floor->sector->floorheight +
- 24 * FRACUNIT;
- sec->floorpic = line->frontsector->floorpic;
- sec->special = line->frontsector->special;
- break;
-
- case raiseToTexture:
- {
- int minsize = INT_MAX;
- side_t* side;
-
- floor->direction = 1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- for (i = 0; i < sec->linecount; i++)
- {
- if (twoSided (secnum, i) )
- {
- side = getSide(secnum,i,0);
- if (side->bottomtexture >= 0)
- if (textureheight[side->bottomtexture] <
- minsize)
- minsize =
- textureheight[side->bottomtexture];
- side = getSide(secnum,i,1);
- if (side->bottomtexture >= 0)
- if (textureheight[side->bottomtexture] <
- minsize)
- minsize =
- textureheight[side->bottomtexture];
- }
- }
- floor->floordestheight =
- floor->sector->floorheight + minsize;
- }
- break;
-
- case lowerAndChange:
- floor->direction = -1;
- floor->sector = sec;
- floor->speed = FLOORSPEED;
- floor->floordestheight =
- P_FindLowestFloorSurrounding(sec);
- floor->texture = sec->floorpic;
-
- for (i = 0; i < sec->linecount; i++)
- {
- if ( twoSided(secnum, i) )
- {
- if (getSide(secnum,i,0)->sector-sectors == secnum)
- {
- sec = getSector(secnum,i,1);
-
- if (sec->floorheight == floor->floordestheight)
- {
- floor->texture = sec->floorpic;
- floor->newspecial = sec->special;
- break;
- }
- }
- else
- {
- sec = getSector(secnum,i,0);
-
- if (sec->floorheight == floor->floordestheight)
- {
- floor->texture = sec->floorpic;
- floor->newspecial = sec->special;
- break;
- }
- }
- }
- }
- default:
- break;
- }
+ sec = &sectors[secnum];
+
+ // ALREADY MOVING? IF SO, KEEP GOING...
+ if (sec->specialdata)
+ continue;
+
+ // new floor thinker
+ rtn = 1;
+ floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
+ P_AddThinker (&floor->thinker);
+ sec->specialdata = floor;
+ floor->thinker.function.acp1 = (actionf_p1) T_MoveFloor;
+ floor->type = floortype;
+ floor->crush = false;
+
+ switch(floortype)
+ {
+ case lowerFloor: // [STRIFE] verified unmodified
+ floor->direction = -1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight =
+ P_FindHighestFloorSurrounding(sec);
+ break;
+
+ case lowerFloorToLowest: // [STRIFE] verified unmodified
+ floor->direction = -1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight =
+ P_FindLowestFloorSurrounding(sec);
+ break;
+
+ case turboLower: // [STRIFE] Modified: does not += 8
+ floor->direction = -1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED * 4;
+ floor->floordestheight =
+ P_FindHighestFloorSurrounding(sec);
+ //if (floor->floordestheight != sec->floorheight)
+ // floor->floordestheight += 8*FRACUNIT;
+ break;
+
+ case raiseFloorCrush: // [STRIFE] verified unmodified
+ floor->crush = true;
+ case raiseFloor:
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight =
+ P_FindLowestCeilingSurrounding(sec);
+ if (floor->floordestheight > sec->ceilingheight)
+ floor->floordestheight = sec->ceilingheight;
+ floor->floordestheight -= (8*FRACUNIT)*
+ (floortype == raiseFloorCrush);
+ break;
+
+ case raiseFloorTurbo: // [STRIFE] verified unmodified
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED*4;
+ floor->floordestheight =
+ P_FindNextHighestFloor(sec,sec->floorheight);
+ break;
+
+ case raiseFloorToNearest: // [STRIFE] verified unmodified
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight =
+ P_FindNextHighestFloor(sec,sec->floorheight);
+ break;
+
+ case raiseFloor64: // [STRIFE] modified from raiseFloor24!
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight = floor->sector->floorheight +
+ 64 * FRACUNIT; // [STRIFE]
+ break;
+
+ case raiseFloor512: // [STRIFE] verified unmodified
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight = floor->sector->floorheight +
+ 512 * FRACUNIT;
+ break;
+
+ case raiseFloor24AndChange: // [STRIFE] verified unmodified
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight = floor->sector->floorheight +
+ 24 * FRACUNIT;
+ sec->floorpic = line->frontsector->floorpic;
+ sec->special = line->frontsector->special;
+ break;
+
+ case raiseFloor512AndChange: // [STRIFE] New floor type
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight = floor->sector->floorheight +
+ 512 * FRACUNIT;
+ sec->floorpic = line->frontsector->floorpic;
+ sec->special = line->frontsector->special;
+ break;
+
+ case raiseToTexture: // [STRIFE] verified unmodified
+ {
+ int minsize = INT_MAX;
+ side_t* side;
+
+ floor->direction = 1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ for (i = 0; i < sec->linecount; i++)
+ {
+ if (twoSided (secnum, i) )
+ {
+ side = getSide(secnum,i,0);
+ if (side->bottomtexture >= 0)
+ if (textureheight[side->bottomtexture] <
+ minsize)
+ minsize =
+ textureheight[side->bottomtexture];
+ side = getSide(secnum,i,1);
+ if (side->bottomtexture >= 0)
+ if (textureheight[side->bottomtexture] <
+ minsize)
+ minsize =
+ textureheight[side->bottomtexture];
+ }
+ }
+ floor->floordestheight =
+ floor->sector->floorheight + minsize;
+ }
+ break;
+
+ case lowerAndChange: // [STRIFE] verified unmodified
+ floor->direction = -1;
+ floor->sector = sec;
+ floor->speed = FLOORSPEED;
+ floor->floordestheight =
+ P_FindLowestFloorSurrounding(sec);
+ floor->texture = sec->floorpic;
+
+ for (i = 0; i < sec->linecount; i++)
+ {
+ if ( twoSided(secnum, i) )
+ {
+ if (getSide(secnum,i,0)->sector-sectors == secnum)
+ {
+ sec = getSector(secnum,i,1);
+
+ if (sec->floorheight == floor->floordestheight)
+ {
+ floor->texture = sec->floorpic;
+ floor->newspecial = sec->special;
+ break;
+ }
+ }
+ else
+ {
+ sec = getSector(secnum,i,0);
+
+ if (sec->floorheight == floor->floordestheight)
+ {
+ floor->texture = sec->floorpic;
+ floor->newspecial = sec->special;
+ break;
+ }
+ }
+ }
+ }
+ default:
+ break;
+ }
}
return rtn;
}
diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c
index c13450cf..467a424c 100644
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -809,8 +809,9 @@ P_CrossSpecialLine
break;
case 58:
- // Raise Floor 24
- EV_DoFloor(line,raiseFloor24);
+ // [STRIFE] raiseFloor24 was modified into raiseFloor64
+ // Raise Floor 64
+ EV_DoFloor(line,raiseFloor64);
line->special = 0;
break;
@@ -980,8 +981,9 @@ P_CrossSpecialLine
break;
case 92:
- // Raise Floor 24
- EV_DoFloor(line,raiseFloor24);
+ // [STRIFE] raiseFloor24 changed to raiseFloor64
+ // Raise Floor 64
+ EV_DoFloor(line,raiseFloor64);
break;
case 93:
@@ -1056,9 +1058,9 @@ P_CrossSpecialLine
// 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 map = line->tag / 100;
int spot = line->tag % 100;
- char msgbuf[90];
+ static char msgbuf[90];
if(thing->player->weaponowned[wp_sigil])
{
@@ -1068,7 +1070,8 @@ P_CrossSpecialLine
map = 10;
}
- DEH_snprintf(msgbuf, sizeof(msgbuf), "Entering%s", mapnames[map] + 8);
+ DEH_snprintf(msgbuf, sizeof(msgbuf), "Entering%s",
+ mapnames[map - 1] + 8);
thing->player->message = msgbuf;
if(netgame && deathmatch)
@@ -1079,11 +1082,22 @@ P_CrossSpecialLine
(levelTimeCount/TICRATE)/60);
return;
}
- // TODO: raise switch from floor.
+
+ // raise switch from floor
+ EV_DoFloor(line, raiseFloor64);
}
else
{
- // TODO: normal single player exit
+ // normal single-player exit
+
+ // BUG: Here is the opening for a flaming player to cross past
+ // the exit line and hit a deathmatch switch ;) It's not so much
+ // that this is incorrect, as that they forgot to add such a
+ // check to the other kind of exit lines too ;)
+ if(thing->player->health <= 0)
+ return;
+
+ G_RiftExitLevel(map, spot, thing->angle);
}
}
break;
diff --git a/src/strife/p_spec.h b/src/strife/p_spec.h
index 1c10287e..215c7644 100644
--- a/src/strife/p_spec.h
+++ b/src/strife/p_spec.h
@@ -579,14 +579,17 @@ typedef enum
// and change floorpic
lowerAndChange,
- raiseFloor24,
+ raiseFloor64, // [STRIFE] changed from 24 to 64
raiseFloor24AndChange,
raiseFloorCrush,
// raise to next highest floor, turbo-speed
raiseFloorTurbo,
donutRaise,
- raiseFloor512
+ raiseFloor512,
+
+ // [STRIFE] New floor type - used for the coolant reactor pit
+ raiseFloor512AndChange
} floor_e;