shithub: choc

Download patch

ref: 67ff06d6e49c0b7cf378ec0542896f8e99605994
parent: 96736b3926e90e09ad6f42e1ba9fcbdecccc7180
author: James Haley <haleyjd@hotmail.com>
date: Thu Sep 16 21:52:09 EDT 2010

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

--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -1556,7 +1556,22 @@
 {        
     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; 
 } 
--- a/src/strife/p_floor.c
+++ b/src/strife/p_floor.c
@@ -263,189 +263,205 @@
 //
 // 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;
+        sec = &sectors[secnum];
 
-	switch(floortype)
-	{
-	  case lowerFloor:
-	    floor->direction = -1;
-	    floor->sector = sec;
-	    floor->speed = FLOORSPEED;
-	    floor->floordestheight = 
-		P_FindHighestFloorSurrounding(sec);
-	    break;
+        // ALREADY MOVING?  IF SO, KEEP GOING...
+        if (sec->specialdata)
+            continue;
 
-	  case lowerFloorToLowest:
-	    floor->direction = -1;
-	    floor->sector = sec;
-	    floor->speed = FLOORSPEED;
-	    floor->floordestheight = 
-		P_FindLowestFloorSurrounding(sec);
-	    break;
+        // 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;
 
-	  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;
+        switch(floortype)
+        {
+        case lowerFloor: // [STRIFE] verified unmodified
+            floor->direction = -1;
+            floor->sector = sec;
+            floor->speed = FLOORSPEED;
+            floor->floordestheight = 
+                P_FindHighestFloorSurrounding(sec);
+            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 lowerFloorToLowest: // [STRIFE] verified unmodified
+            floor->direction = -1;
+            floor->sector = sec;
+            floor->speed = FLOORSPEED;
+            floor->floordestheight = 
+                P_FindLowestFloorSurrounding(sec);
+            break;
 
-	  case raiseFloorTurbo:
-	    floor->direction = 1;
-	    floor->sector = sec;
-	    floor->speed = FLOORSPEED*4;
-	    floor->floordestheight = 
-		P_FindNextHighestFloor(sec,sec->floorheight);
-	    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 raiseFloorToNearest:
-	    floor->direction = 1;
-	    floor->sector = sec;
-	    floor->speed = FLOORSPEED;
-	    floor->floordestheight = 
-		P_FindNextHighestFloor(sec,sec->floorheight);
-	    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 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 raiseFloorTurbo: // [STRIFE] verified unmodified
+            floor->direction = 1;
+            floor->sector = sec;
+            floor->speed = FLOORSPEED*4;
+            floor->floordestheight = 
+                P_FindNextHighestFloor(sec,sec->floorheight);
+            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 raiseFloorToNearest: // [STRIFE] verified unmodified
+            floor->direction = 1;
+            floor->sector = sec;
+            floor->speed = FLOORSPEED;
+            floor->floordestheight = 
+                P_FindNextHighestFloor(sec,sec->floorheight);
+            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;
+        case raiseFloor64: // [STRIFE] modified from raiseFloor24!
+            floor->direction = 1;
+            floor->sector = sec;
+            floor->speed = FLOORSPEED;
+            floor->floordestheight = floor->sector->floorheight + 
+                64 * FRACUNIT; // [STRIFE]
+            break;
 
-	    for (i = 0; i < sec->linecount; i++)
-	    {
-		if ( twoSided(secnum, i) )
-		{
-		    if (getSide(secnum,i,0)->sector-sectors == secnum)
-		    {
-			sec = getSector(secnum,i,1);
+        case raiseFloor512: // [STRIFE] verified unmodified
+            floor->direction = 1;
+            floor->sector = sec;
+            floor->speed = FLOORSPEED;
+            floor->floordestheight = floor->sector->floorheight +
+                512 * FRACUNIT;
+            break;
 
-			if (sec->floorheight == floor->floordestheight)
-			{
-			    floor->texture = sec->floorpic;
-			    floor->newspecial = sec->special;
-			    break;
-			}
-		    }
-		    else
-		    {
-			sec = getSector(secnum,i,0);
+        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;
 
-			if (sec->floorheight == floor->floordestheight)
-			{
-			    floor->texture = sec->floorpic;
-			    floor->newspecial = sec->special;
-			    break;
-			}
-		    }
-		}
-	    }
-	  default:
-	    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;
 }
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -809,8 +809,9 @@
         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 @@
         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 @@
         // 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 @@
                     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 @@
                                  (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;
--- a/src/strife/p_spec.h
+++ b/src/strife/p_spec.h
@@ -579,7 +579,7 @@
     //  and change floorpic
     lowerAndChange,
   
-    raiseFloor24,
+    raiseFloor64,          // [STRIFE] changed from 24 to 64
     raiseFloor24AndChange,
     raiseFloorCrush,
 
@@ -586,7 +586,10 @@
      // raise to next highest floor, turbo-speed
     raiseFloorTurbo,       
     donutRaise,
-    raiseFloor512
+    raiseFloor512,
+
+    // [STRIFE] New floor type - used for the coolant reactor pit
+    raiseFloor512AndChange
     
 } floor_e;