diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm index 581d3efb17e..d554c7a9d33 100644 --- a/code/ZAS/Phoron.dm +++ b/code/ZAS/Phoron.dm @@ -1,48 +1,32 @@ GLOBAL_DATUM_INIT(contamination_overlay, /image, image('icons/effects/contamination.dmi')) /pl_control + ///Self Descriptive var/PHORON_DMG = 3 - var/PHORON_DMG_NAME = "Phoron Damage Amount" - var/PHORON_DMG_DESC = "Self Descriptive" - + ///If this is on, phoron does damage by getting into cloth. var/CLOTH_CONTAMINATION = TRUE - var/CLOTH_CONTAMINATION_NAME = "Cloth Contamination" - var/CLOTH_CONTAMINATION_DESC = "If this is on, phoron does damage by getting into cloth." - + ///If this is on, only biosuits and spacesuits protect against contamination and ill effects. var/PHORONGUARD_ONLY = FALSE - var/PHORONGUARD_ONLY_NAME = "\"PhoronGuard Only\"" - var/PHORONGUARD_ONLY_DESC = "If this is on, only biosuits and spacesuits protect against contamination and ill effects." - + ///Chance of genetic corruption as well as toxic damage, X in 10,000. var/GENETIC_CORRUPTION = FALSE - var/GENETIC_CORRUPTION_NAME = "Genetic Corruption Chance" - var/GENETIC_CORRUPTION_DESC = "Chance of genetic corruption as well as toxic damage, X in 10,000." - + ///Phoron has an effect similar to mustard gas on the un-suited. var/SKIN_BURNS = TRUE - var/SKIN_BURNS_DESC = "Phoron has an effect similar to mustard gas on the un-suited." - var/SKIN_BURNS_NAME = "Skin Burns" - + ///Phoron burns the eyes of anyone not wearing eye protection. var/EYE_BURNS = TRUE - var/EYE_BURNS_NAME = "Eye Burns" - var/EYE_BURNS_DESC = "Phoron burns the eyes of anyone not wearing eye protection." - - var/CONTAMINATION_LOSS = 2 - var/CONTAMINATION_LOSS_NAME = "Contamination Loss" - var/CONTAMINATION_LOSS_DESC = "How much fire damage is dealt from contaminated clothing, per life process." - + ///How much fire damage is dealt from contaminated clothing to each covered body part per life process. + var/CONTAMINATION_LOSS = 0.2 //This is no longer divided between all body parts, the whole value is instead applied to all covered body parts, for each piece of contaminated clothing. + ///Does being in phoron cause you to hallucinate? var/PHORON_HALLUCINATION = FALSE - var/PHORON_HALLUCINATION_NAME = "Phoron Hallucination" - var/PHORON_HALLUCINATION_DESC = "Does being in phoron cause you to hallucinate?" - + ///Does being in sleeping gas cause you to hallucinate? var/N2O_HALLUCINATION = TRUE - var/N2O_HALLUCINATION_NAME = "N2O Hallucination" - var/N2O_HALLUCINATION_DESC = "Does being in sleeping gas cause you to hallucinate?" - /obj/var/contaminated = 0 /obj/item/proc/can_contaminate() if(item_flags & ITEM_FLAG_PHORON_GUARD) return FALSE + if(!(prob(100 * min(gas_transfer_coefficient, permeability_coefficient)))) + return FALSE return TRUE //Clothing can be contaminated. @@ -88,7 +72,7 @@ GLOBAL_DATUM_INIT(contamination_overlay, /image, image('icons/effects/contaminat //Burn skin if exposed. if(GLOB.vsc.plc.SKIN_BURNS) if(!pl_head_protected() || !pl_suit_protected()) - burn_skin(3) + apply_damage(2, DAMAGE_BURN, null, "Chemical burns", DAMAGE_FLAG_DISPERSED | DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) if(prob(20)) to_chat(src, SPAN_DANGER("Your skin burns!")) updatehealth() diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 660eb7ca114..97ddd53b2e3 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -13,6 +13,8 @@ slot_flags = SLOT_BACK w_class = WEIGHT_CLASS_NORMAL + permeability_coefficient = 0 //So your oxygen tank doesn't get contaminated by phoron in the air. + force = 11 throwforce = 10.0 throw_speed = 1 diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 38d344926f4..11a106ebb04 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -336,12 +336,12 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t //Damages ONE external organ, organ gets randomly selected from damagable ones. //It automatically updates damage overlays if necesary //It automatically updates health status -/mob/living/carbon/human/take_organ_damage(var/brute, var/burn, var/damage_flags) +/mob/living/carbon/human/take_organ_damage(var/brute, var/burn, var/damage_flags, var/used_weapon = null, var/silent) var/list/obj/item/organ/external/parts = get_damageable_organs() if(!parts.len) return var/obj/item/organ/external/picked = pick(parts) - if(picked.take_damage(brute, burn, damage_flags)) + if(picked.take_damage(brute, burn, damage_flags, used_weapon, silent)) UpdateDamageIcon() BITSET(hud_updateflag, HEALTH_HUD) updatehealth() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 12b6a02df30..34212388b30 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -728,15 +728,32 @@ if(gloves && (gloves.heat_protection & HANDS)) protected = TRUE - if(!protected) - for(var/obj/item/held_item in src) - if(held_item.contaminated && !(species.flags & PHORON_IMMUNE)) - if(held_item == r_hand) - apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_R_HAND) - else if(held_item == l_hand) - apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_L_HAND) - else - adjustFireLoss(GLOB.vsc.plc.CONTAMINATION_LOSS) + if(!(species.flags & PHORON_IMMUNE)) + for(var/obj/item/held_item in list(r_hand, l_hand, wear_suit, head, wear_mask, w_uniform, gloves, shoes)) + if(held_item.contaminated) + if(held_item.body_parts_covered & HEAD) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_HEAD, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & UPPER_TORSO) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_CHEST, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & LOWER_TORSO) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_GROIN, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & LEG_LEFT) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_L_LEG, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & LEG_RIGHT) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_R_LEG, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & ARM_LEFT) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_L_ARM, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & ARM_RIGHT) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_R_ARM, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & HAND_LEFT) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_L_HAND, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if (held_item.body_parts_covered & HAND_RIGHT) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_R_HAND, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + if(!protected) + if(held_item == r_hand) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS * gloves.permeability_coefficient, DAMAGE_BURN, BP_R_HAND, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) + else if(held_item == l_hand) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS * gloves.permeability_coefficient, DAMAGE_BURN, BP_L_HAND, "Contamination burns", DAMAGE_FLAG_IGNORE_PROSTHETICS, 100, TRUE) if (intoxication) handle_intoxication() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2bcaa02e77d..88c13c7835e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -423,7 +423,7 @@ default behaviour is: src.updatehealth() // damage ONE external organ, organ gets randomly selected from damaged ones. -/mob/living/proc/take_organ_damage(var/brute, var/burn, var/emp=0) +/mob/living/proc/take_organ_damage(var/brute, var/burn, var/emp=0, var/used_weapon = null, var/damage_flags, var/silent) if(status_flags & GODMODE) return 0 //godmode adjustBruteLoss(brute) adjustFireLoss(burn) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 9ac09619ec1..1f8acb92216 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -10,6 +10,9 @@ #define FRACTURE_AND_TENDON_DAM_THRESHOLD 30 // if a weapon does more than this amount of damage, it's powerful enough to sever the tendon AND fracture the bone, if it's a sharp weapon +///How long before a wound starts autohealing without treatment +#define HEALING_DELAY 60 SECONDS + /obj/item/organ/external name = "external" min_broken_damage = 30 @@ -437,6 +440,9 @@ if((brute <= 0) && (burn <= 0)) return 0 + if(damage_flags & DAMAGE_FLAG_IGNORE_PROSTHETICS && BP_IS_ROBOTIC(src)) + return 0 + var/laser = (damage_flags & DAMAGE_FLAG_LASER) var/sharp = (damage_flags & DAMAGE_FLAG_SHARP) var/edge = (damage_flags & DAMAGE_FLAG_EDGE) @@ -993,8 +999,10 @@ Note that amputating the affected organ does in fact remove the infection from t var/heal_amt = 0 // if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round. + // Only autoheal if wound was created or enlarged more than 10 seconds ago, this is so damage over time effects don't need to be larger than the autoheal speed if (updatehud && brute_ratio < 50 && burn_ratio < 50 && W.can_autoheal()) - heal_amt += 0.5 + if (W.created + HEALING_DELAY <= world.time || W.bandaged || W.salved) + heal_amt += 0.5 //we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime heal_amt *= wound_update_accuracy diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index c4e99d86a8a..7d8d7c74255 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -466,7 +466,8 @@ ABSTRACT_TYPE(/singleton/reagent/alcohol) value = 0.2 /singleton/reagent/acid/affect_blood(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) - M.take_organ_damage(0, removed * power) + M.take_organ_damage(0, removed * power, used_weapon = "Acid burns", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) + /singleton/reagent/acid/affect_breathe(var/mob/living/carbon/human/H, var/alien, var/removed, var/datum/reagents/holder) . = ..() @@ -516,7 +517,7 @@ ABSTRACT_TYPE(/singleton/reagent/alcohol) return if(REAGENT_VOLUME(holder, type) < meltdose) // Not enough to melt anything - M.take_organ_damage(0, removed * power * 0.2) //burn damage, since it causes chemical burns. Acid doesn't make bones shatter, like brute trauma would. + M.take_organ_damage(0, removed * power * 0.2, used_weapon = "Acid burns", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) //burn damage, since it causes chemical burns. Acid doesn't make bones shatter, like brute trauma would. return if(!M.unacidable && removed > 0) if(ishuman(M) && REAGENT_VOLUME(holder, type) >= meltdose) @@ -529,7 +530,7 @@ ABSTRACT_TYPE(/singleton/reagent/alcohol) H.emote("scream") H.status_flags |= DISFIGURED else - M.take_organ_damage(0, removed * power * 0.1) // Balance. The damage is instant, so it's weaker. 10 units -> 5 damage, double for pacid. 120 units beaker could deal 60, but a) it's burn, which is not as dangerous, b) it's a one-use weapon, c) missing with it will splash it over the ground and d) clothes give some protection, so not everything will hit + M.take_organ_damage(0, removed * power * 0.1, used_weapon = "Acid burns", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) // Balance. The damage is instant, so it's weaker. 10 units -> 5 damage, double for pacid. 120 units beaker could deal 60, but a) it's burn, which is not as dangerous, b) it's a one-use weapon, c) missing with it will splash it over the ground and d) clothes give some protection, so not everything will hit /singleton/reagent/acid/touch_obj(var/obj/O, var/amount, var/datum/reagents/holder) if(O.unacidable) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drugs.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drugs.dm index 20bdfe7433f..0e5812d12ad 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drugs.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drugs.dm @@ -420,7 +420,8 @@ to_chat(M, SPAN_GOOD(pick("You feel pumped!", "Energy, energy, energy - so much energy!", "You could run a marathon!", "You can't sit still!", "It's difficult to focus right now... but that's not important!"))) if(prob(5)) // average of 6 brute every 20 seconds. M.visible_message("[M] shudders violently.", "You shudder uncontrollably, it hurts.") - M.take_organ_damage(6 * removed, 0) + M.take_organ_damage(6 * removed, 0, used_weapon = "Stimm tissue damage", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) + /singleton/reagent/toxin/stimm/final_effect(mob/living/carbon/M, datum/reagents/holder) M.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/stimm) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm index 9c9fe4d4728..5039ca388f1 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm @@ -798,7 +798,7 @@ to_chat(M, SPAN_DANGER(pick("Your heart is beating rapidly!", "Your chest hurts!", "You've totally over-exerted yourself!"))) if(prob(M.chem_doses[type] / 3)) M.visible_message("[M] twitches violently, grimacing.", "You twitch violently and feel yourself sprain a joint.") - M.take_organ_damage(5 * removed, 0) + M.take_organ_damage(5 * removed, 0, used_weapon = "Hyperzine overdose", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) M.adjustHalLoss(15) /singleton/reagent/hyperzine/final_effect(mob/living/carbon/M, datum/reagents/holder) @@ -892,7 +892,7 @@ /singleton/reagent/hyronalin/overdose(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) if(prob(60)) - M.take_organ_damage(4 * removed, 0) //Hyronaline OD deals brute damage to the same degree as Arithrazine + M.take_organ_damage(8 * removed, 0, used_weapon = "Hyronaline overdose", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) /singleton/reagent/arithrazine name = "Arithrazine" @@ -922,11 +922,11 @@ M.apply_radiation(-280 * removed) M.add_chemical_effect(CE_ITCH, M.chem_doses[type]/2) if(prob(60)) - M.take_organ_damage(8 * removed, 0) + M.take_organ_damage(8 * removed, 0, used_weapon = "Arithrazine tissue damage", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) /singleton/reagent/arithrazine/overdose(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) if(prob(50)) - M.take_organ_damage(6 * removed, 0) //Even more collateral damage dealt by arithrazine when overdosed. + M.take_organ_damage(6 * removed, 0, used_weapon = "Arithrazine overdose", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) //Even more collateral damage dealt by arithrazine when overdosed. /singleton/reagent/thetamycin name = "Thetamycin" @@ -2081,7 +2081,7 @@ to_chat(M, SPAN_WARNING(pick("You have a headache!", "Energy, energy, energy - so much energy!", "You can't sit still!", "It's difficult to focus right now... but that's not important!", "Your heart is beating rapidly!", "Your chest hurts!", "You've totally over-exerted yourself!"))) if(prob(M.chem_doses[type] / 3)) M.emote(pick("twitch", "blink_r", "shiver")) - M.take_organ_damage(5 * removed, 0) + M.take_organ_damage(5 * removed, 0, used_weapon = "Caffeine overdose", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) M.adjustHalLoss(15) /singleton/reagent/caffeine/final_effect(mob/living/carbon/M, alien, removed, datum/reagents/holder) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 48a1ab8fb3a..523f5d1859e 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -183,7 +183,7 @@ if((alien == IS_VAURCA) || (istype(P) && P.stage >= 3)) return - M.take_organ_damage(0, removed * 0.3) //being splashed directly with phoron causes minor chemical burns + M.take_organ_damage(0, removed * 0.3, used_weapon = "Phoron chemical burns", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) //being splashed directly with phoron causes minor chemical burns if(prob(50)) M.pl_effects() @@ -194,7 +194,7 @@ if((alien == IS_VAURCA) || (istype(P) && P.stage >= 3)) return - M.take_organ_damage(0, removed * 0.6) //Breathing phoron? Oh hell no boy my boy. + M.take_organ_damage(0, removed * 0.6, used_weapon = "Phoron inhalation", damage_flags = DAMAGE_FLAG_IGNORE_PROSTHETICS, silent = TRUE) //Breathing phoron? Oh hell no boy my boy. if(prob(50)) M.pl_effects() diff --git a/html/changelogs/Fenodyree-ChemDamageOverTimeFix.yml b/html/changelogs/Fenodyree-ChemDamageOverTimeFix.yml new file mode 100644 index 00000000000..8b8b62a8406 --- /dev/null +++ b/html/changelogs/Fenodyree-ChemDamageOverTimeFix.yml @@ -0,0 +1,12 @@ +author: Fenodyree + +delete-after: True + +changes: + - rscadd: "Adds a 60 second delay before wounds start autohealing. This allows dps to be less than 1, as autoheal is 1HP/s." + - bugfix: "Fixes chemicals that deal brute or burn damage doing nothing, they dealt less than 1 dps, so they were healing faster than they hurt." + - bugfix: "Fixes chemicals that deal brute or burn damaging your robotic limbs. They still damage robotic internal organs, if they did already." + - bugfix: "Fixes contamination checking if your internal organs are contaminated." + - bugfix: "Fixes contamination damaging all bodyparts, not just the ones covered." + - bugfix: "Fixes contamination damaging hands, even when wearing gloves that should protect you." + - bugfix: "Fixes impermeable items, like oxygen tanks, immediately getting contaminated. It is now a 10% chance per tick, multiplied by item permeability."