shithub: choc

Download patch

ref: 7298899199a5bb750c66c4b52227e9e979f8d260
parent: 2016bb4f4b3c00b6d037727d0a5f4e7e6847fc0b
author: James Haley <haleyjd@hotmail.com>
date: Sun Sep 12 23:27:49 EDT 2010

Started finale slideshow stuff, added/tweaked quest flags, and did some
elimination of tabs in altered functions. Also refactored a few strings
to use DEH_String.

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

--- a/src/strife/doomdef.h
+++ b/src/strife/doomdef.h
@@ -199,10 +199,10 @@
 } powertype_t;
 
 // villsa [STRIFE]
-// quest flags
+// quest numbers
 typedef enum
 {
-    tk_quest1 = 1,
+    tk_quest1,
     tk_quest2,
     tk_quest3,
     tk_quest4,
@@ -233,10 +233,49 @@
     tk_quest29,
     tk_quest30,
     tk_quest31,
-    tk_quest32,
-    NUMQUESTS,
-    tk_allquests = 0x7fffffff
+    tk_quest32,   // most likely unused
+    tk_numquests,
 } questtype_t;
+
+// haleyjd 09/12/10: [STRIFE]
+// flag values for each quest.
+enum
+{
+    QF_QUEST1  = (1 << tk_quest1),
+    QF_QUEST2  = (1 << tk_quest2),
+    QF_QUEST3  = (1 << tk_quest3), 
+    QF_QUEST4  = (1 << tk_quest4),
+    QF_QUEST5  = (1 << tk_quest5),
+    QF_QUEST6  = (1 << tk_quest6),
+    QF_QUEST7  = (1 << tk_quest7),
+    QF_QUEST8  = (1 << tk_quest8),
+    QF_QUEST9  = (1 << tk_quest9),
+    QF_QUEST10 = (1 << tk_quest10),
+    QF_QUEST11 = (1 << tk_quest11),
+    QF_QUEST12 = (1 << tk_quest12),
+    QF_QUEST13 = (1 << tk_quest13),
+    QF_QUEST14 = (1 << tk_quest14),
+    QF_QUEST15 = (1 << tk_quest15),
+    QF_QUEST16 = (1 << tk_quest16),
+    QF_QUEST17 = (1 << tk_quest17),
+    QF_QUEST18 = (1 << tk_quest18),
+    QF_QUEST19 = (1 << tk_quest19),
+    QF_QUEST20 = (1 << tk_quest20),
+    QF_QUEST21 = (1 << tk_quest21),
+    QF_QUEST22 = (1 << tk_quest22),
+    QF_QUEST23 = (1 << tk_quest23),
+    QF_QUEST24 = (1 << tk_quest24),
+    QF_QUEST25 = (1 << tk_quest25),
+    QF_QUEST26 = (1 << tk_quest26),
+    QF_QUEST27 = (1 << tk_quest27),
+    QF_QUEST28 = (1 << tk_quest28),
+    QF_QUEST29 = (1 << tk_quest29),
+    QF_QUEST30 = (1 << tk_quest30),
+    QF_QUEST31 = (1 << tk_quest31),
+    QF_QUEST32 = (1 << tk_quest32), // note seems to be unused
+    
+    QF_ALLQUESTS  = (QF_QUEST31 + (QF_QUEST31 - 1)) // does not include bit 32!
+};
 
 //
 // Power up durations,
--- a/src/strife/f_finale.c
+++ b/src/strife/f_finale.c
@@ -62,6 +62,11 @@
 
 unsigned int finalecount;
 
+// haleyjd 09/12/10: [STRIFE] Slideshow variables
+char *slideshow_panel;
+int   slideshow_tics;
+int   slideshow_state;
+
 #define	TEXTSPEED	3
 #define	TEXTWAIT	250
 
