Fixes ODing on crank/other chems, viruses, and other things damaging/healing robotic limbs. (#41593)

cl ShizCalev
fix: Fixed chem OD's causing damage to robotic limbs.
fix: Fixed wood golems repairing robotic limbs every tick of life()
fix: Fixed vampires repairing robotic limbs every tick of life()...
fix: Fixed shadowpeople healing robotic limbs every tick of life()
fix: Fixed poppeople healing robotic limbs every tick of life()
fix: Fixed adjustBruteLoss and adjustFireLoss not properly discriminating for limb status types.
tweak: Fixed bibles healing robotic limbs, because your false deity can't fix SCIENCE.
fix: Fixed the Starlight Condensation, Nocturnal Regeneration, Tissue Hydration, Regenerative Coma, and Radioactive Resonance virus symptoms repairing robotic limbs.
/cl

Gonna be away the next two weeks, so if there's anything major after today just go ahead and close it and I'll fix it when I get back.
This commit is contained in:
ShizCalev
2018-12-02 01:12:22 -06:00
committed by yogstation13-bot
parent c0bffd5d5c
commit 6dd67981ce
20 changed files with 79 additions and 80 deletions

View File

@@ -81,13 +81,13 @@
M.adjustToxLoss(-(4 * heal_amt)) //most effective on toxins M.adjustToxLoss(-(4 * heal_amt)) //most effective on toxins
var/list/parts = M.get_damaged_bodyparts(1,1) var/list/parts = M.get_damaged_bodyparts(1,1, null, BODYPART_ORGANIC)
if(!parts.len) if(!parts.len)
return return
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len, null, BODYPART_ORGANIC))
M.update_damage_overlays() M.update_damage_overlays()
return 1 return 1
@@ -191,7 +191,7 @@
/datum/symptom/heal/darkness/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power) /datum/symptom/heal/darkness/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = 2 * actual_power var/heal_amt = 2 * actual_power
var/list/parts = M.get_damaged_bodyparts(1,1) var/list/parts = M.get_damaged_bodyparts(1,1, null, BODYPART_ORGANIC)
if(!parts.len) if(!parts.len)
return return
@@ -200,7 +200,7 @@
to_chat(M, "<span class='notice'>The darkness soothes and mends your wounds.</span>") to_chat(M, "<span class='notice'>The darkness soothes and mends your wounds.</span>")
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5)) //more effective on brute if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5, null, BODYPART_ORGANIC)) //more effective on brute
M.update_damage_overlays() M.update_damage_overlays()
return 1 return 1
@@ -271,7 +271,7 @@
return return
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len, null, BODYPART_ORGANIC))
M.update_damage_overlays() M.update_damage_overlays()
if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0) if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0)
@@ -321,7 +321,7 @@
/datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power) /datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
var/heal_amt = 2 * actual_power var/heal_amt = 2 * actual_power
var/list/parts = M.get_damaged_bodyparts(1,1) //more effective on burns var/list/parts = M.get_damaged_bodyparts(1,1, null, BODYPART_ORGANIC) //more effective on burns
if(!parts.len) if(!parts.len)
return return
@@ -330,7 +330,7 @@
to_chat(M, "<span class='notice'>You feel yourself absorbing the water around you to soothe your damaged skin.</span>") to_chat(M, "<span class='notice'>You feel yourself absorbing the water around you to soothe your damaged skin.</span>")
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len)) if(L.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len, null, BODYPART_ORGANIC))
M.update_damage_overlays() M.update_damage_overlays()
return 1 return 1
@@ -394,13 +394,13 @@
M.adjustToxLoss(-heal_amt) M.adjustToxLoss(-heal_amt)
var/list/parts = M.get_damaged_bodyparts(1,1) var/list/parts = M.get_damaged_bodyparts(1,1, null, BODYPART_ORGANIC)
if(!parts.len) if(!parts.len)
return return
if(prob(5)) if(prob(5))
to_chat(M, "<span class='notice'>The pain from your wounds fades rapidly.</span>") to_chat(M, "<span class='notice'>The pain from your wounds fades rapidly.</span>")
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len, null, BODYPART_ORGANIC))
M.update_damage_overlays() M.update_damage_overlays()
return 1 return 1
@@ -452,7 +452,7 @@
M.adjustToxLoss(-(2 * heal_amt)) M.adjustToxLoss(-(2 * heal_amt))
var/list/parts = M.get_damaged_bodyparts(1,1) var/list/parts = M.get_damaged_bodyparts(1,1, null, BODYPART_ORGANIC)
if(!parts.len) if(!parts.len)
return return
@@ -461,6 +461,6 @@
to_chat(M, "<span class='notice'>Your skin glows faintly, and you feel your wounds mending themselves.</span>") to_chat(M, "<span class='notice'>Your skin glows faintly, and you feel your wounds mending themselves.</span>")
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len, null, BODYPART_ORGANIC))
M.update_damage_overlays() M.update_damage_overlays()
return 1 return 1

