From c23d6f01135708b08efad43d73f4d051839e8fe7 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Tue, 17 Sep 2019 01:08:37 +0100 Subject: [PATCH 01/47] I missed an earlier port. --- code/__DEFINES/DNA.dm | 6 + code/__DEFINES/misc.dm | 2 +- code/__DEFINES/obj_flags.dm | 8 ++ code/__DEFINES/stat.dm | 3 + code/__HELPERS/game.dm | 38 +++++ code/controllers/subsystem/blackbox.dm | 3 +- code/datums/datumvars.dm | 6 +- .../diseases/advance/symptoms/choking.dm | 2 +- .../diseases/advance/symptoms/confusion.dm | 2 +- .../diseases/advance/symptoms/sensory.dm | 2 +- .../diseases/advance/symptoms/vision.dm | 2 +- code/datums/diseases/appendicitis.dm | 2 + code/datums/diseases/brainrot.dm | 6 +- code/datums/martial/cqc.dm | 2 +- code/datums/martial/psychotic_brawl.dm | 2 +- code/datums/martial/sleeping_carp.dm | 2 +- code/datums/status_effects/buffs.dm | 4 +- code/datums/traits/negative.dm | 2 +- code/game/machinery/Sleeper.dm | 2 +- code/game/machinery/cloning.dm | 10 +- .../mecha/equipment/tools/medical_tools.dm | 2 +- .../circuitboards/machine_circuitboards.dm | 1 + code/game/objects/items/defib.dm | 46 ++++-- .../objects/items/devices/dogborg_sleeper.dm | 2 +- code/game/objects/items/devices/scanners.dm | 68 +++++++-- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/storage/book.dm | 2 +- code/game/objects/items/twohanded.dm | 2 +- .../crates_lockers/closets/secure/freezer.dm | 18 +++ code/game/objects/structures/morgue.dm | 4 + code/modules/admin/secrets.dm | 2 +- code/modules/admin/topic.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 2 +- .../antagonists/abductor/equipment/gland.dm | 2 +- .../antagonists/changeling/changeling.dm | 2 +- .../clockcult/clock_items/clockwork_armor.dm | 2 +- .../antagonists/slaughter/slaughter.dm | 1 + .../kitchen_machinery/smartfridge.dm | 63 +++++++- .../jobs/job_types/civilian_chaplain.dm | 2 +- code/modules/library/lib_codex_gigas.dm | 4 +- code/modules/mapping/mapping_helpers.dm | 2 +- code/modules/mob/living/brain/MMI.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 136 ++++++++++++++++-- code/modules/mob/living/brain/life.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 3 +- .../modules/mob/living/carbon/damage_procs.dm | 45 +++++- .../mob/living/carbon/human/human_defense.dm | 47 +++++- code/modules/mob/living/carbon/human/life.dm | 2 +- .../mob/living/carbon/human/species.dm | 15 +- .../carbon/human/species_types/dullahan.dm | 4 +- .../human/species_types/shadowpeople.dm | 1 + code/modules/mob/living/carbon/life.dm | 41 ++++-- code/modules/mob/living/damage_procs.dm | 16 +-- code/modules/mob/living/emote.dm | 2 +- code/modules/mob/living/living.dm | 6 +- .../mob/living/silicon/damage_procs.dm | 4 +- .../mob/living/silicon/pai/pai_defense.dm | 8 +- code/modules/mob/transform_procs.dm | 4 +- .../projectile/special/mindflayer.dm | 2 +- .../chemistry/reagents/alcohol_reagents.dm | 4 +- .../chemistry/reagents/drug_reagents.dm | 32 ++--- .../chemistry/reagents/food_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 18 ++- .../chemistry/reagents/other_reagents.dm | 8 +- .../chemistry/reagents/toxin_reagents.dm | 2 +- .../nanites/nanite_programs/healing.dm | 12 +- .../research/nanites/nanite_programs/rogue.dm | 2 +- .../xenobiology/crossbreeding/consuming.dm | 2 +- code/modules/surgery/advanced/brainwashing.dm | 2 +- code/modules/surgery/advanced/lobotomy.dm | 5 +- code/modules/surgery/advanced/revival.dm | 4 +- code/modules/surgery/brain_surgery.dm | 4 +- code/modules/surgery/coronary_bypass.dm | 77 ++++++++++ code/modules/surgery/eye_surgery.dm | 2 +- code/modules/surgery/lobectomy.dm | 46 ++++++ code/modules/surgery/organs/appendix.dm | 18 ++- code/modules/surgery/organs/augments_arms.dm | 5 +- code/modules/surgery/organs/augments_chest.dm | 2 +- .../surgery/organs/augments_internal.dm | 7 +- code/modules/surgery/organs/ears.dm | 8 ++ code/modules/surgery/organs/lungs.dm | 2 +- code/modules/surgery/organs/vocal_cords.dm | 2 +- code/modules/vehicles/scooter.dm | 4 +- code/modules/zombie/items.dm | 2 +- .../code/datums/status_effects/chems.dm | 18 +-- .../reagents/chemistry/reagents/MKUltra.dm | 4 +- .../modules/reagents/reagents/cit_reagents.dm | 6 +- .../modules/vore/resizing/sizechemicals.dm | 2 +- 88 files changed, 777 insertions(+), 202 deletions(-) create mode 100644 code/modules/surgery/coronary_bypass.dm create mode 100644 code/modules/surgery/lobectomy.dm diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm index 4ed099d9e2..1719ea068e 100644 --- a/code/__DEFINES/DNA.dm +++ b/code/__DEFINES/DNA.dm @@ -99,6 +99,7 @@ #define NOEYES 16 #define MARKINGS 17 +//organ slots #define ORGAN_SLOT_BRAIN "brain" #define ORGAN_SLOT_APPENDIX "appendix" #define ORGAN_SLOT_RIGHT_ARM_AUG "r_arm_device" @@ -122,3 +123,8 @@ #define ORGAN_SLOT_BRAIN_ANTISTUN "brain_antistun" #define ORGAN_SLOT_TAIL "tail" #define ORGAN_SLOT_PENIS "penis" + +////organ defines +#define STANDARD_ORGAN_THRESHOLD 100 +#define STANDARD_ORGAN_HEALING 0.001 +#define STANDARD_ORGAN_DECAY 0.00222 //designed to fail organs when left to decay for ~15 minutes \ No newline at end of file diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index c71780e7e9..7821e5adf5 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -314,7 +314,7 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S #define MAP_MAXZ 6 // Defib stats -#define DEFIB_TIME_LIMIT 120 +#define DEFIB_TIME_LIMIT 960 #define DEFIB_TIME_LOSS 60 // Diagonal movement diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 01d95d7ff9..22bced0b39 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -38,3 +38,11 @@ #define THICKMATERIAL (1<<5) //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body. #define VOICEBOX_TOGGLABLE (1<<6) // The voicebox in this clothing can be toggled. #define VOICEBOX_DISABLED (1<<7) // The voicebox is currently turned off. + +/// Flags for the organ_flags var on /obj/item/organ + +#define ORGAN_SYNTHETIC (1<<0) //Synthetic organs, or cybernetic organs. Reacts to EMPs and don't deteriorate or heal +#define ORGAN_FROZEN (1<<1) //Frozen organs, don't deteriorate +#define ORGAN_FAILING (1<<2) //Failing organs perform damaging effects until replaced or fixed +#define ORGAN_EXTERNAL (1<<3) //Was this organ implanted/inserted/etc, if true will not be removed during species change. +#define ORGAN_VITAL (1<<4) //Currently only the brain diff --git a/code/__DEFINES/stat.dm b/code/__DEFINES/stat.dm index 1d3ea1347a..b975aa1f89 100644 --- a/code/__DEFINES/stat.dm +++ b/code/__DEFINES/stat.dm @@ -8,6 +8,9 @@ #define UNCONSCIOUS 2 #define DEAD 3 +//Maximum healthiness an individual can have +#define MAX_SATIETY 600 + // bitflags for machine stat variable #define BROKEN (1<<0) #define NOPOWER (1<<1) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index c741a08108..cc0bd3e0b4 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -159,6 +159,44 @@ processing_list.Cut(1, 2) processing_list += A.contents +/** recursive_organ_check + * inputs: O (object to start with) + * outputs: + * description: A pseudo-recursive loop based off of the recursive mob check, this check looks for any organs held + * within 'O', toggling their frozen flag. This check excludes items held within other safe organ + * storage units, so that only the lowest level of container dictates whether we do or don't decompose + */ +/proc/recursive_organ_check(atom/O) + + var/list/processing_list = list(O) + var/list/processed_list = list() + var/index = 1 + var/obj/item/organ/found_organ + + while(index <= length(processing_list)) + + var/atom/A = processing_list[index] + + if(istype(A, /obj/item/organ)) + found_organ = A + found_organ.organ_flags ^= ORGAN_FROZEN + + else if(istype(A, /mob/living/carbon)) + var/mob/living/carbon/Q = A + for(var/organ in Q.internal_organs) + found_organ = organ + found_organ.organ_flags ^= ORGAN_FROZEN + + for(var/atom/B in A) //objects held within other objects are added to the processing list, unless that object is something that can hold organs safely + if(!processed_list[B] && !istype(B, /obj/structure/closet/crate/freezer) && !istype(B, /obj/structure/closet/secure_closet/freezer)) + processing_list+= B + + index++ + processed_list[A] = A + + return + + // Better recursive loop, technically sort of not actually recursive cause that shit is retarded, enjoy. //No need for a recursive limit either /proc/recursive_mob_check(atom/O,client_check=1,sight_check=1,include_radio=1) diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 72dfed6af0..7cb46f594a 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -294,7 +294,8 @@ Versioning var/lakey = L.lastattackerckey var/sqlbrute = L.getBruteLoss() var/sqlfire = L.getFireLoss() - var/sqlbrain = L.getBrainLoss() + var/sqlbrain = L.getOrganLoss(ORGAN_SLOT_BRAIN) + var/sqlbrain = L.getOrganLoss(ORGAN_SLOT_BRAIN) var/sqloxy = L.getOxyLoss() var/sqltox = L.getToxLoss() var/sqlclone = L.getCloneLoss() diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index f0fb7f6095..93eb764c3f 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -94,7 +94,7 @@ TOXIN:[M.getToxLoss()] OXY:[M.getOxyLoss()] CLONE:[M.getCloneLoss()] - BRAIN:[M.getBrainLoss()] + BRAIN:[M.getOrganLoss(ORGAN_SLOT_BRAIN)] STAMINA:[M.getStaminaLoss()] AROUSAL:[M.getArousalLoss()] @@ -1334,8 +1334,8 @@ L.adjustOxyLoss(amount) newamt = L.getOxyLoss() if("brain") - L.adjustBrainLoss(amount) - newamt = L.getBrainLoss() + L.adjustOrganLoss(ORGAN_SLOT_BRAIN, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_BRAIN) if("clone") L.adjustCloneLoss(amount) newamt = L.getCloneLoss() diff --git a/code/datums/diseases/advance/symptoms/choking.dm b/code/datums/diseases/advance/symptoms/choking.dm index 81cdad8042..a54b132de1 100644 --- a/code/datums/diseases/advance/symptoms/choking.dm +++ b/code/datums/diseases/advance/symptoms/choking.dm @@ -144,5 +144,5 @@ Bonus /datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A) var/get_damage = rand(25,35) * power M.adjustOxyLoss(get_damage) - M.adjustBrainLoss(get_damage/2) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2) return 1 diff --git a/code/datums/diseases/advance/symptoms/confusion.dm b/code/datums/diseases/advance/symptoms/confusion.dm index e7315c6bb1..260c6888d7 100644 --- a/code/datums/diseases/advance/symptoms/confusion.dm +++ b/code/datums/diseases/advance/symptoms/confusion.dm @@ -55,7 +55,7 @@ Bonus to_chat(M, "You can't think straight!") M.confused = min(100 * power, M.confused + 8) if(brain_damage) - M.adjustBrainLoss(3 * power, 80) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3 * power, 80) M.updatehealth() return diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm index 8d7cc5ed70..438adec7b9 100644 --- a/code/datums/diseases/advance/symptoms/sensory.dm +++ b/code/datums/diseases/advance/symptoms/sensory.dm @@ -51,7 +51,7 @@ M.hallucination = max(0, M.hallucination - 10) if(A.stage >= 5) - M.adjustBrainLoss(-3) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -3) if(trauma_heal_mild && iscarbon(M)) var/mob/living/carbon/C = M if(prob(10)) diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm index d1cc6905a6..fa36b1c08a 100644 --- a/code/datums/diseases/advance/symptoms/vision.dm +++ b/code/datums/diseases/advance/symptoms/vision.dm @@ -45,7 +45,7 @@ Bonus return var/mob/living/carbon/M = A.affected_mob var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES) - if(istype(eyes)) + if(eyes) switch(A.stage) if(1, 2) if(prob(base_message_chance) && !suppress_warning) diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index 5708447542..be7e6ceecd 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -27,8 +27,10 @@ A.update_icon() if(prob(3)) to_chat(affected_mob, "You feel a stabbing pain in your abdomen!") + affected_mob.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 5) affected_mob.Stun(rand(40,60)) affected_mob.adjustToxLoss(1) if(3) if(prob(1)) affected_mob.vomit(95) + affected_mob.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 15) diff --git a/code/datums/diseases/brainrot.dm b/code/datums/diseases/brainrot.dm index 0a34501763..98ae74270b 100644 --- a/code/datums/diseases/brainrot.dm +++ b/code/datums/diseases/brainrot.dm @@ -24,7 +24,7 @@ if(prob(2)) to_chat(affected_mob, "You don't feel like yourself.") if(prob(5)) - affected_mob.adjustBrainLoss(1, 170) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1, 170) affected_mob.updatehealth() if(3) if(prob(2)) @@ -32,7 +32,7 @@ if(prob(2)) affected_mob.emote("drool") if(prob(10)) - affected_mob.adjustBrainLoss(2, 170) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2, 170) affected_mob.updatehealth() if(prob(2)) to_chat(affected_mob, "Your try to remember something important...but can't.") @@ -43,7 +43,7 @@ if(prob(2)) affected_mob.emote("drool") if(prob(15)) - affected_mob.adjustBrainLoss(3, 170) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 170) affected_mob.updatehealth() if(prob(2)) to_chat(affected_mob, "Strange buzzing fills your head, removing all thoughts.") diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm index 71545476ff..c7644997ee 100644 --- a/code/datums/martial/cqc.dm +++ b/code/datums/martial/cqc.dm @@ -79,7 +79,7 @@ "[A] kicks your head, knocking you out!") playsound(get_turf(A), 'sound/weapons/genhit1.ogg', 50, 1, -1) D.SetSleeping(300) - D.adjustBrainLoss(15, 150) + D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 150) return TRUE /datum/martial_art/cqc/proc/Pressure(mob/living/carbon/human/A, mob/living/carbon/human/D) diff --git a/code/datums/martial/psychotic_brawl.dm b/code/datums/martial/psychotic_brawl.dm index 8f1a33a8b3..34301516dc 100644 --- a/code/datums/martial/psychotic_brawl.dm +++ b/code/datums/martial/psychotic_brawl.dm @@ -46,7 +46,7 @@ D.apply_damage(rand(5,10), BRUTE, BODY_ZONE_HEAD) A.apply_damage(rand(5,10), BRUTE, BODY_ZONE_HEAD) if(!istype(D.head,/obj/item/clothing/head/helmet/) && !istype(D.head,/obj/item/clothing/head/hardhat)) - D.adjustBrainLoss(5) + D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5) A.Stun(rand(10,45)) D.Knockdown(rand(5,30))//CIT CHANGE - makes stuns from martial arts always use Knockdown instead of Stun for the sake of consistency if(5,6) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index e205d7a435..801e8c8c7a 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -224,7 +224,7 @@ H.visible_message("[user] delivers a heavy hit to [H]'s head, knocking [H.p_them()] out cold!", \ "[user] knocks you unconscious!") H.SetSleeping(600) - H.adjustBrainLoss(15, 150) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 150) else return ..() diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 336945f622..563d06ca57 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -521,7 +521,7 @@ itemUser.adjustToxLoss(-1.5, forced = TRUE) //Because Slime People are people too itemUser.adjustOxyLoss(-1.5) itemUser.adjustStaminaLoss(-1.5) - itemUser.adjustBrainLoss(-1.5) + itemUser.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1.5) itemUser.adjustCloneLoss(-0.5) //Becasue apparently clone damage is the bastion of all health //Heal all those around you, unbiased for(var/mob/living/L in view(7, owner)) @@ -533,7 +533,7 @@ L.adjustToxLoss(-3.5, forced = TRUE) //Because Slime People are people too L.adjustOxyLoss(-3.5) L.adjustStaminaLoss(-3.5) - L.adjustBrainLoss(-3.5) + L.adjustOrganLoss(ORGAN_SLOT_BRAIN, -3.5) L.adjustCloneLoss(-1) //Becasue apparently clone damage is the bastion of all health else if(issilicon(L)) L.adjustBruteLoss(-3.5) diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index f77fe37333..62cb8e0999 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -119,7 +119,7 @@ medical_record_text = "Patient has a tumor in their brain that is slowly driving them to brain death." /datum/quirk/brainproblems/on_process() - quirk_holder.adjustBrainLoss(0.2) + quirk_holder.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2) /datum/quirk/nearsighted //t. errorage name = "Nearsighted" diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 76ea855c77..5b56050cfd 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -146,7 +146,7 @@ data["occupant"]["toxLoss"] = mob_occupant.getToxLoss() data["occupant"]["fireLoss"] = mob_occupant.getFireLoss() data["occupant"]["cloneLoss"] = mob_occupant.getCloneLoss() - data["occupant"]["brainLoss"] = mob_occupant.getBrainLoss() + data["occupant"]["brainLoss"] = mob_occupant.getOrganLoss(ORGAN_SLOT_BRAIN) data["occupant"]["reagents"] = list() if(mob_occupant.reagents && mob_occupant.reagents.reagent_list.len) for(var/datum/reagent/R in mob_occupant.reagents.reagent_list) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index a175558f74..efb357f295 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -241,13 +241,14 @@ var/obj/item/I = pick_n_take(unattached_flesh) if(isorgan(I)) var/obj/item/organ/O = I + O.organ_flags &= ~ORGAN_FROZEN O.Insert(mob_occupant) else if(isbodypart(I)) var/obj/item/bodypart/BP = I BP.attach_limb(mob_occupant) //Premature clones may have brain damage. - mob_occupant.adjustBrainLoss(-((speed_coeff / 2) * dmg_mult)) + mob_occupant.adjustOrganLoss(ORGAN_SLOT_BRAIN, -((speed_coeff / 2) * dmg_mult)) use_power(7500) //This might need tweaking. @@ -261,6 +262,7 @@ for(var/i in unattached_flesh) if(isorgan(i)) var/obj/item/organ/O = i + O.organ_flags &= ~ORGAN_FROZEN O.Insert(mob_occupant) else if(isbodypart(i)) var/obj/item/bodypart/BP = i @@ -346,6 +348,9 @@ if(mess) //Clean that mess and dump those gibs! for(var/obj/fl in unattached_flesh) fl.forceMove(T) + if(istype(fl, /obj/item/organ)) + var/obj/item/organ/O = fl + O.organ_flags &= ~ORGAN_FROZEN unattached_flesh.Cut() mess = FALSE new /obj/effect/gibspawner/generic(get_turf(src)) @@ -458,8 +463,9 @@ for(var/o in H.internal_organs) var/obj/item/organ/organ = o - if(!istype(organ) || organ.vital) + if(!istype(organ) || (organ.organ_flags & ORGAN_VITAL)) continue + organ.organ_flags |= ORGAN_FROZEN organ.Remove(H, special=TRUE) organ.forceMove(src) unattached_flesh += organ diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 21bbdfd14b..ae3fdb15b4 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -166,7 +166,7 @@ Toxin Content: [patient.getToxLoss()]%
Burn Severity: [patient.getFireLoss()]%
[patient.getCloneLoss() ? "Subject appears to have cellular damage." : ""]
- [patient.getBrainLoss() ? "Significant brain damage detected." : ""]
+ [patient.getOrganLoss(ORGAN_SLOT_BRAIN) ? "Significant brain damage detected." : ""]
[length(patient.get_traumas()) ? "Brain Traumas detected." : ""]
"} diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 2a01a7e18f..639d570462 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -399,6 +399,7 @@ /obj/machinery/smartfridge/food = "food", /obj/machinery/smartfridge/drinks = "drinks", /obj/machinery/smartfridge/extract = "slimes", + /obj/machinery/smartfridge/organ = "organs", /obj/machinery/smartfridge/chemistry = "chems", /obj/machinery/smartfridge/chemistry/virology = "viruses", /obj/machinery/smartfridge/disks = "disks") diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 5bef86c6d2..c2c7dbfabc 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -440,9 +440,20 @@ do_help(H, user) -/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H) +/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H) //Our code here is different than tg, if it breaks in testing; BUG_PROBABLE_CAUSE + var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart) + if(H.suiciding || H.hellbound || HAS_TRAIT(H, TRAIT_HUSK)) + return + if((world.time - H.timeofdeath) > tlimit) + return + if((H.getBruteLoss() >= MAX_REVIVE_BRUTE_DAMAGE) || (H.getFireLoss() >= MAX_REVIVE_FIRE_DAMAGE)) + return + if(!heart || (heart.organ_flags & ORGAN_FAILING)) + return var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) - return (!H.suiciding && !(HAS_TRAIT(H, TRAIT_NOCLONE)) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain) + if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided) + return + return TRUE /obj/item/twohanded/shockpaddles/proc/shock_touching(dmg, mob/H) if(req_defib) @@ -558,13 +569,12 @@ user.visible_message("[user] places [src] on [H]'s chest.", "You place [src] on [H]'s chest.") playsound(src, 'sound/machines/defib_charge.ogg', 75, 0) var/tplus = world.time - H.timeofdeath - // past this much time the patient is unrecoverable - // (in deciseconds) - // brain damage starts setting in on the patient after - // some time left rotting + // patients rot when they are killed, and die when they are dead var/tloss = deathtimer var/total_burn = 0 var/total_brute = 0 + var/tplus = world.time - H.timeofdeath //length of time spent dead + var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart) if(do_after(user, primetimer2, target = H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total for(var/obj/item/carried_item in H.contents) if(istype(carried_item, /obj/item/clothing/suit/space)) @@ -589,16 +599,26 @@ failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's soul appears to be on another plane of existence. Further attempts futile." else if (tplus > tlimit) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Body has decayed for too long. Further attempts futile." - else if (!H.getorgan(/obj/item/organ/heart)) + else if (!heart) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's heart is missing." + else if (heart.organ_flags & ORGAN_FAILING) + failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's heart too damaged." else if(total_burn >= 180 || total_brute >= 180) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Severe tissue damage makes recovery of patient impossible via defibrillator. Further attempts futile." else if(H.get_ghost()) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No activity in patient's brain. Further attempts may be successful." else var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) - if(!BR || BR.damaged_brain) - failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing or damaged beyond point of no return. Further attempts futile." + if(BR) //BUG_PROBABLE_CAUSE - slight difference between us and tg + if(BR.organ_flags & ORGAN_FAILING) + failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain tissue is damaged making recovery of patient impossible via defibrillator. Further attempts futile." + if(BR.brain_death) + failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain damaged beyond point of no return. Further attempts futile." + if(BR.suicided || BR.brainmob?.suiciding) + failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No intelligence pattern can be detected in patient's brain. Further attempts futile." + else + failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing. Further attempts futile." + if(failed) user.visible_message(failed) @@ -623,7 +643,7 @@ H.Jitter(100) SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK) if(tplus > tloss) - H.adjustBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100))), 150) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, max(0, min(99, ((tlimit - tplus) / tlimit * 100))), 150) log_combat(user, H, "revived", defib) if(req_defib) if(defib.healdisk) @@ -641,7 +661,11 @@ playsound(src, 'sound/machines/defib_failed.ogg', 50, 0) else if(H.undergoing_cardiac_arrest()) H.set_heartattack(FALSE) - user.visible_message("[req_defib ? "[defib]" : "[src]"] pings: Patient's heart is now beating again.") + if(!(heart.organ_flags & ORGAN_FAILING)) + H.set_heartattack(FALSE) + user.visible_message("[req_defib ? "[defib]" : "[src]"] pings: Patient's heart is now beating again.") + else + user.visible_message("[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed, heart damage detected.") playsound(src, 'sound/machines/defib_zap.ogg', 50, 1, -1) diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index 7f3c7f3bfc..ca1648bb07 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -211,7 +211,7 @@ data["occupant"]["toxLoss"] = mob_occupant.getToxLoss() data["occupant"]["fireLoss"] = mob_occupant.getFireLoss() data["occupant"]["cloneLoss"] = mob_occupant.getCloneLoss() - data["occupant"]["brainLoss"] = mob_occupant.getBrainLoss() + data["occupant"]["brainLoss"] = mob_occupant.getOrganLoss(ORGAN_SLOT_BRAIN) data["occupant"]["reagents"] = list() if(mob_occupant.reagents.reagent_list.len) for(var/datum/reagent/R in mob_occupant.reagents.reagent_list) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 0059938720..a546a83732 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -135,7 +135,7 @@ SLIME SCANNER var/mob/living/carbon/human/H = M if(H.undergoing_cardiac_arrest() && H.stat != DEAD) to_chat(user, "Subject suffering from heart attack: Apply defibrillation or other electric shock immediately!") - if(H.undergoing_liver_failure() && H.stat != DEAD) + if(H.undergoing_liver_failure() && H.stat != DEAD) //might be depreciated BUG_PROBABLE_CAUSE to_chat(user, "Subject is suffering from liver failure: Apply Corazone and begin a liver transplant immediately!") var/msg = "*---------*\nAnalyzing results for [M]:\n\tOverall status: [mob_status]\n" @@ -157,12 +157,8 @@ SLIME SCANNER msg += "\tSubject appears to have [M.getCloneLoss() > 30 ? "Severe" : "Minor"] cellular damage.\n" if(advanced) msg += "\tCellular Damage Level: [M.getCloneLoss()].\n" - if (M.getBrainLoss() >= 200 || !M.getorgan(/obj/item/organ/brain)) - msg += "\tSubject's brain function is non-existent.\n" - else if (M.getBrainLoss() >= 120) - msg += "\tSevere brain damage detected. Subject likely to have mental traumas.\n" - else if (M.getBrainLoss() >= 45) - msg += "\tBrain damage detected.\n" + if (!M.getorgan(/obj/item/organ/brain)) + to_chat(user, "\tSubject lacks a brain.") //Unsure how this won't proc for 50% of the cit playerbase (This is a joke everyone on cit a cute.) if(ishuman(M) && advanced) // Should I make this not advanced? var/mob/living/carbon/human/H = M var/obj/item/organ/liver/L = H.getorganslot("liver") @@ -212,7 +208,7 @@ SLIME SCANNER if(C.roundstart_quirks.len) msg += "\tSubject has the following physiological traits: [C.get_trait_string()].\n" if(advanced) - msg += "\tBrain Activity Level: [(200 - M.getBrainLoss())/2]%.\n" + msg += "\tBrain Activity Level: [(200 - M.getOrganLoss(ORGAN_SLOT_BRAIN))/2]%.\n" if(M.radiation) msg += "\tSubject is irradiated.\n" if(advanced) @@ -296,6 +292,62 @@ SLIME SCANNER msg += "\tDamage: Brute-Burn-Toxin-Suffocation\n\t\tSpecifics: [brute_loss]-[fire_loss]-[tox_loss]-[oxy_loss]\n" for(var/obj/item/bodypart/org in damaged) msg += "\t\t[capitalize(org.name)]: [(org.brute_dam > 0) ? "[org.brute_dam]" : "0"]-[(org.burn_dam > 0) ? "[org.burn_dam]" : "0"]\n" + + //Organ damages report + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/minor_damage + var/major_damage + var/max_damage + var/report_organs = FALSE + + //Piece together the lists to be reported + for(var/O in H.internal_organs) + var/obj/item/organ/organ = O + if(organ.organ_flags & ORGAN_FAILING) + report_organs = TRUE //if we report one organ, we report all organs, even if the lists are empty, just for consistency + if(max_damage) + max_damage += ", " //prelude the organ if we've already reported an organ + max_damage += organ.name //this just slaps the organ name into the string of text + else + max_damage = "\tNon-Functional Organs: " //our initial statement + max_damage += organ.name + else if(organ.damage > organ.high_threshold) + report_organs = TRUE + if(major_damage) + major_damage += ", " + major_damage += organ.name + else + major_damage = "\tSeverely Damaged Organs: " + major_damage += organ.name + else if(organ.damage > organ.low_threshold) + report_organs = TRUE + if(minor_damage) + minor_damage += ", " + minor_damage += organ.name + else + minor_damage = "\tMildly Damaged Organs: " + minor_damage += organ.name + + if(report_organs) //we either finish the list, or set it to be empty if no organs were reported in that category + if(!max_damage) + max_damage = "\tNon-Functional Organs: " + else + max_damage += "" + if(!major_damage) + major_damage = "\tSeverely Damaged Organs: " + else + major_damage += "" + if(!minor_damage) + minor_damage = "\tMildly Damaged Organs: " + else + minor_damage += "" + to_chat(user, minor_damage) + to_chat(user, major_damage) + to_chat(user, max_damage) + //Genetic damage + if(advanced && H.has_dna()) + to_chat(user, "\tGenetic Stability: [H.dna.stability]%.") // Species and body temperature diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index cd2ccff170..95110692c9 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -254,7 +254,7 @@ to_chat(user, "The MMI indicates that their mind is currently inactive; it might change!") return - if(BM.stat == DEAD || (M.brain && M.brain.damaged_brain)) + if(BM.stat == DEAD || (M.brain && M.brain.organ_flags & ORGAN_FAILING)) to_chat(user, "Sticking a dead brain into the frame would sort of defeat the purpose!") return diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index df7b203f91..85a06f0c1e 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -140,7 +140,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", else if(iscarbon(M)) var/mob/living/carbon/C = M if(!istype(C.head, /obj/item/clothing/head)) - C.adjustBrainLoss(10, 80) + C.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10, 80) to_chat(C, "You feel dumber.") if(smack) diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 82bf2c6b5f..a126d16777 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -304,7 +304,7 @@ var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)//stole from chainsaw code var/obj/item/organ/brain/B = user.getorganslot(ORGAN_SLOT_BRAIN) - B.vital = FALSE//this cant possibly be a good idea + B.organ_flags &= ~ORGAN_VITAL //this cant possibly be a good idea var/randdir for(var/i in 1 to 24)//like a headless chicken! if(user.is_holding(src)) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm index 6e841bcd93..9dab3679fa 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm @@ -2,6 +2,24 @@ icon_state = "freezer" var/jones = FALSE +/obj/structure/closet/secure_closet/freezer/Destroy() + recursive_organ_check(src) + ..() + +/obj/structure/closet/secure_closet/freezer/Initialize() + ..() + recursive_organ_check(src) + +/obj/structure/closet/secure_closet/freezer/open(mob/living/user) + if(opened || !can_open(user)) //dupe check just so we don't let the organs decay when someone fails to open the locker + return FALSE + recursive_organ_check(src) + return ..() + +/obj/structure/closet/secure_closet/freezer/close(mob/living/user) + if(..()) //if we actually closed the locker + recursive_organ_check(src) + /obj/structure/closet/secure_closet/freezer/ex_act() if(!jones) jones = TRUE diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 09e5510d62..eaf3629718 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -31,6 +31,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an /obj/structure/bodycontainer/Initialize() . = ..() GLOB.bodycontainers += src + recursive_organ_check(src) /obj/structure/bodycontainer/Destroy() GLOB.bodycontainers -= src @@ -101,6 +102,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an /obj/structure/bodycontainer/deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/metal (loc, 5) + recursive_organ_check(src) qdel(src) /obj/structure/bodycontainer/container_resist(mob/living/user) @@ -120,6 +122,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an open() /obj/structure/bodycontainer/proc/open() + recursive_organ_check(src) playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) playsound(src, 'sound/effects/roll.ogg', 5, 1) var/turf/T = get_step(src, dir) @@ -134,6 +137,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an for(var/atom/movable/AM in connected.loc) if(!AM.anchored || AM == connected) AM.forceMove(src) + recursive_organ_check(src) update_icon() /obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user) diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 7d74387c43..9dc8b73d0e 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -458,7 +458,7 @@ SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Mass Braindamage")) for(var/mob/living/carbon/human/H in GLOB.player_list) to_chat(H, "You suddenly feel stupid.") - H.adjustBrainLoss(60, 80) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60, 80) message_admins("[key_name_admin(usr)] made everybody retarded") if("eagles")//SCRAW diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 91df9ef85c..b0b9190556 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2042,7 +2042,7 @@ if(DEAD) status = "Dead" health_description = "Status = [status]" - health_description += "
Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()] - Stamina: [L.getStaminaLoss()]" + health_description += "
Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getOrganLoss(ORGAN_SLOT_BRAIN)] - Stamina: [L.getStaminaLoss()]" else health_description = "This mob type has no health to speak of." diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index a725399b0f..c27b355ff1 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1264,7 +1264,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits target.electrocution_animation(40) to_chat(target, "The gods have punished you for your sins!") if(ADMIN_PUNISHMENT_BRAINDAMAGE) - target.adjustBrainLoss(199, 199) + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 199, 199) if(ADMIN_PUNISHMENT_GIB) target.gib(FALSE) if(ADMIN_PUNISHMENT_BSA) diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 8a3ff2186a..35a1135b92 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -151,7 +151,7 @@ if(2) to_chat(H, "You hear an annoying buzz in your head.") H.confused += 15 - H.adjustBrainLoss(10, 160) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10, 160) if(3) H.hallucination += 60 diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 252e2b5cbe..67f6bd1d46 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -83,7 +83,7 @@ if(istype(C)) var/obj/item/organ/brain/B = C.getorganslot(ORGAN_SLOT_BRAIN) if(B && (B.decoy_override != initial(B.decoy_override))) - B.vital = TRUE + B.organ_flags |= ORGAN_VITAL B.decoy_override = FALSE remove_changeling_powers() . = ..() diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm index 0ac96c47f9..88cf420420 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm @@ -50,7 +50,7 @@ to_chat(user, "The helmet tries to drive a spike through your head as you scramble to remove it!") user.emote("scream") user.apply_damage(30, BRUTE, BODY_ZONE_HEAD) - user.adjustBrainLoss(30) + user.adjustOrganLoss(ORGAN_SLOT_BRAIN, 30) addtimer(CALLBACK(user, /mob/living.proc/dropItemToGround, src, TRUE), 1) //equipped happens before putting stuff on(but not before picking items up), 1). thus, we need to wait for it to be on before forcing it off. /obj/item/clothing/head/helmet/clockwork/mob_can_equip(mob/M, mob/equipper, slot, disable_warning = 0) diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index 4f31346136..03a176b054 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -80,6 +80,7 @@ desc = "Still it beats furiously, emanating an aura of utter hate." icon = 'icons/obj/surgery.dmi' icon_state = "demon_heart-on" + decay_factor = 0 /obj/item/organ/heart/demon/update_icon() return //always beating visually diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 483055cb0d..f69333ee56 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -144,6 +144,13 @@ else O.forceMove(src) return TRUE + +///Really simple proc, just moves the object "O" into the hands of mob "M" if able, done so I could modify the proc a little for the organ fridge +/obj/machinery/smartfridge/proc/dispense(obj/item/O, var/mob/M) + if(!M.put_in_hands(O)) + O.forceMove(drop_location()) + adjust_item_drop_location(O) + /obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) @@ -197,9 +204,7 @@ if(desired == 1 && Adjacent(usr) && !issilicon(usr)) for(var/obj/item/O in src) if(O.name == params["name"]) - if(!usr.put_in_hands(O)) - O.forceMove(drop_location()) - adjust_item_drop_location(O) + dispense(O, usr) break if (visible_contents) update_icon() @@ -209,8 +214,7 @@ if(desired <= 0) break if(O.name == params["name"]) - O.forceMove(drop_location()) - adjust_item_drop_location(O) + dispense(O, usr) desired-- if (visible_contents) update_icon() @@ -378,6 +382,55 @@ /obj/machinery/smartfridge/extract/preloaded initial_contents = list(/obj/item/slime_scanner = 2) +// ------------------------- You think you're better than Chem, huh? +// Organ Surgery Smartfridge +// ------------------------- Just wait till Tamiorgans +/obj/machinery/smartfridge/organ + name = "smart organ storage" + desc = "A refrigerated storage unit for organ storage." + max_n_of_items = 20 //vastly lower to prevent processing too long + var/repair_rate = 0 + +/obj/machinery/smartfridge/organ/accept_check(obj/item/O) + if(istype(O, /obj/item/organ)) + return TRUE + return FALSE + +/obj/machinery/smartfridge/organ/load(obj/item/O) + if(..()) //if the item loads, clear can_decompose + var/obj/item/organ/organ = O + organ.organ_flags |= ORGAN_FROZEN + +/obj/machinery/smartfridge/organ/dispense(obj/item/O, var/mob/M) + var/obj/item/organ/organ = O + organ.organ_flags &= ~ORGAN_FROZEN + ..() + +/obj/machinery/smartfridge/organ/RefreshParts() + for(var/obj/item/stock_parts/matter_bin/B in component_parts) + max_n_of_items = 20 * B.rating + repair_rate = max(0, STANDARD_ORGAN_HEALING * (B.rating - 1)) + +/obj/machinery/smartfridge/organ/Destroy() + for(var/organ in src) + var/obj/item/organ/O = organ + if(O) + O.organ_flags &= ~ORGAN_FROZEN + ..() + +/obj/machinery/smartfridge/organ/process() + for(var/organ in src) + var/obj/item/organ/O = organ + if(O) + O.damage = max(0, O.damage - repair_rate) + +/obj/machinery/smartfridge/organ/deconstruct() + for(var/organ in src) + var/obj/item/organ/O = organ + if(O) + O.organ_flags &= ~ORGAN_FROZEN + ..() + // ----------------------------- // Chemistry Medical Smartfridge // ----------------------------- diff --git a/code/modules/jobs/job_types/civilian_chaplain.dm b/code/modules/jobs/job_types/civilian_chaplain.dm index 2d190cfe60..5abe1631e5 100644 --- a/code/modules/jobs/job_types/civilian_chaplain.dm +++ b/code/modules/jobs/job_types/civilian_chaplain.dm @@ -69,7 +69,7 @@ Chaplain B.name = "Guys Gone Wild" if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks", "meme", "memes") B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition") - H.adjustBrainLoss(100) // starts off retarded as fuck + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 100) // starts off retarded as fuck if("science") B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition") else diff --git a/code/modules/library/lib_codex_gigas.dm b/code/modules/library/lib_codex_gigas.dm index d3d95db974..57bf37d528 100644 --- a/code/modules/library/lib_codex_gigas.dm +++ b/code/modules/library/lib_codex_gigas.dm @@ -50,8 +50,8 @@ if(U.job in list("Curator")) // the curator is both faster, and more accurate than normal crew members at research speed = 100 correctness = 100 - correctness -= U.getBrainLoss() *0.5 //Brain damage makes researching hard. - speed += U.getBrainLoss() * 3 + correctness -= U.getOrganLoss(ORGAN_SLOT_BRAIN) *0.5 //Brain damage makes researching hard. + speed += U.getOrganLoss(ORGAN_SLOT_BRAIN) * 3 if(do_after(user, speed, 0, user)) var/usedName = devilName if(!prob(correctness)) diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index 7a875ccf9f..e2459d780a 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -213,4 +213,4 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) if(!ispath(disease_type,/datum/disease)) CRASH("Wrong disease type passed in.") var/datum/disease/D = new disease_type() - return list(component_type,D) \ No newline at end of file + return list(component_type,D) diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index bacdc4524b..cbf9b28a17 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -57,7 +57,7 @@ newbrain.brainmob = null brainmob.forceMove(src) brainmob.container = src - if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death. + if(!newbrain.organ_flags & ORGAN_FAILING) // the brain organ hasn't been beaten to death. brainmob.stat = CONSCIOUS //we manually revive the brain mob GLOB.dead_mob_list -= brainmob GLOB.alive_mob_list += brainmob diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index dafc6cf5e0..8b1ab66ba0 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -7,11 +7,19 @@ layer = ABOVE_MOB_LAYER zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_BRAIN - vital = TRUE + organ_flags |= ORGAN_VITAL attack_verb = list("attacked", "slapped", "whacked") + ///The brain's organ variables are significantly more different than the other organs, with half the decay rate for balance reasons, and twice the maxHealth + decay_factor = STANDARD_ORGAN_DECAY / 2 //30 minutes of decaying to result in a fully damaged brain, since a fast decay rate would be unfun gameplay-wise + + maxHealth = BRAIN_DAMAGE_DEATH + low_threshold = 45 + high_threshold = 120 var/mob/living/brain/brainmob = null - var/damaged_brain = FALSE //whether the brain organ is damaged. + var/organ_flags & ORGAN_FAILING = FALSE //whether the brain organ is damaged. var/decoy_override = FALSE //I apologize to the security players, and myself, who abused this, but this is going to go. + //two variables necessary for calculating whether we get a brain trauma or not + var/damage_delta = 0 var/list/datum/brain_trauma/traumas = list() @@ -90,22 +98,88 @@ if(brainmob) O.attack(brainmob, user) //Oh noooeeeee -/obj/item/organ/brain/examine(mob/user) - ..() + if(istype(O, /obj/item/organ_storage)) //BUG_PROBABLE_CAUSE + return //Borg organ bags shouldn't be killing brains - if(brainmob) - if(brainmob.client) - if(brainmob.health <= HEALTH_THRESHOLD_DEAD) - to_chat(user, "It's lifeless and severely damaged.") + if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("neurine")) //Neurine fixes dead brains + . = TRUE //don't do attack animation. + var/cached_Bdamage = brainmob?.health + var/datum/reagent/medicine/neurine/N = reagents.has_reagent("neurine") + + if(O.reagents.has_reagent("mannitol")//Just a quick way to bolster the effects if someone mixes up a batch. + N.volume *= 1.5 + + if(!O.reagents.has_reagent("neurine", 10)) + to_chat(user, "There's not enough neurine in [O] to restore [src]!") + return + + user.visible_message("[user] starts to pour the contents of [O] onto [src].", "You start to slowly pour the contents of [O] onto [src].") + if(!do_after(user, 60, TRUE, src)) + to_chat(user, "You failed to pour [O] onto [src]!") + return + + user.visible_message("[user] pours the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.", "You pour the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.") + setOrganDamage((damage - (0.10 * maxHealth)*N.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up + O.reagents.clear_reagents() + + if(cached_Bdamage) //Fixing dead brains yeilds a trauma + if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD && brainmob.health > HEALTH_THRESHOLD_DEAD) + if(prob(90)) + gain_trauma_type(BRAIN_TRAUMA_MILD) + if else(prob(50)) + gain_trauma_type(BRAIN_TRAUMA_SEVERE) + else + gain_trauma_type(BRAIN_TRAUMA_SPECIAL) + return + + if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("mannitol")) //attempt to heal the brain + . = TRUE //don't do attack animation. + var/datum/reagent/medicine/mannitol/M = reagents.has_reagent("mannitol") + if(brain_death || brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing + to_chat(user, "[src] is far too damaged, you'll have to use neurine on it!") + return + + if(!O.reagents.has_reagent("mannitol", 10)) + to_chat(user, "There's not enough mannitol in [O] to restore [src]!") + return + + user.visible_message("[user] starts to pour the contents of [O] onto [src].", "You start to slowly pour the contents of [O] onto [src].") + if(!do_after(user, 60, TRUE, src)) + to_chat(user, "You failed to pour [O] onto [src]!") + return + + user.visible_message("[user] pours the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.", "You pour the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.") + setOrganDamage((damage - (0.05 * maxHealth)*M.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up + O.reagents.clear_reagents() + return + + + +/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . += + . = ..() + + if(suicided) + . += "It's started turning slightly grey. They must not have been able to handle the stress of it all." + else if(brainmob) + if(brainmob.get_ghost(FALSE, TRUE)) + if(brain_death || brainmob.health <= HEALTH_THRESHOLD_DEAD) + . += "It's lifeless and severely damaged, only the strongest of chems will save it." + else if(organ_flags & ORGAN_FAILING) + . += "It seems to still have a bit of energy within it, but it's rather damaged... You may be able to restore it with some mannitol." else - to_chat(user, "You can feel the small spark of life still left in this one.") + . += "You can feel the small spark of life still left in this one." + else if(organ_flags & ORGAN_FAILING) + . += "It seems particularly lifeless and is rather damaged... You may be able to restore it with some mannitol incase it becomes functional again later." else - to_chat(user, "This one seems particularly lifeless. Perhaps it will regain some of its luster later.") + . += "This one seems particularly lifeless. Perhaps it will regain some of its luster later." else if(decoy_override) - to_chat(user, "This one seems particularly lifeless. Perhaps it will regain some of its luster later.") + if(organ_flags & ORGAN_FAILING) + . += "It seems particularly lifeless and is rather damaged... You may be able to restore it with some mannitol incase it becomes functional again later." + else + . += "This one seems particularly lifeless. Perhaps it will regain some of its luster later." else - to_chat(user, "This one is completely devoid of life.") + . += "This one is completely devoid of life." /obj/item/organ/brain/attack(mob/living/carbon/C, mob/user) if(!istype(C)) @@ -141,7 +215,7 @@ Insert(C) else ..() - +/* TO BE REMOVED, KEPT IN CASE OF BUGS /obj/item/organ/brain/proc/get_brain_damage() var/brain_damage_threshold = max_integrity * BRAIN_DAMAGE_INTEGRITY_MULTIPLIER var/offset_integrity = obj_integrity - (max_integrity - brain_damage_threshold) @@ -165,6 +239,42 @@ else if(adjusted_amount <= -DAMAGE_PRECISION) obj_integrity = min(max_integrity, obj_integrity-adjusted_amount) . = adjusted_amount +*/ + +/obj/item/organ/brain/on_life() + if(damage >= BRAIN_DAMAGE_DEATH) //rip + to_chat(owner, "The last spark of life in your brain fizzles out...") + owner.death() + brain_death = TRUE + +/obj/item/organ/brain/process() //needs to run in life AND death + ..() + //if we're not more injured than before, return without gambling for a trauma + if(damage <= prev_damage) + prev_damage = damage + return + damage_delta = damage - prev_damage + if(damage > BRAIN_DAMAGE_MILD) + if(prob(damage_delta * (1 + max(0, (damage - BRAIN_DAMAGE_MILD)/100)))) //Base chance is the hit damage; for every point of damage past the threshold the chance is increased by 1% //learn how to do your bloody math properly goddamnit + gain_trauma_type(BRAIN_TRAUMA_MILD) + if(damage > BRAIN_DAMAGE_SEVERE) + if(prob(damage_delta * (1 + max(0, (damage - BRAIN_DAMAGE_SEVERE)/100)))) //Base chance is the hit damage; for every point of damage past the threshold the chance is increased by 1% + if(prob(20)) + gain_trauma_type(BRAIN_TRAUMA_SPECIAL) + else + gain_trauma_type(BRAIN_TRAUMA_SEVERE) + + if (owner) + if(owner.stat < UNCONSCIOUS) //conscious or soft-crit + if(prev_damage < BRAIN_DAMAGE_MILD && damage >= BRAIN_DAMAGE_MILD) + to_chat(owner, "You feel lightheaded.") + else if(prev_damage < BRAIN_DAMAGE_SEVERE && damage >= BRAIN_DAMAGE_SEVERE) + to_chat(owner, "You feel less in control of your thoughts.") + else if(prev_damage < (BRAIN_DAMAGE_DEATH - 20) && damage >= (BRAIN_DAMAGE_DEATH - 20)) + to_chat(owner, "You can feel your mind flickering on and off...") + //update our previous damage holder after we've checked our boundaries + prev_damage = damage + return /obj/item/organ/brain/Destroy() //copypasted from MMIs. if(brainmob) diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 786bb0b55c..64f2a207a2 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -20,7 +20,7 @@ else if(istype(loc, /obj/item/organ/brain)) BR = loc if(BR) - BR.damaged_brain = 1 //beaten to a pulp + BR.organ_flags & ORGAN_FAILING = 1 //beaten to a pulp /mob/living/brain/proc/handle_emp_damage() if(emp_damage) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 9acecea545..5cbbc92693 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -814,7 +814,8 @@ reagents.clear_reagents() var/obj/item/organ/brain/B = getorgan(/obj/item/organ/brain) if(B) - B.damaged_brain = FALSE + B.organ_flags & ORGAN_FAILING = FALSE + B.brain_death = FALSE for(var/thing in diseases) var/datum/disease/D = thing if(D.severity != DISEASE_SEVERITY_POSITIVE) diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 749ae3b5b0..9c17a3e7e7 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -40,14 +40,13 @@ update_damage_overlays() else adjustStaminaLoss(damage * hit_percent) - if(BRAIN) - adjustBrainLoss(damage * hit_percent) //citadel code if(AROUSAL) adjustArousalLoss(damage * hit_percent) return TRUE + //These procs fetch a cumulative total damage from all bodyparts /mob/living/carbon/getBruteLoss() var/amount = 0 @@ -113,6 +112,38 @@ return adjustStaminaLoss(diff, updating, forced) +/** adjustOrganLoss + * inputs: slot (organ slot, like ORGAN_SLOT_HEART), amount (damage to be done), and maximum (currently an arbitrarily large number, can be set so as to limit damage) + * outputs: + * description: If an organ exists in the slot requested, and we are capable of taking damage (we don't have GODMODE on), call the damage proc on that organ. + */ +/mob/living/carbon/adjustOrganLoss(slot, amount, maximum) + var/obj/item/organ/O = getorganslot(slot) + if(O && !(status_flags & GODMODE)) + O.applyOrganDamage(amount, maximum) + +/** setOrganLoss + * inputs: slot (organ slot, like ORGAN_SLOT_HEART), amount(damage to be set to) + * outputs: + * description: If an organ exists in the slot requested, and we are capable of taking damage (we don't have GODMODE on), call the set damage proc on that organ, which can + * set or clear the failing variable on that organ, making it either cease or start functions again, unlike adjustOrganLoss. + */ +/mob/living/carbon/setOrganLoss(slot, amount) + var/obj/item/organ/O = getorganslot(slot) + if(O && !(status_flags & GODMODE)) + O.setOrganDamage(amount) + +/** getOrganLoss + * inputs: slot (organ slot, like ORGAN_SLOT_HEART) + * outputs: organ damage + * description: If an organ exists in the slot requested, return the amount of damage that organ has + */ +/mob/living/carbon/getOrganLoss(slot) + var/obj/item/organ/O = getorganslot(slot) + if(O) + return O.damage + + //////////////////////////////////////////// //Returns a list of damaged bodyparts @@ -213,24 +244,25 @@ update_damage_overlays() update_stamina() -/mob/living/carbon/getBrainLoss() +/* TO_REMOVE +/mob/living/carbon/getOrganLoss(ORGAN_SLOT_BRAIN) . = 0 var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) if(B) . = B.get_brain_damage() //Some sources of brain damage shouldn't be deadly -/mob/living/carbon/adjustBrainLoss(amount, maximum = BRAIN_DAMAGE_DEATH) +/mob/living/carbon/adjustOrganLoss(ORGAN_SLOT_BRAIN, amount, maximum = BRAIN_DAMAGE_DEATH) if(status_flags & GODMODE) return FALSE - var/prev_brainloss = getBrainLoss() + var/prev_brainloss = getOrganLoss(ORGAN_SLOT_BRAIN) var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) if(!B) return B.adjust_brain_damage(amount, maximum) if(amount <= 0) //cut this early return - var/brainloss = getBrainLoss() + var/brainloss = getOrganLoss(ORGAN_SLOT_BRAIN) if(brainloss > BRAIN_DAMAGE_MILD) if(prob(amount * ((2 * (100 + brainloss - BRAIN_DAMAGE_MILD)) / 100))) //Base chance is the hit damage; for every point of damage past the threshold the chance is increased by 2% gain_trauma_type(BRAIN_TRAUMA_MILD) @@ -253,3 +285,4 @@ if(B) var/adjusted_amount = amount - B.get_brain_damage() B.adjust_brain_damage(adjusted_amount, null) +*/ diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index ff4878aa13..54d9587654 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -746,9 +746,54 @@ if(0 to NUTRITION_LEVEL_STARVING) to_send += "You're starving!\n" + + //TODO: Convert these messages into vague messages, thereby encouraging actual dignosis. + //Compiles then shows the list of damaged organs and broken organs + var/list/broken = list() + var/list/damaged = list() + var/broken_message + var/damaged_message + var/broken_plural + var/damaged_plural + //Sets organs into their proper list + for(var/O in internal_organs) + var/obj/item/organ/organ = O + if(organ.organ_flags & ORGAN_FAILING) + if(broken.len) + broken += ", " + broken += organ.name + else if(organ.damage > organ.low_threshold) + if(damaged.len) + damaged += ", " + damaged += organ.name + //Checks to enforce proper grammar, inserts words as necessary into the list + if(broken.len) + if(broken.len > 1) + broken.Insert(broken.len, "and ") + broken_plural = TRUE + else + var/holder = broken[1] //our one and only element + if(holder[lentext(holder)] == "s") + broken_plural = TRUE + //Put the items in that list into a string of text + for(var/B in broken) + broken_message += B + to_chat(src, " Your [broken_message] [broken_plural ? "are" : "is"] non-functional!") + if(damaged.len) + if(damaged.len > 1) + damaged.Insert(damaged.len, "and ") + damaged_plural = TRUE + else + var/holder = damaged[1] + if(holder[lentext(holder)] == "s") + damaged_plural = TRUE + for(var/D in damaged) + damaged_message += D + to_chat(src, "Your [damaged_message] [damaged_plural ? "are" : "is"] hurt.") + if(roundstart_quirks.len) to_send += "You have these quirks: [get_trait_string()].\n" - + to_chat(src, to_send) else if(wear_suit) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1af9dbc5f5..fccd5d595e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -70,7 +70,7 @@ else if(eye_blurry) //blurry eyes heal slowly adjust_blurriness(-1) - if (getBrainLoss() >= 30) //Citadel change to make memes more often. + if (getOrganLoss(ORGAN_SLOT_BRAIN) >= 30) //Citadel change to make memes more often. SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "brain_damage", /datum/mood_event/brain_damage) if(prob(3)) if(prob(25)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 0f83e675fc..0e9cd34010 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1196,9 +1196,14 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(mood && mood.sanity > SANITY_DISTURBED) hunger_rate *= max(0.5, 1 - 0.002 * mood.sanity) //0.85 to 0.75 - if(H.satiety > 0) + // Whether we cap off our satiety or move it towards 0 + if(H.satiety > MAX_SATIETY) + H.satiety = MAX_SATIETY + else if(H.satiety > 0) H.satiety-- - if(H.satiety < 0) + else if(H.satiety < -MAX_SATIETY) + H.satiety = -MAX_SATIETY + else if(H.satiety < 0) H.satiety++ if(prob(round(-H.satiety/40))) H.Jitter(5) @@ -1683,7 +1688,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(BODY_ZONE_HEAD) if(!I.is_sharp() && armor_block < 50) if(prob(I.force)) - H.adjustBrainLoss(20) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 20) if(H.stat == CONSCIOUS) H.visible_message("[H] has been knocked senseless!", \ "[H] has been knocked senseless!") @@ -1692,7 +1697,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(prob(10)) H.gain_trauma(/datum/brain_trauma/mild/concussion) else - H.adjustBrainLoss(I.force * 0.2) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, I.force * 0.2) if(H.stat == CONSCIOUS && H != user && prob(I.force + ((100 - H.health) * 0.5))) // rev deconversion through blunt trauma. var/datum/antagonist/rev/rev = H.mind.has_antag_datum(/datum/antagonist/rev) @@ -1787,7 +1792,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else H.adjustStaminaLoss(damage * hit_percent * H.physiology.stamina_mod) if(BRAIN) - H.adjustBrainLoss(damage * hit_percent * H.physiology.brain_mod) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, damage * hit_percent * H.physiology.brain_mod) if(AROUSAL) //Citadel edit - arousal H.adjustArousalLoss(damage * hit_percent) return 1 diff --git a/code/modules/mob/living/carbon/human/species_types/dullahan.dm b/code/modules/mob/living/carbon/human/species_types/dullahan.dm index 4a7580e978..b7d5130cd8 100644 --- a/code/modules/mob/living/carbon/human/species_types/dullahan.dm +++ b/code/modules/mob/living/carbon/human/species_types/dullahan.dm @@ -64,7 +64,7 @@ /obj/item/organ/brain/dullahan decoy_override = TRUE - vital = FALSE + organ_flags = 0 /obj/item/organ/tongue/dullahan zone = "abstract" @@ -138,4 +138,4 @@ D.myhead = null owner.gib() owner = null - ..() \ No newline at end of file + ..() diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 754c48c3bd..70fd4798ce 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -102,6 +102,7 @@ color = "#1C1C1C" var/respawn_progress = 0 var/obj/item/light_eater/blade + decay_factor = 0 /obj/item/organ/heart/nightmare/attack(mob/M, mob/living/carbon/user, obj/target) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 36e4e18817..967a92e0c4 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -28,8 +28,10 @@ if(stat != DEAD) handle_brain_damage() + /* BUG_PROBABLE_CAUSE if(stat != DEAD) handle_liver() + */ if(stat == DEAD) stop_sound_channel(CHANNEL_HEARTBEAT) @@ -47,8 +49,23 @@ //Start of a breath chain, calls breathe() /mob/living/carbon/handle_breathing(times_fired) - if((times_fired % 4) == 2 || failed_last_breath) - breathe() //Breathe per 4 ticks, unless suffocating + /mob/living/carbon/handle_breathing(times_fired) + var/next_breath = 4 + var/obj/item/organ/lungs/L = getorganslot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART) + if(L) + if(L.damage > L.high_threshold) + next_breath-- + if(H) + if(H.damage > H.high_threshold) + next_breath-- + + if((times_fired % next_breath) == 0 || failed_last_breath) + breathe() //Breathe per 4 ticks if healthy, down to 2 if our lungs or heart are damaged, unless suffocating + if(failed_last_breath) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation") else if(istype(loc, /obj/)) var/obj/location_as_object = loc @@ -56,6 +73,7 @@ //Second link in a breath chain, calls check_breath() /mob/living/carbon/proc/breathe() + var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS) if(reagents.has_reagent("lexorin")) return if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell)) @@ -74,7 +92,7 @@ var/datum/gas_mixture/breath if(!getorganslot(ORGAN_SLOT_BREATHING_TUBE)) - if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL)) + if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL) || lungs.organ_flags & ORGAN_FAILING) losebreath++ //You can't breath at all when in critical or when being choked, so you're going to miss a breath else if(health <= crit_threshold) @@ -126,7 +144,7 @@ if((status_flags & GODMODE)) return - var/lungs = getorganslot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS) if(!lungs) adjustOxyLoss(2) @@ -613,7 +631,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put to_chat(src, "Maybe you should lie down for a bit...") if(drunkenness >= 91) - adjustBrainLoss(0.4, 60) + adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.4, 60) if(prob(20) && !stat) if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly to_chat(src, "You're so tired... but you can't miss that shuttle...") @@ -647,8 +665,8 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put if((!dna && !liver) || (NOLIVER in dna.species.species_traits)) return if(liver) - if(liver.damage >= liver.maxHealth) - liver.failing = TRUE + if(liver.damage < liver.maxHealth) + liver.organ_flags |= ORGAN_FAILING liver_failure() else liver_failure() @@ -687,13 +705,6 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put var/datum/brain_trauma/BT = T BT.on_life() - if(getBrainLoss() >= BRAIN_DAMAGE_DEATH) //rip - to_chat(src, "The last spark of life in your brain fizzles out...") - death() - var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) - if(B) - B.damaged_brain = TRUE - ///////////////////////////////////// //MONKEYS WITH TOO MUCH CHOLOESTROL// ///////////////////////////////////// @@ -702,7 +713,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put if(!needs_heart()) return FALSE var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) - if(!heart || heart.synthetic) + if(!heart || (heart.organ_flags & ORGAN_SYNTHETIC)) return FALSE return TRUE diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index b2eed2d19e..563ab7cfb6 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -25,8 +25,6 @@ adjustCloneLoss(damage * hit_percent) if(STAMINA) adjustStaminaLoss(damage * hit_percent) - if(BRAIN) - adjustBrainLoss(damage * hit_percent) return 1 /mob/living/proc/apply_damage_type(damage = 0, damagetype = BRUTE) //like apply damage except it always uses the damage procs @@ -43,8 +41,6 @@ return adjustCloneLoss(damage) if(STAMINA) return adjustStaminaLoss(damage) - if(BRAIN) - return adjustBrainLoss(damage) /mob/living/proc/get_damage_amount(damagetype = BRUTE) switch(damagetype) @@ -60,8 +56,6 @@ return getCloneLoss() if(STAMINA) return getStaminaLoss() - if(BRAIN) - return getBrainLoss() /mob/living/proc/apply_damages(brute = 0, burn = 0, tox = 0, oxy = 0, clone = 0, def_zone = null, blocked = FALSE, stamina = 0, brain = 0) @@ -218,13 +212,13 @@ updatehealth() return amount -/mob/living/proc/getBrainLoss() - . = 0 - -/mob/living/proc/adjustBrainLoss(amount, maximum = BRAIN_DAMAGE_DEATH) +/mob/living/proc/adjustOrganLoss(slot, amount, maximum) return -/mob/living/proc/setBrainLoss(amount) +/mob/living/proc/setOrganLoss(slot, amount, maximum) + return + +/mob/living/proc/getOrganLoss(slot) return /mob/living/proc/getStaminaLoss() diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index 25d8c4d44c..df711a6dca 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -255,7 +255,7 @@ H.Knockdown(20) else message_param = "bumps [user.p_their()] head on the ground trying to motion towards %t." - H.adjustBrainLoss(5) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5) ..() /datum/emote/living/pout diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 19f18f9973..c22b070340 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -473,7 +473,6 @@ setToxLoss(0, 0) //zero as second argument not automatically call updatehealth(). setOxyLoss(0, 0) setCloneLoss(0, 0) - setBrainLoss(0) setStaminaLoss(0, 0) SetUnconscious(0, FALSE) set_disgust(0) @@ -500,6 +499,11 @@ QDEL_LIST_ASSOC_VAL(mood.mood_events) mood.sanity = SANITY_GREAT mood.update_mood() + //Heal all organs + if(internal_organs) + for(var/organ in internal_organs) + var/obj/item/organ/O = organ + O.setOrganDamage(0) //proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again) diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm index 1190a00645..69d150b315 100644 --- a/code/modules/mob/living/silicon/damage_procs.dm +++ b/code/modules/mob/living/silicon/damage_procs.dm @@ -35,8 +35,8 @@ /mob/living/silicon/setStaminaLoss(amount, updating_stamina = 1) return FALSE -/mob/living/silicon/adjustBrainLoss(amount) +/mob/living/silicon/adjustOrganLoss(slot, amount, maximum = 500) return FALSE -/mob/living/silicon/setBrainLoss(amount) +/mob/living/silicon/setOrganLoss(slot, amount) return FALSE diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm index f20ccbc730..f36e996b81 100644 --- a/code/modules/mob/living/silicon/pai/pai_defense.dm +++ b/code/modules/mob/living/silicon/pai/pai_defense.dm @@ -84,7 +84,7 @@ /mob/living/silicon/pai/adjustStaminaLoss(amount) take_holo_damage(amount & 0.25) -/mob/living/silicon/pai/adjustBrainLoss(amount) +/mob/living/silicon/pai/adjustOrganLoss(slot, amount, maximum = 500) //I kept this in, unlike tg Knockdown(amount * 0.2) /mob/living/silicon/pai/getBruteLoss() @@ -102,18 +102,12 @@ /mob/living/silicon/pai/getCloneLoss() return FALSE -/mob/living/silicon/pai/getBrainLoss() - return FALSE - /mob/living/silicon/pai/getStaminaLoss() return FALSE /mob/living/silicon/pai/setCloneLoss() return FALSE -/mob/living/silicon/pai/setBrainLoss() - return FALSE - /mob/living/silicon/pai/setStaminaLoss() return FALSE diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 5703e2190b..be907fc1cd 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -75,7 +75,7 @@ O.setOxyLoss(getOxyLoss(), 0) O.setCloneLoss(getCloneLoss(), 0) O.adjustFireLoss(getFireLoss(), 0) - O.setBrainLoss(getBrainLoss(), 0) + O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0) O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina O.updatehealth() O.radiation = radiation @@ -236,7 +236,7 @@ O.setOxyLoss(getOxyLoss(), 0) O.setCloneLoss(getCloneLoss(), 0) O.adjustFireLoss(getFireLoss(), 0) - O.setBrainLoss(getBrainLoss(), 0) + O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0) O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina O.updatehealth() O.radiation = radiation diff --git a/code/modules/projectiles/projectile/special/mindflayer.dm b/code/modules/projectiles/projectile/special/mindflayer.dm index d717bed39e..ac4488cae0 100644 --- a/code/modules/projectiles/projectile/special/mindflayer.dm +++ b/code/modules/projectiles/projectile/special/mindflayer.dm @@ -5,5 +5,5 @@ . = ..() if(ishuman(target)) var/mob/living/carbon/human/M = target - M.adjustBrainLoss(20) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 20) M.hallucination += 30 diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index afd2be3f53..c50550aa15 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1389,7 +1389,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/neurotoxin/on_mob_life(mob/living/carbon/M) M.set_drugginess(50) M.dizziness +=2 - M.adjustBrainLoss(1*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 150) if(prob(20)) M.adjustStaminaLoss(10) M.drop_all_held_items() @@ -1400,7 +1400,7 @@ All effects don't start immediately, but rather get worse over time; the rate is ADD_TRAIT(M, t, type) M.adjustStaminaLoss(10) if(current_cycle > 30) - M.adjustBrainLoss(2*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM) if(current_cycle > 50 && prob(15)) if(!M.undergoing_cardiac_arrest() && M.can_heartattack()) M.set_heartattack(TRUE) diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 5b06710472..f3df72cd4d 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -80,14 +80,14 @@ . = 1 /datum/reagent/drug/crank/overdose_process(mob/living/M) - M.adjustBrainLoss(2*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM) M.adjustToxLoss(2*REM, 0) M.adjustBruteLoss(2*REM, 0) ..() . = 1 /datum/reagent/drug/crank/addiction_act_stage1(mob/living/M) - M.adjustBrainLoss(5*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5*REM) ..() /datum/reagent/drug/crank/addiction_act_stage2(mob/living/M) @@ -101,7 +101,7 @@ . = 1 /datum/reagent/drug/crank/addiction_act_stage4(mob/living/M) - M.adjustBrainLoss(3*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3*REM) M.adjustToxLoss(5*REM, 0) M.adjustBruteLoss(5*REM, 0) ..() @@ -125,13 +125,13 @@ ..() /datum/reagent/drug/krokodil/overdose_process(mob/living/M) - M.adjustBrainLoss(0.25*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.25*REM) M.adjustToxLoss(0.25*REM, 0) ..() . = 1 /datum/reagent/drug/krokodil/addiction_act_stage1(mob/living/M) - M.adjustBrainLoss(2*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM) M.adjustToxLoss(2*REM, 0) ..() . = 1 @@ -192,7 +192,7 @@ if(jitter) M.Jitter(2) if(brain_damage) - M.adjustBrainLoss(rand(1,4)) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1,4)) M.heal_overall_damage(2, 2) if(prob(5)) M.emote(pick("twitch", "shiver")) @@ -210,7 +210,7 @@ M.drop_all_held_items() ..() M.adjustToxLoss(1, 0) - M.adjustBrainLoss(pick(0.5, 0.6, 0.7, 0.8, 0.9, 1)) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, pick(0.5, 0.6, 0.7, 0.8, 0.9, 1)) . = 1 /datum/reagent/drug/methamphetamine/addiction_act_stage1(mob/living/M) @@ -289,7 +289,7 @@ if(prob(5)) to_chat(M, "[high_message]") M.adjustStaminaLoss(-5, 0) - M.adjustBrainLoss(4) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 4) M.hallucination += 5 if(M.canmove && !ismovableatom(M.loc)) step(M, pick(GLOB.cardinals)) @@ -314,7 +314,7 @@ for(var/i = 0, i < 8, i++) step(M, pick(GLOB.cardinals)) M.Jitter(5) - M.adjustBrainLoss(10) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) if(prob(20)) M.emote(pick("twitch","drool","moan")) ..() @@ -326,7 +326,7 @@ step(M, pick(GLOB.cardinals)) M.Jitter(10) M.Dizzy(10) - M.adjustBrainLoss(10) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) if(prob(30)) M.emote(pick("twitch","drool","moan")) ..() @@ -338,7 +338,7 @@ step(M, pick(GLOB.cardinals)) M.Jitter(15) M.Dizzy(15) - M.adjustBrainLoss(10) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) if(prob(40)) M.emote(pick("twitch","drool","moan")) ..() @@ -351,7 +351,7 @@ M.Jitter(50) M.Dizzy(50) M.adjustToxLoss(5, 0) - M.adjustBrainLoss(10) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10) if(prob(50)) M.emote(pick("twitch","drool","moan")) ..() @@ -401,7 +401,7 @@ M.jitteriness = 0 M.confused = 0 M.disgust = 0 - M.adjustBrainLoss(0.2) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2) ..() . = 1 @@ -418,7 +418,7 @@ if(3) M.emote("frown") SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug_bad_od) - M.adjustBrainLoss(0.5) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5) ..() . = 1 @@ -490,7 +490,7 @@ H.dna.species.punchdamagehigh *= 0.2 /datum/reagent/drug/skooma/on_mob_life(mob/living/carbon/M) - M.adjustBrainLoss(1*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM) M.adjustToxLoss(1*REM) if(prob(10)) M.adjust_blurriness(2) @@ -522,7 +522,7 @@ M.Dizzy(50) M.adjust_blurriness(10) if(prob(50)) //This proc will be called about 200 times and the adjustbrainloss() below only has to be called 40 times to kill. This will make surviving skooma addiction pretty rare without mannitol usage. - M.adjustBrainLoss(5) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5) if(prob(40)) M.emote(pick("twitch","drool","moan")) ..() diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 19aeaeb25e..cebc8f0975 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -684,7 +684,7 @@ . = 1 if(prob(20)) M.losebreath += 4 - M.adjustBrainLoss(2*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM, 150) M.adjustToxLoss(3*REM,0) M.adjustStaminaLoss(10*REM,0) M.blur_eyes(5) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 4dc0d145dc..f6863c6023 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -64,6 +64,10 @@ if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) M.blood_volume = (BLOOD_VOLUME_NORMAL*M.blood_ratio) + for(var/organ in M.internal_organs) + var/obj/item/organ/O = organ + O.setOrganDamage(0) + for(var/thing in M.diseases) var/datum/disease/D = thing if(D.severity == DISEASE_SEVERITY_POSITIVE) @@ -852,10 +856,16 @@ if(M.notify_ghost_cloning(source = M)) spawn (100) //so the ghost has time to re-enter return + else M.adjustOxyLoss(-20, 0) M.adjustToxLoss(-20, 0) + var/mob/living/carbon/H = M + for(var/organ in H.internal_organs) + var/obj/item/organ/O = organ + O.setOrganDamage(0) M.updatehealth() + if(M.revive()) M.emote("gasp") log_combat(M, M, "revived", src) @@ -875,7 +885,7 @@ pH = 10.4 /datum/reagent/medicine/mannitol/on_mob_life(mob/living/carbon/C) - C.adjustBrainLoss(-2*REM) + C.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2*REM) if(prob(10)) C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC) ..() @@ -1130,7 +1140,7 @@ M.adjustFireLoss(-5*REM, 0) M.adjustOxyLoss(-15, 0) M.adjustToxLoss(-5*REM, 0) - M.adjustBrainLoss(-15*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -15*REM) M.adjustCloneLoss(-3*REM, 0) M.adjustStaminaLoss(-20*REM,0) ..() @@ -1175,7 +1185,7 @@ M.adjustFireLoss(-3 * REM, 0) M.adjustOxyLoss(-15 * REM, 0) M.adjustToxLoss(-3 * REM, 0, TRUE) //Heals TOXINLOVERS - M.adjustBrainLoss(2 * REM, 150) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that! + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2 * REM, 150) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that! M.adjustCloneLoss(-1 * REM, 0) M.adjustStaminaLoss(-13 * REM, 0) M.jitteriness = min(max(0, M.jitteriness + 3), 30) @@ -1207,7 +1217,7 @@ if (M.hallucination >= 5) M.hallucination -= 5 if(prob(20)) - M.adjustBrainLoss(1*REM, 50) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 50) M.adjustStaminaLoss(2.5*REM, 0) ..() return TRUE diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 07c9b166ff..2e33a77dd0 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -296,7 +296,7 @@ if(ishuman(M) && M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) M.blood_volume += 3 else // Will deal about 90 damage when 50 units are thrown - M.adjustBrainLoss(3, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) M.adjustToxLoss(2, 0) M.adjustFireLoss(2, 0) M.adjustOxyLoss(2, 0) @@ -315,7 +315,7 @@ M.IgniteMob() //Only problem with igniting people is currently the commonly availible fire suits make you immune to being on fire M.adjustToxLoss(1, 0) M.adjustFireLoss(1, 0) //Hence the other damages... ain't I a bastard? - M.adjustBrainLoss(5, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 150) holder.remove_reagent(id, 1) pH = 0.1 @@ -805,7 +805,7 @@ step(M, pick(GLOB.cardinals)) if(prob(5)) M.emote(pick("twitch","drool","moan")) - M.adjustBrainLoss(1) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) ..() /datum/reagent/sulfur @@ -1172,7 +1172,7 @@ /datum/reagent/impedrezene/on_mob_life(mob/living/carbon/M) M.jitteriness = max(M.jitteriness-5,0) if(prob(80)) - M.adjustBrainLoss(2*REM) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM) if(prob(50)) M.drowsyness = max(M.drowsyness, 3) if(prob(10)) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 2848c336e2..56cd52e9b6 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -490,7 +490,7 @@ toxpwr = 0 /datum/reagent/toxin/fentanyl/on_mob_life(mob/living/carbon/M) - M.adjustBrainLoss(3*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3*REM, 150) if(M.toxloss <= 60) M.adjustToxLoss(1*REM, 0) if(current_cycle >= 18) diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 8aab7f1e2b..5d89d3aba5 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -74,12 +74,12 @@ var/mob/living/carbon/C = host_mob if(length(C.get_traumas())) return ..() - if(host_mob.getBrainLoss()) + if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN)) return ..() return FALSE /datum/nanite_program/brain_heal/active_effect() - host_mob.adjustBrainLoss(-1, TRUE) + host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1, TRUE) if(iscarbon(host_mob) && prob(10)) var/mob/living/carbon/C = host_mob C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC) @@ -195,12 +195,12 @@ var/mob/living/carbon/C = host_mob if(length(C.get_traumas())) return ..() - if(host_mob.getBrainLoss()) + if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN)) return ..() return FALSE /datum/nanite_program/brain_heal_advanced/active_effect() - host_mob.adjustBrainLoss(-2, TRUE) + host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2, TRUE) if(iscarbon(host_mob) && prob(10)) var/mob/living/carbon/C = host_mob C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_LOBOTOMY) @@ -232,7 +232,7 @@ if(!C.getorgan(/obj/item/organ/heart)) //what are we even shocking return FALSE var/obj/item/organ/brain/BR = C.getorgan(/obj/item/organ/brain) - if(QDELETED(BR) || BR.damaged_brain) + if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided) return FALSE if(C.get_ghost()) return FALSE @@ -252,7 +252,7 @@ SEND_SIGNAL(C, COMSIG_LIVING_MINOR_SHOCK) var/tplus = world.time - C.timeofdeath if(tplus > 600) - C.adjustBrainLoss( max(0, ((1800 - tplus) / 1800 * 150)), 150) + C.adjustOrganLoss(ORGAN_SLOT_BRAIN, max(0, ((1800 - tplus) / 1800 * 150)), 150) log_game("[C] has been successfully defibrillated by nanites.") else playsound(C, 'sound/machines/defib_failed.ogg', 50, 0) diff --git a/code/modules/research/nanites/nanite_programs/rogue.dm b/code/modules/research/nanites/nanite_programs/rogue.dm index f64c7e8781..287aed36fe 100644 --- a/code/modules/research/nanites/nanite_programs/rogue.dm +++ b/code/modules/research/nanites/nanite_programs/rogue.dm @@ -59,7 +59,7 @@ /datum/nanite_program/brain_decay/active_effect() if(prob(4)) host_mob.hallucination = min(15, host_mob.hallucination) - host_mob.adjustBrainLoss(1) + host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) //Generic brain-affecting programs can also decay into this /datum/nanite_program/brain_misfire diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index 0b2d60da8c..d6536f4fdd 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -119,7 +119,7 @@ Consuming extracts: M.adjustToxLoss(-5, forced=1) //To heal slimepeople. M.adjustOxyLoss(-5) M.adjustCloneLoss(-5) - M.adjustBrainLoss(-5) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -5) /obj/item/slimecross/consuming/blue colour = "blue" diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm index 730a912189..68deca4729 100644 --- a/code/modules/surgery/advanced/brainwashing.dm +++ b/code/modules/surgery/advanced/brainwashing.dm @@ -56,7 +56,7 @@ display_results(user, target, "You screw up, bruising the brain tissue!", "[user] screws up, causing brain damage!", "[user] completes the surgery on [target]'s brain.") - target.adjustBrainLoss(40) + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 40) else user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") return FALSE diff --git a/code/modules/surgery/advanced/lobotomy.dm b/code/modules/surgery/advanced/lobotomy.dm index 1c09f5f7da..12c5e4dab2 100644 --- a/code/modules/surgery/advanced/lobotomy.dm +++ b/code/modules/surgery/advanced/lobotomy.dm @@ -51,11 +51,12 @@ return TRUE /datum/surgery_step/lobotomize/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target.getorganslot(ORGAN_SLOT_BRAIN)) + var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) + if(B) display_results(user, target, "You remove the wrong part, causing more damage!", "[user] successfully lobotomizes [target]!", "[user] completes the surgery on [target]'s brain.") - target.adjustBrainLoss(80) + B.applyOrganDamage(80) switch(rand(1,3)) if(1) target.gain_trauma_type(BRAIN_TRAUMA_MILD, TRAUMA_RESILIENCE_MAGIC) diff --git a/code/modules/surgery/advanced/revival.dm b/code/modules/surgery/advanced/revival.dm index 01c30f174a..b31a7518bd 100644 --- a/code/modules/surgery/advanced/revival.dm +++ b/code/modules/surgery/advanced/revival.dm @@ -63,7 +63,7 @@ user.visible_message("...[target] wakes up, alive and aware!", "IT'S ALIVE!") target.visible_message("...[target] wakes up, alive and aware!") target.emote("gasp") - target.adjustBrainLoss(50, 199) //MAD SCIENCE + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 50, 199) //MAD SCIENCE return TRUE else user.visible_message("...[target.p_they()] convulses, then lies still.") @@ -75,5 +75,5 @@ "[user] send a powerful shock to [target]'s brain with [tool], but [target.p_they()] doesn't react.", "[user] send a powerful shock to [target]'s brain with [tool], but [target.p_they()] doesn't react.") playsound(get_turf(target), 'sound/magic/lightningbolt.ogg', 50, 1) - target.adjustBrainLoss(15, 199) + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 199) return FALSE diff --git a/code/modules/surgery/brain_surgery.dm b/code/modules/surgery/brain_surgery.dm index e65271576d..c553d05448 100644 --- a/code/modules/surgery/brain_surgery.dm +++ b/code/modules/surgery/brain_surgery.dm @@ -31,7 +31,7 @@ "[user] completes the surgery on [target]'s brain.") if(target.mind && target.mind.has_antag_datum(/datum/antagonist/brainwashed)) target.mind.remove_antag_datum(/datum/antagonist/brainwashed) - target.adjustBrainLoss(-60) + target.setOrganLoss(ORGAN_SLOT_BRAIN, target.getOrganLoss(ORGAN_SLOT_BRAIN) - 60) //we set damage in this case in order to clear the "failing" flag target.cure_all_traumas(TRAUMA_RESILIENCE_SURGERY) return TRUE @@ -40,7 +40,7 @@ display_results(user, target, "You screw up, causing more damage!", "[user] screws up, causing brain damage!", "[user] completes the surgery on [target]'s brain.") - target.adjustBrainLoss(60) + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60) target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY) else user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") diff --git a/code/modules/surgery/coronary_bypass.dm b/code/modules/surgery/coronary_bypass.dm new file mode 100644 index 0000000000..3e36e9aa9b --- /dev/null +++ b/code/modules/surgery/coronary_bypass.dm @@ -0,0 +1,77 @@ +/datum/surgery/coronary_bypass + name = "Coronary Bypass" + steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, + /datum/surgery_step/incise_heart, /datum/surgery_step/coronary_bypass, /datum/surgery_step/close) + possible_locs = list(BODY_ZONE_CHEST) + +/datum/surgery/coronary_bypass/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART) + if(H) + if(H.damage > 60 && !H.operated) + return TRUE + return FALSE + + +//an incision but with greater bleed, and a 90% base success chance +/datum/surgery_step/incise_heart + name = "incise heart" + implements = list(/obj/item/scalpel = 90, /obj/item/melee/transforming/energy/sword = 45, /obj/item/kitchen/knife = 45, + /obj/item/shard = 25) + time = 16 + +/datum/surgery_step/incise_heart/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to make an incision in [target]'s heart...", + "[user] begins to make an incision in [target]'s heart.", + "[user] begins to make an incision in [target]'s heart.") + +/datum/surgery_step/incise_heart/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if (!(NOBLOOD in H.dna.species.species_traits)) + display_results(user, target, "Blood pools around the incision in [H]'s heart.", + "Blood pools around the incision in [H]'s heart.", + "") + H.bleed_rate += 10 + H.adjustBruteLoss(10) + return TRUE + +/datum/surgery_step/incise_heart/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up, cutting too deeply into the heart!", + "[user] screws up, causing blood to spurt out of [H]'s chest!", + "[user] screws up, causing blood to spurt out of [H]'s chest!") + H.bleed_rate += 20 + H.adjustOrganLoss(ORGAN_SLOT_HEART, 10) + H.adjustBruteLoss(10) + +//grafts a coronary bypass onto the individual's heart, success chance is 90% base again +/datum/surgery_step/coronary_bypass + name = "graft coronary bypass" + implements = list(/obj/item/hemostat = 90, TOOL_WIRECUTTER = 35, /obj/item/stack/packageWrap = 15, /obj/item/stack/cable_coil = 5) + time = 90 + +/datum/surgery_step/coronary_bypass/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to graft a bypass onto [target]'s heart...", + "[user] begins to graft something onto [target]'s heart!", + "[user] begins to graft something onto [target]'s heart!") + +/datum/surgery_step/coronary_bypass/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + target.setOrganLoss(ORGAN_SLOT_HEART, 60) + var/obj/item/organ/heart/heart = target.getorganslot(ORGAN_SLOT_HEART) + if(heart) //slightly worrying if we lost our heart mid-operation, but that's life + heart.operated = TRUE + display_results(user, target, "You successfully graft a bypass onto [target]'s heart.", + "[user] finishes grafting something onto [target]'s heart.", + "[user] finishes grafting something onto [target]'s heart.") + return TRUE + +/datum/surgery_step/coronary_bypass/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up in attaching the graft, and it tears off, tearing part of the heart!", + "[user] screws up, causing blood to spurt out of [H]'s chest profusely!", + "[user] screws up, causing blood to spurt out of [H]'s chest profusely!") + H.adjustOrganLoss(ORGAN_SLOT_HEART, 20) + H.bleed_rate += 30 + return FALSE \ No newline at end of file diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm index 85142e7bb1..29385ef20b 100644 --- a/code/modules/surgery/eye_surgery.dm +++ b/code/modules/surgery/eye_surgery.dm @@ -37,7 +37,7 @@ display_results(user, target, "You accidentally stab [target] right in the brain!", "[user] accidentally stabs [target] right in the brain!", "[user] accidentally stabs [target] right in the brain!") - target.adjustBrainLoss(70) + target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 70) else display_results(user, target, "You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.", "[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.", diff --git a/code/modules/surgery/lobectomy.dm b/code/modules/surgery/lobectomy.dm new file mode 100644 index 0000000000..7d8b8a53e8 --- /dev/null +++ b/code/modules/surgery/lobectomy.dm @@ -0,0 +1,46 @@ +/datum/surgery/lobectomy + name = "Lobectomy" //not to be confused with lobotomy + steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, + /datum/surgery_step/lobectomy, /datum/surgery_step/close) + possible_locs = list(BODY_ZONE_CHEST) + +/datum/surgery/lobectomy/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/lungs/L = target.getorganslot(ORGAN_SLOT_LUNGS) + if(L) + if(L.damage > 60 && !L.operated) + return TRUE + return FALSE + + +//lobectomy, removes the most damaged lung lobe with a 95% base success chance +/datum/surgery_step/lobectomy + name = "excise damaged lung node" + implements = list(/obj/item/scalpel = 95, /obj/item/melee/transforming/energy/sword = 65, /obj/item/kitchen/knife = 45, + /obj/item/shard = 35) + time = 42 + +/datum/surgery_step/lobectomy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to make an incision in [target]'s lungs...", + "[user] begins to make an incision in [target].", + "[user] begins to make an incision in [target].") + +/datum/surgery_step/lobectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + var/obj/item/organ/lungs/L = H.getorganslot(ORGAN_SLOT_LUNGS) + L.operated = TRUE + H.setOrganLoss(ORGAN_SLOT_LUNGS, 60) + display_results(user, target, "You successfully excise [H]'s most damaged lobe.", + "Successfully removes a piece of [H]'s lungs.", + "") + return TRUE + +/datum/surgery_step/lobectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + display_results(user, target, "You screw up, failing to excise [H]'s damaged lobe!", + "[user] screws up!", + "[user] screws up!") + H.losebreath += 4 + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, 10) + return FALSE \ No newline at end of file diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm index 34a7e16ebf..1f3f2fff5b 100644 --- a/code/modules/surgery/organs/appendix.dm +++ b/code/modules/surgery/organs/appendix.dm @@ -3,7 +3,21 @@ icon_state = "appendix" zone = BODY_ZONE_PRECISE_GROIN slot = ORGAN_SLOT_APPENDIX - var/inflamed = 0 + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + + now_failing = "An explosion of pain erupts in your lower right abdomen!" + now_fixed = "The pain in your abdomen has subsided." + + var/inflamed + +/obj/item/organ/appendix/on_life() + ..() + if(!(organ_flags & ORGAN_FAILING)) + return + var/mob/living/carbon/M = owner + if(M) + M.adjustToxLoss(4, TRUE, TRUE) //forced to ensure people don't use it to gain tox as slime person /obj/item/organ/appendix/update_icon() if(inflamed) @@ -16,7 +30,7 @@ /obj/item/organ/appendix/Remove(mob/living/carbon/M, special = 0) for(var/datum/disease/appendicitis/A in M.diseases) A.cure() - inflamed = 1 + inflamed = TRUE update_icon() ..() diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 2489aa0705..e42fc91d47 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -121,7 +121,7 @@ playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1) /obj/item/organ/cyberimp/arm/ui_action_click() - if(crit_fail || (!holder && !contents.len)) + if(crit_fail || (organ_flags & ORGAN_FAILING) || (!holder && !contents.len)) to_chat(owner, "The implant doesn't respond. It seems to be broken...") return @@ -145,7 +145,7 @@ . = ..() if(. & EMP_PROTECT_SELF) return - if(prob(30/severity) && owner && !crit_fail) + if(prob(30/severity) && owner && !(organ_flags & ORGAN_FAILING)) Retract() owner.visible_message("A loud bang comes from [owner]\'s [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm!") playsound(get_turf(owner), 'sound/weapons/flashbang.ogg', 100, 1) @@ -154,6 +154,7 @@ owner.IgniteMob() owner.adjustFireLoss(25) crit_fail = 1 + organ_flags |= ORGAN_FAILING /obj/item/organ/cyberimp/arm/gun/laser diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm index ea336bea19..7156b8180b 100644 --- a/code/modules/surgery/organs/augments_chest.dm +++ b/code/modules/surgery/organs/augments_chest.dm @@ -144,7 +144,7 @@ /obj/item/organ/cyberimp/chest/thrusters/proc/toggle(silent = FALSE) if(!on) - if(crit_fail) + if(crit_fail || (organ_flags & ORGAN_FAILING)) if(!silent) to_chat(owner, "Your thrusters set seems to be broken!") return 0 diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 06d523721d..0648a30fe1 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -4,6 +4,7 @@ name = "cybernetic implant" desc = "A state-of-the-art implant that improves a baseline's functionality." status = ORGAN_ROBOTIC + organ_flags = ORGAN_SYNTHETIC var/implant_color = "#FFFFFF" var/implant_overlay var/syndicate_implant = FALSE //Makes the implant invisible to health analyzers and medical HUDs. @@ -102,7 +103,7 @@ /obj/item/organ/cyberimp/brain/anti_stun/on_life() ..() - if(crit_fail) + if((crit_fail || !(organ_flags & ORGAN_FAILING)) && amount > 0) return owner.adjustStaminaLoss(-3.5) //Citadel edit, makes it more useful in Stamina based combat if(owner.AmountStun() > STUN_SET_AMOUNT) @@ -112,13 +113,15 @@ /obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity) . = ..() - if(crit_fail || . & EMP_PROTECT_SELF) + if(crit_fail || (organ_flags & ORGAN_FAILING) || . & EMP_PROTECT_SELF) return crit_fail = TRUE + organ_flags |= ORGAN_FAILING addtimer(CALLBACK(src, .proc/reboot), 90 / severity) /obj/item/organ/cyberimp/brain/anti_stun/proc/reboot() crit_fail = FALSE + organ_flags &= ~ORGAN_FAILING //[[[[MOUTH]]]] diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index 8e191a41a9..e56ca2cb3b 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -6,6 +6,14 @@ slot = ORGAN_SLOT_EARS gender = PLURAL + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + + low_threshold_passed = "Your ears begin to resonate with an internal ring sometimes." + now_failing = "You are unable to hear at all!" + now_fixed = "Noise slowly begins filling your ears once more." + low_threshold_cleared = "The ringing in your ears has died down." + // `deaf` measures "ticks" of deafness. While > 0, the person is unable // to hear anything. var/deaf = 0 diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index cfbb530e69..95c5299ac3 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -289,7 +289,7 @@ H.hallucination += 10 H.reagents.add_reagent("bz_metabolites",5) if(prob(33)) - H.adjustBrainLoss(3, 150) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) else if(bz_pp > 0.01) H.hallucination += 5 diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 8103224306..7052c0c5c1 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -991,7 +991,7 @@ if (HAS_TRAIT(H, TRAIT_DEAF))//How the heck you managed to get here I have no idea, but just in case! speaktrigger += "I can barely hear you! " //And the brain damage. And the brain damage. And the brain damage. And the brain damage. And the brain damage. - switch(H.getBrainLoss()) + switch(H.getOrganLoss(ORGAN_SLOT_BRAIN)) if(20 to 40) speaktrigger += "I have a mild head ache, " if(40 to 80) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 9af5b13a7d..8c21b050aa 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -75,7 +75,7 @@ H.adjustStaminaLoss(40) var/head_slot = H.get_item_by_slot(SLOT_HEAD) if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) - H.adjustBrainLoss(3) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3) H.updatehealth() visible_message("[src] crashes into [A], sending [H] flying!") playsound(src, 'sound/effects/bang.ogg', 50, 1) @@ -201,7 +201,7 @@ H.adjustStaminaLoss(10) var/head_slot = H.get_item_by_slot(SLOT_HEAD) if(!head_slot || !(istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat))) - H.adjustBrainLoss(1) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) H.updatehealth() visible_message("[src] crashes into [A], sending [H] flying!") playsound(src, 'sound/effects/bang.ogg', 50, 1) diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index ae53f29a55..0f6ef14cd1 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -73,5 +73,5 @@ user.adjustFireLoss(-hp_gained, 0) user.adjustCloneLoss(-hp_gained, 0) user.updatehealth() - user.adjustBrainLoss(-hp_gained) // Zom Bee gibbers "BRAAAAISNSs!1!" + user.adjustOrganLoss(ORGAN_SLOT_BRAIN, -hp_gained) // Zom Bee gibbers "BRAAAAISNSs!1!" user.nutrition = min(user.nutrition + hp_gained, NUTRITION_LEVEL_FULL) diff --git a/modular_citadel/code/datums/status_effects/chems.dm b/modular_citadel/code/datums/status_effects/chems.dm index 4bc83d2af6..61a107e446 100644 --- a/modular_citadel/code/datums/status_effects/chems.dm +++ b/modular_citadel/code/datums/status_effects/chems.dm @@ -334,7 +334,7 @@ if(owner.client?.prefs.lewdchem && !customEcho) to_chat(owner, "[pick("I belong to [enthrallGender].", "[enthrallGender] knows whats best for me.", "Obedence is pleasure.", "I exist to serve [enthrallGender].", "[enthrallGender] is so dominant, it feels right to obey them.")].") if (4) //mindbroken - if (mental_capacity >= 499 && (owner.getBrainLoss() <=0 || HAS_TRAIT(M, TRAIT_MINDSHIELD)) && !owner.reagents.has_reagent("MKUltra")) + if (mental_capacity >= 499 && (owner.getOrganLoss(ORGAN_SLOT_BRAIN) <=0 || HAS_TRAIT(M, TRAIT_MINDSHIELD)) && !owner.reagents.has_reagent("MKUltra")) phase = 2 mental_capacity = 500 customTriggers = list() @@ -373,8 +373,8 @@ M.hallucination = max(0, M.hallucination - 5) M.stuttering = max(0, M.stuttering - 5) M.jitteriness = max(0, M.jitteriness - 5) - if(owner.getBrainLoss() >=20) - owner.adjustBrainLoss(-0.2) + if(owner.getOrganLoss(ORGAN_SLOT_BRAIN) >=20) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, -0.2) if(withdrawal == TRUE) REMOVE_TRAIT(owner, TRAIT_PACIFISM, "MKUltra") SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "EnthMissing1") @@ -395,7 +395,7 @@ if(prob(5)) to_chat(owner, "You're starting to miss [(owner.client?.prefs.lewdchem?"your [enthrallGender]":"[master]")].") if(prob(5)) - owner.adjustBrainLoss(0.1) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.1) to_chat(owner, "[(owner.client?.prefs.lewdchem?"[enthrallGender]":"[master]")] will surely be back soon") //denial if(36) var/message = "[(owner.client?.prefs.lewdchem?"I feel empty when [enthrallGender]'s not around..":"I miss [master]'s presence")]" @@ -403,11 +403,11 @@ if(37 to 65)//barganing if(prob(10)) to_chat(owner, "They are coming back, right...?") - owner.adjustBrainLoss(0.5) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5) if(prob(10)) if(owner.client?.prefs.lewdchem) to_chat(owner, "I just need to be a good pet for [enthrallGender], they'll surely return if I'm a good pet.") - owner.adjustBrainLoss(-1.5) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1.5) if(66) SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "EnthMissing1") var/message = "[(owner.client?.prefs.lewdchem?"I feel so lost in this complicated world without [enthrallGender]..":"I have to return to [master]!")]" @@ -452,7 +452,7 @@ to_chat(owner, "You're unable to hold back your tears, suddenly sobbing as the desire to see your [enthrallGender] oncemore overwhelms you.") else to_chat(owner, "You are overwheled with withdrawl from [master].") - owner.adjustBrainLoss(1) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) owner.stuttering += 35 owner.jitteriness += 35 if(prob(10))//2% chance @@ -468,14 +468,14 @@ if(140 to INFINITY) //acceptance if(prob(15)) deltaResist += 5 - owner.adjustBrainLoss(-1) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1) if(prob(20)) if(owner.client?.prefs.lewdchem) to_chat(owner, "Maybe you'll be okay without your [enthrallGender].") else to_chat(owner, "You feel your mental functions slowly begin to return.") if(prob(5)) - owner.adjustBrainLoss(1) + owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) M.hallucination += 30 withdrawalTick += 0.5//Enough to leave you with a major brain trauma, but not kill you. diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm index 1508a5d519..76d0951d97 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm @@ -295,7 +295,7 @@ Creating a chem with a low purity will make you permanently fall in love with so SSblackbox.record_feedback("tally", "fermi_chem", 1, "Thralls mindbroken") /datum/reagent/fermi/enthrall/overdose_process(mob/living/carbon/M) - M.adjustBrainLoss(0.2)//should be ~30 in total + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2)//should be ~30 in total ..() //Creates a gas cloud when the reaction blows up, causing everyone in it to fall in love with someone/something while it's in their system. @@ -342,7 +342,7 @@ Creating a chem with a low purity will make you permanently fall in love with so M.Stun(10) M.emote("whimper")//does this exist? to_chat(M, "[(M.client?.prefs.lewdchem?"":"")] You're overcome with a desire to see [love].") - M.adjustBrainLoss(0.5)//I found out why everyone was so damaged! + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5)//I found out why everyone was so damaged! ..() /datum/reagent/fermi/enthrallExplo/on_mob_delete(mob/living/carbon/M) diff --git a/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm b/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm index c4c1cff1e7..0e823a658f 100644 --- a/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm +++ b/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm @@ -138,16 +138,16 @@ /datum/reagent/drug/aphrodisiacplus/addiction_act_stage2(mob/living/M) if(prob(30)) - M.adjustBrainLoss(2) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2) ..() /datum/reagent/drug/aphrodisiacplus/addiction_act_stage3(mob/living/M) if(prob(30)) - M.adjustBrainLoss(3) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3) ..() /datum/reagent/drug/aphrodisiacplus/addiction_act_stage4(mob/living/M) if(prob(30)) - M.adjustBrainLoss(4) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 4) ..() /datum/reagent/drug/aphrodisiacplus/overdose_process(mob/living/M) diff --git a/modular_citadel/code/modules/vore/resizing/sizechemicals.dm b/modular_citadel/code/modules/vore/resizing/sizechemicals.dm index 1164bf65d6..f83ba2ce76 100644 --- a/modular_citadel/code/modules/vore/resizing/sizechemicals.dm +++ b/modular_citadel/code/modules/vore/resizing/sizechemicals.dm @@ -84,7 +84,7 @@ return /datum/reagent/medicine/sizeoxadone/overdose_process(mob/living/M) - M.adjustBrainLoss(1) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1) M.adjustToxLoss(1) ..() . = 1 From dfa40a4b22bcba5dea7645c2e16f41784bb4035e Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Wed, 18 Sep 2019 23:57:21 +0100 Subject: [PATCH 02/47] tg Code complete, now to bugtest and clear compile errors. --- code/__DEFINES/mobs.dm | 2 - code/datums/components/earhealing.dm | 4 +- .../diseases/advance/symptoms/deafness.dm | 4 +- .../diseases/advance/symptoms/sensory.dm | 6 +- .../diseases/advance/symptoms/vision.dm | 12 +- code/game/objects/items.dm | 8 +- code/game/objects/items/body_egg.dm | 13 +- .../kitchen_machinery/smartfridge.dm | 35 ++--- code/modules/mob/living/brain/MMI.dm | 2 + .../carbon/alien/special/alien_embryo.dm | 1 + .../modules/mob/living/carbon/damage_procs.dm | 13 ++ .../human/species_types/shadowpeople.dm | 7 +- code/modules/mob/living/carbon/life.dm | 15 ++- code/modules/surgery/graft_synthtissue.dm | 62 +++++++++ code/modules/surgery/organs/ears.dm | 13 +- code/modules/surgery/organs/eyes.dm | 39 ++++++ code/modules/surgery/organs/heart.dm | 24 +++- code/modules/surgery/organs/liver.dm | 14 +- code/modules/surgery/organs/lungs.dm | 87 ++++++++---- code/modules/surgery/organs/organ_internal.dm | 125 ++++++++++++++++-- code/modules/surgery/organs/stomach.dm | 33 ++++- code/modules/surgery/organs/vocal_cords.dm | 7 +- .../chemistry/reagents/fermi_reagents.dm | 2 +- .../reagents/chemistry/reagents/healing.dm | 8 +- tgstation.dme | 1 + 25 files changed, 427 insertions(+), 110 deletions(-) create mode 100644 code/modules/surgery/graft_synthtissue.dm diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 1d1dda6d99..8b5cb1453b 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -203,8 +203,6 @@ #define MAX_CHICKENS 50 -#define UNHEALING_EAR_DAMAGE 100 - #define INCORPOREAL_MOVE_BASIC 1 #define INCORPOREAL_MOVE_SHADOW 2 // leaves a trail of shadows diff --git a/code/datums/components/earhealing.dm b/code/datums/components/earhealing.dm index 6eb71285e0..bd3d57480d 100644 --- a/code/datums/components/earhealing.dm +++ b/code/datums/components/earhealing.dm @@ -26,5 +26,5 @@ if(!HAS_TRAIT(wearer, TRAIT_DEAF)) var/obj/item/organ/ears/ears = wearer.getorganslot(ORGAN_SLOT_EARS) if (ears) - ears.deaf = max(ears.deaf - 1, (ears.ear_damage < UNHEALING_EAR_DAMAGE ? 0 : 1)) // Do not clear deafness while above the unhealing ear damage threshold - ears.ear_damage = max(ears.ear_damage - 0.1, 0) + ears.deaf = max(ears.deaf - 1, (ears.damage < ears.maxHealth ? 0 : 1)) // Do not clear deafness if our ears are too damaged + ears.damage = max(ears.damage - 0.1, 0) diff --git a/code/datums/diseases/advance/symptoms/deafness.dm b/code/datums/diseases/advance/symptoms/deafness.dm index cc388f0b59..3718104b48 100644 --- a/code/datums/diseases/advance/symptoms/deafness.dm +++ b/code/datums/diseases/advance/symptoms/deafness.dm @@ -50,9 +50,9 @@ Bonus if(5) if(power > 2) var/obj/item/organ/ears/ears = M.getorganslot(ORGAN_SLOT_EARS) - if(istype(ears) && ears.ear_damage < UNHEALING_EAR_DAMAGE) + if(istype(ears) && ears.damage < ears.maxHealth) to_chat(M, "Your ears pop painfully and start bleeding!") - ears.ear_damage = max(ears.ear_damage, UNHEALING_EAR_DAMAGE) + ears.damage = max(ears.damage, ears.maxHealth) M.emote("scream") else to_chat(M, "Your ears pop and begin ringing loudly!") diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm index 438adec7b9..2705e0b168 100644 --- a/code/datums/diseases/advance/symptoms/sensory.dm +++ b/code/datums/diseases/advance/symptoms/sensory.dm @@ -100,8 +100,8 @@ else if(M.eye_blind || M.eye_blurry) M.set_blindness(0) M.set_blurriness(0) - else if(eyes.eye_damage > 0) - M.adjust_eye_damage(-1) + else if(eyes.damage > 0) + eyes.applyOrganDamage(-1) else if(prob(base_message_chance)) - to_chat(M, "[pick("Your eyes feel great.","You feel like your eyes can focus more clearly.", "You don't feel the need to blink.","Your ears feel great.","Your healing feels more acute.")]") \ No newline at end of file + to_chat(M, "[pick("Your eyes feel great.","You feel like your eyes can focus more clearly.", "You don't feel the need to blink.","Your ears feel great.","Your healing feels more acute.")]") diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm index fa36b1c08a..b4a33cb837 100644 --- a/code/datums/diseases/advance/symptoms/vision.dm +++ b/code/datums/diseases/advance/symptoms/vision.dm @@ -53,20 +53,20 @@ Bonus if(3, 4) to_chat(M, "Your eyes burn!") M.blur_eyes(10) - M.adjust_eye_damage(1) + eyes.applyOrganDamage(1) else M.blur_eyes(20) - M.adjust_eye_damage(5) - if(eyes.eye_damage >= 10) + eyes.applyOrganDamage(5) + if(eyes.damage >= 10) M.become_nearsighted(EYE_DAMAGE) - if(prob(eyes.eye_damage - 10 + 1)) + if(prob(eyes.damage - 10 + 1)) if(!remove_eyes) if(!HAS_TRAIT(M, TRAIT_BLIND)) to_chat(M, "You go blind!") - M.become_blind(EYE_DAMAGE) + eyes.applyOrganDamage(eyes.maxHealth) else M.visible_message("[M]'s eyes fall off their sockets!", "Your eyes fall off their sockets!") eyes.Remove(M) eyes.forceMove(get_turf(M)) else - to_chat(M, "Your eyes burn horrifically!") \ No newline at end of file + to_chat(M, "Your eyes burn horrifically!") diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c98cef2b87..b1e5505fa8 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -514,12 +514,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) log_combat(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])") - M.adjust_blurriness(3) - M.adjust_eye_damage(rand(2,4)) var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES) if (!eyes) return - if(eyes.eye_damage >= 10) + M.adjust_blurriness(3) + eyes.applyOrganDamage(rand(2,4)) + if(eyes.damage >= 10) M.adjust_blurriness(15) if(M.stat != DEAD) to_chat(M, "Your eyes start to bleed profusely!") @@ -533,7 +533,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) M.adjust_blurriness(10) M.Unconscious(20) M.Knockdown(40) - if (prob(eyes.eye_damage - 10 + 1)) + if (prob(eyes.damage - 10 + 1)) M.become_blind(EYE_DAMAGE) to_chat(M, "You go blind!") diff --git a/code/game/objects/items/body_egg.dm b/code/game/objects/items/body_egg.dm index 80fc0f43fd..ea72197cf0 100644 --- a/code/game/objects/items/body_egg.dm +++ b/code/game/objects/items/body_egg.dm @@ -17,26 +17,27 @@ /obj/item/organ/body_egg/Insert(var/mob/living/carbon/M, special = 0) ..() ADD_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC) - START_PROCESSING(SSobj, src) owner.med_hud_set_status() INVOKE_ASYNC(src, .proc/AddInfectionImages, owner) /obj/item/organ/body_egg/Remove(var/mob/living/carbon/M, special = 0) - STOP_PROCESSING(SSobj, src) if(owner) REMOVE_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC) owner.med_hud_set_status() INVOKE_ASYNC(src, .proc/RemoveInfectionImages, owner) ..() -/obj/item/organ/body_egg/process() +/obj/item/organ/body_egg/on_death() + . = ..() if(!owner) return - if(!(src in owner.internal_organs)) - Remove(owner) - return egg_process() +/obj/item/organ/body_egg/on_life() + . = ..() + egg_process() + + /obj/item/organ/body_egg/proc/egg_process() return diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index f69333ee56..ceb7a01ede 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -397,39 +397,28 @@ return FALSE /obj/machinery/smartfridge/organ/load(obj/item/O) - if(..()) //if the item loads, clear can_decompose - var/obj/item/organ/organ = O - organ.organ_flags |= ORGAN_FROZEN - -/obj/machinery/smartfridge/organ/dispense(obj/item/O, var/mob/M) + . = ..() + if(!.) //if the item loads, clear can_decompose + return var/obj/item/organ/organ = O - organ.organ_flags &= ~ORGAN_FROZEN - ..() + organ.organ_flags |= ORGAN_FROZEN /obj/machinery/smartfridge/organ/RefreshParts() for(var/obj/item/stock_parts/matter_bin/B in component_parts) max_n_of_items = 20 * B.rating repair_rate = max(0, STANDARD_ORGAN_HEALING * (B.rating - 1)) -/obj/machinery/smartfridge/organ/Destroy() - for(var/organ in src) - var/obj/item/organ/O = organ - if(O) - O.organ_flags &= ~ORGAN_FROZEN - ..() - /obj/machinery/smartfridge/organ/process() - for(var/organ in src) + for(var/organ in contents) var/obj/item/organ/O = organ - if(O) - O.damage = max(0, O.damage - repair_rate) + if(!istype(O)) + return + O.applyOrganDamage(-repair_rate) -/obj/machinery/smartfridge/organ/deconstruct() - for(var/organ in src) - var/obj/item/organ/O = organ - if(O) - O.organ_flags &= ~ORGAN_FROZEN - ..() +/obj/machinery/smartfridge/organ/Exited(obj/item/organ/AM, atom/newLoc) + . = ..() + if(istype(AM)) + AM.organ_flags &= ~ORGAN_FROZEN // ----------------------------- // Chemistry Medical Smartfridge diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index cbf9b28a17..e3d83ef5a6 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -64,6 +64,7 @@ brainmob.reset_perspective() brain = newbrain + brain.organ_flags |= ORGAN_FROZEN name = "Man-Machine Interface: [brainmob.real_name]" update_icon() @@ -100,6 +101,7 @@ user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf else brain.forceMove(get_turf(src)) + brain.organ_flags &= ~ORGAN_FROZEN brain = null //No more brain in here diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 1574305a83..9706fde782 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -22,6 +22,7 @@ return S /obj/item/organ/body_egg/alien_embryo/on_life() + . = ..() switch(stage) if(2, 3) if(prob(2)) diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 9c17a3e7e7..5a1878f6bb 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -120,7 +120,10 @@ /mob/living/carbon/adjustOrganLoss(slot, amount, maximum) var/obj/item/organ/O = getorganslot(slot) if(O && !(status_flags & GODMODE)) + if(!maximum) + maximum = O.maxHealth O.applyOrganDamage(amount, maximum) + O.onDamage(amount, maximum) /** setOrganLoss * inputs: slot (organ slot, like ORGAN_SLOT_HEART), amount(damage to be set to) @@ -132,6 +135,7 @@ var/obj/item/organ/O = getorganslot(slot) if(O && !(status_flags & GODMODE)) O.setOrganDamage(amount) + O.onSetDamage(amount) /** getOrganLoss * inputs: slot (organ slot, like ORGAN_SLOT_HEART) @@ -143,6 +147,15 @@ if(O) return O.damage +/mob/living/carbon/adjustAllOrganLoss(amount, maximum) + for(var/o in internal_organs) + if(O && !(status_flags & GODMODE)) + continue + if(!maximum) + maximum = O.maxHealth + O.applyOrganDamage(amount, maximum) + O.onDamage(amount, maximum) + //////////////////////////////////////////// diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 70fd4798ce..09fc26d04f 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -123,10 +123,8 @@ if(special != HEART_SPECIAL_SHADOWIFY) blade = new/obj/item/light_eater M.put_in_hands(blade) - START_PROCESSING(SSobj, src) /obj/item/organ/heart/nightmare/Remove(mob/living/carbon/M, special = 0) - STOP_PROCESSING(SSobj, src) respawn_progress = 0 if(blade && special != HEART_SPECIAL_SHADOWIFY) QDEL_NULL(blade) @@ -139,9 +137,8 @@ /obj/item/organ/heart/nightmare/update_icon() return //always beating visually -/obj/item/organ/heart/nightmare/process() - if(QDELETED(owner) || owner.stat != DEAD) - respawn_progress = 0 +/obj/item/organ/heart/nightmare/on_death() + if(!owner) return var/turf/T = get_turf(owner) if(istype(T)) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 967a92e0c4..6b3902bb07 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -8,8 +8,8 @@ damageoverlaytemp = 0 update_damage_hud() - if(stat != DEAD) //Reagent processing needs to come before breathing, to prevent edge cases. - handle_organs() + //Reagent processing needs to come before breathing, to prevent edge cases. + handle_organs() . = ..() @@ -384,9 +384,14 @@ . |= BP.on_life() /mob/living/carbon/proc/handle_organs() - for(var/V in internal_organs) - var/obj/item/organ/O = V - O.on_life() + if(stat != DEAD) + for(var/V in internal_organs) + var/obj/item/organ/O = V + O.on_life() + else + for(var/V in internal_organs) + var/obj/item/organ/O = V + O.on_death() //Needed so organs decay while inside the body. /mob/living/carbon/handle_diseases() for(var/thing in diseases) diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm new file mode 100644 index 0000000000..aeb3205b81 --- /dev/null +++ b/code/modules/surgery/graft_synthtissue.dm @@ -0,0 +1,62 @@ +//Organ reconstruction, limited to the chest region as most organs in the head have their own repair method (eyes/brain). We require synthflesh for these +//steps since fixing internal organs aren't as simple as mending exterior flesh, though in the future it would be neat to add more chems to the viable list. +//TBD: Add heart damage, have heart reconstruction seperate from organ reconstruction, and find a better name for this. I can imagine people getting it confused with manipulation. + +/datum/surgery/graft_synthtissue + name = "Graft_synthtissue" + target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + possible_locs = list(BODY_ZONE_CHEST) + steps = list( + /datum/surgery_step/incise, + /datum/surgery_step/retract_skin, + /datum/surgery_step/saw, + /datum/surgery_step/clamp_bleeders, + /datum/surgery_step/incise, + /datum/surgery_step/graft_synthtissue, + /datum/surgery_step/close + ) + +//repair lungs step +/datum/surgery_step/repair_synthtissue + name = "graft synthtissue" + implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) + repeatable = TRUE + time = 25 + chems_needed = list("synthtissue") + var/obj/item/organ/chosen_organ + +//Repair lungs +/datum/surgery_step/repair_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(implement_type in implements_extract) + current_type = "insert" + var/list/organs = target.getorganszone(target_zone) + if(!organs.len) + to_chat(user, "There are no targetable organs in [target]'s [parse_zone(target_zone)]!") + return -1 + else + for(var/obj/item/organ/O in organs) + O.on_find(user) + organs -= O + organs[O.name] = O + chosen_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in organs + if(chosen_organ.organ_flags & ORGAN_FAILING)) + to_chat(user, "[target]'s [chosen_organ] is too damaged to repair graft onto!") + return -1 + + user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].") + +/datum/surgery_step/repair_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING)) + to_chat(user, "[target] has no [chosen_organ] capable of repair!") + else + user.visible_message("[user] successfully repairs part of [target]'s [chosen_organ].", "You succeed in repairing parts of [target]'s [chosen_organ].") + chosen_organ.applyOrganDamage(-10) + +/datum/surgery_step/repair_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING)) + to_chat(user, "[target] has no [chosen_organ] capable of repair!") + else + user.visible_message("[user] accidentally damages part of [target]'s [chosen_organ]!", "You damage [target]'s [chosen_organ]! Apply more synthtissue if it's run out.") + chosen_organ.applyOrganDamage(10) + return FALSE + diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index e56ca2cb3b..30cd7d30f3 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -31,17 +31,26 @@ /obj/item/organ/ears/on_life() if(!iscarbon(owner)) return + ..() var/mob/living/carbon/C = owner + if((damage < maxHealth) && (organ_flags & ORGAN_FAILING)) //ear damage can be repaired from the failing condition + organ_flags &= ~ORGAN_FAILING // genetic deafness prevents the body from using the ears, even if healthy if(HAS_TRAIT(C, TRAIT_DEAF)) deaf = max(deaf, 1) - else if(ear_damage < UNHEALING_EAR_DAMAGE) // if higher than UNHEALING_EAR_DAMAGE, no natural healing occurs. - ear_damage = max(ear_damage - 0.05, 0) + else if(!(organ_flags & ORGAN_FAILING)) // if this organ is failing, do not clear deaf stacks. deaf = max(deaf - 1, 0) + if(prob(damage / 20) && (damage > low_threshold)) + adjustEarDamage(0, 4) + SEND_SOUND(C, sound('sound/weapons/flash_ring.ogg')) + to_chat(C, "The ringing in your ears grows louder, blocking out any external noises for a moment.") + else if((organ_flags & ORGAN_FAILING) && (deaf == 0)) + deaf = 1 //stop being not deaf you deaf idiot /obj/item/organ/ears/proc/restoreEars() deaf = 0 ear_damage = 0 + organ_flags &= ~ORGAN_FAILING var/mob/living/carbon/C = owner diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index eeaaaf2a03..447f5b9ece 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -6,6 +6,19 @@ slot = ORGAN_SLOT_EYES gender = PLURAL + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + maxHealth = 0.5 * STANDARD_ORGAN_THRESHOLD //half the normal health max since we go blind at 30, a permanent blindness at 50 therefore makes sense unless medicine is administered + high_threshold = 0.3 * STANDARD_ORGAN_THRESHOLD //threshold at 30 + low_threshold = 0.2 * STANDARD_ORGAN_THRESHOLD //threshold at 20 + + low_threshold_passed = "Distant objects become somewhat less tangible." + high_threshold_passed = "Everything starts to look a lot less clear." + now_failing = "Darkness envelopes you, as your eyes go blind!" + now_fixed = "Color and shapes are once again perceivable." + high_threshold_cleared = "Your vision functions passably once more." + low_threshold_cleared = "Your vision is cleared of any ailment." + var/sight_flags = 0 var/see_in_dark = 2 var/eye_damage = 0 @@ -15,6 +28,7 @@ var/flash_protect = 0 var/see_invisible = SEE_INVISIBLE_LIVING var/lighting_alpha + var/damaged = FALSE //damaged indicates that our eyes are undergoing some level of negative effect /obj/item/organ/eyes/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = FALSE) ..() @@ -41,6 +55,29 @@ M.update_tint() M.update_sight() +/obj/item/organ/eyes/on_life() + ..() + var/mob/living/carbon/C = owner + //since we can repair fully damaged eyes, check if healing has occurred + if((organ_flags & ORGAN_FAILING) && (damage < maxHealth)) + organ_flags &= ~ORGAN_FAILING + C.cure_blind(EYE_DAMAGE) + //various degrees of "oh fuck my eyes", from "point a laser at your eye" to "staring at the Sun" intensities + if(damage > 20) + damaged = TRUE + if((organ_flags & ORGAN_FAILING)) + C.become_blind(EYE_DAMAGE) + else if(damage > 30) + C.overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2) + else + C.overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1) + //called once since we don't want to keep clearing the screen of eye damage for people who are below 20 damage + else if(damaged) + damaged = FALSE + C.clear_fullscreen("eye_damage") + return + + /obj/item/organ/eyes/night_vision name = "shadow eyes" desc = "A spooky set of eyes that can see in the dark." @@ -88,6 +125,7 @@ icon_state = "cybernetic_eyeballs" desc = "Your vision is augmented." status = ORGAN_ROBOTIC + organ_flags = ORGAN_SYNTHETIC /obj/item/organ/eyes/robotic/emp_act(severity) . = ..() @@ -97,6 +135,7 @@ return to_chat(owner, "Static obfuscates your vision!") owner.flash_act(visual = 1) + owner.adjustOrganLoss(ORGAN_SLOT_EYES, 25) /obj/item/organ/eyes/robotic/xray name = "\improper X-ray eyes" diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 5852cba0c9..f5e1151a35 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -4,12 +4,24 @@ icon_state = "heart-on" zone = BODY_ZONE_CHEST slot = ORGAN_SLOT_HEART + + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = 5 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death + + low_threshold_passed = "Prickles of pain appear then die out from within your chest..." + high_threshold_passed = "Something inside your chest hurts, and the pain isn't subsiding. You notice yourself breathing far faster than before." + now_fixed = "Your heart begins to beat again." + high_threshold_cleared = "The pain in your chest has died down, and your breathing becomes more relaxed." + // Heart attack code is in code/modules/mob/living/carbon/human/life.dm var/beating = 1 var/icon_base = "heart" attack_verb = list("beat", "thumped") var/beat = BEAT_NONE//is this mob having a heatbeat sound played? if so, which? + var/failed = FALSE //to prevent constantly running failing code + var/operated = FALSE //whether the heart's been operated on to fix some of its damages + /obj/item/organ/heart/update_icon() if(beating) icon_state = "[icon_base]-on" @@ -50,6 +62,7 @@ /obj/item/organ/heart/on_life() if(owner.client && beating) + failed = FALSE var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE) var/sound/fastbeat = sound('sound/health/fastbeat.ogg', repeat = TRUE) var/mob/living/carbon/H = owner @@ -70,11 +83,18 @@ H.stop_sound_channel(CHANNEL_HEARTBEAT) beat = BEAT_NONE + if(organ_flags & ORGAN_FAILING) //heart broke, stopped beating, death imminent + if(owner.stat == CONSCIOUS) + owner.visible_message("[owner] clutches at [owner.p_their()] chest as if [owner.p_their()] heart is stopping!") + owner.set_heartattack(TRUE) + failed = TRUE + /obj/item/organ/heart/cursed name = "cursed heart" desc = "A heart that, when inserted, will force you to pump it manually." icon_state = "cursedheart-off" icon_base = "cursedheart" + decay_factor = 0 actions_types = list(/datum/action/item_action/organ_action/cursed_heart) var/last_pump = 0 var/add_colour = TRUE //So we're not constantly recreating colour datums @@ -153,7 +173,7 @@ name = "cybernetic heart" desc = "An electronic device designed to mimic the functions of an organic human heart. Offers no benefit over an organic heart other than being easy to make." icon_state = "heart-c" - synthetic = TRUE + organ_flags = ORGAN_SYNTHETIC /obj/item/organ/heart/cybernetic/emp_act() . = ..() @@ -164,7 +184,7 @@ /obj/item/organ/heart/freedom name = "heart of freedom" desc = "This heart pumps with the passion to give... something freedom." - synthetic = TRUE //the power of freedom prevents heart attacks + organ_flags = ORGAN_SYNTHETIC //the power of freedom prevents heart attacks var/min_next_adrenaline = 0 /obj/item/organ/heart/freedom/on_life() diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index 94973a8e10..88d14cfd12 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -10,6 +10,11 @@ zone = BODY_ZONE_CHEST slot = ORGAN_SLOT_LIVER desc = "Pairing suggestion: chianti and fava beans." + + maxHealth = STANDARD_ORGAN_THRESHOLD + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + var/damage = 0 //liver damage, 0 is no damage, damage=maxHealth causes liver failure var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol var/failing //is this liver failing? @@ -24,7 +29,7 @@ var/mob/living/carbon/C = owner if(istype(C)) - if(!failing)//can't process reagents with a failing liver + if(!(organ_flags & ORGAN_FAILING))//can't process reagents with a failing liver //slowly heal liver damage damage = max(0, damage - 0.1) @@ -69,7 +74,7 @@ if(moveCalc == cachedmoveCalc)//reduce calculations return if(prob(5)) - to_chat(owner, "You feel a stange ache in your side, almost like a sitch. This pain is affecting your movements and making you feel lightheaded.") + to_chat(owner, "You feel a stange ache in your side, almost like a stitch. This pain is affecting your movements and making you feel lightheaded.") var/mob/living/carbon/human/H = owner H.add_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) H.AdjustBloodVol(moveCalc/3) @@ -97,14 +102,15 @@ name = "cybernetic liver" icon_state = "liver-c" desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce." - synthetic = TRUE + organ_flags = ORGAN_SYNTHETIC + maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD /obj/item/organ/liver/cybernetic/upgraded name = "upgraded cybernetic liver" icon_state = "liver-c-u" desc = "An upgraded version of the cybernetic liver, designed to improve upon organic livers. It is resistant to alcohol poisoning and is very robust at filtering toxins." alcohol_tolerance = 0.001 - maxHealth = 200 //double the health of a normal liver + maxHealth = 2 * STANDARD_ORGAN_THRESHOLD toxTolerance = 15 //can shrug off up to 15u of toxins toxLethality = 0.008 //20% less damage than a normal liver diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 95c5299ac3..fec66c45a8 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -8,6 +8,19 @@ gender = PLURAL w_class = WEIGHT_CLASS_NORMAL + var/failed = FALSE + var/operated = FALSE //whether we can still have our damages fixed through surgery + + //health + maxHealth = LUNGS_MAX_HEALTH + + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + + high_threshold_passed = "You feel some sort of constriction around your chest as your breathing becomes shallow and rapid." + now_fixed = "Your lungs seem to once again be able to hold air." + high_threshold_cleared = "The constriction around your chest loosens as your breathing calms down." + //Breath damage var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa @@ -56,12 +69,10 @@ var/crit_stabilizing_reagent = "epinephrine" - //health - var/maxHealth = LUNGS_MAX_HEALTH - var/damage = 0 + //TODO: lung health affects lung function -/obj/item/organ/lungs/proc/adjustLungLoss(damage_mod, mob/living/carbon/M) //damage might be too low atm. +/obj/item/organ/lungs/onDamage(damage_mod) //damage might be too low atm. if (maxHealth == INFINITY) return if(damage+damage_mod < 0) @@ -70,22 +81,22 @@ damage += damage_mod if ((damage / maxHealth) > 1) - to_chat(M, "You feel your lungs collapse within your chest as you gasp for air, unable to inflate them anymore!") - M.emote("gasp") + to_chat(owner, "You feel your lungs collapse within your chest as you gasp for air, unable to inflate them anymore!") + owner.emote("gasp") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Lungs lost") - qdel(src) + //qdel(src) - Handled elsewhere for now. else if ((damage / maxHealth) > 0.75) - to_chat(M, "It's getting really hard to breathe!!") - M.emote("gasp") - M.Dizzy(3) + to_chat(owner, "It's getting really hard to breathe!!") + owner.emote("gasp") + owner.Dizzy(3) else if ((damage / maxHealth) > 0.5) - M.Dizzy(2) - to_chat(M, "Your chest is really starting to hurt.") - M.emote("cough") + owner.Dizzy(2) + to_chat(owner, "Your chest is really starting to hurt.") + owner.emote("cough") else if ((damage / maxHealth) > 0.2) - to_chat(M, "You feel an ache within your chest.") - M.emote("cough") - M.Dizzy(1) + to_chat(owner, "You feel an ache within your chest.") + owner.emote("cough") + owner.Dizzy(1) /obj/item/organ/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) //TODO: add lung damage = less oxygen gains @@ -405,13 +416,13 @@ var/cold_modifier = H.dna.species.coldmod if(breath_temperature < cold_level_3_threshold) H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type) - adjustLungLoss((cold_level_3_damage*cold_modifier*2), H) + adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_3_damage*cold_modifier*2)) if(breath_temperature > cold_level_3_threshold && breath_temperature < cold_level_2_threshold) H.apply_damage_type(cold_level_2_damage*cold_modifier, cold_damage_type) - adjustLungLoss((cold_level_2_damage*cold_modifier*2), H) + adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_2_damage*cold_modifier*2)) if(breath_temperature > cold_level_2_threshold && breath_temperature < cold_level_1_threshold) H.apply_damage_type(cold_level_1_damage*cold_modifier, cold_damage_type) - adjustLungLoss((cold_level_1_damage*cold_modifier*2), H) + adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_1_damage*cold_modifier*2)) if(breath_temperature < cold_level_1_threshold) if(prob(20)) to_chat(H, "You feel [cold_message] in your [name]!") @@ -420,17 +431,29 @@ var/heat_modifier = H.dna.species.heatmod if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold) H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type) - adjustLungLoss((heat_level_1_damage*heat_modifier*2), H) + adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_1_damage*heat_modifier*2)) if(breath_temperature > heat_level_2_threshold && breath_temperature < heat_level_3_threshold) H.apply_damage_type(heat_level_2_damage*heat_modifier, heat_damage_type) - adjustLungLoss((heat_level_2_damage*heat_modifier*2), H) + adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_2_damage*heat_modifier*2)) if(breath_temperature > heat_level_3_threshold) H.apply_damage_type(heat_level_3_damage*heat_modifier, heat_damage_type) - adjustLungLoss((heat_level_3_damage*heat_modifier*2), H) + adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_3_damage*heat_modifier*2)) if(breath_temperature > heat_level_1_threshold) if(prob(20)) to_chat(H, "You feel [hot_message] in your [name]!") + +/obj/item/organ/lungs/on_life() + ..() + if((!failed) && ((organ_flags & ORGAN_FAILING))) + if(owner.stat == CONSCIOUS) + owner.visible_message("[owner] grabs [owner.p_their()] throat, struggling for breath!", \ + "You suddenly feel like you can't breathe!") + failed = TRUE + else if(!(organ_flags & ORGAN_FAILING)) + failed = FALSE + return + /obj/item/organ/lungs/prepare_eat() var/obj/S = ..() S.reagents.add_reagent("salbutamol", 5) @@ -451,14 +474,16 @@ name = "cybernetic lungs" desc = "A cybernetic version of the lungs found in traditional humanoid entities. It functions the same as an organic lung and is merely meant as a replacement." icon_state = "lungs-c" - synthetic = TRUE + organ_flags = ORGAN_SYNTHETIC maxHealth = 400 + safe_oxygen_min = 13 /obj/item/organ/lungs/cybernetic/emp_act() . = ..() if(. & EMP_PROTECT_SELF) return owner.losebreath = 20 + owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 25) /obj/item/organ/lungs/cybernetic/upgraded @@ -495,8 +520,24 @@ safe_toxins_max = 0 //We breathe this to gain POWER. + cold_level_1_threshold = 285 // Remember when slimes used to be succeptable to cold? Well.... + cold_level_2_threshold = 260 + cold_level_3_threshold = 230 + + maxHealth = 250 + /obj/item/organ/lungs/slime/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) . = ..() if (breath && breath.gases[/datum/gas/plasma]) var/plasma_pp = breath.get_breath_partial_pressure(breath.gases[/datum/gas/plasma]) owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. + +/obj/item/organ/lungs/yamerol + name = "Yamerol lungs" + desc = "A temporary pair of lungs made from self assembling yamerol molecules." + maxHealth = 200 + color = "#68e83a" + +/obj/item/organ/lungs/yamerol/on_life() + ..() + damage += 2 //Yamerol lungs are temporary \ No newline at end of file diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 9f910de9a9..13363d9158 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -1,3 +1,6 @@ +#define STANDARD_ORGAN_THRESHOLD 100 +#define STANDARD_ORGAN_HEALING 0.001 + /obj/item/organ name = "organ" icon = 'icons/obj/surgery.dmi' @@ -8,11 +11,34 @@ var/zone = BODY_ZONE_CHEST var/slot // DO NOT add slots with matching names to different zones - it will break internal_organs_slot list! - var/vital = 0 - //Was this organ implanted/inserted/etc, if true will not be removed during species change. - var/external = FALSE - var/synthetic = FALSE // To distinguish between organic and synthetic organs + var/organ_flags = 0 + var/maxHealth = STANDARD_ORGAN_THRESHOLD + var/damage = 0 //total damage this organ has sustained + ///Healing factor and decay factor function on % of maxhealth, and do not work by applying a static number per tick + var/healing_factor = 0 //fraction of maxhealth healed per on_life(), set to 0 for generic organs + var/decay_factor = 0 //same as above but when without a living owner, set to 0 for generic organs + var/high_threshold = STANDARD_ORGAN_THRESHOLD * 0.45 //when severe organ damage occurs + var/low_threshold = STANDARD_ORGAN_THRESHOLD * 0.1 //when minor organ damage occurs + ///Organ variables for determining what we alert the owner with when they pass/clear the damage thresholds + var/prev_damage = 0 + var/low_threshold_passed + var/high_threshold_passed + var/now_failing + var/now_fixed + var/high_threshold_cleared + var/low_threshold_cleared + +/obj/item/organ/proc/Assemble_Failure_Message() //need to assemble a failure message since we can't have variables be based off of the same object's variables + var/name_length + //if no unique failure message is set, output the generic one, otherwise give the one we have set + if(!Unique_Failure_Msg) + name_length = lentext(name) + if(name[name_length] == "s") //plural case, done without much sanitization since I don't know any organ that ends with an "s" that isn't plural at the moment + Unique_Failure_Msg = "Subject's [name] are too damaged to function, and needs to be replaced or fixed!" + else + Unique_Failure_Msg = "Subject's [name] is too damaged to function, and needs to be replaced or fixed!" + return Unique_Failure_Msg /obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) if(!iscarbon(M) || owner == M) @@ -33,31 +59,53 @@ for(var/X in actions) var/datum/action/A = X A.Grant(M) + STOP_PROCESSING(SSobj, src) //Special is for instant replacement like autosurgeons -/obj/item/organ/proc/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/proc/Remove(mob/living/carbon/M, special = FALSE) owner = null if(M) M.internal_organs -= src if(M.internal_organs_slot[slot] == src) M.internal_organs_slot.Remove(slot) - if(vital && !special && !(M.status_flags & GODMODE)) + if((organ_flags & ORGAN_VITAL) && !special && !(M.status_flags & GODMODE)) M.death() for(var/X in actions) var/datum/action/A = X A.Remove(M) + START_PROCESSING(SSobj, src) /obj/item/organ/proc/on_find(mob/living/finder) return -/obj/item/organ/proc/on_life() - return +/obj/item/organ/process() + on_death() //Kinda hate doing it like this, but I really don't want to call process directly. +/obj/item/organ/proc/on_death() //runs decay when outside of a person + if(organ_flags & (ORGAN_SYNTHETIC | ORGAN_FROZEN)) + return + applyOrganDamage(maxHealth * decay_factor) + +/obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing + if(organ_flags & ORGAN_FAILING) + return + ///Damage decrements by a percent of its maxhealth + var/healing_amount = -(maxHealth * healing_factor) + ///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health + healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0 + applyOrganDamage(healing_amount) //FERMI_TWEAK + /obj/item/organ/examine(mob/user) - ..() - if(status == ORGAN_ROBOTIC && crit_fail) - to_chat(user, "[src] seems to be broken!") + . = ..() + if(organ_flags & ORGAN_FAILING) + if(status == ORGAN_ROBOTIC) + . += "[src] seems to be broken!" + return + . += "[src] has decayed for too long, and has turned a sickly color! It doesn't look like it will work anymore!" + return + if(damage > high_threshold) + . += "[src] is starting to look discolored." /obj/item/organ/proc/prepare_eat() @@ -78,6 +126,10 @@ foodtype = RAW | MEAT | GROSS +/obj/item/organ/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + /obj/item/organ/Destroy() if(owner) // The special flag is important, because otherwise mobs can die @@ -100,6 +152,57 @@ /obj/item/organ/item_action_slot_check(slot,mob/user) return //so we don't grant the organ's action to mobs who pick up the organ. +///Adjusts an organ's damage by the amount "d", up to a maximum amount, which is by default max damage +/obj/item/organ/proc/applyOrganDamage(var/d, var/maximum = maxHealth) //use for damaging effects + if(!d) //Micro-optimization. + return + if(maximum < damage) + return + damage = CLAMP(damage + d, 0, maximum) + var/mess = check_damage_thresholds(owner) + prev_damage = damage + if(mess && owner) + to_chat(owner, mess) + +///SETS an organ's damage to the amount "d", and in doing so clears or sets the failing flag, good for when you have an effect that should fix an organ if broken +/obj/item/organ/proc/setOrganDamage(var/d) //use mostly for admin heals + applyOrganDamage(d - damage) + +/** check_damage_thresholds + * input: M (a mob, the owner of the organ we call the proc on) + * output: returns a message should get displayed. + * description: By checking our current damage against our previous damage, we can decide whether we've passed an organ threshold. + * If we have, send the corresponding threshold message to the owner, if such a message exists. + */ +/obj/item/organ/proc/check_damage_thresholds(var/M) + if(damage == prev_damage) + return + var/delta = damage - prev_damage + if(delta > 0) + if(damage >= maxHealth) + organ_flags |= ORGAN_FAILING + return now_failing + if(damage > high_threshold && prev_damage <= high_threshold) + return high_threshold_passed + if(damage > low_threshold && prev_damage <= low_threshold) + return low_threshold_passed + else + organ_flags &= ~ORGAN_FAILING + if(prev_damage > low_threshold && damage <= low_threshold) + return low_threshold_cleared + if(prev_damage > high_threshold && damage <= high_threshold) + return high_threshold_cleared + if(prev_damage == maxHealth) + return now_fixed + +//Runs some code on the organ when damage is taken/healed +/obj/item/organ/proc/onDamage(var/d, var/maximum = maxHealth) + return + +//Runs some code on the organ when damage is taken/healed +/obj/item/organ/proc/onSetDamage(var/d, var/maximum = maxHealth) + return + //Looking for brains? //Try code/modules/mob/living/carbon/brain/brain_item.dm diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index 24132bcf04..0f5a1c2917 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -8,12 +8,43 @@ desc = "Onaka ga suite imasu." var/disgust_metabolism = 1 + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + + low_threshold_passed = "Your stomach flashes with pain before subsiding. Food doesn't seem like a good idea right now." + high_threshold_passed = "Your stomach flares up with constant pain- you can hardly stomach the idea of food right now!" + high_threshold_cleared = "The pain in your stomach dies down for now, but food still seems unappealing." + low_threshold_cleared = "The last bouts of pain in your stomach have died out." + /obj/item/organ/stomach/on_life() var/mob/living/carbon/human/H = owner + var/datum/reagent/consumable/nutriment/Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list + if(istype(H)) - H.dna.species.handle_digestion(H) + if(!(organ_flags & ORGAN_FAILING)) + H.dna.species.handle_digestion(H) handle_disgust(H) + + if(Nutri) + + + if(damage < low_threshold) + return + + Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list + + if(Nutri) + if(prob((damage/40) * Nutri.volume * Nutri.volume)) + H.vomit(damage) + to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") + + else if(Nutri && damage > high_threshold) + if(prob((damage/10) * Nutri.volume * Nutri.volume)) + H.vomit(damage) + to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") + + /obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H) if(H.disgust) diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 7052c0c5c1..009cfce0a5 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -26,12 +26,14 @@ zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_ADAMANTINE_RESONATOR icon_state = "adamantine_resonator" + decay_factor = 0 /obj/item/organ/vocal_cords/adamantine name = "adamantine vocal cords" desc = "When adamantine resonates, it causes all nearby pieces of adamantine to resonate as well. Adamantine golems use this to broadcast messages to nearby golems." actions_types = list(/datum/action/item_action/organ_action/use/adamantine_vocal_cords) icon_state = "adamantine_cords" + decay_factor = 0 /datum/action/item_action/organ_action/use/adamantine_vocal_cords/Trigger() if(!IsAvailable()) @@ -62,6 +64,7 @@ var/cooldown_mod = 1 var/base_multiplier = 1 spans = list("colossus","yell") + decay_factor = 0 /datum/action/item_action/organ_action/colossus name = "Voice of God" @@ -623,10 +626,6 @@ /datum/action/item_action/organ_action/velvet name = "Velvet chords" var/obj/item/organ/vocal_cords/velvet/cords = null - //icon_icon = 'icons/mob/screen_alert.dmi' - //button_icon_state = "velvet_chords" - //icon = 'icons/mob/screen_alert.dmi' - //icon_state = "in_love" /datum/action/item_action/organ_action/velvet/New() ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index 275c244a83..7f3548dd94 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -288,7 +288,7 @@ if(prob(20)) to_chat(C, "You can feel your lungs burning!") var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS) - L.adjustLungLoss(acidstr*2, C) + L.adjustOrganLoss(ORGAN_SLOT_LUNG, acidstr*2) C.apply_damage(acidstr/5, BURN, target) C.acid_act(acidstr, volume) ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index b717948a20..b5cc5606b9 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -18,7 +18,7 @@ if(T) T.adjustTongueLoss(C, -2)//Fix the inputs me! if(L) - L.adjustLungLoss(-5, C) + L.adjustOrganLoss(ORGAN_SLOT_LUNG, -5) C.adjustOxyLoss(-2) else C.adjustOxyLoss(-10) @@ -65,9 +65,9 @@ holder.remove_reagent(src.id, "10") if(!C.getorganslot(ORGAN_SLOT_LUNGS)) - var/obj/item/organ/lungs/L = new() + var/obj/item/organ/lungs/yamero/L = new() L.Insert(C) - to_chat(C, "You feel your lungs reform in your chest.") + to_chat(C, "You feel the yamerol merge in your chest.") holder.remove_reagent(src.id, "10") C.adjustOxyLoss(-3) @@ -88,7 +88,7 @@ if(T) T.adjustTongueLoss(C, 1) if(L) - L.adjustLungLoss(4, C) + L.adjustOrganLoss(ORGAN_SLOT_LUNG, 4) C.adjustOxyLoss(3) else C.adjustOxyLoss(10) diff --git a/tgstation.dme b/tgstation.dme index 1173617419..a84daf855d 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2483,6 +2483,7 @@ #include "code\modules\projectiles\projectile\special\temperature.dm" #include "code\modules\projectiles\projectile\special\wormhole.dm" #include "code\modules\reagents\chem_splash.dm" +#include "code\modules\reagents\chem_wiki_render.dm" #include "code\modules\reagents\reagent_containers.dm" #include "code\modules\reagents\reagent_dispenser.dm" #include "code\modules\reagents\chemistry\colors.dm" From 107dd67cbee0bdaec26156b6d8dd029a49acc802 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 01:14:12 +0100 Subject: [PATCH 03/47] Well it compiles; just synthtissue and TongueLoss now. --- code/__DEFINES/mobs.dm | 3 ++ code/controllers/subsystem/blackbox.dm | 3 +- code/game/machinery/cloning.dm | 2 +- code/game/objects/items/defib.dm | 9 +++--- code/game/objects/items/devices/scanners.dm | 17 +++++------ .../antagonists/changeling/changeling.dm | 2 +- .../changeling/powers/regenerate.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 28 +++++++++++-------- code/modules/mob/living/brain/life.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 1 - .../mob/living/carbon/carbon_defense.dm | 10 +++---- .../modules/mob/living/carbon/damage_procs.dm | 6 ++-- code/modules/mob/living/carbon/life.dm | 1 - code/modules/mob/living/living.dm | 10 ++++--- code/modules/mob/transform_procs.dm | 4 +-- .../chemistry/reagents/medicine_reagents.dm | 8 +++--- .../nanites/nanite_programs/healing.dm | 4 +-- code/modules/surgery/graft_synthtissue.dm | 21 ++++++-------- .../surgery/organs/augments_internal.dm | 2 +- code/modules/surgery/organs/liver.dm | 2 -- code/modules/surgery/organs/lungs.dm | 12 ++++---- code/modules/surgery/organs/organ_internal.dm | 15 ++-------- code/modules/surgery/organs/stomach.dm | 5 +--- code/modules/surgery/organs/tongue.dm | 3 +- .../code/datums/status_effects/chems.dm | 3 +- .../reagents/chemistry/reagents/SDGF.dm | 6 ++-- .../chemistry/reagents/fermi_reagents.dm | 3 +- .../reagents/chemistry/reagents/healing.dm | 25 +++++++++++++++-- tgstation.dme | 4 ++- 29 files changed, 107 insertions(+), 106 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 8b5cb1453b..657bbf82d5 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -254,6 +254,9 @@ #define MAX_QUIRKS 6 //The maximum amount of quirks one character can have at roundstart +#define MAX_REVIVE_FIRE_DAMAGE 180 +#define MAX_REVIVE_BRUTE_DAMAGE 180 + // AI Toggles #define AI_CAMERA_LUMINOSITY 5 #define AI_VOX // Comment out if you don't want VOX to be enabled and have players download the voice sounds. diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 7cb46f594a..58476d472f 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -295,7 +295,6 @@ Versioning var/sqlbrute = L.getBruteLoss() var/sqlfire = L.getFireLoss() var/sqlbrain = L.getOrganLoss(ORGAN_SLOT_BRAIN) - var/sqlbrain = L.getOrganLoss(ORGAN_SLOT_BRAIN) var/sqloxy = L.getOxyLoss() var/sqltox = L.getToxLoss() var/sqlclone = L.getCloneLoss() @@ -309,7 +308,7 @@ Versioning if(!SSdbcore.Connect()) return - + sqlname = sanitizeSQL(sqlname) sqlkey = sanitizeSQL(sqlkey) sqljob = sanitizeSQL(sqljob) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index efb357f295..66151031a2 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -447,7 +447,7 @@ unattached_flesh.Cut() H.setCloneLoss(CLONE_INITIAL_DAMAGE) //Yeah, clones start with very low health, not with random, because why would they start with random health - H.setBrainLoss(CLONE_INITIAL_DAMAGE) + H.setOrganLoss(ORGAN_SLOT_BRAIN, CLONE_INITIAL_DAMAGE) // In addition to being cellularly damaged and having barely any // brain function, they also have no limbs or internal organs. diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index c2c7dbfabc..e960272783 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -451,7 +451,7 @@ if(!heart || (heart.organ_flags & ORGAN_FAILING)) return var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) - if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided) + if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || H.suiciding) return return TRUE @@ -568,12 +568,11 @@ if(do_after(user, primetimer, target = H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process user.visible_message("[user] places [src] on [H]'s chest.", "You place [src] on [H]'s chest.") playsound(src, 'sound/machines/defib_charge.ogg', 75, 0) - var/tplus = world.time - H.timeofdeath // patients rot when they are killed, and die when they are dead + var/tplus = world.time - H.timeofdeath //length of time spent dead var/tloss = deathtimer var/total_burn = 0 var/total_brute = 0 - var/tplus = world.time - H.timeofdeath //length of time spent dead var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart) if(do_after(user, primetimer2, target = H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total for(var/obj/item/carried_item in H.contents) @@ -614,11 +613,11 @@ failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain tissue is damaged making recovery of patient impossible via defibrillator. Further attempts futile." if(BR.brain_death) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain damaged beyond point of no return. Further attempts futile." - if(BR.suicided || BR.brainmob?.suiciding) + if(H.suicided || BR.brainmob?.suiciding) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No intelligence pattern can be detected in patient's brain. Further attempts futile." else failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing. Further attempts futile." - + if(failed) user.visible_message(failed) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index a546a83732..8ceb8abc16 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -243,11 +243,11 @@ SLIME SCANNER healthy = FALSE msg += "\tSubject is deaf.\n" else - if(ears.ear_damage) - msg += "\tSubject has [ears.ear_damage > UNHEALING_EAR_DAMAGE? "permanent ": "temporary "]hearing damage.\n" + if(ears.damage) + to_chat(user, "\tSubject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.") healthy = FALSE if(ears.deaf) - msg += "\tSubject is [ears.ear_damage > UNHEALING_EAR_DAMAGE ? "permanently ": "temporarily "] deaf.\n" + to_chat(user, "\tSubject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.") healthy = FALSE if(healthy) msg += "\tHealthy.\n" @@ -263,13 +263,13 @@ SLIME SCANNER if(HAS_TRAIT(C, TRAIT_NEARSIGHT)) msg += "\tSubject is nearsighted.\n" healthy = FALSE - if(eyes.eye_damage > 30) + if(eyes.damage > 30) msg += "\tSubject has severe eye damage.\n" healthy = FALSE - else if(eyes.eye_damage > 20) + else if(eyes.damage > 20) msg += "\tSubject has significant eye damage.\n" healthy = FALSE - else if(eyes.eye_damage) + else if(eyes.damage) msg += "\tSubject has minor eye damage.\n" healthy = FALSE if(healthy) @@ -292,7 +292,7 @@ SLIME SCANNER msg += "\tDamage: Brute-Burn-Toxin-Suffocation\n\t\tSpecifics: [brute_loss]-[fire_loss]-[tox_loss]-[oxy_loss]\n" for(var/obj/item/bodypart/org in damaged) msg += "\t\t[capitalize(org.name)]: [(org.brute_dam > 0) ? "[org.brute_dam]" : "0"]-[(org.burn_dam > 0) ? "[org.burn_dam]" : "0"]\n" - + //Organ damages report if(ishuman(M)) var/mob/living/carbon/human/H = M @@ -345,9 +345,6 @@ SLIME SCANNER to_chat(user, minor_damage) to_chat(user, major_damage) to_chat(user, max_damage) - //Genetic damage - if(advanced && H.has_dna()) - to_chat(user, "\tGenetic Stability: [H.dna.stability]%.") // Species and body temperature diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 67f6bd1d46..b6e3d66c35 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -340,7 +340,7 @@ if(istype(C)) var/obj/item/organ/brain/B = C.getorganslot(ORGAN_SLOT_BRAIN) if(B) - B.vital = FALSE + B.organ_flags &= ~ORGAN_VITAL B.decoy_override = TRUE update_changeling_icons_added() return diff --git a/code/modules/antagonists/changeling/powers/regenerate.dm b/code/modules/antagonists/changeling/powers/regenerate.dm index a1f8e1ef9b..1b27fa9694 100644 --- a/code/modules/antagonists/changeling/powers/regenerate.dm +++ b/code/modules/antagonists/changeling/powers/regenerate.dm @@ -35,7 +35,7 @@ B = new C.dna.species.mutant_brain() else B = new() - B.vital = FALSE + B.organ_flags &= ~ORGAN_VITAL B.decoy_override = TRUE B.Insert(C) if(ishuman(user)) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 8b1ab66ba0..1d032109db 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -7,7 +7,7 @@ layer = ABOVE_MOB_LAYER zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_BRAIN - organ_flags |= ORGAN_VITAL + organ_flags = ORGAN_VITAL attack_verb = list("attacked", "slapped", "whacked") ///The brain's organ variables are significantly more different than the other organs, with half the decay rate for balance reasons, and twice the maxHealth decay_factor = STANDARD_ORGAN_DECAY / 2 //30 minutes of decaying to result in a fully damaged brain, since a fast decay rate would be unfun gameplay-wise @@ -16,7 +16,7 @@ low_threshold = 45 high_threshold = 120 var/mob/living/brain/brainmob = null - var/organ_flags & ORGAN_FAILING = FALSE //whether the brain organ is damaged. + var/brain_death = FALSE //if the brainmob was intentionally killed by attacking the brain after removal, or by severe braindamage var/decoy_override = FALSE //I apologize to the security players, and myself, who abused this, but this is going to go. //two variables necessary for calculating whether we get a brain trauma or not var/damage_delta = 0 @@ -103,16 +103,16 @@ if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("neurine")) //Neurine fixes dead brains . = TRUE //don't do attack animation. - var/cached_Bdamage = brainmob?.health + var/cached_Bdamage = brainmob?.health var/datum/reagent/medicine/neurine/N = reagents.has_reagent("neurine") - if(O.reagents.has_reagent("mannitol")//Just a quick way to bolster the effects if someone mixes up a batch. + if(O.reagents.has_reagent("mannitol"))//Just a quick way to bolster the effects if someone mixes up a batch. N.volume *= 1.5 if(!O.reagents.has_reagent("neurine", 10)) to_chat(user, "There's not enough neurine in [O] to restore [src]!") return - + user.visible_message("[user] starts to pour the contents of [O] onto [src].", "You start to slowly pour the contents of [O] onto [src].") if(!do_after(user, 60, TRUE, src)) to_chat(user, "You failed to pour [O] onto [src]!") @@ -123,10 +123,10 @@ O.reagents.clear_reagents() if(cached_Bdamage) //Fixing dead brains yeilds a trauma - if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD && brainmob.health > HEALTH_THRESHOLD_DEAD) + if((cached_Bdamage <= HEALTH_THRESHOLD_DEAD) && (brainmob.health > HEALTH_THRESHOLD_DEAD)) if(prob(90)) gain_trauma_type(BRAIN_TRAUMA_MILD) - if else(prob(50)) + else if(prob(50)) gain_trauma_type(BRAIN_TRAUMA_SEVERE) else gain_trauma_type(BRAIN_TRAUMA_SPECIAL) @@ -136,8 +136,8 @@ . = TRUE //don't do attack animation. var/datum/reagent/medicine/mannitol/M = reagents.has_reagent("mannitol") if(brain_death || brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing - to_chat(user, "[src] is far too damaged, you'll have to use neurine on it!") - return + to_chat(user, "[src] is far too damaged, you'll have to use neurine on it!") + return if(!O.reagents.has_reagent("mannitol", 10)) to_chat(user, "There's not enough mannitol in [O] to restore [src]!") @@ -152,13 +152,13 @@ setOrganDamage((damage - (0.05 * maxHealth)*M.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up O.reagents.clear_reagents() return - -/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . += + +/obj/item/organ/brain/examine(mob/user)//BUG_PROBABLE_CAUSE to_chats changed to . += . = ..() - if(suicided) + if(user.suiciding) . += "It's started turning slightly grey. They must not have been able to handle the stress of it all." else if(brainmob) if(brainmob.get_ghost(FALSE, TRUE)) @@ -247,6 +247,10 @@ owner.death() brain_death = TRUE +/obj/item/organ/brain/on_death() + if(damage <= BRAIN_DAMAGE_DEATH) //rip + brain_death = FALSE + /obj/item/organ/brain/process() //needs to run in life AND death ..() //if we're not more injured than before, return without gambling for a trauma diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 64f2a207a2..51be1f6971 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -20,7 +20,7 @@ else if(istype(loc, /obj/item/organ/brain)) BR = loc if(BR) - BR.organ_flags & ORGAN_FAILING = 1 //beaten to a pulp + BR.brain_death = TRUE /mob/living/brain/proc/handle_emp_damage() if(emp_damage) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 5cbbc92693..9b5e60a295 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -814,7 +814,6 @@ reagents.clear_reagents() var/obj/item/organ/brain/B = getorgan(/obj/item/organ/brain) if(B) - B.organ_flags & ORGAN_FAILING = FALSE B.brain_death = FALSE for(var/thing in diseases) var/datum/disease/D = thing diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 57483f64e7..bc64c8303b 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -405,16 +405,16 @@ if(istype(ears) && (deafen_pwr || damage_pwr)) var/ear_damage = damage_pwr * effect_amount - var/deaf = max(ears.deaf, deafen_pwr * effect_amount) + var/deaf = deafen_pwr * effect_amount adjustEarDamage(ear_damage,deaf) - if(ears.ear_damage >= 15) + if(ears.damage >= 15) to_chat(src, "Your ears start to ring badly!") - if(prob(ears.ear_damage - 5)) + if(prob(ears.damage - 5)) to_chat(src, "You can't hear anything!") - ears.ear_damage = min(ears.ear_damage, UNHEALING_EAR_DAMAGE) + ears.damage = min(ears.damage, ears.maxHealth) // you need earmuffs, inacusiate, or replacement - else if(ears.ear_damage >= 5) + else if(ears.damage >= 5) to_chat(src, "Your ears start to ring!") SEND_SOUND(src, sound('sound/weapons/flash_ring.ogg',0,1,0,250)) return effect_amount //how soundbanged we are diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 5a1878f6bb..cc0c0d7434 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -147,15 +147,15 @@ if(O) return O.damage -/mob/living/carbon/adjustAllOrganLoss(amount, maximum) - for(var/o in internal_organs) +/mob/living/carbon/proc/adjustAllOrganLoss(amount, maximum) + for(var/obj/item/organ/O in internal_organs) if(O && !(status_flags & GODMODE)) continue if(!maximum) maximum = O.maxHealth O.applyOrganDamage(amount, maximum) O.onDamage(amount, maximum) - + //////////////////////////////////////////// diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 6b3902bb07..cb155839c6 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -49,7 +49,6 @@ //Start of a breath chain, calls breathe() /mob/living/carbon/handle_breathing(times_fired) - /mob/living/carbon/handle_breathing(times_fired) var/next_breath = 4 var/obj/item/organ/lungs/L = getorganslot(ORGAN_SLOT_LUNGS) var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c22b070340..5c6422c86e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -500,10 +500,12 @@ mood.sanity = SANITY_GREAT mood.update_mood() //Heal all organs - if(internal_organs) - for(var/organ in internal_organs) - var/obj/item/organ/O = organ - O.setOrganDamage(0) + if(iscarbon(src)) + var/mob/living/carbon/C = src + if(C.internal_organs) + for(var/organ in C.internal_organs) + var/obj/item/organ/O = organ + O.setOrganDamage(0) //proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index be907fc1cd..6bbe512776 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -75,7 +75,7 @@ O.setOxyLoss(getOxyLoss(), 0) O.setCloneLoss(getCloneLoss(), 0) O.adjustFireLoss(getFireLoss(), 0) - O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0) + O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN), 0) O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina O.updatehealth() O.radiation = radiation @@ -236,7 +236,7 @@ O.setOxyLoss(getOxyLoss(), 0) O.setCloneLoss(getCloneLoss(), 0) O.adjustFireLoss(getFireLoss(), 0) - O.setBrainLoss(getOrganLoss(ORGAN_SLOT_BRAIN), 0) + O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN), 0) O.adjustStaminaLoss(getStaminaLoss(), 0)//CIT CHANGE - makes monkey transformations inherit stamina O.updatehealth() O.radiation = radiation diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index f6863c6023..951a77b0e8 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -44,7 +44,7 @@ M.heal_bodypart_damage(5,5) M.adjustToxLoss(-5, 0, TRUE) M.hallucination = 0 - M.setBrainLoss(0) + M.setOrganLoss(ORGAN_SLOT_BRAIN, 0) REMOVE_TRAITS_NOT_IN(M, list(SPECIES_TRAIT, ROUNDSTART_TRAIT, ORGAN_TRAIT)) M.set_blurriness(0) M.set_blindness(0) @@ -856,16 +856,16 @@ if(M.notify_ghost_cloning(source = M)) spawn (100) //so the ghost has time to re-enter return - + else M.adjustOxyLoss(-20, 0) M.adjustToxLoss(-20, 0) var/mob/living/carbon/H = M for(var/organ in H.internal_organs) var/obj/item/organ/O = organ - O.setOrganDamage(0) + O.setOrganDamage(0) M.updatehealth() - + if(M.revive()) M.emote("gasp") log_combat(M, M, "revived", src) diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 5d89d3aba5..66a5344d6c 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -198,7 +198,7 @@ if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN)) return ..() return FALSE - + /datum/nanite_program/brain_heal_advanced/active_effect() host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2, TRUE) if(iscarbon(host_mob) && prob(10)) @@ -232,7 +232,7 @@ if(!C.getorgan(/obj/item/organ/heart)) //what are we even shocking return FALSE var/obj/item/organ/brain/BR = C.getorgan(/obj/item/organ/brain) - if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || BR.suicided) + if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || C.suiciding) return FALSE if(C.get_ghost()) return FALSE diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index aeb3205b81..58e4c4a181 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -4,7 +4,7 @@ /datum/surgery/graft_synthtissue name = "Graft_synthtissue" - target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST) steps = list( /datum/surgery_step/incise, @@ -16,8 +16,8 @@ /datum/surgery_step/close ) -//repair lungs step -/datum/surgery_step/repair_synthtissue +//repair organs +/datum/surgery_step/graft_synthtissue name = "graft synthtissue" implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) repeatable = TRUE @@ -25,10 +25,8 @@ chems_needed = list("synthtissue") var/obj/item/organ/chosen_organ -//Repair lungs -/datum/surgery_step/repair_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(implement_type in implements_extract) - current_type = "insert" +/datum/surgery_step/graft_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(implement_type in implements) var/list/organs = target.getorganszone(target_zone) if(!organs.len) to_chat(user, "There are no targetable organs in [target]'s [parse_zone(target_zone)]!") @@ -39,24 +37,23 @@ organs -= O organs[O.name] = O chosen_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in organs - if(chosen_organ.organ_flags & ORGAN_FAILING)) + if(chosen_organ.organ_flags & ORGAN_FAILING) to_chat(user, "[target]'s [chosen_organ] is too damaged to repair graft onto!") return -1 - + user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].") -/datum/surgery_step/repair_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/graft_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING)) to_chat(user, "[target] has no [chosen_organ] capable of repair!") else user.visible_message("[user] successfully repairs part of [target]'s [chosen_organ].", "You succeed in repairing parts of [target]'s [chosen_organ].") chosen_organ.applyOrganDamage(-10) -/datum/surgery_step/repair_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/graft_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING)) to_chat(user, "[target] has no [chosen_organ] capable of repair!") else user.visible_message("[user] accidentally damages part of [target]'s [chosen_organ]!", "You damage [target]'s [chosen_organ]! Apply more synthtissue if it's run out.") chosen_organ.applyOrganDamage(10) return FALSE - diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 0648a30fe1..114b92f10d 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -103,7 +103,7 @@ /obj/item/organ/cyberimp/brain/anti_stun/on_life() ..() - if((crit_fail || !(organ_flags & ORGAN_FAILING)) && amount > 0) + if(crit_fail || !(organ_flags & ORGAN_FAILING)) return owner.adjustStaminaLoss(-3.5) //Citadel edit, makes it more useful in Stamina based combat if(owner.AmountStun() > STUN_SET_AMOUNT) diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index 88d14cfd12..01559c83c3 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -15,10 +15,8 @@ healing_factor = STANDARD_ORGAN_HEALING decay_factor = STANDARD_ORGAN_DECAY - var/damage = 0 //liver damage, 0 is no damage, damage=maxHealth causes liver failure var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol var/failing //is this liver failing? - var/maxHealth = LIVER_DEFAULT_HEALTH var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver var/filterToxins = TRUE //whether to filter toxins diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index fec66c45a8..4c791c91f2 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -416,13 +416,13 @@ var/cold_modifier = H.dna.species.coldmod if(breath_temperature < cold_level_3_threshold) H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_3_damage*cold_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_3_damage*cold_modifier*2)) if(breath_temperature > cold_level_3_threshold && breath_temperature < cold_level_2_threshold) H.apply_damage_type(cold_level_2_damage*cold_modifier, cold_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_2_damage*cold_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_2_damage*cold_modifier*2)) if(breath_temperature > cold_level_2_threshold && breath_temperature < cold_level_1_threshold) H.apply_damage_type(cold_level_1_damage*cold_modifier, cold_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (cold_level_1_damage*cold_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (cold_level_1_damage*cold_modifier*2)) if(breath_temperature < cold_level_1_threshold) if(prob(20)) to_chat(H, "You feel [cold_message] in your [name]!") @@ -431,13 +431,13 @@ var/heat_modifier = H.dna.species.heatmod if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold) H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_1_damage*heat_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_1_damage*heat_modifier*2)) if(breath_temperature > heat_level_2_threshold && breath_temperature < heat_level_3_threshold) H.apply_damage_type(heat_level_2_damage*heat_modifier, heat_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_2_damage*heat_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_2_damage*heat_modifier*2)) if(breath_temperature > heat_level_3_threshold) H.apply_damage_type(heat_level_3_damage*heat_modifier, heat_damage_type) - adjustOrganLoss(ORGAN_SLOT_LUNG, (heat_level_3_damage*heat_modifier*2)) + H.adjustOrganLoss(ORGAN_SLOT_LUNGS, (heat_level_3_damage*heat_modifier*2)) if(breath_temperature > heat_level_1_threshold) if(prob(20)) to_chat(H, "You feel [hot_message] in your [name]!") diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 13363d9158..65b0888bc7 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -29,17 +29,6 @@ var/high_threshold_cleared var/low_threshold_cleared -/obj/item/organ/proc/Assemble_Failure_Message() //need to assemble a failure message since we can't have variables be based off of the same object's variables - var/name_length - //if no unique failure message is set, output the generic one, otherwise give the one we have set - if(!Unique_Failure_Msg) - name_length = lentext(name) - if(name[name_length] == "s") //plural case, done without much sanitization since I don't know any organ that ends with an "s" that isn't plural at the moment - Unique_Failure_Msg = "Subject's [name] are too damaged to function, and needs to be replaced or fixed!" - else - Unique_Failure_Msg = "Subject's [name] is too damaged to function, and needs to be replaced or fixed!" - return Unique_Failure_Msg - /obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) if(!iscarbon(M) || owner == M) return @@ -94,8 +83,8 @@ var/healing_amount = -(maxHealth * healing_factor) ///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0 - applyOrganDamage(healing_amount) //FERMI_TWEAK - + applyOrganDamage(healing_amount) //to FERMI_TWEAK + /obj/item/organ/examine(mob/user) . = ..() if(organ_flags & ORGAN_FAILING) diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index 0f5a1c2917..f9b4f180e3 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -25,9 +25,6 @@ if(!(organ_flags & ORGAN_FAILING)) H.dna.species.handle_digestion(H) handle_disgust(H) - - if(Nutri) - if(damage < low_threshold) return @@ -44,7 +41,7 @@ H.vomit(damage) to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") - + /obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H) if(H.disgust) diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 3eaaa8de92..be56a1387b 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -10,8 +10,7 @@ var/list/languages_possible var/say_mod = null var/taste_sensitivity = 15 // lower is more sensitive. - var/maxHealth = TONGUE_MAX_HEALTH - var/damage = 0 + maxHealth = TONGUE_MAX_HEALTH var/modifies_speech = FALSE var/static/list/languages_possible_base = typecacheof(list( /datum/language/common, diff --git a/modular_citadel/code/datums/status_effects/chems.dm b/modular_citadel/code/datums/status_effects/chems.dm index 61a107e446..1b1886173b 100644 --- a/modular_citadel/code/datums/status_effects/chems.dm +++ b/modular_citadel/code/datums/status_effects/chems.dm @@ -230,8 +230,7 @@ // owner.remove_status_effect(src)//At the moment, a user can enthrall themselves, toggle this back in if that should be removed. redirect_component = WEAKREF(owner.AddComponent(/datum/component/redirect, list(COMSIG_LIVING_RESIST = CALLBACK(src, .proc/owner_resist)))) //Do resistance calc if resist is pressed# RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/owner_hear) - var/obj/item/organ/brain/B = M.getorganslot(ORGAN_SLOT_BRAIN) //It's their brain! - mental_capacity = 500 - B.get_brain_damage() + mental_capacity = 500 - M.getOrganLoss(ORGAN_SLOT_BRAIN)//It's their brain! var/mob/living/carbon/human/H = owner if(H)//Prefs if(!H.canbearoused) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 8af3176746..84c436cdbd 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -123,7 +123,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //Damage the clone SM.blood_volume = (BLOOD_VOLUME_NORMAL*SM.blood_ratio)/2 SM.adjustCloneLoss(60, 0) - SM.setBrainLoss(40) + SM.setOrganLoss(ORGAN_SLOT_BRAIN, 40) SM.nutrition = startHunger/2 //Transfer remaining reagent to clone. I think around 30u will make a healthy clone, otherwise they'll have clone damage, blood loss, brain damage and hunger. @@ -249,7 +249,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING SM.adjustToxLoss(-(bodydamage/10), 0) SM.blood_volume = (BLOOD_VOLUME_NORMAL*SM.blood_ratio)/1.5 SM.adjustCloneLoss((bodydamage/10), 0) - SM.setBrainLoss((bodydamage/10)) + SM.setOrganLoss(ORGAN_SLOT_BRAIN, (bodydamage/10)) SM.nutrition = 400 if(bodydamage>200) SM.gain_trauma_type(BRAIN_TRAUMA_MILD) @@ -289,7 +289,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING if(M.blood_volume < (BLOOD_VOLUME_NORMAL*M.blood_ratio)) M.blood_volume += 10 M.adjustCloneLoss(-2, 0) - M.setBrainLoss(-1) + M.setOrganLoss(ORGAN_SLOT_BRAIN, -1) M.nutrition += 10 ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index 7f3548dd94..a7c4ea00b5 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -287,8 +287,7 @@ if((method==VAPOR) && (!C.wear_mask)) if(prob(20)) to_chat(C, "You can feel your lungs burning!") - var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS) - L.adjustOrganLoss(ORGAN_SLOT_LUNG, acidstr*2) + C.adjustOrganLoss(ORGAN_SLOT_LUNGS, acidstr*2) C.apply_damage(acidstr/5, BURN, target) C.acid_act(acidstr, volume) ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index b5cc5606b9..3cbccfd2cd 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -18,7 +18,7 @@ if(T) T.adjustTongueLoss(C, -2)//Fix the inputs me! if(L) - L.adjustOrganLoss(ORGAN_SLOT_LUNG, -5) + C.adjustOrganLoss(ORGAN_SLOT_LUNGS, -5) C.adjustOxyLoss(-2) else C.adjustOxyLoss(-10) @@ -65,7 +65,7 @@ holder.remove_reagent(src.id, "10") if(!C.getorganslot(ORGAN_SLOT_LUNGS)) - var/obj/item/organ/lungs/yamero/L = new() + var/obj/item/organ/lungs/yamerol/L = new() L.Insert(C) to_chat(C, "You feel the yamerol merge in your chest.") holder.remove_reagent(src.id, "10") @@ -88,8 +88,27 @@ if(T) T.adjustTongueLoss(C, 1) if(L) - L.adjustOrganLoss(ORGAN_SLOT_LUNG, 4) + C.adjustOrganLoss(ORGAN_SLOT_LUNGS, 4) C.adjustOxyLoss(3) else C.adjustOxyLoss(10) ..() + + +/datum/reagent/fermi/synthtissue + name = "Synthtissue" + id = "synthtissue" + description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." + +/datum/reagent/fermi/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) + if(iscarbon(M)) + var/target = M.zone_selected + if (M.stat == DEAD) + show_message = 0 + if(method in list(PATCH, TOUCH)) + M.apply_damage(volume*1.25, BRUTE, target) + M.apply_damage(volume*1.25, BURN, target) + if(show_message) + to_chat(M, "You feel your damaged [target] heal! It stings like hell!") + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) + ..() diff --git a/tgstation.dme b/tgstation.dme index a84daf855d..e5e65864e7 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2483,7 +2483,6 @@ #include "code\modules\projectiles\projectile\special\temperature.dm" #include "code\modules\projectiles\projectile\special\wormhole.dm" #include "code\modules\reagents\chem_splash.dm" -#include "code\modules\reagents\chem_wiki_render.dm" #include "code\modules\reagents\reagent_containers.dm" #include "code\modules\reagents\reagent_dispenser.dm" #include "code\modules\reagents\chemistry\colors.dm" @@ -2718,13 +2717,16 @@ #include "code\modules\surgery\brain_surgery.dm" #include "code\modules\surgery\cavity_implant.dm" #include "code\modules\surgery\core_removal.dm" +#include "code\modules\surgery\coronary_bypass.dm" #include "code\modules\surgery\dental_implant.dm" #include "code\modules\surgery\embalming.dm" #include "code\modules\surgery\eye_surgery.dm" +#include "code\modules\surgery\graft_synthtissue.dm" #include "code\modules\surgery\helpers.dm" #include "code\modules\surgery\implant_removal.dm" #include "code\modules\surgery\limb_augmentation.dm" #include "code\modules\surgery\lipoplasty.dm" +#include "code\modules\surgery\lobectomy.dm" #include "code\modules\surgery\mechanic_steps.dm" #include "code\modules\surgery\nutcracker.dm" #include "code\modules\surgery\organ_manipulation.dm" From aabc2423a8625524b6c6b0ebb7e7b07128eedc56 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 01:19:45 +0100 Subject: [PATCH 04/47] Oops. --- code/game/objects/items/defib.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index e960272783..a4f286bf88 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -613,7 +613,7 @@ failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain tissue is damaged making recovery of patient impossible via defibrillator. Further attempts futile." if(BR.brain_death) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain damaged beyond point of no return. Further attempts futile." - if(H.suicided || BR.brainmob?.suiciding) + if(H.suiciding || BR.brainmob?.suiciding) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No intelligence pattern can be detected in patient's brain. Further attempts futile." else failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's brain is missing. Further attempts futile." From d8e6f4247ead4d0274872913bd5cfddd112f947d Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 13:40:44 +0100 Subject: [PATCH 05/47] Traaavis --- code/modules/jobs/job_types/chaplain.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/jobs/job_types/chaplain.dm b/code/modules/jobs/job_types/chaplain.dm index f9de81fe1f..56b72d1704 100644 --- a/code/modules/jobs/job_types/chaplain.dm +++ b/code/modules/jobs/job_types/chaplain.dm @@ -72,7 +72,7 @@ B.name = "Fluorescent Incandescence" if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks", "meme", "memes") B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition","F.A.T.A.L. Rulebook") - H.adjustBrainLoss(100) // starts off retarded as fuck + H.adjusOrganLoss(ORGAN_SLOT_BRAIN, 100) // starts off retarded as fuck if("monkeyism","apism","gorillism","primatism") B.name = pick("Going Bananas", "Bananas Out For Harambe") if("mormonism") From 40bac8c807419d5ab7499662fa547e1dc5744680 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 14:44:12 +0100 Subject: [PATCH 06/47] t --- code/modules/jobs/job_types/chaplain.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/jobs/job_types/chaplain.dm b/code/modules/jobs/job_types/chaplain.dm index 56b72d1704..97b1edc8c2 100644 --- a/code/modules/jobs/job_types/chaplain.dm +++ b/code/modules/jobs/job_types/chaplain.dm @@ -72,7 +72,7 @@ B.name = "Fluorescent Incandescence" if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks", "meme", "memes") B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition","F.A.T.A.L. Rulebook") - H.adjusOrganLoss(ORGAN_SLOT_BRAIN, 100) // starts off retarded as fuck + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 100) // starts off retarded as fuck if("monkeyism","apism","gorillism","primatism") B.name = pick("Going Bananas", "Bananas Out For Harambe") if("mormonism") From a398f64b66f475130c8839407156dafa4d949ded Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 15:33:40 +0100 Subject: [PATCH 07/47] Okay --- code/modules/mob/living/taste.dm | 6 ++--- .../research/designs/medical_designs.dm | 22 +++++++++++++++++++ code/modules/research/techweb/all_nodes.dm | 13 +++++++++-- code/modules/surgery/organs/ears.dm | 22 ++++++++++++++++++- code/modules/surgery/organs/lungs.dm | 17 +++++++------- code/modules/surgery/organs/tongue.dm | 2 +- .../reagents/chemistry/reagents/healing.dm | 4 ++-- 7 files changed, 69 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/taste.dm b/code/modules/mob/living/taste.dm index 282fe0a716..8b0c54653c 100644 --- a/code/modules/mob/living/taste.dm +++ b/code/modules/mob/living/taste.dm @@ -43,7 +43,7 @@ .=..() if ((from.pH > 12.5) || (from.pH < 1.5)) to_chat(src, "You taste chemical burns!") - T.adjustTongueLoss(src, 4) + T.applyOrganDamage(5) if(istype(T, /obj/item/organ/tongue/cybernetic)) to_chat(src, "Your tongue moves on it's own in response to the liquid.") say("The pH is appropriately [round(from.pH, 1)].") @@ -52,13 +52,13 @@ switch(from.pH) if(11.5 to INFINITY) to_chat(src, "You taste a strong alkaline flavour!") - T.adjustTongueLoss(src, 1) + T.applyOrganDamage(1) if(8.5 to 11.5) to_chat(src, "You taste a sort of soapy tone in the mixture.") if(2.5 to 5.5) to_chat(src, "You taste a sort of acid tone in the mixture.") if(-INFINITY to 2.5) to_chat(src, "You taste a strong acidic flavour!") - T.adjustTongueLoss(src, 1) + T.applyOrganDamage(1) #undef DEFAULT_TASTE_SENSITIVITY diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index d3db4f75b3..05f9ee6d07 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -702,6 +702,28 @@ category = list("Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL +/datum/design/cybernetic_ears + name = "Cybernetic Ears" + desc = "A pair of cybernetic ears." + id = "cybernetic_ears" + build_type = PROTOLATHE | MECHFAB + construction_time = 30 + materials = list(/datum/material/iron = 250, /datum/material/glass = 400) + build_path = /obj/item/organ/ears/cybernetic + category = list("Misc", "Medical Designs") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL + +/datum/design/cybernetic_ears_u + name = "Upgraded Cybernetic Ears" + desc = "A pair of upgraded cybernetic ears." + id = "cybernetic_ears_u" + build_type = PROTOLATHE | MECHFAB + construction_time = 40 + materials = list(/datum/material/iron = 500, /datum/material/glass = 500, /datum/material/silver = 500) + build_path = /obj/item/organ/ears/cybernetic/upgraded + category = list("Misc", "Medical Designs") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL + ///////////////////// ///Surgery Designs/// ///////////////////// diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 3721e7943e..4db27394d6 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -517,8 +517,17 @@ display_name = "Cybernetic Organs" description = "We have the technology to rebuild him." prereq_ids = list("adv_biotech") - design_ids = list("cybernetic_heart", "cybernetic_liver", "cybernetic_liver_u", "cybernetic_lungs", "cybernetic_lungs_u", "cybernetic_tongue") - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) + design_ids = list("cybernetic_ears", "cybernetic_heart", "cybernetic_liver", "cybernetic_lungs", "cybernetic_tongue") + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) + export_price = 5000 + +/datum/techweb_node/cyber_organs_upgraded + id = "cyber_organs_upgraded" + display_name = "Upgraded Cybernetic Organs" + description = "We have the technology to upgrade him." + prereq_ids = list("cyber_organs") + design_ids = list("cybernetic_ears_u", "cybernetic_heart_u", "cybernetic_liver_u", "cybernetic_lungs_u") + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1500) export_price = 5000 /datum/techweb_node/cyber_implants diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index 30cd7d30f3..bc71a5cc95 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -116,4 +116,24 @@ name = "tin ears" desc = "The robust ears of a bronze golem. " damage_multiplier = 0.1 //STRONK - bang_protect = 1 //Fear me weaklings. + bang_protect = 1 //Fear me weaklings. + +/obj/item/organ/ears/cybernetic + name = "cybernetic ears" + icon_state = "ears-c" + desc = "a basic cybernetic designed to mimic the operation of ears." + damage_multiplier = 0.9 + organ_flags = ORGAN_SYNTHETIC + +/obj/item/organ/ears/cybernetic/upgraded + name = "upgraded cybernetic ears" + icon_state = "ears-c-u" + desc = "an advanced cybernetic ear, surpassing the performance of organic ears" + damage_multiplier = 0.5 +This conversation was marked as resolved by ExcessiveUseOfCobblestone + +/obj/item/organ/ears/cybernetic/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_SELF) + return + damage += 40/severity diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 4c791c91f2..94243b1eda 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -73,27 +73,28 @@ //TODO: lung health affects lung function /obj/item/organ/lungs/onDamage(damage_mod) //damage might be too low atm. + cached_damage = damage if (maxHealth == INFINITY) return - if(damage+damage_mod < 0) - damage = 0 + if(cached_damage+damage_mod < 0) + cached_damage = 0 return - damage += damage_mod - if ((damage / maxHealth) > 1) + cached_damage += damage_mod + if ((cached_damage/ maxHealth) > 1) to_chat(owner, "You feel your lungs collapse within your chest as you gasp for air, unable to inflate them anymore!") owner.emote("gasp") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Lungs lost") //qdel(src) - Handled elsewhere for now. - else if ((damage / maxHealth) > 0.75) + else if ((cached_damage / maxHealth) > 0.75) to_chat(owner, "It's getting really hard to breathe!!") owner.emote("gasp") owner.Dizzy(3) - else if ((damage / maxHealth) > 0.5) + else if ((cached_damage / maxHealth) > 0.5) owner.Dizzy(2) to_chat(owner, "Your chest is really starting to hurt.") owner.emote("cough") - else if ((damage / maxHealth) > 0.2) + else if ((cached_damage / maxHealth) > 0.2) to_chat(owner, "You feel an ache within your chest.") owner.emote("cough") owner.Dizzy(1) @@ -540,4 +541,4 @@ /obj/item/organ/lungs/yamerol/on_life() ..() - damage += 2 //Yamerol lungs are temporary \ No newline at end of file + damage += 2 //Yamerol lungs are temporary diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index be56a1387b..91a29db813 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -30,7 +30,7 @@ /obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args) -/obj/item/organ/tongue/proc/adjustTongueLoss(mob/living/carbon/M, damage_mod) +/obj/item/organ/tongue/proc/onDamage(damage_mod) if (maxHealth == "alien") return if (maxHealth == "bone") diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 3cbccfd2cd..9a5a2a9247 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -16,7 +16,7 @@ var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS) if(T) - T.adjustTongueLoss(C, -2)//Fix the inputs me! + T.applyOrganDamage(-2) if(L) C.adjustOrganLoss(ORGAN_SLOT_LUNGS, -5) C.adjustOxyLoss(-2) @@ -86,7 +86,7 @@ var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS) if(T) - T.adjustTongueLoss(C, 1) + T.applyOrganDamage(1) if(L) C.adjustOrganLoss(ORGAN_SLOT_LUNGS, 4) C.adjustOxyLoss(3) From b9a2a5ce38f6fd9aeabd32f77ad2bc3544a032b2 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 19 Sep 2019 15:41:26 +0100 Subject: [PATCH 08/47] Oops --- code/modules/research/designs/medical_designs.dm | 4 ++-- code/modules/surgery/organs/ears.dm | 1 - code/modules/surgery/organs/lungs.dm | 2 +- code/modules/surgery/organs/tongue.dm | 14 +++++++------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 05f9ee6d07..457169c67f 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -708,7 +708,7 @@ id = "cybernetic_ears" build_type = PROTOLATHE | MECHFAB construction_time = 30 - materials = list(/datum/material/iron = 250, /datum/material/glass = 400) + materials = list(MAT_METAL = 250, MAT_GLASS = 400) build_path = /obj/item/organ/ears/cybernetic category = list("Misc", "Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL @@ -719,7 +719,7 @@ id = "cybernetic_ears_u" build_type = PROTOLATHE | MECHFAB construction_time = 40 - materials = list(/datum/material/iron = 500, /datum/material/glass = 500, /datum/material/silver = 500) + materials = list(MAT_METAL = 500, MAT_GLASS = 500, MAT_SILVER = 500) build_path = /obj/item/organ/ears/cybernetic/upgraded category = list("Misc", "Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index bc71a5cc95..0d3002915e 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -130,7 +130,6 @@ icon_state = "ears-c-u" desc = "an advanced cybernetic ear, surpassing the performance of organic ears" damage_multiplier = 0.5 -This conversation was marked as resolved by ExcessiveUseOfCobblestone /obj/item/organ/ears/cybernetic/emp_act(severity) . = ..() diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 94243b1eda..f3eaba1a1b 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -73,7 +73,7 @@ //TODO: lung health affects lung function /obj/item/organ/lungs/onDamage(damage_mod) //damage might be too low atm. - cached_damage = damage + var/cached_damage = damage if (maxHealth == INFINITY) return if(cached_damage+damage_mod < 0) diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 91a29db813..e53723425d 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -30,13 +30,13 @@ /obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args) -/obj/item/organ/tongue/proc/onDamage(damage_mod) +/obj/item/organ/tongue/onDamage(damage_mod) if (maxHealth == "alien") return if (maxHealth == "bone") - var/target = M.get_bodypart(BODY_ZONE_HEAD) - M.apply_damage(damage_mod, BURN, target) - to_chat(M, "The drink burns your skull! Oof, your bones!") + var/target = owner.get_bodypart(BODY_ZONE_HEAD) + owner.apply_damage(damage_mod, BURN, target) + to_chat(owner, "The drink burns your skull! Oof, your bones!") return if(damage+damage_mod < 0) damage = 0 @@ -44,13 +44,13 @@ damage += damage_mod if ((damage / maxHealth) > 1) - to_chat(M, "Your tongue is singed beyond recognition, and disintegrates!") + to_chat(owner, "Your tongue is singed beyond recognition, and disintegrates!") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Tongues lost to Fermi") qdel(src) else if ((damage / maxHealth) > 0.85) - to_chat(M, "Your tongue feels like it's about to fall out!.") + to_chat(owner, "Your tongue feels like it's about to fall out!.") else if ((damage / maxHealth) > 0.5) - to_chat(M, "Your tongue is really starting to hurt.") + to_chat(owner, "Your tongue is really starting to hurt.") /obj/item/organ/tongue/Insert(mob/living/carbon/M, special = 0) From 3b1a36fb07fe55eeaec642315d0225393fc0668f Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 20 Sep 2019 04:17:01 +0100 Subject: [PATCH 09/47] Needed. --- code/__DEFINES/flags.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index d64fa30047..d9b30bf0e3 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -10,6 +10,8 @@ #define CHECK_BITFIELD(variable, flag) (variable & (flag)) #define TOGGLE_BITFIELD(variable, flag) (variable ^= (flag)) +#define CHECK_MULTIPLE_BITFIELDS(flagvar, flags) (((flagvar) & (flags)) == (flags)) + GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)) // for /datum/var/datum_flags From 13cf5a78222eb29836f88f6b85576686f7a79754 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 20 Sep 2019 22:51:14 +0100 Subject: [PATCH 10/47] Updates --- .../modules/reagents/chemistry/reagents/alcohol_reagents.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 39c77314cb..c0dd49e338 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1431,13 +1431,13 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M) if(holder.has_reagent("neurotoxin")) - M.adjustBrainLoss(-1*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT<_BRAIN, -1*REM, 150) M.reagents.remove_reagent("neurotoxin", 1.5 * REAGENTS_METABOLISM, FALSE) if(holder.has_reagent("fentanyl")) - M.adjustBrainLoss(-1*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT<_BRAIN, -1*REM, 150) M.reagents.remove_reagent("fentanyl", 0.75 * REAGENTS_METABOLISM, FALSE) else - M.adjustBrainLoss(-0.5*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT<_BRAIN, -0.5*REM, 150) M.dizziness +=2 ..() From 2b80998f64f88af93d961ad8918a1e07602f93af Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 04:19:34 +0100 Subject: [PATCH 11/47] Adds: cybernetic_heart_u and VV viewer. --- code/datums/datumvars.dm | 34 ++++++++++++++++++- .../chemistry/reagents/alcohol_reagents.dm | 6 ++-- .../research/designs/medical_designs.dm | 11 ++++++ code/modules/surgery/organs/heart.dm | 32 ++++++++++++++++- 4 files changed, 78 insertions(+), 5 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 93eb764c3f..16577429b8 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -97,6 +97,14 @@ BRAIN:[M.getOrganLoss(ORGAN_SLOT_BRAIN)] STAMINA:[M.getStaminaLoss()] AROUSAL:[M.getArousalLoss()] + HEART:[M.getOrganLoss(ORGAN_SLOT_HEART)] + LIVER:[M.getOrganLoss(ORGAN_SLOT_LIVER)] + LUNGS:[M.getOrganLoss(ORGAN_SLOT_LUNGS)] + EYES:[M.getOrganLoss(ORGAN_SLOT_EYES)] + EARS:[M.getOrganLoss(ORGAN_SLOT_EARS)] + STOMACH:[M.getOrganLoss(ORGAN_SLOT_STOMACH)] + TONGUE:[M.getOrganLoss(ORGAN_SLOT_TONGUE)] + APPENDIX:[M.getOrganLoss(ORGAN_SLOT_APPENDIX)] "} else @@ -1345,6 +1353,30 @@ if("arousal") L.adjustArousalLoss(amount) newamt = L.getArousalLoss() + if("heart") + L.adjustOrganLoss(ORGAN_SLOT_HEART, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_HEART) + if("liver") + L.adjustOrganLoss(ORGAN_SLOT_LIVER, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_LIVER) + if("lungs") + L.adjustOrganLoss(ORGAN_SLOT_LUNGS, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_LUNGS) + if("eye_sight") + L.adjustOrganLoss(ORGAN_SLOT_EYES, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_EYES) + if("ears") + L.adjustOrganLoss(ORGAN_SLOT_EARS, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_EARS) + if("stomach") + L.adjustOrganLoss(ORGAN_SLOT_STOMACH, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_STOMACH) + if("tongue") + L.adjustOrganLoss(ORGAN_SLOT_TONGUE, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_TONGUE) + if("appendix") + L.adjustOrganLoss(ORGAN_SLOT_APPENDIX, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_APPENDIX) else to_chat(usr, "You caused an error. DEBUG: Text:[Text] Mob:[L]") return @@ -1360,4 +1392,4 @@ return var/mob/living/carbon/human/H = locate(href_list["copyoutfit"]) in GLOB.carbon_list if(istype(H)) - H.copy_outfit() \ No newline at end of file + H.copy_outfit() diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index c0dd49e338..991da11508 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1431,13 +1431,13 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M) if(holder.has_reagent("neurotoxin")) - M.adjustOrganLoss(ORGAN_SLOT<_BRAIN, -1*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150) M.reagents.remove_reagent("neurotoxin", 1.5 * REAGENTS_METABOLISM, FALSE) if(holder.has_reagent("fentanyl")) - M.adjustOrganLoss(ORGAN_SLOT<_BRAIN, -1*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150) M.reagents.remove_reagent("fentanyl", 0.75 * REAGENTS_METABOLISM, FALSE) else - M.adjustOrganLoss(ORGAN_SLOT<_BRAIN, -0.5*REM, 150) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -0.5*REM, 150) M.dizziness +=2 ..() diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 457169c67f..59dada07e1 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -524,6 +524,17 @@ category = list("Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL +/datum/design/cybernetic_heart_u + name = "Upgraded Cybernetic Heart" + desc = "An upgraded cybernetic heart" + id = "cybernetic_heart_u" + build_type = PROTOLATHE | MECHFAB + construction_time = 50 + materials = list(MAT_METAL = 500, MAT_GLASS = 500, MAT_SILVER = 500) + build_path = /obj/item/organ/heart/cybernetic/upgraded + category = list("Misc", "Medical Designs") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL + /datum/design/cybernetic_liver_u name = "Upgraded Cybernetic Liver" desc = "An upgraded cybernetic liver" diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index f5e1151a35..3a64955f84 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -175,11 +175,41 @@ icon_state = "heart-c" organ_flags = ORGAN_SYNTHETIC -/obj/item/organ/heart/cybernetic/emp_act() +/obj/item/organ/heart/cybernetic/emp_act(severity) . = ..() if(. & EMP_PROTECT_SELF) return Stop() + addtimer(CALLBACK(src, .proc/Restart), 20/severity SECONDS) + damage += 100/severity + +/obj/item/organ/heart/cybernetic/upgraded + name = "upgraded cybernetic heart" + desc = "An electronic device designed to mimic the functions of an organic human heart. Also holds an emergency dose of epinephrine, used automatically after facing severe trauma. This upgraded model can regenerate its dose after use." + icon_state = "heart-c-u" + maxHealth = 2 * STANDARD_ORGAN_THRESHOLD + + //I put it on upgraded for now. + var/dose_available = TRUE + var/rid = /datum/reagent/medicine/epinephrine + var/ramount = 10 + +obj/item/organ/heart/cybernetic/upgraded/on_life() + . = ..() + if(dose_available && owner.health <= owner.crit_threshold && !owner.reagents.has_reagent(rid)) + owner.reagents.add_reagent(rid, ramount) + used_dose() + if(ramount < 10) //eats your nutrition to regen epinephrine + var/regen_amount = owner.nutrition/2000 + owner.nutrition -= regen_amount + ramount += regen_amount + +/obj/item/organ/heart/cybernetic/upgraded/proc/used_dose() + . = ..() + addtimer(VARSET_CALLBACK(src, dose_available, TRUE), 5 MINUTES) + ramount = 0 + + /obj/item/organ/heart/freedom name = "heart of freedom" From 4b44b31aa3edc168a44ebcaa7d8497fed1510050 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 08:24:46 +0100 Subject: [PATCH 12/47] Okay, feature done --- code/datums/datumvars.dm | 7 +++- code/modules/reagents/chemistry/holder.dm | 6 +++- .../reagents/chemistry/recipes/medicine.dm | 35 +++++++++++++++++++ code/modules/surgery/organs/tongue.dm | 26 ++++++++------ .../reagents/chemistry/reagents/healing.dm | 7 ++-- .../reagents/chemistry/recipes/fermi.dm | 2 +- 6 files changed, 68 insertions(+), 15 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 16577429b8..cfbd8be32c 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -97,6 +97,9 @@ BRAIN:[M.getOrganLoss(ORGAN_SLOT_BRAIN)] STAMINA:[M.getStaminaLoss()] AROUSAL:[M.getArousalLoss()] + "} + if(GLOB.Debug2) + atomsnowflake += {" HEART:[M.getOrganLoss(ORGAN_SLOT_HEART)] LIVER:[M.getOrganLoss(ORGAN_SLOT_LIVER)] LUNGS:[M.getOrganLoss(ORGAN_SLOT_LUNGS)] @@ -105,7 +108,9 @@ STOMACH:[M.getOrganLoss(ORGAN_SLOT_STOMACH)] TONGUE:[M.getOrganLoss(ORGAN_SLOT_TONGUE)] APPENDIX:[M.getOrganLoss(ORGAN_SLOT_APPENDIX)] - + "} + atomsnowflake += {" + "} else atomsnowflake += "[D]" diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 61273d181d..558639640a 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -550,6 +550,10 @@ if (multiplier == 0) fermiEnd() return + for(var/P in C.required_catalysts) + if(!has_reagent(P)) + fermiEnd() + return for(var/P in cached_results) targetVol = cached_results[P]*multiplier @@ -676,7 +680,7 @@ STOP_PROCESSING(SSprocessing, src) return 0 - C.FermiCreate(src)//proc that calls when step is done + C.FermiCreate(src, addChemAmmount, purity)//proc that calls when step is done //Apply pH changes and thermal output of reaction to beaker chem_temp = round(cached_temp + (C.ThermicConstant * addChemAmmount)) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index 59865dd1da..2c75fc8827 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -68,6 +68,41 @@ results = list("synthflesh" = 3) required_reagents = list("blood" = 1, "carbon" = 1, "styptic_powder" = 1) +/datum/chemical_reaction/synthtissue + name = "Synthtissue" + id = "synthtissue" + results = list("synthtissue" = 0.05) + required_reagents = list("synthflesh" = 0.01) + required_catalysts = list("nutriment" = 0.1) + //FermiChem vars: + OptimalTempMin = 305 // Lower area of bell curve for determining heat based rate reactions + OptimalTempMax = 315 // Upper end for above + ExplodeTemp = 1050 // Temperature at which reaction explodes + OptimalpHMin = 9 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase) + OptimalpHMax = 9.5 // Higest value for above + ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase) + CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst) + CurveSharpT = 2.5 // How sharp the temperature exponential curve is (to the power of value) + CurveSharppH = 2.5 // How sharp the pH exponential curve is (to the power of value) + ThermicConstant = 0.01 // Temperature change per 1u produced + HIonRelease = 0.01 // pH change per 1u reaction (inverse for some reason) + RateUpLim = 0.02 // Optimal/max rate possible if all conditions are perfect + FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics + PurityMin = 0 + +/datum/chemical_reaction/synthtissue/FermiCreate(datum/reagents/holder, added_volume, added_purity) + var/datum/reagent/St = holder.has_reagent("synthtissue") + var/datum/reagent/N = holder.has_reagent("nutriment") + if(!St) + return + if(holder.chem_temp > 320) + var/temp_ratio = 1-(330 - holder.chem_temp)/10 + holder.remove_reagent(src.id, added_volume*temp_ratio) + if(St.purity < 1) + St.volume *= St.purity + St.purity = 1 + N.volume -= 0.002 + /datum/chemical_reaction/styptic_powder name = "Styptic Powder" id = "styptic_powder" diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index e53723425d..34fcc86a10 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -30,19 +30,25 @@ /obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args) -/obj/item/organ/tongue/onDamage(damage_mod) - if (maxHealth == "alien") - return +/obj/item/organ/tongue/applyOrganDamage(var/d, var/maximum = maxHealth) if (maxHealth == "bone") + if(owner) + return var/target = owner.get_bodypart(BODY_ZONE_HEAD) - owner.apply_damage(damage_mod, BURN, target) - to_chat(owner, "The drink burns your skull! Oof, your bones!") - return - if(damage+damage_mod < 0) - damage = 0 + owner.apply_damage(d, BURN, target) + to_chat(owner, "You feel your skull burning! Oof, your bones!") return - damage += damage_mod + if(!d) //Micro-optimization. + return + if(maximum < damage) + return + damage = CLAMP(damage + d, 0, maximum) + var/mess = check_damage_thresholds(owner) + prev_damage = damage + if(mess && owner) + to_chat(owner, mess) + if ((damage / maxHealth) > 1) to_chat(owner, "Your tongue is singed beyond recognition, and disintegrates!") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Tongues lost to Fermi") @@ -167,7 +173,7 @@ icon_state = "tonguexeno" say_mod = "hisses" taste_sensitivity = 10 // LIZARDS ARE ALIENS CONFIRMED - maxHealth = "alien" //Their blood is acid, so, no, though a tongueless xeno might be funny + maxHealth = 500 //They've a little mouth for a tongue, so it's pretty rhobust modifies_speech = TRUE // not really, they just hiss var/static/list/languages_possible_alien = typecacheof(list( /datum/language/xenocommon, diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 9a5a2a9247..5a8d74d30b 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -95,12 +95,13 @@ ..() -/datum/reagent/fermi/synthtissue +/datum/reagent/synthtissue name = "Synthtissue" id = "synthtissue" description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." + pH = 7.6 -/datum/reagent/fermi/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) +/datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) if(iscarbon(M)) var/target = M.zone_selected if (M.stat == DEAD) @@ -112,3 +113,5 @@ to_chat(M, "You feel your damaged [target] heal! It stings like hell!") SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) ..() + +//NEEDS ON_MOB_DEAD() diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm index d993322fcb..78765434b2 100644 --- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm +++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm @@ -2,7 +2,7 @@ mix_sound = 'sound/effects/bubbles.ogg' //Called for every reaction step -/datum/chemical_reaction/proc/FermiCreate(holder) +/datum/chemical_reaction/proc/FermiCreate(datum/reagents) return //Called when reaction STOP_PROCESSING From a08c1229d63989ea94291c01d067b6744b289240 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 09:31:53 +0100 Subject: [PATCH 13/47] OKAY now I'm done I think. --- .../reagents/chemistry/recipes/medicine.dm | 8 +++--- code/modules/surgery/graft_synthtissue.dm | 2 +- code/modules/surgery/organs/organ_internal.dm | 21 +++++++++++++-- .../reagents/chemistry/reagents/healing.dm | 26 ++++++++++++++++--- .../reagents/chemistry/recipes/fermi.dm | 2 +- 5 files changed, 49 insertions(+), 10 deletions(-) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index 2c75fc8827..b5f0fb0f4b 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -82,16 +82,16 @@ OptimalpHMax = 9.5 // Higest value for above ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase) CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst) - CurveSharpT = 2.5 // How sharp the temperature exponential curve is (to the power of value) + CurveSharpT = 1 // How sharp the temperature exponential curve is (to the power of value) CurveSharppH = 2.5 // How sharp the pH exponential curve is (to the power of value) ThermicConstant = 0.01 // Temperature change per 1u produced HIonRelease = 0.01 // pH change per 1u reaction (inverse for some reason) - RateUpLim = 0.02 // Optimal/max rate possible if all conditions are perfect + RateUpLim = 0.05 // Optimal/max rate possible if all conditions are perfect FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics PurityMin = 0 /datum/chemical_reaction/synthtissue/FermiCreate(datum/reagents/holder, added_volume, added_purity) - var/datum/reagent/St = holder.has_reagent("synthtissue") + var/datum/reagent/synthtissue/St = holder.has_reagent("synthtissue") var/datum/reagent/N = holder.has_reagent("nutriment") if(!St) return @@ -102,6 +102,8 @@ St.volume *= St.purity St.purity = 1 N.volume -= 0.002 + St.grown_volume += added_volume + St.data = St.grown_volume /datum/chemical_reaction/styptic_powder name = "Styptic Powder" diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index 58e4c4a181..fb0a2552ba 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -5,7 +5,7 @@ /datum/surgery/graft_synthtissue name = "Graft_synthtissue" species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list(BODY_ZONE_CHEST) + possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES) steps = list( /datum/surgery_step/incise, /datum/surgery_step/retract_skin, diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 65b0888bc7..78742e9b61 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -198,7 +198,7 @@ /mob/living/proc/regenerate_organs() return 0 -/mob/living/carbon/regenerate_organs() +/mob/living/carbon/regenerate_organs(only_one = FALSE) var/breathes = TRUE var/blooded = TRUE if(dna && dna.species) @@ -217,6 +217,8 @@ else LI = new() LI.Insert(src) + if(only_one) + return if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH)) var/obj/item/organ/stomach/S @@ -226,14 +228,20 @@ else S = new() S.Insert(src) + if(only_one) + return if(breathes && !getorganslot(ORGAN_SLOT_LUNGS)) var/obj/item/organ/lungs/L = new() L.Insert(src) + if(only_one) + return if(blooded && !getorganslot(ORGAN_SLOT_HEART)) var/obj/item/organ/heart/H = new() H.Insert(src) + if(only_one) + return if(!getorganslot(ORGAN_SLOT_TONGUE)) var/obj/item/organ/tongue/T @@ -245,7 +253,10 @@ // if they have no mutant tongues, give them a regular one T.Insert(src) - else + if(only_one) + return + + else if (!only_one) var/obj/item/organ/tongue/oT = getorganslot(ORGAN_SLOT_TONGUE) if(oT.name == "fluffy tongue") var/obj/item/organ/tongue/T @@ -266,6 +277,8 @@ else E = new() E.Insert(src) + if(only_one) + return if(!getorganslot(ORGAN_SLOT_EARS)) var/obj/item/organ/ears/ears @@ -275,9 +288,13 @@ ears = new ears.Insert(src) + if(only_one) + return if(!getorganslot(ORGAN_SLOT_TAIL)) var/obj/item/organ/tail/tail if(dna && dna.species && dna.species.mutanttail) tail = new dna.species.mutanttail tail.Insert(src) + if(only_one) + return diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 5a8d74d30b..f2db39a593 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -100,18 +100,38 @@ id = "synthtissue" description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." pH = 7.6 + var/grown_volume = 0 + var/injected_vol = 0 /datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) + cached_method = method if(iscarbon(M)) var/target = M.zone_selected if (M.stat == DEAD) show_message = 0 if(method in list(PATCH, TOUCH)) - M.apply_damage(volume*1.25, BRUTE, target) - M.apply_damage(volume*1.25, BURN, target) + M.apply_damage(reac_volume*-1.25, BRUTE, target) + M.apply_damage(reac_volume*-1.25, BURN, target) if(show_message) - to_chat(M, "You feel your damaged [target] heal! It stings like hell!") + to_chat(M, "You feel your [target] heal! It stings like hell!") SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) + if(method == INJECT) + injected_vol += reac_volume + ..() + +/datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C) + if(!iscarbon(C)) + return ..() + if(cached_method == INJECT) + if(grown_volume > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) + if(volume >= 20) + C.regenerate_organs(only_one = TRUE) + C.reagents.remove_reagent(id, 20) + ..() + +/datum/reagent/synthtissue/on_merge(data) + if(data > grown_volume) + grown_volume = data ..() //NEEDS ON_MOB_DEAD() diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm index 78765434b2..7d5e36f84f 100644 --- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm +++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm @@ -2,7 +2,7 @@ mix_sound = 'sound/effects/bubbles.ogg' //Called for every reaction step -/datum/chemical_reaction/proc/FermiCreate(datum/reagents) +/datum/chemical_reaction/proc/FermiCreate(datum/reagents/holder, added_volume, added_purity) return //Called when reaction STOP_PROCESSING From 15d36cbaa17d4fd389d93f78a5b046f3f52ff003 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 09:37:54 +0100 Subject: [PATCH 14/47] I need to stop leaving .dm files open in dreammaker. --- .../code/modules/reagents/chemistry/reagents/healing.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index f2db39a593..a0af4175e4 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -100,18 +100,18 @@ id = "synthtissue" description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." pH = 7.6 + metabolization_rate = 0.1 var/grown_volume = 0 var/injected_vol = 0 /datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) - cached_method = method if(iscarbon(M)) var/target = M.zone_selected if (M.stat == DEAD) show_message = 0 if(method in list(PATCH, TOUCH)) - M.apply_damage(reac_volume*-1.25, BRUTE, target) - M.apply_damage(reac_volume*-1.25, BURN, target) + M.apply_damage(reac_volume*-1.5, BRUTE, target) + M.apply_damage(reac_volume*-1.5, BURN, target) if(show_message) to_chat(M, "You feel your [target] heal! It stings like hell!") SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) @@ -122,7 +122,7 @@ /datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C) if(!iscarbon(C)) return ..() - if(cached_method == INJECT) + if(injected_vol >= 20) if(grown_volume > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) if(volume >= 20) C.regenerate_organs(only_one = TRUE) From f0ea842c170e3f9cf085583b874d4e44819efd00 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 09:58:37 +0100 Subject: [PATCH 15/47] lil tweaks. --- code/modules/reagents/chemistry/recipes/medicine.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index b5f0fb0f4b..1886f5d159 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -78,14 +78,14 @@ OptimalTempMin = 305 // Lower area of bell curve for determining heat based rate reactions OptimalTempMax = 315 // Upper end for above ExplodeTemp = 1050 // Temperature at which reaction explodes - OptimalpHMin = 9 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase) + OptimalpHMin = 8.5 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase) OptimalpHMax = 9.5 // Higest value for above ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase) CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst) CurveSharpT = 1 // How sharp the temperature exponential curve is (to the power of value) CurveSharppH = 2.5 // How sharp the pH exponential curve is (to the power of value) ThermicConstant = 0.01 // Temperature change per 1u produced - HIonRelease = 0.01 // pH change per 1u reaction (inverse for some reason) + HIonRelease = 0.015 // pH change per 1u reaction (inverse for some reason) RateUpLim = 0.05 // Optimal/max rate possible if all conditions are perfect FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics PurityMin = 0 From a3ae942c1d76d56ee9d38eac90ea4ffcec695b48 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 11:13:20 +0100 Subject: [PATCH 16/47] Okay.. I think this fixes it all. --- .../reagents/chemistry/recipes/medicine.dm | 4 +- code/modules/surgery/graft_synthtissue.dm | 9 +++-- code/modules/surgery/organs/organ_internal.dm | 16 ++++---- .../reagents/chemistry/reagents/healing.dm | 40 +++++++++++++------ 4 files changed, 42 insertions(+), 27 deletions(-) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index 1886f5d159..f1eda93505 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -102,8 +102,8 @@ St.volume *= St.purity St.purity = 1 N.volume -= 0.002 - St.grown_volume += added_volume - St.data = St.grown_volume + St.data.["grown_volume"] += added_volume + St.data = St.data.["grown_volume"] /datum/chemical_reaction/styptic_powder name = "Styptic Powder" diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index fb0a2552ba..0d396e5fdf 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -3,7 +3,7 @@ //TBD: Add heart damage, have heart reconstruction seperate from organ reconstruction, and find a better name for this. I can imagine people getting it confused with manipulation. /datum/surgery/graft_synthtissue - name = "Graft_synthtissue" + name = "Graft synthtissue" species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES) steps = list( @@ -21,7 +21,7 @@ name = "graft synthtissue" implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) repeatable = TRUE - time = 25 + time = 50 chems_needed = list("synthtissue") var/obj/item/organ/chosen_organ @@ -36,9 +36,10 @@ O.on_find(user) organs -= O organs[O.name] = O - chosen_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in organs + chosen_organ = input("Target which organ?", "Surgery", null, null) as null|anything in organs + chosen_organ = organs[chosen_organ] if(chosen_organ.organ_flags & ORGAN_FAILING) - to_chat(user, "[target]'s [chosen_organ] is too damaged to repair graft onto!") + to_chat(user, "[target]'s [chosen_organ] is too damaged to graft onto!") return -1 user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].") diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 78742e9b61..4da064b895 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -218,7 +218,7 @@ LI = new() LI.Insert(src) if(only_one) - return + return TRUE if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH)) var/obj/item/organ/stomach/S @@ -229,19 +229,19 @@ S = new() S.Insert(src) if(only_one) - return + return TRUE if(breathes && !getorganslot(ORGAN_SLOT_LUNGS)) var/obj/item/organ/lungs/L = new() L.Insert(src) if(only_one) - return + return TRUE if(blooded && !getorganslot(ORGAN_SLOT_HEART)) var/obj/item/organ/heart/H = new() H.Insert(src) if(only_one) - return + return TRUE if(!getorganslot(ORGAN_SLOT_TONGUE)) var/obj/item/organ/tongue/T @@ -254,7 +254,7 @@ // if they have no mutant tongues, give them a regular one T.Insert(src) if(only_one) - return + return TRUE else if (!only_one) var/obj/item/organ/tongue/oT = getorganslot(ORGAN_SLOT_TONGUE) @@ -278,7 +278,7 @@ E = new() E.Insert(src) if(only_one) - return + return TRUE if(!getorganslot(ORGAN_SLOT_EARS)) var/obj/item/organ/ears/ears @@ -289,7 +289,7 @@ ears.Insert(src) if(only_one) - return + return TRUE if(!getorganslot(ORGAN_SLOT_TAIL)) var/obj/item/organ/tail/tail @@ -297,4 +297,4 @@ tail = new dna.species.mutanttail tail.Insert(src) if(only_one) - return + return TRUE diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index a0af4175e4..9c24720a5a 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -98,11 +98,10 @@ /datum/reagent/synthtissue name = "Synthtissue" id = "synthtissue" - description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage." + description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage. Has a very tight growth window between 305-320, any higher and the temperature will cause the cells to die. Additionally, growth time is considerably long, so chemists are encouraged to leave beakers with said reaction ongoing, while they tend to their other duties." pH = 7.6 metabolization_rate = 0.1 - var/grown_volume = 0 - var/injected_vol = 0 + data = list("grown_volume" = 0, "injected_vol" = 0) /datum/reagent/synthtissue/reaction_mob(mob/living/M, method=TOUCH, reac_volume,show_message = 1) if(iscarbon(M)) @@ -115,23 +114,38 @@ if(show_message) to_chat(M, "You feel your [target] heal! It stings like hell!") SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) - if(method == INJECT) - injected_vol += reac_volume + if(method==INJECT) + data.["injected_vol"] += reac_volume + message_admins("inject! [data.["injected_vol"]], [reac_volume]") ..() /datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C) if(!iscarbon(C)) return ..() - if(injected_vol >= 20) - if(grown_volume > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) - if(volume >= 20) - C.regenerate_organs(only_one = TRUE) - C.reagents.remove_reagent(id, 20) + if(data.["injected_vol"] > 14) + if(data.["grown_volume"] > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) + if(volume >= 14) + if(C.regenerate_organs(only_one = TRUE)) + C.reagents.remove_reagent(id, 15) + to_chat(C, "You feel something reform inside of you!") + + data.["injected_vol"] -= metabolization_rate ..() -/datum/reagent/synthtissue/on_merge(data) - if(data > grown_volume) - grown_volume = data +/datum/reagent/synthtissue/on_merge(passed_data) + if(passed_data.["grown_volume"] > data.["grown_volume"]) + data.["grown_volume"] = passed_data.["grown_volume"] + if(!data) + data = passed_data ..() +/datum/reagent/synthtissue/on_new(passed_data) + if(passed_data.["grown_volume"] > data.["grown_volume"]) + data.["grown_volume"] = passed_data.["grown_volume"] + if(!data) + data = passed_data + ..() + +/datum/reagent/synthtissue/ + //NEEDS ON_MOB_DEAD() From f8dfb1e3aaf4541e804448455d7e58b9f75ae2e1 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 12:45:10 +0100 Subject: [PATCH 17/47] Okay. --- .../reagents/chemistry/recipes/medicine.dm | 3 +- code/modules/surgery/graft_synthtissue.dm | 38 ++++++++++++------- .../reagents/chemistry/reagents/healing.dm | 25 ++++++------ 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index f1eda93505..11dd8b7475 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -102,8 +102,7 @@ St.volume *= St.purity St.purity = 1 N.volume -= 0.002 - St.data.["grown_volume"] += added_volume - St.data = St.data.["grown_volume"] + St.data["grown_volume"] = St.data["grown_volume"] + added_volume /datum/chemical_reaction/styptic_powder name = "Styptic Powder" diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index 0d396e5fdf..8e61f49f49 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -21,9 +21,10 @@ name = "graft synthtissue" implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) repeatable = TRUE - time = 50 + time = 75 chems_needed = list("synthtissue") var/obj/item/organ/chosen_organ + var/health_restored = 10 /datum/surgery_step/graft_synthtissue/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) if(implement_type in implements) @@ -38,23 +39,32 @@ organs[O.name] = O chosen_organ = input("Target which organ?", "Surgery", null, null) as null|anything in organs chosen_organ = organs[chosen_organ] - if(chosen_organ.organ_flags & ORGAN_FAILING) - to_chat(user, "[target]'s [chosen_organ] is too damaged to graft onto!") + if(!chosen_organ) + return -1 + if(!target.reagents.has_reagent("synthtissue")) + to_chat(user, "There's no synthtissue available for use on [chosen_organ]") + return -1 + var/datum/reagent/synthtissue/Sf = locate(/datum/reagent/synthtissue) in target.reagents.reagent_list + if(Sf.volume < 10) + to_chat(user, "There's not enough synthtissue to perform the operation! There needs to be at least 10u.") return -1 - user.visible_message("[user] begins to repair damaged portions of [target]'s [chosen_organ].
") + if((chosen_organ.organ_flags & ORGAN_FAILING) && !(Sf.data["grown_volume"] >= 115)) + to_chat(user, "[chosen_organ] is too damaged to graft onto!") + return -1 + + + user.visible_message("[user] begins to graft synthtissue onto [chosen_organ].") + target.reagents.remove_reagent("synthtissue", 10) + if(health_restored != 10) + health_restored = 10 + health_restored += (Sf.data["grown_volume"]/10) /datum/surgery_step/graft_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING)) - to_chat(user, "[target] has no [chosen_organ] capable of repair!") - else - user.visible_message("[user] successfully repairs part of [target]'s [chosen_organ].", "You succeed in repairing parts of [target]'s [chosen_organ].") - chosen_organ.applyOrganDamage(-10) + user.visible_message("[user] successfully repairs part of [chosen_organ].", "You succeed in repairing parts of [chosen_organ].") + chosen_organ.applyOrganDamage(health_restored) /datum/surgery_step/graft_synthtissue/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if((!chosen_organ)||(chosen_organ.organ_flags & ORGAN_FAILING)) - to_chat(user, "[target] has no [chosen_organ] capable of repair!") - else - user.visible_message("[user] accidentally damages part of [target]'s [chosen_organ]!", "You damage [target]'s [chosen_organ]! Apply more synthtissue if it's run out.") - chosen_organ.applyOrganDamage(10) + user.visible_message("[user] accidentally damages part of [chosen_organ]!", "You damage [chosen_organ]! Apply more synthtissue if it's run out.") + chosen_organ.applyOrganDamage(10) return FALSE diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 9c24720a5a..9daddb3104 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -115,35 +115,34 @@ to_chat(M, "You feel your [target] heal! It stings like hell!") SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "painful_medicine", /datum/mood_event/painful_medicine) if(method==INJECT) - data.["injected_vol"] += reac_volume - message_admins("inject! [data.["injected_vol"]], [reac_volume]") + data["injected_vol"] = data["injected_vol"] + reac_volume ..() /datum/reagent/synthtissue/on_mob_life(mob/living/carbon/C) if(!iscarbon(C)) return ..() - if(data.["injected_vol"] > 14) - if(data.["grown_volume"] > 150) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) + if(data["injected_vol"] > 14) + if(data["grown_volume"] > 175) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) if(volume >= 14) if(C.regenerate_organs(only_one = TRUE)) C.reagents.remove_reagent(id, 15) to_chat(C, "You feel something reform inside of you!") - data.["injected_vol"] -= metabolization_rate + data["injected_vol"] -= metabolization_rate ..() /datum/reagent/synthtissue/on_merge(passed_data) - if(passed_data.["grown_volume"] > data.["grown_volume"]) - data.["grown_volume"] = passed_data.["grown_volume"] - if(!data) - data = passed_data + if(!passed_data) + return ..() + if(passed_data["grown_volume"] > data["grown_volume"]) + data["grown_volume"] = passed_data["grown_volume"] ..() /datum/reagent/synthtissue/on_new(passed_data) - if(passed_data.["grown_volume"] > data.["grown_volume"]) - data.["grown_volume"] = passed_data.["grown_volume"] - if(!data) - data = passed_data + if(!passed_data) + return ..() + if(passed_data["grown_volume"] > data["grown_volume"]) + data["grown_volume"] = passed_data["grown_volume"] ..() /datum/reagent/synthtissue/ From 167ffde648b1d3d32f6ff83f7301b60c28c95933 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 21 Sep 2019 14:07:23 +0100 Subject: [PATCH 18/47] OOPS --- code/modules/surgery/graft_synthtissue.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index 8e61f49f49..8826de7171 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -53,12 +53,12 @@ to_chat(user, "[chosen_organ] is too damaged to graft onto!") return -1 + if(health_restored != 10) + health_restored = 10 + health_restored += (Sf.data["grown_volume"]/10) user.visible_message("[user] begins to graft synthtissue onto [chosen_organ].") target.reagents.remove_reagent("synthtissue", 10) - if(health_restored != 10) - health_restored = 10 - health_restored += (Sf.data["grown_volume"]/10) /datum/surgery_step/graft_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) user.visible_message("[user] successfully repairs part of [chosen_organ].", "You succeed in repairing parts of [chosen_organ].") From 1bdb66d5def9814fe0afafcd931942aeee4e7429 Mon Sep 17 00:00:00 2001 From: Thalpy <48600475+ThalpySci@users.noreply.github.com> Date: Fri, 27 Sep 2019 07:28:02 +0100 Subject: [PATCH 19/47] Okay a few things I just saw --- code/modules/mob/living/brain/brain_item.dm | 9 +++++---- .../code/modules/reagents/chemistry/reagents/healing.dm | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 1d032109db..52bef062fb 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -105,9 +105,10 @@ . = TRUE //don't do attack animation. var/cached_Bdamage = brainmob?.health var/datum/reagent/medicine/neurine/N = reagents.has_reagent("neurine") + var/datum/reagent/medicine/mannitol/M1 = reagents.has_reagent("mannitol") if(O.reagents.has_reagent("mannitol"))//Just a quick way to bolster the effects if someone mixes up a batch. - N.volume *= 1.5 + N.volume *= (M1.volume*0.5) if(!O.reagents.has_reagent("neurine", 10)) to_chat(user, "There's not enough neurine in [O] to restore [src]!") @@ -119,10 +120,10 @@ return user.visible_message("[user] pours the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.", "You pour the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.") - setOrganDamage((damage - (0.10 * maxHealth)*N.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up + setOrganDamage((damage - (0.10 * maxHealth)*(N.volume/10))) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up O.reagents.clear_reagents() - if(cached_Bdamage) //Fixing dead brains yeilds a trauma + if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD) //Fixing dead brains yeilds a trauma if((cached_Bdamage <= HEALTH_THRESHOLD_DEAD) && (brainmob.health > HEALTH_THRESHOLD_DEAD)) if(prob(90)) gain_trauma_type(BRAIN_TRAUMA_MILD) @@ -149,7 +150,7 @@ return user.visible_message("[user] pours the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.", "You pour the contents of [O] onto [src], causing it to reform its original shape and turn a slightly brighter shade of pink.") - setOrganDamage((damage - (0.05 * maxHealth)*M.volume)) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up + setOrganDamage((damage - (0.05 * maxHealth)*(M.volume/10))) //heals a small amount, and by using "setorgandamage", we clear the failing variable if that was up O.reagents.clear_reagents() return diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 9daddb3104..c5f8950715 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -145,6 +145,4 @@ data["grown_volume"] = passed_data["grown_volume"] ..() -/datum/reagent/synthtissue/ - //NEEDS ON_MOB_DEAD() From 888906b4e7ca3493e0d23f2336beddb567ce5183 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 11:12:53 +0100 Subject: [PATCH 20/47] Fixes Mk1 ! --- code/__DEFINES/obj_flags.dm | 3 +- code/modules/surgery/organs/organ_internal.dm | 2 +- code/modules/surgery/organs/stomach.dm | 37 ++++++++++--------- code/modules/surgery/organs/tongue.dm | 17 +++++---- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 22bced0b39..bde48c32ee 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -39,10 +39,11 @@ #define VOICEBOX_TOGGLABLE (1<<6) // The voicebox in this clothing can be toggled. #define VOICEBOX_DISABLED (1<<7) // The voicebox is currently turned off. -/// Flags for the organ_flags var on /obj/item/organ +// Flags for the organ_flags var on /obj/item/organ #define ORGAN_SYNTHETIC (1<<0) //Synthetic organs, or cybernetic organs. Reacts to EMPs and don't deteriorate or heal #define ORGAN_FROZEN (1<<1) //Frozen organs, don't deteriorate #define ORGAN_FAILING (1<<2) //Failing organs perform damaging effects until replaced or fixed #define ORGAN_EXTERNAL (1<<3) //Was this organ implanted/inserted/etc, if true will not be removed during species change. #define ORGAN_VITAL (1<<4) //Currently only the brain +#define ORGAN_NO_SPOIL (1<<5) //Currently only the brain diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 4da064b895..b5c3ed9f2f 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -72,7 +72,7 @@ on_death() //Kinda hate doing it like this, but I really don't want to call process directly. /obj/item/organ/proc/on_death() //runs decay when outside of a person - if(organ_flags & (ORGAN_SYNTHETIC | ORGAN_FROZEN)) + if(organ_flags & (ORGAN_SYNTHETIC | ORGAN_FROZEN | ORGAN_NO_SPOIL)) return applyOrganDamage(maxHealth * decay_factor) diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index f9b4f180e3..8ddaa951d8 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -17,31 +17,32 @@ low_threshold_cleared = "The last bouts of pain in your stomach have died out." /obj/item/organ/stomach/on_life() - var/mob/living/carbon/human/H = owner - var/datum/reagent/consumable/nutriment/Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list - - - if(istype(H)) + var/datum/reagent/consumable/nutriment/Nutri + if(ishuman(owner)) + var/mob/living/carbon/human/H = owner if(!(organ_flags & ORGAN_FAILING)) H.dna.species.handle_digestion(H) handle_disgust(H) + Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list + + if(Nutri) + if(prob((damage/40) * Nutri.volume * Nutri.volume)) + H.vomit(damage) + to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") + + else if(Nutri && damage > high_threshold) + if(prob((damage/10) * Nutri.volume * Nutri.volume)) + H.vomit(damage) + to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") + + + else if(iscarbon(owner)) + var/mob/living/carbon/C = owner + Nutri = locate(/datum/reagent/consumable/nutriment) in C.reagents.reagent_list if(damage < low_threshold) return - Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list - - if(Nutri) - if(prob((damage/40) * Nutri.volume * Nutri.volume)) - H.vomit(damage) - to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") - - else if(Nutri && damage > high_threshold) - if(prob((damage/10) * Nutri.volume * Nutri.volume)) - H.vomit(damage) - to_chat(H, "Your stomach reels in pain as you're incapable of holding down all that food!") - - /obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H) if(H.disgust) diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 34fcc86a10..15bce1c2ea 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -31,13 +31,6 @@ /obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args) /obj/item/organ/tongue/applyOrganDamage(var/d, var/maximum = maxHealth) - if (maxHealth == "bone") - if(owner) - return - var/target = owner.get_bodypart(BODY_ZONE_HEAD) - owner.apply_damage(d, BURN, target) - to_chat(owner, "You feel your skull burning! Oof, your bones!") - return if(!d) //Micro-optimization. return @@ -196,7 +189,7 @@ say_mod = "rattles" attack_verb = list("bitten", "chattered", "chomped", "enamelled", "boned") taste_sensitivity = 101 // skeletons cannot taste anything - maxHealth = "bone" //Take brute damage instead + maxHealth = 75 //Take brute damage instead modifies_speech = TRUE var/chattering = FALSE var/phomeme_type = "sans" @@ -206,6 +199,14 @@ . = ..() phomeme_type = pick(phomeme_types) +/obj/item/organ/tongue/bone/applyOrganDamage(var/d, var/maximum = maxHealth) + if(!owner) + return + var/target = owner.get_bodypart(BODY_ZONE_HEAD) + owner.apply_damage(d, BURN, target) + to_chat(owner, "You feel your skull burning! Oof, your bones!") + return + /obj/item/organ/tongue/bone/handle_speech(datum/source, list/speech_args) if (chattering) chatter(speech_args[SPEECH_MESSAGE], phomeme_type, source) From e11197f97701911b8fc0c2dce2ba88fb8d015618 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 11:23:06 +0100 Subject: [PATCH 21/47] Truth --- code/modules/surgery/organs/tongue.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 15bce1c2ea..ae9b2231ae 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -187,6 +187,7 @@ desc = "Apparently skeletons alter the sounds they produce through oscillation of their teeth, hence their characteristic rattling." icon_state = "tonguebone" say_mod = "rattles" + organ_flags = ORGAN_NO_SPOIL attack_verb = list("bitten", "chattered", "chomped", "enamelled", "boned") taste_sensitivity = 101 // skeletons cannot taste anything maxHealth = 75 //Take brute damage instead @@ -268,6 +269,7 @@ icon_state = "tonguecybernetic" taste_sensitivity = 10 maxHealth = 60 //It's robotic! + organ_flags = ORGAN_SYNTHETIC /obj/item/organ/tongue/cybernetic/handle_speech(datum/source, list/speech_args) speech_args[SPEECH_SPANS] |= SPAN_ROBOT @@ -277,3 +279,4 @@ say_mod = "beeps" desc = "A voice synthesizer used by IPCs to smoothly interface with organic lifeforms." electronics_magic = FALSE + organ_flags = ORGAN_SYNTHETIC From a6a14499519d0c2cfb298f39bdef241156965090 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 11:44:15 +0100 Subject: [PATCH 22/47] This was supposed to be the atomised branch aaargh!! --- code/modules/surgery/organs/tongue.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index ae9b2231ae..3dd5c7b2b7 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -30,6 +30,14 @@ /obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args) +/obj/item/organ/tongue/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_SELF) + return + if(organ_flags & ORGAN_SYNTHETIC) + var/errormessage = list("Runtime in tongue.dm, line 39: Undefined operation \"zapzap ow my tongue\"", "afhsjifksahgjkaslfhashfjsak", "-1.#IND", "Graham's number", "inside you all along", "awaiting at least 1 approving review before merging this taste request") + owner.say("The pH is appropriately [pick(errormessage)].") + /obj/item/organ/tongue/applyOrganDamage(var/d, var/maximum = maxHealth) if(!d) //Micro-optimization. From 50ef6aa2575627a39be1eb68d2d5b98acc628039 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 13:28:23 +0100 Subject: [PATCH 23/47] Eye fix --- code/modules/surgery/organs/eyes.dm | 11 ++++++++++- code/modules/surgery/organs/organ_internal.dm | 16 ++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 3b7fdf0355..f1ccb47a6b 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -32,6 +32,8 @@ /obj/item/organ/eyes/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = FALSE) ..() + if(damage == initial(damage)) + clear_eye_trauma() if(ishuman(owner)) var/mob/living/carbon/human/HMN = owner old_eye_color = HMN.eye_color @@ -46,7 +48,9 @@ M.update_tint() owner.update_sight() + /obj/item/organ/eyes/Remove(mob/living/carbon/M, special = 0) + clear_eye_trauma() ..() if(ishuman(M) && eye_color) var/mob/living/carbon/human/HMN = M @@ -65,7 +69,7 @@ //various degrees of "oh fuck my eyes", from "point a laser at your eye" to "staring at the Sun" intensities if(damage > 20) damaged = TRUE - if((organ_flags & ORGAN_FAILING)) + if(organ_flags & ORGAN_FAILING) C.become_blind(EYE_DAMAGE) else if(damage > 30) C.overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2) @@ -77,6 +81,11 @@ C.clear_fullscreen("eye_damage") return +/obj/item/organ/eyes/proc/clear_eye_trauma() + var/mob/living/carbon/C = owner + C.clear_fullscreen("eye_damage") + C.cure_blind(EYE_DAMAGE) + damaged = FALSE /obj/item/organ/eyes/night_vision name = "shadow eyes" diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index b5c3ed9f2f..a17d4906bf 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -77,17 +77,17 @@ applyOrganDamage(maxHealth * decay_factor) /obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing - if(organ_flags & ORGAN_FAILING) - return - ///Damage decrements by a percent of its maxhealth - var/healing_amount = -(maxHealth * healing_factor) - ///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health - healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0 - applyOrganDamage(healing_amount) //to FERMI_TWEAK + if(!(organ_flags & ORGAN_FAILING)) + ///Damage decrements by a percent of its maxhealth + var/healing_amount = -(maxHealth * healing_factor) + ///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health + healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0 + applyOrganDamage(healing_amount) //to FERMI_TWEAK + //Make it so each threshold is stuck. /obj/item/organ/examine(mob/user) . = ..() - if(organ_flags & ORGAN_FAILING) + if(!organ_flags & ORGAN_FAILING) if(status == ORGAN_ROBOTIC) . += "[src] seems to be broken!" return From b16e6972013ef219948ac5416f7d8642da99eb7d Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 13:34:27 +0100 Subject: [PATCH 24/47] eye tweaks. --- code/modules/surgery/organs/eyes.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index f1ccb47a6b..3b5e4cfe82 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -10,7 +10,7 @@ decay_factor = STANDARD_ORGAN_DECAY maxHealth = 0.5 * STANDARD_ORGAN_THRESHOLD //half the normal health max since we go blind at 30, a permanent blindness at 50 therefore makes sense unless medicine is administered high_threshold = 0.3 * STANDARD_ORGAN_THRESHOLD //threshold at 30 - low_threshold = 0.2 * STANDARD_ORGAN_THRESHOLD //threshold at 20 + low_threshold = 0.15 * STANDARD_ORGAN_THRESHOLD //threshold at 15 low_threshold_passed = "Distant objects become somewhat less tangible." high_threshold_passed = "Everything starts to look a lot less clear." @@ -140,11 +140,11 @@ . = ..() if(!owner || . & EMP_PROTECT_SELF) return - if(prob(10 * severity)) - return to_chat(owner, "Static obfuscates your vision!") owner.flash_act(visual = 1) - owner.adjustOrganLoss(ORGAN_SLOT_EYES, 25) + if(severity == EMP_HEAVY) + owner.adjustOrganLoss(ORGAN_SLOT_EYES, 20) + /obj/item/organ/eyes/robotic/xray name = "\improper X-ray eyes" From b622ea4fd2254ecf0a982937ee2ac120533a939a Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 13:49:25 +0100 Subject: [PATCH 25/47] Fixes --- code/modules/mob/living/carbon/life.dm | 6 ++++-- code/modules/surgery/organs/eyes.dm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 5c94448055..cdcfeedc80 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -386,11 +386,13 @@ if(stat != DEAD) for(var/V in internal_organs) var/obj/item/organ/O = V - O.on_life() + if(O) + O.on_life() else for(var/V in internal_organs) var/obj/item/organ/O = V - O.on_death() //Needed so organs decay while inside the body. + if(O) + O.on_death() //Needed so organs decay while inside the body. /mob/living/carbon/handle_diseases() for(var/thing in diseases) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 3b5e4cfe82..cb890082cd 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -185,7 +185,7 @@ M.become_blind("flashlight_eyes") -/obj/item/organ/eyes/robotic/flashlight/Remove(var/mob/living/carbon/M, var/special = 0) +/obj/item/organ/eyes/robotic/flashlight/Remove(var/mob/living/carbon/M, special = FALSE) eye.on = FALSE eye.update_brightness(M) eye.forceMove(src) From d44fbd3fb19ba704a1e84612ee673d3b3f98412d Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 27 Sep 2019 23:46:44 +0100 Subject: [PATCH 26/47] Brain fix --- code/_globalvars/bitfields.dm | 10 ++++++++- code/modules/mob/living/brain/MMI.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 25 +++++++++++++-------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 3b32745b5c..3c8b60eb9b 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -177,4 +177,12 @@ GLOBAL_LIST_INIT(bitfields, list( "CAN_CARRY" = CAN_CARRY, "CAN_RESIST" = CAN_RESIST ), - )) \ No newline at end of file + "organ_flags" = list( + "ORGAN_SYNTHETIC" = ORGAN_SYNTHETIC, + "ORGAN_FROZEN" = ORGAN_FROZEN, + "ORGAN_FAILING" = ORGAN_FAILING, + "ORGAN_EXTERNAL" = ORGAN_EXTERNAL, + "ORGAN_VITAL" = ORGAN_VITAL, + "ORGAN_NO_SPOIL" = ORGAN_NO_SPOIL + ), + )) diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index e3d83ef5a6..d84ba0d7a1 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -57,7 +57,7 @@ newbrain.brainmob = null brainmob.forceMove(src) brainmob.container = src - if(!newbrain.organ_flags & ORGAN_FAILING) // the brain organ hasn't been beaten to death. + if(!(newbrain.organ_flags & ORGAN_FAILING)) // the brain organ hasn't been beaten to death. brainmob.stat = CONSCIOUS //we manually revive the brain mob GLOB.dead_mob_list -= brainmob GLOB.alive_mob_list += brainmob diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 52bef062fb..d635a4adb9 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -125,7 +125,7 @@ if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD) //Fixing dead brains yeilds a trauma if((cached_Bdamage <= HEALTH_THRESHOLD_DEAD) && (brainmob.health > HEALTH_THRESHOLD_DEAD)) - if(prob(90)) + if(prob(80)) gain_trauma_type(BRAIN_TRAUMA_MILD) else if(prob(50)) gain_trauma_type(BRAIN_TRAUMA_SEVERE) @@ -252,11 +252,15 @@ if(damage <= BRAIN_DAMAGE_DEATH) //rip brain_death = FALSE -/obj/item/organ/brain/process() //needs to run in life AND death + +/obj/item/organ/brain/applyOrganDamage(var/d, var/maximum = maxHealth) ..() + + +/obj/item/organ/brain/check_damage_thresholds(mob/M) + . = ..() //if we're not more injured than before, return without gambling for a trauma if(damage <= prev_damage) - prev_damage = damage return damage_delta = damage - prev_damage if(damage > BRAIN_DAMAGE_MILD) @@ -271,15 +275,18 @@ if (owner) if(owner.stat < UNCONSCIOUS) //conscious or soft-crit + var/brain_message if(prev_damage < BRAIN_DAMAGE_MILD && damage >= BRAIN_DAMAGE_MILD) - to_chat(owner, "You feel lightheaded.") + brain_message = "You feel lightheaded." else if(prev_damage < BRAIN_DAMAGE_SEVERE && damage >= BRAIN_DAMAGE_SEVERE) - to_chat(owner, "You feel less in control of your thoughts.") + brain_message = "You feel less in control of your thoughts." else if(prev_damage < (BRAIN_DAMAGE_DEATH - 20) && damage >= (BRAIN_DAMAGE_DEATH - 20)) - to_chat(owner, "You can feel your mind flickering on and off...") - //update our previous damage holder after we've checked our boundaries - prev_damage = damage - return + brain_message = "You can feel your mind flickering on and off..." + + if(.) + . += "\n[brain_message]" + else + return brain_message /obj/item/organ/brain/Destroy() //copypasted from MMIs. if(brainmob) From 391af0f946bb7a1599489426bd8cfd86ca8f71eb Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 28 Sep 2019 07:26:59 +0100 Subject: [PATCH 27/47] I have no idea why the brain doesn't decay, but this seems to fix it. --- code/modules/mob/living/brain/brain_item.dm | 3 ++- code/modules/surgery/organs/heart.dm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index d635a4adb9..a60ec41961 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -10,7 +10,7 @@ organ_flags = ORGAN_VITAL attack_verb = list("attacked", "slapped", "whacked") ///The brain's organ variables are significantly more different than the other organs, with half the decay rate for balance reasons, and twice the maxHealth - decay_factor = STANDARD_ORGAN_DECAY / 2 //30 minutes of decaying to result in a fully damaged brain, since a fast decay rate would be unfun gameplay-wise + decay_factor = STANDARD_ORGAN_DECAY / 4 //30 minutes of decaying to result in a fully damaged brain, since a fast decay rate would be unfun gameplay-wise maxHealth = BRAIN_DAMAGE_DEATH low_threshold = 45 @@ -251,6 +251,7 @@ /obj/item/organ/brain/on_death() if(damage <= BRAIN_DAMAGE_DEATH) //rip brain_death = FALSE + applyOrganDamage(maxHealth * decay_factor) /obj/item/organ/brain/applyOrganDamage(var/d, var/maximum = maxHealth) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 3a64955f84..5fea801ba0 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -6,7 +6,7 @@ slot = ORGAN_SLOT_HEART healing_factor = STANDARD_ORGAN_HEALING - decay_factor = 5 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death + decay_factor = 4 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death low_threshold_passed = "Prickles of pain appear then die out from within your chest..." high_threshold_passed = "Something inside your chest hurts, and the pain isn't subsiding. You notice yourself breathing far faster than before." From f83de631242a1f4637bb33373e7a090774382112 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 28 Sep 2019 17:51:55 +0100 Subject: [PATCH 28/47] Kev's scanner malarky --- code/game/objects/items/devices/scanners.dm | 14 +++++++++++--- .../chemistry/reagents/toxin_reagents.dm | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 8ceb8abc16..76f7e4f2e7 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -190,6 +190,14 @@ SLIME SCANNER if(Br.cached_size>5) msg += "\tSubject has a sizeable bosom with a [Br.size] cup.\n" + if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 200 || !M.getorgan(/obj/item/organ/brain)) + msg += "\tSubject's brain function is non-existent.\n" + else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 120) + msg += "\tSevere brain damage detected. Subject likely to have mental traumas.\n" + else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 45) + msg += "\tBrain damage detected.\n" + + if(iscarbon(M)) var/mob/living/carbon/C = M if(LAZYLEN(C.get_traumas())) var/list/trauma_text = list() @@ -342,9 +350,9 @@ SLIME SCANNER minor_damage = "\tMildly Damaged Organs: " else minor_damage += "" - to_chat(user, minor_damage) - to_chat(user, major_damage) - to_chat(user, max_damage) + msg += "[minor_damage]" + msg += "[major_damage]" + msg += "[max_damage]" // Species and body temperature diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 56cd52e9b6..600b6a64ca 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -969,3 +969,19 @@ to_chat(M, "Your missing arm aches from wherever you left it.") M.emote("sigh") return ..() + +/datum/reagent/toxin/brainhurtingjuice //oof ouch + name = "Brain Hurting Juice" + id = "brainhurtingjuice" + color = "#AAAAAA77" //RGBA: 170, 170, 170, 77 + toxpwr = 0 + taste_description = "brain hurting" + metabolization_rate = 5 + +/datum/reagent/toxin/brainhurtingjuice/on_mob_life(mob/living/carbon/M) + if(prob(50)) + M.gain_trauma_type(BRAIN_TRAUMA_MILD) + else if(prob(50)) + M.gain_trauma_type(BRAIN_TRAUMA_SEVERE) + else + M.gain_trauma_type(BRAIN_TRAUMA_SPECIAL) From 0762ed526558cf8921474a917d166f230409211e Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sun, 29 Sep 2019 20:25:00 +0100 Subject: [PATCH 29/47] oops, but also this shouldn't be able to be made. --- code/modules/reagents/chemistry/reagents/toxin_reagents.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 600b6a64ca..89ac5466c9 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -985,3 +985,4 @@ M.gain_trauma_type(BRAIN_TRAUMA_SEVERE) else M.gain_trauma_type(BRAIN_TRAUMA_SPECIAL) + ..() From 2f0e5d809175ede01734b9c9f6b4729b97a5e707 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sun, 29 Sep 2019 21:27:42 +0100 Subject: [PATCH 30/47] Hotfix --- code/game/machinery/cloning.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 66151031a2..8e49c0a126 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -447,7 +447,7 @@ unattached_flesh.Cut() H.setCloneLoss(CLONE_INITIAL_DAMAGE) //Yeah, clones start with very low health, not with random, because why would they start with random health - H.setOrganLoss(ORGAN_SLOT_BRAIN, CLONE_INITIAL_DAMAGE) + //H.setOrganLoss(ORGAN_SLOT_BRAIN, CLONE_INITIAL_DAMAGE) // In addition to being cellularly damaged and having barely any // brain function, they also have no limbs or internal organs. From 553818504ce5ba247b6342004045b5f30facb589 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Tue, 1 Oct 2019 06:21:34 +0100 Subject: [PATCH 31/47] Hoepfully fixes unwanted traumas in the dead. --- code/modules/mob/living/brain/brain_item.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index a60ec41961..601dd2dc2f 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -323,7 +323,9 @@ return FALSE if(!resilience) resilience = initial(trauma.resilience) - + if(owner.stat == DEAD) + return FALSE + var/resilience_tier_count = 0 for(var/X in traumas) if(istype(X, trauma)) From 2bbcc7f66096ff9858dfd150d7402d0e182886e5 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Tue, 1 Oct 2019 06:48:15 +0100 Subject: [PATCH 32/47] Fixes them sneaky nades --- code/modules/reagents/chemistry/reagents/other_reagents.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 2f7a8652ba..8b4d9bd8d8 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1222,7 +1222,7 @@ description = "A perfluoronated sulfonic acid that forms a foam when mixed with water." color = "#9E6B38" // rgb: 158, 107, 56 taste_description = "metal" - pH = 13 + pH = 11 /datum/reagent/foaming_agent// Metal foaming agent. This is lithium hydride. Add other recipes (e.g. LiH + H2O -> LiOH + H2) eventually. name = "Foaming agent" @@ -1231,7 +1231,7 @@ reagent_state = SOLID color = "#664B63" // rgb: 102, 75, 99 taste_description = "metal" - pH = 12.5 + pH = 11.5 /datum/reagent/smart_foaming_agent //Smart foaming agent. Functions similarly to metal foam, but conforms to walls. name = "Smart foaming agent" From 986ac16b931b92a9a669713547ccbf607026506c Mon Sep 17 00:00:00 2001 From: Chayse Ramsay Date: Tue, 1 Oct 2019 22:21:32 +0100 Subject: [PATCH 33/47] Adds unrestricted directional access to the medbay lobby and cloning access airlocks on all maps --- _maps/map_files/BoxStation/BoxStation.dmm | 3 +++ _maps/map_files/Deltastation/DeltaStation2.dmm | 6 ++++++ _maps/map_files/MetaStation/MetaStation.dmm | 5 +++++ _maps/map_files/OmegaStation/OmegaStation.dmm | 9 +++++++++ _maps/map_files/PubbyStation/PubbyStation.dmm | 7 +++++++ 5 files changed, 30 insertions(+) diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 9cd932c6d4..b018f36856 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -28105,6 +28105,7 @@ /obj/effect/turf_decal/tile/blue{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/medbay/central) "bof" = ( @@ -28128,6 +28129,7 @@ /obj/effect/turf_decal/tile/blue{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/medbay/central) "boi" = ( @@ -30036,6 +30038,7 @@ name = "Genetics"; req_access_txt = "5; 68" }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/genetics) "bsv" = ( diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 554904ada0..f3f713fd5e 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -88714,6 +88714,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 4 + }, /turf/open/floor/plasteel, /area/medical/medbay/central) "cSK" = ( @@ -89888,6 +89891,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 4 + }, /turf/open/floor/plasteel, /area/medical/medbay/central) "cUD" = ( diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 13f774d25d..542d191116 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -57384,6 +57384,7 @@ /obj/effect/turf_decal/tile/blue{ dir = 8 }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/medbay/central) "cha" = ( @@ -57404,6 +57405,7 @@ /obj/effect/turf_decal/tile/blue{ dir = 8 }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/medbay/central) "chb" = ( @@ -66401,6 +66403,9 @@ /obj/effect/turf_decal/tile/blue{ dir = 8 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 4 + }, /turf/open/floor/plasteel/white, /area/medical/genetics/cloning) "cxZ" = ( diff --git a/_maps/map_files/OmegaStation/OmegaStation.dmm b/_maps/map_files/OmegaStation/OmegaStation.dmm index 0c55f05fcb..5202f170d0 100644 --- a/_maps/map_files/OmegaStation/OmegaStation.dmm +++ b/_maps/map_files/OmegaStation/OmegaStation.dmm @@ -27287,6 +27287,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 1 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 1 + }, /turf/open/floor/plasteel, /area/medical/medbay/zone3) "aWM" = ( @@ -28598,6 +28601,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 8 + }, /turf/open/floor/plasteel, /area/medical/medbay/zone3) "aYU" = ( @@ -29134,6 +29140,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 8 + }, /turf/open/floor/plasteel, /area/medical/medbay/zone3) "aZQ" = ( diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index 7e4f54c8b4..53a184ba85 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -27566,6 +27566,7 @@ }, /obj/structure/disposalpipe/segment, /obj/machinery/atmospherics/pipe/simple/supply/hidden, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/freezer, /area/storage/emergency/port) "bnx" = ( @@ -29314,6 +29315,9 @@ /obj/structure/disposalpipe/segment{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/unres{ + dir = 8 + }, /turf/open/floor/plasteel/white, /area/medical/genetics) "brb" = ( @@ -30153,6 +30157,7 @@ /obj/effect/turf_decal/tile/blue{ dir = 8 }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/medbay/central) "bsI" = ( @@ -30164,6 +30169,7 @@ name = "Medbay" }, /obj/effect/turf_decal/tile/blue, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/white, /area/medical/medbay/central) "bsJ" = ( @@ -62094,6 +62100,7 @@ name = "Port Emergency Storage"; req_access_txt = "0" }, +/obj/effect/mapping_helpers/airlock/unres, /turf/open/floor/plasteel/freezer, /area/storage/emergency/port) "xSX" = ( From 5c827ed8ed6e76a1c728f021e0fbe36e04b6a0ef Mon Sep 17 00:00:00 2001 From: Chayse Ramsay Date: Wed, 2 Oct 2019 04:08:25 +0100 Subject: [PATCH 34/47] Fixes the Trek uniform/suit sprites Not having mutant additions was causing the update_icons code to null out the alternate_worn_icon variable --- .../mob/living/carbon/human/update_icons.dm | 46 +++++++++--------- .../icons/mob/clothing/fed hats n modern.dmi | Bin 2892 -> 0 bytes .../icons/mob/clothing/fedcoats.dmi | Bin 2061 -> 0 bytes .../icons/obj/clothing/trek_item_icon.dmi | Bin 5525 -> 3398 bytes 4 files changed, 24 insertions(+), 22 deletions(-) delete mode 100644 modular_citadel/icons/mob/clothing/fed hats n modern.dmi delete mode 100644 modular_citadel/icons/mob/clothing/fedcoats.dmi diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 72ff7e7a60..6b4703d7df 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -123,15 +123,16 @@ There are several things that need to be remembered: if(U.adjusted == ALT_STYLE) t_color = "[t_color]_d" - if(U.mutantrace_variation) - if(U.suit_style == DIGITIGRADE_SUIT_STYLE) - U.alternate_worn_icon = 'modular_citadel/icons/mob/uniform_digi.dmi' - if(U.adjusted == ALT_STYLE) - t_color = "[t_color]_d_l" - else if(U.adjusted == NORMAL_STYLE) - t_color = "[t_color]_l" - else - U.alternate_worn_icon = null + if(!U.alternate_worn_icon) + if(U.mutantrace_variation) + if(U.suit_style == DIGITIGRADE_SUIT_STYLE) + U.alternate_worn_icon = 'modular_citadel/icons/mob/uniform_digi.dmi' + if(U.adjusted == ALT_STYLE) + t_color = "[t_color]_d_l" + else if(U.adjusted == NORMAL_STYLE) + t_color = "[t_color]_l" + else + U.alternate_worn_icon = null var/mutable_appearance/uniform_overlay @@ -388,22 +389,23 @@ There are several things that need to be remembered: client.screen += wear_suit update_observer_view(wear_suit,1) - if(!no_taur_thanks && S.mutantrace_variation) //Just make sure we've got this checked too - if(S.taurmode == NOT_TAURIC && S.adjusted == ALT_STYLE) //are we not a taur, but we have Digitigrade legs? Run this check first, then. - S.alternate_worn_icon = 'modular_citadel/icons/mob/suit_digi.dmi' - else - S.alternate_worn_icon = null - - if(S.tauric == TRUE) //Are we a suit with tauric mode possible? - if(S.taurmode == SNEK_TAURIC) - S.alternate_worn_icon = 'modular_citadel/icons/mob/taur_naga.dmi' - if(S.taurmode == PAW_TAURIC) - S.alternate_worn_icon = 'modular_citadel/icons/mob/taur_canine.dmi' - if(S.taurmode == NOT_TAURIC && S.adjusted == ALT_STYLE) + if(!S.alternate_worn_icon) + if(!no_taur_thanks && S.mutantrace_variation) //Just make sure we've got this checked too + if(S.taurmode == NOT_TAURIC && S.adjusted == ALT_STYLE) //are we not a taur, but we have Digitigrade legs? Run this check first, then. S.alternate_worn_icon = 'modular_citadel/icons/mob/suit_digi.dmi' - else if(S.taurmode == NOT_TAURIC && S.adjusted == NORMAL_STYLE) + else S.alternate_worn_icon = null + if(S.tauric == TRUE) //Are we a suit with tauric mode possible? + if(S.taurmode == SNEK_TAURIC) + S.alternate_worn_icon = 'modular_citadel/icons/mob/taur_naga.dmi' + if(S.taurmode == PAW_TAURIC) + S.alternate_worn_icon = 'modular_citadel/icons/mob/taur_canine.dmi' + if(S.taurmode == NOT_TAURIC && S.adjusted == ALT_STYLE) + S.alternate_worn_icon = 'modular_citadel/icons/mob/suit_digi.dmi' + else if(S.taurmode == NOT_TAURIC && S.adjusted == NORMAL_STYLE) + S.alternate_worn_icon = null + overlays_standing[SUIT_LAYER] = S.build_worn_icon(state = wear_suit.icon_state, default_layer = SUIT_LAYER, default_icon_file = ((wear_suit.alternate_worn_icon) ? S.alternate_worn_icon : 'icons/mob/suit.dmi')) var/mutable_appearance/suit_overlay = overlays_standing[SUIT_LAYER] if(OFFSET_SUIT in dna.species.offset_features) diff --git a/modular_citadel/icons/mob/clothing/fed hats n modern.dmi b/modular_citadel/icons/mob/clothing/fed hats n modern.dmi deleted file mode 100644 index ab8682b7859146ef47faa5e580bedf5d86a15323..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2892 zcmYk8c{J4f8^=Fm#=a9{-%|D^B8Hl=g~(2>b$+2DQA~C-V{5}j(jub~LWPv=T57~C z;aV~=C3l1{xk6(%=KGtv=lss^bI#}Uoagh$=RD7Oznt`ZXfU?y(PUUoC2Y7zk5Fy4=juH*_ZISCjHKm@?e%g55nT1Vf2!C=?{ zfCa$B0XrnWKRA^{xYOWvq2Mt9qocseH|{u=cr6#$pL7`=9aU6O4GKHclcT*>YYzPx zOO8=f&^WAVb^>a0rQX%=8Kka3KNq?Bsn0RV1YbFyfS`o*OzPBJ66bvrlg7rz3IO`x za0~{sva*tpkYH(P2?%|CoS;D;jYgA`lhf1FL!nTfo}LjA5kw*pf{ewHN){(WP1FS& zlhmc;)m_hC!RQFDlpAUq+jw30eV?3ag1Zb_G;I0(RD0Q>+Tt)nJ65y5aC zE}j50M?1rDx{|znakgQxAu-_>apBQX03?)D-aILiZYXwqd`U}=CXqoI%T1G!j^Tzc z-7;;s)#zOxEhTBg(z$fRIFar@;OyM|p)ShdkNQ>FoT4NZd5@?>0Dy1H(bmc*W<+5gU>I z#D)mg%Ou5Ng}M8IA3aQ~m=UT7p_U7YP3E8+{v zSkpm~^xp5k2=F^QYAe$dBNtkE80y#M6RdM2qwH5D)^JHF1Fuf4|0ozzQ2Qozy1<;0 zrg`n{Oai}zN&V(YUGco&+_#bo+YQg)8_EZ-t|FW<65>Jr=|k2Xm~{4&Ip+EC(+#wy z^AF%hrQ@5?1#XMe^8qjFL}Y~OdJy;H(i{bdy<_#Gydy=6T|!-B(Vx|$s%@TaFBUA0 zXil2-5SHCU@4qT&6VH90YojaG^V*`o;jrAEnq01J+}K8VtI@kj|C(Df21RX6Pa>=m z&T9NPApVh`OemQ0xv^InrL{LY@4(tv>iO{G`b5jjRNQ<^`UxwDOq2F1>QCm^+vPu%&fd%99bnOarplAiC92Piui`*+IC?h59G!%E(NcBq)zuR5O=*#5 zS!d}%yI!v_YomW< z+pLh3+q}pVD`rDXh&AKHpbtPt^6o*=3dYcpU&&z&Tk}VArY`$orhX;FeU{!u?xm|N z%tI`08!Tj}&$AN6Buu8@yYr!vJKF^PR{oAb2>y+ZrCA07&YnVW_-(^d4tDOM|fS5{EC-T$>4PROP8JoaVYsMJ&I`RlB=WTIh@j>UOHN{6KQ# z(PZ|+ho4T@WV4CV*T$9crzkK1`gKJ=d!qJ|U?7W?p?x9DyRv_y8h52Q^f!}XrQh6M z=$=dyeH>bIVzR0FPw!QNK<7a&s#n|ES?>swj;^9^zuM<@;DaFSu@meul1rEI`hjBoYl_T4a z5<7jd?pw>AfhE@8^y>6cz|XDr56;L$^ikgX=~b=k;&Y2-l3UXDz9xg5J!UhYv7 zq^+oE6*#b2_C5Y3AtgZD;vu*VwDSM$~V~dX*SvoLOAyp4)eluN9)iWRi6A$l@@&Bb$AEM?w@=k zu%zQ(zJB3@v{T@kedXr4;Dzb=Bgu_LM~n0)%HP`&lb!@EXKeJQ<2&ngWg0C^13#y2 zP#!t`63~cN{=^YhJnh;KTc}DEC)dB9hqdh;+YRn2jjstX<__X;pSiur^zMc zom4&EE=F$IM~+ve-29GMh|?n0!S|6Tym@2-_zZmo3|qypj`7a=T-DoRU@IgfO7ZTv z)|MDp$OgS+I!IxPsmvMxrQ99TGSqj(fVmg^;fMT##m%`YF`3ehP~NGOSL5?MtvKR& zs-A+bi|S=Tp6nK}bMEz8=-y%#Ot4b|P;4pY>CB z4T%}YFo8&NouFYPO~}Zh4KAeOdNm4(SQxZ|-PK2hl-S4H6?`HurM&!P%7-0Fdz=5O z<8s;%b_<$Leo0U>=!wqpi3<)sH5>bqkmP43OWNn+T859~Obt~08oxS{ZFOMh>bFJ<$(SLsd%WN?V1pF{6_l?{3 z`rC(C+Br?ZM~w!!RpwjIPkl8f?ku@8)F=xnhl|rVG<-alDQHGKs-S&@rnMk+)l|T+ z^1L(b&A%iVi(?;gNI3XH_A@qOB+_(*=h+1T@*?1Vb|H+&$O5C4U{nxx8>c}DwT9so z$)J#5g!1My%CO#ZMfLwmne<+nZi(Ql)d4?ES^AL_rV*Wx5r$^&p*!m!jbUD!D54W@ z>+z!jq(RrRS8T4f(X>}-E{fB?7;qEhwR!VZCJaMtV5!Jw0OQ0QHTbCPOiYf^4iF9` zUeTxI{H*OWKZU0_Ah8vq6xu?LIDe%7zMAnnRo$UnT+VZ3Fn}mMG(95eo~iTm$5{zy Z!HHx4+;x<`tRAVCa*3Q|TO%)ls!BnTKpBvC=glc5D6SSTY>MG+7XNux6iMI2F@ z;1d-_kUoImO(;GGDM8BM5;0VzJWUAU1ro`fFzdbb=EFIAe>wZV*Ke1T>E`07qO79~ z0DubF$=*Y5Ia@~wDZeivO049@-_6<6VYak#u)n_$0D=HuMIf*MfPMgg;c*}c_97P~ZcVF2Kz0k3ZWzSaO-V*wWe>gwt$Dk^9+ zT1Q7mt{@NIW~SaQ_rMqr7Yac7_*O0hJWBAS#@Jtqz8Do6854T-3IN2HP`o0eu8T#K z$d$D@lhX%H2K%{`x-!9HT%s88a;;6+C&{F9yk1POW^h8^z5c+LHD0^AeD}Er;QkEwBwQl{aY@yrp);&k4nBj;78&Q_qS zvlXKX(q+LZ9EJHzDt#Cy%$7{4D(~HU&z$t3ZTGAFMmAF%F|pil&Y^Rh{Zw^nZsqd} z=OdY!>6(2vk(rj9z$t2`N?nM{ChxH-YFe*%Qt+f@kEUJl4c_-GnNeFH;JEW_-E8_= zDJw!^e6L8w-md}2SXnP_1DZeDu+U9vD*o4Otxb*{r=2H}6W*2Q-t7KyD)tF=y=0zN ztR8G&i6r;)zl9(+_}gN;)V40|E&`FOV0w##G3*`98RuF_5|Hs{1F-ojm7<5WJgAIb z0x_f}tN1uj&y}@I_P??oPoq9)6RAgb=!2n30*D zT1*;92+e&g#2j{;HdcwSf)tGq>4&~5)RUMmCQj5`{R?uZzudsMnbwqOpEC%*Gd;x5 zQpE_!@1>7d!P*K{xZ_tL713Z?us0vF-?gM{Q2#uUZKKy%ohCzCXD(%Y7$OY_!$r#; zrnzqOQat28wZQ2Ig@dKmjv8-38V@dK4Q$v|j%cx8z}43Og?y=;vC~&4th`qoz?{~r znG|@poa_)-^+^vKiE68jXeACI2JbJ*g^~gaRg`$RepIE^IMKE|H3Z0-HCS`K#h?99 zr`0-Xyax)p!F$~0qclL$M#q}V)7G6o_WPnMNR38JmBkk$;^*5K91 zin8O7YWUm@9xh~6&aiolVHp^zEGR|gJQfzHk*v?mDMS19wP|iamoi#DSXW!L6%o*3q8QhRH5tMHl%IHbe{|AAA_sz5>N4Ff|G3-@=PHuR_)Nb96(hKOa_V$Pk z$cym<#EXp*&aH0#bMhWPeC>j!+1u^)N$mT4zx2C%BHRVhkp!OilB?n%Xx9}2?MAN; zH;uwqC{XR#6GW@igHs1IIPPC;VzZHB{ivde@8ec!k02Zq?UbPyd2OoGeV}SF1iYRt z*gS!khdFvbs$QTJW6sWUqw|_&sJ8|Da1jl(?leT5DqnsaYx)@qe6N!mzV@AD^C!fu z%cMKYJw`ZMVinO8Xc6>u}&+5 zj-6dJd&_v7Tn`6!#B7%CSxWS)`rC+=X7!=K)?uX0romtX#Ll_M_12Qq zqqnx18-%-+vdoOnk>PWEVpEsF^H~93wH!?Zox*V8W;m{(Oq8{JiY7oSo5R&`^A^bRt%4^+o!Ix^ zc@w^N*EqbQfCb`+gatpw9n94J6We3I)81tZS>WP0Q1OpiZ$Jg^Tn{KTQse`aFMRLB9W7QtpDbi8nyd0$Z|v!IQgR_ z^sraUet%zR<8xAcT)PY=x#@c?oZ0HFT&AVMdIkEBB@*ev`dTrz^mMx@{5SVSiQ~e^ zISrrk^eia}j2cSEsHGIIgOYB2qBcE=isgKWc<=||f1`&%b<>CDrP7mk`E0;*Lv}!3 zL^i^5Lw1^Uo6lDG%PHpbcSJz!qoWKqoAAqqOy>4c{-BW0SG@#n6)Md&!>=ZGXGh$9 S?^yXa3y>XL?4O7ypf6Cd=4+)=XrJEFmH>JnJKbqQ9Le#Ej+D(D0i<*`8fbvZs<1srQ)d zBa$UcNYGc+``va(tw z0&Q(=r2r5F0H)yyD3_4r*k@0}06iUROLOo1yKPSA!lb38)zs9Kl#~Vlz&ZW#rHir6 z&CP%=8xH_OGRG!u9bZG>D=R<=06YPJ(NQ3WBALTd%u|Kvf~vYd17KetCm*1XmtQa> zBm|Ggv)Q^D8X7`kQiFqorxf}Bh*eYofa?G-I51EM04V2BlsaOwQd6hGk;UOF97nn>_&pu`dn9@lt&Z*(o#~4R0Q+@Km*Au2LRNP$K=~UUktzo z3juL)aRdV4eHvgt(}ly~*#}DuPBM^aX9pJmwfK>9YzQLO)jirGFe)H27!w_g4hH~i z@tr%Z;ZS+uq*dzi>{;vmh&+XJm-{0{+BJ#qP@ezy9DfNKxh)pW|Z?=R<>=dR?|-nYq+PzvF)J?b{M&*c&r zjrK$#-A=z(&bEI{f8Qy}e)XapC59)!B0u1co!?Mg>qVI9AQBt%%?>d7;9p74kt6oL)u!Hxnhggi?iHZtbgheGat)$7B$blC|)h?B5GR^y_(y^-!wH#tW9HxhCV}i z^fjcRgkRTPt(g8RTbP0b=V&FnDa*~fh#tw;8-=up#f42m;kS}+b8$w=Bh-^Re~Xdq zR&40-1h$oHcVB#WpWEA`1{?OQgK5opSh`@%76=dsUWhQ0AZIV(d|4X+q+_*bG}hg*-88ciFNcnx|OKrjKH7gG&IgBdY*}}Hc-g{kvxmZycgXO}t>wa9YNzzHE5KM>c2scX}f-zaJYQ9cXK&5(*#^*OO+0@0w zpvy$Uk_kB?cSr>@^E2l`5)-*MghsZ*!s1htPqmESp~^Viw5{rfIDE6wZ24U=>Qt*8 zej(!E_VxCVc_8^7RmLP79?o``rC_3r6@NGVbS`f1RnC9p{CG6D`1aEFm2T#@sPo;G zqNYd}V`aLd$t389O>T;|F_yC_cjTVu+ATGVT3nlaxx8QUZ248xQpbq(CAl*o%lPzx zB$9lKUjkz`WPQj%&`43vdO6jCOP?ElnIh0l^QXvuSH|BJSGSf7K2b0S&P5o+D$J#- z_ve-APlK>~&ABIN4TxxdhVFF76)r8Q>{o&K1v=;Fv2birA*dH6e6I5PMP+!8caDc9 z9Mkf$M}L?aUT!Cb3XDm9OD&0*Mim=SY@0IKnb_n3>gDo00h_?Lbyn6smUEvvdr?AC z!o;(XM~@X~m`~cMA;Q&iKXig-aMaF`O~FDHaNae=DPf+MgenM1xIywlY^j+X}bZQ%<=qs&o4)Hj}RS1vF-)M|yapeHHs~2_qq%&cwfDs* zUT1stsK>E@oZVfY<_|+;GdU(FwA%rLG;Y$5D$53De@qFsZfralOC%)(r83x9@(eqIt@GnN+^JXAROG(FDsgwgfkRo3$g$SjYq%!R_oYE967j zaaWgF6AnbS5p%A>6k3N z#|O3~5>tK(L^cg|)yW!5Dw{CysXm6-)8@F(@?!1lc%m@7!vqR-fafKC6A%Dj2y*yB z-^$A3m*p*&6~OH>g~UAhvVlI*(Y*)RT(hii9-pXGW5>+75>%zYZ^|me-c*->UF8u~ zXn;%J)dB7%=5E@SqPat6W@pFagU@=}xAbAqfG=WKP|a*_+fw^B|D!9~+B<24;~((h z?AG^;hY)WqL`ozXtkVPeLD-WTk1$gQ_RWKy1`qVxnrD}*`RK>*PStS!uO`*_9R;xs z`81!_w{HY%2xTy38>lHSEMBfy5y8T_BkbL2ulvk^zG8QNpEWWvO(wVP>hRH}+nS3Qs#uhYS;O9fxt3H8Ly z&Q7k0&LZO46 zrQg9wLlbzt01wgs$2`hV9&Q6H_%1fnK=%b_Jhziz5NU!a?n|hgOeB|@L$(k>aZ0y?Z4m=FrURdRKbmQ>Czgly(j-JtdCG=`Op*!Q$9~0CfTBg-f z!PA8-qXPGcexSd;quxDe@_($mU{va1vTg@P(%sqvPvF_<4fchGiNJmuS4oDP29m>?VshH=qTy#elHxsb&rQWa?h*4K5nZ1-thyT9+OpD*<=R7Maw!i3$=bPkUC z2ElB(Uu!4at#qB5i3f^jbk6H^ta5n&A|)L1+q;4pVk|64I^b)d0SnX=AZ|e=F$<;a z{8y$vVQt<|%yE4Be?1vSx7W+w3bKvmmrbf1K4FI@Bx0UC_>gW-O#Xf=JdB^h;>#{6 zy<=!f?gd=W(EFBr**Bhdfk&bjePp;rEW5Ur5BA~dE^X?bZ%1v$ zpmdCOo14rn>FNb5E0ELS{v+(y_ll-1+6#x$Tkvg^&c8Bg2hM&jV+6_p17&jL6Ur>dE?i7aL-!vM3r!nj>NLX;E_>0z` z1#^x^+S&WeT%dn#S=%$Xv9VS>65Qhzer)KPg0u0Tdp1Hz^j|$A#UCcPg>i3YMoLV9ya3Vd5Y}N^BOmA zJv6AlUGR(zg%(Z!U2wiM2@9x4^N-@kOitDOTkVI^)zrW1d|?=bmFlzOFzR1r`?P@|xf z5Gg@=6BOy8gdz}%gcy<+@BQCf|66P3%$~Am&YthvduC0tosAhUHdB)wI$JGP?ub2a>r-6e0^XJchuj0W!=Kc%-mCVLB3qVnCUlBK!DOY_1 z-pvBd>rg24)TvVn3JSdda4EG4kH-TqM}dYVAiKfA!NJ|#T}Ma9)YLQ%01~5Xs{H{C zH8T@qmjQ`m-z{wa&TDC7;aFJ#?5zC@0pKM7jEn%+u0$t20+iq?=Mctb);23ED-zxV7;fqo*Z%O-Xdb-1e{^(q2@Z!xMn;}H zckYDxc>vYj&9o8d{`T#gva&K458tg@x8maB7z}lOLGk|n{@~zXO?e({w7eVugabfH zNr{mX@7A+3rvRV`;JxghCIpp@v=?L4sGmCtv19HQAZ6wp`7K)sdX!xm#&r|`qya!s zTt-(Bq5%Nc0ieIPHy;4VTU+V?Z~_1rjPW$)`aXr-pqO03@xNKIch%LbF)E0MOD9m4uW%7pE@np zJhmCo9y#6~^SkIB+?9~d+$g6}8n|0OdZ`-5Iz8eA-)Yt0VtXT#w z<+`4ZYnq^alh;aFdj=h^RA$l^%WjIif=v<^+3Ccq$4b_|zOdV+`jR%-_svHj9CQb^oNx=>}U0V1zXOz^a`+JX&uKtd+=|0J@h!wB3jLQ|6~ zIz)Y?uMa&vY#eQwT2j9eP=l?eU%36;dr!aSagOKa26AvikT3(2*FUksVO*Xl-~6KH zr&(k8PpZ9>#HQU29%GB9FW@mv=am!r^x3HniF{-}O{oC=rhEGVehFkm)O@mHiEt-} z_dt>U;I@+AL}SEe3-Wi#B7uKn1_ulE!&FP_2F(Jb!3U1|gQL^a(?dfnHFa@J$_Hsf zn8Go$vgdijf29d#$BW%`Y1zW#v1+K-- zG_aqWdRTvT8GnY>sXXh*Gwou=XELkh+G!YelsB5baPk#`a05aq)s^;;sw4PINqtrw zo0NQ@Zy?6ULvXaT1O=1q znxve0-c7(OqojVAGOP{_g}O$YVq&+W&Q!hM`@4K(wPeqNU%TF@u|p<0={lq=5!+Gn z>(|&=+vk&yz+vIn!x}oOKUn~{-L@cpN&RS{jkva^=}DT#@Z@PyP`Z>}IAr4tBJgMH zVxhs*sTFt8!}3&@78BY~X&aAq7tcJ%#n1F~G>_aG_FNCE{wmX^ttuj@A3LmIvqc^| z)FO4L3($L0=RvR#sqyg64uD_xT=~<(BL-g#>CsX5V^>njPW*S;-w`za+ckQHE^4}2 zksDx<{(jHs$B0Pw?wJ*L`}7Ry%-xC#KELNGJ}a-T{ad&)i`bzjxhU?Y)A_r@O0`X_ zDudg6acO*EmeG)EX3%CSpa^%iLPy)mq-FKxNRGJCp&|DgSMJ2NG3s-3dAU)QQXQ3I zjwR`X>mO1WHL{aP3*a8TCheg~ih<~;KxeJ@8)Lr+U&YuI8yt?+PNT2% z%24=SJRU?2AHG%z?znvjiQ(KxE=bb1>Zqc=G9A&^&ZM6S zVC!f*vykZ)YIvZEhTkwoH$UX3$G_qy)yn$uyvuqR%kjYWK>68E{dz$w)IA9{Ha4x- zJi2>8Dku}U*Iw@`4Nc?c|E$@rySrxC6tS4%01H{{zK5#PB&Bb^6 z{QKK!u|Fp`P%kw}l)eHjDXCZ;m)nC~yz+>joazWO4*0h20frCRmC~L_N}sh0785T& z`y~uWoNh$#sa~D-q{${u<5H+!_r+0NrTni;V}G)B!iWN^Xv5^+kc*?bZo3j$X*Xm( z+6hTf1qg8lla1M!eQ}L0-GwW#9lPBEEq1A+pb&ZTGL9A&Z+YaILoCS}}LXtidt!qU}svQy=vmB%u?lH02?Tq@f9 zT7Z3E~31g);aQDf z{!Q%KUl>rchrj?Qd{P`6-uL%C9JW*DO@Jyk0D1dozP9;TF63tOGGgo4}`Ki12u-$mM~>O=_Y1< zswz{SL-y^9d1fHYgI>ju#Kq~FMdOwybNn4 zg=D$BPA{dNl1-?J^`R8+yhZFV%2je4F)}JaVJLc!t7wCes_tTLhVd@Fu~@kqtQ`9< z^X^+FQcl869@-pqtXzh9cE2j8ikZK~L8Tkt42?{n^D;+DG z^4}L0-u_|Y_JaHmckggGyQt6L`bBQ|KixLSUTtv=_*X&+;tToi99M$W0|FsC3t<`5 z7l%;ab*e#Z)%JJ|s#O;3*}_k&@YtSM4~mG2La6z%zrJ?HFDLeuCMP}YG35GUXr)2L zEdeK3c6*>Sf#5F=0xM)!BP{hG*I%mo-AqJi>eirw-B}=Sy#>Uub*)hB+qRO&P|THZ zvCGc{|H4F)3e4&ur}jOopzxW?qdGmmq+GzsRh&RnA^o6e2qKy$DX_ zI{5+n@PB!I@j&SJwk0A$jpT|>TZHxhp|vM5sYf-P6Wo`_pYmD%1NKf@)QT(?`>;WB zC&_KF`k+KxNep|7*(lA1kz5D!PC%eoaqPoN0ZFybtVR)a5*jzv{f2!8S1)ttUl-;L z7T~>@lL;}-8WvBOy+??LPPAs}+z=4~VMMyk!LmHV;){@Gqe92K3X3rYHqSwrOWy63 z*#AD@w;2iVwU_RNQDKWPLBWxcU+|F;LBTAdXleUS?%wm%q4Fm_eM$FJw=> zqu(n1BIdY&mG8U!-s@MdJ}7oSGxC__?RP8|ts$4(eqG?^<(Mrd!!K@-g{jB1h1OTQ zea78l0a5vH2_Xco*Kc%tRV*FPMk*iUb4|mwEV}w9f&F)kORH$jDWFoubW$l|!D}wDeu-#qs6-Cs7K=1F*>EPgoy9|b55wW(~gY~1Az^^&nWa5tqYpT!!$%o^)ayt%W z#9U6m!JJ;c9zuKk*PlQdqkh6+KvkuAhCxX~IGn{)RD-=qwhB=!;(5-UYKSN9ojwAx z=gJS$ap>}Lb#DAbzHq7Ohv4vwC~NR5b3yEj*ZR_knE#HYCibg}h5d*Eo&=D-klYm0 zJvuwh?(AumhMq0x@$Vg2riecX-qDdMu(nhxp-NcDpEd3xio@P~orzyse)pX>57x?i z5o!G1>GD@C z$En>f2-@TWA=o=0Iw-J$+ymB>X~8_F9|wK70y(;hIwe>>?Hoh9FFg;s8$@#_&Y;O; za8E)!6=q1(b6gGF`tG7x^~=KbpQ*U!;1l6za+hpn)mx$feJX_y&NM#i020!vVrw^O zA1Cx--3@+qgFu+^^NJa#N(_M6R}0*X&Q_I@VWx+?3qj}CP%)1-ub|i>NDp>Tb`ACM zU35x9amD%lzzYPF(kwoflG&Ich~FLkF*@zq%Hg9lSkNmRo@-FYE#EB-eiN8xbKH{gU*%jAm&c_arPcnwYkW7~@QSsc)=m^+VA*2-4ZRZZFTGDr z9Tc%tI2o&3Ff}=O-Fb4sH*dyy67c`tG~`7RQOZWUagCR6Z-d(v1ei zCC4JK9!MXJvM0J#v*xt67Q=TSg}ZzKQ^x1ahbLjpTv0nWiX_Ua+d5W#&;`TbA<$e6 zyDCCt$7#W~RF*7z|Dt_YaV_r4;|3x09~aKaHaPg>!cI&VzVjKRRbS5Kkt4*tt`07b z=_rZu7sV0Jvp&Aq;jf6iXvMvVA4@?PAKH4OM+*vM=tlf^(UCi|{ECZ#i#(wi;cer? z^kTAQhK4XEZ;#{uaIXJD86p$sx(p`HP+Xn2v{AZ2?2AwwLV;d2pwjItw(^*ZTbDay zAxG-8Q1>B);`HdD?SRZ2M9Frr0CAssTr7k4mS4SS}tgaon7f-@@)>i(knA*>WpUOwx7hQdZ}{W~BG7+B_ig^}X3MV(vir+{3H? z`;_p{706rh`O&WgjcR)5CdK8X@G}#pgXYFdUq&5E1|6n Date: Wed, 2 Oct 2019 11:55:38 +0100 Subject: [PATCH 35/47] whoops --- code/modules/mob/living/carbon/human/update_icons.dm | 4 ++-- modular_citadel/code/modules/clothing/clothing.dm | 2 ++ modular_citadel/code/modules/clothing/under/trek_under.dm | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6b4703d7df..03c7209152 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -123,7 +123,7 @@ There are several things that need to be remembered: if(U.adjusted == ALT_STYLE) t_color = "[t_color]_d" - if(!U.alternate_worn_icon) + if(!U.force_alternate_icon) if(U.mutantrace_variation) if(U.suit_style == DIGITIGRADE_SUIT_STYLE) U.alternate_worn_icon = 'modular_citadel/icons/mob/uniform_digi.dmi' @@ -389,7 +389,7 @@ There are several things that need to be remembered: client.screen += wear_suit update_observer_view(wear_suit,1) - if(!S.alternate_worn_icon) + if(!S.force_alternate_icon) if(!no_taur_thanks && S.mutantrace_variation) //Just make sure we've got this checked too if(S.taurmode == NOT_TAURIC && S.adjusted == ALT_STYLE) //are we not a taur, but we have Digitigrade legs? Run this check first, then. S.alternate_worn_icon = 'modular_citadel/icons/mob/suit_digi.dmi' diff --git a/modular_citadel/code/modules/clothing/clothing.dm b/modular_citadel/code/modules/clothing/clothing.dm index fc71d5bdde..7f366ecf35 100644 --- a/modular_citadel/code/modules/clothing/clothing.dm +++ b/modular_citadel/code/modules/clothing/clothing.dm @@ -38,6 +38,8 @@ var/secondary_color = "#FFFFFF" var/tertiary_color = "#808080" + var/force_alternate_icon = FALSE + /obj/item/clothing/update_icon() // picks the colored overlays from the ICON file ..() if(hasprimary) //Checks if the overlay is enabled diff --git a/modular_citadel/code/modules/clothing/under/trek_under.dm b/modular_citadel/code/modules/clothing/under/trek_under.dm index a60f7653c5..5cd0620a9d 100644 --- a/modular_citadel/code/modules/clothing/under/trek_under.dm +++ b/modular_citadel/code/modules/clothing/under/trek_under.dm @@ -14,6 +14,7 @@ desc = "Oooh... right." icon = 'modular_citadel/icons/obj/clothing/trek_item_icon.dmi' alternate_worn_icon = 'modular_citadel/icons/mob/clothing/trek_mob_icon.dmi' + force_alternate_icon = TRUE item_state = "" can_adjust = FALSE //to prevent you from "wearing it casually" @@ -23,7 +24,7 @@ desc = "The uniform worn by command officers in the mid 2260s." icon_state = "trek_command" item_state = "trek_command" - armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0) + armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0) /obj/item/clothing/under/rank/trek/engsec name = "Operations Uniform" @@ -94,6 +95,7 @@ icon = 'modular_citadel/icons/obj/clothing/trek_item_icon.dmi' icon_state = "trek_ds9_coat" alternate_worn_icon = 'modular_citadel/icons/mob/clothing/trek_mob_icon.dmi' + force_alternate_icon = TRUE item_state = "trek_ds9_coat" body_parts_covered = CHEST|GROIN|ARMS mutantrace_variation = NO_MUTANTRACE_VARIATION @@ -138,6 +140,7 @@ desc = "A uniform jacket from the United Federation. Set phasers to awesome." icon = 'modular_citadel/icons/obj/clothing/trek_item_icon.dmi' alternate_worn_icon = 'modular_citadel/icons/mob/clothing/trek_mob_icon.dmi' + force_alternate_icon = TRUE icon_state = "fedcoat" item_state = "fedcoat" mutantrace_variation = NO_MUTANTRACE_VARIATION @@ -204,6 +207,7 @@ desc = "A modern uniform jacket from the United Federation." icon = 'modular_citadel/icons/obj/clothing/trek_item_icon.dmi' alternate_worn_icon = 'modular_citadel/icons/mob/clothing/trek_mob_icon.dmi' + force_alternate_icon = TRUE icon_state = "fedmodern" item_state = "fedmodern" body_parts_covered = CHEST|GROIN|ARMS @@ -236,6 +240,7 @@ icon = 'modular_citadel/icons/obj/clothing/trek_item_icon.dmi' icon_state = "fedcapofficer" alternate_worn_icon = 'modular_citadel/icons/mob/clothing/trek_mob_icon.dmi' + force_alternate_icon = TRUE item_state = "fedcapofficer" //Variants From 79e85e2cfafb54548cd399a49308e122cd5d3f8e Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Fri, 4 Oct 2019 03:53:02 +0100 Subject: [PATCH 36/47] Fixes some runtimes --- code/datums/traits/negative.dm | 4 +++- code/modules/mob/living/brain/brain_item.dm | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 62cb8e0999..f42fe688c5 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -345,10 +345,12 @@ gain_text = "You find yourself unable to speak!" lose_text = "You feel a growing strength in your vocal chords." medical_record_text = "Functionally mute, patient is unable to use their voice in any capacity." + var/datum/brain_trauma/severe/mute/mute /datum/quirk/mute/add() var/mob/living/carbon/human/H = quirk_holder - H.gain_trauma(TRAIT_MUTE, TRAUMA_RESILIENCE_SURGERY) + mute = new + H.gain_trauma(mute, TRAUMA_RESILIENCE_SURGERY) /datum/quirk/mute/on_process() if(quirk_holder.mind && LAZYLEN(quirk_holder.mind.antag_datums)) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 601dd2dc2f..17f81981d1 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -323,9 +323,11 @@ return FALSE if(!resilience) resilience = initial(trauma.resilience) + if(!owner) + return FALSE if(owner.stat == DEAD) return FALSE - + var/resilience_tier_count = 0 for(var/X in traumas) if(istype(X, trauma)) From 0716b48a99e300ee129598e3b8658fab8858245f Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 4 Oct 2019 06:56:57 -0500 Subject: [PATCH 37/47] unmodularize it --- .../code => code}/game/machinery/cryopod.dm | 37 ++++++++++++++++--- tgstation.dme | 2 +- 2 files changed, 32 insertions(+), 7 deletions(-) rename {modular_citadel/code => code}/game/machinery/cryopod.dm (94%) diff --git a/modular_citadel/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm similarity index 94% rename from modular_citadel/code/game/machinery/cryopod.dm rename to code/game/machinery/cryopod.dm index 15e7d34c65..13ee36ce98 100644 --- a/modular_citadel/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -24,15 +24,31 @@ var/list/frozen_crew = list() var/list/frozen_items = list() + // Used for containing rare items traitors need to steal, so it's not + // game-over if they get iced + var/list/objective_items = list() + // A cache of theft datums so you don't have to re-create them for + // each item check + var/list/theft_cache = list() + var/storage_type = "crewmembers" var/storage_name = "Cryogenic Oversight Control" var/allow_items = TRUE -/obj/machinery/computer/cryopod/ui_interact(mob/user = usr) - . = ..() +/obj/machinery/computer/cryopod/New() + ..() + for(var/T in potential_theft_objectives) + theft_cache += new T + +/obj/machinery/computer/cryopod/attack_ai() + attack_hand() + +/obj/machinery/computer/cryopod/attack_hand(mob/user = usr) + if(!is_operational()) + return user.set_machine(src) - add_fingerprint(user) + add_fingerprint(usr) var/dat @@ -49,10 +65,14 @@ /obj/machinery/computer/cryopod/Topic(href, href_list) if(..()) - return 1 + return + + if(!usr.canUseTopic(src)) + return var/mob/user = usr + user.set_machine(src) add_fingerprint(user) if(href_list["log"]) @@ -119,6 +139,8 @@ name = "Circuit board (Cryogenic Oversight Console)" build_path = "/obj/machinery/computer/cryopod" +/obj/machinery/computer/cryopod/contents_explosion() + return //Cryopods themselves. /obj/machinery/cryopod @@ -176,10 +198,10 @@ /obj/item/gun/energy/laser/cyborg ) -/obj/machinery/cryopod/Initialize() +/obj/machinery/cryopod/Initialize(mapload) . = ..() update_icon() - find_control_computer(TRUE) + find_control_computer(mapload) /obj/machinery/cryopod/proc/find_control_computer(urgent = FALSE) for(var/obj/machinery/computer/cryopod/C in get_area(src)) @@ -244,6 +266,9 @@ // This function can not be undone; do not call this unless you are sure /obj/machinery/cryopod/proc/despawn_occupant() + if(!control_computer) + find_control_computer() + var/mob/living/mob_occupant = occupant //Update any existing objectives involving this mob. diff --git a/tgstation.dme b/tgstation.dme index cceeb1f915..be270841a4 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -581,6 +581,7 @@ #include "code\game\machinery\cell_charger.dm" #include "code\game\machinery\cloning.dm" #include "code\game\machinery\constructable_frame.dm" +#include "code\game\machinery\cryopod.dm" #include "code\game\machinery\dance_machine.dm" #include "code\game\machinery\defibrillator_mount.dm" #include "code\game\machinery\deployable.dm" @@ -2922,7 +2923,6 @@ #include "modular_citadel\code\game\gamemodes\gangs\implant_gang.dm" #include "modular_citadel\code\game\gamemodes\miniantags\bot_swarm\swarmer_event.dm" #include "modular_citadel\code\game\gamemodes\revolution\revolution.dm" -#include "modular_citadel\code\game\machinery\cryopod.dm" #include "modular_citadel\code\game\machinery\displaycases.dm" #include "modular_citadel\code\game\machinery\firealarm.dm" #include "modular_citadel\code\game\machinery\Sleeper.dm" From 209b195822edb559cd9cc7bb427eda3df12d16f1 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 4 Oct 2019 07:31:31 -0500 Subject: [PATCH 38/47] this probably doesn't fix the shitty console, but --- code/game/machinery/cryopod.dm | 40 +++++++++++----------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 13ee36ce98..2607651c72 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -24,22 +24,10 @@ var/list/frozen_crew = list() var/list/frozen_items = list() - // Used for containing rare items traitors need to steal, so it's not - // game-over if they get iced - var/list/objective_items = list() - // A cache of theft datums so you don't have to re-create them for - // each item check - var/list/theft_cache = list() - var/storage_type = "crewmembers" var/storage_name = "Cryogenic Oversight Control" var/allow_items = TRUE -/obj/machinery/computer/cryopod/New() - ..() - for(var/T in potential_theft_objectives) - theft_cache += new T - /obj/machinery/computer/cryopod/attack_ai() attack_hand() @@ -48,7 +36,7 @@ return user.set_machine(src) - add_fingerprint(usr) + add_fingerprint(user) var/dat @@ -65,14 +53,10 @@ /obj/machinery/computer/cryopod/Topic(href, href_list) if(..()) - return - - if(!usr.canUseTopic(src)) - return + return TRUE var/mob/user = usr - user.set_machine(src) add_fingerprint(user) if(href_list["log"]) @@ -134,6 +118,7 @@ frozen_items -= I updateUsrDialog() + return /obj/item/circuitboard/cryopodcontrol name = "Circuit board (Cryogenic Oversight Console)" @@ -208,6 +193,7 @@ control_computer = C if(C) return C + break // Don't send messages unless we *need* the computer, and less than five minutes have passed since last time we messaged if(!control_computer && urgent && last_no_computer_message + 5*60*10 < world.time) @@ -215,7 +201,7 @@ message_admins("Cryopod in [get_area(src)] could not find control computer!") last_no_computer_message = world.time - return null + return control_computer != null /obj/machinery/cryopod/close_machine(mob/user) if(!control_computer) @@ -383,7 +369,7 @@ var/generic_plsnoleave_message = " Please adminhelp before leaving the round, even if there are no administrators online!" - if(target == user && world.time - target.client.cryo_warned > 5 * 600)//if we haven't warned them in the last 5 minutes + if(target == user && world.time - target.client.cryo_warned > 5 MINUTES)//if we haven't warned them in the last 5 minutes var/caught = FALSE if(target.mind.assigned_role in GLOB.command_positions) alert("You're a Head of Staff![generic_plsnoleave_message] Be sure to put your locker items back into your locker!") @@ -391,13 +377,13 @@ if(iscultist(target) || is_servant_of_ratvar(target)) to_chat(target, "You're a Cultist![generic_plsnoleave_message]") caught = TRUE - if(istype(SSticker.mode, /datum/antagonist/blob)) - if(target.mind in GLOB.overminds) - alert("You're a Blob![generic_plsnoleave_message]") - caught = TRUE if(is_devil(target)) alert("You're a Devil![generic_plsnoleave_message]") caught = TRUE + if(istype(SSticker.mode, /datum/antagonist/gang)) + if(target.mind.has_antag_datum(/datum/antagonist/gang)) + alert("You're a Gangster![generic_plsnoleave_message]") + caught = TRUE if(istype(SSticker.mode, /datum/antagonist/rev)) if(target.mind.has_antag_datum(/datum/antagonist/rev/head)) alert("You're a Head Revolutionary![generic_plsnoleave_message]") @@ -410,8 +396,9 @@ target.client.cryo_warned = world.time return - if(!Adjacent(user)) + if(!target || user.incapacitated() || !target.Adjacent(user) || !Adjacent(user) || (!ishuman(user) && !iscyborg(user)) || !istype(user.loc, /turf) || target.buckled) return + //rerun the checks in case of shenanigans if(target == user) visible_message("[user] starts climbing into the cryo pod.") @@ -421,7 +408,6 @@ if(occupant) to_chat(user, "\The [src] is in use.") return - close_machine(target) to_chat(target, "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.") @@ -432,4 +418,4 @@ //Attacks/effects. /obj/machinery/cryopod/blob_act() - return //Sorta gamey, but we don't really want these to be destroyed. + return //Sorta gamey, but we don't really want these to be destroyed. \ No newline at end of file From cda97faaa57575fbcdaaf52f90bcec9b0cdaef02 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 4 Oct 2019 09:52:42 -0500 Subject: [PATCH 39/47] UI and proper deletion stuff --- code/game/machinery/cryopod.dm | 194 +++++++++++++++++++++++---------- 1 file changed, 135 insertions(+), 59 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 2607651c72..59f7e7779f 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -20,36 +20,66 @@ req_one_access = list(ACCESS_HEADS, ACCESS_ARMORY) //Heads of staff or the warden can go here to claim recover items from their department that people went were cryodormed with. var/mode = null + var/menu = 1 //Which menu screen to display + //Used for logging people entering cryosleep and important items they are carrying. var/list/frozen_crew = list() var/list/frozen_items = list() - var/storage_type = "crewmembers" - var/storage_name = "Cryogenic Oversight Control" + // Used for containing rare items traitors need to steal, so it's not + // game-over if they get iced + var/list/objective_items = list() + // A cache of theft datums so you don't have to re-create them for + // each item check + var/list/theft_cache = list() + var/allow_items = TRUE /obj/machinery/computer/cryopod/attack_ai() attack_hand() -/obj/machinery/computer/cryopod/attack_hand(mob/user = usr) +/obj/machinery/computer/cryopod/ui_interact(mob/user = usr) if(!is_operational()) return user.set_machine(src) add_fingerprint(user) - var/dat + var/dat = "" - dat += "