@@ -115,6 +120,7 @@
 //
 void F_StartFinale (void)
 {
+    patch_t *panel;
     size_t i;
 
     gameaction = ga_nothing;
@@ -121,15 +127,38 @@
     gamestate = GS_FINALE;
     viewactive = false;
     automapactive = false;
+    wipegamestate = -1; // [STRIFE]
 
-    if (gamemission == doom)
+    // [STRIFE] Setup the slide show
+    slideshow_panel = DEH_String("PANEL0");
+
+    panel = (patch_t *)W_CacheLumpName(slideshow_panel, PU_CACHE);
+    V_DrawPatch(0, 0, panel);
+
+    // haleyjd: NOT FINISHED
+#if 0
+    switch(gamemap)
     {
-        S_ChangeMusic(mus_logo, true);  // villsa [STRIFE] TODO - fix music
+    case 3:
+        slideshow_state = 1;
+        break;
+    case 9:
+        slideshow_state = -99;
+        break;
+    case 10:
+        slideshow_state = 5;
+        break;
+    case 29:
+        if(!netgame)
+        {
+            if(players[0].health < 0)
+                slideshow_state = 17;
+            else
+            {
+            }
+        }
     }
-    else
-    {
-        S_ChangeMusic(mus_logo, true);  // villsa [STRIFE] TODO - fix music
-    }
+#endif
 
     // Find the right screen and set the text and background
 
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -594,7 +594,7 @@
         // [STRIFE] TODO - verify this. Seems that questflag isn't
         // applied if the special's speed is equal to 8 or if
         // the player has recieved a specific quest token
-        if(special->info->speed != 8 || !(player->questflags & 32))
+        if(special->info->speed != 8 || !(player->questflags & QF_QUEST6))
             player->questflags |= 1 << (special->info->speed - 1);
     }
 
@@ -623,7 +623,7 @@
     mobj_t*     mo;
     line_t      junk;
     int         i;
-	
+
     // villsa [STRIFE] corpse and dropoff are removed, but why when these two flags
     // are set a few lines later? watcom nonsense perhaps?
     target->flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_BOUNCE|MF_CORPSE|MF_DROPOFF);
@@ -630,7 +630,7 @@
 
     // villsa [STRIFE] unused
     /*if (target->type != MT_SKULL)
-	target->flags &= ~MF_NOGRAVITY;*/
+        target->flags &= ~MF_NOGRAVITY;*/
 
     target->flags |= MF_CORPSE|MF_DROPOFF;
     target->height = FRACUNIT;  // villsa [STRIFE] set to fracunit instead of >>= 2
@@ -637,18 +637,18 @@
 
     if(source && source->player)
     {
-	// count for intermission
-	if(target->flags & MF_COUNTKILL)
-	    source->player->killcount++;	
+        // count for intermission
+        if(target->flags & MF_COUNTKILL)
+            source->player->killcount++;	
 
-	if(target->player)
+        if(target->player)
         {
-	    source->player->frags[target->player-players]++;
+            source->player->frags[target->player-players]++;
 
             // villsa [STRIFE] new messages when fragging players
-            sprintf(plrkilledmsg, "%s killed %s",
-                pnameprefixes[source->player->mo->miscdata],
-                pnameprefixes[target->player->mo->miscdata]);
+            sprintf(plrkilledmsg, DEH_String("%s killed %s"),
+                    pnameprefixes[source->player->mo->miscdata],
+                    pnameprefixes[target->player->mo->miscdata]);
 
             if(netgame)
                 players[consoleplayer].message = plrkilledmsg;
@@ -656,16 +656,16 @@
     }
     else if(!netgame && (target->flags & MF_COUNTKILL))
     {
-	// count all monster deaths,
-	// even those caused by other monsters
-	players[0].killcount++;
+        // count all monster deaths,
+        // even those caused by other monsters
+        players[0].killcount++;
     }
     
     if(target->player)
     {
-	// count environment kills against you
-	if(!source)	
-	    target->player->frags[target->player-players]++;
+        // count environment kills against you
+        if(!source)
+            target->player->frags[target->player-players]++;
 
         if(gamemap == 29 && !netgame)
         {
@@ -689,7 +689,8 @@
                 item = target->player->inventory[0].type;
                 if(item == MT_MONY_1)
                 {
-                    loot = P_SpawnMobj(target->x, target->y, target->z + (24*FRACUNIT), MT_MONY_25);
+                    loot = P_SpawnMobj(target->x, target->y, 
+                                       target->z + (24*FRACUNIT), MT_MONY_25);
 
                     // [STRIFE] TODO - what the hell is it doing here?
                     loot->health = target->player->inventory[0].amount;
@@ -699,7 +700,8 @@
                 }
                 else
                 {
-                    loot = P_SpawnMobj(target->x, target->y, target->z + (24*FRACUNIT), item);
+                    loot = P_SpawnMobj(target->x, target->y, 
+                                       target->z + (24*FRACUNIT), item);
                     amount = 1;
                 }
 
@@ -710,20 +712,20 @@
                 loot->flags |= MF_DROPPED;
             }
         }
-			
-	target->flags &= ~MF_SOLID;
-	target->player->playerstate = PST_DEAD;
+
+        target->flags &= ~MF_SOLID;
+        target->player->playerstate = PST_DEAD;
         target->player->mo->momz = (5*FRACUNIT);
-	P_DropWeapon(target->player);
+        P_DropWeapon(target->player);
 
-	if(target->player == &players[consoleplayer]
-	    && automapactive)
-	{
-	    // don't die in auto map,
-	    // switch view prior to dying
-	    AM_Stop ();
-	}
-	
+        if(target->player == &players[consoleplayer]
+           && automapactive)
+        {
+            // don't die in auto map,
+            // switch view prior to dying
+            AM_Stop ();
+        }
+
     }
 
     // villsa [STRIFE] some modifications to setting states