View File

@@ -92,12 +92,12 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", "
return 0 return 0
var/heal_amt = 10 var/heal_amt = 10
var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1) var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1, null, BODYPART_ORGANIC)
if(hurt_limbs.len) if(hurt_limbs.len)
for(var/X in hurt_limbs) for(var/X in hurt_limbs)
var/obj/item/bodypart/affecting = X var/obj/item/bodypart/affecting = X
if(affecting.heal_damage(heal_amt, heal_amt)) if(affecting.heal_damage(heal_amt, heal_amt, null, BODYPART_ORGANIC))
H.update_damage_overlays() H.update_damage_overlays()
H.visible_message("<span class='notice'>[user] heals [H] with the power of [deity_name]!</span>") H.visible_message("<span class='notice'>[user] heals [H] with the power of [deity_name]!</span>")
to_chat(H, "<span class='boldnotice'>May the power of [deity_name] compel you to be healed!</span>") to_chat(H, "<span class='boldnotice'>May the power of [deity_name] compel you to be healed!</span>")

View File

@@ -38,7 +38,7 @@
break break
stacks++ stacks++
//user.take_bodypart_damage(stacks * 0.03, 0)
user.staminaloss += stacks * 1.3 //At first the changeling may regenerate stamina fast enough to nullify fatigue, but it will stack user.staminaloss += stacks * 1.3 //At first the changeling may regenerate stamina fast enough to nullify fatigue, but it will stack
if(stacks == 11) //Warning message that the stacks are getting too high if(stacks == 11) //Warning message that the stacks are getting too high

View File

