From f87c7b538a56c0667ded89533bdc0e9d871756b1 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 18 May 2022 15:09:06 -0400 Subject: [PATCH] - add `sv_ammofactor` to change the skill adjustment for ammo --- src/playsim/p_interaction.cpp | 1 + wadsrc/static/zscript/actors/inventory/ammo.zs | 8 ++++---- wadsrc/static/zscript/actors/inventory/weapons.zs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/playsim/p_interaction.cpp b/src/playsim/p_interaction.cpp index b58ba727d..8a8732b3b 100644 --- a/src/playsim/p_interaction.cpp +++ b/src/playsim/p_interaction.cpp @@ -76,6 +76,7 @@ EXTERN_CVAR (Bool, show_obituaries) CVAR (Float, sv_damagefactormobj, 1.0, CVAR_SERVERINFO|CVAR_CHEAT) CVAR (Float, sv_damagefactorfriendly, 1.0, CVAR_SERVERINFO|CVAR_CHEAT) CVAR (Float, sv_damagefactorplayer, 1.0, CVAR_SERVERINFO|CVAR_CHEAT) +CVAR (Float, sv_ammofactor, 1.0, CVAR_SERVERINFO|CVAR_CHEAT) // used in the zscript ammo code // // GET STUFF diff --git a/wadsrc/static/zscript/actors/inventory/ammo.zs b/wadsrc/static/zscript/actors/inventory/ammo.zs index 52b3d8f22..e30a5de60 100644 --- a/wadsrc/static/zscript/actors/inventory/ammo.zs +++ b/wadsrc/static/zscript/actors/inventory/ammo.zs @@ -94,7 +94,7 @@ class Ammo : Inventory if (!item.bIgnoreSkill) { // extra ammo in baby mode and nightmare mode - receiving = int(receiving * G_SkillPropertyFloat(SKILLP_AmmoFactor)); + receiving = int(receiving * (G_SkillPropertyFloat(SKILLP_AmmoFactor) * sv_ammofactor)); } int oldamount = Amount; @@ -140,7 +140,7 @@ class Ammo : Inventory // extra ammo in baby mode and nightmare mode if (!bIgnoreSkill) { - amount = int(amount * G_SkillPropertyFloat(SKILLP_AmmoFactor)); + amount = int(amount * (G_SkillPropertyFloat(SKILLP_AmmoFactor) * sv_ammofactor)); } let type = GetParentAmmo(); @@ -258,7 +258,7 @@ class BackpackItem : Inventory // extra ammo in baby mode and nightmare mode if (!bIgnoreSkill) { - amount = int(amount * G_SkillPropertyFloat(SKILLP_AmmoFactor)); + amount = int(amount * (G_SkillPropertyFloat(SKILLP_AmmoFactor) * sv_ammofactor)); } if (amount < 0) amount = 0; if (ammoitem == NULL) @@ -323,7 +323,7 @@ class BackpackItem : Inventory // extra ammo in baby mode and nightmare mode if (!bIgnoreSkill) { - amount = int(amount * G_SkillPropertyFloat(SKILLP_AmmoFactor)); + amount = int(amount * (G_SkillPropertyFloat(SKILLP_AmmoFactor) * sv_ammofactor)); } ammoitem.Amount += amount; if (ammoitem.Amount > ammoitem.MaxAmount && !sv_unlimited_pickup) diff --git a/wadsrc/static/zscript/actors/inventory/weapons.zs b/wadsrc/static/zscript/actors/inventory/weapons.zs index eca912291..e3284f913 100644 --- a/wadsrc/static/zscript/actors/inventory/weapons.zs +++ b/wadsrc/static/zscript/actors/inventory/weapons.zs @@ -748,7 +748,7 @@ class Weapon : StateProvider // extra ammoitem in baby mode and nightmare mode if (!bIgnoreSkill) { - amount = int(amount * G_SkillPropertyFloat(SKILLP_AmmoFactor)); + amount = int(amount * (G_SkillPropertyFloat(SKILLP_AmmoFactor) * sv_ammofactor)); } ammoitem = Ammo(other.FindInventory (ammotype)); if (ammoitem == NULL) @@ -783,7 +783,7 @@ class Weapon : StateProvider // extra ammo in baby mode and nightmare mode if (!bIgnoreSkill) { - amount = int(amount * G_SkillPropertyFloat(SKILLP_AmmoFactor)); + amount = int(amount * (G_SkillPropertyFloat(SKILLP_AmmoFactor) * sv_ammofactor)); } ammo.Amount += amount; if (ammo.Amount > ammo.MaxAmount && !sv_unlimited_pickup)