@@ -744,7 +746,7 @@
     // villsa [STRIFE] unused
     /*target->tics -= P_Random()&3;
     if (target->tics < 1)
-	target->tics = 1;*/
+        target->tics = 1;*/
 
     // Drop stuff.
     // villsa [STRIFE] get item from dialog target
@@ -809,11 +811,11 @@
             junk.tag = 44;
             EV_DoFloor(&junk, lowerFloor);
 
-            I_StartVoice("VOC13");
-            if(W_CheckNumForName("LOG13") != -1)
+            I_StartVoice(DEH_String("VOC13"));
+            if(W_CheckNumForName(DEH_String("LOG13")) != -1)
             {
                 strncpy(mission_objective,
-                    W_CacheLumpName("LOG13", PU_CACHE), OBJECTIVE_LEN);
+                    W_CacheLumpName(DEH_String("LOG13"), PU_CACHE), OBJECTIVE_LEN);
             }
             item = MT_COUPLING_BROKEN;
             players[0].questflags |= (1 << (mobjinfo[MT_COUPLING].speed - 1));
@@ -832,7 +834,7 @@
         EV_DoDoor(&junk, close);
         P_NoiseAlert(players[0].mo, players[0].mo);
 
-        sprintf(plrkilledmsg, "You're dead!  You set off the alarm.");
+        sprintf(plrkilledmsg, "%s", DEH_String("You're dead!  You set off the alarm."));
         if(!deathmatch)
             players[consoleplayer].message = plrkilledmsg;
 
@@ -869,7 +871,7 @@
     case MT_TOKEN_ALARM:
         P_NoiseAlert(players[0].mo, players[0].mo);
 
-        sprintf(plrkilledmsg, "You Fool!  You've set off the alarm");
+        sprintf(plrkilledmsg, "%s", DEH_String("You Fool!  You've set off the alarm"));
         if(!deathmatch)
             players[consoleplayer].message = plrkilledmsg;
         return;
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -809,7 +809,7 @@
     if(deathmatch)
     {
         p->accuracy = 50;
-        p->questflags = tk_allquests;
+        p->questflags = QF_ALLQUESTS; // 0x7fffffff
 
         /*for(i = 0; i < NUMCARDS; i++)
             p->cards[i] = true;*/
--- a/src/strife/p_switch.c
+++ b/src/strife/p_switch.c
@@ -255,7 +255,7 @@
     texTop = sides[line->sidenum[0]].toptexture;
     texMid = sides[line->sidenum[0]].midtexture;
     texBot = sides[line->sidenum[0]].bottomtexture;
-	
+
     sound = sfx_swtchn;
 
     // EXIT SWITCH?
@@ -278,46 +278,46 @@
     }
 
     if(!useAgain)
