shithub: choc

Download patch

ref: d57be3f239cc500bb600c6b9f932ae742dc2b8c7
parent: 8bbfd5b68a289ddf933f78d369606f1f22dd91c6
author: James Haley <[email protected]>
date: Wed Sep 22 14:10:40 EDT 2010

Added linetype 180 to P_ShootSpecialLine and vetted other line types.
Removed episode parameter from G_DeferedInitNew, started work on the
"Name Your Character" menu, and adjusted the temporary code in
M_ChooseSkill so that the game starts in Tarnhill rather than in the
Sanctuary.

Subversion-branch: /branches/strife-branch
Subversion-revision: 2131

--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -1730,22 +1730,22 @@
  
 
 //
-// G_InitNew
-// Can be called by the startup code or the menu task,
-// consoleplayer, displayplayer, playeringame[] should be set. 
-//
 skill_t	d_skill; 
 int     d_episode; 
 int     d_map; 
- 
-void
-G_DeferedInitNew
-( skill_t	skill,
-  int		episode,
-  int		map) 
+
+//
+// G_DeferedInitNew
+//
+// Can be called by the startup code or the menu task,
+// consoleplayer, displayplayer, playeringame[] should be set. 
+//
+// haleyjd 09/22/10: [STRIFE] Removed episode parameter
+//
+void G_DeferedInitNew(skill_t skill, int map)
 { 
     d_skill = skill; 
-    d_episode = episode; 
+    d_episode = 1; // STRIFE-TODO: no such thing as episodes.
     d_map = map; 
     gameaction = ga_newgame; 
 } 
--- a/src/strife/g_game.h
+++ b/src/strife/g_game.h
@@ -43,7 +43,8 @@
 // Can be called by the startup code or M_Responder.
 // A normal game starts at map 1,
 // but a warp test can start elsewhere
-void G_DeferedInitNew (skill_t skill, int episode, int map);
+// [STRIFE] Removed episode parameter
+void G_DeferedInitNew (skill_t skill, int map);
 
 void G_DeferedPlayDemo (char* demo);
 
--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -542,8 +542,60 @@
     }
 }
 
+//
+// M_DrawNameChar
+//
+// haleyjd 09/22/10: [STRIFE] New function
+// Handler for drawing the "Name Your Character" menu.
+//
+void M_DrawNameChar(void)
+{
+    int i;
 
+    M_WriteText(72, 28, DEH_String("Name Your Character"));
+
+    for (i = 0;i < load_end; i++)
+    {
+        M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
+        M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
+    }
+
+    if (saveStringEnter)
+    {
+        i = M_StringWidth(savegamestrings[saveSlot]); // STRIFE-TODO: verify variable
+        M_WriteText(LoadDef.x + i,LoadDef.y+LINEHEIGHT*saveSlot,"_");
+    }
+}
+
 //
+// M_DoNameChar
+//
+// haleyjd 09/22/10: [STRIFE] New function
+// Handler for items in the "Name Your Character" menu.
+//
+void M_DoNameChar(int choice)
+{
+    int map;
+
+    // STRIFE-TODO
+    // dword_9F144 = 1;
+    // ClearTmp();
+    // G_WriteSaveName(...);
+    // quickSaveSlot = v5;  // VERIFY VARIABLE
+    // SaveDef.lastOn = v5;
+    // ClearSlot();
+    // FromCurr(...);
+    
+    if(isdemoversion)
+        map = 33;
+    else
+        map = 2;
+
+    //G_DeferedInitNew(skill, map);
+    M_ClearMenus(0);
+}
+
+//
 // M_LoadGame & Cie.
 //
 void M_DrawLoad(void)
@@ -555,8 +607,8 @@
 
     for (i = 0;i < load_end; i++)
     {
-	M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
-	M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
+        M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
+        M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
     }
 }
 