@@ -61,22 +61,22 @@
return amount return amount
/mob/living/carbon/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE) /mob/living/carbon/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE, required_status)
if(!forced && (status_flags & GODMODE)) if(!forced && (status_flags & GODMODE))
return FALSE return FALSE
if(amount > 0) if(amount > 0)
take_overall_damage(amount, 0, 0, updating_health) take_overall_damage(amount, 0, 0, updating_health, required_status)
else else
heal_overall_damage(abs(amount), 0, 0, FALSE, TRUE, updating_health) heal_overall_damage(abs(amount), 0, 0, required_status ? required_status : BODYPART_ORGANIC, updating_health)
return amount return amount
/mob/living/carbon/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE) /mob/living/carbon/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE, required_status)
if(!forced && (status_flags & GODMODE)) if(!forced && (status_flags & GODMODE))
return FALSE return FALSE
if(amount > 0) if(amount > 0)
take_overall_damage(0, amount, 0, updating_health) take_overall_damage(0, amount, 0, updating_health, required_status)
else else
heal_overall_damage(0, abs(amount), 0, FALSE, TRUE, updating_health) heal_overall_damage(0, abs(amount), 0, required_status ? required_status : BODYPART_ORGANIC, updating_health)
return amount return amount
/mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE) /mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
@@ -100,7 +100,7 @@
if(amount > 0) if(amount > 0)
take_overall_damage(0, 0, amount, updating_health) take_overall_damage(0, 0, amount, updating_health)
else else
heal_overall_damage(0, 0, abs(amount), FALSE, FALSE, updating_health) heal_overall_damage(0, 0, abs(amount), null, updating_health)
return amount return amount
/mob/living/carbon/setStaminaLoss(amount, updating = TRUE, forced = FALSE) /mob/living/carbon/setStaminaLoss(amount, updating = TRUE, forced = FALSE)
@@ -117,17 +117,19 @@
var/list/obj/item/bodypart/parts = list() var/list/obj/item/bodypart/parts = list()
for(var/X in bodyparts) for(var/X in bodyparts)
var/obj/item/bodypart/BP = X var/obj/item/bodypart/BP = X
if(status && BP.status != status) if(status && (BP.status != status))
continue continue
if((brute && BP.brute_dam) || (burn && BP.burn_dam) || (stamina && BP.stamina_dam)) if((brute && BP.brute_dam) || (burn && BP.burn_dam) || (stamina && BP.stamina_dam))
parts += BP parts += BP
return parts return parts
//Returns a list of damageable bodyparts //Returns a list of damageable bodyparts
/mob/living/carbon/proc/get_damageable_bodyparts() /mob/living/carbon/proc/get_damageable_bodyparts(status)
var/list/obj/item/bodypart/parts = list() var/list/obj/item/bodypart/parts = list()
for(var/X in bodyparts) for(var/X in bodyparts)
var/obj/item/bodypart/BP = X var/obj/item/bodypart/BP = X
if(status && (BP.status != status))
continue
if(BP.brute_dam + BP.burn_dam < BP.max_damage) if(BP.brute_dam + BP.burn_dam < BP.max_damage)
parts += BP parts += BP
return parts return parts
@@ -135,19 +137,19 @@
//Heals ONE bodypart randomly selected from damaged ones. //Heals ONE bodypart randomly selected from damaged ones.
//It automatically updates damage overlays if necessary //It automatically updates damage overlays if necessary
//It automatically updates health status //It automatically updates health status
/mob/living/carbon/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, only_robotic = FALSE, only_organic = TRUE) /mob/living/carbon/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status)
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn) var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn,stamina,required_status)
if(!parts.len) if(!parts.len)
return return
var/obj/item/bodypart/picked = pick(parts) var/obj/item/bodypart/picked = pick(parts)
if(picked.heal_damage(brute, burn, stamina, only_robotic, only_organic)) if(picked.heal_damage(brute, burn, stamina, required_status))
update_damage_overlays() update_damage_overlays()
//Damages ONE bodypart randomly selected from damagable ones. //Damages ONE bodypart randomly selected from damagable ones.
//It automatically updates damage overlays if necessary //It automatically updates damage overlays if necessary
//It automatically updates health status //It automatically updates health status
/mob/living/carbon/take_bodypart_damage(brute = 0, burn = 0, stamina = 0) /mob/living/carbon/take_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status)
var/list/obj/item/bodypart/parts = get_damageable_bodyparts() var/list/obj/item/bodypart/parts = get_damageable_bodyparts(required_status)
if(!parts.len) if(!parts.len)
return return
var/obj/item/bodypart/picked = pick(parts) var/obj/item/bodypart/picked = pick(parts)
@@ -155,8 +157,8 @@
update_damage_overlays() update_damage_overlays()
//Heal MANY bodyparts, in random order //Heal MANY bodyparts, in random order
/mob/living/carbon/heal_overall_damage(brute = 0, burn = 0, stamina = 0, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE) /mob/living/carbon/heal_overall_damage(brute = 0, burn = 0, stamina = 0, required_status, updating_health = TRUE)
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute, burn, stamina) var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute, burn, stamina, required_status)
var/update = NONE var/update = NONE
while(parts.len && (brute > 0 || burn > 0 || stamina > 0)) while(parts.len && (brute > 0 || burn > 0 || stamina > 0))
@@ -166,7 +168,7 @@
var/burn_was = picked.burn_dam var/burn_was = picked.burn_dam
var/stamina_was = picked.stamina_dam var/stamina_was = picked.stamina_dam
update |= picked.heal_damage(brute, burn, stamina, only_robotic, only_organic, FALSE) update |= picked.heal_damage(brute, burn, stamina, required_status, FALSE)
brute = round(brute - (brute_was - picked.brute_dam), DAMAGE_PRECISION) brute = round(brute - (brute_was - picked.brute_dam), DAMAGE_PRECISION)
burn = round(burn - (burn_was - picked.burn_dam), DAMAGE_PRECISION) burn = round(burn - (burn_was - picked.burn_dam), DAMAGE_PRECISION)
@@ -180,11 +182,11 @@
update_damage_overlays() update_damage_overlays()
// damage MANY bodyparts, in random order // damage MANY bodyparts, in random order
/mob/living/carbon/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status = null) /mob/living/carbon/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status)
if(status_flags & GODMODE) if(status_flags & GODMODE)
return //godmode return //godmode
var/list/obj/item/bodypart/parts = get_damageable_bodyparts() var/list/obj/item/bodypart/parts = get_damageable_bodyparts(required_status)
var/update = 0 var/update = 0
while(parts.len && (brute > 0 || burn > 0 || stamina > 0)) while(parts.len && (brute > 0 || burn > 0 || stamina > 0))
var/obj/item/bodypart/picked = pick(parts) var/obj/item/bodypart/picked = pick(parts)

