Skip to content

Commit

Permalink
Bullits 'n woundiing mods. (#4985)
Browse files Browse the repository at this point in the history
* Mamba/Copperhead onsuit

Fixes the pathing for a few on-suit sprites for the Mamba/copperhead marshal guns

* Merge remote-tracking branch 'upstream/master'

* Woundiing Mult

Actually adds wounding mult from Eris and makes it a bity more granular(i felt this necessary due to our uh...frankly insane amount of weapons/guns.) - For the record, I only slightly understand how this actually ineracts with the code that Rebel decided to port that referenced it but I THINK it affects how likely (specifically bullets) are to do organ damage in addition to actual regular damage. I spread the mults across our ammo in a roughly homogenous way but we'll need to test to see if it like....matters. If i understand right, this system will mean 9mm HV will tend to wound less than 9mm hp, which will do worse than 10mm hp and so on.

Also adds a tweak to the damage proc to *maybe* fix weirdness owing to us not using armor divisor, instead generating armor divisor by dividng AP by 10(so you still end up roughly....the same scale of 1-10ish).

Also nukes PVP/PVE damage listing, damage is now given only as 1 value that incidentally also includes modifiers for post_pen_damagemult(HP damage bonus).  PLEASE note that the damage listed for HALLOWPOINT bullets and other TRAUMATIC ROUNDS(Shrapnel bolts, red-nose AMR, buckshot) is HIGHLY SUBJECT to ARMOR VALUES and if you use it against armored targets it will NOT WORK GREAT. this has not changed, but I want to make it double clear before this goes live and people scream 'cdb you broke hp awaawawawawa'

---------

Co-authored-by: cdb-is-not-good <[email protected]>
  • Loading branch information
cdb-is-not-good and cdb-is-not-good authored Feb 7, 2024
1 parent a036847 commit 7f8758e
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 16 deletions.
10 changes: 10 additions & 0 deletions code/__DEFINES/weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
#define ARMOR_PEN_MASSIVE 30
#define ARMOR_PEN_HALF 50

//Wounding Multiplier: Increases damage taken, applied after armor.
#define WOUNDING_HARMLESS 0.25
#define WOUNDING_TINY 0.5
#define WOUNDING_SMALL 0.75
#define WOUNDING_NORMAL 1
#define WOUNDING_SERIOUS 1.25
#define WOUNDING_WIDE 1.5
#define WOUNDING_EXTREME 1.75
#define WOUNDING_DEVESTATIING 2

//Resistance values, used on floors, windows, airlocks, girders, and similar hard targets.
//Resistance value is also used on simple animals.
//Reduces the damage they take by flat amounts
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ This function restores all organs.
if(damagetype == PSY)
sanity.onPsyDamage(damage)
var/obj/item/organ/brain = random_organ_by_process(BP_BRAIN)
brain.take_damage(damage, PSY, armor_divisor, wounding_multiplier)
brain.take_damage(damage, PSY, (armor_penetration * 0.1), wounding_multiplier)
return TRUE

if(damagetype == TOX && stats.getPerk(PERK_BLOOD_OF_LEAD))
Expand All @@ -382,7 +382,7 @@ This function restores all organs.
return FALSE

damageoverlaytemp = 20
if(organ.take_damage(damage, damagetype, armor_divisor, wounding_multiplier, sharp, edge, used_weapon))
if(organ.take_damage(damage, damagetype, (armor_penetration * 0.1), wounding_multiplier, sharp, edge, used_weapon))
UpdateDamageIcon()

sanity.onDamage(damage)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/organs/external/damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
var/transferred_damage_amount
switch(damage_type)
if(BRUTE)
transferred_damage_amount = amount - (max_damage - brute_dam) / armor_divisor / 2
transferred_damage_amount = amount - (max_damage - brute_dam) / max(1, armor_penetration * 0.1) / 2
if(BURN)
transferred_damage_amount = amount - (max_damage - burn_dam) / armor_divisor / 2
transferred_damage_amount = amount - (max_damage - burn_dam) / max(1, armor_penetration * 0.1) / 2
if(HALLOSS)
transferred_damage_amount = 0
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/external/subtypes/standard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
owner.update_hair()
..()

/obj/item/organ/external/head/take_damage(amount, damage_type, armor_divisor = 1, wounding_multiplier = 1, sharp, edge, used_weapon = null, list/forbidden_limbs = list(), silent)
/obj/item/organ/external/head/take_damage(amount, damage_type, armor_divisor = max(1, armor_penetration), wounding_multiplier = 1, sharp, edge, used_weapon = null, list/forbidden_limbs = list(), silent)
. = ..()
if(. && !disfigured)
if(amount > 25)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ For the sake of consistency, I suggest always rounding up on even values when ap
var/list/data = list()
data["projectile_name"] = P.name
data["projectile_damage"] = (P.get_total_damage() * damage_multiplier) + get_total_damage_adjust()
data["projectile_damage_pve"] = (P.get_total_damage() * damage_multiplier) + get_total_damage_adjust() + (P.agony * proj_agony_multiplier)
data["projectile_WOUND"] = P.wounding_mult
data["projectile_AP"] = P.armor_penetration * penetration_multiplier
data["projectile_pain"] = P.agony * proj_agony_multiplier
data["projectile_recoil"] = P.recoil
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
var/serial_type_index_bullet = ""

var/recoil = 0
var/wounding_mult = 1 // A multiplier on damage inflicted to and damage blocked by mobs

var/ignition_source = TRUE //Used for deciding if a projectile should blow up a benzin.

Expand Down Expand Up @@ -150,10 +151,9 @@
/obj/item/projectile/proc/get_total_damage()
var/val = 0
for(var/i in damage_types)
val += damage_types[i]
val += damage_types[i] * post_penetration_dammult
return val


/obj/item/projectile/proc/is_halloss()
for(var/i in damage_types)
if(i != HALLOSS)
Expand Down
Loading

0 comments on commit 7f8758e

Please sign in to comment.