Reduces bone break chance, increases organ hit chance with unbroken ribs (#22732)

Reduces the chance for bones to break.
Fixes injury checks not respecting the DAMAGE_FLAG_BULLET flag.

The chance was: Brute damage + damage of the hit.
Then multiplied by 2 if the hit was blunt. (Bullets counted as blunt
previously)

The new chance is a linear scale, 0% at no damage, 100% at max health *
4. (Organs take damage up to 4* their max health).
Then 1/2 the damage of the hit, 1 times the damage of the hit if blunt.

To compensate, edged weapons now only decrease their chance to hit
organs by 40% if the ribs are not broken, instead of by 80%.

Example of the first hit to the chest:
STS35 bullet (damage 35):
Previously: 35% + 35% = 70% fracture chance. With 16% chance to hit an
organ.

Now: 8.75% + 17.5% = 26.25% fracture chance. With 49% chance to hit an
organ.

This one will probably need some testing!
This commit is contained in:
FenodyreeAv
2026-07-13 11:35:42 +01:00
committed by GitHub
parent f32dc7f683
commit c0e1029d62
2 changed files with 20 additions and 5 deletions
+14 -5
View File
@@ -447,9 +447,10 @@
START_PROCESSING(SSprocessing, src)
var/laser = (damage_flags & DAMAGE_FLAG_LASER)
var/sharp = (damage_flags & DAMAGE_FLAG_SHARP)
var/bullet = (damage_flags & DAMAGE_FLAG_BULLET)
var/edge = (damage_flags & DAMAGE_FLAG_EDGE)
var/psionic = (damage_flags & DAMAGE_FLAG_PSIONIC)
var/blunt = !!(brute && !sharp && !edge)
var/blunt = !!(brute && !sharp && !edge && !bullet)
/// Psionics and psionically deaf species take varying amounts of damage from psionic abilities.
if(psionic)
@@ -477,7 +478,9 @@
handle_limb_gibbing(used_weapon, brute, burn)
if(brute_dam + brute > min_broken_damage && prob(brute_dam + brute * (1 + blunt)))
///The chance of a bone breaking increases linearly, up to 100% at max_damage * 4 (The most damage an organ can take)
var/fracture_chance_increase = min(100, max(0, (brute_dam * 100) / (max_damage * 4)))
if(brute_dam + brute > min_broken_damage && prob(fracture_chance_increase + ((brute / 2) * (1 + blunt)))) //Blunt hits have 2x chance to break bones.
if(blunt || brute > FRACTURE_AND_TENDON_DAM_THRESHOLD)
fracture()
@@ -494,7 +497,7 @@
if(can_cut)
to_create = INJURY_TYPE_CUT
//need to check sharp again here so that blunt damage that was strong enough to break skin doesn't give puncture wounds
if(sharp && !edge)
if(sharp && !edge || bullet)
to_create = INJURY_TYPE_PIERCE
created_wound = createwound(to_create, brute)
@@ -530,6 +533,7 @@
var/cur_damage = brute_dam
var/sharp = (damage_flags & DAMAGE_FLAG_SHARP)
var/laser = (damage_flags & DAMAGE_FLAG_LASER)
var/bullet = (damage_flags & DAMAGE_FLAG_BULLET)
if(BP_IS_ROBOTIC(src) || laser)
damage_amt += burn
@@ -561,8 +565,13 @@
organ_hit_chance += 5 * damage_amt / organ_damage_threshold
if(!BP_IS_ROBOTIC(src))
if(encased && !(status & ORGAN_BROKEN)) //ribs protect
organ_hit_chance *= 0.2
if(encased && !(status & ORGAN_BROKEN)) //Ribs protect
if (bullet) //Less protection against bullets.
organ_hit_chance *= 0.6
else if (sharp)
organ_hit_chance *= 0.4
else
organ_hit_chance *= 0.2
else
organ_hit_chance *= 0.8 // robots should not have the same advantage
@@ -0,0 +1,6 @@
author: Fenodyree
delete-after: True
changes:
- balance: "The percent chance to break bones is now increased linearly up to 4 times max health, instead of by flat damage."
- balance: "Sharp and edged weapons are now more likely to hit organs, if the ribs are not yet broken."
- bugfix: "Bullets are no longer treated as blunt weapons. This increases their chance to hit organs and decreases their chance to break bone."