All pastes #1931022 Raw Edit

Miscellany

public text v1 · immutable
#1931022 ·published 2010-09-02 08:36 UTC
rendered paste body
Index: common/doomstat.h
===================================================================
--- common/doomstat.h	(revision 1832)
+++ common/doomstat.h	(working copy)
@@ -89,6 +89,7 @@
 #define GM_DM		1.0f
 #define GM_TEAMDM	2.0f
 #define GM_CTF		3.0f
+#define GM_ARENA	4.0f
 
 
 // -------------------------
Index: server/src/p_mobj.cpp
===================================================================
--- server/src/p_mobj.cpp	(revision 1832)
+++ server/src/p_mobj.cpp	(working copy)
@@ -1383,6 +1383,56 @@
 		// send new objects
 		SV_SpawnMobj(mobj);
 	}
+
+	if (sv_gametype == GM_ARENA)
+	{
+                size_t i;
+
+                p->health = deh.MaxSoulsphere;
+                p->mo->health = p->health;
+                p->armorpoints = deh.MaxArmor;
+                p->armortype = deh.BlueAC;
+                /*if(p->readyweapon != wp_supershotgun)
+		{
+			SV_BroadcastPrintf(PRINT_HIGH, "this one?\n");
+			p->pendingweapon = wp_supershotgun;
+		}*/
+                p->backpack = true;
+                p->powers[pw_strength] = true;
+
+                for (i = 0; i < NUMWEAPONS; i++)
+                        p->weaponowned[i] = true;
+
+                p->weaponowned[wp_bfg] = false;
+                p->weaponowned[wp_chainsaw] = false;
+
+                for (i = 0; i < NUMAMMO; i++) {
+                        p->maxammo[i] *= 2;
+                        p->ammo[i] = p->maxammo[i];
+                }
+
+                // inform client
+                {
+                	size_t j;
+                        client_t *cl = &p->client;
+                        MSG_WriteMarker (&cl->reliablebuf, svc_playerinfo);
+
+                        for(j = 0; j < NUMWEAPONS; j++)
+                                MSG_WriteByte (&cl->reliablebuf, p->weaponowned[j]);
+
+                        for(j = 0; j < NUMAMMO; j++)
+                        {
+                                MSG_WriteShort (&cl->reliablebuf, p->maxammo[j]);
+                                MSG_WriteShort (&cl->reliablebuf, p->ammo[j]);
+                        }
+
+                        MSG_WriteByte (&cl->reliablebuf, p->health);
+                        MSG_WriteByte (&cl->reliablebuf, p->armorpoints);
+                        MSG_WriteByte (&cl->reliablebuf, p->armortype);
+                        MSG_WriteByte (&cl->reliablebuf, p->readyweapon);
+                        MSG_WriteByte (&cl->reliablebuf, p->backpack);
+		}
+	}
 }
 
 //
@@ -1628,6 +1678,9 @@
 		if (i == MT_SKULL || (mobjinfo[i].flags & MF_COUNTKILL) )
 			return;
 
+	if (sv_gametype == GM_ARENA && (mobjinfo[i].flags & MF_SPECIAL) && (mthing->type < MT_BSOK || mthing->type > MT_RDWN))
+		return;
+
 	// spawn it
 	x = mthing->x << FRACBITS;
 	y = mthing->y << FRACBITS;