View File

@@ -254,7 +254,7 @@
/datum/species/golem/alloy/spec_life(mob/living/carbon/human/H) /datum/species/golem/alloy/spec_life(mob/living/carbon/human/H)
if(H.stat == DEAD) if(H.stat == DEAD)
return return
H.heal_overall_damage(2,2) H.heal_overall_damage(2,2, 0, BODYPART_ORGANIC)
H.adjustToxLoss(-2) H.adjustToxLoss(-2)
H.adjustOxyLoss(-2) H.adjustOxyLoss(-2)
@@ -296,7 +296,7 @@
if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL) if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL)
H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL) H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL)
if(light_amount > 0.2) //if there's enough light, heal if(light_amount > 0.2) //if there's enough light, heal
H.heal_overall_damage(1,1) H.heal_overall_damage(1,1,0, BODYPART_ORGANIC)
H.adjustToxLoss(-1) H.adjustToxLoss(-1)
H.adjustOxyLoss(-1) H.adjustOxyLoss(-1)

View File

@@ -35,7 +35,7 @@
if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL) if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL)
H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL) H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL)
if(light_amount > 0.2) //if there's enough light, heal if(light_amount > 0.2) //if there's enough light, heal
H.heal_overall_damage(1,1) H.heal_overall_damage(1,1, 0, BODYPART_ORGANIC)
H.adjustToxLoss(-1) H.adjustToxLoss(-1)
H.adjustOxyLoss(-1) H.adjustOxyLoss(-1)

View File

@@ -22,9 +22,9 @@
var/light_amount = T.get_lumcount() var/light_amount = T.get_lumcount()
if(light_amount > SHADOW_SPECIES_LIGHT_THRESHOLD) //if there's enough light, start dying if(light_amount > SHADOW_SPECIES_LIGHT_THRESHOLD) //if there's enough light, start dying
H.take_overall_damage(1,1) H.take_overall_damage(1,1, 0, BODYPART_ORGANIC)
else if (light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) //heal in the dark else if (light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) //heal in the dark
H.heal_overall_damage(1,1) H.heal_overall_damage(1,1, 0, BODYPART_ORGANIC)
/datum/species/shadow/check_roundstart_eligible() /datum/species/shadow/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) if(SSevents.holidays && SSevents.holidays[HALLOWEEN])

View File

@@ -40,7 +40,7 @@
/datum/species/vampire/spec_life(mob/living/carbon/human/C) /datum/species/vampire/spec_life(mob/living/carbon/human/C)
. = ..() . = ..()
if(istype(C.loc, /obj/structure/closet/crate/coffin)) if(istype(C.loc, /obj/structure/closet/crate/coffin))
C.heal_overall_damage(4,4) C.heal_overall_damage(4,4,0, BODYPART_ORGANIC)
C.adjustToxLoss(-4) C.adjustToxLoss(-4)
C.adjustOxyLoss(-4) C.adjustOxyLoss(-4)
C.adjustCloneLoss(-4) C.adjustCloneLoss(-4)

View File