[storage_name]
" - dat += "Welcome, [user.real_name].


" - dat += "
View storage log.
" - if(allow_items) - dat += "View objects.
" - dat += "Recover object.
" - dat += "Recover all objects.
" + dat += "

Welcome, [user.real_name].


" + dat += "

" - user << browse(dat, "window=cryopod_console") - onclose(user, "cryopod_console") + switch(src.menu) + if(1) + dat += "View crew storage log

" + if(allow_items) + dat += "View objects storage log

" + dat += "Recover object

" + dat += "Recover all objects
" + if(2) + dat += "<< Back

" + dat += "

Recently stored Crew




" + if(!frozen_crew.len) + dat += "There has been no storage usage at this terminal.
" + else + for(var/person in frozen_crew) + dat += "[person]
" + dat += "
" + if(3) + dat += "<< Back

" + dat += "

Recently stored objects




" + if(!frozen_items.len) + dat += "There has been no storage usage at this terminal.
" + else + for(var/obj/item/I in frozen_items) + dat += "[I.name]
" + dat += "
" + + var/datum/browser/popup = new(user, "cryopod_console", "Cryogenic System Control") + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() /obj/machinery/computer/cryopod/Topic(href, href_list) if(..()) @@ -59,64 +89,68 @@ add_fingerprint(user) - if(href_list["log"]) - - var/dat = "Recently stored [storage_type]