-	line->special = 0;
-	
+        line->special = 0;
+
     for(i = 0; i < numswitches*2; i++)
     {
         sl = &alphSwitchList[i / 2]; // villsa [STRIFE]
 
-	if(switchlist[i] == texTop)
-	{
+        if(switchlist[i] == texTop)
+        {
             // villsa [STRIFE] set sound
             if(sl->sound)
                 sound = sl->sound;
 
-	    S_StartSound(buttonlist->soundorg,sound);
-	    sides[line->sidenum[0]].toptexture = switchlist[i^1];
+            S_StartSound(buttonlist->soundorg,sound);
+            sides[line->sidenum[0]].toptexture = switchlist[i^1];
 
-	    if(useAgain)
-		P_StartButton(line,top,switchlist[i],BUTTONTIME);
+            if(useAgain)
+                P_StartButton(line,top,switchlist[i],BUTTONTIME);
 
             if(breakglass)
                 P_SpawnBrokenGlass(line);
 
-	    return;
-	}
-	else
-	{
-	    if(switchlist[i] == texMid)
-	    {
+            return;
+        }
+        else
+        {
+            if(switchlist[i] == texMid)
+            {
                 // villsa [STRIFE] set sound
                 if(sl->sound)
                     sound = sl->sound;
 
-		S_StartSound(buttonlist->soundorg,sound);
-		sides[line->sidenum[0]].midtexture = switchlist[i^1];
+                S_StartSound(buttonlist->soundorg,sound);
+                sides[line->sidenum[0]].midtexture = switchlist[i^1];
 
                 // villsa [STRIFE] affect second side of line
                 if(line->flags & ML_TWOSIDED)
                     sides[line->sidenum[1]].midtexture = switchlist[i^1];
 
-		if(useAgain)
-		    P_StartButton(line, middle,switchlist[i],BUTTONTIME);
+                if(useAgain)
+                    P_StartButton(line, middle,switchlist[i],BUTTONTIME);
 
                 // villsa [STRIFE]
                 if(sound == sfx_firxpl)
@@ -324,8 +324,8 @@
                 {
                     breakglass = true;
 
-                    // give quest token #28 to player
-                    players[0].questflags |= (1 << tk_quest28);
+                    // give quest flag 29 to player
+                    players[0].questflags |= QF_QUEST29;
 
                     // give stamina/accuracy items
                     if(!netgame)
@@ -340,29 +340,29 @@
                 if(breakglass || sound == sfx_bglass)
                     P_SpawnBrokenGlass(line);
 
-		return;
-	    }
-	    else
-	    {
-		if(switchlist[i] == texBot)
-		{
+                return;
+            }
+            else
+            {
+                if(switchlist[i] == texBot)
+                {
                     // villsa [STRIFE] set sound
                     if(sl->sound)
                         sound = sl->sound;
 
-		    S_StartSound(buttonlist->soundorg,sound);
-		    sides[line->sidenum[0]].bottomtexture = switchlist[i^1];
+                    S_StartSound(buttonlist->soundorg,sound);
+                    sides[line->sidenum[0]].bottomtexture = switchlist[i^1];
 
-		    if(useAgain)
-			P_StartButton(line, bottom,switchlist[i],BUTTONTIME);
+                    if(useAgain)
+                        P_StartButton(line, bottom,switchlist[i],BUTTONTIME);
 
                     if(breakglass)
                         P_SpawnBrokenGlass(line);
 
-		    return;
-		}
-	    }
-	}
+                    return;
+                }
+            }
+        }
     }
 }
 
