Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cap pain multiplier from nerves #5094

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions code/modules/mob/living/carbon/shock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
. = getFireLoss() + getBruteLoss()

/mob/living/carbon/human/get_limb_damage()
for(var/obj/item/organ/external/organ in organs)
var/limb_damage = min(organ.burn_dam + organ.brute_dam, organ.max_damage) // Limbs can be damaged beyond their max damage, but max pain is max damage
. += limb_damage
. += organ.internal_wound_hal_dam
if(organ && (organ.is_broken() || (!BP_IS_ROBOTIC(organ) && organ.open)))
. += 25
. *= max((get_specific_organ_efficiency(OP_NERVE, organ.organ_tag)/100), 0.5)
for(var/obj/item/organ/external/organ in organs)
var/limb_damage = min(organ.burn_dam + organ.brute_dam, organ.max_damage) // Limbs can be damaged beyond their max damage, but max pain is max damage
if(organ && (organ.is_broken() || (!BP_IS_ROBOTIC(organ) && organ.open)))
limb_damage += 25
limb_damage += organ.internal_wound_hal_dam
limb_damage *= clamp((get_specific_organ_efficiency(OP_NERVE, organ.organ_tag)/100), 0.5, 1.25)
. += limb_damage

/mob/living/carbon/proc/get_dynamic_pain()
. = 1.33 * halloss
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

if(damagetype == HALLOSS)
//First we get the nervs!
effective_damage = round(effective_damage * max(0.5, (get_specific_organ_efficiency(OP_NERVE, def_zone) / 100)))
effective_damage = round(effective_damage * clamp((get_specific_organ_efficiency(OP_NERVE, def_zone) / 100), 0.5, 1.5))
var/pain_armor = max(0, (src.getarmor(def_zone, "bullet") + src.getarmor(def_zone, "melee") - armour_pen))//All brute over-pen checks bullet rather then melee for simple mobs to keep melee viable
var/pain_no_matter_what = (effective_damage * 0.15) //we deal 15% of are pain, this is to stop rubbers being *completely* uses with basic armor - Its not perfect in melee
effective_damage = max(pain_no_matter_what, (effective_damage - pain_armor))
Expand Down Expand Up @@ -131,7 +131,7 @@
//Pain part of the damage, that simulates impact from armor absorbtion
//For balance purposes, it's lowered by ARMOR_HALLOS_COEFFICIENT
if(!(damagetype == HALLOSS ))
var/agony_gamage = round( ( effective_damage * armor_effectiveness * ARMOR_HALLOS_COEFFICIENT * max(0.5, (get_specific_organ_efficiency(OP_NERVE, def_zone) / 100)) / 100))
var/agony_gamage = round( ( effective_damage * armor_effectiveness * ARMOR_HALLOS_COEFFICIENT * clamp((get_specific_organ_efficiency(OP_NERVE, def_zone) / 100), 0.5, 1.5) / 100))
adjustHalLoss(agony_gamage)

//Actual part of the damage that passed through armor
Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mob/living/carbon/human/proc/handle_pain()
if(E.status&ORGAN_DEAD || BP_IS_ROBOTIC(E))
continue
var/dam = E.get_damage()
dam *= (get_specific_organ_efficiency(OP_NERVE, E.organ_tag)/100)
dam *= (min(get_specific_organ_efficiency(OP_NERVE, E.organ_tag)/100, 1.5))
// make the choice of the organ depend on damage,
// but also sometimes use one of the less damaged ones
if(dam > maxdam && (maxdam == 0 || prob(70)) )
Expand Down
Loading