" - for(var/person in frozen_crew) - dat += "[person]
" - dat += "
" - - user << browse(dat, "window=cryolog") - - if(href_list["view"]) - if(!allow_items) return - - var/dat = "Recently stored objects


" - for(var/obj/item/I in frozen_items) - dat += "[I.name]
" - dat += "
" - - user << browse(dat, "window=cryoitems") - - else if(href_list["item"]) + if(href_list["item"]) if(!allowed(user)) to_chat(user, "Access Denied.") + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + updateUsrDialog() return if(!allow_items) return if(frozen_items.len == 0) to_chat(user, "There is nothing to recover from storage.") + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + updateUsrDialog() return var/obj/item/I = input(user, "Please choose which object to retrieve.","Object recovery",null) as null|anything in frozen_items + playsound(src, "terminal_type", 25, 0) if(!I) return if(!(I in frozen_items)) to_chat(user, "\The [I] is no longer in storage.") + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + updateUsrDialog() return visible_message("The console beeps happily as it disgorges \the [I].") + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - I.forceMove(get_turf(src)) + I.forceMove(drop_location()) + if(user && Adjacent(user) && !issiliconoradminghost(user)) + user.put_in_hands(I) frozen_items -= I + updateUsrDialog() else if(href_list["allitems"]) + playsound(src, "terminal_type", 25, 0) if(!allowed(user)) to_chat(user, "Access Denied.") + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + updateUsrDialog() return if(!allow_items) return if(frozen_items.len == 0) to_chat(user, "There is nothing to recover from storage.") + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) return visible_message("The console beeps happily as it disgorges the desired objects.") + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) for(var/obj/item/I in frozen_items) - I.forceMove(get_turf(src)) + I.forceMove(drop_location()) frozen_items -= I + updateUsrDialog() + else if (href_list["menu"]) + src.menu = text2num(href_list["menu"]) + playsound(src, "terminal_type", 25, 0) + updateUsrDialog() + + ui_interact(usr) updateUsrDialog() return @@ -250,6 +284,19 @@ despawn_occupant() +#define CRYO_DESTROY 0 +#define CRYO_PRESERVE 1 +#define CRYO_OBJECTIVE 2 + +/obj/machinery/cryopod/proc/should_preserve_item(obj/item/I) + for(var/datum/objective_item/steal/T in control_computer.theft_cache) + if(istype(I, T.targetitem) && T.check_special_completion(I)) + return CRYO_OBJECTIVE + for(var/T in preserve_items) + if(istype(I, T) && !(I.type in do_not_preserve_items)) + return CRYO_PRESERVE + return CRYO_DESTROY + // This function can not be undone; do not call this unless you are sure /obj/machinery/cryopod/proc/despawn_occupant() if(!control_computer) @@ -257,6 +304,55 @@ var/mob/living/mob_occupant = occupant + //Handle Borg stuff first + if(iscyborg(mob_occupant)) + var/mob/living/silicon/robot/R = mob_occupant + if(!istype(R)) return ..() + + R.contents -= R.mmi + qdel(R.mmi) + for(var/obj/item/I in R.module) // the tools the borg has; metal, glass, guns etc + for(var/obj/item/O in I) // the things inside the tools, if anything; mainly for janiborg trash bags + if(should_preserve_item(O) != CRYO_DESTROY) // Preserve important things inside the item + continue + O.forceMove(src) + R.module.remove_module(I, TRUE) //delete the module itself so it doesn't transfer over. + + //Drop all items into the pod. + for(var/obj/item/I in mob_occupant) + mob_occupant.doUnEquip(I) + I.forceMove(src) + + if(I.contents.len) //Make sure we catch anything not handled by qdel() on the items. + if(should_preserve_item(I) != CRYO_DESTROY) // Don't remove the contents of things that need preservation + continue + for(var/obj/item/O in I.contents) + if(istype(O, /obj/item/tank)) //Stop eating pockets, you fuck! + continue + O.forceMove(src) + + //Delete all items not on the preservation list. + var/list/items = contents + items -= occupant // Don't delete the occupant + + for(var/obj/item/I in items) + if(istype(I, /obj/item/pda)) + var/obj/item/pda/P = I + QDEL_NULL(P.id) + qdel(P) + continue + + var/preserve = should_preserve_item(I) + if(preserve == CRYO_DESTROY) + qdel(I) + else if(control_computer && control_computer.allow_items) + control_computer.frozen_items += I + if(preserve == CRYO_OBJECTIVE) + control_computer.objective_items += I + I.loc = null + else + I.forceMove(loc) + //Update any existing objectives involving this mob. for(var/datum/objective/O in GLOB.objectives) // We don't want revs to get objectives that aren't for heads of staff. Letting @@ -313,30 +409,6 @@ announcer.announce("CRYOSTORAGE", mob_occupant.real_name, announce_rank, list()) visible_message("\The [src] hums and hisses as it moves [mob_occupant.real_name] into storage.") - - for(var/obj/item/W in mob_occupant.GetAllContents()) - if(W.loc.loc && (( W.loc.loc == loc ) || (W.loc.loc == control_computer))) - continue//means we already moved whatever this thing was in - //I'm a professional, okay - for(var/T in preserve_items) - if(istype(W, T)) - if(control_computer && control_computer.allow_items) - control_computer.frozen_items += W - mob_occupant.transferItemToLoc(W, control_computer, TRUE) - else - mob_occupant.transferItemToLoc(W, loc, TRUE) - - for(var/obj/item/W in mob_occupant.GetAllContents()) - qdel(W)//because we moved all items to preserve away - //and yes, this totally deletes their bodyparts one by one, I just couldn't bother - - if(iscyborg(mob_occupant)) - var/mob/living/silicon/robot/R = occupant - if(!istype(R)) return ..() - - R.contents -= R.mmi - qdel(R.mmi) - // Ghost and delete the mob. if(!mob_occupant.get_ghost(1)) mob_occupant.ghostize(0) // Players who cryo out may not re-enter the round @@ -345,6 +417,10 @@ open_machine() name = initial(name) +#undef CRYO_DESTROY +#undef CRYO_PRESERVE +#undef CRYO_OBJECTIVE + /obj/machinery/cryopod/MouseDrop_T(mob/living/target, mob/user) if(!istype(target) || user.incapacitated() || !target.Adjacent(user) || !Adjacent(user) || !ismob(target) || (!ishuman(user) && !iscyborg(user)) || !istype(user.loc, /turf) || target.buckled) return From 35d33b4f3b49f93916bdc53572b2fbf86f341f04 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Fri, 4 Oct 2019 10:05:08 -0500 Subject: [PATCH 40/47] mob_occupant --- code/game/machinery/cryopod.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 59f7e7779f..e358f10346 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -333,7 +333,7 @@ //Delete all items not on the preservation list. var/list/items = contents - items -= occupant // Don't delete the occupant + items -= mob_occupant // Don't delete the occupant for(var/obj/item/I in items) if(istype(I, /obj/item/pda)) From b2e71817d3a8b88e9bbeff546cf29beaa1a93140 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 6 Oct 2019 23:37:52 -0500 Subject: [PATCH 41/47] Automatic changelog generation for PR #9377 [ci skip] --- html/changelogs/AutoChangeLog-pr-9377.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-9377.yml diff --git a/html/changelogs/AutoChangeLog-pr-9377.yml b/html/changelogs/AutoChangeLog-pr-9377.yml new file mode 100644 index 0000000000..26587eb6c6 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9377.yml @@ -0,0 +1,4 @@ +author: "Fermis" +delete-after: True +changes: + - bugfix: "fixes Janitor grenades." From 6fc2373a58f40323186bc806468f152653b07add Mon Sep 17 00:00:00 2001 From: EmeraldSundisk Date: Mon, 7 Oct 2019 12:59:43 -0700 Subject: [PATCH 42/47] Adds some potted plants. --- _maps/map_files/BoxStation/BoxStation.dmm | 119 +++++++++++++++++++--- 1 file changed, 104 insertions(+), 15 deletions(-) diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 9cd932c6d4..6f35aa286d 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -9471,7 +9471,7 @@ }, /obj/machinery/atmospherics/pipe/simple/supply/hidden, /turf/open/floor/plating, -/area/lawoffice) +/area/maintenance/fore) "avj" = ( /obj/machinery/firealarm{ dir = 8; @@ -17917,6 +17917,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 9 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-20" + }, /turf/open/floor/plasteel, /area/hallway/secondary/entry) "aPu" = ( @@ -21195,6 +21198,11 @@ /obj/effect/turf_decal/stripes/corner{ dir = 2 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-21"; + pixel_x = -3; + pixel_y = 3 + }, /turf/open/floor/plasteel, /area/crew_quarters/locker) "aXu" = ( @@ -21295,6 +21303,9 @@ /obj/effect/turf_decal/stripes/line{ dir = 4 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-05" + }, /turf/open/floor/plasteel, /area/hallway/secondary/exit) "aXI" = ( @@ -21933,6 +21944,9 @@ dir = 1; pixel_y = -24 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-08" + }, /turf/open/floor/wood, /area/library) "aZe" = ( @@ -24557,6 +24571,9 @@ /obj/effect/turf_decal/tile/purple{ dir = 8 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-13" + }, /turf/open/floor/plasteel, /area/hallway/primary/starboard) "bfX" = ( @@ -24603,6 +24620,9 @@ /obj/effect/turf_decal/tile/purple{ dir = 8 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-10" + }, /turf/open/floor/plasteel, /area/hallway/primary/starboard) "bgc" = ( @@ -27271,11 +27291,6 @@ }, /turf/open/floor/plasteel, /area/quartermaster/sorting) -"bml" = ( -/obj/effect/spawner/structure/window/reinforced, -/obj/effect/decal/cleanable/dirt, -/turf/open/floor/plasteel, -/area/quartermaster/office) "bmm" = ( /obj/structure/cable{ icon_state = "1-2" @@ -30320,6 +30335,9 @@ /obj/machinery/atmospherics/pipe/simple/supply/hidden{ dir = 4 }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-16" + }, /turf/open/floor/plasteel/white, /area/science/research) "bti" = ( @@ -39710,6 +39728,7 @@ /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{ dir = 4 }, +/obj/item/twohanded/required/kirbyplants, /turf/open/floor/plasteel/white/side{ dir = 1 }, @@ -57100,6 +57119,18 @@ }, /turf/open/floor/plating, /area/maintenance/port) +"hwu" = ( +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-24" + }, +/turf/open/floor/plasteel, +/area/security/prison) +"hEm" = ( +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-22" + }, +/turf/open/floor/plasteel/white, +/area/medical/medbay/central) "hRa" = ( /obj/structure/table/reinforced, /obj/machinery/light{ @@ -57559,6 +57590,15 @@ }, /turf/open/floor/plasteel, /area/science/circuit) +"qoW" = ( +/obj/effect/turf_decal/stripes/line{ + dir = 10 + }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-18" + }, +/turf/open/floor/plasteel, +/area/hallway/secondary/entry) "quT" = ( /obj/structure/lattice, /obj/structure/grille/broken, @@ -57570,6 +57610,12 @@ }, /turf/open/floor/carpet, /area/crew_quarters/cryopod) +"qQP" = ( +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-14" + }, +/turf/open/floor/plasteel, +/area/hallway/primary/port) "rcD" = ( /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{ dir = 4 @@ -57580,6 +57626,15 @@ /obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden, /turf/open/floor/plasteel, /area/maintenance/disposal/incinerator) +"rjA" = ( +/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{ + dir = 4 + }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-04" + }, +/turf/open/floor/plasteel/white, +/area/medical/medbay/central) "rmX" = ( /obj/structure/table, /obj/item/reagent_containers/food/drinks/beer, @@ -57723,6 +57778,12 @@ icon_state = "wood-broken5" }, /area/maintenance/bar) +"tlO" = ( +/obj/item/twohanded/required/kirbyplants{ + icon_state = "applebush" + }, +/turf/open/floor/plasteel, +/area/hallway/primary/port) "tqg" = ( /obj/machinery/cryopod{ dir = 4 @@ -57879,6 +57940,20 @@ }, /turf/open/floor/plating, /area/maintenance/starboard/aft) +"uZN" = ( +/obj/machinery/light{ + dir = 1 + }, +/obj/effect/turf_decal/tile/blue{ + dir = 4 + }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-03" + }, +/turf/open/floor/plasteel/white/corner{ + dir = 1 + }, +/area/hallway/secondary/entry) "vbD" = ( /obj/machinery/door/firedoor, /obj/machinery/door/airlock/command/glass{ @@ -58053,6 +58128,20 @@ }, /turf/closed/wall/r_wall, /area/maintenance/disposal/incinerator) +"xFY" = ( +/obj/machinery/light{ + dir = 1 + }, +/obj/effect/turf_decal/tile/blue{ + dir = 4 + }, +/obj/item/twohanded/required/kirbyplants{ + icon_state = "plant-06" + }, +/turf/open/floor/plasteel/white/corner{ + dir = 1 + }, +/area/hallway/secondary/entry) "xIa" = ( /obj/structure/table, /obj/effect/spawner/lootdrop/grille_or_trash, @@ -67425,7 +67514,7 @@ apN apN apN apJ -awY +xFY ayk awW aAD @@ -67449,7 +67538,7 @@ aaa aaa aaa arB -awY +uZN ayk awW aAD @@ -70021,7 +70110,7 @@ awW arB awZ aym -azB +qoW awW aaf aaa @@ -79775,7 +79864,7 @@ aKt aLN aMS aOi -aLE +tlO aPK aSl aTH @@ -81083,7 +81172,7 @@ boS bfm bNK bkN -bml +bfm bwe bwe bwd @@ -81831,7 +81920,7 @@ aKA aLN aMS aOz -aLE +qQP aPQ aSa aSr @@ -85383,7 +85472,7 @@ aaG aaK aaP aaX -aat +hwu aat acd acD @@ -94951,7 +95040,7 @@ aYV aYV bet bfH -bhh +hEm bhh bhg bln @@ -97287,7 +97376,7 @@ bCR bqQ bGX bCR -bqQ +rjA bRN bIK bPq From 071c23b101fcd26b75917a9f59a9e86ba43836cd Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 7 Oct 2019 15:20:26 -0500 Subject: [PATCH 43/47] Automatic changelog generation for PR #9434 [ci skip] --- html/changelogs/AutoChangeLog-pr-9434.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-9434.yml diff --git a/html/changelogs/AutoChangeLog-pr-9434.yml b/html/changelogs/AutoChangeLog-pr-9434.yml new file mode 100644 index 0000000000..d6ad25361a --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9434.yml @@ -0,0 +1,5 @@ +author: "EmeraldSundisk" +delete-after: True +changes: + - rscadd: "Adds some potted plants around Box Station" + - bugfix: "The tile mentioned in #9409 should now be radiation-free." From 5777a0a196438e907ea91dd85d45900baa74895a Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 7 Oct 2019 18:20:02 -0500 Subject: [PATCH 44/47] Automatic changelog generation for PR #9384 [ci skip] --- html/changelogs/AutoChangeLog-pr-9384.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-9384.yml diff --git a/html/changelogs/AutoChangeLog-pr-9384.yml b/html/changelogs/AutoChangeLog-pr-9384.yml new file mode 100644 index 0000000000..a941371f1c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9384.yml @@ -0,0 +1,4 @@ +author: "Chayse" +delete-after: True +changes: + - bugfix: "Fixes the Trek Uniform/Suit worn icons" From e60f9534cb82305b95f009b16027568a6a338cd7 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 7 Oct 2019 18:23:26 -0500 Subject: [PATCH 45/47] Automatic changelog generation for PR #9379 [ci skip] --- html/changelogs/AutoChangeLog-pr-9379.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-9379.yml diff --git a/html/changelogs/AutoChangeLog-pr-9379.yml b/html/changelogs/AutoChangeLog-pr-9379.yml new file mode 100644 index 0000000000..05301d3f72 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9379.yml @@ -0,0 +1,4 @@ +author: "Chayse" +delete-after: True +changes: + - tweak: "Medbay doors can now be opened by anyone from the inside without having to press the exit button." From 46d6cf8a17f2411d1b8756825f26d737fdff71bb Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 7 Oct 2019 18:24:40 -0500 Subject: [PATCH 46/47] Automatic changelog generation for PR #9410 [ci skip] --- html/changelogs/AutoChangeLog-pr-9410.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-9410.yml diff --git a/html/changelogs/AutoChangeLog-pr-9410.yml b/html/changelogs/AutoChangeLog-pr-9410.yml new file mode 100644 index 0000000000..910b9f6f2e --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9410.yml @@ -0,0 +1,5 @@ +author: "Poojawa" +delete-after: True +changes: + - bugfix: "cryopod UI isn't complete shit anymore" + - bugfix: "Cryopods purge silicon gear more efficiently now. Same with ghosts." From 1cfcfb8e2e4aa5dd76631e4b24ce3b8e6c3e7278 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Tue, 8 Oct 2019 01:29:21 -0500 Subject: [PATCH 47/47] Automatic changelog generation for PR #9309 [ci skip] --- html/changelogs/AutoChangeLog-pr-9309.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-9309.yml diff --git a/html/changelogs/AutoChangeLog-pr-9309.yml b/html/changelogs/AutoChangeLog-pr-9309.yml new file mode 100644 index 0000000000..b3aef0372b --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9309.yml @@ -0,0 +1,6 @@ +author: "Fermis" +delete-after: True +changes: + - rscadd: "graft synthtissue surgery, new reagent synthtissue" + - tweak: "neurine fixes brain objs +merge: combines fermichem's lung damage with tg's"