@@ -568,15 +620,15 @@
 void M_DrawSaveLoadBorder(int x,int y)
 {
     int             i;
-	
+
     V_DrawPatchDirect(x - 8, y + 7,
                       W_CacheLumpName(DEH_String("M_LSLEFT"), PU_CACHE));
-	
+
     for (i = 0;i < 24;i++)
     {
-	V_DrawPatchDirect(x, y + 7,
+        V_DrawPatchDirect(x, y + 7,
                           W_CacheLumpName(DEH_String("M_LSCNTR"), PU_CACHE));
-	x += 8;
+        x += 8;
     }
 
     V_DrawPatchDirect(x, y + 7, 
@@ -591,7 +643,7 @@
 void M_LoadSelect(int choice)
 {
     char    name[256];
-	
+
     strcpy(name, P_SaveGameFile(choice));
 
     G_LoadGame (name);
@@ -605,10 +657,10 @@
 {
     if (netgame)
     {
-	M_StartMessage(DEH_String(LOADNET),NULL,false);
-	return;
+        M_StartMessage(DEH_String(LOADNET),NULL,false);
+        return;
     }
-	
+
     M_SetupNextMenu(&LoadDef);
     M_ReadSaveStrings();
 }
@@ -620,18 +672,18 @@
 void M_DrawSave(void)
 {
     int             i;
-	
+
     V_DrawPatchDirect(72, 28, W_CacheLumpName(DEH_String("M_SAVEG"), PU_CACHE));
     for (i = 0;i < load_end; i++)
     {
-	M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
-	M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
+        M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
+        M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
     }
-	
+
     if (saveStringEnter)
     {
-	i = M_StringWidth(savegamestrings[saveSlot]);
-	M_WriteText(LoadDef.x + i,LoadDef.y+LINEHEIGHT*saveSlot,"_");
+        i = M_StringWidth(savegamestrings[saveSlot]);
+        M_WriteText(LoadDef.x + i,LoadDef.y+LINEHEIGHT*saveSlot,"_");
     }
 }
 
@@ -936,7 +988,7 @@
     if (key != key_menu_confirm)
         return;
 
-    G_DeferedInitNew(nightmare,epi+1,1);
+    G_DeferedInitNew(nightmare, 1);
     M_ClearMenus (0);
 }
 */
@@ -944,7 +996,9 @@
 void M_ChooseSkill(int choice)
 {
     // haleyjd 09/07/10: Removed nightmare confirmation
-    G_DeferedInitNew(choice,epi+1,1);
+    // STRIFE-TODO: This is not done here, but on the "Name your Character" menu.
+    // I have modified the starting map to 2 until the naming menu is functional.
+    G_DeferedInitNew(choice, 2);
     M_ClearMenus (0);
 }
 
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -1399,46 +1399,54 @@
   line_t*	line )
 {
     int		ok;
-    
+
     //	Impacts that other things can activate.
     if (!thing->player)
     {
-	ok = 0;
-	switch(line->special)
-	{
-	  case 46:
-          case 182: // villsa [STRIFE] for windows
-	    // OPEN DOOR IMPACT
-	    ok = 1;
-	    break;
-	}
-	if (!ok)
-	    return;
+        ok = 0;
+        switch(line->special)
+        {
+        case 46:
+        case 182: // villsa [STRIFE] for windows
+            // OPEN DOOR IMPACT
+            ok = 1;
+            break;
+        }
+        if (!ok)
+            return;
     }
 
     switch(line->special)
     {
-      case 24:
-	// RAISE FLOOR
-	EV_DoFloor(line,raiseFloor);
-	P_ChangeSwitchTexture(line,0);
-	break;
-	
-      case 46:
-	// OPEN DOOR
-	EV_DoDoor(line,open);
-	P_ChangeSwitchTexture(line,1);
-	break;
-	
-      case 47:
-	// RAISE FLOOR NEAR AND CHANGE
-	EV_DoPlat(line,raiseToNearestAndChange,0);
-	P_ChangeSwitchTexture(line,0);
-	break;
+    case 24:
+        // RAISE FLOOR - [STRIFE] Verified unmodified
+        EV_DoFloor(line,raiseFloor);
+        P_ChangeSwitchTexture(line,0);
+        break;
 
-      case 182:
-          // villsa [STRIFE] break glass
-          P_ChangeSwitchTexture(line, 0);
+    case 46:
+        // OPEN DOOR - [STRIFE] Verified unmodified.
+        EV_DoDoor(line,open);
+        P_ChangeSwitchTexture(line,1);
+        break;
+
+    case 47: // STRIFE-TODO: plat type changed to 4 ????
+        // RAISE FLOOR NEAR AND CHANGE
+        EV_DoPlat(line,raiseToNearestAndChange,0);
+        P_ChangeSwitchTexture(line,0);
+        break;
+
+    case 180:
+        // haleyjd 09/22/10: [STRIFE] G1 Raise Floor 512 & Change
+        EV_DoFloor(line, raiseFloor512AndChange);
+        P_ChangeSwitchTexture(line, 0);
+        break;
+
+    case 182:
+        // villsa [STRIFE] G1 Break Glass
+        //   haleyjd: note that 182 is also a W1 type in P_CrossSpecialLine, but
+        //   can only be activated in that manner by an MF_MISSILE object.
+        P_ChangeSwitchTexture(line, 0);
         break;
     }
 }