From 1791acfb567b60219279b2681a6485dab7c579c1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Dec 2007 14:57:12 +0000 Subject: [PATCH] - Added Karate Chris's 'sv_doubleammo' submission. SVN r625 (trunk) --- docs/rh-log.txt | 1 + src/d_main.cpp | 1 + src/doomdef.h | 2 +- src/g_shared/a_pickups.cpp | 4 ++++ src/m_options.cpp | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 4137c7e71..2bf2931dc 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ December 23, 2007 (Changes by Graf Zahl) +- Added Karate Chris's 'sv_doubleammo' submission. - Added Karate Chris's 'Take' console command submission. - Changed DTA_Translation parameter for DrawTexture to an integer to avoid passing renderer specific data to the function. Also added DTA_Font so diff --git a/src/d_main.cpp b/src/d_main.cpp index 027fe59ff..1656fcfeb 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -388,6 +388,7 @@ CVAR (Flag, sv_nocrouch, dmflags, DF_NO_CROUCH); CVAR (Int, dmflags2, 0, CVAR_SERVERINFO); CVAR (Flag, sv_weapondrop, dmflags2, DF2_YES_WEAPONDROP); +CVAR (Flag, sv_doubleammo, dmflags2, DF2_YES_DOUBLEAMMO); CVAR (Flag, sv_nobfgaim, dmflags2, DF2_NO_FREEAIMBFG); CVAR (Flag, sv_respawnprotect, dmflags2, DF2_YES_INVUL); CVAR (Flag, sv_barrelrespawn, dmflags2, DF2_BARRELS_RESPAWN); diff --git a/src/doomdef.h b/src/doomdef.h index c72423031..5d6f548b7 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -246,7 +246,7 @@ enum //#define DF2_YES_RUNEDROP 256 // Drop current rune upon death //#define DF2_YES_200MAX 512 // Don't all max. health/armor items to bring // // health or armor over 200% -//#define DF2_YES_DOUBLEAMMO 1024 // Doubles ammo like skill 1 and 5 do + DF2_YES_DOUBLEAMMO = 1 << 10, // Doubles ammo like skill 1 and 5 do //#define DF2_NO_CLEARFRAGS 2048 // Don't clear frags after each level //#define DF2_FORCE_NORESPAWN 4096 // Player cannot respawn //#define DF2_YES_DEGENERATION 8192 // Quake-style degeneration diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index a4f92a051..e10aeba37 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -82,6 +82,10 @@ bool AAmmo::HandlePickup (AInventory *item) receiving = FixedMul(receiving, G_SkillProperty(SKILLP_AmmoFactor)); } int oldamount = Amount; + + if (dmflags2 & DF2_YES_DOUBLEAMMO) + receiving *= 2; + Amount += receiving; if (Amount > MaxAmount) { diff --git a/src/m_options.cpp b/src/m_options.cpp index 812f2a292..32dfb7ee0 100644 --- a/src/m_options.cpp +++ b/src/m_options.cpp @@ -1012,6 +1012,7 @@ static menuitem_t DMFlagsItems[] = { // { bitflag, "Falling damage (old)", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_FORCE_FALLINGZD} }, // { bitflag, "Falling damage (Hexen)",{&dmflags}, {0}, {0}, {0}, {(value_t *)DF_FORCE_FALLINGHX} }, { bitflag, "Drop weapon", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_YES_WEAPONDROP} }, + { bitflag, "Double ammo", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_YES_DOUBLEAMMO} }, { bitflag, "Infinite ammo", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_INFINITE_AMMO} }, { bitflag, "No monsters", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_NO_MONSTERS} }, { bitflag, "Monsters respawn", {&dmflags}, {0}, {0}, {0}, {(value_t *)DF_MONSTERS_RESPAWN} },