--- a/src/strife/p_user.c
+++ b/src/strife/p_user.c
@@ -312,43 +312,43 @@
 {
     ticcmd_t*		cmd;
     weapontype_t	newweapon;
-	
+
     // fixme: do this in the cheat code
     // villsa [STRIFE] TODO - verify if unused
     if (player->cheats & CF_NOCLIP)
-	player->mo->flags |= MF_NOCLIP;
+        player->mo->flags |= MF_NOCLIP;
     else
-	player->mo->flags &= ~MF_NOCLIP;
-    
+        player->mo->flags &= ~MF_NOCLIP;
+
     // chain saw run forward
     cmd = &player->cmd;
     if (player->mo->flags & MF_JUSTATTACKED)
     {
-	cmd->angleturn = 0;
-	cmd->forwardmove = 0xc800/512;
-	cmd->sidemove = 0;
-	player->mo->flags &= ~MF_JUSTATTACKED;
+        cmd->angleturn = 0;
+        cmd->forwardmove = 0xc800/512;
+        cmd->sidemove = 0;
+        player->mo->flags &= ~MF_JUSTATTACKED;
     }
-			
-	
+
+
     if (player->playerstate == PST_DEAD)
     {
-	P_DeathThink (player);
-	return;
+        P_DeathThink (player);
+        return;
     }
-    
+
     // Move around.
     // Reactiontime is used to prevent movement
     //  for a bit after a teleport.
     if (player->mo->reactiontime)
-	player->mo->reactiontime--;
+        player->mo->reactiontime--;
     else
-	P_MovePlayer (player);
-    
+        P_MovePlayer (player);
+
     P_CalcHeight (player);
 
     if (player->mo->subsector->sector->special)
-	P_PlayerInSpecialSector (player);
+        P_PlayerInSpecialSector (player);
 
     // villsa [STRIFE] handle inventory input
     if(!player->inventorydown)
@@ -364,19 +364,19 @@
             // villsa [STRIFE] TODO - add workparm variable
             /*if(workparm)
             {
-                int cheat = player->cheats ^ 1;
-                player->cheats ^= CF_NOCLIP;
+            int cheat = player->cheats ^ 1;
+            player->cheats ^= CF_NOCLIP;
 
-                if(cheat & CF_NOCLIP)
-                {
-                    player->message = "No Clipping Mode ON";
-                    player->mo->flags |= MF_NOCLIP;
-                }
-                else
-                {
-                    player->mo->flags &= ~MF_NOCLIP;
-                    player->message = "No Clipping Mode OFF";
-                }
+            if(cheat & CF_NOCLIP)
+            {
+            player->message = "No Clipping Mode ON";
+            player->mo->flags |= MF_NOCLIP;
+            }
+            else
+            {
+            player->mo->flags &= ~MF_NOCLIP;
+            player->message = "No Clipping Mode OFF";
+            }
             }*/
 
         }
@@ -385,75 +385,75 @@
     }
     else
         player->inventorydown = false;
-    
+
     // Check for weapon change.
 
     // A special event has no other buttons.
     if (cmd->buttons & BT_SPECIAL)
-	cmd->buttons = 0;			
-		
+        cmd->buttons = 0;			
+
     if (cmd->buttons & BT_CHANGE)
     {
-	// The actual changing of the weapon is done
-	//  when the weapon psprite can do it
-	//  (read: not in the middle of an attack).
-	newweapon = (cmd->buttons&BT_WEAPONMASK)>>BT_WEAPONSHIFT;
+        // The actual changing of the weapon is done
+        //  when the weapon psprite can do it
+        //  (read: not in the middle of an attack).
+        newweapon = (cmd->buttons&BT_WEAPONMASK)>>BT_WEAPONSHIFT;
 
         // villsa [STRIFE] TODO - placeholder
         if (player->weaponowned[newweapon]
-	    && newweapon != player->readyweapon)
-	{
+        && newweapon != player->readyweapon)
+        {
             player->pendingweapon = newweapon;
-	}
-	
+        }
+
         // villsa [STRIFE] TODO - MUST FIX!!!
-	/*if (newweapon == wp_fist
-	    && player->weaponowned[wp_chainsaw]
-	    && !(player->readyweapon == wp_chainsaw
-		 && player->powers[pw_strength]))
-	{
-	    newweapon = wp_chainsaw;
-	}
-	
-	if ( (gamemode == commercial)
-	    && newweapon == wp_shotgun 
-	    && player->weaponowned[wp_supershotgun]
-	    && player->readyweapon != wp_supershotgun)
-	{
-	    newweapon = wp_supershotgun;
-	}
-	
+        /*if (newweapon == wp_fist
+        && player->weaponowned[wp_chainsaw]
+        && !(player->readyweapon == wp_chainsaw
+        && player->powers[pw_strength]))
+        {
+        newweapon = wp_chainsaw;
+        }
 
-	if (player->weaponowned[newweapon]
-	    && newweapon != player->readyweapon)
-	{
-	    // Do not go to plasma or BFG in shareware,
-	    //  even if cheated.
-	    if ((newweapon != wp_plasma
-		 && newweapon != wp_bfg)
-		|| (gamemode != shareware) )
-	    {
-		player->pendingweapon = newweapon;
-	    }
-	}*/
+        if ( (gamemode == commercial)
+        && newweapon == wp_shotgun 
+        && player->weaponowned[wp_supershotgun]
+        && player->readyweapon != wp_supershotgun)
+        {
+        newweapon = wp_supershotgun;
+        }
+
+
+        if (player->weaponowned[newweapon]
+        && newweapon != player->readyweapon)
+        {
+        // Do not go to plasma or BFG in shareware,
+        //  even if cheated.
+        if ((newweapon != wp_plasma
+        && newweapon != wp_bfg)
+        || (gamemode != shareware) )
+        {
+        player->pendingweapon = newweapon;
+        }
+        }*/
     }