@@ -154,7 +154,7 @@
/mob/living/proc/getBruteLoss() /mob/living/proc/getBruteLoss()
return bruteloss return bruteloss
/mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE) /mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE, required_status)
if(!forced && (status_flags & GODMODE)) if(!forced && (status_flags & GODMODE))
return FALSE return FALSE
bruteloss = CLAMP((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) bruteloss = CLAMP((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
@@ -249,7 +249,7 @@
return return
// heal ONE external organ, organ gets randomly selected from damaged ones. // heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE) /mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(-burn, FALSE) adjustFireLoss(-burn, FALSE)
adjustStaminaLoss(-stamina, FALSE) adjustStaminaLoss(-stamina, FALSE)
@@ -258,7 +258,7 @@
update_stamina() update_stamina()
// damage ONE external organ, organ gets randomly selected from damaged ones. // damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE) /mob/living/proc/take_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status)
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(burn, FALSE) adjustFireLoss(burn, FALSE)
adjustStaminaLoss(stamina, FALSE) adjustStaminaLoss(stamina, FALSE)
@@ -267,7 +267,7 @@
update_stamina() update_stamina()
// heal MANY bodyparts, in random order // heal MANY bodyparts, in random order
/mob/living/proc/heal_overall_damage(brute = 0, burn = 0, stamina = 0, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE) /mob/living/proc/heal_overall_damage(brute = 0, burn = 0, stamina = 0, required_status, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(-burn, FALSE) adjustFireLoss(-burn, FALSE)
adjustStaminaLoss(-stamina, FALSE) adjustStaminaLoss(-stamina, FALSE)

View File

@@ -480,7 +480,7 @@
cure_blind() cure_blind()
cure_husk() cure_husk()
hallucination = 0 hallucination = 0
heal_overall_damage(INFINITY, INFINITY, INFINITY, FALSE, FALSE, TRUE) //heal brute and burn dmg on both organic and robotic limbs, and update health right away. heal_overall_damage(INFINITY, INFINITY, INFINITY, null, TRUE) //heal brute and burn dmg on both organic and robotic limbs, and update health right away.
ExtinguishMob() ExtinguishMob()
fire_stacks = 0 fire_stacks = 0
confused = 0 confused = 0
@@ -949,7 +949,7 @@
/mob/living/proc/spreadFire(mob/living/L) /mob/living/proc/spreadFire(mob/living/L)
if(!istype(L)) if(!istype(L))
return return
if(on_fire) if(on_fire)
if(L.on_fire) // If they were also on fire if(L.on_fire) // If they were also on fire
var/firesplit = (fire_stacks + L.fire_stacks)/2 var/firesplit = (fire_stacks + L.fire_stacks)/2

View File

@@ -407,7 +407,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
else else
dam = 0 dam = 0
if((brute_heal > 0 && affecting.brute_dam > 0) || (burn_heal > 0 && affecting.burn_dam > 0)) if((brute_heal > 0 && affecting.brute_dam > 0) || (burn_heal > 0 && affecting.burn_dam > 0))
if(affecting.heal_damage(brute_heal, burn_heal, 0, TRUE, FALSE)) if(affecting.heal_damage(brute_heal, burn_heal, 0, BODYPART_ROBOTIC))
H.update_damage_overlays() H.update_damage_overlays()
user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].", \ user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].", \
"<span class='notice'>You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].</span>") "<span class='notice'>You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].</span>")

View File

@@ -91,7 +91,7 @@
/datum/reagent/drug/crank/overdose_process(mob/living/M) /datum/reagent/drug/crank/overdose_process(mob/living/M)
M.adjustBrainLoss(2*REM) M.adjustBrainLoss(2*REM)
M.adjustToxLoss(2*REM, 0) M.adjustToxLoss(2*REM, 0)
M.adjustBruteLoss(2*REM, 0) M.adjustBruteLoss(2*REM, FALSE, FALSE, BODYPART_ORGANIC)
..() ..()
. = 1 . = 1

View File

@@ -266,7 +266,7 @@
/datum/reagent/medicine/oxandrolone/overdose_process(mob/living/M) /datum/reagent/medicine/oxandrolone/overdose_process(mob/living/M)
if(M.getFireLoss()) //It only makes existing burns worse if(M.getFireLoss()) //It only makes existing burns worse
M.adjustFireLoss(4.5*REM, 0) // it's going to be healing either 4 or 0.5 M.adjustFireLoss(4.5*REM, FALSE, FALSE, BODYPART_ORGANIC) // it's going to be healing either 4 or 0.5
. = 1 . = 1
..() ..()
@@ -334,8 +334,8 @@
holder.add_reagent("sugar", 1) holder.add_reagent("sugar", 1)
holder.remove_reagent("salglu_solution", 0.5) holder.remove_reagent("salglu_solution", 0.5)
if(prob(33)) if(prob(33))
M.adjustBruteLoss(0.5*REM, 0) M.adjustBruteLoss(0.5*REM, FALSE, FALSE, BODYPART_ORGANIC)
M.adjustFireLoss(0.5*REM, 0) M.adjustFireLoss(0.5*REM, FALSE, FALSE, BODYPART_ORGANIC)
. = TRUE . = TRUE
..() ..()
@@ -433,8 +433,8 @@
/datum/reagent/medicine/omnizine/overdose_process(mob/living/M) /datum/reagent/medicine/omnizine/overdose_process(mob/living/M)
M.adjustToxLoss(1.5*REM, 0) M.adjustToxLoss(1.5*REM, 0)
M.adjustOxyLoss(1.5*REM, 0) M.adjustOxyLoss(1.5*REM, 0)
M.adjustBruteLoss(1.5*REM, 0) M.adjustBruteLoss(1.5*REM, FALSE, FALSE, BODYPART_ORGANIC)
M.adjustFireLoss(1.5*REM, 0) M.adjustFireLoss(1.5*REM, FALSE, FALSE, BODYPART_ORGANIC)
..() ..()
. = 1 . = 1
@@ -506,7 +506,7 @@
/datum/reagent/medicine/sal_acid/overdose_process(mob/living/M) /datum/reagent/medicine/sal_acid/overdose_process(mob/living/M)
if(M.getBruteLoss()) //It only makes existing bruises worse if(M.getBruteLoss()) //It only makes existing bruises worse
M.adjustBruteLoss(4.5*REM, 0) // it's going to be healing either 4 or 0.5 M.adjustBruteLoss(4.5*REM, FALSE, FALSE, BODYPART_ORGANIC) // it's going to be healing either 4 or 0.5
. = 1 . = 1
..() ..()
@@ -824,7 +824,7 @@
/datum/reagent/medicine/mannitol/on_mob_life(mob/living/carbon/C) /datum/reagent/medicine/mannitol/on_mob_life(mob/living/carbon/C)
C.adjustBrainLoss(-2*REM) C.adjustBrainLoss(-2*REM)
..() ..()
/datum/reagent/medicine/neurine /datum/reagent/medicine/neurine
name = "Neurine" name = "Neurine"
id = "neurine" id = "neurine"
@@ -934,7 +934,7 @@
. = 1 . = 1
/datum/reagent/medicine/bicaridine/overdose_process(mob/living/M) /datum/reagent/medicine/bicaridine/overdose_process(mob/living/M)
M.adjustBruteLoss(4*REM, 0) M.adjustBruteLoss(4*REM, FALSE, FALSE, BODYPART_ORGANIC)
..() ..()
. = 1 . = 1
@@ -970,7 +970,7 @@
. = 1 . = 1
/datum/reagent/medicine/kelotane/overdose_process(mob/living/M) /datum/reagent/medicine/kelotane/overdose_process(mob/living/M)
M.adjustFireLoss(4*REM, 0) M.adjustFireLoss(4*REM, FALSE, FALSE, BODYPART_ORGANIC)
..() ..()
. = 1 . = 1
@@ -1028,8 +1028,8 @@
/datum/reagent/medicine/tricordrazine/overdose_process(mob/living/M) /datum/reagent/medicine/tricordrazine/overdose_process(mob/living/M)
M.adjustToxLoss(2*REM, 0) M.adjustToxLoss(2*REM, 0)
M.adjustOxyLoss(2*REM, 0) M.adjustOxyLoss(2*REM, 0)
M.adjustBruteLoss(2*REM, 0) M.adjustBruteLoss(2*REM, FALSE, FALSE, BODYPART_ORGANIC)
M.adjustFireLoss(2*REM, 0) M.adjustFireLoss(2*REM, FALSE, FALSE, BODYPART_ORGANIC)
..() ..()
. = 1 . = 1
@@ -1128,8 +1128,8 @@
return TRUE return TRUE
/datum/reagent/medicine/lavaland_extract/overdose_process(mob/living/M) /datum/reagent/medicine/lavaland_extract/overdose_process(mob/living/M)
M.adjustBruteLoss(3*REM, 0) M.adjustBruteLoss(3*REM, 0, FALSE, BODYPART_ORGANIC)
M.adjustFireLoss(3*REM, 0) M.adjustFireLoss(3*REM, 0, FALSE, BODYPART_ORGANIC)
M.adjustToxLoss(3*REM, 0) M.adjustToxLoss(3*REM, 0)
..() ..()
return TRUE return TRUE

View File

@@ -427,7 +427,7 @@
/datum/reagent/toxin/histamine/overdose_process(mob/living/M) /datum/reagent/toxin/histamine/overdose_process(mob/living/M)
M.adjustOxyLoss(2*REM, 0) M.adjustOxyLoss(2*REM, 0)
M.adjustBruteLoss(2*REM, 0) M.adjustBruteLoss(2*REM, FALSE, FALSE, BODYPART_ORGANIC)
M.adjustToxLoss(2*REM, 0) M.adjustToxLoss(2*REM, 0)
..() ..()
. = 1 . = 1

View File

@@ -23,7 +23,7 @@
if(!parts.len) if(!parts.len)
return return
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(1/parts.len, 1/parts.len)) if(L.heal_damage(1/parts.len, 1/parts.len, null, BODYPART_ORGANIC))
host_mob.update_damage_overlays() host_mob.update_damage_overlays()
else else
host_mob.adjustBruteLoss(-1, TRUE) host_mob.adjustBruteLoss(-1, TRUE)
@@ -128,7 +128,7 @@
return return
var/update = FALSE var/update = FALSE
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(1/parts.len, 1/parts.len, only_robotic = TRUE, only_organic = FALSE)) if(L.heal_damage(1/parts.len, 1/parts.len, null, BODYPART_ROBOTIC))
update = TRUE update = TRUE
if(update) if(update)
host_mob.update_damage_overlays() host_mob.update_damage_overlays()
@@ -172,7 +172,7 @@
return return
var/update = FALSE var/update = FALSE
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(3/parts.len, 3/parts.len)) if(L.heal_damage(3/parts.len, 3/parts.len, null, BODYPART_ORGANIC))
update = TRUE update = TRUE
if(update) if(update)
host_mob.update_damage_overlays() host_mob.update_damage_overlays()