Index: server/src/sv_main.cpp
===================================================================
--- server/src/sv_main.cpp	(revision 1832)
+++ server/src/sv_main.cpp	(working copy)
@@ -3719,7 +3719,7 @@
 
 	// LEVEL TIMER
 	if (players.size()) {
-		if (sv_gametype == GM_DM) {
+		if (sv_gametype == GM_DM || sv_gametype == GM_ARENA) {
 			player_t *winplayer = &players[0];
 			bool drawgame = false;
 
Index: server/src/p_interaction.cpp
===================================================================
--- server/src/p_interaction.cpp	(revision 1832)
+++ server/src/p_interaction.cpp	(working copy)
@@ -1175,7 +1175,7 @@
 	if (source && source->player && target->player && level.time)
 	{
 		// [Toke] Better sv_fraglimit
-		if (sv_gametype == GM_DM && sv_fraglimit && splayer->fragcount >= (int)sv_fraglimit && !sv_fragexitswitch) // [ML] 04/4/06: Added !sv_fragexitswitch
+		if ((sv_gametype == GM_DM || sv_gametype == GM_ARENA) && sv_fraglimit && splayer->fragcount >= (int)sv_fraglimit && !sv_fragexitswitch) // [ML] 04/4/06: Added !sv_fragexitswitch
 		{
 				SV_BroadcastPrintf (PRINT_HIGH, "Frag limit hit. Game won by %s!\n", splayer->userinfo.netname);
 				shotclock = TICRATE*2;
Index: server/src/d_player.h
===================================================================
--- server/src/d_player.h	(revision 1832)
+++ server/src/d_player.h	(working copy)
@@ -362,7 +362,7 @@
 		deathcount = 0;
 		killcount = 0;
 		pendingweapon = wp_nochange;
-		readyweapon = wp_nochange;		
+		readyweapon = wp_nochange;
 		for (i = 0; i < NUMWEAPONS; i++)
 			weaponowned[i] = false;
 		for (i = 0; i < NUMAMMO; i++)
Index: server/src/sv_sqpold.cpp
===================================================================
--- server/src/sv_sqpold.cpp	(revision 1832)
+++ server/src/sv_sqpold.cpp	(working copy)
@@ -179,7 +179,7 @@
 	for (i = 1; i < numwads; ++i)
 		MSG_WriteString(&ml_message, wadnames[i].c_str());
 
-	MSG_WriteBool(&ml_message, (sv_gametype == GM_DM || sv_gametype == GM_TEAMDM));
+	MSG_WriteBool(&ml_message, (sv_gametype == GM_DM || sv_gametype == GM_TEAMDM || sv_gametype == GM_ARENA));
 	MSG_WriteByte(&ml_message, (BYTE)sv_skill);
 	MSG_WriteBool(&ml_message, (sv_gametype == GM_TEAMDM));
 	MSG_WriteBool(&ml_message, (sv_gametype == GM_CTF));
Index: server/src/g_game.cpp
===================================================================
--- server/src/g_game.cpp	(revision 1832)
+++ server/src/g_game.cpp	(working copy)
@@ -593,9 +593,20 @@
 	p.health = deh.StartHealth;		// [RH] Used to be MAXHEALTH
 	p.armortype = 0;
 	p.armorpoints = 0;
-	p.readyweapon = p.pendingweapon = wp_pistol;
-	p.weaponowned[wp_fist] = true;
-	p.weaponowned[wp_pistol] = true;
+        if(sv_gametype == GM_ARENA)
+        {
+                p.readyweapon = p.pendingweapon = wp_pistol;
+                p.weaponowned[wp_fist] = true;
+                p.weaponowned[wp_pistol] = true;
+        }
+        else
+	{
+                p.readyweapon = p.pendingweapon = wp_pistol;
+                p.weaponowned[wp_fist] = true;
+                p.weaponowned[wp_pistol] = true;
+
+	}
+
 	p.ammo[am_clip] = deh.StartBullets; // [RH] Used to be 50
 
 	p.respawn_time = level.time;
Index: client/src/g_game.cpp
===================================================================
--- client/src/g_game.cpp	(revision 1832)
+++ client/src/g_game.cpp	(working copy)
@@ -432,7 +432,7 @@
 		}
 		else if (consoleplayer().spectator ||
 			 sv_gametype == GM_COOP ||
-			 (sv_gametype != GM_DM &&
+			 ((sv_gametype != GM_DM || sv_gametype != GM_ARENA) &&
 				players[curr].userinfo.team == consoleplayer().userinfo.team))
 		{
 			displayplayer_id = players[curr].id;
@@ -1141,10 +1141,10 @@
 
 	p->usedown = p->attackdown = true;	// don't do anything immediately
 	p->playerstate = PST_LIVE;
-	p->health = deh.StartHealth;		// [RH] Used to be MAXHEALTH
-	p->readyweapon = p->pendingweapon = wp_pistol;
-	p->weaponowned[wp_fist] = true;
-	p->weaponowned[wp_pistol] = true;
+/	p->health = deh.StartHealth;		// [RH] Used to be MAXHEALTH
+        p.readyweapon = p.pendingweapon = wp_pistol;
+        p.weaponowned[wp_fist] = true;
+        p.weaponowned[wp_pistol] = true;
 	p->ammo[am_clip] = deh.StartBullets; // [RH] Used to be 50
 
 	for (i = 0; (i < NUMAMMO); i++)
@@ -1171,9 +1171,20 @@
 	p.health = deh.StartHealth;		// [RH] Used to be MAXHEALTH
 	p.armortype = 0;
 	p.armorpoints = 0;
-	p.readyweapon = p.pendingweapon = wp_pistol;
-	p.weaponowned[wp_fist] = true;
-	p.weaponowned[wp_pistol] = true;
+	if(sv_gametype == GM_ARENA)
+	{
+		p.readyweapon = p.pendingweapon = wp_pistol;
+		p.weaponowned[wp_fist] = true;
+		p.weaponowned[wp_pistol] = true;
+	}
+	else
+        {
+                p.readyweapon = p.pendingweapon = wp_pistol;
+                p.weaponowned[wp_fist] = true;
+                p.weaponowned[wp_pistol] = true;
+
+	}
+
 	p.ammo[am_clip] = deh.StartBullets; // [RH] Used to be 50
 
 	p.respawn_time = level.time;
Index: client/src/hu_stuff.cpp
===================================================================
--- client/src/hu_stuff.cpp	(revision 1832)
+++ client/src/hu_stuff.cpp	(working copy)
@@ -713,7 +713,9 @@
 
 	// Scoreboard Identify
 	// Dan - Tells which current game mode is being played
-	if (sv_gametype != GM_COOP)
+	if(sv_gametype == GM_ARENA)
+                screen->DrawTextClean (CR_GOLD,120 * CleanXfac,10 * CleanYfac,"Arena");
+	else if (sv_gametype != GM_COOP)
 		screen->DrawTextClean (CR_GOLD,120 * CleanXfac,10 * CleanYfac,"Deathmatch");
 	else
 		screen->DrawTextClean (CR_GOLD,120 * CleanXfac,10 * CleanYfac,"Cooperative");
@@ -875,7 +877,9 @@
 
 	// Scoreboard Identify
     // Dan - Tells which current game mode is being played
-    if (sv_gametype != GM_COOP)
+    if (sv_gametype == GM_ARENA)
+        screen->DrawText (CR_GOLD,locx + 135,locy + 0,"Arena");
+    else if (sv_gametype != GM_COOP)
         screen->DrawText (CR_GOLD,locx + 135,locy + 0,"Deathmatch");
     else
         screen->DrawText (CR_GOLD,locx + 150,locy + 0,"Cooperative");
@@ -1817,7 +1821,7 @@
                         Printf_Bold("%-15s\n", player->userinfo.netname);
                 }
             }
-    } else if (sv_gametype == GM_DM) {
+    } else if (sv_gametype == GM_DM || sv_gametype == GM_ARENA) {
         std::sort(sortedplayers.begin(), sortedplayers.end(), compare_player_frags);
 
         Printf_Bold("\n--------------------------------------\n");
Index: client/src/am_map.cpp
===================================================================
--- client/src/am_map.cpp	(revision 1832)
+++ client/src/am_map.cpp	(working copy)
@@ -1454,7 +1454,7 @@
 		mpoint_t pt;
 
 		if (!players[i].ingame() || !p->mo ||
-			(((sv_gametype == GM_DM && p != &conplayer) ||
+			((((sv_gametype == GM_DM || sv_gametype == GM_ARENA) && p != &conplayer) ||
 			((sv_gametype == GM_TEAMDM || sv_gametype == GM_CTF) && p->userinfo.team != conplayer.userinfo.team))
 			&& !demoplayback && !(conplayer.spectator)) || p->spectator)
 		{