More combat/gun/medical tweaks. (#8615)

This commit is contained in:
Matt Atlas
2020-04-19 14:28:33 +02:00
committed by GitHub
parent 7ef1c10f7a
commit d403ee314d
12 changed files with 132 additions and 90 deletions
+4 -4
View File
@@ -43,11 +43,11 @@
/obj/item/organ/internal/proc/surgical_fix(mob/user)
if(damage > min_broken_damage)
var/scarring = damage/max_damage
scarring = 1 - 0.3 * scarring ** 2 // Between ~15 and 30 percent loss
var/scarring = damage / max_damage
scarring = 1 - 0.5 * scarring ** 2 // Between ~15 and 50 percent loss.
var/new_max_dam = Floor(scarring * max_damage)
if(new_max_dam < max_damage)
to_chat(user, "<span class='warning'>Not every part of [src] could be saved, some dead tissue had to be removed, making it more suspectable to damage in the future.</span>")
to_chat(user, SPAN_WARNING("Not every part of [src] could be saved; some dead tissue had to be removed, making it more susceptible to future damage."))
set_max_damage(new_max_dam)
heal_damage(damage)
@@ -123,4 +123,4 @@
if(!damage || BP_IS_ROBOTIC(src) || !owner || owner.chem_effects[CE_TOXIN] || owner.is_asystole())
return
if(damage < 0.1*max_damage)
heal_damage(0.1)
heal_damage(0.1)
+11 -8
View File
@@ -128,20 +128,20 @@
if(prob(1))
to_chat(owner, "<span class='warning'>You feel [pick("dizzy","woozy","faint")]...</span>")
damprob = owner.chem_effects[CE_STABLE] ? 30 : 60
if(!past_damage_threshold(2) && prob(damprob))
if(!past_damage_threshold(4) && prob(damprob))
take_internal_damage(1)
if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
owner.eye_blurry = max(owner.eye_blurry,6)
damprob = owner.chem_effects[CE_STABLE] ? 40 : 80
if(!past_damage_threshold(4) && prob(damprob))
take_internal_damage(1)
if(!past_damage_threshold(6) && prob(damprob))
take_internal_damage(2)
if(!owner.paralysis && prob(10))
owner.Paralyse(rand(1,3))
to_chat(owner, "<span class='warning'>You feel extremely [pick("dizzy","woozy","faint")]...</span>")
if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD)
owner.eye_blurry = max(owner.eye_blurry,6)
damprob = owner.chem_effects[CE_STABLE] ? 60 : 100
if(!past_damage_threshold(6) && prob(damprob))
if(!past_damage_threshold(8) && prob(damprob))
take_internal_damage(1)
if(!owner.paralysis)
owner.Paralyse(3,5)
@@ -152,17 +152,20 @@
if(prob(damprob))
take_internal_damage(1)
if(prob(damprob))
take_internal_damage(1)
take_internal_damage(2)
..()
/obj/item/organ/internal/brain/take_internal_damage(var/damage, var/silent)
set waitfor = 0
if(damage >= (max_damage / 4))
damage *= 2
..()
if(damage >= (max_damage / 3)) //This probably won't be triggered by oxyloss or mercury. Probably.
if(damage >= (max_damage / 5)) //This probably won't be triggered by oxyloss or mercury. Probably.
var/damage_secondary = damage * 0.20
owner.eye_blurry += damage_secondary
owner.confused += damage_secondary * 2
owner.Weaken(round(damage, 1))
owner.Weaken(round(damage_secondary * 3, 1))
owner.adjustOxyLoss(damage)
if(prob(30))
addtimer(CALLBACK(src, .proc/brain_damage_callback, damage), rand(6, 20) SECONDS, TIMER_UNIQUE)
@@ -204,7 +207,7 @@
/obj/item/organ/internal/brain/surgical_fix(mob/user)
var/blood_volume = owner.get_blood_oxygenation()
if(blood_volume < BLOOD_VOLUME_SURVIVE)
if(blood_volume < BLOOD_VOLUME_BAD)
to_chat(user, "<span class='danger'>Parts of [src] didn't survive the procedure due to lack of air supply!</span>")
set_max_damage(Floor(max_damage - 0.25*damage))
heal_damage(damage)
+3 -6
View File
@@ -103,11 +103,8 @@
rupture()
var/safe_pressure_min = owner.species.breath_pressure // Minimum safe partial pressure of breathable gas in kPa
if(is_broken())
safe_pressure_min *= 1.5
else if(is_bruised())
safe_pressure_min *= 1.25
// Lung damage increases the minimum safe pressure.
safe_pressure_min *= 1 + rand(1,4) * damage/max_damage
var/safe_exhaled_max = 10
var/safe_toxins_max = 0.2
@@ -115,7 +112,7 @@
var/SA_sleep_min = 5
var/inhaled_gas_used = 0
var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/(BREATH_VOLUME * owner.species.breath_vol_mul)
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / (BREATH_VOLUME * owner.species.breath_vol_mul)
var/inhaling
var/poison
+41 -56
View File
@@ -240,7 +240,8 @@
****************************************************/
/obj/item/organ/external/proc/is_damageable(var/additional_damage = 0)
return (vital || brute_dam + burn_dam + additional_damage < max_damage)
//Continued damage to vital organs can kill you, and robot organs don't count towards total damage so no need to cap them.
return (BP_IS_ROBOTIC(src) || brute_dam + burn_dam + additional_damage < max_damage * 4)
/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list(), damage_flags, var/silent)
if((brute <= 0) && (burn <= 0))
@@ -250,15 +251,51 @@
burn *= burn_mod
var/laser = (damage_flags & DAM_LASER)
add_pain(0.8*burn + 0.5*brute)
var/blunt = !!(brute && !sharp && !edge)
if(status & ORGAN_BROKEN && prob(40) && brute)
if(owner && (owner.can_feel_pain()))
owner.emote("scream") //getting hit on broken hand hurts
owner.emote(pick("scream", "groan")) //getting hit on broken hand hurts
if(used_weapon)
add_autopsy_data("[used_weapon]", brute + burn)
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
var/spillover = 0
if(!is_damageable(brute + burn))
spillover = brute_dam + burn_dam + brute - max_damage
if(spillover > 0)
brute = max(brute - spillover, 0)
else
spillover = brute_dam + burn_dam + brute + burn - max_damage
if(spillover > 0)
burn = max(burn - spillover, 0)
handle_limb_gibbing(used_weapon, brute, burn)
if(brute_dam + brute > min_broken_damage && prob(brute_dam + brute * (1 + blunt)))
fracture()
if(brute)
var/to_create = BRUISE
if(can_cut)
to_create = 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)
to_create = PIERCE
createwound(to_create, brute)
if(burn)
if(laser)
createwound(LASER, burn)
else
createwound(BURN, burn)
add_pain(0.8 * burn + 0.6 * brute)
//If there are still hurties to dispense
if (spillover)
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
// High brute damage or sharp objects may damage internal organs
if(length(internal_organs))
if(damage_internal_organs(brute, burn, sharp, damage_flags))
@@ -268,58 +305,6 @@
brute /= brute_div
burn /= 2
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
// If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking
// Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can
// push them faster into paincrit though, as the additional damage is converted into shock.
if(is_damageable(brute + burn) || !config.limbs_can_break)
if(brute)
if(can_cut)
if(sharp && !edge)
createwound(PIERCE, brute)
else
createwound(CUT, brute)
else
createwound(BRUISE, brute)
if(burn)
createwound(BURN, burn)
else
//If we can't inflict the full amount of damage, spread the damage in other ways
//How much damage can we actually cause?
var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam)
var/spillover = 0
if(can_inflict)
if(brute > 0)
//Inflict all brute damage we can
if(can_cut)
if(sharp && !edge)
createwound(PIERCE, min(brute,can_inflict))
else
createwound(CUT, min(brute,can_inflict))
else
createwound(BRUISE, min(brute,can_inflict))
var/temp = can_inflict
//How much more damage can we inflict
can_inflict = max(0, can_inflict - brute)
//How much brute damage is left to inflict
spillover += max(0, brute - temp)
if(burn > 0 && can_inflict)
//Inflict all burn damage we can
if(laser)
createwound(LASER, min(burn, can_inflict))
else
createwound(BURN, min(burn,can_inflict))
//How much burn damage is left to inflict
spillover += max(0, burn - can_inflict)
//If there are still hurties to dispense
if (spillover && owner)
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
handle_limb_gibbing(used_weapon,brute,burn)
// sync the organ's damage with its wounds
update_damages()
+1 -1
View File
@@ -245,7 +245,7 @@
if(BRUISE)
return /datum/wound/bruise
if(BURN)
if(BURN, LASER)
switch(damage)
if(50 to INFINITY)
return /datum/wound/burn/carbonised