-    
+
     // check for use
     if (cmd->buttons & BT_USE)
     {
-	if (!player->usedown)
-	{
+        if (!player->usedown)
+        {
             P_DialogStart(player);  // villsa [STRIFE]
-	    P_UseLines (player);
-	    player->usedown = true;
-	}
+            P_UseLines (player);
+            player->usedown = true;
+        }
     }
     else
-	player->usedown = false;
-    
+        player->usedown = false;
+
     // cycle psprites
     P_MovePsprites (player);
-    
+
     // Counters, time dependend power ups.
 
     // haleyjd 08/30/10: [STRIFE]
@@ -470,28 +470,28 @@
 
     // Strength counts up to diminish fade.
     if (player->powers[pw_strength])
-	player->powers[pw_strength]++;	
-		
+        player->powers[pw_strength]++;	
+
     // villsa [STRIFE] unused
     /*if (player->powers[pw_invulnerability])
-	player->powers[pw_invulnerability]--;*/
+    player->powers[pw_invulnerability]--;*/
 
     if (player->powers[pw_invisibility])
-	if (! --player->powers[pw_invisibility] )
-	    player->mo->flags &= ~MF_SHADOW;
-			
+        if (! --player->powers[pw_invisibility] )
+            player->mo->flags &= ~MF_SHADOW;
+
     // villsa [STRIFE] unused
     /*if (player->powers[pw_infrared])
-	player->powers[pw_infrared]--;*/
-		
+    player->powers[pw_infrared]--;*/
+
     if (player->powers[pw_ironfeet])
-	player->powers[pw_ironfeet]--;
-		
+        player->powers[pw_ironfeet]--;
+
     if (player->damagecount)
-	player->damagecount--;
-		
+        player->damagecount--;
+
     if (player->bonuscount)
-	player->bonuscount--;
+        player->bonuscount--;
 
     // villsa [STRIFE] checks for extralight
     if(player->extralight >= 0)
@@ -501,33 +501,33 @@
         else
             player->fixedcolormap = 0;
     }
-    else
+    else // Sigil shock:
         player->fixedcolormap = INVERSECOLORMAP;
 
-    
+
     // villsa [STRIFE] unused
     // Handling colormaps.
     /*if (player->powers[pw_invulnerability])
     {
-	if (player->powers[pw_invulnerability] > 4*32
-	    || (player->powers[pw_invulnerability]&8) )
-	    player->fixedcolormap = INVERSECOLORMAP;
-	else
-	    player->fixedcolormap = 0;
+        if (player->powers[pw_invulnerability] > 4*32
+            || (player->powers[pw_invulnerability]&8) )
+            player->fixedcolormap = INVERSECOLORMAP;
+        else
+            player->fixedcolormap = 0;
     }
     else if (player->powers[pw_infrared])	
     {
-	if (player->powers[pw_infrared] > 4*32
-	    || (player->powers[pw_infrared]&8) )
-	{
-	    // almost full bright
-	    player->fixedcolormap = 1;
-	}
-	else
-	    player->fixedcolormap = 0;
+        if (player->powers[pw_infrared] > 4*32
+            || (player->powers[pw_infrared]&8) )
+        {
+            // almost full bright
+            player->fixedcolormap = 1;
+        }
+        else
+            player->fixedcolormap = 0;
     }
     else
-	player->fixedcolormap = 0;*/
+        player->fixedcolormap = 0;*/
 }