View File

@@ -58,7 +58,7 @@
if(light_amount > 0.2) // jaunt ends if(light_amount > 0.2) // jaunt ends
end_jaunt(TRUE) end_jaunt(TRUE)
else if (light_amount < 0.2 && (!QDELETED(jaunter))) //heal in the dark else if (light_amount < 0.2 && (!QDELETED(jaunter))) //heal in the dark
jaunter.heal_overall_damage(1,1) jaunter.heal_overall_damage(1,1, 0, BODYPART_ORGANIC)
/obj/effect/dummy/phased_mob/shadow/proc/end_jaunt(forced = FALSE) /obj/effect/dummy/phased_mob/shadow/proc/end_jaunt(forced = FALSE)
if(jaunter) if(jaunter)

View File

@@ -138,7 +138,7 @@
//Return TRUE to get whatever mob this is in to update health. //Return TRUE to get whatever mob this is in to update health.
/obj/item/bodypart/proc/on_life() /obj/item/bodypart/proc/on_life()
if(stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life. if(stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life.
if(heal_damage(brute = 0, burn = 0, stamina = stam_heal_tick, only_robotic = FALSE, only_organic = FALSE, updating_health = FALSE)) if(heal_damage(brute = 0, burn = 0, stamina = stam_heal_tick, null, updating_health = FALSE))
. |= BODYPART_LIFE_UPDATE_HEALTH . |= BODYPART_LIFE_UPDATE_HEALTH
//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all. //Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
@@ -148,7 +148,7 @@
if(owner && (owner.status_flags & GODMODE)) if(owner && (owner.status_flags & GODMODE))
return FALSE //godmode return FALSE //godmode
if(required_status && status != required_status) if(required_status && (status != required_status))
return FALSE return FALSE
var/dmg_mlt = CONFIG_GET(number/damage_multiplier) var/dmg_mlt = CONFIG_GET(number/damage_multiplier)
@@ -196,12 +196,9 @@
//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all. //Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
//Damage cannot go below zero. //Damage cannot go below zero.
//Cannot remove negative damage (i.e. apply damage) //Cannot remove negative damage (i.e. apply damage)
/obj/item/bodypart/proc/heal_damage(brute, burn, stamina, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE) /obj/item/bodypart/proc/heal_damage(brute, burn, stamina, required_status, updating_health = TRUE)
if(only_robotic && status != BODYPART_ROBOTIC) //This makes organic limbs not heal when the proc is in Robotic mode. if(required_status && (status != required_status)) //So we can only heal certain kinds of limbs, ie robotic vs organic.
return
if(only_organic && status != BODYPART_ORGANIC) //This makes robolimbs not healable by chems.
return return
brute_dam = round(max(brute_dam - brute, 0), DAMAGE_PRECISION) brute_dam = round(max(brute_dam - brute, 0), DAMAGE_PRECISION)
@@ -223,7 +220,7 @@
//Checks disabled status thresholds //Checks disabled status thresholds
/obj/item/bodypart/proc/update_disabled() /obj/item/bodypart/proc/update_disabled()
set_disabled(is_disabled()) set_disabled(is_disabled())
/obj/item/bodypart/proc/is_disabled() /obj/item/bodypart/proc/is_disabled()
if(has_trait(TRAIT_PARALYSIS)) if(has_trait(TRAIT_PARALYSIS))
return BODYPART_DISABLED_PARALYSIS return BODYPART_DISABLED_PARALYSIS
@@ -512,7 +509,7 @@
if(owner.has_trait(TRAIT_PARALYSIS_L_ARM)) if(owner.has_trait(TRAIT_PARALYSIS_L_ARM))
return BODYPART_DISABLED_PARALYSIS return BODYPART_DISABLED_PARALYSIS
return ..() return ..()
/obj/item/bodypart/l_arm/set_disabled(new_disabled) /obj/item/bodypart/l_arm/set_disabled(new_disabled)
. = ..() . = ..()
if(disabled == new_disabled) if(disabled == new_disabled)
@@ -572,7 +569,7 @@
px_y = 0 px_y = 0
stam_heal_tick = 2 stam_heal_tick = 2
max_stamina_damage = 50 max_stamina_damage = 50
/obj/item/bodypart/r_arm/is_disabled() /obj/item/bodypart/r_arm/is_disabled()
if(owner.has_trait(TRAIT_PARALYSIS_R_ARM)) if(owner.has_trait(TRAIT_PARALYSIS_R_ARM))
return BODYPART_DISABLED_PARALYSIS return BODYPART_DISABLED_PARALYSIS
@@ -634,7 +631,7 @@
px_y = 12 px_y = 12
stam_heal_tick = 2 stam_heal_tick = 2
max_stamina_damage = 50 max_stamina_damage = 50
/obj/item/bodypart/l_leg/is_disabled() /obj/item/bodypart/l_leg/is_disabled()
if(owner.has_trait(TRAIT_PARALYSIS_L_LEG)) if(owner.has_trait(TRAIT_PARALYSIS_L_LEG))
return BODYPART_DISABLED_PARALYSIS return BODYPART_DISABLED_PARALYSIS
@@ -693,7 +690,7 @@
px_y = 12 px_y = 12
max_stamina_damage = 50 max_stamina_damage = 50
stam_heal_tick = 2 stam_heal_tick = 2
/obj/item/bodypart/r_leg/is_disabled() /obj/item/bodypart/r_leg/is_disabled()
if(owner.has_trait(TRAIT_PARALYSIS_R_LEG)) if(owner.has_trait(TRAIT_PARALYSIS_R_LEG))
return BODYPART_DISABLED_PARALYSIS return BODYPART_DISABLED_PARALYSIS

View File

@@ -175,6 +175,6 @@
if(owner.health < 5 && world.time > min_next_adrenaline) if(owner.health < 5 && world.time > min_next_adrenaline)
min_next_adrenaline = world.time + rand(250, 600) //anywhere from 4.5 to 10 minutes min_next_adrenaline = world.time + rand(250, 600) //anywhere from 4.5 to 10 minutes
to_chat(owner, "<span class='userdanger'>You feel yourself dying, but you refuse to give up!</span>") to_chat(owner, "<span class='userdanger'>You feel yourself dying, but you refuse to give up!</span>")
owner.heal_overall_damage(15, 15) owner.heal_overall_damage(15, 15, 0, BODYPART_ORGANIC)
if(owner.reagents.get_reagent_amount("ephedrine") < 20) if(owner.reagents.get_reagent_amount("ephedrine") < 20)
owner.reagents.add_reagent("ephedrine", 10) owner.reagents.add_reagent("ephedrine", 10)

View File

@@ -305,7 +305,7 @@
cooldown = COOLDOWN_DAMAGE cooldown = COOLDOWN_DAMAGE
for(var/V in listeners) for(var/V in listeners)
var/mob/living/L = V var/mob/living/L = V
L.heal_overall_damage(10 * power_multiplier, 10 * power_multiplier, 0, FALSE, FALSE) L.heal_overall_damage(10 * power_multiplier, 10 * power_multiplier)
//BRUTE DAMAGE //BRUTE DAMAGE
else if((findtext(message, hurt_words))) else if((findtext(message, hurt_words)))

View File

@@ -80,7 +80,7 @@
//Fully heal the zombie's damage the first time they rise //Fully heal the zombie's damage the first time they rise
owner.setToxLoss(0, 0) owner.setToxLoss(0, 0)
owner.setOxyLoss(0, 0) owner.setOxyLoss(0, 0)
owner.heal_overall_damage(INFINITY, INFINITY, INFINITY, FALSE, FALSE, TRUE) owner.heal_overall_damage(INFINITY, INFINITY, INFINITY, null, TRUE)
if(!owner.revive()) if(!owner.revive())
return return