From 82cf9ea499030ccde26b86e88fc458d9c7ac7e1b Mon Sep 17 00:00:00 2001 From: ChungusGamer666 <82850673+ChungusGamer666@users.noreply.github.com> Date: Thu, 29 Jun 2023 18:09:55 -0300 Subject: [PATCH] Removes shitty "status" variable on organs, makes them use organ_flags instead (#76350) ## About The Pull Request Title. ## Why It's Good For The Game Seriously this shit pisses me off, why are ORGAN_SYNTHETIC and ORGAN_ROBOTIC two different things? ## Changelog not applicable unless i fucked up --------- Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> --- code/__DEFINES/mobs.dm | 6 --- code/__DEFINES/surgery.dm | 46 +++++++++++------ code/__HELPERS/bodyparts.dm | 1 - code/_globalvars/bitfields.dm | 6 ++- code/datums/components/surgery_initiator.dm | 1 - code/datums/quirks/negative_quirks.dm | 14 +++--- code/game/gamemodes/objective.dm | 2 +- .../game/machinery/dna_infuser/dna_infuser.dm | 2 +- code/game/objects/items/cigs_lighters.dm | 2 +- .../items/devices/scanners/health_analyzer.dm | 6 +-- code/game/objects/items/stacks/medical.dm | 2 +- code/game/objects/items/tools/weldingtool.dm | 2 +- code/game/turfs/open/lava.dm | 2 +- .../antagonists/abductor/equipment/gland.dm | 3 +- .../abductor/equipment/glands/heal.dm | 10 ++-- .../heretic/heretic_living_heart.dm | 2 +- .../heretic/knowledge/starting_lore.dm | 4 +- .../heretic/magic/flesh_surgery.dm | 2 +- .../heretic/structures/mawed_crucible.dm | 2 +- code/modules/library/bibles.dm | 2 +- .../equipment/monster_organs/monster_organ.dm | 2 +- code/modules/mining/lavaland/tendril_loot.dm | 3 +- code/modules/mob/living/brain/brain_item.dm | 6 +-- code/modules/mob/living/carbon/carbon.dm | 2 - .../mob/living/carbon/carbon_defense.dm | 12 +++-- .../modules/mob/living/carbon/damage_procs.dm | 12 ++--- .../mob/living/carbon/human/_species.dm | 2 +- .../mob/living/carbon/human/examine.dm | 6 +-- .../mob/living/carbon/human/human_defense.dm | 7 --- .../carbon/human/species_types/dullahan.dm | 2 +- code/modules/mob/living/carbon/life.dm | 2 +- code/modules/mob/living/damage_procs.dm | 4 +- .../mob/living/silicon/damage_procs.dm | 2 +- code/modules/power/cable.dm | 2 +- code/modules/reagents/chemistry/reagents.dm | 6 +-- .../reagents/cat2_medicine_reagents.dm | 24 ++++----- .../reagents/drinks/alcohol_reagents.dm | 4 +- .../chemistry/reagents/drug_reagents.dm | 32 ++++++------ .../chemistry/reagents/impure_reagents.dm | 6 +-- .../impure_medicine_reagents.dm | 6 +-- .../impure_reagents/impure_toxin_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 20 ++++---- .../reagents/reagent_containers/patch.dm | 2 +- code/modules/religion/religion_sects.dm | 4 +- code/modules/surgery/bodyparts/_bodyparts.dm | 16 +++--- code/modules/surgery/organs/_organ.dm | 50 ++++++++++++------- .../organs/external/_external_organ.dm | 2 +- .../organs/external/wings/functional_wings.dm | 1 + .../organs/internal/_internal_organ.dm | 4 +- .../organs/internal/appendix/_appendix.dm | 7 ++- .../internal/appendix/appendix_golem.dm | 2 +- .../organs/internal/cyberimp/augments_arms.dm | 4 +- .../organs/internal/cyberimp/augments_eyes.dm | 3 +- .../internal/cyberimp/augments_internal.dm | 3 +- .../surgery/organs/internal/ears/_ears.dm | 2 +- .../surgery/organs/internal/eyes/_eyes.dm | 9 ++-- .../surgery/organs/internal/heart/_heart.dm | 6 +-- .../surgery/organs/internal/liver/_liver.dm | 6 +-- .../organs/internal/liver/liver_golem.dm | 2 +- .../organs/internal/liver/liver_plasmaman.dm | 2 +- .../surgery/organs/internal/lungs/_lungs.dm | 4 +- .../organs/internal/stomach/_stomach.dm | 4 +- .../organs/internal/stomach/stomach_golem.dm | 2 +- .../surgery/organs/internal/tongue/_tongue.dm | 7 ++- tgstation.dme | 1 - 65 files changed, 214 insertions(+), 210 deletions(-) delete mode 100644 code/__HELPERS/bodyparts.dm diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index c38f4c98a9c..9863d429bda 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -58,12 +58,6 @@ #define RESPIRATION_OXYGEN (1 << 0) #define RESPIRATION_N2 (1 << 1) #define RESPIRATION_PLASMA (1 << 2) - -//Organ defines for carbon mobs -#define ORGAN_ORGANIC 1 -#define ORGAN_ROBOTIC 2 -#define ORGAN_MINERAL 3 // Used for the plasmaman liver - #define DEFAULT_BODYPART_ICON_ORGANIC 'icons/mob/species/human/bodyparts_greyscale.dmi' #define DEFAULT_BODYPART_ICON_ROBOTIC 'icons/mob/augmentation/augments.dmi' diff --git a/code/__DEFINES/surgery.dm b/code/__DEFINES/surgery.dm index 3a068666090..55dbe8c4499 100644 --- a/code/__DEFINES/surgery.dm +++ b/code/__DEFINES/surgery.dm @@ -1,20 +1,34 @@ +/// Helper to figure out if an organ is organic +#define IS_ORGANIC_ORGAN(organ) (organ.organ_flags & ORGAN_ORGANIC) +/// Helper to figure out if an organ is robotic +#define IS_ROBOTIC_ORGAN(organ) (organ.organ_flags & ORGAN_ROBOTIC) + // Flags for the organ_flags var on /obj/item/organ -///Synthetic organs, or cybernetic organs. Reacts to EMPs and don't deteriorate or heal -#define ORGAN_SYNTHETIC (1<<0) -///Frozen organs, don't deteriorate -#define ORGAN_FROZEN (1<<1) -///Failing organs perform damaging effects until replaced or fixed -#define ORGAN_FAILING (1<<2) -///Currently only the brain -#define ORGAN_VITAL (1<<3) -///is a snack? :D -#define ORGAN_EDIBLE (1<<4) -///Synthetic organ affected by an EMP. Deteriorates over time. -#define ORGAN_SYNTHETIC_EMP (1<<5) -///Can't be removed using surgery -#define ORGAN_UNREMOVABLE (1<<6) +/// Organic organs, the default. Don't get affected by EMPs. +#define ORGAN_ORGANIC (1<<0) +/// Synthetic organs, or cybernetic organs. Reacts to EMPs and don't deteriorate or heal +#define ORGAN_ROBOTIC (1<<1) +/// Mineral organs. Snowflakey. +#define ORGAN_MINERAL (1<<2) +/// Frozen organs, don't deteriorate +#define ORGAN_FROZEN (1<<3) +/// Failing organs perform damaging effects until replaced or fixed, and typically they don't function properly either +#define ORGAN_FAILING (1<<4) +/// Synthetic organ affected by an EMP. Deteriorates over time. +#define ORGAN_EMP (1<<5) +/// Currently only the brain - Removing this organ KILLS the owner +#define ORGAN_VITAL (1<<6) +/// Can be eaten +#define ORGAN_EDIBLE (1<<7) +/// Can't be removed using surgery or other common means +#define ORGAN_UNREMOVABLE (1<<8) /// Can't be seen by scanners, doesn't anger body purists -#define ORGAN_HIDDEN (1<<7) +#define ORGAN_HIDDEN (1<<9) + +/// Helper to figure out if a limb is organic +#define IS_ORGANIC_LIMB(limb) (limb.bodytype & BODYTYPE_ORGANIC) +/// Helper to figure out if a limb is robotic +#define IS_ROBOTIC_LIMB(limb) (limb.bodytype & BODYTYPE_ROBOTIC) // Flags for the bodypart_flags var on /obj/item/bodypart /// Bodypart cannot be dismembered or amputated @@ -46,7 +60,7 @@ /// All head flags, default for most heads #define HEAD_ALL_FEATURES (HEAD_HAIR|HEAD_FACIAL_HAIR|HEAD_LIPS|HEAD_EYESPRITES|HEAD_EYECOLOR|HEAD_EYEHOLES|HEAD_DEBRAIN) -/// When the surgery step fails :( +/// Return value when the surgery step fails :( #define SURGERY_STEP_FAIL -1 // Flags for surgery_flags on surgery datums diff --git a/code/__HELPERS/bodyparts.dm b/code/__HELPERS/bodyparts.dm deleted file mode 100644 index 39df8e37e5f..00000000000 --- a/code/__HELPERS/bodyparts.dm +++ /dev/null @@ -1 +0,0 @@ -#define IS_ORGANIC_LIMB(limb) (limb.bodytype & BODYTYPE_ORGANIC) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 80a0e7cbb77..5668ca879ca 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -419,12 +419,14 @@ DEFINE_BITFIELD(emote_flags, list( )) DEFINE_BITFIELD(organ_flags, list( - "ORGAN_SYNTHETIC" = ORGAN_SYNTHETIC, + "ORGAN_ORGANIC" = ORGAN_ORGANIC, + "ORGAN_ROBOTIC" = ORGAN_ROBOTIC, + "ORGAN_MINERAL" = ORGAN_MINERAL, "ORGAN_FROZEN" = ORGAN_FROZEN, "ORGAN_FAILING" = ORGAN_FAILING, + "ORGAN_EMP" = ORGAN_EMP, "ORGAN_VITAL" = ORGAN_VITAL, "ORGAN_EDIBLE" = ORGAN_EDIBLE, - "ORGAN_SYNTHETIC_EMP" = ORGAN_SYNTHETIC_EMP, "ORGAN_UNREMOVABLE" = ORGAN_UNREMOVABLE, )) diff --git a/code/datums/components/surgery_initiator.dm b/code/datums/components/surgery_initiator.dm index 17c4c23f7d0..74eac4f44c5 100644 --- a/code/datums/components/surgery_initiator.dm +++ b/code/datums/components/surgery_initiator.dm @@ -130,7 +130,6 @@ var/required_tool_type = TOOL_CAUTERY var/obj/item/close_tool = user.get_inactive_held_item() var/is_robotic = the_surgery.requires_bodypart_type == BODYTYPE_ROBOTIC - if(is_robotic) required_tool_type = TOOL_SCREWDRIVER diff --git a/code/datums/quirks/negative_quirks.dm b/code/datums/quirks/negative_quirks.dm index 84ea17064ef..d60085ea782 100644 --- a/code/datums/quirks/negative_quirks.dm +++ b/code/datums/quirks/negative_quirks.dm @@ -916,7 +916,7 @@ quirk_holder.add_mob_memory(/datum/memory/key/quirk_smoker, protagonist = quirk_holder, preferred_brand = initial(drug_container_type.name)) // smoker lungs have 25% less health and healing var/obj/item/organ/internal/lungs/smoker_lungs = quirk_holder.get_organ_slot(ORGAN_SLOT_LUNGS) - if (smoker_lungs && !(smoker_lungs.organ_flags & ORGAN_SYNTHETIC)) // robotic lungs aren't affected + if(smoker_lungs && IS_ORGANIC_ORGAN(smoker_lungs)) // robotic lungs aren't affected smoker_lungs.maxHealth = smoker_lungs.maxHealth * 0.75 smoker_lungs.healing_factor = smoker_lungs.healing_factor * 0.75 @@ -1175,10 +1175,10 @@ if(!istype(owner)) return for(var/obj/item/bodypart/limb as anything in owner.bodyparts) - if(!IS_ORGANIC_LIMB(limb)) + if(IS_ROBOTIC_LIMB(limb)) cybernetics_level++ for(var/obj/item/organ/organ as anything in owner.organs) - if((organ.organ_flags & ORGAN_SYNTHETIC || organ.status == ORGAN_ROBOTIC) && !(organ.organ_flags & ORGAN_HIDDEN)) + if(IS_ROBOTIC_ORGAN(organ) && !(organ.organ_flags & ORGAN_HIDDEN)) cybernetics_level++ update_mood() @@ -1189,25 +1189,25 @@ /datum/quirk/body_purist/proc/on_organ_gain(datum/source, obj/item/organ/new_organ, special) SIGNAL_HANDLER - if((new_organ.organ_flags & ORGAN_SYNTHETIC || new_organ.status == ORGAN_ROBOTIC) && !(new_organ.organ_flags & ORGAN_HIDDEN)) //why the fuck are there 2 of them + if(IS_ROBOTIC_ORGAN(new_organ) && !(new_organ.organ_flags & ORGAN_HIDDEN)) //why the fuck are there 2 of them cybernetics_level++ update_mood() /datum/quirk/body_purist/proc/on_organ_lose(datum/source, obj/item/organ/old_organ, special) SIGNAL_HANDLER - if((old_organ.organ_flags & ORGAN_SYNTHETIC || old_organ.status == ORGAN_ROBOTIC) && !(old_organ.organ_flags & ORGAN_HIDDEN)) + if(IS_ROBOTIC_ORGAN(old_organ) && !(old_organ.organ_flags & ORGAN_HIDDEN)) cybernetics_level-- update_mood() /datum/quirk/body_purist/proc/on_limb_gain(datum/source, obj/item/bodypart/new_limb, special) SIGNAL_HANDLER - if(!IS_ORGANIC_LIMB(new_limb)) + if(IS_ROBOTIC_LIMB(new_limb)) cybernetics_level++ update_mood() /datum/quirk/body_purist/proc/on_limb_lose(datum/source, obj/item/bodypart/old_limb, special) SIGNAL_HANDLER - if(!IS_ORGANIC_LIMB(old_limb)) + if(IS_ROBOTIC_LIMB(old_limb)) cybernetics_level-- update_mood() diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 019ade57089..1963803c438 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -935,7 +935,7 @@ GLOBAL_LIST_EMPTY(possible_items) continue //this is an objective item var/obj/item/organ/wanted = stolen - if(!(wanted.organ_flags & ORGAN_FAILING) && !(wanted.organ_flags & ORGAN_SYNTHETIC)) + if(!(wanted.organ_flags & ORGAN_FAILING) && !IS_ROBOTIC_ORGAN(wanted)) stolen_count++ return stolen_count >= amount diff --git a/code/game/machinery/dna_infuser/dna_infuser.dm b/code/game/machinery/dna_infuser/dna_infuser.dm index 1b8964ad686..ab8ee85f52f 100644 --- a/code/game/machinery/dna_infuser/dna_infuser.dm +++ b/code/game/machinery/dna_infuser/dna_infuser.dm @@ -151,7 +151,7 @@ for(var/obj/item/organ/new_organ as anything in infusing_into.output_organs) var/obj/item/organ/old_organ = target.get_organ_slot(initial(new_organ.slot)) if(old_organ) - if((old_organ.type != new_organ) && (old_organ.status != ORGAN_ROBOTIC)) + if((old_organ.type != new_organ) && !IS_ROBOTIC_ORGAN(old_organ)) continue // Old organ can be mutated! else if(ispath(new_organ, /obj/item/organ/external)) continue // External organ can be grown! diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index c44a04cad07..4abedacc0b6 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -327,7 +327,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM reagents.expose(smoker, INGEST, min(to_smoke / reagents.total_volume, 1)) var/obj/item/organ/internal/lungs/lungs = smoker.get_organ_slot(ORGAN_SLOT_LUNGS) - if(lungs && !(lungs.organ_flags & ORGAN_SYNTHETIC)) + if(lungs && IS_ORGANIC_ORGAN(lungs)) var/smoker_resistance = HAS_TRAIT(smoker, TRAIT_SMOKER) ? 0.5 : 1 smoker.adjustOrganLoss(ORGAN_SLOT_LUNGS, lung_harm*smoker_resistance) if(!reagents.trans_to(smoker, to_smoke, methods = INGEST, ignore_stomach = TRUE)) diff --git a/code/game/objects/items/devices/scanners/health_analyzer.dm b/code/game/objects/items/devices/scanners/health_analyzer.dm index 6be81622eda..cba548c7267 100644 --- a/code/game/objects/items/devices/scanners/health_analyzer.dm +++ b/code/game/objects/items/devices/scanners/health_analyzer.dm @@ -390,9 +390,9 @@ if(iscarbon(target)) var/mob/living/carbon/carbontarget = target var/cyberimp_detect - for(var/obj/item/organ/internal/cyberimp/CI in carbontarget.organs) - if(CI.status == ORGAN_ROBOTIC && !(CI.organ_flags & ORGAN_HIDDEN)) - cyberimp_detect += "[!cyberimp_detect ? "[CI.get_examine_string(user)]" : ", [CI.get_examine_string(user)]"]" + for(var/obj/item/organ/internal/cyberimp/cyberimp in carbontarget.organs) + if(IS_ROBOTIC_ORGAN(cyberimp) && !(cyberimp.organ_flags & ORGAN_HIDDEN)) + cyberimp_detect += "[!cyberimp_detect ? "[cyberimp.get_examine_string(user)]" : ", [cyberimp.get_examine_string(user)]"]" if(cyberimp_detect) render_list += "Detected cybernetic modifications:\n" render_list += "[cyberimp_detect]\n" diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 537aa4f94bc..82c63cdda19 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -88,7 +88,7 @@ patient.balloon_alert(user, "no [parse_zone(user.zone_selected)]!") return FALSE if(!IS_ORGANIC_LIMB(affecting)) //Limb must be organic to be healed - RR - patient.balloon_alert(user, "it's mechanical!") + patient.balloon_alert(user, "it's not organic!") return FALSE if(affecting.brute_dam && brute || affecting.burn_dam && burn) user.visible_message( diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 6c4a41cdb5f..048b1ba9f12 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -140,7 +140,7 @@ var/obj/item/bodypart/affecting = attacked_humanoid.get_bodypart(check_zone(user.zone_selected)) - if(affecting && !IS_ORGANIC_LIMB(affecting) && !user.combat_mode) + if(affecting && IS_ROBOTIC_LIMB(affecting) && !user.combat_mode) if(src.use_tool(attacked_humanoid, user, 0, volume=50, amount=1)) if(user == attacked_humanoid) user.visible_message(span_notice("[user] starts to fix some of the dents on [attacked_humanoid]'s [affecting.name]."), diff --git a/code/game/turfs/open/lava.dm b/code/game/turfs/open/lava.dm index eceee21c816..2df65a74ad4 100644 --- a/code/game/turfs/open/lava.dm +++ b/code/game/turfs/open/lava.dm @@ -388,7 +388,7 @@ for(var/obj/item/bodypart/burn_limb as anything in burn_human.bodyparts) if(IS_ORGANIC_LIMB(burn_limb) && burn_limb.limb_id != SPECIES_PLASMAMAN) //getting every organic, non-plasmaman limb (augments/androids are immune to this) plasma_parts += burn_limb - if(!IS_ORGANIC_LIMB(burn_limb)) + if(IS_ROBOTIC_LIMB(burn_limb)) robo_parts += burn_limb burn_human.adjustToxLoss(15, required_biotype = MOB_ORGANIC) // This is from plasma, so it should obey plasma biotype requirements diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 056e72fc1a0..18a4412113e 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -3,8 +3,7 @@ desc = "A nausea-inducing hunk of twisting flesh and metal." icon = 'icons/obj/abductor.dmi' icon_state = "gland" - status = ORGAN_ROBOTIC - organ_flags = NONE + organ_flags = ORGAN_ROBOTIC // weird? beating = TRUE /// Shows name of the gland as well as a description of what it does upon examination by abductor scientists and observers. var/abductor_hint = "baseline placebo referencer" diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index 8704f049a91..a8e01a45eee 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -22,27 +22,27 @@ return var/obj/item/organ/internal/appendix/appendix = owner.get_organ_slot(ORGAN_SLOT_APPENDIX) - if((!appendix && !HAS_TRAIT(owner, TRAIT_NOHUNGER)) || (appendix && ((appendix.organ_flags & ORGAN_FAILING) || (appendix.organ_flags & ORGAN_SYNTHETIC)))) + if((!appendix && !HAS_TRAIT(owner, TRAIT_NOHUNGER)) || (appendix && ((appendix.organ_flags & ORGAN_FAILING) || IS_ROBOTIC_ORGAN(appendix)))) replace_appendix(appendix) return var/obj/item/organ/internal/liver/liver = owner.get_organ_slot(ORGAN_SLOT_LIVER) - if((!liver && !HAS_TRAIT(owner, TRAIT_LIVERLESS_METABOLISM)) || (liver && ((liver.damage > liver.high_threshold) || (liver.organ_flags & ORGAN_SYNTHETIC)))) + if((!liver && !HAS_TRAIT(owner, TRAIT_LIVERLESS_METABOLISM)) || (liver && ((liver.damage > liver.high_threshold) || IS_ROBOTIC_ORGAN(liver)))) replace_liver(liver) return var/obj/item/organ/internal/lungs/lungs = owner.get_organ_slot(ORGAN_SLOT_LUNGS) - if((!lungs && !HAS_TRAIT(owner, TRAIT_NOBREATH)) || (lungs && ((lungs.damage > lungs.high_threshold) || (lungs.organ_flags & ORGAN_SYNTHETIC)))) + if((!lungs && !HAS_TRAIT(owner, TRAIT_NOBREATH)) || (lungs && ((lungs.damage > lungs.high_threshold) || IS_ROBOTIC_ORGAN(lungs)))) replace_lungs(lungs) return var/obj/item/organ/internal/stomach/stomach = owner.get_organ_slot(ORGAN_SLOT_STOMACH) - if((!stomach && !HAS_TRAIT(owner, TRAIT_NOHUNGER)) || (stomach && ((stomach.damage > stomach.high_threshold) || (stomach.organ_flags & ORGAN_SYNTHETIC)))) + if((!stomach && !HAS_TRAIT(owner, TRAIT_NOHUNGER)) || (stomach && ((stomach.damage > stomach.high_threshold) || IS_ROBOTIC_ORGAN(stomach)))) replace_stomach(stomach) return var/obj/item/organ/internal/eyes/eyes = owner.get_organ_slot(ORGAN_SLOT_EYES) - if(!eyes || (eyes && ((eyes.damage > eyes.low_threshold) || (eyes.organ_flags & ORGAN_SYNTHETIC)))) + if(!eyes || (eyes && ((eyes.damage > eyes.low_threshold) || IS_ROBOTIC_ORGAN(eyes)))) replace_eyes(eyes) return diff --git a/code/modules/antagonists/heretic/heretic_living_heart.dm b/code/modules/antagonists/heretic/heretic_living_heart.dm index 063303c49b6..b50cd44b0d8 100644 --- a/code/modules/antagonists/heretic/heretic_living_heart.dm +++ b/code/modules/antagonists/heretic/heretic_living_heart.dm @@ -55,7 +55,7 @@ /datum/component/living_heart/proc/on_organ_replaced(obj/item/organ/source, obj/item/organ/replacement) SIGNAL_HANDLER - if(replacement.status == ORGAN_ROBOTIC || (replacement.organ_flags & ORGAN_SYNTHETIC)) + if(IS_ROBOTIC_ORGAN(replacement)) qdel(src) return diff --git a/code/modules/antagonists/heretic/knowledge/starting_lore.dm b/code/modules/antagonists/heretic/knowledge/starting_lore.dm index 2e6b8b22772..8f36b866510 100644 --- a/code/modules/antagonists/heretic/knowledge/starting_lore.dm +++ b/code/modules/antagonists/heretic/knowledge/starting_lore.dm @@ -183,9 +183,7 @@ GLOBAL_LIST_INIT(heretic_start_knowledge, initialize_starting_knowledge()) return FALSE if(!new_heart.useable) return FALSE - if(new_heart.status == ORGAN_ROBOTIC) - return FALSE - if(new_heart.organ_flags & (ORGAN_SYNTHETIC|ORGAN_FAILING)) + if(new_heart.organ_flags & (ORGAN_ROBOTIC|ORGAN_FAILING)) return FALSE return TRUE diff --git a/code/modules/antagonists/heretic/magic/flesh_surgery.dm b/code/modules/antagonists/heretic/magic/flesh_surgery.dm index 2a216b08969..0fb0a402da9 100644 --- a/code/modules/antagonists/heretic/magic/flesh_surgery.dm +++ b/code/modules/antagonists/heretic/magic/flesh_surgery.dm @@ -142,7 +142,7 @@ if(deprecise_zone(organ.zone) != zone_to_check) continue // Also, some organs to exclude. Don't remove vital (brains), don't remove synthetics, and don't remove unremovable - if(organ.organ_flags & (ORGAN_SYNTHETIC|ORGAN_VITAL|ORGAN_UNREMOVABLE)) + if(organ.organ_flags & (ORGAN_ROBOTIC|ORGAN_VITAL|ORGAN_UNREMOVABLE)) continue organs_we_can_remove[organ.name] = organ diff --git a/code/modules/antagonists/heretic/structures/mawed_crucible.dm b/code/modules/antagonists/heretic/structures/mawed_crucible.dm index 1b720cd9940..091fe2f827e 100644 --- a/code/modules/antagonists/heretic/structures/mawed_crucible.dm +++ b/code/modules/antagonists/heretic/structures/mawed_crucible.dm @@ -84,7 +84,7 @@ if(isorgan(weapon)) var/obj/item/organ/consumed = weapon - if(consumed.status == ORGAN_ROBOTIC || (consumed.organ_flags & ORGAN_SYNTHETIC)) + if(!IS_ORGANIC_ORGAN(consumed)) balloon_alert(user, "not organic!") return if(consumed.organ_flags & ORGAN_VITAL) // Basically, don't eat organs like brains diff --git a/code/modules/library/bibles.dm b/code/modules/library/bibles.dm index 5a22b95db17..5f4109c6f1c 100644 --- a/code/modules/library/bibles.dm +++ b/code/modules/library/bibles.dm @@ -189,7 +189,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list( var/mob/living/carbon/human/built_in_his_image = blessed for(var/obj/item/bodypart/bodypart as anything in built_in_his_image.bodyparts) if(!IS_ORGANIC_LIMB(bodypart)) - balloon_alert(user, "can't heal metal!") + balloon_alert(user, "can't heal inorganic!") return FALSE var/heal_amt = 10 diff --git a/code/modules/mining/equipment/monster_organs/monster_organ.dm b/code/modules/mining/equipment/monster_organs/monster_organ.dm index 22837383d31..7898abd6dda 100644 --- a/code/modules/mining/equipment/monster_organs/monster_organ.dm +++ b/code/modules/mining/equipment/monster_organs/monster_organ.dm @@ -42,7 +42,7 @@ visual = FALSE item_flags = NOBLUDGEON slot = ORGAN_SLOT_MONSTER_CORE - organ_flags = NONE + organ_flags = ORGAN_ORGANIC force = 0 /// Set to true if this organ has decayed into uselessness. var/inert = FALSE diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index ed636d142f4..4072670a472 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -896,8 +896,7 @@ desc = "An eerie metal shard surrounded by dark energies...of soup drinking. You probably don't think you should have been able to find this." icon = 'icons/obj/lavaland/artefacts.dmi' icon_state = "cursed_katana_organ" - status = ORGAN_ORGANIC - organ_flags = ORGAN_FROZEN|ORGAN_UNREMOVABLE + organ_flags = ORGAN_ORGANIC | ORGAN_FROZEN | ORGAN_UNREMOVABLE items_to_create = list(/obj/item/kitchen/spoon) extend_sound = 'sound/items/unsheath.ogg' retract_sound = 'sound/items/sheath.ogg' diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index ea034fd43d6..769105376f6 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -9,7 +9,7 @@ plane = GAME_PLANE_UPPER zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_BRAIN - organ_flags = ORGAN_VITAL + organ_flags = ORGAN_ORGANIC | ORGAN_VITAL attack_verb_continuous = list("attacks", "slaps", "whacks") attack_verb_simple = list("attack", "slap", "whack") @@ -379,7 +379,7 @@ desc = "This collection of sparkling gems somehow allows a golem to think." icon_state = "adamantine_resonator" color = COLOR_GOLEM_GRAY - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL organ_traits = list(TRAIT_ADVANCEDTOOLUSER, TRAIT_LITERATE, TRAIT_CAN_STRIP, TRAIT_ROCK_METAMORPHIC) ////////////////////////////////////TRAUMAS//////////////////////////////////////// @@ -507,7 +507,7 @@ amount_cured++ return amount_cured -/obj/item/organ/internal/brain/apply_organ_damage(damage_amount, maximum, required_organtype) +/obj/item/organ/internal/brain/apply_organ_damage(damage_amount, maximum = maxHealth, required_organ_flag = NONE) . = ..() if(!owner) return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 20bd4d33969..1625e34051f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -856,8 +856,6 @@ blood_volume += (excess_healing * 2) //1 excess = 10 blood for(var/obj/item/organ/organ as anything in organs) - if(organ.organ_flags & ORGAN_SYNTHETIC) - continue organ.apply_organ_damage(excess_healing * -1) //1 excess = 5 organ damage healed return ..() diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 9a75d5ef17c..cd727952f41 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -375,6 +375,8 @@ return for(var/obj/item/organ/organ as anything in organs) organ.emp_act(severity) + for(var/obj/item/bodypart/bodypart as anything in src.bodyparts) + bodypart.emp_act(severity) ///Adds to the parent by also adding functionality to propagate shocks through pulling and doing some fluff effects. /mob/living/carbon/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) @@ -771,7 +773,7 @@ var/changed_something = FALSE var/obj/item/organ/new_organ = pick(GLOB.bioscrambler_valid_organs) var/obj/item/organ/replaced = get_organ_slot(initial(new_organ.slot)) - if (!(replaced?.organ_flags & ORGAN_SYNTHETIC)) + if (!replaced || !IS_ROBOTIC_ORGAN(replaced)) changed_something = TRUE new_organ = new new_organ() new_organ.replace_into(src) @@ -795,15 +797,15 @@ /// Fill in the lists of things we can bioscramble into people /mob/living/carbon/proc/init_bioscrambler_lists() var/list/body_parts = typesof(/obj/item/bodypart/chest) + typesof(/obj/item/bodypart/head) + subtypesof(/obj/item/bodypart/arm) + subtypesof(/obj/item/bodypart/leg) - for (var/obj/item/bodypart/part as anything in body_parts) - if (!is_type_in_typecache(part, GLOB.bioscrambler_parts_blacklist) && BODYTYPE_CAN_BE_BIOSCRAMBLED(initial(part.bodytype))) + for(var/obj/item/bodypart/part as anything in body_parts) + if(!is_type_in_typecache(part, GLOB.bioscrambler_parts_blacklist) && BODYTYPE_CAN_BE_BIOSCRAMBLED(initial(part.bodytype))) continue body_parts -= part GLOB.bioscrambler_valid_parts = body_parts var/list/organs = subtypesof(/obj/item/organ/internal) + subtypesof(/obj/item/organ/external) - for (var/obj/item/organ/organ_type as anything in organs) - if (!is_type_in_typecache(organ_type, GLOB.bioscrambler_organs_blacklist) && !(initial(organ_type.organ_flags) & ORGAN_SYNTHETIC)) + for(var/obj/item/organ/organ_type as anything in organs) + if(!is_type_in_typecache(organ_type, GLOB.bioscrambler_organs_blacklist) && !(initial(organ_type.organ_flags) & ORGAN_ROBOTIC)) continue organs -= organ_type GLOB.bioscrambler_valid_organs = organs diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index a0f69296229..2c14cc678e7 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -114,13 +114,13 @@ * * slot - organ slot, like [ORGAN_SLOT_HEART] * * amount - damage to be done * * maximum - currently an arbitrarily large number, can be set so as to limit damage - * * required_organtype - targets only a specific organ type if set to ORGAN_ORGANIC or ORGAN_ROBOTIC + * * required_organ_flag - targets only a specific organ type if set to ORGAN_ORGANIC or ORGAN_ROBOTIC */ -/mob/living/carbon/adjustOrganLoss(slot, amount, maximum, required_organtype) +/mob/living/carbon/adjustOrganLoss(slot, amount, maximum = INFINITY, required_organ_flag = NONE) var/obj/item/organ/affected_organ = get_organ_slot(slot) if(!affected_organ || (status_flags & GODMODE)) return - if(required_organtype && (affected_organ.status != required_organtype)) + if(required_organ_flag && !(affected_organ.organ_flags & required_organ_flag)) return affected_organ.apply_organ_damage(amount, maximum) @@ -131,13 +131,13 @@ * Arguments: * * slot - organ slot, like [ORGAN_SLOT_HEART] * * amount - damage to be set to - * * required_organtype - targets only a specific organ type if set to ORGAN_ORGANIC or ORGAN_ROBOTIC + * * required_organ_flag - targets only a specific organ type if set to ORGAN_ORGANIC or ORGAN_ROBOTIC */ -/mob/living/carbon/setOrganLoss(slot, amount, required_organtype) +/mob/living/carbon/setOrganLoss(slot, amount, required_organ_flag = NONE) var/obj/item/organ/affected_organ = get_organ_slot(slot) if(!affected_organ || (status_flags & GODMODE)) return - if(required_organtype && (affected_organ.status != required_organtype)) + if(required_organ_flag && !(affected_organ.organ_flags & required_organ_flag)) return if(affected_organ.damage == amount) return diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index 88eb6f469f3..790aa6bdfea 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -686,7 +686,7 @@ GLOBAL_LIST_EMPTY(features_by_species) if(mutant_bodyparts["ears"]) - if(!source.dna.features["ears"] || source.dna.features["ears"] == "None" || source.head && (source.head.flags_inv & HIDEHAIR) || (source.wear_mask && (source.wear_mask.flags_inv & HIDEHAIR)) || !noggin || !IS_ORGANIC_LIMB(noggin)) + if(!source.dna.features["ears"] || source.dna.features["ears"] == "None" || source.head && (source.head.flags_inv & HIDEHAIR) || (source.wear_mask && (source.wear_mask.flags_inv & HIDEHAIR)) || !noggin || IS_ROBOTIC_LIMB(noggin)) bodyparts_to_add -= "ears" if(!bodyparts_to_add) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 1a2a2ba7e4e..7077dcc199e 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -367,9 +367,9 @@ . += "Rank: [target_record.rank]\n\[Front photo\]\[Side photo\]" if(HAS_TRAIT(user, TRAIT_MEDICAL_HUD)) var/cyberimp_detect - for(var/obj/item/organ/internal/cyberimp/CI in organs) - if(CI.status == ORGAN_ROBOTIC && !(CI.organ_flags & ORGAN_HIDDEN)) - cyberimp_detect += "[!cyberimp_detect ? "[CI.get_examine_string(user)]" : ", [CI.get_examine_string(user)]"]" + for(var/obj/item/organ/internal/cyberimp/cyberimp in organs) + if(IS_ROBOTIC_ORGAN(cyberimp) && !(cyberimp.organ_flags & ORGAN_HIDDEN)) + cyberimp_detect += "[!cyberimp_detect ? "[cyberimp.get_examine_string(user)]" : ", [cyberimp.get_examine_string(user)]"]" if(cyberimp_detect) . += "Detected cybernetic modifications:" . += "[cyberimp_detect]" diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 05a09848087..882bb88afbe 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -513,13 +513,6 @@ to_chat(src, span_notice("You feel your heart beating again!")) electrocution_animation(40) -/mob/living/carbon/human/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_CONTENTS) - return - for(var/obj/item/bodypart/L as anything in src.bodyparts) - L.emp_act() - /mob/living/carbon/human/acid_act(acidpwr, acid_volume, bodyzone_hit) //todo: update this to utilize check_obscured_slots() //and make sure it's check_obscured_slots(TRUE) to stop aciding through visors etc var/list/damaged = list() var/list/inventory_items_to_kill = list() 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 27c84d93200..99241838db0 100644 --- a/code/modules/mob/living/carbon/human/species_types/dullahan.dm +++ b/code/modules/mob/living/carbon/human/species_types/dullahan.dm @@ -159,7 +159,7 @@ /obj/item/organ/internal/brain/dullahan decoy_override = TRUE - organ_flags = NONE + organ_flags = ORGAN_ORGANIC //not vital /obj/item/organ/internal/tongue/dullahan zone = "abstract" diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 23cdbeb61fc..a068c69ba59 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -743,7 +743,7 @@ if(!needs_heart()) return FALSE var/obj/item/organ/internal/heart/heart = get_organ_slot(ORGAN_SLOT_HEART) - if(!heart || (heart.organ_flags & ORGAN_SYNTHETIC)) + if(!heart || IS_ROBOTIC_ORGAN(heart)) return FALSE return TRUE diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index faefa04b61f..f08d45678e9 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -279,10 +279,10 @@ updatehealth() return amount -/mob/living/proc/adjustOrganLoss(slot, amount, maximum, required_organtype) +/mob/living/proc/adjustOrganLoss(slot, amount, maximum, required_organ_flag) return -/mob/living/proc/setOrganLoss(slot, amount, maximum, required_organtype) +/mob/living/proc/setOrganLoss(slot, amount, maximum, required_organ_flag) return /mob/living/proc/get_organ_loss(slot) diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm index 093c3baee73..59db1264a30 100644 --- a/code/modules/mob/living/silicon/damage_procs.dm +++ b/code/modules/mob/living/silicon/damage_procs.dm @@ -33,7 +33,7 @@ /mob/living/silicon/setStaminaLoss(amount, updating_health = TRUE) return FALSE -/mob/living/silicon/adjustOrganLoss(slot, amount, maximum = 500, required_organtype) //immune to organ damage (no organs, duh) +/mob/living/silicon/adjustOrganLoss(slot, amount, maximum = 500, required_organ_flag) //immune to organ damage (no organs, duh) return FALSE /mob/living/silicon/setOrganLoss(slot, amount) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 43fbf44b300..1425fcdf126 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -570,7 +570,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri return ..() var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected)) - if(affecting && !IS_ORGANIC_LIMB(affecting)) + if(affecting && IS_ROBOTIC_LIMB(affecting)) if(user == H) user.visible_message(span_notice("[user] starts to fix some of the wires in [H]'s [affecting.name]."), span_notice("You start fixing some of the wires in [H == user ? "your" : "[H]'s"] [affecting.name].")) if(!do_after(user, 50, H)) diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index ce4e11d9f0d..44cf8b995da 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -80,6 +80,9 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) var/burning_volume = 0.5 ///Assoc list with key type of addiction this reagent feeds, and value amount of addiction points added per unit of reagent metabolzied (which means * REAGENTS_METABOLISM every life()) var/list/addiction_types = null + /// The affected organ_flags, if the reagent damages/heals organ damage of an affected mob. + /// See "Organ defines for carbon mobs" in /code/_DEFINES/surgery.dm + var/affected_organ_flags = ORGAN_ORGANIC /// The affected bodytype, if the reagent damages/heals bodyparts (Brute/Fire) of an affected mob. /// See "Bodytype defines" in /code/_DEFINES/mobs.dm var/affected_bodytype = BODYTYPE_ORGANIC @@ -89,9 +92,6 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) /// The affected respiration type, if the reagent damages/heals oxygen damage of an affected mob. /// See "Mob bio-types flags" in /code/_DEFINES/mobs.dm var/affected_respiration_type = ALL - /// The affected organtype, if the reagent damages/heals organ damage of an affected mob. - /// See "Organ defines for carbon mobs" in /code/_DEFINES/mobs.dm - var/affected_organtype = ORGAN_ORGANIC ///The default reagent container for the reagent, used for icon generation var/obj/item/reagent_containers/default_container = /obj/item/reagent_containers/cup/bottle diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index c512a63b729..3d13194b166 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -100,7 +100,7 @@ chemical_flags = REAGENT_CAN_BE_SYNTHESIZED /datum/reagent/medicine/c2/libital/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.3 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.3 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjustBruteLoss(-3 * REM * normalise_creation_purity() * seconds_per_tick, required_bodytype = affected_bodytype) ..() return TRUE @@ -164,7 +164,7 @@ /datum/reagent/medicine/c2/lenturi/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) affected_mob.adjustFireLoss(-3 * REM * normalise_creation_purity() * seconds_per_tick, required_bodytype = affected_bodytype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_STOMACH, 0.4 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_STOMACH, 0.4 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) ..() return TRUE @@ -180,7 +180,7 @@ /datum/reagent/medicine/c2/aiuri/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) affected_mob.adjustFireLoss(-2 * REM * normalise_creation_purity() * seconds_per_tick, required_bodytype = affected_bodytype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_EYES, 0.25 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_EYES, 0.25 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) ..() return TRUE @@ -331,7 +331,7 @@ //you're yes and... oh no! healypoints = round(healypoints, 0.1) - affected_mob.adjustOrganLoss(ORGAN_SLOT_HEART, healypoints / 5, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_HEART, healypoints / 5, required_organ_flag = affected_organ_flags) ..() return TRUE @@ -352,7 +352,7 @@ if(creation_purity >= 1) //Perfectly pure multivers gives a bonus of 2! medibonus += 1 affected_mob.adjustToxLoss(-0.5 * min(medibonus, 3 * normalise_creation_purity()) * REM * seconds_per_tick, required_biotype = affected_biotype) //not great at healing but if you have nothing else it will work - affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5 * REM * seconds_per_tick, required_organtype = affected_organtype) //kills at 40u + affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) //kills at 40u for(var/r2 in affected_mob.reagents.reagent_list) var/datum/reagent/the_reagent2 = r2 if(the_reagent2 == src) @@ -396,7 +396,7 @@ ..() /datum/reagent/medicine/c2/syriniver/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.8 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.8 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjustToxLoss(-1 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) for(var/datum/reagent/R in affected_mob.reagents.reagent_list) if(issyrinormusc(R)) @@ -407,7 +407,7 @@ . = TRUE /datum/reagent/medicine/c2/syriniver/overdose_process(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 1.5 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 1.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjust_disgust(3 * REM * seconds_per_tick) affected_mob.reagents.add_reagent(/datum/reagent/medicine/c2/musiver, 0.225 * REM * seconds_per_tick) ..() @@ -425,7 +425,7 @@ chemical_flags = REAGENT_CAN_BE_SYNTHESIZED /datum/reagent/medicine/c2/musiver/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.1 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.1 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjustToxLoss(-1 * REM * seconds_per_tick * normalise_creation_purity(), FALSE, required_biotype = affected_biotype) for(var/datum/reagent/R in affected_mob.reagents.reagent_list) if(issyrinormusc(R)) @@ -445,7 +445,7 @@ return ..() /datum/reagent/medicine/c2/musiver/overdose_process(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 1.5 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 1.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjust_disgust(3 * REM * seconds_per_tick) ..() . = TRUE @@ -523,7 +523,7 @@ user.add_traits(subject_traits, type) /datum/reagent/medicine/c2/penthrite/on_mob_life(mob/living/carbon/human/H, seconds_per_tick, times_fired) - H.adjustOrganLoss(ORGAN_SLOT_STOMACH, 0.25 * REM * seconds_per_tick, required_organtype = affected_organtype) + H.adjustOrganLoss(ORGAN_SLOT_STOMACH, 0.25 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) if(H.health <= HEALTH_THRESHOLD_CRIT && H.health > (H.crit_threshold + HEALTH_THRESHOLD_FULLCRIT * (2 * normalise_creation_purity()))) //we cannot save someone below our lowered crit threshold. H.adjustToxLoss(-2 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) @@ -533,7 +533,7 @@ H.losebreath = 0 - H.adjustOrganLoss(ORGAN_SLOT_HEART, max(volume/10, 1) * REM * seconds_per_tick, required_organtype = affected_organtype) // your heart is barely keeping up! + H.adjustOrganLoss(ORGAN_SLOT_HEART, max(volume/10, 1) * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) // your heart is barely keeping up! H.set_jitter_if_lower(rand(0 SECONDS, 4 SECONDS) * REM * seconds_per_tick) H.set_dizzy_if_lower(rand(0 SECONDS, 4 SECONDS) * REM * seconds_per_tick) @@ -557,7 +557,7 @@ /datum/reagent/medicine/c2/penthrite/overdose_process(mob/living/carbon/human/H, seconds_per_tick, times_fired) REMOVE_TRAIT(H, TRAIT_STABLEHEART, type) H.adjustStaminaLoss(10 * REM * seconds_per_tick, required_biotype = affected_biotype) - H.adjustOrganLoss(ORGAN_SLOT_HEART, 10 * REM * seconds_per_tick, required_organtype = affected_organtype) + H.adjustOrganLoss(ORGAN_SLOT_HEART, 10 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) H.set_heartattack(TRUE) diff --git a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm index 234f150f0e7..6186d06b81c 100644 --- a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm @@ -1373,7 +1373,7 @@ /datum/reagent/consumable/ethanol/neurotoxin/on_mob_life(mob/living/carbon/drinker, seconds_per_tick, times_fired) drinker.set_drugginess(100 SECONDS * REM * seconds_per_tick) drinker.adjust_dizzy(4 SECONDS * REM * seconds_per_tick) - drinker.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1 * REM * seconds_per_tick, 150, required_organtype = affected_organtype) + drinker.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1 * REM * seconds_per_tick, 150, required_organ_flag = affected_organ_flags) if(SPT_PROB(10, seconds_per_tick)) drinker.adjustStaminaLoss(10, required_biotype = affected_biotype) drinker.drop_all_held_items() @@ -1384,7 +1384,7 @@ ADD_TRAIT(drinker, paralyzed_limb, type) drinker.adjustStaminaLoss(10, required_biotype = affected_biotype) if(current_cycle > 30) - drinker.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2 * REM * seconds_per_tick, required_organtype = affected_organtype) + drinker.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) if(current_cycle > 50 && SPT_PROB(7.5, seconds_per_tick)) if(!drinker.undergoing_cardiac_arrest() && drinker.can_heartattack()) drinker.set_heartattack(TRUE) diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index b0ae2994137..f9c78ddd5cb 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -125,7 +125,7 @@ ..() /datum/reagent/drug/krokodil/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.25 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.25 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjustToxLoss(0.25 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) ..() . = TRUE @@ -178,7 +178,7 @@ affected_mob.AdjustImmobilized(-40 * REM * seconds_per_tick) affected_mob.adjustStaminaLoss(-2 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) affected_mob.set_jitter_if_lower(4 SECONDS * REM * seconds_per_tick) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1, 4) * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, rand(1, 4) * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) if(SPT_PROB(2.5, seconds_per_tick)) affected_mob.emote(pick("twitch", "shiver")) ..() @@ -195,7 +195,7 @@ affected_mob.drop_all_held_items() ..() affected_mob.adjustToxLoss(1 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, (rand(5, 10) / 10) * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, (rand(5, 10) / 10) * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) . = TRUE /datum/reagent/drug/bath_salts @@ -230,7 +230,7 @@ to_chat(affected_mob, span_notice("[high_message]")) affected_mob.add_mood_event("salted", /datum/mood_event/stimulant_heavy, name) affected_mob.adjustStaminaLoss(-5 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 4 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 4 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjust_hallucinations(10 SECONDS * REM * seconds_per_tick) if(!HAS_TRAIT(affected_mob, TRAIT_IMMOBILIZED) && !ismovable(affected_mob.loc)) step(affected_mob, pick(GLOB.cardinals)) @@ -293,7 +293,7 @@ affected_mob.remove_status_effect(/datum/status_effect/jitter) affected_mob.remove_status_effect(/datum/status_effect/confusion) affected_mob.disgust = 0 - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) ..() . = TRUE @@ -310,7 +310,7 @@ if(3) affected_mob.emote("frown") affected_mob.add_mood_event("happiness_drug", /datum/mood_event/happiness_drug_bad_od) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) ..() . = TRUE @@ -385,7 +385,7 @@ /datum/reagent/drug/maint/powder/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) . = ..() - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.1 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.1 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) // 5x if you want to OD, you can potentially go higher, but good luck managing the brain damage. var/amt = max(round(volume/3, 0.1), 1) affected_mob?.mind?.experience_multiplier_reasons |= type @@ -398,7 +398,7 @@ /datum/reagent/drug/maint/powder/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired) . = ..() - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 6 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 6 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) /datum/reagent/drug/maint/sludge name = "Maintenance Sludge" @@ -451,13 +451,13 @@ affected_mob.AdjustUnconscious(-10 * REM * seconds_per_tick) affected_mob.AdjustParalyzed(-10 * REM * seconds_per_tick) affected_mob.AdjustImmobilized(-10 * REM * seconds_per_tick) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 1.5 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 1.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) /datum/reagent/drug/maint/tar/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired) . = ..() affected_mob.adjustToxLoss(5 * REM * seconds_per_tick, required_biotype = affected_biotype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 3 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 3 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) /datum/reagent/drug/mushroomhallucinogen name = "Mushroom Hallucinogen" @@ -598,7 +598,7 @@ /datum/reagent/drug/blastoff/on_mob_life(mob/living/carbon/dancer, seconds_per_tick, times_fired) . = ..() - dancer.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.3 * REM * seconds_per_tick, required_organtype = affected_organtype) + dancer.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.3 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) dancer.AdjustKnockdown(-20) if(SPT_PROB(BLASTOFF_DANCE_MOVE_CHANCE_PER_UNIT * volume, seconds_per_tick)) @@ -606,7 +606,7 @@ /datum/reagent/drug/blastoff/overdose_process(mob/living/dancer, seconds_per_tick, times_fired) . = ..() - dancer.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.3 * REM * seconds_per_tick, required_organtype = affected_organtype) + dancer.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.3 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) if(SPT_PROB(BLASTOFF_DANCE_MOVE_CHANCE_PER_UNIT * volume, seconds_per_tick)) dancer.emote("spin") @@ -669,7 +669,7 @@ /datum/reagent/drug/saturnx/on_mob_life(mob/living/carbon/invisible_man, seconds_per_tick, times_fired) . = ..() - invisible_man.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.3 * REM * seconds_per_tick, required_organtype = affected_organtype) + invisible_man.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.3 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) /datum/reagent/drug/saturnx/on_mob_metabolize(mob/living/invisible_man) . = ..() @@ -745,7 +745,7 @@ invisible_man.emote("giggle") if(SPT_PROB(5, seconds_per_tick)) invisible_man.emote("laugh") - invisible_man.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.4 * REM * seconds_per_tick, required_organtype = affected_organtype) + invisible_man.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.4 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) /datum/reagent/drug/saturnx/stable name = "Stabilized Saturn-X" @@ -787,7 +787,7 @@ /datum/reagent/drug/kronkaine/on_mob_life(mob/living/carbon/kronkaine_fiend, seconds_per_tick, times_fired) . = ..() kronkaine_fiend.add_mood_event("tweaking", /datum/mood_event/stimulant_medium, name) - kronkaine_fiend.adjustOrganLoss(ORGAN_SLOT_HEART, 0.4 * REM * seconds_per_tick, required_organtype = affected_organtype) + kronkaine_fiend.adjustOrganLoss(ORGAN_SLOT_HEART, 0.4 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) kronkaine_fiend.set_jitter_if_lower(20 SECONDS * REM * seconds_per_tick) kronkaine_fiend.AdjustSleeping(-20 * REM * seconds_per_tick) kronkaine_fiend.adjust_drowsiness(-10 SECONDS * REM * seconds_per_tick) @@ -800,7 +800,7 @@ /datum/reagent/drug/kronkaine/overdose_process(mob/living/kronkaine_fiend, seconds_per_tick, times_fired) . = ..() - kronkaine_fiend.adjustOrganLoss(ORGAN_SLOT_HEART, 1 * REM * seconds_per_tick, required_organtype = affected_organtype) + kronkaine_fiend.adjustOrganLoss(ORGAN_SLOT_HEART, 1 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) kronkaine_fiend.set_jitter_if_lower(20 SECONDS * REM * seconds_per_tick) if(SPT_PROB(10, seconds_per_tick)) to_chat(kronkaine_fiend, span_danger(pick("You feel like your heart is going to explode!", "Your ears are ringing!", "You sweat like a pig!", "You clench your jaw and grind your teeth.", "You feel prickles of pain in your chest."))) diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents.dm index 682ca6f9f0b..d14df37ce96 100644 --- a/code/modules/reagents/chemistry/reagents/impure_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/impure_reagents.dm @@ -15,11 +15,11 @@ var/liver_damage = 0.5 /datum/reagent/impurity/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - var/obj/item/organ/internal/liver/L = affected_mob.get_organ_slot(ORGAN_SLOT_LIVER) - if(!L)//Though, lets be safe + var/obj/item/organ/internal/liver/liver = affected_mob.get_organ_slot(ORGAN_SLOT_LIVER) + if(!liver)//Though, lets be safe affected_mob.adjustToxLoss(1 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype)//Incase of no liver! return ..() - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, liver_damage * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, liver_damage * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) return ..() //Basically just so people don't forget to adjust metabolization_rate diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm index 259393f3b32..9c8a4aa874c 100644 --- a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm @@ -297,7 +297,7 @@ Basically, we fill the time between now and 2s from now with hands based off the /datum/reagent/inverse/hercuri/overdose_process(mob/living/carbon/owner, seconds_per_tick, times_fired) . = ..() - owner.adjustOrganLoss(ORGAN_SLOT_LIVER, 2 * REM * seconds_per_tick, required_organtype = affected_organtype) //Makes it so you can't abuse it with pyroxadone very easily (liver dies from 25u unless it's fully upgraded) + owner.adjustOrganLoss(ORGAN_SLOT_LIVER, 2 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) //Makes it so you can't abuse it with pyroxadone very easily (liver dies from 25u unless it's fully upgraded) var/heating = 10 * creation_purity * REM * seconds_per_tick * TEMPERATURE_DAMAGE_COEFFICIENT owner.adjust_bodytemperature(heating) //hot hot if(ishuman(owner)) @@ -491,7 +491,7 @@ Basically, we fill the time between now and 2s from now with hands based off the //Heals toxins if it's the only thing present - kinda the oposite of multiver! Maybe that's why it's inverse! /datum/reagent/inverse/healing/monover/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) if(length(affected_mob.reagents.reagent_list) > 1) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5 * seconds_per_tick, required_organtype = affected_organtype) //Hey! It's everyone's favourite drawback from multiver! + affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5 * seconds_per_tick, required_organ_flag = affected_organ_flags) //Hey! It's everyone's favourite drawback from multiver! return ..() affected_mob.adjustToxLoss(-2 * REM * creation_purity * seconds_per_tick, FALSE, required_biotype = affected_biotype) ..() @@ -552,7 +552,7 @@ Basically, we fill the time between now and 2s from now with hands based off the for(var/datum/wound/iter_wound as anything in affected_mob.all_wounds) iter_wound.adjust_blood_flow(1-creation_purity) affected_mob.adjustBruteLoss(5 * (1-creation_purity) * seconds_per_tick, required_bodytype = affected_bodytype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_HEART, (1 + (1-creation_purity)) * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_HEART, (1 + (1-creation_purity)) * seconds_per_tick, required_organ_flag = affected_organ_flags) if(affected_mob.health < HEALTH_THRESHOLD_CRIT) affected_mob.add_movespeed_modifier(/datum/movespeed_modifier/reagent/nooartrium) if(affected_mob.health < HEALTH_THRESHOLD_FULLCRIT) diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_toxin_reagents.dm index 12912b80a15..947c83c3166 100644 --- a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_toxin_reagents.dm @@ -30,7 +30,7 @@ /datum/reagent/impurity/methanol/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) var/obj/item/organ/internal/eyes/eyes = affected_mob.get_organ_slot(ORGAN_SLOT_EYES) - eyes?.apply_organ_damage(0.5 * REM * seconds_per_tick, required_organtype = affected_organtype) + eyes?.apply_organ_damage(0.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) return ..() //Chloral Hydrate - Impure Version diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 0323316992a..676a49d59b4 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -720,7 +720,7 @@ var/obj/item/organ/internal/eyes/eyes = affected_mob.get_organ_slot(ORGAN_SLOT_EYES) if(eyes) // Healing eye damage will cure nearsightedness and blindness from ... eye damage - eyes.apply_organ_damage(-2 * REM * seconds_per_tick * normalise_creation_purity(), required_organtype = affected_organtype) + eyes.apply_organ_damage(-2 * REM * seconds_per_tick * normalise_creation_purity(), required_organ_flag = affected_organ_flags) // If our eyes are seriously damaged, we have a probability of causing eye blur while healing depending on purity if(eyes.damaged && SPT_PROB(16 - min(normalized_purity * 6, 12), seconds_per_tick)) // While healing, gives some eye blur @@ -990,7 +990,7 @@ inverse_chem_val = 0.45 /datum/reagent/medicine/mannitol/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2 * REM * seconds_per_tick * normalise_creation_purity(), required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2 * REM * seconds_per_tick * normalise_creation_purity(), required_organ_flag = affected_organ_flags) ..() //Having mannitol in you will pause the brain damage from brain tumor (so it heals an even 2 brain damage instead of 1.8) @@ -1056,7 +1056,7 @@ ..() /datum/reagent/medicine/neurine/on_mob_dead(mob/living/carbon/affected_mob, seconds_per_tick) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1 * REM * seconds_per_tick * normalise_creation_purity(), required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1 * REM * seconds_per_tick * normalise_creation_purity(), required_organ_flag = affected_organ_flags) ..() /datum/reagent/medicine/mutadone @@ -1242,7 +1242,7 @@ affected_mob.adjustToxLoss(-0.5 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) affected_mob.adjustCloneLoss(-0.1 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) affected_mob.adjustStaminaLoss(-0.5 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1 * REM * seconds_per_tick, 150, affected_organtype) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that! + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1 * REM * seconds_per_tick, 150, affected_organ_flags) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that! else affected_mob.adjustBruteLoss(-5 * REM * seconds_per_tick, FALSE, required_bodytype = affected_bodytype) //slow to start, but very quick healing once it gets going affected_mob.adjustFireLoss(-5 * REM * seconds_per_tick, FALSE, required_bodytype = affected_bodytype) @@ -1251,7 +1251,7 @@ affected_mob.adjustCloneLoss(-1 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) affected_mob.adjustStaminaLoss(-3 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) affected_mob.adjust_jitter_up_to(6 SECONDS * REM * seconds_per_tick, 1 MINUTES) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2 * REM * seconds_per_tick, 150, affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2 * REM * seconds_per_tick, 150, affected_organ_flags) if(SPT_PROB(5, seconds_per_tick)) affected_mob.say(return_hippie_line(), forced = /datum/reagent/medicine/earthsblood) affected_mob.adjust_drugginess_up_to(20 SECONDS * REM * seconds_per_tick, 30 SECONDS * REM * seconds_per_tick) @@ -1313,7 +1313,7 @@ affected_mob.adjust_hallucinations(-10 SECONDS * REM * seconds_per_tick) if(SPT_PROB(10, seconds_per_tick)) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1, 50, affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1, 50, affected_organ_flags) affected_mob.adjustStaminaLoss(2.5 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) ..() return TRUE @@ -1543,7 +1543,7 @@ chemical_flags = REAGENT_CAN_BE_SYNTHESIZED /datum/reagent/medicine/silibinin/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, -2 * REM * seconds_per_tick, required_organtype = affected_organtype)//Add a chance to cure liver trauma once implemented. + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, -2 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags)//Add a chance to cure liver trauma once implemented. ..() . = TRUE @@ -1559,7 +1559,7 @@ /datum/reagent/medicine/polypyr/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) //I wanted a collection of small positive effects, this is as hard to obtain as coniine after all. . = ..() - affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, -0.25 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, -0.25 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjustBruteLoss(-0.35 * REM * seconds_per_tick, FALSE, required_bodytype = affected_bodytype) return TRUE @@ -1572,7 +1572,7 @@ exposed_human.update_body_parts() /datum/reagent/medicine/polypyr/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired) - affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.5 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) ..() . = TRUE @@ -1594,7 +1594,7 @@ /datum/reagent/medicine/granibitaluri/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired) . = TRUE - affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.2 * REM * seconds_per_tick, required_organtype = affected_organtype) + affected_mob.adjustOrganLoss(ORGAN_SLOT_LIVER, 0.2 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags) affected_mob.adjustToxLoss(0.2 * REM * seconds_per_tick, FALSE, required_biotype = affected_biotype) //Only really deadly if you eat over 100u ..() diff --git a/code/modules/reagents/reagent_containers/patch.dm b/code/modules/reagents/reagent_containers/patch.dm index 1682395ddb0..9c2b38f1850 100644 --- a/code/modules/reagents/reagent_containers/patch.dm +++ b/code/modules/reagents/reagent_containers/patch.dm @@ -18,7 +18,7 @@ to_chat(user, span_warning("The limb is missing!")) return if(!IS_ORGANIC_LIMB(affecting)) - to_chat(user, span_notice("Medicine won't work on a robotic limb!")) + to_chat(user, span_notice("Medicine won't work on an inorganic limb!")) return ..() diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm index 0095aa973b5..91825ab86dc 100644 --- a/code/modules/religion/religion_sects.dm +++ b/code/modules/religion/religion_sects.dm @@ -98,7 +98,7 @@ return FALSE var/mob/living/carbon/human/blessed = target for(var/obj/item/bodypart/bodypart as anything in blessed.bodyparts) - if(!IS_ORGANIC_LIMB(bodypart)) + if(IS_ROBOTIC_LIMB(bodypart)) to_chat(chap, span_warning("[GLOB.deity] refuses to heal this metallic taint!")) return TRUE @@ -258,7 +258,7 @@ return FALSE var/mob/living/carbon/human/blessed = blessed_living for(var/obj/item/bodypart/robolimb as anything in blessed.bodyparts) - if(!IS_ORGANIC_LIMB(robolimb)) + if(IS_ROBOTIC_LIMB(robolimb)) to_chat(chap, span_warning("[GLOB.deity] refuses to heal this metallic taint!")) return TRUE diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 08f88f8b5c4..bd938a66bfa 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -66,20 +66,16 @@ var/speed_modifier = 0 // Limb disabling variables + ///Whether it is possible for the limb to be disabled whatsoever. TRUE means that it is possible. + var/can_be_disabled = FALSE //Defaults to FALSE, as only human limbs can be disabled, and only the appendages. ///Controls if the limb is disabled. TRUE means it is disabled (similar to being removed, but still present for the sake of targeted interactions). var/bodypart_disabled = FALSE ///Handles limb disabling by damage. If 0 (0%), a limb can't be disabled via damage. If 1 (100%), it is disabled at max limb damage. Anything between is the percentage of damage against maximum limb damage needed to disable the limb. var/disabling_threshold_percentage = 0 - ///Whether it is possible for the limb to be disabled whatsoever. TRUE means that it is possible. - var/can_be_disabled = FALSE //Defaults to FALSE, as only human limbs can be disabled, and only the appendages. - - // Damage state variables + // Damage variables ///A mutiplication of the burn and brute damage that the limb's stored damage contributes to its attached mob's overall wellbeing. var/body_damage_coeff = 1 - ///Used in determining overlays for limb damage states. As the mob receives more burn/brute damage, their limbs update to reflect. - var/brutestate = 0 - var/burnstate = 0 ///The current amount of brute damage the limb has var/brute_dam = 0 ///The current amount of burn damage the limb has @@ -87,6 +83,10 @@ ///The maximum brute OR burn damage a bodypart can take. Once we hit this cap, no more damage of either type! var/max_damage = 0 + //Used in determining overlays for limb damage states. As the mob receives more burn/brute damage, their limbs update to reflect. + var/brutestate = 0 + var/burnstate = 0 + ///Gradually increases while burning when at full damage, destroys the limb when at 100 var/cremation_progress = 0 @@ -1170,7 +1170,7 @@ /obj/item/bodypart/emp_act(severity) . = ..() - if(. & EMP_PROTECT_WIRES || !(bodytype & BODYTYPE_ROBOTIC)) + if(. & EMP_PROTECT_WIRES || !IS_ROBOTIC_LIMB(src)) return FALSE owner.visible_message(span_danger("[owner]'s [src.name] seems to malfunction!")) diff --git a/code/modules/surgery/organs/_organ.dm b/code/modules/surgery/organs/_organ.dm index 6c68ed3d0d5..1cdbc3ba5a9 100644 --- a/code/modules/surgery/organs/_organ.dm +++ b/code/modules/surgery/organs/_organ.dm @@ -4,26 +4,32 @@ icon = 'icons/obj/medical/organs/organs.dmi' w_class = WEIGHT_CLASS_SMALL throwforce = 0 - ///The mob that owns this organ. + /// The mob that owns this organ. var/mob/living/carbon/owner = null - var/status = ORGAN_ORGANIC - ///The body zone this organ is supposed to inhabit. + /// The body zone this organ is supposed to inhabit. var/zone = BODY_ZONE_CHEST - ///The organ slot this organ is supposed to inhabit. This should be unique by type. (Lungs, Appendix, Stomach, etc) + /** + * The organ slot this organ is supposed to inhabit. This should be unique by type. (Lungs, Appendix, Stomach, etc) + * Do NOT add slots with matching names to different zones - it will break the organs_slot list! + */ var/slot - // DO NOT add slots with matching names to different zones - it will break organs_slot list! - var/organ_flags = ORGAN_EDIBLE + /// Random flags that describe this organ + var/organ_flags = ORGAN_ORGANIC | ORGAN_EDIBLE + /// Maximum damage the organ can take, ever. var/maxHealth = STANDARD_ORGAN_THRESHOLD - /// Total damage this organ has sustained - /// Should only ever be modified by apply_organ_damage + /** + * Total damage this organ has sustained. + * Should only ever be modified by apply_organ_damage! + */ var/damage = 0 - ///Healing factor and decay factor function on % of maxhealth, and do not work by applying a static number per tick + /// 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 var/severe_cooldown //cooldown for severe effects, used for synthetic organ emp effects. - ///Organ variables for determining what we alert the owner with when they pass/clear the damage thresholds + + // 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 @@ -32,16 +38,22 @@ var/high_threshold_cleared var/low_threshold_cleared - ///When you take a bite you cant jam it in for surgery anymore. + /// When set to false, this can't be used in surgeries and such - Honestly a terrible variable. var/useable = TRUE + + /// Food reagents if the organ is edible var/list/food_reagents = list(/datum/reagent/consumable/nutriment = 5) - ///The size of the reagent container + /// The size of the reagent container if the organ is edible var/reagent_vol = 10 + /// Time this organ has failed for var/failure_time = 0 - ///Do we effect the appearance of our mob. Used to save time in preference code + /// Do we affect the appearance of our mob. Used to save time in preference code var/visual = TRUE - /// Traits that are given to the holder of the organ. If you want an effect that changes this, don't add directly to this. Use the add_organ_trait() proc + /** + * Traits that are given to the holder of the organ. + * If you want an effect that changes this, don't add directly to this. Use the add_organ_trait() proc. + */ var/list/organ_traits /// Status Effects that are given to the holder of the organ. var/list/organ_effects @@ -201,7 +213,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) . += span_notice("It should be inserted in the [parse_zone(zone)].") if(organ_flags & ORGAN_FAILING) - if(status == ORGAN_ROBOTIC) + if(IS_ROBOTIC_ORGAN(src)) . += span_warning("[src] seems to be broken.") return . += span_warning("[src] has decayed for too long, and has turned a sickly color. It probably won't work without repairs.") @@ -225,12 +237,12 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) 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 "damage_amount", up to a maximum amount, which is by default max damage -/obj/item/organ/proc/apply_organ_damage(damage_amount, maximum = maxHealth, required_organtype) //use for damaging effects +/obj/item/organ/proc/apply_organ_damage(damage_amount, maximum = maxHealth, required_organ_flag = NONE) //use for damaging effects if(!damage_amount) //Micro-optimization. return if(maximum < damage) return - if(required_organtype && (status != required_organtype)) + if(required_organ_flag && !(organ_flags & required_organ_flag)) return damage = clamp(damage + damage_amount, 0, maximum) var/mess = check_damage_thresholds(owner) @@ -245,8 +257,8 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) to_chat(owner, mess) ///SETS an organ's damage to the amount "damage_amount", 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/set_organ_damage(damage_amount, required_organtype) //use mostly for admin heals - apply_organ_damage(damage_amount - damage, required_organtype = required_organtype) +/obj/item/organ/proc/set_organ_damage(damage_amount, required_organ_flag = NONE) //use mostly for admin heals + return apply_organ_damage(damage_amount - damage, required_organ_flag = required_organ_flag) /** check_damage_thresholds * input: mob/organ_owner (a mob, the owner of the organ we call the proc on) diff --git a/code/modules/surgery/organs/external/_external_organ.dm b/code/modules/surgery/organs/external/_external_organ.dm index 5e29cd95009..e682a5098b2 100644 --- a/code/modules/surgery/organs/external/_external_organ.dm +++ b/code/modules/surgery/organs/external/_external_organ.dm @@ -7,7 +7,7 @@ name = "external organ" desc = "An external organ that is too external." - organ_flags = ORGAN_EDIBLE + organ_flags = ORGAN_ORGANIC | ORGAN_EDIBLE visual = TRUE ///The overlay datum that actually draws stuff on the limb diff --git a/code/modules/surgery/organs/external/wings/functional_wings.dm b/code/modules/surgery/organs/external/wings/functional_wings.dm index 0298cecde4c..127bd623a08 100644 --- a/code/modules/surgery/organs/external/wings/functional_wings.dm +++ b/code/modules/surgery/organs/external/wings/functional_wings.dm @@ -174,6 +174,7 @@ /obj/item/organ/external/wings/functional/robotic name = "robotic wings" desc = "Using microscopic hover-engines, or \"microwings,\" as they're known in the trade, these tiny devices are able to lift a few grams at a time. Gathering enough of them, and you can lift impressively large things." + organ_flags = ORGAN_ROBOTIC sprite_accessory_override = /datum/sprite_accessory/wings/robotic ///skeletal wings, which relate to skeletal races. diff --git a/code/modules/surgery/organs/internal/_internal_organ.dm b/code/modules/surgery/organs/internal/_internal_organ.dm index a51ad9dd1fe..0c314237a47 100644 --- a/code/modules/surgery/organs/internal/_internal_organ.dm +++ b/code/modules/surgery/organs/internal/_internal_organ.dm @@ -41,7 +41,7 @@ on_death(seconds_per_tick, times_fired) //Kinda hate doing it like this, but I really don't want to call process directly. /obj/item/organ/internal/on_death(seconds_per_tick, times_fired) //runs decay when outside of a person - if(organ_flags & (ORGAN_SYNTHETIC | ORGAN_FROZEN)) + if(organ_flags & (ORGAN_ROBOTIC | ORGAN_FROZEN)) return apply_organ_damage(decay_factor * maxHealth * seconds_per_tick) @@ -57,7 +57,7 @@ if(failure_time > 0) failure_time-- - if(organ_flags & ORGAN_SYNTHETIC_EMP) //Synthetic organ has been emped, is now failing. + if(organ_flags & ORGAN_EMP) //Synthetic organ has been emped, is now failing. apply_organ_damage(decay_factor * maxHealth * seconds_per_tick) return diff --git a/code/modules/surgery/organs/internal/appendix/_appendix.dm b/code/modules/surgery/organs/internal/appendix/_appendix.dm index 8a0f04be1f2..835d7e62bed 100644 --- a/code/modules/surgery/organs/internal/appendix/_appendix.dm +++ b/code/modules/surgery/organs/internal/appendix/_appendix.dm @@ -28,14 +28,13 @@ return ..() /obj/item/organ/internal/appendix/on_life(seconds_per_tick, times_fired) - ..() - var/mob/living/carbon/organ_owner = owner - if(!organ_owner) + . = ..() + if(!owner) return if(organ_flags & ORGAN_FAILING) // forced to ensure people don't use it to gain tox as slime person - organ_owner.adjustToxLoss(2 * seconds_per_tick, updating_health = TRUE, forced = TRUE) + owner.adjustToxLoss(2 * seconds_per_tick, updating_health = TRUE, forced = TRUE) else if(inflamation_stage) inflamation(seconds_per_tick) else if(SPT_PROB(APPENDICITIS_PROB, seconds_per_tick)) diff --git a/code/modules/surgery/organs/internal/appendix/appendix_golem.dm b/code/modules/surgery/organs/internal/appendix/appendix_golem.dm index eb89112cbd0..03b076b1b2a 100644 --- a/code/modules/surgery/organs/internal/appendix/appendix_golem.dm +++ b/code/modules/surgery/organs/internal/appendix/appendix_golem.dm @@ -4,7 +4,7 @@ desc = "This expanded digestive chamber allows golems to smelt minerals, provided that they are immersed in lava." icon_state = "ethereal_heart" color = COLOR_GOLEM_GRAY - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL /// Action which performs smelting var/datum/action/cooldown/internal_smelting/smelter diff --git a/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm b/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm index 28d67178759..f1c7cce7b03 100644 --- a/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm +++ b/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm @@ -60,7 +60,7 @@ /obj/item/organ/internal/cyberimp/arm/examine(mob/user) . = ..() - if(status == ORGAN_ROBOTIC) + if(IS_ROBOTIC_ORGAN(src)) . += span_info("[src] is assembled in the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm configuration. You can use a screwdriver to reassemble it.") /obj/item/organ/internal/cyberimp/arm/screwdriver_act(mob/living/user, obj/item/screwtool) @@ -98,7 +98,7 @@ /obj/item/organ/internal/cyberimp/arm/emp_act(severity) . = ..() - if(. & EMP_PROTECT_SELF || status == ORGAN_ORGANIC) + if(. & EMP_PROTECT_SELF || !IS_ROBOTIC_ORGAN(src)) return if(prob(15/severity) && owner) to_chat(owner, span_warning("The electromagnetic pulse causes [src] to malfunction!")) diff --git a/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm b/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm index 837b10443f2..352d4237cc0 100644 --- a/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm +++ b/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm @@ -44,7 +44,6 @@ desc = "These cybernetic eye implants will display a security HUD over everything you see." HUD_type = DATA_HUD_SECURITY_ADVANCED HUD_trait = TRAIT_SECURITY_HUD - organ_flags = ALL /obj/item/organ/internal/cyberimp/eyes/hud/diagnostic name = "Diagnostic HUD implant" @@ -54,4 +53,4 @@ /obj/item/organ/internal/cyberimp/eyes/hud/security/syndicate name = "Contraband Security HUD Implant" desc = "A Cybersun Industries brand Security HUD Implant. These illicit cybernetic eye implants will display a security HUD over everything you see." - organ_flags = ORGAN_SYNTHETIC | ORGAN_HIDDEN + organ_flags = ORGAN_ROBOTIC | ORGAN_HIDDEN diff --git a/code/modules/surgery/organs/internal/cyberimp/augments_internal.dm b/code/modules/surgery/organs/internal/cyberimp/augments_internal.dm index 0ae0cbc962a..48f48bf674c 100644 --- a/code/modules/surgery/organs/internal/cyberimp/augments_internal.dm +++ b/code/modules/surgery/organs/internal/cyberimp/augments_internal.dm @@ -3,8 +3,7 @@ name = "cybernetic implant" desc = "A state-of-the-art implant that improves a baseline's functionality." visual = FALSE - status = ORGAN_ROBOTIC - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC var/implant_color = "#FFFFFF" var/implant_overlay diff --git a/code/modules/surgery/organs/internal/ears/_ears.dm b/code/modules/surgery/organs/internal/ears/_ears.dm index 58e20b84f08..a25e761d120 100644 --- a/code/modules/surgery/organs/internal/ears/_ears.dm +++ b/code/modules/surgery/organs/internal/ears/_ears.dm @@ -104,7 +104,7 @@ icon_state = "ears-c" desc = "A basic cybernetic organ designed to mimic the operation of ears." damage_multiplier = 0.9 - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC /obj/item/organ/internal/ears/cybernetic/upgraded name = "upgraded cybernetic ears" diff --git a/code/modules/surgery/organs/internal/eyes/_eyes.dm b/code/modules/surgery/organs/internal/eyes/_eyes.dm index 583781f026e..54972cce2ed 100644 --- a/code/modules/surgery/organs/internal/eyes/_eyes.dm +++ b/code/modules/surgery/organs/internal/eyes/_eyes.dm @@ -151,7 +151,7 @@ eye_color_left = initial(eye_color_left) eye_color_right = initial(eye_color_right) -/obj/item/organ/internal/eyes/apply_organ_damage(damage_amount, maximum, required_organtype) +/obj/item/organ/internal/eyes/apply_organ_damage(damage_amount, maximum = maxHealth, required_organ_flag) . = ..() if(!owner) return @@ -261,7 +261,7 @@ desc = "Golems somehow measure external light levels and detect nearby ore using this sensitive mineral lattice." color = COLOR_GOLEM_GRAY visual = FALSE - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL color_cutoffs = list(10, 15, 5) actions_types = list(/datum/action/cooldown/golem_ore_sight) @@ -284,12 +284,11 @@ name = "robotic eyes" icon_state = "cybernetic_eyeballs" desc = "Your vision is augmented." - status = ORGAN_ROBOTIC - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC /obj/item/organ/internal/eyes/robotic/emp_act(severity) . = ..() - if(!owner || . & EMP_PROTECT_SELF) + if((. & EMP_PROTECT_SELF) || !owner) return if(prob(10 * severity)) return diff --git a/code/modules/surgery/organs/internal/heart/_heart.dm b/code/modules/surgery/organs/internal/heart/_heart.dm index 9e80dc060a5..1dfff58d887 100644 --- a/code/modules/surgery/organs/internal/heart/_heart.dm +++ b/code/modules/surgery/organs/internal/heart/_heart.dm @@ -201,7 +201,7 @@ desc = "A basic electronic device designed to mimic the functions of an organic human heart." icon_state = "heart-c-on" base_icon_state = "heart-c" - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC maxHealth = STANDARD_ORGAN_THRESHOLD*0.75 //This also hits defib timer, so a bit higher than its less important counterparts var/dose_available = FALSE @@ -241,7 +241,7 @@ owner.losebreath += 10 COOLDOWN_START(src, severe_cooldown, 20 SECONDS) if(prob(emp_vulnerability/severity)) //Chance of permanent effects - organ_flags |= ORGAN_SYNTHETIC_EMP //Starts organ faliure - gonna need replacing soon. + organ_flags |= ORGAN_EMP //Starts organ faliure - gonna need replacing soon. Stop() owner.visible_message(span_danger("[owner] clutches at [owner.p_their()] chest as if [owner.p_their()] heart is stopping!"), \ span_userdanger("You feel a terrible pain in your chest, as if your heart has stopped!")) @@ -263,7 +263,7 @@ /obj/item/organ/internal/heart/freedom name = "heart of freedom" desc = "This heart pumps with the passion to give... something freedom." - organ_flags = ORGAN_SYNTHETIC //the power of freedom prevents heart attacks + organ_flags = ORGAN_ROBOTIC //the power of freedom prevents heart attacks /// The cooldown until the next time this heart can give the host an adrenaline boost. COOLDOWN_DECLARE(adrenaline_cooldown) diff --git a/code/modules/surgery/organs/internal/liver/_liver.dm b/code/modules/surgery/organs/internal/liver/_liver.dm index c35a38a6420..fb9f62f7b28 100644 --- a/code/modules/surgery/organs/internal/liver/_liver.dm +++ b/code/modules/surgery/organs/internal/liver/_liver.dm @@ -139,7 +139,7 @@ if(filterToxins && !HAS_TRAIT(owner, TRAIT_TOXINLOVER)) for(var/datum/reagent/toxin/toxin in cached_reagents) - if(status != toxin.affected_organtype) //this particular toxin does not affect this type of organ + if(toxin.affected_organ_flags && !(organ_flags & toxin.affected_organ_flags)) //this particular toxin does not affect this type of organ continue var/amount = round(toxin.volume, CHEMICAL_QUANTISATION_LEVEL) // this is an optimization if(belly) @@ -245,7 +245,7 @@ name = "basic cybernetic liver" desc = "A very basic device designed to mimic the functions of a human liver. Handles toxins slightly worse than an organic liver." icon_state = "liver-c" - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC toxTolerance = 2 liver_resistance = 0.9 * LIVER_DEFAULT_TOX_RESISTANCE // -10% maxHealth = STANDARD_ORGAN_THRESHOLD*0.5 @@ -278,7 +278,7 @@ owner.adjustToxLoss(10) COOLDOWN_START(src, severe_cooldown, 10 SECONDS) if(prob(emp_vulnerability/severity)) //Chance of permanent effects - organ_flags |= ORGAN_SYNTHETIC_EMP //Starts organ faliure - gonna need replacing soon. + organ_flags |= ORGAN_EMP //Starts organ faliure - gonna need replacing soon. #undef HAS_SILENT_TOXIN #undef HAS_NO_TOXIN diff --git a/code/modules/surgery/organs/internal/liver/liver_golem.dm b/code/modules/surgery/organs/internal/liver/liver_golem.dm index 4bcfae5d9d9..1ab3eabcd9c 100644 --- a/code/modules/surgery/organs/internal/liver/liver_golem.dm +++ b/code/modules/surgery/organs/internal/liver/liver_golem.dm @@ -9,7 +9,7 @@ name = "porous rock" desc = "A spongy rock capable of absorbing chemicals." icon_state = "liver-p" - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL color = COLOR_GOLEM_GRAY /obj/item/organ/internal/liver/golem/handle_chemical(mob/living/carbon/organ_owner, datum/reagent/chem, seconds_per_tick, times_fired) diff --git a/code/modules/surgery/organs/internal/liver/liver_plasmaman.dm b/code/modules/surgery/organs/internal/liver/liver_plasmaman.dm index 3365c5ec3fc..0ed71c32445 100644 --- a/code/modules/surgery/organs/internal/liver/liver_plasmaman.dm +++ b/code/modules/surgery/organs/internal/liver/liver_plasmaman.dm @@ -6,7 +6,7 @@ name = "reagent processing crystal" desc = "A large crystal that is somehow capable of metabolizing chemicals, these are found in plasmamen." icon_state = "liver-p" - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL organ_traits = list(TRAIT_PLASMA_LOVER_METABOLISM) /obj/item/organ/internal/liver/bone/plasmaman/handle_chemical(mob/living/carbon/organ_owner, datum/reagent/chem, seconds_per_tick, times_fired) diff --git a/code/modules/surgery/organs/internal/lungs/_lungs.dm b/code/modules/surgery/organs/internal/lungs/_lungs.dm index e46137006bc..7214c7e6764 100644 --- a/code/modules/surgery/organs/internal/lungs/_lungs.dm +++ b/code/modules/surgery/organs/internal/lungs/_lungs.dm @@ -820,7 +820,7 @@ name = "basic cybernetic lungs" desc = "A basic cybernetic version of the lungs found in traditional humanoid entities." icon_state = "lungs-c" - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC maxHealth = STANDARD_ORGAN_THRESHOLD * 0.5 var/emp_vulnerability = 80 //Chance of permanent effects if emp-ed. @@ -855,7 +855,7 @@ owner.losebreath += 20 COOLDOWN_START(src, severe_cooldown, 30 SECONDS) if(prob(emp_vulnerability/severity)) //Chance of permanent effects - organ_flags |= ORGAN_SYNTHETIC_EMP //Starts organ faliure - gonna need replacing soon. + organ_flags |= ORGAN_EMP //Starts organ faliure - gonna need replacing soon. /obj/item/organ/internal/lungs/lavaland diff --git a/code/modules/surgery/organs/internal/stomach/_stomach.dm b/code/modules/surgery/organs/internal/stomach/_stomach.dm index 253cfb3be70..2d2a4681616 100644 --- a/code/modules/surgery/organs/internal/stomach/_stomach.dm +++ b/code/modules/surgery/organs/internal/stomach/_stomach.dm @@ -289,7 +289,7 @@ name = "basic cybernetic stomach" desc = "A basic device designed to mimic the functions of a human stomach" icon_state = "stomach-c" - organ_flags = ORGAN_SYNTHETIC + organ_flags = ORGAN_ROBOTIC maxHealth = STANDARD_ORGAN_THRESHOLD * 0.5 var/emp_vulnerability = 80 //Chance of permanent effects if emp-ed. metabolism_efficiency = 0.035 // not as good at digestion @@ -320,7 +320,7 @@ owner.vomit(stun = FALSE) COOLDOWN_START(src, severe_cooldown, 10 SECONDS) if(prob(emp_vulnerability/severity)) //Chance of permanent effects - organ_flags |= ORGAN_SYNTHETIC_EMP //Starts organ faliure - gonna need replacing soon. + organ_flags |= ORGAN_EMP //Starts organ faliure - gonna need replacing soon. #undef STOMACH_METABOLISM_CONSTANT diff --git a/code/modules/surgery/organs/internal/stomach/stomach_golem.dm b/code/modules/surgery/organs/internal/stomach/stomach_golem.dm index 2649656982b..c03ae073941 100644 --- a/code/modules/surgery/organs/internal/stomach/stomach_golem.dm +++ b/code/modules/surgery/organs/internal/stomach/stomach_golem.dm @@ -3,7 +3,7 @@ icon_state = "stomach-p" desc = "A rocklike organ which grinds and processes nutrition from minerals." color = COLOR_GOLEM_GRAY - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL organ_traits = list(TRAIT_ROCK_EATER) hunger_modifier = 10 // golems burn fuel quickly /// How slow are you when the "hungry" icon appears? diff --git a/code/modules/surgery/organs/internal/tongue/_tongue.dm b/code/modules/surgery/organs/internal/tongue/_tongue.dm index bdc52184cb7..681f82fe6c9 100644 --- a/code/modules/surgery/organs/internal/tongue/_tongue.dm +++ b/code/modules/surgery/organs/internal/tongue/_tongue.dm @@ -143,7 +143,7 @@ ADD_TRAIT(tongue_owner, TRAIT_AGEUSIA, NO_TONGUE_TRAIT) tongue_owner.voice_filter = initial(tongue_owner.voice_filter) -/obj/item/organ/internal/tongue/apply_organ_damage(damage_amount, maximum, required_organtype) +/obj/item/organ/internal/tongue/apply_organ_damage(damage_amount, maximum = maxHealth, required_organ_flag) . = ..() if(!owner) return @@ -467,8 +467,7 @@ GLOBAL_LIST_INIT(english_to_zombie, list()) /obj/item/organ/internal/tongue/robot name = "robotic voicebox" desc = "A voice synthesizer that can interface with organic lifeforms." - status = ORGAN_ROBOTIC - organ_flags = NONE + organ_flags = ORGAN_ROBOTIC icon_state = "tonguerobot" say_mod = "states" attack_verb_continuous = list("beeps", "boops") @@ -575,7 +574,7 @@ GLOBAL_LIST_INIT(english_to_zombie, list()) name = "golem tongue" desc = "This silicate plate doesn't seem particularly mobile, but golems use it to form sounds." color = COLOR_WEBSAFE_DARK_GRAY - status = ORGAN_MINERAL + organ_flags = ORGAN_MINERAL say_mod = "rumbles" sense_of_taste = FALSE liked_foodtypes = STONE diff --git a/tgstation.dme b/tgstation.dme index 77b52837882..abde5e164f8 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -349,7 +349,6 @@ #include "code\__HELPERS\atoms.dm" #include "code\__HELPERS\auxtools.dm" #include "code\__HELPERS\bitflag_lists.dm" -#include "code\__HELPERS\bodyparts.dm" #include "code\__HELPERS\chat.dm" #include "code\__HELPERS\chat_filter.dm" #include "code\__HELPERS\clients.dm"