From e62eb0de0a1ffdb59cfcc5ae1c194e9fa9b5617a Mon Sep 17 00:00:00 2001 From: Helg2 Date: Fri, 26 Jul 2024 15:06:14 +0300 Subject: [PATCH 01/43] hmmmmmmmmm --- code/__DEFINES/mobs.dm | 1 + .../objects/items/reagent_containers/pill.dm | 6 +- code/modules/mob/living/carbon/carbon.dm | 20 ++- .../mob/living/carbon/human/species.dm | 5 +- .../modules/mob/living/carbon/human/zombie.dm | 3 +- .../castes/carrier/abilities_carrier.dm | 2 +- .../mob/living/carbon/xenomorph/embryo.dm | 2 +- code/modules/organs/organ_internal.dm | 40 +++-- code/modules/organs/organ_objects.dm | 169 +++++++++--------- code/modules/reagents/holder.dm | 35 ++-- code/modules/reagents/reagents/medical.dm | 2 +- 11 files changed, 159 insertions(+), 126 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 9a99a003a79..58d232940eb 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -220,6 +220,7 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA #define ORGAN_BRAIN 5 #define ORGAN_EYES 6 #define ORGAN_APPENDIX 7 +#define ORGAN_STOMACH 8 #define ORGAN_HEALTHY 0 #define ORGAN_BRUISED 1 diff --git a/code/game/objects/items/reagent_containers/pill.dm b/code/game/objects/items/reagent_containers/pill.dm index dbc728fd4ff..7a111abcaff 100644 --- a/code/game/objects/items/reagent_containers/pill.dm +++ b/code/game/objects/items/reagent_containers/pill.dm @@ -1,7 +1,3 @@ -//////////////////////////////////////////////////////////////////////////////// -/// Pills. -//////////////////////////////////////////////////////////////////////////////// - /obj/item/reagent_containers/pill name = "pill" icon = 'icons/obj/items/chemistry.dmi' @@ -39,7 +35,7 @@ if(reagents.total_volume) record_reagent_consumption(reagents.total_volume, reagents.reagent_list, user) reagents.reaction(M, INGEST) - reagents.trans_to(M, reagents.total_volume) + reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE) qdel(src) return TRUE diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0f44a80cb1a..6f78049c346 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -72,15 +72,14 @@ return TIMER_COOLDOWN_START(src, COOLDOWN_PUKE, 40 SECONDS) //5 seconds before the actual action plus 35 before the next one. - to_chat(src, "You feel like you are about to throw up!") + to_chat(src, span_warning("You feel like you are about to throw up!")) addtimer(CALLBACK(src, PROC_REF(do_vomit)), 5 SECONDS) - /mob/living/carbon/proc/do_vomit() adjust_stagger(3 SECONDS) add_slowdown(3) - visible_message("[src] throws up!","You throw up!", null, 5) + visible_message(span_warning("[src] throws up!"), span_warning("You throw up!"), null, 5) playsound(loc, 'sound/effects/splat.ogg', 25, TRUE, 7) var/turf/location = loc @@ -90,6 +89,21 @@ adjust_nutrition(-40) adjustToxLoss(-3) +/** + * Expel the reagents you just tried to ingest + * + * When you try to ingest reagents but you do not have a stomach + * you will spew the reagents on the floor. + * + * Vars: + * * bite: /atom the reagents to expel + * * amount: int The amount of reagent + */ +/mob/living/carbon/proc/expel_ingested(atom/bite, amount) + visible_message(span_danger("[src] throws up all over [p_them()]self!"), span_userdanger("You are unable to keep the [bite] down without a stomach!")) + + var/obj/effect/decal/cleanable/vomit/spew = new(get_turf(src)) + bite.reagents.trans_to(spew, amount) /mob/living/carbon/proc/help_shake_act(mob/living/carbon/shaker) if(health < get_crit_threshold()) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 7ab04b5c0d9..96ae902f192 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -107,8 +107,9 @@ "kidneys" = /datum/internal_organ/kidneys, "brain" = /datum/internal_organ/brain, "appendix" = /datum/internal_organ/appendix, - "eyes" = /datum/internal_organ/eyes - ) + "eyes" = /datum/internal_organ/eyes, + "stomach" = /datum/internal_organ/eyes, + ) var/knock_down_reduction = 1 //how much the knocked_down effect is reduced per Life call. var/stun_reduction = 1 //how much the stunned effect is reduced per Life call. diff --git a/code/modules/mob/living/carbon/human/zombie.dm b/code/modules/mob/living/carbon/human/zombie.dm index 871bbe5304e..65d9ae524da 100644 --- a/code/modules/mob/living/carbon/human/zombie.dm +++ b/code/modules/mob/living/carbon/human/zombie.dm @@ -17,7 +17,8 @@ "kidneys" = /datum/internal_organ/kidneys, "brain" = /datum/internal_organ/brain/zombie, "appendix" = /datum/internal_organ/appendix, - "eyes" = /datum/internal_organ/eyes + "eyes" = /datum/internal_organ/eyes, + "stomach" = /datum/internal_organ/eyes, ) ///Sounds made randomly by the zombie var/list/sounds = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg') diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm index 97b685426bd..1105eea5e41 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm @@ -443,7 +443,7 @@ GLOBAL_LIST_INIT(hugger_images_list, list( victim.apply_damage(stamina_dmg, STAMINA) var/datum/internal_organ/O - for(var/i in list("heart", "lungs", "liver")) + for(var/i in list("heart", "lungs", "liver", "stomach")) O = victim.internal_organs_by_name[i] O.take_damage(debuff, TRUE) diff --git a/code/modules/mob/living/carbon/xenomorph/embryo.dm b/code/modules/mob/living/carbon/xenomorph/embryo.dm index a3dae7170e5..4c90b42ea33 100644 --- a/code/modules/mob/living/carbon/xenomorph/embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/embryo.dm @@ -221,7 +221,7 @@ var/mob/living/carbon/human/H = victim H.apply_damage(200, BRUTE, H.get_limb("chest"), updating_health = TRUE) //lethal armor ignoring brute damage var/datum/internal_organ/O - for(var/i in list("heart", "lungs", "liver", "kidneys", "appendix")) //Bruise all torso internal organs + for(var/i in list("heart", "lungs", "liver", "kidneys", "appendix", "stomach")) //Bruise all torso internal organs O = H.internal_organs_by_name[i] if(!H.mind && !H.client) //If we have no client or mind, permadeath time; remove the organs. Mainly for the NPC colonist bodies diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index ea5469ecdb3..ce02232ce1f 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -1,9 +1,3 @@ - -/**************************************************** - INTERNAL ORGANS -****************************************************/ - - /datum/internal_organ var/name = "organ" var/mob/living/carbon/human/owner = null @@ -85,6 +79,17 @@ damage = max(damage - amount, 0) set_organ_status() +/datum/internal_organ/proc/remove(mob/user) + + if(!removed_type) return 0 + + var/obj/item/organ/removed_organ = new removed_type(get_turf(user), src) + + if(istype(removed_organ)) + organ_holder = removed_organ + + return removed_organ + /datum/internal_organ/proc/emp_act(severity) switch(robotic) if(0) @@ -117,7 +122,6 @@ robotic = ORGAN_ROBOT removed_type = robotic_type - /datum/internal_organ/proc/mechassist() //Used to add things like pacemakers, etc robotic = ORGAN_ASSISTED min_bruised_damage = 15 @@ -184,7 +188,6 @@ robotic = ORGAN_ROBOT removed_type = /obj/item/organ/lungs/prosthetic - /datum/internal_organ/liver name = "liver" parent_limb = "chest" @@ -369,20 +372,19 @@ robotic = ORGAN_ROBOT removed_type = /obj/item/organ/eyes/prosthetic - /datum/internal_organ/appendix name = "appendix" parent_limb = "groin" removed_type = /obj/item/organ/appendix organ_id = ORGAN_APPENDIX -/datum/internal_organ/proc/remove(mob/user) - - if(!removed_type) return 0 - - var/obj/item/organ/removed_organ = new removed_type(get_turf(user), src) - - if(istype(removed_organ)) - organ_holder = removed_organ - - return removed_organ +/datum/internal_organ/stomach + name = "stomach" + removed_type = /obj/item/organ/stomach + organ_id = ORGAN_STOMACH + ///This is a reagent user and needs more then the 10u from edible component + var/reagent_vol = 1000 + ///The rate that the stomach will transfer reagents to the body + var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 + ///The reagents we are processing + var/datum/reagents/reagents = null diff --git a/code/modules/organs/organ_objects.dm b/code/modules/organs/organ_objects.dm index 52bb5024d31..9d696893d65 100644 --- a/code/modules/organs/organ_objects.dm +++ b/code/modules/organs/organ_objects.dm @@ -2,21 +2,25 @@ name = "organ" desc = "It looks like it probably just plopped out." icon = 'icons/obj/items/organs.dmi' + icon_state = "appendix" item_icons = list( slot_l_hand_str = 'icons/mob/inhands/items/bodyparts_left.dmi', slot_r_hand_str = 'icons/mob/inhands/items/bodyparts_right.dmi', ) - - icon_state = "appendix" - - max_integrity = 100 // Process() ticks before death. - - var/fresh = 3 // Squirts of blood left in it. - var/dead_icon // Icon used when the organ dies. - var/robotic // Is the limb prosthetic? - var/organ_tag // What slot does it go in? - var/organ_type = /datum/internal_organ // Used to spawn the relevant organ data when produced via a machine or spawn(). - var/datum/internal_organ/organ_data // Stores info when removed. + // Process() ticks before death. + max_integrity = 100 + /// Squirts of blood left in it. + var/fresh = 3 + /// Icon used when the organ dies. + var/dead_icon + /// Is the limb prosthetic? + var/robotic + /// What slot does it go in? + var/organ_tag + /// Used to spawn the relevant organ data when produced via a machine or spawn(). + var/organ_type = /datum/internal_organ + /// Stores info when removed. + var/datum/internal_organ/organ_data /obj/item/organ/attack_self(mob/user as mob) @@ -35,7 +39,6 @@ if(!robotic) START_PROCESSING(SSobj, src) - /obj/item/organ/Destroy() if(!robotic) STOP_PROCESSING(SSobj, src) @@ -66,6 +69,43 @@ if(obj_integrity <= 0) die() +/obj/item/organ/proc/removed(mob/living/target,mob/living/user) + + if(!target || !user) + return + + if(organ_data.vital) + log_combat(user, target, "removed a vital organ ([src])", addition="(INTENT: [uppertext(user.a_intent)])") + target.death() + +/obj/item/organ/proc/replaced(mob/living/target) + return + +/obj/item/organ/proc/bitten(mob/user) + + if(robotic) + return + + to_chat(user, span_notice("You take an experimental bite out of \the [src].")) + var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list + if(B) + var/turf/TU = get_turf(src) + var/list/L = list() + if(B.data["blood_DNA"]) + L = list(B.data["blood_DNA"] = B.data["blood_type"]) + TU.add_blood(L, B.color) + + user.temporarilyRemoveItemFromInventory(src) + var/obj/item/reagent_containers/food/snacks/organ/O = new(get_turf(src)) + O.name = name + O.icon_state = dead_icon ? dead_icon : icon_state + + // Pass over the blood. + reagents.trans_to(O, reagents.total_volume) + + user.put_in_active_hand(O) + qdel(src) + /obj/item/organ/proc/die() name = "dead [initial(name)]" if(dead_icon) icon_state = dead_icon @@ -74,7 +114,6 @@ //TODO: Grey out the icon state. //TODO: Inject an organ with peridaxon to make it alive again. - // Brain is defined in brain_item.dm. /obj/item/organ/heart name = "heart" @@ -106,6 +145,36 @@ organ_type = /datum/internal_organ/eyes var/eye_colour +/obj/item/organ/eyes/removed(mob/living/target,mob/living/user) + + if(!eye_colour) + eye_colour = list(0,0,0) + + ..() //Make sure target is set so we can steal their eye colour for later. + var/mob/living/carbon/human/H = target + if(istype(H)) + eye_colour = list( + H.r_eyes ? H.r_eyes : 0, + H.g_eyes ? H.g_eyes : 0, + H.b_eyes ? H.b_eyes : 0 + ) + + // Leave bloody red pits behind! + H.r_eyes = 128 + H.g_eyes = 0 + H.b_eyes = 0 + H.update_body() + +/obj/item/organ/eyes/replaced(mob/living/target) + + // Apply our eye colour to the target. + var/mob/living/carbon/human/H = target + if(istype(H) && eye_colour) + H.r_eyes = eye_colour[1] + H.g_eyes = eye_colour[2] + H.b_eyes = eye_colour[3] + H.update_body() + /obj/item/organ/liver name = "liver" icon_state = "liver" @@ -137,7 +206,6 @@ icon_state = "kidneys-prosthetic" organ_type = /datum/internal_organ/kidneys/prosthetic - /obj/item/organ/eyes/prosthetic robotic = ORGAN_ROBOT name = "visual prosthesis" @@ -156,71 +224,8 @@ icon_state = "brain-prosthetic" organ_type = /datum/internal_organ/brain/prosthetic - -/obj/item/organ/proc/removed(mob/living/target,mob/living/user) - - if(!target || !user) - return - - if(organ_data.vital) - log_combat(user, target, "removed a vital organ ([src])", addition="(INTENT: [uppertext(user.a_intent)])") - target.death() - -/obj/item/organ/eyes/removed(mob/living/target,mob/living/user) - - if(!eye_colour) - eye_colour = list(0,0,0) - - ..() //Make sure target is set so we can steal their eye colour for later. - var/mob/living/carbon/human/H = target - if(istype(H)) - eye_colour = list( - H.r_eyes ? H.r_eyes : 0, - H.g_eyes ? H.g_eyes : 0, - H.b_eyes ? H.b_eyes : 0 - ) - - // Leave bloody red pits behind! - H.r_eyes = 128 - H.g_eyes = 0 - H.b_eyes = 0 - H.update_body() - -/obj/item/organ/proc/replaced(mob/living/target) - return - -/obj/item/organ/eyes/replaced(mob/living/target) - - // Apply our eye colour to the target. - var/mob/living/carbon/human/H = target - if(istype(H) && eye_colour) - H.r_eyes = eye_colour[1] - H.g_eyes = eye_colour[2] - H.b_eyes = eye_colour[3] - H.update_body() - -/obj/item/organ/proc/bitten(mob/user) - - if(robotic) - return - - to_chat(user, span_notice("You take an experimental bite out of \the [src].")) - var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list - if(B) - var/turf/TU = get_turf(src) - var/list/L = list() - if(B.data["blood_DNA"]) - L = list(B.data["blood_DNA"] = B.data["blood_type"]) - TU.add_blood(L, B.color) - - - user.temporarilyRemoveItemFromInventory(src) - var/obj/item/reagent_containers/food/snacks/organ/O = new(get_turf(src)) - O.name = name - O.icon_state = dead_icon ? dead_icon : icon_state - - // Pass over the blood. - reagents.trans_to(O, reagents.total_volume) - - user.put_in_active_hand(O) - qdel(src) +/obj/item/organ/stomach + name = "stomach" + icon_state = "stomach" + organ_tag = "stomach" + organ_type = /datum/internal_organ/stomach diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index 0d64f8bfc9f..50ad06cf1ec 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -146,29 +146,42 @@ * Transfer some stuff from this holder to a target object * * Arguments: - * * obj/target - Target to attempt transfer to + * * atom/target - Target to attempt transfer to * * amount - amount of reagent volume to transfer * * multiplier - multiplies amount of each reagent by this number * * preserve_data - if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred. * * no_react - passed through to [/datum/reagents/proc/add_reagent] - * * mob/transfered_by - used for logging - * * remove_blacklisted - skips transferring of reagents with can_synth = FALSE - * * method - passed through to [/datum/reagents/proc/react_single] and [/datum/reagent/proc/on_transfer] - * * show_message - passed through to [/datum/reagents/proc/react_single] - * * round_robin - if round_robin=TRUE, so transfer 5 from 15 water, 15 sugar and 15 plasma becomes 10, 15, 15 instead of 13.3333, 13.3333 13.3333. Good if you hate floating point errors - */ -/datum/reagents/proc/trans_to(obj/target, amount = 1, multiplier=1, preserve_data=1, no_react = 0)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred. + * * transfer_to_stomach - does it goes to stomach like from pills and food? + * */ +/datum/reagents/proc/trans_to( +atom/target, +amount = 1, +multiplier = 1, +preserve_data = TRUE, +no_react = FALSE, +transfer_to_stomach = FALSE +) var/list/cached_reagents = reagent_list - if (!target || !total_volume) + if(!target || !total_volume) return - if (amount < 0) + if(amount < 0) return var/datum/reagents/R if(istype(target, /datum/reagents)) R = target else - if(!target.reagents) + if(!transfer_to_stomach && ishuman(target)) + var/mob/living/carbon/human/eater = target + var/datum/internal_organ/stomach/belly = eater.internal_organs_by_name["stomach"] + if(belly.organ_status == ORGAN_BROKEN) + var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) + if(expel_amount > 0 ) + eater.expel_ingested(my_atom, expel_amount) + return + R = belly.reagents + //target_atom = belly + else if(!target.reagents) return R = target.reagents amount = min(min(amount, total_volume), R.maximum_volume-R.total_volume) diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index 0ee878b84b5..da11bc3cec6 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -992,7 +992,7 @@ L.adjustBrainLoss(0.1*effect_str, TRUE) if(prob(15) && ishuman(L)) var/mob/living/carbon/human/H = L - var/affected_organ = pick("heart","lungs","liver","kidneys") + var/affected_organ = pick("heart","lungs","liver","kidneys", "stomach") var/datum/internal_organ/I = H.internal_organs_by_name[affected_organ] I.take_damage(5.5*effect_str) From da02975300a83fcda634a578e50ef143592aa9c9 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Fri, 26 Jul 2024 15:15:47 +0300 Subject: [PATCH 02/43] vomitting --- code/datums/status_effects/debuffs.dm | 8 +++- code/modules/mob/living/carbon/carbon.dm | 41 ------------------ .../living/carbon/human/human_status_procs.dm | 43 +++++++++++++++++-- code/modules/mob/living/carbon/life.dm | 6 +-- .../mob/living/carbon/xenomorph/xenomorph.dm | 3 -- code/modules/mob/living/living.dm | 5 --- code/modules/predator/yautja/chems.dm | 2 +- code/modules/reagents/reagents/drink.dm | 2 +- code/modules/reagents/reagents/medical.dm | 6 +-- 9 files changed, 54 insertions(+), 62 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 67fc9d7b579..c503d57e17b 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -473,15 +473,19 @@ alert_type = /atom/movable/screen/alert/status_effect/irradiated ///Some effects only apply to carbons var/mob/living/carbon/carbon_owner + var/mob/living/carbon/human/human_owner /datum/status_effect/incapacitating/irradiated/on_creation(mob/living/new_owner, set_duration) . = ..() if(.) if(iscarbon(owner)) carbon_owner = owner + if(ishuman(owner)) // I hate my life + human_owner = owner /datum/status_effect/incapacitating/irradiated/Destroy() carbon_owner = null + human_owner = null return ..() /datum/status_effect/incapacitating/irradiated/tick() @@ -494,8 +498,8 @@ living_owner.adjustToxLoss(3) if(prob(15)) living_owner.adjust_Losebreath(5) - if(prob(15)) - living_owner.vomit() + if(human_owner && prob(15)) + human_owner.vomit() if(carbon_owner && prob(15)) var/datum/internal_organ/organ = pick(carbon_owner.internal_organs) if(organ) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6f78049c346..4b064eaf609 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -64,47 +64,6 @@ return shock_damage -/mob/living/carbon/vomit() - if(stat == DEAD) //Corpses don't puke - return - - if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_PUKE)) - return - - TIMER_COOLDOWN_START(src, COOLDOWN_PUKE, 40 SECONDS) //5 seconds before the actual action plus 35 before the next one. - to_chat(src, span_warning("You feel like you are about to throw up!")) - addtimer(CALLBACK(src, PROC_REF(do_vomit)), 5 SECONDS) - -/mob/living/carbon/proc/do_vomit() - adjust_stagger(3 SECONDS) - add_slowdown(3) - - visible_message(span_warning("[src] throws up!"), span_warning("You throw up!"), null, 5) - playsound(loc, 'sound/effects/splat.ogg', 25, TRUE, 7) - - var/turf/location = loc - if (istype(location, /turf)) - location.add_vomit_floor(src, 1) - - adjust_nutrition(-40) - adjustToxLoss(-3) - -/** - * Expel the reagents you just tried to ingest - * - * When you try to ingest reagents but you do not have a stomach - * you will spew the reagents on the floor. - * - * Vars: - * * bite: /atom the reagents to expel - * * amount: int The amount of reagent - */ -/mob/living/carbon/proc/expel_ingested(atom/bite, amount) - visible_message(span_danger("[src] throws up all over [p_them()]self!"), span_userdanger("You are unable to keep the [bite] down without a stomach!")) - - var/obj/effect/decal/cleanable/vomit/spew = new(get_turf(src)) - bite.reagents.trans_to(spew, amount) - /mob/living/carbon/proc/help_shake_act(mob/living/carbon/shaker) if(health < get_crit_threshold()) return diff --git a/code/modules/mob/living/carbon/human/human_status_procs.dm b/code/modules/mob/living/carbon/human/human_status_procs.dm index ac8f9e795be..c5eb8437e91 100644 --- a/code/modules/mob/living/carbon/human/human_status_procs.dm +++ b/code/modules/mob/living/carbon/human/human_status_procs.dm @@ -58,18 +58,55 @@ if(!(species.species_flags & NO_BREATHE) || forced) return ..() -/mob/living/carbon/human/vomit() +/mob/living/carbon/human/proc/vomit() if(isspeciessynthetic(src)) return //Machines don't throw up. - return ..() + if(stat == DEAD) //Corpses don't puke + return + + if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_PUKE)) + return + + TIMER_COOLDOWN_START(src, COOLDOWN_PUKE, 40 SECONDS) //5 seconds before the actual action plus 35 before the next one. + to_chat(src, span_warning("You feel like you are about to throw up!")) + addtimer(CALLBACK(src, PROC_REF(do_vomit)), 5 SECONDS) + +/mob/living/carbon/human/proc/do_vomit() + adjust_stagger(3 SECONDS) + add_slowdown(3) + + visible_message(span_warning("[src] throws up!"), span_warning("You throw up!"), null, 5) + playsound(loc, 'sound/effects/splat.ogg', 25, TRUE, 7) + + var/turf/location = loc + if(istype(location, /turf)) + location.add_vomit_floor(src, 1) + + adjust_nutrition(-40) + adjustToxLoss(-3) + +/** + * Expel the reagents you just tried to ingest + * + * When you try to ingest reagents but you do not have a stomach + * you will spew the reagents on the floor. + * + * Vars: + * * bite: /atom the reagents to expel + * * amount: int The amount of reagent + */ +/mob/living/carbon/proc/expel_ingested(atom/bite, amount) + visible_message(span_danger("[src] throws up all over [p_them()]self!"), span_userdanger("You are unable to keep the [bite] down without a stomach!")) + + var/obj/effect/decal/cleanable/vomit/spew = new(get_turf(src)) + bite.reagents.trans_to(spew, amount) /mob/living/carbon/human/adjust_ear_damage(damage = 0, deaf = 0) if(isspeciessynthetic(src)) return return ..() - /mob/living/carbon/human/set_ear_damage(damage = 0, deaf = 0) if(isspeciessynthetic(src)) return diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 2c363c84446..51893ac6cda 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -94,8 +94,6 @@ if(hallucination >= 20) // hallucinations require stacking before triggering handle_hallucinations() - - if(staminaloss > -max_stamina) handle_staminaloss() @@ -127,7 +125,9 @@ if(drunkenness >= 51) if(prob(5)) AdjustConfused(10 SECONDS) - vomit() + if(ishuman(src)) + var/mob/living/carbon/human/human = src + human.vomit() if(dizziness < 600) dizzy(12) diff --git a/code/modules/mob/living/carbon/xenomorph/xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/xenomorph.dm index fa3e776d6d4..1dadd9a23cc 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenomorph.dm @@ -366,9 +366,6 @@ /mob/living/carbon/xenomorph/get_eye_protection() return 2 -/mob/living/carbon/xenomorph/vomit() - return - /mob/living/carbon/xenomorph/reagent_check(datum/reagent/R) //For the time being they can't metabolize chemicals. return TRUE diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 6dc669f9175..b57dacbaf8f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -616,11 +616,6 @@ below 100 is not dizzy var/datum/action/A = X A.update_button_icon() - -/mob/living/proc/vomit() - return - - /mob/living/proc/take_over(mob/M, bypass) if(!M.mind) to_chat(M, span_warning("You don't have a mind.")) diff --git a/code/modules/predator/yautja/chems.dm b/code/modules/predator/yautja/chems.dm index 5143326824e..2b9ec502484 100644 --- a/code/modules/predator/yautja/chems.dm +++ b/code/modules/predator/yautja/chems.dm @@ -17,7 +17,7 @@ to_chat(L, span_userdanger("Something feels off!")) L.AdjustParalyzed(20) -/datum/reagent/thwei/on_mob_life(mob/living/L, metabolism) +/datum/reagent/thwei/on_mob_life(mob/living/carbon/human/L, metabolism) . = ..() if(isyautja(L)) L.blood_volume += 3 diff --git a/code/modules/reagents/reagents/drink.dm b/code/modules/reagents/reagents/drink.dm index b61028aebbd..cbb4637e029 100644 --- a/code/modules/reagents/reagents/drink.dm +++ b/code/modules/reagents/reagents/drink.dm @@ -507,7 +507,7 @@ adj_dizzy = 6 taste_description = "your brains smashed out by a lemon wrapped around a gold brick" -/datum/reagent/consumable/drink/gargle_blaster/on_mob_life(mob/living/L, metabolism) +/datum/reagent/consumable/drink/gargle_blaster/on_mob_life(mob/living/carbon/human/L, metabolism) switch(current_cycle) if(15 to 45) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/slurring/drunk) diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index da11bc3cec6..26a55df77b4 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -1196,19 +1196,19 @@ taste_description = "punishment" taste_multi = 8 -/datum/reagent/hypervene/on_mob_life(mob/living/L, metabolism) +/datum/reagent/hypervene/on_mob_life(mob/living/carbon/human/L, metabolism) L.reagent_shock_modifier -= PAIN_REDUCTION_HEAVY //Significant pain while metabolized. if(prob(5)) //causes vomiting L.vomit() return ..() -/datum/reagent/hypervene/overdose_process(mob/living/L, metabolism) +/datum/reagent/hypervene/overdose_process(mob/living/carbon/human/L, metabolism) L.apply_damages(effect_str, effect_str) if(prob(10)) //heavy vomiting L.vomit() L.reagent_shock_modifier -= PAIN_REDUCTION_VERY_HEAVY * 1.25//Massive pain. -/datum/reagent/hypervene/overdose_crit_process(mob/living/L, metabolism) +/datum/reagent/hypervene/overdose_crit_process(mob/living/carbon/human/L, metabolism) L.apply_damages(2*effect_str, 2*effect_str) if(prob(50)) //violent vomiting L.vomit() From 1aa8d01cff3e081cafb858398d5bc88615a743fe Mon Sep 17 00:00:00 2001 From: Helg2 Date: Fri, 26 Jul 2024 17:23:49 +0300 Subject: [PATCH 03/43] Update organ_internal.dm --- code/modules/organs/organ_internal.dm | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index ce02232ce1f..25ce3a45c27 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -205,7 +205,7 @@ //High toxins levels are dangerous if you aren't actively treating them. 100 seconds to hit bruised from this alone if(owner.getToxLoss() >= (80 - 20 * organ_status)) //Healthy liver suffers on its own - if (organ_status != ORGAN_BROKEN) + if(organ_status != ORGAN_BROKEN) take_damage(0.2, TRUE) //Damaged one shares the fun else @@ -322,7 +322,6 @@ robotic = ORGAN_ROBOT removed_type = /obj/item/organ/kidneys - /datum/internal_organ/brain name = "brain" parent_limb = "head" @@ -388,3 +387,34 @@ var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 ///The reagents we are processing var/datum/reagents/reagents = null + +/datum/internal_organ/stomach/process() + ..() + + var/mob/living/carbon/human/body = owner + + // digest food, send all reagents that can be metabolized to the body + for(var/datum/reagent/bit AS in reagents?.reagent_list) + //Do not transfer over more then we have + var/amount_max = bit.volume + + // Transfer the amount of reagents based on volume with a min amount of 1u + var/rate_minimum = max(bit.custom_metabolism, 0.25) + var/amount = min((round(metabolism_efficiency * amount_max, 0.05) + rate_minimum), amount_max) + + if(amount <= 0) + continue + + // transfer the reagents over to the body at the rate of the stomach metabolim + // this way the body is where all reagents that are processed and react + // the stomach manages how fast they are feed in a drip style + reagents.trans_to(body, amount) + + //If the stomach is not damage exit out + if(damage < min_bruised_damage) + return + + if(prob(0.0125 * damage) || damage > min_broken_damage && prob(0.05 * damage)) + body.vomit() + to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down all that food!")) + return From 0842600cf2d1f32584783456cdb25e7fe856e0e7 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Fri, 26 Jul 2024 17:43:06 +0300 Subject: [PATCH 04/43] hmm --- code/game/objects/items/reagent_containers/food/drinks.dm | 4 ++-- code/game/objects/items/reagent_containers/food/snacks.dm | 6 +++--- code/game/objects/items/reagent_containers/pill.dm | 4 ++-- code/game/objects/items/tools/kitchen_tools.dm | 2 +- code/game/objects/machinery/portable_reagent_tank.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 2 +- code/modules/mob/living/carbon/human/zombie.dm | 2 +- code/modules/reagents/holder.dm | 2 +- code/modules/reagents/reagents/medical.dm | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/code/game/objects/items/reagent_containers/food/drinks.dm b/code/game/objects/items/reagent_containers/food/drinks.dm index 8c9965b70f5..7cc4de2153d 100644 --- a/code/game/objects/items/reagent_containers/food/drinks.dm +++ b/code/game/objects/items/reagent_containers/food/drinks.dm @@ -36,7 +36,7 @@ record_reagent_consumption(min(gulp_size, reagents.total_volume), reagents.reagent_list, user) if(reagents.total_volume) reagents.reaction(M, INGEST) - reagents.trans_to(M, gulp_size) + reagents.trans_to(M, gulp_size, transfer_to_stomach = TRUE) playsound(M.loc,'sound/items/drink.ogg', 15, 1) return TRUE else @@ -56,7 +56,7 @@ if(reagents.total_volume) reagents.reaction(M, INGEST) - reagents.trans_to(M, gulp_size) + reagents.trans_to(M, gulp_size, transfer_to_stomach = TRUE) playsound(M.loc,'sound/items/drink.ogg', 15, 1) return TRUE diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index a874b400d33..83fa6fc4d2a 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -113,10 +113,10 @@ */ //Why is bitesize used instead of an actual portion??? record_reagent_consumption(bitesize, reagents.reagent_list, user, M) - reagents.trans_to(M, bitesize) + reagents.trans_to(M, bitesize, transfer_to_stomach = TRUE) else record_reagent_consumption(reagents.total_volume, reagents.reagent_list, user, M) - reagents.trans_to(M, reagents.total_volume) + reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE) bitecount++ On_Consume(M) return TRUE @@ -1555,7 +1555,7 @@ /obj/item/reagent_containers/food/snacks/lollipop/proc/handle_reagents() var/fraction = min(FOOD_METABOLISM/reagents.total_volume, 1) reagents.reaction(owner, INGEST, fraction) - if(!reagents.trans_to(owner, FOOD_METABOLISM)) + if(!reagents.trans_to(owner, FOOD_METABOLISM, transfer_to_stomach = TRUE)) reagents.remove_any(FOOD_METABOLISM) /obj/item/reagent_containers/food/snacks/lollipop/process() diff --git a/code/game/objects/items/reagent_containers/pill.dm b/code/game/objects/items/reagent_containers/pill.dm index 7a111abcaff..089c0bcca32 100644 --- a/code/game/objects/items/reagent_containers/pill.dm +++ b/code/game/objects/items/reagent_containers/pill.dm @@ -64,7 +64,7 @@ if(reagents.total_volume) record_reagent_consumption(reagents.total_volume, reagents.reagent_list, user, M) reagents.reaction(M, INGEST) - reagents.trans_to(M, reagents.total_volume) + reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE) qdel(src) else qdel(src) @@ -103,7 +103,7 @@ log_combat(user, target, "spiked", src, "Reagents: [rgt_list_text]") reagents.trans_to(target, reagents.total_volume) - visible_message("[user] puts something in \the [target].", null, null, 2) + visible_message(span_warning("[user] puts something in \the [target]."), null, null, 2) QDEL_IN(src, 5) diff --git a/code/game/objects/items/tools/kitchen_tools.dm b/code/game/objects/items/tools/kitchen_tools.dm index 9103ee1baff..edd3bc06f0b 100644 --- a/code/game/objects/items/tools/kitchen_tools.dm +++ b/code/game/objects/items/tools/kitchen_tools.dm @@ -35,7 +35,7 @@ if (reagents.total_volume > 0) reagents.reaction(M, INGEST) - reagents.trans_to(M, reagents.total_volume) + reagents.trans_to(M, reagents.total_volume, transfer_to_stomach = TRUE) if(M == user) visible_message(span_notice("[user] eats some [loaded] from \the [src].")) M.reagents.add_reagent(/datum/reagent/consumable/nutriment, 1) diff --git a/code/game/objects/machinery/portable_reagent_tank.dm b/code/game/objects/machinery/portable_reagent_tank.dm index 34a417e7dc7..2d3eb64a1e3 100644 --- a/code/game/objects/machinery/portable_reagent_tank.dm +++ b/code/game/objects/machinery/portable_reagent_tank.dm @@ -87,7 +87,7 @@ record_sippies(5, reagents.reagent_list, user) playsound(user.loc,'sound/items/drink.ogg', 25, 2) reagents.reaction(user, INGEST) - reagents.trans_to(user, 5) + reagents.trans_to(user, 5, transfer_to_stomach = TRUE) return TRUE balloon_alert(user, "It's empty!") diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 96ae902f192..fdb86741d31 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -108,7 +108,7 @@ "brain" = /datum/internal_organ/brain, "appendix" = /datum/internal_organ/appendix, "eyes" = /datum/internal_organ/eyes, - "stomach" = /datum/internal_organ/eyes, + "stomach" = /datum/internal_organ/stomach, ) var/knock_down_reduction = 1 //how much the knocked_down effect is reduced per Life call. diff --git a/code/modules/mob/living/carbon/human/zombie.dm b/code/modules/mob/living/carbon/human/zombie.dm index 65d9ae524da..3a0be5319c9 100644 --- a/code/modules/mob/living/carbon/human/zombie.dm +++ b/code/modules/mob/living/carbon/human/zombie.dm @@ -18,7 +18,7 @@ "brain" = /datum/internal_organ/brain/zombie, "appendix" = /datum/internal_organ/appendix, "eyes" = /datum/internal_organ/eyes, - "stomach" = /datum/internal_organ/eyes, + "stomach" = /datum/internal_organ/stomach, ) ///Sounds made randomly by the zombie var/list/sounds = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg') diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index 50ad06cf1ec..b4f164e538e 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -171,7 +171,7 @@ transfer_to_stomach = FALSE if(istype(target, /datum/reagents)) R = target else - if(!transfer_to_stomach && ishuman(target)) + if(transfer_to_stomach && ishuman(target)) var/mob/living/carbon/human/eater = target var/datum/internal_organ/stomach/belly = eater.internal_organs_by_name["stomach"] if(belly.organ_status == ORGAN_BROKEN) diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index 26a55df77b4..ebff1b20717 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -992,7 +992,7 @@ L.adjustBrainLoss(0.1*effect_str, TRUE) if(prob(15) && ishuman(L)) var/mob/living/carbon/human/H = L - var/affected_organ = pick("heart","lungs","liver","kidneys", "stomach") + var/affected_organ = pick("heart", "lungs", "liver", "kidneys", "stomach") var/datum/internal_organ/I = H.internal_organs_by_name[affected_organ] I.take_damage(5.5*effect_str) From a0c81ff1f5b76e8010c3a25b3da63a02122287d0 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Fri, 26 Jul 2024 17:46:16 +0300 Subject: [PATCH 05/43] Update condiment.dm --- code/game/objects/items/reagent_containers/food/condiment.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/reagent_containers/food/condiment.dm b/code/game/objects/items/reagent_containers/food/condiment.dm index 2d39a4e761f..b849b04284f 100644 --- a/code/game/objects/items/reagent_containers/food/condiment.dm +++ b/code/game/objects/items/reagent_containers/food/condiment.dm @@ -50,7 +50,7 @@ if(reagents.total_volume) record_reagent_consumption(min(10, reagents.total_volume), reagents.reagent_list, user, M) reagents.reaction(M, INGEST) - reagents.trans_to(M, 10) + reagents.trans_to(M, 10, transfer_to_stomach = TRUE) playsound(M.loc,'sound/items/drink.ogg', 15, 1) return 1 return 0 From ad51e51c5fe8fbeaa2f86b965ae94d6240478367 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Fri, 26 Jul 2024 18:00:59 +0300 Subject: [PATCH 06/43] hmm --- .../living/carbon/human/human_status_procs.dm | 16 ---------------- code/modules/mob/living/carbon/human/species.dm | 2 +- code/modules/mob/living/carbon/human/zombie.dm | 2 +- code/modules/reagents/holder.dm | 2 +- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_status_procs.dm b/code/modules/mob/living/carbon/human/human_status_procs.dm index c5eb8437e91..2e38f3d01c3 100644 --- a/code/modules/mob/living/carbon/human/human_status_procs.dm +++ b/code/modules/mob/living/carbon/human/human_status_procs.dm @@ -86,22 +86,6 @@ adjust_nutrition(-40) adjustToxLoss(-3) -/** - * Expel the reagents you just tried to ingest - * - * When you try to ingest reagents but you do not have a stomach - * you will spew the reagents on the floor. - * - * Vars: - * * bite: /atom the reagents to expel - * * amount: int The amount of reagent - */ -/mob/living/carbon/proc/expel_ingested(atom/bite, amount) - visible_message(span_danger("[src] throws up all over [p_them()]self!"), span_userdanger("You are unable to keep the [bite] down without a stomach!")) - - var/obj/effect/decal/cleanable/vomit/spew = new(get_turf(src)) - bite.reagents.trans_to(spew, amount) - /mob/living/carbon/human/adjust_ear_damage(damage = 0, deaf = 0) if(isspeciessynthetic(src)) return diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index fdb86741d31..6182a015d3a 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -104,11 +104,11 @@ "heart" = /datum/internal_organ/heart, "lungs" = /datum/internal_organ/lungs, "liver" = /datum/internal_organ/liver, + "stomach" = /datum/internal_organ/stomach, "kidneys" = /datum/internal_organ/kidneys, "brain" = /datum/internal_organ/brain, "appendix" = /datum/internal_organ/appendix, "eyes" = /datum/internal_organ/eyes, - "stomach" = /datum/internal_organ/stomach, ) var/knock_down_reduction = 1 //how much the knocked_down effect is reduced per Life call. diff --git a/code/modules/mob/living/carbon/human/zombie.dm b/code/modules/mob/living/carbon/human/zombie.dm index 3a0be5319c9..d89ea4db315 100644 --- a/code/modules/mob/living/carbon/human/zombie.dm +++ b/code/modules/mob/living/carbon/human/zombie.dm @@ -14,11 +14,11 @@ "heart" = /datum/internal_organ/heart, "lungs" = /datum/internal_organ/lungs, "liver" = /datum/internal_organ/liver, + "stomach" = /datum/internal_organ/stomach, "kidneys" = /datum/internal_organ/kidneys, "brain" = /datum/internal_organ/brain/zombie, "appendix" = /datum/internal_organ/appendix, "eyes" = /datum/internal_organ/eyes, - "stomach" = /datum/internal_organ/stomach, ) ///Sounds made randomly by the zombie var/list/sounds = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg') diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index b4f164e538e..9add009b706 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -177,7 +177,7 @@ transfer_to_stomach = FALSE if(belly.organ_status == ORGAN_BROKEN) var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) if(expel_amount > 0 ) - eater.expel_ingested(my_atom, expel_amount) + eater.vomit() return R = belly.reagents //target_atom = belly From aef9a5c90b51b1129b9f0035f7899af79ceec3b9 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 31 Jul 2024 16:03:24 +0300 Subject: [PATCH 07/43] Update mobs.dm --- code/__DEFINES/mobs.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 9376b00e510..8e565e8559e 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -229,6 +229,7 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA #define ORGAN_SLOT_EYES "eyes" #define ORGAN_SLOT_HEART "heart" #define ORGAN_SLOT_LIVER "liver" +#define ORGAN_SLOT_STOMACH "stomach" #define ORGAN_SLOT_LUNGS "lungs" #define ORGAN_SLOT_KIDNEYS "kidneys" From 43932ce64d89d4871f8e9a363879021e1cc76dba Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 31 Jul 2024 16:39:42 +0300 Subject: [PATCH 08/43] Update holder.dm --- code/modules/reagents/holder.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index 9add009b706..5b2205cebf4 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -173,11 +173,13 @@ transfer_to_stomach = FALSE else if(transfer_to_stomach && ishuman(target)) var/mob/living/carbon/human/eater = target - var/datum/internal_organ/stomach/belly = eater.internal_organs_by_name["stomach"] - if(belly.organ_status == ORGAN_BROKEN) + var/datum/internal_organ/stomach/belly = eater.get_organ_slot(ORGAN_SLOT_STOMACH) + if(belly.organ_status != ORGAN_HEALTHY && prob(belly.damage * 4)) var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) if(expel_amount > 0 ) eater.vomit() + var/datum/limb/chest/torso = eater.get_limb(BODY_ZONE_CHEST) // eating with bruised stomach will get you infections + torso.germ_level += expel_amount * 15 // 10 units are 150 germ level and etc. return R = belly.reagents //target_atom = belly From 578141bf28a6406d655bd6d67fd2f2455a385c33 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 31 Jul 2024 18:02:18 +0300 Subject: [PATCH 09/43] Update holder.dm --- code/modules/reagents/holder.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index 5b2205cebf4..a0b99a242d8 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -178,7 +178,7 @@ transfer_to_stomach = FALSE var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) if(expel_amount > 0 ) eater.vomit() - var/datum/limb/chest/torso = eater.get_limb(BODY_ZONE_CHEST) // eating with bruised stomach will get you infections + var/datum/limb/chest/torso = eater.get_limb(belly.parent_limb) // eating with bruised stomach will get you infections torso.germ_level += expel_amount * 15 // 10 units are 150 germ level and etc. return R = belly.reagents From 7ab63a6778a1f5cf285367087ae0e5f179b4c663 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Thu, 1 Aug 2024 14:24:28 +0300 Subject: [PATCH 10/43] Update snacks.dm --- .../items/reagent_containers/food/snacks.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index 83fa6fc4d2a..e65aa1ff293 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -34,7 +34,7 @@ if(reagents.total_volume) return - balloon_alert_to_viewers("eats \the [src]") + balloon_alert_to_viewers("eats \the [src]", ignored_mobs = M) usr.dropItemToGround(src) //so icons update :[ @@ -71,15 +71,15 @@ if(ishuman(H) && (H.species.species_flags & ROBOTIC_LIMBS)) balloon_alert(user, "can't eat food") return - if (fullness <= 50) + if(fullness <= 50) balloon_alert(user, "hungrily chews [src]") - if (fullness > 50 && fullness <= 150) + if(fullness > 50 && fullness <= 150) balloon_alert(user, "hungrily eats [src]") - if (fullness > 150 && fullness <= 350) + if(fullness > 150 && fullness <= 350) balloon_alert(user, "takes bite of [src]") - if (fullness > 350 && fullness <= 550) + if(fullness > 350 && fullness <= 550) balloon_alert(user, "unwillingly chews [src]") - if (fullness > 550) + if(fullness > 550) balloon_alert(user, "cannot eat more of [src]") return FALSE else @@ -87,7 +87,7 @@ if(ishuman(H) && (H.species.species_flags & ROBOTIC_LIMBS)) balloon_alert(user, "can't eat food") return - if (fullness <= 550) + if(fullness <= 550) balloon_alert_to_viewers("tries to feed [M]") else balloon_alert_to_viewers("tries to feed [M] but can't") From ebf5572f0064f457cd3412c8674ed2052ca891be Mon Sep 17 00:00:00 2001 From: Helg2 Date: Thu, 1 Aug 2024 14:24:47 +0300 Subject: [PATCH 11/43] Update holder.dm --- code/modules/reagents/holder.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index a0b99a242d8..d6d6ef78df2 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -174,7 +174,7 @@ transfer_to_stomach = FALSE if(transfer_to_stomach && ishuman(target)) var/mob/living/carbon/human/eater = target var/datum/internal_organ/stomach/belly = eater.get_organ_slot(ORGAN_SLOT_STOMACH) - if(belly.organ_status != ORGAN_HEALTHY && prob(belly.damage * 4)) + if(belly.organ_status != ORGAN_HEALTHY && prob(belly.damage * 3)) var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) if(expel_amount > 0 ) eater.vomit() From 7f8110b7d0aec442bb82e4a070f0d55382192ef1 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Thu, 1 Aug 2024 14:35:21 +0300 Subject: [PATCH 12/43] Update living_health_procs.dm --- code/modules/mob/living/living_health_procs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index afef8182f18..73e629c7d0b 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -261,7 +261,7 @@ embedded.unembed_ourself() // shut down various types of badness - setStaminaLoss(0) + setStaminaLoss(-50) setToxLoss(0) setOxyLoss(0) setCloneLoss(0) From ce64aff2e3e1c8813038d189d4353f1066c349d3 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Thu, 1 Aug 2024 15:19:56 +0300 Subject: [PATCH 13/43] Update holder.dm --- code/modules/reagents/holder.dm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index d6d6ef78df2..6b7b3600819 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -154,19 +154,19 @@ * * transfer_to_stomach - does it goes to stomach like from pills and food? * */ /datum/reagents/proc/trans_to( -atom/target, -amount = 1, -multiplier = 1, -preserve_data = TRUE, -no_react = FALSE, -transfer_to_stomach = FALSE + atom/target, + amount = 1, + multiplier = 1, + preserve_data = TRUE, + no_react = FALSE, + transfer_to_stomach = FALSE ) - var/list/cached_reagents = reagent_list if(!target || !total_volume) return if(amount < 0) return + var/list/cached_reagents = reagent_list var/datum/reagents/R if(istype(target, /datum/reagents)) R = target @@ -182,14 +182,14 @@ transfer_to_stomach = FALSE torso.germ_level += expel_amount * 15 // 10 units are 150 germ level and etc. return R = belly.reagents - //target_atom = belly else if(!target.reagents) return - R = target.reagents - amount = min(min(amount, total_volume), R.maximum_volume-R.total_volume) + else + R = target.reagents + amount = min(min(amount, total_volume), R.maximum_volume - R.total_volume) var/part = amount / total_volume var/trans_data = null - for(var/reagent in cached_reagents) + for(var/reagent AS in cached_reagents) var/datum/reagent/T = reagent var/transfer_amount = T.volume * part if(preserve_data) @@ -205,7 +205,7 @@ transfer_to_stomach = FALSE return amount /// Copies the reagents to the target object -/datum/reagents/proc/copy_to(obj/target, amount=1, multiplier=1, preserve_data=1) +/datum/reagents/proc/copy_to(obj/target, amount = 1, multiplier = 1, preserve_data = 1) var/list/cached_reagents = reagent_list if(!target || !total_volume) return From 9cc15719bae62cc95c5ff9a60822bc0e2900f80c Mon Sep 17 00:00:00 2001 From: Helg2 Date: Thu, 1 Aug 2024 15:50:47 +0300 Subject: [PATCH 14/43] defib fixes --- code/__DEFINES/loadout.dm | 2 +- code/game/objects/items/defibrillator.dm | 48 +++++++++--------------- 2 files changed, 19 insertions(+), 31 deletions(-) diff --git a/code/__DEFINES/loadout.dm b/code/__DEFINES/loadout.dm index b74bea7f1c2..4b6df1541fc 100644 --- a/code/__DEFINES/loadout.dm +++ b/code/__DEFINES/loadout.dm @@ -147,7 +147,7 @@ GLOBAL_LIST_INIT(medic_gear_listed_products, list( /obj/item/reagent_containers/hypospray/autoinjector/neuraline = list(CAT_MEDSUP, "Injector (Neuraline)", 14, "cyan"), /obj/item/healthanalyzer/gloves = list(CAT_MEDSUP, "Health scanner gloves", 2, "yellow"), /obj/item/defibrillator/gloves = list(CAT_MEDSUP, "Advanced medical gloves", 4, "yellow"), - /obj/item/defibrillator/advanced = list(CAT_FCSUP, "advanced emergency defibrillator", 4, "yellow"), + /obj/item/defibrillator/advanced = list(CAT_MEDSUP, "advanced emergency defibrillator", 4, "yellow"), /obj/item/tweezers_advanced = list(CAT_MEDSUP, "Advanced Tweezers", 8, "yellow"), /obj/effect/vendor_bundle/stretcher = list(CAT_MEDSUP, "Medivac Stretcher", 20, "yellow"), )) diff --git a/code/game/objects/items/defibrillator.dm b/code/game/objects/items/defibrillator.dm index 17607ec56b3..60bfee22b3a 100644 --- a/code/game/objects/items/defibrillator.dm +++ b/code/game/objects/items/defibrillator.dm @@ -2,7 +2,7 @@ name = "emergency defibrillator" desc = "A handheld emergency defibrillator, used to restore fibrillating patients. Can optionally bring people back from the dead." icon = 'icons/obj/items/defibrillator.dmi' - icon_state = "defib_full" + icon_state = "defib" item_state = "defib" flags_atom = CONDUCT flags_item = NOBLUDGEON @@ -10,23 +10,23 @@ force = 5 throwforce = 6 w_class = WEIGHT_CLASS_NORMAL - var/ready = FALSE ///wether readying is needed var/ready_needed = TRUE var/advanced = FALSE - var/damage_threshold = 8 //This is the maximum non-oxy damage the defibrillator will heal to get a patient above -100, in all categories - var/charge_cost = 66 //How much energy is used. + ///This is the maximum non-oxy damage the defibrillator will heal to get a patient above -100, in all categories + var/damage_threshold = 8 + /// How much energy is used + var/charge_cost = 66 var/obj/item/cell/dcell = null var/datum/effect_system/spark_spread/sparks - var/defib_cooldown = 0 //Cooldown for toggling the defib - + ///Cooldown for toggling the defib + var/defib_cooldown = 0 /obj/item/defibrillator/suicide_act(mob/user) user.visible_message(span_danger("[user] is putting the live paddles on [user.p_their()] chest! It looks like [user.p_theyre()] trying to commit suicide.")) return (FIRELOSS) - /obj/item/defibrillator/Initialize(mapload) . = ..() sparks = new @@ -35,7 +35,6 @@ set_dcell(new /obj/item/cell()) update_icon() - /obj/item/defibrillator/Destroy() QDEL_NULL(sparks) if(dcell) @@ -43,7 +42,6 @@ QDEL_NULL(dcell) return ..() - /obj/item/defibrillator/update_icon_state() icon_state = initial(icon_state) if(ready) @@ -59,12 +57,10 @@ else icon_state += "_empty" - /obj/item/defibrillator/examine(mob/user) . = ..() . += maybe_message_recharge_hint() - /** * Message user with a hint to recharge defibrillator * and how to do it if the battery is low. @@ -83,7 +79,6 @@ return return span_notice("[message] You can click-drag defibrillator on corpsman backpack to recharge it.") - /obj/item/defibrillator/attack_self(mob/living/carbon/human/user) if(!ready_needed) return @@ -111,7 +106,6 @@ playsound(get_turf(src), 'sound/items/defib_safetyOff.ogg', 30, 0) update_icon() - ///Wrapper to guarantee powercells are properly nulled and avoid hard deletes. /obj/item/defibrillator/proc/set_dcell(obj/item/cell/new_cell) if(dcell) @@ -120,7 +114,6 @@ if(dcell) RegisterSignal(dcell, COMSIG_QDELETING, PROC_REF(on_cell_deletion)) - ///Called by the deletion of the referenced powercell. /obj/item/defibrillator/proc/on_cell_deletion(obj/item/cell/source, force) SIGNAL_HANDLER @@ -189,7 +182,7 @@ user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Vital signs detected. Aborting.")) return - if((HAS_TRAIT(H, TRAIT_UNDEFIBBABLE ) && !issynth(H)) || H.suiciding) //synthetic species have no expiration date + if((HAS_TRAIT(H, TRAIT_UNDEFIBBABLE) && !issynth(H)) || H.suiciding) //synthetic species have no expiration date user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Patient is braindead. No remedy possible.")) return @@ -197,7 +190,7 @@ user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Patient's organs are too damaged to sustain life. Deliver patient to a MD for surgical intervention.")) return - if((H.wear_suit && H.wear_suit.flags_atom & CONDUCT)) + if((H.wear_suit && H.wear_suit.flags_atom & CONDUCT && !advanced)) user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Paddles registering >100,000 ohms, Possible cause: Suit or Armor interferring.")) return @@ -222,21 +215,18 @@ sparks.start() dcell.use(charge_cost) update_icon() - /* ORIGINAL - playsound(get_turf(src), 'sound/items/defib_release.ogg', 25, 1) - */ - playsound(get_turf(src), 'sound/items/defib_release.ogg', 30, 0) //RUTGMC EDIT + playsound(get_turf(src), 'sound/items/defib_release.ogg', 30, 0) user.visible_message(span_notice("[user] shocks [H] with the paddles."), span_notice("You shock [H] with the paddles.")) H.visible_message(span_danger("[H]'s body convulses a bit.")) defib_cooldown = world.time + 10 //1 second cooldown before you can shock again - if(H.wear_suit && advanced == FALSE && H.wear_suit.flags_atom & CONDUCT) + if(H.wear_suit && H.wear_suit.flags_atom & CONDUCT && !advanced) user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Defibrillation failed: Paddles registering >100,000 ohms, Possible cause: Suit or Armor interferring.")) return var/datum/internal_organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) - if(!issynth(H) && !isrobot(H) && heart && prob(90) && advanced == FALSE) + if(!issynth(H) && !isrobot(H) && heart && prob(90) && !advanced) heart.take_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib if(HAS_TRAIT(H, TRAIT_UNDEFIBBABLE) || H.suiciding) @@ -310,7 +300,7 @@ H.handle_regular_hud_updates() H.updatehealth() //One more time, so it doesn't show the target as dead on HUDs H.dead_ticks = 0 //We reset the DNR time - H.initial_stage = 0 // RUTGMC ADDITION + H.initial_stage = 0 REMOVE_TRAIT(H, TRAIT_PSY_DRAINED, TRAIT_PSY_DRAINED) if(user.client) var/datum/personal_statistics/personal_statistics = GLOB.personal_statistics_list[user.ckey] @@ -328,12 +318,12 @@ /obj/item/defibrillator/civi name = "emergency defibrillator" desc = "A handheld emergency defibrillator, used to restore fibrillating patients. Can optionally bring people back from the dead. Appears to be a civillian model." - icon_state = "civ_defib_full" + icon_state = "civ_defib" item_state = "defib" /obj/item/defibrillator/gloves name = "advanced medical combat gloves" - desc = "Advanced medical gloves, these include small electrodes to defibrilate a patiant. No more bulky units!" + desc = "Advanced medical gloves, these include small electrodes to defibrilate a patiant. Ignores armor and doesn't deal any damage to the patient's heart!" icon_state = "defib_gloves" item_state = "defib_gloves" ready = TRUE @@ -354,7 +344,6 @@ max_heat_protection_temperature = GLOVES_MAX_HEAT_PROTECTION_TEMPERATURE advanced = TRUE - /obj/item/defibrillator/gloves/equipped(mob/living/carbon/human/user, slot) . = ..() if(user.gloves == src) @@ -376,11 +365,10 @@ /obj/item/defibrillator/gloves/update_icon_state() return - /obj/item/defibrillator/advanced name = "advanced emergency defibrillator" - desc = "A handheld advanced emergency defibrillator, used to restore fibrillating patients. Can optionally bring people back from the dead." + desc = "A handheld advanced emergency defibrillator, used to restore fibrillating patients. at the cost of increased charge consumption." icon = 'icons/obj/items/defibrillator.dmi' - icon_state = "civ_defib_full" + icon_state = "civ_defib" + charge_cost = 100 advanced = TRUE - charge_cost = 100 //How much energy is used. From 61ed74201422feed44a766b0403f69df494cb6fa Mon Sep 17 00:00:00 2001 From: Helg2 Date: Sun, 4 Aug 2024 20:02:50 +0300 Subject: [PATCH 15/43] guh --- code/__DEFINES/mobs.dm | 12 - code/datums/gamemodes/objective.dm | 2 +- code/datums/status_effects/debuffs.dm | 2 +- code/game/objects/items.dm | 2 +- code/game/objects/items/defibrillator.dm | 4 +- .../items/reagent_containers/food/snacks.dm | 2 +- code/game/objects/items/scanners.dm | 2 +- code/game/objects/machinery.dm | 11 +- code/game/objects/machinery/autodoc.dm | 29 +- code/game/objects/machinery/flasher.dm | 2 +- .../objects/machinery/practice/medical.dm | 4 +- code/game/objects/structures/supplypod.dm | 7 +- code/modules/mob/living/brain/brain_item.dm | 59 --- .../mob/living/carbon/carbon_helpers.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 8 +- .../mob/living/carbon/human/human_damage.dm | 8 +- .../mob/living/carbon/human/human_defense.dm | 12 +- .../mob/living/carbon/human/human_helpers.dm | 6 +- .../living/carbon/human/life/handle_organs.dm | 6 +- .../mob/living/carbon/human/species.dm | 26 +- .../modules/mob/living/carbon/human/zombie.dm | 18 +- code/modules/mob/living/carbon/shock.dm | 2 +- .../castes/carrier/abilities_carrier.dm | 2 +- .../mob/living/carbon/xenomorph/embryo.dm | 2 +- .../modules/mob/living/living_health_procs.dm | 2 +- code/modules/organs/_organ.dm | 78 ++++ code/modules/organs/limb_objects.dm | 1 - code/modules/organs/limbs.dm | 12 +- code/modules/organs/organ_alien.dm | 76 ---- code/modules/organs/organ_internal.dm | 420 ------------------ code/modules/organs/organ_objects.dm | 231 ---------- code/modules/organs/organs.dm | 250 +++++++++++ code/modules/organs/pain.dm | 2 +- code/modules/reagents/holder.dm | 2 +- code/modules/reagents/reagents/alcohol.dm | 6 +- code/modules/reagents/reagents/drink.dm | 4 +- code/modules/reagents/reagents/medical.dm | 18 +- code/modules/surgery/brainrepair.dm | 6 +- code/modules/surgery/eye.dm | 18 +- code/modules/surgery/mcomp_tendwounds.dm | 2 +- code/modules/surgery/organs_internal.dm | 70 +-- icons/obj/items/organs.dmi | Bin 3470 -> 7427 bytes tgmc.dme | 6 +- 43 files changed, 445 insertions(+), 991 deletions(-) delete mode 100644 code/modules/mob/living/brain/brain_item.dm create mode 100644 code/modules/organs/_organ.dm delete mode 100644 code/modules/organs/organ_alien.dm delete mode 100644 code/modules/organs/organ_internal.dm delete mode 100644 code/modules/organs/organ_objects.dm create mode 100644 code/modules/organs/organs.dm diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 8e565e8559e..fdcd3aa0f27 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -210,18 +210,6 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA ///////////////////INTERNAL ORGANS DEFINES/////////////////// -#define ORGAN_ASSISTED 1 -#define ORGAN_ROBOT 2 - -#define ORGAN_HEART 1 -#define ORGAN_LUNGS 2 -#define ORGAN_LIVER 3 -#define ORGAN_KIDNEYS 4 -#define ORGAN_BRAIN 5 -#define ORGAN_EYES 6 -#define ORGAN_APPENDIX 7 -#define ORGAN_STOMACH 8 - //organ slots #define ORGAN_SLOT_APPENDIX "appendix" #define ORGAN_SLOT_BRAIN "brain" diff --git a/code/datums/gamemodes/objective.dm b/code/datums/gamemodes/objective.dm index 51574d10286..e609981018e 100644 --- a/code/datums/gamemodes/objective.dm +++ b/code/datums/gamemodes/objective.dm @@ -554,7 +554,7 @@ GLOBAL_LIST_EMPTY(possible_items) return TRUE for(targethuman in defendedarea) if(iszombie(targethuman)) //zombies count as hostile forces to everyone but zombies - for(var/datum/internal_organ/affectedorgan in targethuman.internal_organs) + for(var/obj/item/organ/affectedorgan in targethuman.internal_organs) if(affectedorgan == targethuman.get_organ_slot(ORGAN_SLOT_HEART)) return FALSE if(targethuman.stat == DEAD) //we don't care about dead humans diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index c503d57e17b..94c8b799c81 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -501,7 +501,7 @@ if(human_owner && prob(15)) human_owner.vomit() if(carbon_owner && prob(15)) - var/datum/internal_organ/organ = pick(carbon_owner.internal_organs) + var/obj/item/organ/organ = pick(carbon_owner.internal_organs) if(organ) organ.take_damage(5) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 21ff161c204..9df518d38ab 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -942,7 +942,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. return TRUE var/safety = user.get_eye_protection() var/mob/living/carbon/human/H = user - var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) switch(safety) if(1) E.take_damage(rand(1, 2), TRUE) diff --git a/code/game/objects/items/defibrillator.dm b/code/game/objects/items/defibrillator.dm index 60bfee22b3a..b4b103b80c4 100644 --- a/code/game/objects/items/defibrillator.dm +++ b/code/game/objects/items/defibrillator.dm @@ -135,7 +135,7 @@ return null /mob/living/carbon/human/proc/has_working_organs() - var/datum/internal_organ/heart/heart = get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/heart = get_organ_slot(ORGAN_SLOT_HEART) if(!heart || heart.organ_status == ORGAN_BROKEN || !has_brain()) return FALSE @@ -225,7 +225,7 @@ user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Defibrillation failed: Paddles registering >100,000 ohms, Possible cause: Suit or Armor interferring.")) return - var/datum/internal_organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) if(!issynth(H) && !isrobot(H) && heart && prob(90) && !advanced) heart.take_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index e65aa1ff293..19a8dbda7ef 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -858,7 +858,7 @@ var/mob/living/carbon/human/H = M var/datum/limb/E = H.get_limb("chest") E.fracture() - for (var/datum/internal_organ/I in E.internal_organs) + for (var/obj/item/organ/I in E.internal_organs) I.take_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) if (!E.hidden && prob(60)) //set it snuggly E.hidden = surprise diff --git a/code/game/objects/items/scanners.dm b/code/game/objects/items/scanners.dm index 939d2dd8643..df8973824fd 100644 --- a/code/game/objects/items/scanners.dm +++ b/code/game/objects/items/scanners.dm @@ -259,7 +259,7 @@ REAGENT SCANNER data["pulse"] = "[human_patient.get_pulse(GETPULSE_TOOL)] bpm" data["implants"] = unknown_implants var/damaged_organs = list() - for(var/datum/internal_organ/organ AS in human_patient.internal_organs) + for(var/obj/item/organ/organ AS in human_patient.internal_organs) if(organ.organ_status == ORGAN_HEALTHY) continue var/current_organ = list( diff --git a/code/game/objects/machinery.dm b/code/game/objects/machinery.dm index f7707b32d67..79f2bdbf8c6 100644 --- a/code/game/objects/machinery.dm +++ b/code/game/objects/machinery.dm @@ -412,16 +412,9 @@ dat += "[e.display_name]--Not Found" dat += "" - for(var/datum/internal_organ/i in occ["internal_organs"]) - - var/mech = "" - if(i.robotic == ORGAN_ASSISTED) - mech = "Assisted:
" - if(i.robotic == ORGAN_ROBOT) - mech = "Mechanical:
" - + for(var/obj/item/organ/i in occ["internal_organs"]) dat += "" - dat += "[i.name]N/A[i.damage]None:[mech]" + dat += "[i.name]N/A[i.damage]" dat += "" dat += "" diff --git a/code/game/objects/machinery/autodoc.dm b/code/game/objects/machinery/autodoc.dm index 950860a9e07..5693e6ed86f 100644 --- a/code/game/objects/machinery/autodoc.dm +++ b/code/game/objects/machinery/autodoc.dm @@ -212,7 +212,7 @@ /datum/autodoc_surgery var/datum/limb/limb_ref = null - var/datum/internal_organ/organ_ref = null + var/obj/item/organ/organ_ref = null var/type_of_surgery = 0 // the above constants var/surgery_procedure = "" // text of surgery var/unneeded = 0 @@ -236,12 +236,9 @@ surgery_list += create_autodoc_surgery(L,LIMB_SURGERY,ADSURGERY_INTERNAL) var/organdamagesurgery = 0 - for(var/datum/internal_organ/I in L.internal_organs) - if(I.robotic == ORGAN_ASSISTED||I.robotic == ORGAN_ROBOT) - // we can't deal with these - continue + for(var/obj/item/organ/I in L.internal_organs) if(I.damage > 0) - if(I.organ_id == ORGAN_EYES) // treat eye surgery differently + if(I.slot == ORGAN_SLOT_EYES) // treat eye surgery differently continue if(organdamagesurgery > 0) continue // avoid duplicates @@ -274,7 +271,7 @@ surgery_list += create_autodoc_surgery(L,LIMB_SURGERY,ADSURGERY_GERMS) if(L.surgery_open_stage) surgery_list += create_autodoc_surgery(L,LIMB_SURGERY,ADSURGERY_OPEN) - var/datum/internal_organ/I = M.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/I = M.get_organ_slot(ORGAN_SLOT_EYES) if(I && (M.disabilities & NEARSIGHTED || M.disabilities & BLIND || I.damage > 0)) surgery_list += create_autodoc_surgery(null,ORGAN_SURGERY,ADSURGERY_EYES,0,I) if(M.getBruteLoss() > 0) @@ -372,7 +369,7 @@ else occupant.reagents.add_reagent(/datum/reagent/medicine/spaceacillin,inject_per_second) amount -= inject_per_second - sleep(10*surgery_mod) + sleep(10 * surgery_mod) if(ADSURGERY_DAMAGE) say("Beginning organ restoration.") @@ -386,15 +383,15 @@ if(S.limb_ref.body_part != GROIN) open_encased(occupant, S.limb_ref) - if(!istype(S.organ_ref,/datum/internal_organ/brain)) + if(!istype(S.organ_ref, /obj/item/organ/brain)) sleep(FIX_ORGAN_MAX_DURATION*surgery_mod) else if(S.organ_ref.damage > BONECHIPS_MAX_DAMAGE) - sleep(HEMOTOMA_MAX_DURATION*surgery_mod) - sleep(BONECHIPS_REMOVAL_MAX_DURATION*surgery_mod) + sleep(HEMOTOMA_MAX_DURATION * surgery_mod) + sleep(BONECHIPS_REMOVAL_MAX_DURATION * surgery_mod) if(!surgery) break - if(istype(S.organ_ref,/datum/internal_organ)) + if(istype(S.organ_ref, /obj/item/organ)) S.organ_ref.heal_organ_damage(S.organ_ref.damage) else say("Organ is missing.") @@ -411,8 +408,8 @@ say("Procedure has been deemed unnecessary.") surgery_todo_list -= S continue - if(istype(S.organ_ref,/datum/internal_organ/eyes)) - var/datum/internal_organ/eyes/E = S.organ_ref + if(istype(S.organ_ref, /obj/item/organ/eyes)) + var/obj/item/organ/eyes/E = S.organ_ref if(E.eye_surgery_stage == 0) sleep(EYE_CUT_MAX_DURATION) @@ -1218,9 +1215,7 @@ for(var/i in connected.occupant.limbs) var/datum/limb/L = i for(var/x in L.internal_organs) - var/datum/internal_organ/I = x - if(I.robotic == ORGAN_ASSISTED || I.robotic == ORGAN_ROBOT) - continue + var/obj/item/organ/I = x if(I.damage > 0) N.fields["autodoc_manual"] += create_autodoc_surgery(L,ORGAN_SURGERY,ADSURGERY_DAMAGE,0,I) needed++ diff --git a/code/game/objects/machinery/flasher.dm b/code/game/objects/machinery/flasher.dm index eda7d506ce2..5a4aee36c2e 100644 --- a/code/game/objects/machinery/flasher.dm +++ b/code/game/objects/machinery/flasher.dm @@ -76,7 +76,7 @@ var/mob/living/carbon/human/H = L if(H.get_eye_protection() > 0) continue - var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) H.flash_act() E.take_damage(rand(1, 5)) diff --git a/code/game/objects/machinery/practice/medical.dm b/code/game/objects/machinery/practice/medical.dm index f09f0764a1f..5101e2be4d8 100644 --- a/code/game/objects/machinery/practice/medical.dm +++ b/code/game/objects/machinery/practice/medical.dm @@ -46,8 +46,8 @@ if("damaged organs") humanspawned = new /mob/living/carbon/human(get_turf(src)) var/list/organs_to_hurt = list() - for(var/datum/internal_organ/I in humanspawned.internal_organs) + for(var/obj/item/organ/I in humanspawned.internal_organs) organs_to_hurt += I if(length(organs_to_hurt)) - var/datum/internal_organ/O = pick(organs_to_hurt) + var/obj/item/organ/O = pick(organs_to_hurt) O.take_damage(40) diff --git a/code/game/objects/structures/supplypod.dm b/code/game/objects/structures/supplypod.dm index ecd56aa50f7..8591faf4ee4 100644 --- a/code/game/objects/structures/supplypod.dm +++ b/code/game/objects/structures/supplypod.dm @@ -125,11 +125,10 @@ GLOBAL_LIST_INIT(pod_styles, list(\ if(effectOrgans && ishuman(L)) var/mob/living/carbon/human/H = L - for(var/datum/internal_organ/IO in H.internal_organs) + for(var/obj/item/organ/IO in H.internal_organs) var/destination = get_edge_target_turf(T, pick(GLOB.alldirs)) - var/obj/item/organ/O = IO.remove(H) - O.forceMove(T) - O.throw_at(destination, 2, 3) + IO.forceMove(T) + IO.throw_at(destination, 2, 3) sleep(0.1 SECONDS) if(effectGib) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm deleted file mode 100644 index c319fba32d7..00000000000 --- a/code/modules/mob/living/brain/brain_item.dm +++ /dev/null @@ -1,59 +0,0 @@ -/obj/item/organ/brain - name = "brain" - max_integrity = 400 //They need to live awhile longer than other organs. - desc = "A piece of juicy meat found in a person's head." - icon_state = "brain2" - flags_atom = NONE - force = 1 - w_class = WEIGHT_CLASS_SMALL - throwforce = 1 - throw_speed = 3 - throw_range = 5 - attack_verb = list("attacked", "slapped", "whacked") - organ_type = /datum/internal_organ/brain - organ_tag = ORGAN_SLOT_BRAIN - - var/mob/living/brain/brainmob = null - -/obj/item/organ/brain/xeno - name = "thinkpan" - desc = "It looks kind of like an enormous wad of purple bubblegum." - icon = 'icons/mob/alien.dmi' - icon_state = "chitin" - - -/obj/item/organ/brain/proc/transfer_identity(mob/living/carbon/H) - name = "[H]'s brain" - brainmob = new(src) - brainmob.name = H.real_name - brainmob.real_name = H.real_name - brainmob.timeofhostdeath = H.timeofdeath - if(H.mind) - H.mind.transfer_to(brainmob) - - to_chat(brainmob, span_notice("You feel slightly disoriented. That's normal when you're just a brain.")) - -/obj/item/organ/brain/examine(mob/user) - . = ..() - if(brainmob?.client)//if thar be a brain inside... the brain. - . += "You can feel the small spark of life still left in this one." - else - . += "This one seems particularly lifeless. Perhaps it will regain some of its luster later.." - -/obj/item/organ/brain/removed(mob/living/target,mob/living/user) - ..() - var/mob/living/carbon/human/H = target - var/obj/item/organ/brain/B = src - if(istype(B) && istype(H)) - B.transfer_identity(target) - -/obj/item/organ/brain/replaced(mob/living/target) - - if(target.key) - target.ghostize() - - if(brainmob) - if(brainmob.mind) - brainmob.mind.transfer_to(target) - else - target.key = brainmob.key diff --git a/code/modules/mob/living/carbon/carbon_helpers.dm b/code/modules/mob/living/carbon/carbon_helpers.dm index b3f86cb7506..4500615570c 100644 --- a/code/modules/mob/living/carbon/carbon_helpers.dm +++ b/code/modules/mob/living/carbon/carbon_helpers.dm @@ -15,8 +15,8 @@ ///Return the most damaged internal_organ that isn't at 0, or null. /mob/living/carbon/proc/get_damaged_organ() - var/datum/internal_organ/chosen_organ - for(var/datum/internal_organ/test_organ AS in internal_organs) + var/obj/item/organ/chosen_organ + for(var/obj/item/organ/test_organ AS in internal_organs) if(!test_organ.damage) continue if(!chosen_organ) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fca982b98c4..5625b61473d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -654,11 +654,9 @@ if(!species.has_organ["eyes"]) return 2//No eyes, can't hurt them. - var/datum/internal_organ/eyes/I = get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/I = get_organ_slot(ORGAN_SLOT_EYES) if(!I) return 2 - if(I.robotic == ORGAN_ROBOT) - return 2 if(istype(head, /obj/item/clothing)) var/obj/item/clothing/C = head @@ -695,11 +693,11 @@ /mob/living/carbon/human/proc/is_lung_ruptured() - var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) return L?.organ_status == ORGAN_BRUISED /mob/living/carbon/human/proc/rupture_lung() - var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) if(L?.organ_status == ORGAN_BRUISED) src.custom_pain("You feel a stabbing pain in your chest!", 1) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 69a3b8576da..61b18b9845a 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -39,7 +39,7 @@ return FALSE //godmode if(species?.has_organ[ORGAN_SLOT_BRAIN]) - var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.take_damage(amount, silent) sponge.damage = clamp(sponge.damage, 0, MAX_BRAINLOSS) @@ -55,7 +55,7 @@ return FALSE //godmode if(species?.has_organ[ORGAN_SLOT_BRAIN]) - var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.damage = clamp(amount, 0, MAX_BRAINLOSS) brainloss = sponge.damage @@ -70,7 +70,7 @@ return FALSE //godmode if(species?.has_organ[ORGAN_SLOT_BRAIN]) - var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) //Make sure they actually have a brain brainloss = min(sponge.damage, MAX_BRAINLOSS) else @@ -315,7 +315,7 @@ This function restores all limbs. for(var/organ_slot in species.has_organ) var/internal_organ_type = species.has_organ[organ_slot] if(!get_organ_slot(organ_slot)) - var/datum/internal_organ/IO = new internal_organ_type(src) + var/obj/item/organ/IO = new internal_organ_type(src) internal_organs_by_name[organ_slot] = IO if(updating_health) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 590f43c6feb..971dd2fcc27 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -61,14 +61,13 @@ Contains most of the procs that are called when a mob is attacked by something /mob/living/carbon/human/emp_act(severity) for(var/obj/O in src) - if(!O) continue + if(!O) + continue O.emp_act(severity) for(var/datum/limb/O in limbs) - if(O.limb_status & LIMB_DESTROYED) continue + if(O.limb_status & LIMB_DESTROYED) + continue O.emp_act(severity) - for(var/datum/internal_organ/I in O.internal_organs) - if(I.robotic == 0) continue - I.emp_act(severity) ..() /mob/living/carbon/human/has_smoke_protection() @@ -92,7 +91,7 @@ Contains most of the procs that are called when a mob is attacked by something /mob/living/carbon/human/inhale_smoke(obj/effect/particle_effect/smoke/S) . = ..() if(CHECK_BITFIELD(S.smoke_traits, SMOKE_BLISTERING) && species.has_organ[ORGAN_SLOT_LUNGS]) - var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) L?.take_damage(1, TRUE) @@ -412,7 +411,6 @@ Contains most of the procs that are called when a mob is attacked by something visible_message(span_notice("[user] ripped off [src]'s heart!"), span_notice("You ripped off [src]'s heart!")) remove_organ_slot(ORGAN_SLOT_HEART) var/obj/item/organ/heart/heart = new - heart.die() user.put_in_hands(heart) chestburst = 2 update_burst() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index da0bd8d546d..864a5b8e308 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -185,14 +185,14 @@ /mob/living/carbon/human/has_brain() if(get_organ_slot(ORGAN_SLOT_BRAIN)) - var/datum/internal_organ/brain = get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain = get_organ_slot(ORGAN_SLOT_BRAIN) if(brain && istype(brain)) return 1 return 0 /mob/living/carbon/human/has_eyes() if(get_organ_slot(ORGAN_SLOT_EYES)) - var/datum/internal_organ/eyes = get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes = get_organ_slot(ORGAN_SLOT_EYES) if(eyes && istype(eyes)) return 1 return 0 @@ -250,6 +250,6 @@ ///Removes organ by name /mob/living/carbon/human/proc/remove_organ_slot(string) - var/datum/internal_organ/organ = get_organ_slot(string) + var/obj/item/organ/organ = get_organ_slot(string) internal_organs_by_name -= string internal_organs -= organ diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index 45e7a08c54d..570ee8bc120 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -3,7 +3,7 @@ . = ..() if(reagents && !CHECK_BITFIELD(species.species_flags, NO_CHEM_METABOLIZATION)) - var/datum/internal_organ/liver/L + var/obj/item/organ/liver/L if(species?.has_organ[ORGAN_SLOT_LIVER]) L = get_organ_slot(ORGAN_SLOT_LIVER) var/overdosable = CHECK_BITFIELD(species.species_flags, NO_OVERDOSE) ? FALSE : TRUE @@ -19,7 +19,7 @@ last_dam = getBruteLoss() + getFireLoss() + getToxLoss() - for(var/datum/internal_organ/I in internal_organs) + for(var/obj/item/organ/I in internal_organs) I.process() var/multi_limb_regen_penalty = 1 / (max(1, length(get_damaged_limbs(TRUE, TRUE))) ** 0.5) //Per-limb regen decreases with multiple damaged limbs, but slower than linear @@ -38,7 +38,7 @@ if(!lying_angle && world.time - last_move_time < 15) if(E.is_broken() && E.internal_organs && prob(15)) - var/datum/internal_organ/I = pick(E.internal_organs) + var/obj/item/organ/I = pick(E.internal_organs) custom_pain("You feel broken bones moving in your [E.display_name]!", 1) I.take_damage(rand(3,5)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 1db1f48ca7d..fc5664e8f20 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -101,14 +101,14 @@ /// inherent species-specific actions var/list/inherent_actions var/list/has_organ = list( - ORGAN_SLOT_HEART = /datum/internal_organ/heart, - ORGAN_SLOT_LUNGS = /datum/internal_organ/lungs, - ORGAN_SLOT_LIVER = /datum/internal_organ/liver, - ORGAN_SLOT_STOMACH = /datum/internal_organ/stomach, - ORGAN_SLOT_KIDNEYS = /datum/internal_organ/kidneys, - ORGAN_SLOT_BRAIN = /datum/internal_organ/brain, - ORGAN_SLOT_APPENDIX = /datum/internal_organ/appendix, - ORGAN_SLOT_EYES = /datum/internal_organ/eyes + ORGAN_SLOT_HEART = /obj/item/organ/heart, + ORGAN_SLOT_LUNGS = /obj/item/organ/lungs, + ORGAN_SLOT_LIVER = /obj/item/organ/liver, + ORGAN_SLOT_STOMACH = /obj/item/organ/stomach, + ORGAN_SLOT_KIDNEYS = /obj/item/organ/kidneys, + ORGAN_SLOT_BRAIN = /obj/item/organ/brain, + ORGAN_SLOT_APPENDIX = /obj/item/organ/appendix, + ORGAN_SLOT_EYES = /obj/item/organ/eyes ) var/knock_down_reduction = 1 //how much the knocked_down effect is reduced per Life call. @@ -160,18 +160,18 @@ organless_human.limbs += new/datum/limb/foot/l_foot(new_l_leg, organless_human) organless_human.limbs += new/datum/limb/foot/r_foot(new_r_leg, organless_human) - for(var/organ in has_organ) - var/organ_type = has_organ[organ] + for(var/obj/item/organ/organ in has_organ) + var/obj/item/organ/organ_type = has_organ[organ] // will it even do something? organless_human.internal_organs_by_name[organ] = new organ_type(organless_human) + organ.owner = organless_human + var/datum/limb/limb = organless_human.get_limb(organ.parent_limb) + LAZYDISTINCTADD(limb.internal_organs, src) if(species_flags & ROBOTIC_LIMBS) for(var/datum/limb/robotic_limb AS in organless_human.limbs) if(robotic_limb.limb_status & LIMB_DESTROYED) continue robotic_limb.add_limb_flags(LIMB_ROBOT) - for(var/datum/internal_organ/my_cold_heart in organless_human.internal_organs) - my_cold_heart.mechanize() - /datum/species/proc/hug(mob/living/carbon/human/H, mob/living/target) if(H.zone_selected == "head") diff --git a/code/modules/mob/living/carbon/human/zombie.dm b/code/modules/mob/living/carbon/human/zombie.dm index c471a095b1d..408cdda6f66 100644 --- a/code/modules/mob/living/carbon/human/zombie.dm +++ b/code/modules/mob/living/carbon/human/zombie.dm @@ -11,14 +11,14 @@ slowdown = 0.5 default_language_holder = /datum/language_holder/zombie has_organ = list( - ORGAN_SLOT_HEART = /datum/internal_organ/heart, - ORGAN_SLOT_LUNGS = /datum/internal_organ/lungs, - ORGAN_SLOT_LIVER = /datum/internal_organ/liver, - ORGAN_SLOT_STOMACH = /datum/internal_organ/stomach, - ORGAN_SLOT_KIDNEYS = /datum/internal_organ/kidneys, - ORGAN_SLOT_BRAIN = /datum/internal_organ/brain/zombie, - ORGAN_SLOT_APPENDIX = /datum/internal_organ/appendix, - ORGAN_SLOT_EYES = /datum/internal_organ/eyes + ORGAN_SLOT_HEART = /obj/item/organ/heart, + ORGAN_SLOT_LUNGS = /obj/item/organ/lungs, + ORGAN_SLOT_LIVER = /obj/item/organ/liver, + ORGAN_SLOT_STOMACH = /obj/item/organ/stomach, + ORGAN_SLOT_KIDNEYS = /obj/item/organ/kidneys, + ORGAN_SLOT_BRAIN = /obj/item/organ/brain, + ORGAN_SLOT_APPENDIX = /obj/item/organ/appendix, + ORGAN_SLOT_EYES = /obj/item/organ/eyes ) ///Sounds made randomly by the zombie var/list/sounds = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg') @@ -80,7 +80,7 @@ H.heal_limbs(heal_rate) for(var/organ_slot in has_organ) - var/datum/internal_organ/internal_organ = H.get_organ_slot(organ_slot) + var/obj/item/organ/internal_organ = H.get_organ_slot(organ_slot) internal_organ?.heal_organ_damage(1) H.updatehealth() diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index 86d24b3aec9..bd1c59431b8 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -87,7 +87,7 @@ traumatic_shock += O.germ_level * 0.05 //Internal organs hurt too - for(var/datum/internal_organ/O in M.internal_organs) + for(var/obj/item/organ/O in M.internal_organs) if(O.damage) traumatic_shock += O.damage * 1.5 if(M.protection_aura) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm index 1b7690ac00a..e473b156a54 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm @@ -439,7 +439,7 @@ GLOBAL_LIST_INIT(hugger_images_list, list( victim.adjust_slowdown(debuff) victim.apply_damage(stamina_dmg, STAMINA) - var/datum/internal_organ/O + var/obj/item/organ/O for(var/i in list(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_STOMACH)) O = victim.get_organ_slot(i) O.take_damage(debuff, TRUE) diff --git a/code/modules/mob/living/carbon/xenomorph/embryo.dm b/code/modules/mob/living/carbon/xenomorph/embryo.dm index 6abc32606d7..0a814083d6b 100644 --- a/code/modules/mob/living/carbon/xenomorph/embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/embryo.dm @@ -219,7 +219,7 @@ if(ishuman(victim)) var/mob/living/carbon/human/H = victim H.apply_damage(200, BRUTE, H.get_limb("chest"), updating_health = TRUE) //lethal armor ignoring brute damage - var/datum/internal_organ/O + var/obj/item/organ/O for(var/i in list(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_KIDNEYS, ORGAN_SLOT_APPENDIX, ORGAN_SLOT_STOMACH)) //Bruise all torso internal organs O = H.get_organ_slot(i) diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 73e629c7d0b..1b750a756b6 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -346,7 +346,7 @@ H.brainmob.mind.transfer_to(src) qdel(H) - for(var/datum/internal_organ/I in internal_organs) + for(var/obj/item/organ/I in internal_organs) I.heal_organ_damage(I.damage) reagents.clear_reagents() //and clear all reagents in them diff --git a/code/modules/organs/_organ.dm b/code/modules/organs/_organ.dm new file mode 100644 index 00000000000..e75dd74cc1b --- /dev/null +++ b/code/modules/organs/_organ.dm @@ -0,0 +1,78 @@ +/obj/item/organ + name = "organ" + desc = "It looks like it probably just plopped out." + icon = 'icons/obj/items/organs.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/inhands/items/bodyparts_left.dmi', + slot_r_hand_str = 'icons/mob/inhands/items/bodyparts_right.dmi', + ) + /// Reference to the mob owning the organs + var/mob/living/carbon/human/owner = null + /// Reference to the limb we're inside of + var/datum/limb/parent_limb = BODY_ZONE_CHEST + /// amount of damage to the organ + var/damage = 0 + /// amount of damage after which the organ gets bruised flag + var/min_bruised_damage = 10 + /// amount of damage after which the organ gets broken flag + var/min_broken_damage = 30 + /// State of the organ + var/organ_status = ORGAN_HEALTHY + /// What slot does it go in? + var/slot + +/* Do something with this +/datum/internal_organ/New(mob/living/carbon/carbon_mob) + ..() + if(!istype(carbon_mob)) + return + + carbon_mob.internal_organs |= src + owner = carbon_mob + + var/mob/living/carbon/human/human = carbon_mob + var/datum/limb/limb = human.get_limb(parent_limb) + LAZYDISTINCTADD(limb.internal_organs, src) +*/ + +/obj/item/organ/Destroy() + clean_owner() + return ..() + +///Signal handler to prevent hard del +/obj/item/organ/proc/clean_owner() + SIGNAL_HANDLER + owner = null + +/obj/item/organ/proc/get_damage(amount, silent = FALSE) + if(SSticker.mode?.flags_round_type & MODE_NO_PERMANENT_WOUNDS) + return + if(amount <= 0) + heal_organ_damage(-amount) + return + damage += amount + + var/datum/limb/parent = owner.get_limb(parent_limb) + if(!silent) + owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) + set_organ_status() + +/obj/item/organ/proc/heal_organ_damage(amount) + damage = max(damage - amount, 0) + set_organ_status() + +/// Set the correct organ state +/obj/item/organ/proc/set_organ_status() + if(damage > min_broken_damage) + if(organ_status != ORGAN_BROKEN) + organ_status = ORGAN_BROKEN + return TRUE + return FALSE + if(damage > min_bruised_damage) + if(organ_status != ORGAN_BRUISED) + organ_status = ORGAN_BRUISED + return TRUE + return FALSE + if(organ_status != ORGAN_HEALTHY) + organ_status = ORGAN_HEALTHY + return TRUE diff --git a/code/modules/organs/limb_objects.dm b/code/modules/organs/limb_objects.dm index 009885c5dcb..d3ca45f6c69 100644 --- a/code/modules/organs/limb_objects.dm +++ b/code/modules/organs/limb_objects.dm @@ -1,4 +1,3 @@ - /obj/item/limb icon = 'icons/mob/human_races/r_human.dmi' item_icons = list( diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index 556040c27cb..fca82a7561d 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -38,7 +38,7 @@ var/list/datum/limb/children ///List of Internal organs of this body part - var/list/datum/internal_organ/internal_organs + var/list/obj/item/organ/internal_organs /// Message that displays when you feel pain from this limb var/damage_msg = span_warning("You feel an intense pain") @@ -184,7 +184,7 @@ //High brute damage or sharp objects may damage internal organs if(internal_organs && ((sharp && brute >= 10) || brute >= 20) && prob(5)) //Damage an internal organ - var/datum/internal_organ/I = pick(internal_organs) + var/obj/item/organ/I = pick(internal_organs) I.take_damage(brute / 2) brute -= brute / 2 RU TGMC EDIT */ @@ -316,7 +316,7 @@ RU TGMC EDIT */ // heal internal organs for(var/o in internal_organs) - var/datum/internal_organ/current_organ = o + var/obj/item/organ/current_organ = o current_organ.heal_organ_damage(current_organ.damage) // remove embedded objects and drop them on the floor @@ -506,10 +506,10 @@ Note that amputating the affected organ does in fact remove the infection from t owner.adjustToxLoss(1) if (prob(1)) to_chat(owner, span_notice("You have a high fever!")) -//Not technically a germ effect, but derived from it + //Not technically a germ effect, but derived from it if(limb_status & LIMB_NECROTIZED) - for(var/datum/internal_organ/organ AS in internal_organs) - organ.take_damage(0.2, silent = TRUE) //1 point every 10 seconds, 100 seconds to bruise, five minutes to broken. + for(var/obj/item/organ/organ AS in internal_organs) + organ.get_damage(0.2, silent = TRUE) //1 point every 10 seconds, 100 seconds to bruise, five minutes to broken. ///Updating wounds. Handles natural damage healing from limb treatments and processes internal wounds diff --git a/code/modules/organs/organ_alien.dm b/code/modules/organs/organ_alien.dm deleted file mode 100644 index 9f67598b0f4..00000000000 --- a/code/modules/organs/organ_alien.dm +++ /dev/null @@ -1,76 +0,0 @@ -//XENOMORPH ORGANS -/datum/internal_organ/xenos/eggsac - name = "egg sac" - parent_limb = "groin" - removed_type = /obj/item/organ/xenos/eggsac - -/datum/internal_organ/xenos/plasmavessel - name = "plasma vessel" - parent_limb = "chest" - removed_type = /obj/item/organ/xenos/plasmavessel - var/stored_plasma = 0 - var/max_plasma = 500 - -/datum/internal_organ/xenos/plasmavessel/queen - name = "bloated plasma vessel" - stored_plasma = 200 - max_plasma = 500 - -/datum/internal_organ/xenos/plasmavessel/sentinel - stored_plasma = 100 - max_plasma = 250 - -/datum/internal_organ/xenos/plasmavessel/hunter - name = "tiny plasma vessel" - stored_plasma = 100 - max_plasma = 150 - -/datum/internal_organ/xenos/acidgland - name = "acid gland" - parent_limb = "head" - removed_type = /obj/item/organ/xenos/acidgland - -/datum/internal_organ/xenos/hivenode - name = "hive node" - parent_limb = "chest" - removed_type = /obj/item/organ/xenos/hivenode - -/datum/internal_organ/xenos/resinspinner - name = "resin spinner" - parent_limb = "head" - removed_type = /obj/item/organ/xenos/resinspinner - -/obj/item/organ/xenos - name = "xeno organ" - icon = 'icons/effects/blood.dmi' - desc = "It smells like an accident in a chemical factory." - -/obj/item/organ/xenos/eggsac - name = "egg sac" - icon_state = "xgibmid1" - organ_tag = "egg sac" - organ_type = /datum/internal_organ/xenos/eggsac - -/obj/item/organ/xenos/plasmavessel - name = "plasma vessel" - icon_state = "xgibdown1" - organ_tag = "plasma vessel" - organ_type = /datum/internal_organ/xenos/plasmavessel - -/obj/item/organ/xenos/acidgland - name = "acid gland" - icon_state = "xgibtorso" - organ_tag = "acid gland" - organ_type = /datum/internal_organ/xenos/acidgland - -/obj/item/organ/xenos/hivenode - name = "hive node" - icon_state = "xgibmid2" - organ_tag = "hive node" - organ_type = /datum/internal_organ/xenos/hivenode - -/obj/item/organ/xenos/resinspinner - name = "hive node" - icon_state = "xgibmid2" - organ_tag = "resin spinner" - organ_type = /datum/internal_organ/xenos/resinspinner diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm deleted file mode 100644 index 25ce3a45c27..00000000000 --- a/code/modules/organs/organ_internal.dm +++ /dev/null @@ -1,420 +0,0 @@ -/datum/internal_organ - var/name = "organ" - var/mob/living/carbon/human/owner = null - var/vital //Lose a vital limb, die immediately. - var/damage = 0 // amount of damage to the organ - var/min_bruised_damage = 10 - var/min_broken_damage = 30 - var/parent_limb = "chest" - var/robotic = 0 //1 for 'assisted' organs (e.g. pacemaker), 2 for actual cyber organ. - var/removed_type //When removed, forms this object. - var/robotic_type //robotic version of removed_type, used in mechanize(). - var/obj/item/organ/organ_holder // If not in a body, held in this item. - var/list/transplant_data - var/organ_id - /// State of the organ - var/organ_status = ORGAN_HEALTHY - -/datum/internal_organ/process() - return 0 - -/datum/internal_organ/Destroy() - owner = null - organ_holder = null - return ..() - -/datum/internal_organ/New(mob/living/carbon/carbon_mob) - ..() - if(!istype(carbon_mob)) - return - - carbon_mob.internal_organs |= src - owner = carbon_mob - RegisterSignal(owner, COMSIG_QDELETING, PROC_REF(clean_owner)) - - if(!ishuman(carbon_mob)) - return - var/mob/living/carbon/human/human = carbon_mob - var/datum/limb/limb = human.get_limb(parent_limb) - LAZYDISTINCTADD(limb.internal_organs, src) - -///Signal handler to prevent hard del -/datum/internal_organ/proc/clean_owner() - SIGNAL_HANDLER - owner = null - -/datum/internal_organ/proc/take_damage(amount, silent= FALSE) - if(SSticker.mode?.flags_round_type & MODE_NO_PERMANENT_WOUNDS) - return - if(amount <= 0) - heal_organ_damage(-amount) - return - if(robotic == ORGAN_ROBOT) - damage += (amount * 0.8) - else - damage += amount - - var/datum/limb/parent = owner.get_limb(parent_limb) - if (!silent) - owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) - set_organ_status() - -/// Set the correct organ state -/datum/internal_organ/proc/set_organ_status() - if(damage > min_broken_damage) - if(organ_status != ORGAN_BROKEN) - organ_status = ORGAN_BROKEN - return TRUE - return FALSE - if(damage > min_bruised_damage) - if(organ_status != ORGAN_BRUISED) - organ_status = ORGAN_BRUISED - return TRUE - return FALSE - if(organ_status != ORGAN_HEALTHY) - organ_status = ORGAN_HEALTHY - return TRUE - -/datum/internal_organ/proc/heal_organ_damage(amount) - damage = max(damage - amount, 0) - set_organ_status() - -/datum/internal_organ/proc/remove(mob/user) - - if(!removed_type) return 0 - - var/obj/item/organ/removed_organ = new removed_type(get_turf(user), src) - - if(istype(removed_organ)) - organ_holder = removed_organ - - return removed_organ - -/datum/internal_organ/proc/emp_act(severity) - switch(robotic) - if(0) - return - if(1) - switch (severity) - if (1.0) - take_damage(20,0) - return - if (2.0) - take_damage(7,0) - return - if(3.0) - take_damage(3,0) - return - if(2) - switch (severity) - if (1.0) - take_damage(40,0) - return - if (2.0) - take_damage(15,0) - return - if(3.0) - take_damage(10,0) - return - -/datum/internal_organ/proc/mechanize() //Being used to make robutt hearts, etc - if(robotic_type) - robotic = ORGAN_ROBOT - removed_type = robotic_type - -/datum/internal_organ/proc/mechassist() //Used to add things like pacemakers, etc - robotic = ORGAN_ASSISTED - min_bruised_damage = 15 - min_broken_damage = 35 - -/**************************************************** - INTERNAL ORGANS TYPES -****************************************************/ - -/datum/internal_organ/heart // This is not set to vital because death immediately occurs in blood.dm if it is removed. Also, all damage effects are handled there. - name = "heart" - parent_limb = "chest" - removed_type = /obj/item/organ/heart - robotic_type = /obj/item/organ/heart/prosthetic - organ_id = ORGAN_HEART - -/datum/internal_organ/heart/process() - . = ..() - - if(organ_status == ORGAN_BRUISED && prob(5)) - owner.emote("me", 1, "grabs at [owner.p_their()] chest!") - else if(organ_status == ORGAN_BROKEN && prob(20)) - owner.emote("me", 1, "clutches [owner.p_their()] chest!") - -/datum/internal_organ/heart/set_organ_status() - var/old_organ_status = organ_status - . = ..() - if(!.) - return - owner.max_stamina_buffer += (old_organ_status - organ_status) * 25 - owner.maxHealth += (old_organ_status - organ_status) * 20 - -/datum/internal_organ/heart/prosthetic //used by synthetic species - robotic = ORGAN_ROBOT - removed_type = /obj/item/organ/heart/prosthetic - -/datum/internal_organ/lungs - name = "lungs" - parent_limb = "chest" - removed_type = /obj/item/organ/lungs - robotic_type = /obj/item/organ/lungs/prosthetic - organ_id = ORGAN_LUNGS - -/datum/internal_organ/lungs/process() - ..() - - if((organ_status == ORGAN_BRUISED && prob(5)) || (organ_status == ORGAN_BROKEN && prob(20))) - owner.emote("me", 1, "gasps for air!") - -/datum/internal_organ/lungs/set_organ_status() - . = ..() - if(!.) - return - // For example, bruised lungs will reduce stamina regen by 40%, broken by 80% - owner.add_stamina_regen_modifier(name, organ_status * -0.40) - // Slowdown added when the heart is damaged - owner.add_movespeed_modifier(id = name, override = TRUE, multiplicative_slowdown = organ_status) - -/datum/internal_organ/lungs/take_damage(amount, silent= FALSE) - owner.adjust_Losebreath(amount) //Hits of 1 damage or less won't do anything due to how losebreath works, but any stronger and we'll get the wind knocked out of us for a bit. Mostly just flavor. - return ..() - -/datum/internal_organ/lungs/prosthetic - robotic = ORGAN_ROBOT - removed_type = /obj/item/organ/lungs/prosthetic - -/datum/internal_organ/liver - name = "liver" - parent_limb = "chest" - removed_type = /obj/item/organ/liver - robotic_type = /obj/item/organ/liver/prosthetic - organ_id = ORGAN_LIVER - ///lower value, higher resistance. - var/alcohol_tolerance = 0.005 - ///How fast we clean out toxins/toxloss. Adjusts based on organ damage. - var/filter_rate = 3 - -/datum/internal_organ/liver/process() - ..() - - //High toxins levels are dangerous if you aren't actively treating them. 100 seconds to hit bruised from this alone - if(owner.getToxLoss() >= (80 - 20 * organ_status)) - //Healthy liver suffers on its own - if(organ_status != ORGAN_BROKEN) - take_damage(0.2, TRUE) - //Damaged one shares the fun - else - var/datum/internal_organ/O = pick(owner.internal_organs) - O?.take_damage(0.2, TRUE) - - // Heal a bit if needed and we're not busy. This allows recovery from low amounts of toxins. - if(!owner.drunkenness && owner.getToxLoss() <= 15 && organ_status == ORGAN_HEALTHY) - heal_organ_damage(0.04) - - // Do some reagent filtering/processing. - for(var/datum/reagent/potential_toxin AS in owner.reagents.reagent_list) - //Liver helps clear out any toxins but with drawbacks if damaged - if(istype(potential_toxin, /datum/reagent/consumable/ethanol) || istype(potential_toxin, /datum/reagent/toxin)) - if(organ_status != ORGAN_HEALTHY) - owner.adjustToxLoss(0.3 * organ_status) - owner.reagents.remove_reagent(potential_toxin.type, potential_toxin.custom_metabolism * filter_rate * 0.1) - - //Heal toxin damage slowly if not damaged. If broken, increase it instead. - owner.adjustToxLoss((2 - filter_rate) * 0.1) - if(prob(organ_status)) //Just under once every three minutes while bruised, twice as often while broken. - owner.vomit() //No stomach, so the liver can cause vomiting instead. Stagger and slowdown plus feedback that something's wrong. - -/datum/internal_organ/liver/set_organ_status() - . = ..() - if(!.) - return - filter_rate = initial(filter_rate) - organ_status - -/datum/internal_organ/liver/prosthetic - robotic = ORGAN_ROBOT - removed_type = /obj/item/organ/liver/prosthetic - alcohol_tolerance = 0.003 - -/datum/internal_organ/kidneys - name = "kidneys" - parent_limb = "groin" - removed_type = /obj/item/organ/kidneys - robotic_type = /obj/item/organ/kidneys/prosthetic - organ_id = ORGAN_KIDNEYS - ///Tracks the number of reagent/medicine datums we currently have - var/current_medicine_count = 0 - ///How many drugs we can take before they overwhelm us. Decreases with damage - var/current_medicine_cap = 5 - ///Whether we were over cap the last time we checked. - var/old_overflow = FALSE - ///Total medicines added since last tick - var/new_medicines = 0 - ///Total medicines removed since last tick - var/removed_medicines = 0 - -/datum/internal_organ/kidneys/New(mob/living/carbon/carbon_mob) - . = ..() - if(!carbon_mob) - return - RegisterSignal(carbon_mob.reagents, COMSIG_NEW_REAGENT_ADD, PROC_REF(owner_added_reagent)) - RegisterSignal(carbon_mob.reagents, COMSIG_REAGENT_DELETING, PROC_REF(owner_removed_reagent)) - -/datum/internal_organ/kidneys/clean_owner() - if(owner?.reagents) - UnregisterSignal(owner.reagents, list(COMSIG_NEW_REAGENT_ADD, COMSIG_REAGENT_DELETING)) - return ..() - -///Signaled proc. Check if the added reagent was under reagent/medicine. If so, increment medicine counter and potentially notify owner. -/datum/internal_organ/kidneys/proc/owner_added_reagent(datum/source, reagent_type, amount) - SIGNAL_HANDLER - if(!ispath(reagent_type, /datum/reagent/medicine)) - return - new_medicines++ - -///Signaled proc. Check if the removed reagent was under reagent/medicine. If so, decrement medicine counter and potentially notify owner. -/datum/internal_organ/kidneys/proc/owner_removed_reagent(datum/source, reagent_type) - SIGNAL_HANDLER - if(!ispath(reagent_type, /datum/reagent/medicine)) - return - removed_medicines++ - -/datum/internal_organ/kidneys/set_organ_status() - . = ..() - if(!.) - return - current_medicine_cap = initial(current_medicine_cap) - 2 * organ_status - -/datum/internal_organ/kidneys/process() - ..() - - var/bypass = FALSE - - if(owner.bodytemperature <= 170) //No sense worrying about a chem cap if we're in cryo anyway. Still need to clear tick counts. - bypass = TRUE - - current_medicine_count += new_medicines //We want to include medicines that were individually both added and removed this tick - var/overflow = current_medicine_count - current_medicine_cap //This catches any case where a reagent was added with volume below its metabolism - current_medicine_count -= removed_medicines //Otherwise, you can microdose infinite chems without kidneys complaining - - new_medicines = 0 - removed_medicines = 0 - - if(overflow < 1 || bypass) - if(old_overflow) - to_chat(owner, span_notice("You don't feel as overwhelmed by all the drugs any more.")) - old_overflow = FALSE - return - - if(!old_overflow) - to_chat(owner, span_warning("All the different drugs in you are starting to make you feel off...")) - old_overflow = TRUE - - owner.set_drugginess(3) - if(prob(overflow * (organ_status + 1) * 10)) - owner.Confused(2 SECONDS * (organ_status + 1)) - -/datum/internal_organ/kidneys/prosthetic - robotic = ORGAN_ROBOT - removed_type = /obj/item/organ/kidneys - -/datum/internal_organ/brain - name = "brain" - parent_limb = "head" - removed_type = /obj/item/organ/brain - robotic_type = /obj/item/organ/brain/prosthetic - vital = TRUE - organ_id = ORGAN_BRAIN - -/datum/internal_organ/brain/set_organ_status() - var/old_organ_status = organ_status - . = ..() - if(!.) - return - owner.set_skills(owner.skills.modifyAllRatings(old_organ_status - organ_status)) - if(organ_status >= ORGAN_BRUISED) - ADD_TRAIT(owner, TRAIT_DROOLING, BRAIN_TRAIT) - else - REMOVE_TRAIT(owner, TRAIT_DROOLING, BRAIN_TRAIT) - -/datum/internal_organ/brain/prosthetic //used by synthetic species - robotic = ORGAN_ROBOT - removed_type = /obj/item/organ/brain/prosthetic - -/datum/internal_organ/brain/xeno - removed_type = /obj/item/organ/brain/xeno - robotic_type = null - -/datum/internal_organ/brain/zombie - vital = FALSE - -/datum/internal_organ/eyes - name = "eyes" - parent_limb = "head" - removed_type = /obj/item/organ/eyes - robotic_type = /obj/item/organ/eyes/prosthetic - var/eye_surgery_stage = 0 //stores which stage of the eye surgery the eye is at - organ_id = ORGAN_EYES - -/datum/internal_organ/eyes/process() //Eye damage replaces the old eye_stat var. - ..() - if(organ_status == ORGAN_BRUISED) - owner.set_blurriness(20) - if(organ_status == ORGAN_BROKEN) - owner.set_blindness(20) - -/datum/internal_organ/eyes/prosthetic - robotic = ORGAN_ROBOT - removed_type = /obj/item/organ/eyes/prosthetic - -/datum/internal_organ/appendix - name = "appendix" - parent_limb = "groin" - removed_type = /obj/item/organ/appendix - organ_id = ORGAN_APPENDIX - -/datum/internal_organ/stomach - name = "stomach" - removed_type = /obj/item/organ/stomach - organ_id = ORGAN_STOMACH - ///This is a reagent user and needs more then the 10u from edible component - var/reagent_vol = 1000 - ///The rate that the stomach will transfer reagents to the body - var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 - ///The reagents we are processing - var/datum/reagents/reagents = null - -/datum/internal_organ/stomach/process() - ..() - - var/mob/living/carbon/human/body = owner - - // digest food, send all reagents that can be metabolized to the body - for(var/datum/reagent/bit AS in reagents?.reagent_list) - //Do not transfer over more then we have - var/amount_max = bit.volume - - // Transfer the amount of reagents based on volume with a min amount of 1u - var/rate_minimum = max(bit.custom_metabolism, 0.25) - var/amount = min((round(metabolism_efficiency * amount_max, 0.05) + rate_minimum), amount_max) - - if(amount <= 0) - continue - - // transfer the reagents over to the body at the rate of the stomach metabolim - // this way the body is where all reagents that are processed and react - // the stomach manages how fast they are feed in a drip style - reagents.trans_to(body, amount) - - //If the stomach is not damage exit out - if(damage < min_bruised_damage) - return - - if(prob(0.0125 * damage) || damage > min_broken_damage && prob(0.05 * damage)) - body.vomit() - to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down all that food!")) - return diff --git a/code/modules/organs/organ_objects.dm b/code/modules/organs/organ_objects.dm deleted file mode 100644 index 145e00d266c..00000000000 --- a/code/modules/organs/organ_objects.dm +++ /dev/null @@ -1,231 +0,0 @@ -/obj/item/organ - name = "organ" - desc = "It looks like it probably just plopped out." - icon = 'icons/obj/items/organs.dmi' - icon_state = "appendix" - item_icons = list( - slot_l_hand_str = 'icons/mob/inhands/items/bodyparts_left.dmi', - slot_r_hand_str = 'icons/mob/inhands/items/bodyparts_right.dmi', - ) - // Process() ticks before death. - max_integrity = 100 - /// Squirts of blood left in it. - var/fresh = 3 - /// Icon used when the organ dies. - var/dead_icon - /// Is the limb prosthetic? - var/robotic - /// What slot does it go in? - var/organ_tag - /// Used to spawn the relevant organ data when produced via a machine or spawn(). - var/organ_type = /datum/internal_organ - /// Stores info when removed. - var/datum/internal_organ/organ_data - -/obj/item/organ/attack_self(mob/user as mob) - - // Convert it to an edible form, yum yum. - if(!robotic && user.a_intent == INTENT_HELP && user.zone_selected == "mouth") - bitten(user) - return - -/obj/item/organ/Initialize(mapload, organ_datum) - . = ..() - create_reagents(5) - if(organ_datum) - organ_data = organ_datum - else - organ_data = new organ_type() - if(!robotic) - START_PROCESSING(SSobj, src) - -/obj/item/organ/Destroy() - if(!robotic) - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/organ/process() - - if(robotic) - STOP_PROCESSING(SSobj, src) - return - - // Don't process if we're in a freezer, an MMI or a stasis bag. //TODO: ambient temperature? - if(istype(loc,/obj/item/mmi) || istype(loc,/obj/item/bodybag/cryobag) || istype(loc,/obj/structure/closet/crate/freezer)) - return - - if(fresh && prob(40)) - fresh-- - var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list - if(B) - var/turf/TU = get_turf(src) - var/list/L = list() - if(B.data["blood_DNA"]) - L = list(B.data["blood_DNA"] = B.data["blood_type"]) - TU.add_blood(L, B.color) - //blood_splatter(src,B,1) - - take_damage(rand(0,1)) - if(obj_integrity <= 0) - die() - -/obj/item/organ/proc/removed(mob/living/target,mob/living/user) - - if(!target || !user) - return - - if(organ_data.vital) - log_combat(user, target, "removed a vital organ ([src])", addition="(INTENT: [uppertext(user.a_intent)])") - target.death() - -/obj/item/organ/proc/replaced(mob/living/target) - return - -/obj/item/organ/proc/bitten(mob/user) - - if(robotic) - return - - to_chat(user, span_notice("You take an experimental bite out of \the [src].")) - var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list - if(B) - var/turf/TU = get_turf(src) - var/list/L = list() - if(B.data["blood_DNA"]) - L = list(B.data["blood_DNA"] = B.data["blood_type"]) - TU.add_blood(L, B.color) - - user.temporarilyRemoveItemFromInventory(src) - var/obj/item/reagent_containers/food/snacks/organ/O = new(get_turf(src)) - O.name = name - O.icon_state = dead_icon ? dead_icon : icon_state - - // Pass over the blood. - reagents.trans_to(O, reagents.total_volume) - - user.put_in_active_hand(O) - qdel(src) - -/obj/item/organ/proc/die() - name = "dead [initial(name)]" - if(dead_icon) icon_state = dead_icon - obj_integrity = 0 - STOP_PROCESSING(SSobj, src) - //TODO: Grey out the icon state. - //TODO: Inject an organ with peridaxon to make it alive again. - -// Brain is defined in brain_item.dm. -/obj/item/organ/heart - name = "heart" - icon_state = "heart-on" - organ_tag = ORGAN_SLOT_HEART - fresh = 6 // Juicy. - dead_icon = "heart-off" - organ_type = /datum/internal_organ/heart - -/obj/item/organ/lungs - name = "lungs" - icon_state = "lungs" - gender = PLURAL - organ_tag = ORGAN_SLOT_LUNGS - organ_type = /datum/internal_organ/lungs - -/obj/item/organ/kidneys - name = "kidneys" - icon_state = "kidneys" - gender = PLURAL - organ_tag = ORGAN_SLOT_KIDNEYS - organ_type = /datum/internal_organ/kidneys - -/obj/item/organ/eyes - name = "eyeballs" - icon_state = "eyes" - gender = PLURAL - organ_tag = ORGAN_SLOT_EYES - organ_type = /datum/internal_organ/eyes - var/eye_colour - -/obj/item/organ/eyes/removed(mob/living/target,mob/living/user) - - if(!eye_colour) - eye_colour = list(0,0,0) - - ..() //Make sure target is set so we can steal their eye colour for later. - var/mob/living/carbon/human/H = target - if(istype(H)) - eye_colour = list( - H.r_eyes ? H.r_eyes : 0, - H.g_eyes ? H.g_eyes : 0, - H.b_eyes ? H.b_eyes : 0 - ) - - // Leave bloody red pits behind! - H.r_eyes = 128 - H.g_eyes = 0 - H.b_eyes = 0 - H.update_body() - -/obj/item/organ/eyes/replaced(mob/living/target) - - // Apply our eye colour to the target. - var/mob/living/carbon/human/H = target - if(istype(H) && eye_colour) - H.r_eyes = eye_colour[1] - H.g_eyes = eye_colour[2] - H.b_eyes = eye_colour[3] - H.update_body() - -/obj/item/organ/liver - name = "liver" - icon_state = "liver" - organ_tag = ORGAN_SLOT_LIVER - organ_type = /datum/internal_organ/liver - -/obj/item/organ/appendix - name = "appendix" - icon_state = "appendix" - organ_type = /datum/internal_organ/appendix - organ_tag = ORGAN_SLOT_APPENDIX - -//These are here so they can be printed out via the fabricator. -/obj/item/organ/heart/prosthetic - name = "circulatory pump" - icon_state = "heart-prosthetic" - robotic = ORGAN_ROBOT - organ_type = /datum/internal_organ/heart/prosthetic - -/obj/item/organ/lungs/prosthetic - robotic = ORGAN_ROBOT - name = "gas exchange system" - icon_state = "lungs-prosthetic" - organ_type = /datum/internal_organ/lungs/prosthetic - -/obj/item/organ/kidneys/prosthetic - robotic = ORGAN_ROBOT - name = "prosthetic kidneys" - icon_state = "kidneys-prosthetic" - organ_type = /datum/internal_organ/kidneys/prosthetic - -/obj/item/organ/eyes/prosthetic - robotic = ORGAN_ROBOT - name = "visual prosthesis" - icon_state = "eyes-prosthetic" - organ_type = /datum/internal_organ/eyes/prosthetic - -/obj/item/organ/liver/prosthetic - robotic = ORGAN_ROBOT - name = "toxin filter" - icon_state = "liver-prosthetic" - organ_type = /datum/internal_organ/liver/prosthetic - -/obj/item/organ/brain/prosthetic - robotic = ORGAN_ROBOT - name = "cyberbrain" - icon_state = "brain-prosthetic" - organ_type = /datum/internal_organ/brain/prosthetic - -/obj/item/organ/stomach - name = "stomach" - icon_state = "stomach" - organ_tag = "stomach" - organ_type = /datum/internal_organ/stomach diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm new file mode 100644 index 00000000000..2b590eba573 --- /dev/null +++ b/code/modules/organs/organs.dm @@ -0,0 +1,250 @@ +// This is not set to vital because death immediately occurs in blood.dm if it is removed. Also, all damage effects are handled there. +/obj/item/organ/heart + name = "heart" + icon_state = "heart-on" + slot = ORGAN_SLOT_HEART + +/obj/item/organ/heart/process() + if(organ_status == ORGAN_BRUISED && prob(5)) + owner.emote("me", 1, "grabs at [owner.p_their()] chest!") + else if(organ_status == ORGAN_BROKEN && prob(20)) + owner.emote("me", 1, "clutches [owner.p_their()] chest!") + +/obj/item/organ/heart/set_organ_status() + var/old_organ_status = organ_status + . = ..() + if(!.) + return + owner.max_stamina_buffer += (old_organ_status - organ_status) * 25 + owner.maxHealth += (old_organ_status - organ_status) * 20 + +/obj/item/organ/lungs + name = "lungs" + icon_state = "lungs" + gender = PLURAL + slot = ORGAN_SLOT_LUNGS + +/obj/item/organ/lungs/process() + if((organ_status == ORGAN_BRUISED && prob(5)) || (organ_status == ORGAN_BROKEN && prob(20))) + owner.emote("me", 1, "gasps for air!") + +/obj/item/organ/lungs/set_organ_status() + . = ..() + if(!.) + return + // For example, bruised lungs will reduce stamina regen by 40%, broken by 80% + owner.add_stamina_regen_modifier(name, organ_status * -0.40) + // Slowdown added when the heart is damaged + owner.add_movespeed_modifier(name, override = TRUE, multiplicative_slowdown = organ_status) + +//Hits of 1 damage or less won't do anything due to how losebreath works, but any stronger and we'll get the wind knocked out of us for a bit. Mostly just flavor. +/obj/item/organ/lungs/get_damage(amount, silent = FALSE) + owner.adjust_Losebreath(amount) + return ..() + +/obj/item/organ/kidneys + name = "kidneys" + icon_state = "kidneys" + gender = PLURAL + slot = ORGAN_SLOT_KIDNEYS + parent_limb = BODY_ZONE_PRECISE_GROIN + ///Tracks the number of reagent/medicine datums we currently have + var/current_medicine_count = 0 + ///How many drugs we can take before they overwhelm us. Decreases with damage + var/current_medicine_cap = 5 + ///Whether we were over cap the last time we checked. + var/old_overflow = FALSE + ///Total medicines added since last tick + var/new_medicines = 0 + ///Total medicines removed since last tick + var/removed_medicines = 0 + +/obj/item/organ/kidneys/Initialize(mapload) + . = ..() + if(!owner) + return + RegisterSignal(owner.reagents, COMSIG_NEW_REAGENT_ADD, PROC_REF(owner_added_reagent)) + RegisterSignal(owner.reagents, COMSIG_REAGENT_DELETING, PROC_REF(owner_removed_reagent)) + +/obj/item/organ/kidneys/clean_owner() + if(owner?.reagents) + UnregisterSignal(owner.reagents, list(COMSIG_NEW_REAGENT_ADD, COMSIG_REAGENT_DELETING)) + return ..() + +///Signaled proc. Check if the added reagent was under reagent/medicine. If so, increment medicine counter and potentially notify owner. +/obj/item/organ/kidneys/proc/owner_added_reagent(datum/source, reagent_type, amount) + SIGNAL_HANDLER + if(!ispath(reagent_type, /datum/reagent/medicine)) + return + new_medicines++ + +///Signaled proc. Check if the removed reagent was under reagent/medicine. If so, decrement medicine counter and potentially notify owner. +/obj/item/organ/kidneys/proc/owner_removed_reagent(datum/source, reagent_type) + SIGNAL_HANDLER + if(!ispath(reagent_type, /datum/reagent/medicine)) + return + removed_medicines++ + +/obj/item/organ/kidneys/set_organ_status() + . = ..() + if(!.) + return + current_medicine_cap = initial(current_medicine_cap) - 2 * organ_status + +/obj/item/organ/kidneys/process() + var/bypass = FALSE + + if(owner.bodytemperature <= 170) //No sense worrying about a chem cap if we're in cryo anyway. Still need to clear tick counts. + bypass = TRUE + + current_medicine_count += new_medicines //We want to include medicines that were individually both added and removed this tick + var/overflow = current_medicine_count - current_medicine_cap //This catches any case where a reagent was added with volume below its metabolism + current_medicine_count -= removed_medicines //Otherwise, you can microdose infinite chems without kidneys complaining + + new_medicines = 0 + removed_medicines = 0 + + if(overflow < 1 || bypass) + if(old_overflow) + to_chat(owner, span_notice("You don't feel as overwhelmed by all the drugs any more.")) + old_overflow = FALSE + return + + if(!old_overflow) + to_chat(owner, span_warning("All the different drugs in you are starting to make you feel off...")) + old_overflow = TRUE + + owner.set_drugginess(3) + if(prob(overflow * (organ_status + 1) * 10)) + owner.Confused(2 SECONDS * (organ_status + 1)) + +/obj/item/organ/liver + name = "liver" + icon_state = "liver" + slot = ORGAN_SLOT_LIVER + ///lower value, higher resistance. + var/alcohol_tolerance = 0.005 + ///How fast we clean out toxins/toxloss. Adjusts based on organ damage. + var/filter_rate = 3 + +/obj/item/organ/liver/process() + //High toxins levels are dangerous if you aren't actively treating them. 100 seconds to hit bruised from this alone + if(owner.getToxLoss() >= (80 - 20 * organ_status)) + //Healthy liver suffers on its own + if(organ_status != ORGAN_BROKEN) + get_damage(0.2, TRUE) + //Damaged one shares the fun + else + var/obj/item/organ/O = pick(owner.internal_organs) + O?.get_damage(0.2, TRUE) + + // Heal a bit if needed and we're not busy. This allows recovery from low amounts of toxins. + if(!owner.drunkenness && owner.getToxLoss() <= 15 && organ_status == ORGAN_HEALTHY) + heal_organ_damage(0.04) + + // Do some reagent filtering/processing. + for(var/datum/reagent/potential_toxin AS in owner.reagents.reagent_list) + //Liver helps clear out any toxins but with drawbacks if damaged + if(istype(potential_toxin, /datum/reagent/consumable/ethanol) || istype(potential_toxin, /datum/reagent/toxin)) + if(organ_status != ORGAN_HEALTHY) + owner.adjustToxLoss(0.3 * organ_status) + owner.reagents.remove_reagent(potential_toxin.type, potential_toxin.custom_metabolism * filter_rate * 0.1) + + //Heal toxin damage slowly if not damaged. If broken, increase it instead. + owner.adjustToxLoss((2 - filter_rate) * 0.1) + if(prob(organ_status)) //Just under once every three minutes while bruised, twice as often while broken. + owner.vomit() //No stomach, so the liver can cause vomiting instead. Stagger and slowdown plus feedback that something's wrong. + +/obj/item/organ/liver/set_organ_status() + . = ..() + if(!.) + return + filter_rate = initial(filter_rate) - organ_status + +/obj/item/organ/appendix + name = "appendix" + icon_state = "appendix" + slot = ORGAN_SLOT_APPENDIX + parent_limb = BODY_ZONE_PRECISE_GROIN + +/obj/item/organ/stomach + name = "stomach" + icon_state = "stomach" + slot = ORGAN_SLOT_STOMACH + ///This is a reagent user and needs more then the 10u from edible component + var/reagent_vol = 1000 + ///The rate that the stomach will transfer reagents to the body + var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 + +/obj/item/organ/stomach/process() + var/mob/living/carbon/human/body = owner + + // digest food, send all reagents that can be metabolized to the body + for(var/datum/reagent/bit AS in reagents?.reagent_list) + //Do not transfer over more then we have + var/amount_max = bit.volume + + // Transfer the amount of reagents based on volume with a min amount of 1u + var/rate_minimum = max(bit.custom_metabolism, 0.25) + var/amount = min((round(metabolism_efficiency * amount_max, 0.05) + rate_minimum), amount_max) + + if(amount <= 0) + continue + + // transfer the reagents over to the body at the rate of the stomach metabolim + // this way the body is where all reagents that are processed and react + // the stomach manages how fast they are feed in a drip style + reagents.trans_to(body, amount) + + //If the stomach is not damage exit out + if(damage < min_bruised_damage) + return + + if(prob(0.0125 * damage) || damage > min_broken_damage && prob(0.05 * damage)) + body.vomit() + to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down all that food!")) + return + +/obj/item/organ/eyes + name = "eyeballs" + icon_state = "eyes" + gender = PLURAL + slot = ORGAN_SLOT_EYES + parent_limb = BODY_ZONE_HEAD + ///stores which stage of the eye surgery the eye is at + var/eye_surgery_stage = 0 + +/obj/item/organ/eyes/process() + if(organ_status == ORGAN_BRUISED) + owner.set_blurriness(20) + if(organ_status == ORGAN_BROKEN) + owner.set_blindness(20) + +/obj/item/organ/brain + name = "brain" + icon_state = "brain2" + parent_limb = BODY_ZONE_HEAD + var/mob/living/brain/brainmob = null + +/obj/item/organ/brain/set_organ_status() + var/old_organ_status = organ_status + . = ..() + if(!.) + return + owner.set_skills(owner.skills.modifyAllRatings(old_organ_status - organ_status)) + if(organ_status >= ORGAN_BRUISED) + ADD_TRAIT(owner, TRAIT_DROOLING, BRAIN_TRAIT) + else + REMOVE_TRAIT(owner, TRAIT_DROOLING, BRAIN_TRAIT) + +// I'm not sure if this proc is even used +/obj/item/organ/brain/proc/transfer_identity(mob/living/carbon/H) + name = "[H]'s brain" + brainmob = new(src) + brainmob.name = H.real_name + brainmob.real_name = H.real_name + brainmob.timeofhostdeath = H.timeofdeath + if(H.mind) + H.mind.transfer_to(brainmob) + + to_chat(brainmob, span_notice("You feel slightly disoriented. That's normal when you're just a brain.")) diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index 34d6c5ba1ff..73345fb2509 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -117,7 +117,7 @@ // Damage to internal organs hurts a lot. var/datum/limb/parent - for(var/datum/internal_organ/I in internal_organs) + for(var/obj/item/organ/I in internal_organs) parent = get_limb(I.parent_limb) if(prob(2)) switch(I.damage) diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index 6b7b3600819..c91143578ac 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -173,7 +173,7 @@ else if(transfer_to_stomach && ishuman(target)) var/mob/living/carbon/human/eater = target - var/datum/internal_organ/stomach/belly = eater.get_organ_slot(ORGAN_SLOT_STOMACH) + var/obj/item/organ/stomach/belly = eater.get_organ_slot(ORGAN_SLOT_STOMACH) if(belly.organ_status != ORGAN_HEALTHY && prob(belly.damage * 3)) var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) if(expel_amount > 0 ) diff --git a/code/modules/reagents/reagents/alcohol.dm b/code/modules/reagents/reagents/alcohol.dm index 4b7b0af9ab6..e205302f665 100644 --- a/code/modules/reagents/reagents/alcohol.dm +++ b/code/modules/reagents/reagents/alcohol.dm @@ -40,7 +40,7 @@ All effects don't start immediately, but rather get worse over time; the rate is C.drunkenness = max((C.drunkenness + (sqrt(volume) * boozepwr * ALCOHOL_RATE)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk. if(ishuman(C)) var/mob/living/carbon/human/H = C - var/datum/internal_organ/liver/O = H.get_organ_slot(ORGAN_SLOT_LIVER) + var/obj/item/organ/liver/O = H.get_organ_slot(ORGAN_SLOT_LIVER) if (istype(O)) O.take_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * O.alcohol_tolerance, 0)) * 0.002), TRUE) @@ -279,7 +279,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(prob(5)) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(istype(E)) E.take_damage(2) if(200 to INFINITY) @@ -291,7 +291,7 @@ All effects don't start immediately, but rather get worse over time; the rate is L.druggy = max(L.druggy, 60) if(ishuman(L) && prob(10)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(istype(E)) if(H.species.species_flags ~! NO_PAIN) to_chat(H, span_danger("You clutch for a moment as you feel a scorching pain covering your abdomen!")) diff --git a/code/modules/reagents/reagents/drink.dm b/code/modules/reagents/reagents/drink.dm index dfe3b25fff0..cc1b825b51a 100644 --- a/code/modules/reagents/reagents/drink.dm +++ b/code/modules/reagents/reagents/drink.dm @@ -215,7 +215,7 @@ L.jitter(2) if(prob(5) && ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.take_damage(1, TRUE) L.emote(pick("twitch", "blink_r", "shiver")) @@ -228,7 +228,7 @@ L.Unconscious(10 SECONDS) if(prob(30) && ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.take_damage(1, TRUE) diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index dca1d3b2643..37ba5146c11 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -41,7 +41,7 @@ L.setDrowsyness(L.drowsyness, 20) if(ishuman(L)) //Critical overdose causes total blackout and heart damage. Too much stimulant var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) E.take_damage(0.5*effect_str, TRUE) if(prob(10)) L.emote(pick("twitch","blink_r","shiver")) @@ -163,7 +163,7 @@ L.reagent_pain_modifier += PAIN_REDUCTION_VERY_HEAVY if(ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.take_damage(3*effect_str, TRUE) @@ -401,7 +401,7 @@ if(!ishuman(L)) return var/mob/living/carbon/human/H = L - var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) E.take_damage(0.5*effect_str, TRUE) @@ -409,7 +409,7 @@ L.apply_damages(2*effect_str, 2*effect_str) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) E.take_damage(1.5*effect_str, TRUE) @@ -698,7 +698,7 @@ L.adjust_blindness(-5) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) E.heal_organ_damage(effect_str) return ..() @@ -724,7 +724,7 @@ if(!ishuman(L)) return ..() var/mob/living/carbon/human/H = L - var/datum/internal_organ/organ = H.get_damaged_organ() + var/obj/item/organ/organ = H.get_damaged_organ() if(!organ) return ..() organ.heal_organ_damage(3 * effect_str) @@ -989,13 +989,13 @@ if(prob(15) && ishuman(L)) var/mob/living/carbon/human/H = L var/affected_organ = pick(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_KIDNEYS, ORGAN_SLOT_STOMACH) - var/datum/internal_organ/I = H.get_organ_slot(affected_organ) + var/obj/item/organ/I = H.get_organ_slot(affected_organ) I.take_damage(5.5 * effect_str) /datum/reagent/medicine/ultrazine/overdose_process(mob/living/L, metabolism) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.take_damage(0.5*effect_str, TRUE) else @@ -1008,7 +1008,7 @@ L.adjustToxLoss(1.5*effect_str) else var/mob/living/carbon/human/H = L - var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.take_damage(1.5*effect_str, TRUE) diff --git a/code/modules/surgery/brainrepair.dm b/code/modules/surgery/brainrepair.dm index 1973708edd6..912da89ae47 100644 --- a/code/modules/surgery/brainrepair.dm +++ b/code/modules/surgery/brainrepair.dm @@ -7,7 +7,7 @@ var/dmg_max /datum/surgery_step/brain/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected, checks_only) - var/datum/internal_organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) if(!sponge || sponge.damage <= dmg_min || affected.surgery_open_stage != 3 || target_zone != "head") return SURGERY_CANNOT_USE if(dmg_max && sponge.damage > dmg_max) @@ -38,7 +38,7 @@ user.visible_message(span_notice("[user] takes out all the bone chips in [target]'s brain with \the [tool]."), \ span_notice("You take out all the bone chips in [target]'s brain with \the [tool].")) target.balloon_alert_to_viewers("Success") - var/datum/internal_organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.damage = 0 return ..() @@ -72,7 +72,7 @@ user.visible_message(span_notice("[user] mends hematoma in [target]'s brain with \the [tool]."), \ span_notice("You mend hematoma in [target]'s brain with \the [tool].")) target.balloon_alert_to_viewers("Success") - var/datum/internal_organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.damage = BONECHIPS_MAX_DAMAGE return ..() diff --git a/code/modules/surgery/eye.dm b/code/modules/surgery/eye.dm index 72ec78131eb..0d569366538 100644 --- a/code/modules/surgery/eye.dm +++ b/code/modules/surgery/eye.dm @@ -15,7 +15,7 @@ if(target_zone != "eyes") return 0 - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) if(!E) return 0 if(E.eye_surgery_stage == eye_step) @@ -42,13 +42,13 @@ user.visible_message(span_notice("[user] has separated the cornea on [target]'s eyes with \the [tool].") , \ span_notice("You have separated the cornea on [target]'s eyes with \the [tool]."),) target.balloon_alert_to_viewers("Success") - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.eye_surgery_stage = 1 target.disabilities |= NEARSIGHTED // code\#define\mobs.dm return ..() /datum/surgery_step/eye/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, slicing [target]'s eyes with \the [tool]!") , \ span_warning("Your hand slips, slicing [target]'s eyes with \the [tool]!") ) target.balloon_alert_to_viewers("Slipped!") @@ -77,12 +77,12 @@ user.visible_message(span_notice("[user] has lifted the cornea from [target]'s eyes with \the [tool].") , \ span_notice("You have lifted the cornea from [target]'s eyes with \the [tool].") ) target.balloon_alert_to_viewers("Success") - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.eye_surgery_stage = 2 return ..() /datum/surgery_step/eye/lift_eyes/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/datum/internal_organ/eyes/eyes = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/eyes = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, damaging [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, damaging [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") @@ -110,12 +110,12 @@ user.visible_message(span_notice("[user] mends the nerves and lenses in [target]'s with \the [tool].") , \ span_notice("You mend the nerves and lenses in [target]'s with \the [tool].")) target.balloon_alert_to_viewers("Success") - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.eye_surgery_stage = 3 return ..() /datum/surgery_step/eye/mend_eyes/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, stabbing \the [tool] into [target]'s eye!"), span_warning("Your hand slips, stabbing \the [tool] into [target]'s eye!")) target.balloon_alert_to_viewers("Slipped!") @@ -145,13 +145,13 @@ target.balloon_alert_to_viewers("Success") target.disabilities &= ~NEARSIGHTED target.disabilities &= ~BLIND - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.damage = 0 E.eye_surgery_stage = 0 return ..() /datum/surgery_step/eye/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, searing [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, searing [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") diff --git a/code/modules/surgery/mcomp_tendwounds.dm b/code/modules/surgery/mcomp_tendwounds.dm index 7a1acb0c92e..13dc0e24b97 100644 --- a/code/modules/surgery/mcomp_tendwounds.dm +++ b/code/modules/surgery/mcomp_tendwounds.dm @@ -95,7 +95,7 @@ /datum/surgery_step/mcomp_wounds/mtend_wounds/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) target.heal_overall_damage(65,65) - for(var/datum/internal_organ/organ in target.internal_organs) //Fixes all organs + for(var/obj/item/organ/organ in target.internal_organs) //Fixes all organs organ.heal_organ_damage(100) affected.surgery_open_stage = 0.75 diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 3856839e9a6..0a84818badb 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -81,20 +81,18 @@ success_sound = 'sound/misc/surgery/organ1.ogg' failure_sound = 'sound/misc/surgery/organ2.ogg' - /datum/surgery_step/internal/fix_organ/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected, checks_only) if(..()) if(affected.body_part == HEAD)//brain and eye damage is fixed by a separate surgery return SURGERY_CANNOT_USE - for(var/datum/internal_organ/I in affected.internal_organs) - if(I.damage > 0 && I.robotic != ORGAN_ROBOT) + for(var/obj/item/organ/I in affected.internal_organs) + if(I.damage > 0) return SURGERY_CAN_USE return SURGERY_CANNOT_USE - /datum/surgery_step/internal/fix_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - for(var/datum/internal_organ/I in affected.internal_organs) - if(I?.damage > 0 && I.robotic != ORGAN_ROBOT) + for(var/obj/item/organ/I in affected.internal_organs) + if(I?.damage > 0) user.visible_message(span_notice("[user] starts treating damage to [target]'s [I.name] with the surgical membrane."), \ span_notice("You start treating damage to [target]'s [I.name] with the surgical membrane.") ) target.balloon_alert_to_viewers("Fixing...") @@ -103,8 +101,8 @@ ..() /datum/surgery_step/internal/fix_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - for(var/datum/internal_organ/I in affected.internal_organs) - if(I?.damage > 0 && I.robotic != ORGAN_ROBOT) + for(var/obj/item/organ/I in affected.internal_organs) + if(I?.damage > 0) user.visible_message(span_notice("[user] treats damage to [target]'s [I.name] with surgical membrane."), \ span_notice("You treat damage to [target]'s [I.name] with surgical membrane.") ) @@ -121,62 +119,8 @@ if(istype(tool, /obj/item/tool/surgery/surgical_membrane)) target.adjustToxLoss(5) - for(var/datum/internal_organ/I in affected.internal_organs) + for(var/obj/item/organ/I in affected.internal_organs) if(I?.damage > 0) I.take_damage(dam_amt,0) target.updatehealth() affected.update_wounds() - - - -/datum/surgery_step/internal/fix_organ_robotic //For artificial organs - allowed_tools = list( - /obj/item/stack/nanopaste = 100, - /obj/item/tool/surgery/bonegel = 30, - /obj/item/tool/screwdriver = 70, - ) - - min_duration = 60 - max_duration = 80 - -/datum/surgery_step/internal/fix_organ_robotic/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected, checks_only) - if(..()) - if(affected.body_part == HEAD)//brain and eye damage is fixed by a separate surgery - return SURGERY_CANNOT_USE - for(var/datum/internal_organ/I in affected.internal_organs) - if(I.damage > 0 && I.robotic == ORGAN_ROBOT) - return SURGERY_CAN_USE - return SURGERY_CANNOT_USE - -/datum/surgery_step/internal/fix_organ_robotic/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - for(var/datum/internal_organ/I in affected.internal_organs) - if(I?.damage > 0 && I.robotic == ORGAN_ROBOT) - user.visible_message(span_notice("[user] starts mending the damage to [target]'s [I.name]'s mechanisms."), \ - span_notice("You start mending the damage to [target]'s [I.name]'s mechanisms.") ) - - target.balloon_alert_to_viewers("Mending...") - target.custom_pain("The pain in your [affected.display_name] is living hell!", 1) - ..() - -/datum/surgery_step/internal/fix_organ_robotic/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - for(var/datum/internal_organ/I in affected.internal_organs) - if(I?.damage > 0 && I.robotic == ORGAN_ROBOT) - user.visible_message(span_notice("[user] repairs [target]'s [I.name] with [tool]."), \ - span_notice("You repair [target]'s [I.name] with [tool].") ) - I.damage = 0 - target.balloon_alert_to_viewers("Success") - return ..() - -/datum/surgery_step/internal/fix_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - user.visible_message(span_warning("[user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.display_name] with \the [tool]!"), \ - span_warning("Your hand slips, gumming up the mechanisms inside of [target]'s [affected.display_name] with \the [tool]!")) - target.balloon_alert_to_viewers("Slipped!") - - target.adjustToxLoss(5) - affected.createwound(CUT, 5) - - for(var/datum/internal_organ/I in affected.internal_organs) - if(I) - I.take_damage(rand(3, 5), 0) - target.updatehealth() - affected.update_wounds() diff --git a/icons/obj/items/organs.dmi b/icons/obj/items/organs.dmi index 3cb475eceb9c0df019a582af56c44b63efd2b99f..b3cdbd539005c9d77bb2f1c5b024e544aa64aafe 100644 GIT binary patch literal 7427 zcma)hXH-*B({7Lwdhb<0ML>#xbV3Ie2qjVkq>A)TXp#^*N>dR~qz9x)lisUDI!F@% zDFF#JAOS*XAHH|pyVhOzertU{&e=a^X77FW%sl&CUAU^n7x2ZTlYUTO!^p$}z|+YRo|PYLG|~TC%LKFdP~3 zbevD_NiYEbTmz4^)Sm=r?PgPaV4ki=8Af&86i^cA6>z85zWG{I&w@FcEs8UVO#N0{ z-dZy~+v;C6BV+3VW7TNozNYgVC_@Ca)XX@@*kkR7mY5Y@8e@C;m zV@^+x)!S%0G){+&B{R}gKbR9|;tMizXs;_jPtz?-0V%0cmM)d{? z1Bi!BDaPq>mO<<1W5GRfqRAh(wK_w$Y7dYzR|hD*>6SYNnI)&Qw&9+YwU5md0H}{a zmrn09Hz1{%d~-I1l$~D4i>dl~c1N#DCLg^OqAnGO>tX5p)SuO9R1ba>9o zt^*7{nZ??X$5l4};S4<-krRv4c!~zx4V#iwoEQ-cAKR`9KQv6v23(u*^`~&!2q`YC zU_&l&o0Cji&fo6Rvw`HgOJL&d_*>G)edHt#liJ}lp4jKz2^}W{k8|!D`N!C~+G36~ zM-p;aR0@dj5Z2&;*Pp==aZZ(KHy>@AwANack16TVmH%X7qU57)?I6{jHJN^vyBV^0 zDk4)_Nl;Kwn5wqdblS1Iy1WoMMvNZxjX>2wq=qUc2#(r(?uaSf(E`7!{qV<)9MnIT0W)B1MZ3$ zsb+v*5X}D!93*t?AzsdSL%`qdA3>*eJyS-#jg8-Kl31X6krq`!iA?tMM0RT)I8@72 z;kiP2X&6@hK_|h&+dLaV#eEf1al$frvwLPMczt%$YGpmd#$)^YmB^QSr`ERpj8*R7L(AjKfWMq^pIKUBRb|aY&gr<%ItpM{# zHOb4KAB=;grk?_NMe@DGenGl(q%8eC8W(fFQtPltGS(zTK2R$kS2QKg@2wZYDFn4b ztE#{RcR9X1FXk4`Z8NI1dXNrOk}>*CoH`YPRzeY##3d(tMn)ck+hw$$Bf|ZnX##R8PD=XG0ICzRt&1MKK|Uuq82F&BVTp zlqK4Sz zJo-Mq@VZ%Bwe~2aWYTMx&%kVfiaDuefmfL*Kh?*YM*m5&UdC(qgIN@Y&X$^(o#E>l zHy|~Q77;m%-WkV4W6resVyjT6gbKRA)$lhD8a1gRxt@B203v-gtyoMEu^#bFHED{`B37 ziJwq_ZGfj`+XaK2YBlSE2PiXD!{I%A>+Ff2_>VPO5ArYxa7CP0%8eCZ4O0lIC>Rs5 z-P0x(1tksnR52Lefhjgstt8e;SdM#2uEc2Yg-4I{Kg&2C6E&UMH=(;%@w7@vLyI`9 z!#B71_3`|g7D#~vVe?00fM{PVO@3o!ZSXybUd7)O{a}?4igFY~ z{i0}hUCo|rh7zwgG=joz6AE(0FGP5j3lby}e^MyU+w!-vg$T zL70x_SVzJ*nHi4gxLX)@X`n>NJ2*7po;V@k7nQHlbtC@D0?}1@@+AFPwhaDf3bxZv zlzy@s7>?tSj#8~32n(k*NW--+mxm9guumuAUN{OJEtMsPhZFGq_^SXzXGrZY?#_gb z>%+=*D^@saVSY{AdL+o*Of=8-pWVeojscf@2v@j~LumOrkchMlE^&9ceqs{*Tgo8&hW`)j|n zmgeq<04{QjSoRN9#^H%&zq$aO*1FkyUTkn*O`gEnEY1hMc%N?!Y99vu;@7Y9XD9 zZ|aDbXQn2BGD64`g@&(ig&54s@?7xpnol5iEfbb|{Lvs0?mde6vS7I5UX4wh8%5~R9amF~MBZ?-_!$Fv804P`4~ zdDp@gpNmp%yFl(|8V{W7|A_BsB-DJk#CRaDx`^CDHc@&mtL=_F?QAY{LVAKAG=nbL z$!XL8HkIK5<0$ZsGD6-8drg$4NN^qAi zwfS$YuFGt?IR-z$^5l3Rs_rz6Ysz!nhfJv=!V~BMcN15Ub_DmGWmZFi?;K{;p3Pk- z%>QRMc4*aF_m@W;LpSHDwVaRZxQHXx-QP2D=SW$p;F3{%{{B{w(fFluIMJPZSA=D= zd9a-*iAG!@1Xf`COu;0Zgp4=jY!~uma^p?`HoGH@-ua@X!tL@~#!^|xU71Ji{0OF! zn0%EHD0H5-fOVyVs7DaTM43)kVE%emMCgM|SlR8}!Z>xdPU(~!_|E+Y`TLVem|{a! z<9OmY#Kcma3u#hw&}V{muum~z^p)97-U%4-1rfXGuXLW}h`-rx@{c$A&#wv%t&(3^ zpbS^#4enhK)nbj$meWAVJZH;A9rNocOXVVc_T!vB+mof2#!lzoml4GcJN;{B-2lXI zIU|0PU?YHGwC~;b8 zw;J8SeGQ=z3fiWG@ng%Yb+aqhpmHH&5SI$*Y=9LMR+Q>uR^} zBdgzXfTSJ=j>kPN?=cZ#2Y#!kqdiaRY!B6tj)#i4&zA0b^2KAE(?MLSsL7H=hC{*o zXLri9xmt7eBxsXVMz2=KbBGoi)HMC4ohwfvyY#@ahhK*3Rg^ls&dn-;w*mm%)R_%& zalc(I+55AE&R6Id=Iwb*Ci9ndVseKY{p<>I=Lm_Qt*D8TnxR?tKbXY+Gqylkute1k zpq61(!1U`c$xHaQYSB^vMUf_VkpeLnDEXzqVfWy~jy1I&`;Gklqfs_Dj>K=j@56^F zs!B*o9#l)Wpgu=pif#EuiFX61|a>AKUw;`axdsL{0LXfXgSvrq)ej=_B;hY7~bdFzn(u4sIR9AP1{ z|DxM8&7PodF@gT=gq5^QxN1D4z6>d6Ezbz43!N0v$n7N6sY%sH3r)c z0e&$y^)pd&t*W?rooUj6aJJDrY}Mc_lkD1)R~gKr9QW2qSLJ2QhJgi20${d|>%<@9 z98g50R!b|`pLe|@_7N+*5MLRVP!q5rr zk8}U=3TeeSCxd>_^e1fAcyCIEm7h7XSe@KB61CCuXB9UZDsyDbL7woz4ti;{mXt1n z`^hc>IKvArYNFOzZ`x4D-}oT6N#oYE!*leslX;K109yfv-YymDDd0H&*59?9uj1Ob zpc?x3Va`7Y8~N#n=oO?j0%u_t*@0{q!xL4>7JJ0Y8qpBP=7E1-Yi_=FaZQ2VPR0Ls zVET^--C4Kd$A#_MEJO)h+c+x;KO@&%L4SOLP)-Zh$Eqz;A1Ta0^udCJ&FQ7nE*QfJ z=Q>DPjNUyvHPdTbXcvI4;t%e>HqT(3XzzU&i* zRUj_gPothC^VPrIdZd=29~^rEC+huLj#{%UGe8}lk%x2n-AK74NX$~hBTPux1Bsv7 zAzPCzK7o+~M9TcQu0r+L$p>$*qcS(CO1)S%zz>yNch-K}t+}^f`GIP+unf?%=L(YZ z%l`A1&Xsv4>Dg~RW>knwAStNO+zB+ednPhzdQ(?r>D_ielSV-<99B6pho|-Y?ZL@o zhwinO(<-)%cz#sTa3kFc;1xLL5iV7+#3>TczK=Zokw>AUVV)U?G^LmrQ-f8)X2mUe zsULioQFd~}YgB`?4>!)?aL>79{eFC3=30Q24C*|(m;yhvA}@l1+1esbP^@XQ9wS)^`>jw+YfwJ_mN)x2>vZwhR8Np{iAGAhbFG0t;50)i zEa;rt&2XwRmt&ioX65@JM-LLE}P_f@GJ^S5*ADRKBaX# z8umC?;?1Svumv_2%5~jW$el={$7ByJqIGm|gx_OIvSv;N2-`At&NwSN zsS_3BT#7@8CLB)nj!Ry$3e6gCpDKlQpv$g&0{HS$geL;W>%Tq|S&KW3CdVS$V96F`xhO)wC(XeP&jybjS$S0IoWKa zBVq^}j74!HV`;(c`G*4Ie0pup&QyN-##^SF+tmk$f#60BY9%5y(&*RZKI`wrh3w+= zbZtpuQ(VyzgsEnA;rgB6cR#>K7S}aq!O}=y%*fEfjeX}p#K4)A9MX`g$)-B_wv$k0`Z9O`7B(euRK34N>vlEClic#T?k?1X#fshU(@ z`^|1nj7K&MfJXg|-wypSw~`)X6=hSU>h+S3Q4t_lU-As6VWz|iwiuiTctm-=N-r5J z?YKo$-z*@~wsMY_pOb8hIsG(@&DsI@SI|24cLXRPz0&3#0^IB`Q{1d*hZZ#IZ&;tj z9BvT9p>I;F?!E^8U~sVYv*t{5K*#wC?g+cj#9PV=W-7U-`Ni7I9u+gF&s&`mOe{Y} z3tI4!{&2rk79*Ar5++?#tXHs~e_~G@-Cb+EDG?WZbcS_V<510y5Kkgh6MvP>i6~+h zbe+~tXjdFT3;DqeY?c_cya0+O|Evt%0cKPYRTRTR@ig=wqITDk{lU8QFll3d7xS% zNZn9X{2sFUXjJj4%3X;y)|R&z9Y9Wk_FinEc_xc@c5}PpLz)I( zi6tH{TQd7EHU)ER13S`lbPt=%%tO0VD?5XUhC-9Dfx9WG2~*3VE`$7~lU?|?^g%)0 z;vymE^wCh_Ns z)kpTtm|u5IjS~LuuVyGc9)3eUbl#4P^gULe?H%BaP0g`Wl3R|TSj2NQR(`L%IN@|U zpQxT_<+)+XGOH`EacCD8?8;wH&DD|S7rza7>y4pOP;2AVX&)XgY9!t2!cW4A@(Xb{cr|=+X1T>dnuh-vwQJm|g-Q0=Up5}1 z+d&y54*`MLKXSeZi~2;6^&pSqrL7R9HXmdxdY&8irT3K-y%H&^j!?qo*f1!*tN8^i zc?`UWAV)QYYnUxEJr^d?h&X&m7Y{`cs=4E|!0#w@s*qf5AJc}valUbcgXjq5kqff$ zH}hpr*S%Gh#bi1|BBd@r8+^)y5mPGm`S!M}Qxw122DBJkHIrr-0#bN4x67Ca32eB} z>F(NcDNn-%DZfYi{pnC|tQ|AoLR9k`13=ujG`%%X$HT?X8G^;p-yn=M*} z`$ji@!j`;&l^2@^U5j9k^A&yS(U-PFO=NF8zD%=s>rjy{Xh3!q@Tlv4cngI1g~`a+ z^H1Hnf@35?kM5yQdW55==z%`;_b+!e|DUGT|Df;nzg057z;AxuowVgd(L~9LT_w9w zyQn{Ndw{G!!$lfzQKi57#CjW28Z|jJR^K}-e=;v zgUUl;SMnQ)ZaX|7Y{oT!uYSle(hXQ5@?j8@fkRqEHnlh})h|m`TZgYy6Zs zdbrn*oCFzrAb7gFccLNDsdj0I*mn*t9v6Kt3FTrvAC2(nuHdzFJ9ocml<5o>T>OfE zdf1q`aNfaC!jKoKh8Q&G&I4~i3;uP=9gf*_Xef=AcNroISmrm42Ixw^Q-Qhy`4A8v zQS=_4Wt_6SWH39(Vq48Jz{nyPF__H#O7b!m$;KHGs_@>tEe>32{7EF4uc)_Nc4F_f ziO7B0$>i4;0grrIvnmZrj{jx~??o6b)+kdxUsvgxz%qcL8=$jO!G7q4c)_zE8p-hT zO)N-;QctsV;)GiyKMFOtxdqpBnfcK;-GT&4d|q0d%mf9)gx5Qy%oMvdtnbwW&dJ_r zZ8FT=&l*gO4Gu?}N^pGYS8>K=LCal-Q6eIk?<;;H)H8(KWJ`7P4VwIJs3N5NzDfyx zau?Srt$8Y3?jNet%^`L9ct7@q6E5L+ab#>ha08-V{b$LfCS@>D@X1T8(-ds_iO9>t zj0o4Uv3%k3EAZk{vovC$cailgi534F^U~A7$O^TD%%ilo=)(JA89ru{L44e}i>1tPiOa2{#(JcgJ&((3=;?EODMe+4|8KG=P2jgh$is|k3d L4c4mEu#5aJ!l9{y literal 3470 zcmV;94RP{`P)6)!h8H%k>FDk>^}D`$5KcbwEJddwAUy%S{AD|@yXWWpP2zY}Gr6j`$pU!oCKz8-3Y4o12gXS5Pu zkq=BWIYCiTQ5zc_qobo37a0UyKOvG%@CXYW1Xu|H!P5Ry#-> z6K5|SFcJ)xXGpOpDT^33rKGF>|Np?iz~4`a-A;(O5@EVjdE!})%Pw`HDqhz&eS!@| zx*lf4A8f4?T$dzP*+YWJG(ZyN`#XRPTEX`L@kP(%-;3O`$VGD(7WY{^IrQLv#?a5f^RQAc=(e zbzxOr&Q+!Rpj{AEW;ZI6dx>|n1cNMcLxBMv!grXS_7RtLc{+D#Re7OKWk1K%@?49k zpZG*vh<(*9p-000W9 zNklIBrpqrq`;%!zAu4fz2)wEJF^R5R{ktW0s;$0DxFR(lh0(cnJ_-IZ|FId zyK|Q}K+=2$lxO67_h&Vbx|2(#@&L{NN%NU|awf9@nAt!sl`G_P`9fhid`8a5#SM9* zSe#xvLppaiSIXxLDNd3m&1dENa(QE;n3;7E6bk7=DFso!O9we=zF5o_%NfX``?Doc z0s2lA0C-&jUj*%$A^@*5=})I2Lvwd>bdDy?L*`^*1<3d08P`BzGoLG@^Dsn?PJnnk z?2>efNAbn24Y`=z01I+h0zCk54cviQ%ELgy#iMvIa1Wxu43zouA8x<1 zO*>#S1Yw3C^Jg%c2by*m#bX4@Wyqs!rpyb$15m%Sv-2+Lps<;SEjk^NBC+@!W;tyj zoG)%=;T8}Yfd|{WU-;sCj~+jv4M2M2Q=6!eOwyPL&$giq#6jlV$RGgkKYa!cIICDHLGP$Ay-D9GWAgB@ zLpO-x%bBeWbdcTR7}$Nh_Y9_=ryoYx+{~duj=hp?xa4>36QPzu>;3t()gNh<6>&Bz2Fop?!coiVUxz7AHMho2n)?>cnss_Vl`uBpm+iupTOWnNMa@g|{oi$p<# zhsyf!;P4Qdj2cvw!^81=MGXFEl0Uj_K6HF+0bNupE~@x(-y*3Tjq^tYUmfvPg0GJA z)#*PUI=;lRs#1N{o4^dLHt%e-<2k0Nwc0xI6Zh&0 zYfwk54bNJPZWO>DAHxr8^|j&geW&8xsufi|IXUt7u;M&6QB_nGcY%BuG`*?I3ciRP z^Bciyzp91_NSJqEv|2{+r<$&V0eFmdUnc1R4%kaGUqHeGg|P@uTlYA1n;H}1OOs%!s!B5g09u-Gz|lQ zc`^eRzKYB@a7m+g04w)2=oRFP<;*q(62j;KdOfF&yON_UjH>Gbvbn}oQ8PiIAB#>GKchr&jocU7`wb9y5vCue2!^Qn&TSUROEquKHU3*$m;v^{=jPv1c&}a<_R<+%Q>@i>P1lLhu$Q46X0BEMDd8T3i}n=2Jf9HN#3*o&V|-L;yYaZ=NIQnMOHMOR*)ob zT6VWNe2@=$HDpe#RZO_O0o;GlH@geko&Q4G$0g3Xa z)$O4)oZ&7J0v}H~I6G(kpR@k8pnzm~%eI&_oMDRyfsZE)oL_u+j{Tou|58vu!n`#x z!-RoJJ{SU{)xNkm8};vh^-h|fG6DeuM(ecIg6^IE8-dzD(mdw49kB++`Hs(l(T4sF zgUwHqsB9$7vt81H4brmkf8t){<2%x16QiZK4Z}DidXC9A=lZ-Pbx@%N`#i`riA~1O z`$AwenlJ+YDaFv6%_Mmy&^$ebJMHPIN$rxz<1GyHANh_nxlRnN)eh_5XhiV(e4l3u z+lL_Tuubps=)km`3-D&gx6mQLq5UV#GljS~xsN&%yeat&tN=PDZZ6aUAoxz$GwJeR z#?octrj)prnGnwaycDcp0y&6dz>+#Et3Qqb*g%PArBy+P`?57%o26luwZ+2P8xRl> z5D*YpT`b}uo~)~S=wP`cv^*aUGqiUXoZ@;MU}3&%V;!F6`~61ThbXkdLU1)4@=2KZUe7XnUDG0m0O6?I?w}7sKSrj1)0CHF z5Zx{g!&MPt?&@lI6>>lZlY=wgwJ{RJA&+AKa;OiW4fNfI`Oe4-F-jK?inuBz+ve#X z4zGr`W$~hb`my+H;SjyxDi}B^)HgeW0l5MouUuUwKZkIK00$vyVsdimYA6j&b9iOj zoJ3+%gQZ6kM+h1KO{gCn&;t+H9_2{r^YBA^EV1Mo5oQD7E=Z9saj z%QA;8G%Ik=K?5NFvd??zV-9c=8C%YT0d5Liw@**oCVwBj!V9xtQ|Fj4?^t$cyBLN! z&|=UZfB|y-dJSOOtq%M*AQy?NpCu|~pndoyR-NWLa1y7}F^6o!4;tu>BG4r^QgG0} zB-7t(fSiRMxUDeEyfq8~Km!sdg+_oV5PK0GL3J(1fJL5Cp@GOdFyv53(ac!@bO5{* zGIG=M@>8kA$p;AA79sINNo*r(8I3se5{w;R&NIg04{8WzIgOa^WRZf^2^+a$)U zu$6Fqi;|{8XX1+=vBC-~VR`yJ>FZwLTzCBf0s;a80s;a80s=HX`uLMCe`VPsX2(~* z_VrI*f8(3q`u4JgaADHF_v_$0-+l8v{QBnmKltGSHBAAN{VfB|3Db{${FB$-_iui> zI8jpoE3dtt-Rn{H`=9;%Eq-~p{pmJ*`Nb+G5&O+{$e=Fe;FrJp46eU^XLsk*op;}p ze)HQU2#kW|=8i?xrhoT)xcmYC1?la_Pxhrh{%PUzqH%LROch37{~0d$FG&C8;r{+# z|MvIAN{fYv6XvJ?00ZwoefH0XJKO*I{PV?VnhFsH{{0_Gdi> Date: Sun, 4 Aug 2024 20:04:59 +0300 Subject: [PATCH 16/43] Update limbs.dm --- code/modules/organs/limbs.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index fca82a7561d..53c78b333c0 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -511,7 +511,6 @@ Note that amputating the affected organ does in fact remove the infection from t for(var/obj/item/organ/organ AS in internal_organs) organ.get_damage(0.2, silent = TRUE) //1 point every 10 seconds, 100 seconds to bruise, five minutes to broken. - ///Updating wounds. Handles natural damage healing from limb treatments and processes internal wounds /datum/limb/proc/update_wounds(limb_regen_penalty = 1) From 60020ce825c26cb7f3b8d8fd6d32891cd83b7b52 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Sun, 4 Aug 2024 20:29:19 +0300 Subject: [PATCH 17/43] Update species.dm --- code/modules/mob/living/carbon/human/species.dm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index fc5664e8f20..cf83988852c 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -160,12 +160,9 @@ organless_human.limbs += new/datum/limb/foot/l_foot(new_l_leg, organless_human) organless_human.limbs += new/datum/limb/foot/r_foot(new_r_leg, organless_human) - for(var/obj/item/organ/organ in has_organ) - var/obj/item/organ/organ_type = has_organ[organ] // will it even do something? + for(var/obj/item/organ/organ AS in has_organ) + var/obj/item/organ/organ_type = has_organ[organ] organless_human.internal_organs_by_name[organ] = new organ_type(organless_human) - organ.owner = organless_human - var/datum/limb/limb = organless_human.get_limb(organ.parent_limb) - LAZYDISTINCTADD(limb.internal_organs, src) if(species_flags & ROBOTIC_LIMBS) for(var/datum/limb/robotic_limb AS in organless_human.limbs) From 04a07b3e1ea0001c883b00504e6fe326842b1f29 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Sun, 4 Aug 2024 22:27:46 +0300 Subject: [PATCH 18/43] new() --- code/modules/organs/_organ.dm | 5 ++--- code/modules/organs/organs.dm | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/code/modules/organs/_organ.dm b/code/modules/organs/_organ.dm index e75dd74cc1b..d3d8e69e308 100644 --- a/code/modules/organs/_organ.dm +++ b/code/modules/organs/_organ.dm @@ -21,8 +21,8 @@ /// What slot does it go in? var/slot -/* Do something with this -/datum/internal_organ/New(mob/living/carbon/carbon_mob) +//This is used in the create_organs() which transfers human datums to organs +/obj/item/organ/New(mob/living/carbon/carbon_mob) ..() if(!istype(carbon_mob)) return @@ -33,7 +33,6 @@ var/mob/living/carbon/human/human = carbon_mob var/datum/limb/limb = human.get_limb(parent_limb) LAZYDISTINCTADD(limb.internal_organs, src) -*/ /obj/item/organ/Destroy() clean_owner() diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index 2b590eba573..fffca2f6652 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -59,7 +59,7 @@ ///Total medicines removed since last tick var/removed_medicines = 0 -/obj/item/organ/kidneys/Initialize(mapload) +/obj/item/organ/kidneys/New(mob/living/carbon/carbon_mob) . = ..() if(!owner) return From 9e820c36b4961ba7d173b7c4bed102db1f205a75 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Sun, 4 Aug 2024 22:44:10 +0300 Subject: [PATCH 19/43] Update organs.dm --- code/modules/organs/organs.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index fffca2f6652..fe51cd10d36 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -176,6 +176,10 @@ ///The rate that the stomach will transfer reagents to the body var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 +/obj/item/organ/stomach/New(mob/living/carbon/carbon_mob) + . = ..() + create_reagents(reagent_vol) + /obj/item/organ/stomach/process() var/mob/living/carbon/human/body = owner From 46a422b46b1e33e70272a9399b1e83a941eb0e50 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Sun, 4 Aug 2024 23:20:52 +0300 Subject: [PATCH 20/43] get_damage broken stuff in the future detected --- code/datums/status_effects/debuffs.dm | 2 +- code/game/objects/items.dm | 6 +++--- code/game/objects/items/defibrillator.dm | 2 +- .../items/reagent_containers/food/snacks.dm | 8 ++++---- code/game/objects/machinery/flasher.dm | 2 +- code/game/objects/machinery/practice/medical.dm | 2 +- .../mob/living/carbon/human/human_damage.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 2 +- .../mob/living/carbon/human/life/handle_organs.dm | 2 +- .../xenomorph/castes/carrier/abilities_carrier.dm | 2 +- code/modules/mob/living/carbon/xenomorph/embryo.dm | 2 +- code/modules/organs/limbs.dm | 2 +- code/modules/reagents/reagents/alcohol.dm | 6 +++--- code/modules/reagents/reagents/drink.dm | 4 ++-- code/modules/reagents/reagents/medical.dm | 14 +++++++------- code/modules/surgery/eye.dm | 8 ++++---- code/modules/surgery/organs_internal.dm | 2 +- 17 files changed, 34 insertions(+), 34 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 94c8b799c81..a8873e71d16 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -503,7 +503,7 @@ if(carbon_owner && prob(15)) var/obj/item/organ/organ = pick(carbon_owner.internal_organs) if(organ) - organ.take_damage(5) + organ.get_damage(5) /atom/movable/screen/alert/status_effect/irradiated name = "Irradiated" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 9df518d38ab..ca51d254726 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -945,12 +945,12 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) switch(safety) if(1) - E.take_damage(rand(1, 2), TRUE) + E.get_damage(rand(1, 2), TRUE) if(0) - E.take_damage(rand(2, 4), TRUE) + E.get_damage(rand(2, 4), TRUE) if(-1) H.blur_eyes(rand(12,20)) - E.take_damage(rand(12, 16), TRUE) + E.get_damage(rand(12, 16), TRUE) if(safety<2) if(E.damage >= E.min_broken_damage) to_chat(H, span_danger("You can't see anything!")) diff --git a/code/game/objects/items/defibrillator.dm b/code/game/objects/items/defibrillator.dm index b4b103b80c4..82b55098c2a 100644 --- a/code/game/objects/items/defibrillator.dm +++ b/code/game/objects/items/defibrillator.dm @@ -227,7 +227,7 @@ var/obj/item/organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) if(!issynth(H) && !isrobot(H) && heart && prob(90) && !advanced) - heart.take_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib + heart.get_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib if(HAS_TRAIT(H, TRAIT_UNDEFIBBABLE) || H.suiciding) user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Patient's brain has decayed too much. No remedy possible.")) diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index 19a8dbda7ef..e14b1c8d4ca 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -858,12 +858,12 @@ var/mob/living/carbon/human/H = M var/datum/limb/E = H.get_limb("chest") E.fracture() - for (var/obj/item/organ/I in E.internal_organs) - I.take_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) - if (!E.hidden && prob(60)) //set it snuggly + for(var/obj/item/organ/I in E.internal_organs) + I.get_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) + if(!E.hidden && prob(60)) //set it snuggly E.hidden = surprise E.cavity = 0 - else //someone is having a bad day + else //someone is having a bad day E.createwound(CUT, 30) surprise.embed_into(M, E) qdel(src) diff --git a/code/game/objects/machinery/flasher.dm b/code/game/objects/machinery/flasher.dm index 5a4aee36c2e..fb346293ac8 100644 --- a/code/game/objects/machinery/flasher.dm +++ b/code/game/objects/machinery/flasher.dm @@ -79,7 +79,7 @@ var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) H.flash_act() - E.take_damage(rand(1, 5)) + E.get_damage(rand(1, 5)) else L.flash_act() diff --git a/code/game/objects/machinery/practice/medical.dm b/code/game/objects/machinery/practice/medical.dm index 5101e2be4d8..6f28f0bf637 100644 --- a/code/game/objects/machinery/practice/medical.dm +++ b/code/game/objects/machinery/practice/medical.dm @@ -50,4 +50,4 @@ organs_to_hurt += I if(length(organs_to_hurt)) var/obj/item/organ/O = pick(organs_to_hurt) - O.take_damage(40) + O.get_damage(40) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 61b18b9845a..d9532247b46 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -41,7 +41,7 @@ if(species?.has_organ[ORGAN_SLOT_BRAIN]) var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) - sponge.take_damage(amount, silent) + sponge.get_damage(amount, silent) sponge.damage = clamp(sponge.damage, 0, MAX_BRAINLOSS) brainloss = sponge.damage else diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 971dd2fcc27..2e0327984d6 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -92,7 +92,7 @@ Contains most of the procs that are called when a mob is attacked by something . = ..() if(CHECK_BITFIELD(S.smoke_traits, SMOKE_BLISTERING) && species.has_organ[ORGAN_SLOT_LUNGS]) var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) - L?.take_damage(1, TRUE) + L?.get_damage(1, TRUE) //Returns 1 if the attack hit, 0 if it missed. diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index 570ee8bc120..a363c3d34c6 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -40,7 +40,7 @@ if(E.is_broken() && E.internal_organs && prob(15)) var/obj/item/organ/I = pick(E.internal_organs) custom_pain("You feel broken bones moving in your [E.display_name]!", 1) - I.take_damage(rand(3,5)) + I.get_damage(rand(3, 5)) //Moving makes open wounds get infected much faster if(!(E.limb_wound_status & LIMB_WOUND_DISINFECTED) && E.brute_dam >= 20) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm index e473b156a54..761210a19a3 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm @@ -442,7 +442,7 @@ GLOBAL_LIST_INIT(hugger_images_list, list( var/obj/item/organ/O for(var/i in list(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_STOMACH)) O = victim.get_organ_slot(i) - O.take_damage(debuff, TRUE) + O.get_damage(debuff, TRUE) young.adjust_boost_timer(20, 40) diff --git a/code/modules/mob/living/carbon/xenomorph/embryo.dm b/code/modules/mob/living/carbon/xenomorph/embryo.dm index 0a814083d6b..8c951f9a5ad 100644 --- a/code/modules/mob/living/carbon/xenomorph/embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/embryo.dm @@ -226,7 +226,7 @@ if(!H.mind && !H.client) //If we have no client or mind, permadeath time; remove the organs. Mainly for the NPC colonist bodies H.remove_organ_slot(O) else - O.take_damage(O.min_bruised_damage, TRUE) + O.get_damage(O.min_bruised_damage, TRUE) var/datum/limb/chest = H.get_limb("chest") new /datum/wound/internal_bleeding(15, chest) //Apply internal bleeding to chest diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index 53c78b333c0..62467ef5ea5 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -185,7 +185,7 @@ if(internal_organs && ((sharp && brute >= 10) || brute >= 20) && prob(5)) //Damage an internal organ var/obj/item/organ/I = pick(internal_organs) - I.take_damage(brute / 2) + I.get_damage(brute / 2) brute -= brute / 2 RU TGMC EDIT */ if(limb_status & LIMB_BROKEN && prob(40) && brute) diff --git a/code/modules/reagents/reagents/alcohol.dm b/code/modules/reagents/reagents/alcohol.dm index e205302f665..afcb5601ab9 100644 --- a/code/modules/reagents/reagents/alcohol.dm +++ b/code/modules/reagents/reagents/alcohol.dm @@ -42,7 +42,7 @@ All effects don't start immediately, but rather get worse over time; the rate is var/mob/living/carbon/human/H = C var/obj/item/organ/liver/O = H.get_organ_slot(ORGAN_SLOT_LIVER) if (istype(O)) - O.take_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * O.alcohol_tolerance, 0)) * 0.002), TRUE) + O.get_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * O.alcohol_tolerance, 0)) * 0.002), TRUE) if(druggy != 0) L.set_drugginess(druggy) @@ -281,7 +281,7 @@ All effects don't start immediately, but rather get worse over time; the rate is var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(istype(E)) - E.take_damage(2) + E.get_damage(2) if(200 to INFINITY) L.set_timed_status_effect(5 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) L.adjustToxLoss(1) @@ -296,7 +296,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(H.species.species_flags ~! NO_PAIN) to_chat(H, span_danger("You clutch for a moment as you feel a scorching pain covering your abdomen!")) H.Stun(6 SECONDS) - E.take_damage(20) + E.get_damage(20) return ..() /datum/reagent/consumable/ethanol/deadrum diff --git a/code/modules/reagents/reagents/drink.dm b/code/modules/reagents/reagents/drink.dm index cc1b825b51a..4b53ab1426e 100644 --- a/code/modules/reagents/reagents/drink.dm +++ b/code/modules/reagents/reagents/drink.dm @@ -217,7 +217,7 @@ var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.take_damage(1, TRUE) + E.get_damage(1, TRUE) L.emote(pick("twitch", "blink_r", "shiver")) /datum/reagent/consumable/drink/coffee/overdose_crit_process(mob/living/L, metabolism) @@ -230,7 +230,7 @@ var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.take_damage(1, TRUE) + E.get_damage(1, TRUE) //nice one jpr~ /datum/reagent/consumable/drink/coffee/atomiccoffee diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index 37ba5146c11..eff4b1f2859 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -42,7 +42,7 @@ if(ishuman(L)) //Critical overdose causes total blackout and heart damage. Too much stimulant var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) - E.take_damage(0.5*effect_str, TRUE) + E.get_damage(0.5*effect_str, TRUE) if(prob(10)) L.emote(pick("twitch","blink_r","shiver")) @@ -165,7 +165,7 @@ var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.take_damage(3*effect_str, TRUE) + E.get_damage(3*effect_str, TRUE) /datum/reagent/medicine/oxycodone/on_mob_delete(mob/living/L, metabolism) to_chat(L, span_userdanger("The room spins slightly as you start to come down off your painkillers!")) @@ -403,7 +403,7 @@ var/mob/living/carbon/human/H = L var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) - E.take_damage(0.5*effect_str, TRUE) + E.get_damage(0.5*effect_str, TRUE) /datum/reagent/medicine/dylovene/overdose_crit_process(mob/living/L, metabolism) L.apply_damages(2*effect_str, 2*effect_str) @@ -411,7 +411,7 @@ var/mob/living/carbon/human/H = L var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) - E.take_damage(1.5*effect_str, TRUE) + E.get_damage(1.5*effect_str, TRUE) /datum/reagent/medicine/adminordrazine //An OP chemical for admins name = "Adminordrazine" @@ -990,14 +990,14 @@ var/mob/living/carbon/human/H = L var/affected_organ = pick(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_KIDNEYS, ORGAN_SLOT_STOMACH) var/obj/item/organ/I = H.get_organ_slot(affected_organ) - I.take_damage(5.5 * effect_str) + I.get_damage(5.5 * effect_str) /datum/reagent/medicine/ultrazine/overdose_process(mob/living/L, metabolism) if(ishuman(L)) var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.take_damage(0.5*effect_str, TRUE) + E.get_damage(0.5*effect_str, TRUE) else L.adjustToxLoss(0.5*effect_str) if(prob(10)) @@ -1010,7 +1010,7 @@ var/mob/living/carbon/human/H = L var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.take_damage(1.5*effect_str, TRUE) + E.get_damage(1.5*effect_str, TRUE) /datum/reagent/medicine/cryoxadone name = "Cryoxadone" diff --git a/code/modules/surgery/eye.dm b/code/modules/surgery/eye.dm index 0d569366538..160d4350297 100644 --- a/code/modules/surgery/eye.dm +++ b/code/modules/surgery/eye.dm @@ -53,7 +53,7 @@ span_warning("Your hand slips, slicing [target]'s eyes with \the [tool]!") ) target.balloon_alert_to_viewers("Slipped!") affected.createwound(CUT, 10) - E.take_damage(5, 0) + E.get_damage(5, 0) target.updatehealth() affected.update_wounds() @@ -86,7 +86,7 @@ user.visible_message(span_warning("[user]'s hand slips, damaging [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, damaging [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") - eyes.take_damage(5, 0) + eyes.get_damage(5, 0) target.apply_damage(10, BRUTE, affected, updating_health = TRUE) /datum/surgery_step/eye/mend_eyes @@ -119,7 +119,7 @@ user.visible_message(span_warning("[user]'s hand slips, stabbing \the [tool] into [target]'s eye!"), span_warning("Your hand slips, stabbing \the [tool] into [target]'s eye!")) target.balloon_alert_to_viewers("Slipped!") - E.take_damage(5, 0) + E.get_damage(5, 0) target.apply_damage(10, BRUTE, affected, 0, TRUE, updating_health = TRUE) /datum/surgery_step/eye/cauterize @@ -155,5 +155,5 @@ user.visible_message(span_warning("[user]'s hand slips, searing [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, searing [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") - E.take_damage(5, 0) + E.get_damage(5, 0) target.apply_damage(5, BURN, affected, updating_health = TRUE) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 0a84818badb..e4e4a994f14 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -121,6 +121,6 @@ for(var/obj/item/organ/I in affected.internal_organs) if(I?.damage > 0) - I.take_damage(dam_amt,0) + I.get_damage(dam_amt,0) target.updatehealth() affected.update_wounds() From feae0bfe2ac5760f3ca4ff5822a4c4483d33cf1d Mon Sep 17 00:00:00 2001 From: Helg2 Date: Mon, 5 Aug 2024 00:05:39 +0300 Subject: [PATCH 21/43] Update living_health_procs.dm --- code/modules/mob/living/living_health_procs.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 1b750a756b6..5e6ccdb361c 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -350,6 +350,8 @@ I.heal_organ_damage(I.damage) reagents.clear_reagents() //and clear all reagents in them + var/obj/item/organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) + belly.reagents.clear_reagents() REMOVE_TRAIT(src, TRAIT_UNDEFIBBABLE, TRAIT_UNDEFIBBABLE) REMOVE_TRAIT(src, TRAIT_PSY_DRAINED, TRAIT_PSY_DRAINED) dead_ticks = 0 From ff4b8ac205521aca459d7de8a0d1a8ce43dad83a Mon Sep 17 00:00:00 2001 From: Helg2 Date: Mon, 5 Aug 2024 00:09:05 +0300 Subject: [PATCH 22/43] med analyzer stomach chem contents --- code/game/objects/items/scanners.dm | 16 ++++++++++++- tgui/packages/tgui/interfaces/MedScanner.js | 25 ++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/scanners.dm b/code/game/objects/items/scanners.dm index df8973824fd..71e8443856a 100644 --- a/code/game/objects/items/scanners.dm +++ b/code/game/objects/items/scanners.dm @@ -82,7 +82,7 @@ REAGENT SCANNER ///Skill required to have the scanner auto refresh var/upper_skill_threshold = SKILL_MEDICAL_NOVICE ///Current mob being tracked by the scanner - var/mob/living/carbon/patient + var/mob/living/carbon/human/patient ///Current user of the scanner var/mob/living/carbon/current_user ///Distance the current_user can be away from the patient and still get health data. @@ -190,6 +190,20 @@ REAGENT SCANNER ) data["has_chemicals"] = length(patient.reagents.reagent_list) data["chemicals_lists"] = chemicals_lists + + var/obj/item/organ/stomach/belly = patient.get_organ_slot(ORGAN_SLOT_STOMACH) // should it be this way? + data["has_stomach_chemicals"] = length(belly.reagents.reagent_list) + var/list/stomach_chemicals_lists = list() + for(var/datum/reagent/reagent AS in belly.reagents.reagent_list) + if(!reagent.scannable) + data["has_unknown_chemicals"] = TRUE + continue + stomach_chemicals_lists["[reagent.name]"] = list( + "name" = reagent.name, + "amount" = round(reagent.volume, 0.1), + ) + data["stomach_chemicals_lists"] = stomach_chemicals_lists + data["species"] = patient.species.species_flags & ROBOTIC_LIMBS ? "robot" : "human" var/list/limb_data_lists = list() diff --git a/tgui/packages/tgui/interfaces/MedScanner.js b/tgui/packages/tgui/interfaces/MedScanner.js index a904a2f86bc..a6341e3ec8a 100644 --- a/tgui/packages/tgui/interfaces/MedScanner.js +++ b/tgui/packages/tgui/interfaces/MedScanner.js @@ -18,8 +18,10 @@ export const MedScanner = (props, context) => { revivable, has_chemicals, + has_stomach_chemicals, has_unknown_chemicals, chemicals_lists, + stomach_chemicals_lists, limb_data_lists, limbs_damaged, @@ -37,6 +39,7 @@ export const MedScanner = (props, context) => { hugged, } = data; const chemicals = Object.values(chemicals_lists); + const stomach_chemicals = Object.values(stomach_chemicals_lists); const limb_data = Object.values(limb_data_lists); return ( @@ -134,11 +137,11 @@ export const MedScanner = (props, context) => { + {has_unknown_chemicals ? ( + Unknown reagents detected. + ) : null} {has_chemicals ? (
- {has_unknown_chemicals ? ( - Unknown reagents detected. - ) : null} {chemicals.map((chemical) => ( @@ -159,6 +162,22 @@ export const MedScanner = (props, context) => {
) : null} + {has_stomach_chemicals ? ( +
+ + {stomach_chemicals.map((chemical) => ( + + + {chemical.amount + 'u ' + chemical.name} + + + + ))} + +
+ ) : null} {limbs_damaged ? (
From 87e7a736301a391119b22b078be9a5683eb8a085 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Mon, 5 Aug 2024 13:29:47 +0300 Subject: [PATCH 23/43] peri --- code/modules/organs/_organ.dm | 7 +++++++ code/modules/organs/organs.dm | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/code/modules/organs/_organ.dm b/code/modules/organs/_organ.dm index d3d8e69e308..25fcba93b4e 100644 --- a/code/modules/organs/_organ.dm +++ b/code/modules/organs/_organ.dm @@ -20,6 +20,8 @@ var/organ_status = ORGAN_HEALTHY /// What slot does it go in? var/slot + /// Will peri affect this organ? Thus ignores eyes, ears and brain + var/peri_effect = FALSE //This is used in the create_organs() which transfers human datums to organs /obj/item/organ/New(mob/living/carbon/carbon_mob) @@ -62,6 +64,11 @@ /// Set the correct organ state /obj/item/organ/proc/set_organ_status() + if(owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.1 && peri_effect) //0.1 just in case + if(organ_status != ORGAN_HEALTHY) + organ_status = ORGAN_HEALTHY + return TRUE + return FALSE if(damage > min_broken_damage) if(organ_status != ORGAN_BROKEN) organ_status = ORGAN_BROKEN diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index fe51cd10d36..e120b778f1a 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -3,6 +3,7 @@ name = "heart" icon_state = "heart-on" slot = ORGAN_SLOT_HEART + peri_effect = TRUE /obj/item/organ/heart/process() if(organ_status == ORGAN_BRUISED && prob(5)) @@ -23,6 +24,7 @@ icon_state = "lungs" gender = PLURAL slot = ORGAN_SLOT_LUNGS + peri_effect = TRUE /obj/item/organ/lungs/process() if((organ_status == ORGAN_BRUISED && prob(5)) || (organ_status == ORGAN_BROKEN && prob(20))) @@ -48,6 +50,7 @@ gender = PLURAL slot = ORGAN_SLOT_KIDNEYS parent_limb = BODY_ZONE_PRECISE_GROIN + peri_effect = TRUE ///Tracks the number of reagent/medicine datums we currently have var/current_medicine_count = 0 ///How many drugs we can take before they overwhelm us. Decreases with damage @@ -122,6 +125,7 @@ name = "liver" icon_state = "liver" slot = ORGAN_SLOT_LIVER + peri_effect = TRUE ///lower value, higher resistance. var/alcohol_tolerance = 0.005 ///How fast we clean out toxins/toxloss. Adjusts based on organ damage. @@ -166,11 +170,13 @@ icon_state = "appendix" slot = ORGAN_SLOT_APPENDIX parent_limb = BODY_ZONE_PRECISE_GROIN + peri_effect = TRUE /obj/item/organ/stomach name = "stomach" icon_state = "stomach" slot = ORGAN_SLOT_STOMACH + peri_effect = TRUE ///This is a reagent user and needs more then the 10u from edible component var/reagent_vol = 1000 ///The rate that the stomach will transfer reagents to the body From fd3b32c8845e2ab6aa5ae9f9d27c03c3611027bd Mon Sep 17 00:00:00 2001 From: Helg2 Date: Mon, 5 Aug 2024 13:31:33 +0300 Subject: [PATCH 24/43] Update medical.dm --- code/modules/reagents/reagents/medical.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index d88a01b8806..5a0b0f30d0a 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -690,7 +690,7 @@ L.reagent_shock_modifier += PAIN_REDUCTION_VERY_LIGHT if(ishuman(L)) var/mob/living/carbon/human/H = L - var/datum/internal_organ/brain/B = H.get_organ_slot(ORGAN_SLOT_BRAIN) + var/obj/item/organ/brain/B = H.get_organ_slot(ORGAN_SLOT_BRAIN) if(B.damage < 30) L.adjustBrainLoss(-1.5*effect_str) L.adjustToxLoss(-1.5 * effect_str) @@ -742,7 +742,7 @@ if(!ishuman(L)) return ..() var/mob/living/carbon/human/H = L - for(var/datum/internal_organ/I in H.internal_organs) + for(var/obj/item/organ/I in H.internal_organs) if(I.damage) if(L.bodytemperature > 169 && I.damage > 5) continue @@ -757,12 +757,12 @@ /datum/reagent/medicine/research/stimulon/on_mob_add(mob/living/L, metabolism) . = ..() var/mob/living/carbon/human/H = L - for(var/datum/internal_organ/I in H.internal_organs) + for(var/obj/item/organ/I in H.internal_organs) I.set_organ_status() /datum/reagent/medicine/research/stimulon/on_mob_delete(mob/living/L, metabolism) var/mob/living/carbon/human/H = L - for(var/datum/internal_organ/I in H.internal_organs) + for(var/obj/item/organ/I in H.internal_organs) I.set_organ_status() return ..() @@ -1458,7 +1458,7 @@ if(!ishuman(L)) return ..() var/mob/living/carbon/human/H = L - var/datum/internal_organ/organ = H.get_damaged_organ() + var/obj/item/organ/organ = H.get_damaged_organ() if(!organ) return ..() L.adjustToxLoss(5*effect_str) From 5a9d5606a1c47cca0dc82661e67b8c38f644b62b Mon Sep 17 00:00:00 2001 From: Helg2 Date: Mon, 5 Aug 2024 13:33:33 +0300 Subject: [PATCH 25/43] Update human.dm --- code/modules/mob/living/carbon/human/human.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5625b61473d..2ca710ae7c5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -646,13 +646,13 @@ return FALSE return ..() - ///get_eye_protection() ///Returns a number between -1 to 2 /mob/living/carbon/human/get_eye_protection() var/number = 0 - if(!species.has_organ["eyes"]) return 2//No eyes, can't hurt them. + if(!species.has_organ["eyes"]) + return 2//No eyes, can't hurt them. var/obj/item/organ/eyes/I = get_organ_slot(ORGAN_SLOT_EYES) if(!I) @@ -668,7 +668,6 @@ return number - /mob/living/carbon/human/abiotic(full_body = 0) if(full_body && ((src.l_hand && !( src.l_hand.flags_item & ITEM_ABSTRACT)) || (src.r_hand && !( src.r_hand.flags_item & ITEM_ABSTRACT)) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.wear_ear || src.gloves))) return 1 From 67ab950709d5e31604ccdc35f4a7b998f0f536b0 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Mon, 5 Aug 2024 13:43:44 +0300 Subject: [PATCH 26/43] Update shock.dm --- code/modules/mob/living/carbon/shock.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index bd1c59431b8..7b9cc722438 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -88,7 +88,8 @@ //Internal organs hurt too for(var/obj/item/organ/O in M.internal_organs) - if(O.damage) traumatic_shock += O.damage * 1.5 + if(O.damage) + traumatic_shock += O.damage * 1.5 if(M.protection_aura) traumatic_shock -= 20 + M.protection_aura * 20 //-40 pain for SLs, -80 for Commanders From 710857b698e5cd4a2a8f385c1f174a1e37696c30 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Tue, 6 Aug 2024 14:26:03 +0300 Subject: [PATCH 27/43] eh --- code/game/objects/items/scanners.dm | 7 +++++-- tgui/packages/tgui/interfaces/MedScanner.js | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/scanners.dm b/code/game/objects/items/scanners.dm index 3a7a679f947..2d571f38160 100644 --- a/code/game/objects/items/scanners.dm +++ b/code/game/objects/items/scanners.dm @@ -187,8 +187,7 @@ REAGENT SCANNER chemicals_lists["[reagent.name]"] = list( "name" = reagent.name, "amount" = round(reagent.volume, 0.1), - "od" = reagent.overdosed, - "dangerous" = reagent.overdosed || istype(reagent, /datum/reagent/toxin) + "od" = reagent.overdosed ) data["has_chemicals"] = length(patient.reagents.reagent_list) data["chemicals_lists"] = chemicals_lists @@ -200,9 +199,13 @@ REAGENT SCANNER if(!reagent.scannable) data["has_unknown_chemicals"] = TRUE continue + var/reagent_overdosed = FALSE + if(reagent.overdose_threshold && reagent.volume > reagent.overdose_threshold) + reagent_overdosed = TRUE stomach_chemicals_lists["[reagent.name]"] = list( "name" = reagent.name, "amount" = round(reagent.volume, 0.1), + "od" = reagent_overdosed ) data["stomach_chemicals_lists"] = stomach_chemicals_lists diff --git a/tgui/packages/tgui/interfaces/MedScanner.js b/tgui/packages/tgui/interfaces/MedScanner.js index a6341e3ec8a..61c25cd0355 100644 --- a/tgui/packages/tgui/interfaces/MedScanner.js +++ b/tgui/packages/tgui/interfaces/MedScanner.js @@ -147,8 +147,8 @@ export const MedScanner = (props, context) => { + color={chemical.od ? 'red' : 'white'} + bold={chemical.od}> {chemical.amount + 'u ' + chemical.name} @@ -169,10 +169,16 @@ export const MedScanner = (props, context) => { + color={chemical.od ? 'red' : 'white'} + bold={chemical.od}> {chemical.amount + 'u ' + chemical.name} + {chemical.od ? ( + + {'OD'} + + ) : null} ))} From b1fc4b4f28a8a50836b224444a426f3e8d3bcfb3 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Tue, 6 Aug 2024 14:34:51 +0300 Subject: [PATCH 28/43] Update organs.dm --- code/modules/organs/organs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index e120b778f1a..8ca4134308e 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -212,7 +212,7 @@ if(prob(0.0125 * damage) || damage > min_broken_damage && prob(0.05 * damage)) body.vomit() - to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down all that food!")) + to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down it's contents!")) return /obj/item/organ/eyes From 7735e8661ef2821e759608099a02c7df57ff25fa Mon Sep 17 00:00:00 2001 From: Helg2 Date: Tue, 6 Aug 2024 15:00:41 +0300 Subject: [PATCH 29/43] sanity checks? --- code/modules/organs/_organ.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/organs/_organ.dm b/code/modules/organs/_organ.dm index 25fcba93b4e..6c7541d1144 100644 --- a/code/modules/organs/_organ.dm +++ b/code/modules/organs/_organ.dm @@ -69,16 +69,16 @@ organ_status = ORGAN_HEALTHY return TRUE return FALSE - if(damage > min_broken_damage) + else if(damage > min_broken_damage) if(organ_status != ORGAN_BROKEN) organ_status = ORGAN_BROKEN return TRUE return FALSE - if(damage > min_bruised_damage) + else if(damage > min_bruised_damage) if(organ_status != ORGAN_BRUISED) organ_status = ORGAN_BRUISED return TRUE return FALSE - if(organ_status != ORGAN_HEALTHY) + else if(organ_status != ORGAN_HEALTHY) organ_status = ORGAN_HEALTHY return TRUE From a07a22bd5adbfc029a02ed19c244c2d6cdfdd215 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Tue, 6 Aug 2024 15:00:44 +0300 Subject: [PATCH 30/43] Update death.dm --- code/modules/mob/living/carbon/human/death.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 0b5bef65ddf..e243284b25b 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -9,12 +9,11 @@ // Only make the limb drop if it's not too damaged if(prob(100 - E.get_damage())) // Override the current limb status - //E.droplimb() // RUTGMC DELETION - E.droplimb(silent = TRUE) // RUTGMC ADDITION START + E.droplimb(silent = TRUE) visible_message(span_warning("[name] explodes violently into a bloody mess!"), span_highdanger("You explode violently into a bloody mess!"), - span_warning("You hear a terrible sound of breaking bones and ripping flesh!"), 3) // RUTGMC EDITION END + span_warning("You hear a terrible sound of breaking bones and ripping flesh!"), 3) if(is_a_synth) spawn_gibs() From 6a2eb3b5372f60a29e892fc272f79d0a611de42a Mon Sep 17 00:00:00 2001 From: Helg2 Date: Tue, 6 Aug 2024 15:00:46 +0300 Subject: [PATCH 31/43] Update organs.dm --- code/modules/organs/organs.dm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index 8ca4134308e..d7a6997e690 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -95,11 +95,6 @@ current_medicine_cap = initial(current_medicine_cap) - 2 * organ_status /obj/item/organ/kidneys/process() - var/bypass = FALSE - - if(owner.bodytemperature <= 170) //No sense worrying about a chem cap if we're in cryo anyway. Still need to clear tick counts. - bypass = TRUE - current_medicine_count += new_medicines //We want to include medicines that were individually both added and removed this tick var/overflow = current_medicine_count - current_medicine_cap //This catches any case where a reagent was added with volume below its metabolism current_medicine_count -= removed_medicines //Otherwise, you can microdose infinite chems without kidneys complaining @@ -107,7 +102,8 @@ new_medicines = 0 removed_medicines = 0 - if(overflow < 1 || bypass) + //No sense worrying about a chem cap if we're in cryo anyway. Still need to clear tick counts. + if(overflow < 1 || owner.bodytemperature <= 170) if(old_overflow) to_chat(owner, span_notice("You don't feel as overwhelmed by all the drugs any more.")) old_overflow = FALSE From 67afd5b3f55cd145cd63ba239e5cf02be92236b4 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Tue, 6 Aug 2024 15:31:22 +0300 Subject: [PATCH 32/43] vomitting out reagents --- code/game/objects/effects/decals/Cleanable/misc.dm | 1 - code/modules/mob/living/carbon/human/human_status_procs.dm | 4 ++++ code/modules/mob/living/living_health_procs.dm | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm index cd77a7c725e..71f65595d8f 100644 --- a/code/game/objects/effects/decals/Cleanable/misc.dm +++ b/code/game/objects/effects/decals/Cleanable/misc.dm @@ -112,7 +112,6 @@ icon_state = "vomit_1" random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4") - /obj/effect/decal/cleanable/tomato_smudge name = "tomato smudge" desc = "It's red." diff --git a/code/modules/mob/living/carbon/human/human_status_procs.dm b/code/modules/mob/living/carbon/human/human_status_procs.dm index 2e38f3d01c3..9b2d4fa372e 100644 --- a/code/modules/mob/living/carbon/human/human_status_procs.dm +++ b/code/modules/mob/living/carbon/human/human_status_procs.dm @@ -83,6 +83,10 @@ if(istype(location, /turf)) location.add_vomit_floor(src, 1) + var/obj/item/organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) + for(var/datum/reagent/our_reagent in belly.reagents.reagent_list) + belly.reagents.remove_reagent(our_reagent.type, our_reagent.volume / rand(2, 5)) // vomit out some reagents from our stomach + adjust_nutrition(-40) adjustToxLoss(-3) diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 5e6ccdb361c..50a3d615499 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -324,7 +324,6 @@ return ..() - /mob/living/carbon/human/revive(admin_revive = FALSE) restore_all_organs() @@ -360,7 +359,6 @@ update_hair() return ..() - /mob/living/carbon/xenomorph/revive(admin_revive = FALSE) set_plasma(xeno_caste.plasma_max) sunder = 0 From 06930a2c8a6e4cc7d557237db15450ad49303fc6 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 14:13:39 +0300 Subject: [PATCH 33/43] eh --- code/datums/gamemodes/objective.dm | 2 +- code/datums/status_effects/debuffs.dm | 2 +- code/game/objects/items.dm | 2 +- code/game/objects/items/defibrillator.dm | 4 +-- .../items/reagent_containers/food/snacks.dm | 2 +- code/game/objects/items/scanners.dm | 4 +-- code/game/objects/machinery.dm | 2 +- code/game/objects/machinery/autodoc.dm | 10 +++---- code/game/objects/machinery/flasher.dm | 2 +- .../objects/machinery/practice/medical.dm | 4 +-- code/game/objects/structures/supplypod.dm | 2 +- code/modules/mob/living/brain/MMI.dm | 4 +-- .../mob/living/carbon/carbon_helpers.dm | 4 +-- code/modules/mob/living/carbon/human/human.dm | 6 ++-- .../mob/living/carbon/human/human_damage.dm | 8 +++--- .../mob/living/carbon/human/human_defense.dm | 4 +-- .../mob/living/carbon/human/human_helpers.dm | 6 ++-- .../living/carbon/human/human_status_procs.dm | 2 +- .../living/carbon/human/life/handle_organs.dm | 6 ++-- .../mob/living/carbon/human/species.dm | 4 +-- .../modules/mob/living/carbon/human/zombie.dm | 2 +- code/modules/mob/living/carbon/shock.dm | 2 +- .../castes/carrier/abilities_carrier.dm | 2 +- .../mob/living/carbon/xenomorph/embryo.dm | 2 +- .../modules/mob/living/living_health_procs.dm | 4 +-- code/modules/organs/limbs.dm | 6 ++-- code/modules/organs/organs.dm | 2 +- code/modules/organs/pain.dm | 2 +- code/modules/reagents/holder.dm | 2 +- code/modules/reagents/reagents/alcohol.dm | 6 ++-- code/modules/reagents/reagents/drink.dm | 4 +-- code/modules/reagents/reagents/medical.dm | 28 +++++++++---------- code/modules/surgery/brainrepair.dm | 6 ++-- code/modules/surgery/eye.dm | 18 ++++++------ code/modules/surgery/mcomp_tendwounds.dm | 2 +- code/modules/surgery/organs_internal.dm | 8 +++--- 36 files changed, 88 insertions(+), 88 deletions(-) diff --git a/code/datums/gamemodes/objective.dm b/code/datums/gamemodes/objective.dm index e609981018e..51574d10286 100644 --- a/code/datums/gamemodes/objective.dm +++ b/code/datums/gamemodes/objective.dm @@ -554,7 +554,7 @@ GLOBAL_LIST_EMPTY(possible_items) return TRUE for(targethuman in defendedarea) if(iszombie(targethuman)) //zombies count as hostile forces to everyone but zombies - for(var/obj/item/organ/affectedorgan in targethuman.internal_organs) + for(var/datum/internal_organ/affectedorgan in targethuman.internal_organs) if(affectedorgan == targethuman.get_organ_slot(ORGAN_SLOT_HEART)) return FALSE if(targethuman.stat == DEAD) //we don't care about dead humans diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index a8873e71d16..01efaf954a3 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -501,7 +501,7 @@ if(human_owner && prob(15)) human_owner.vomit() if(carbon_owner && prob(15)) - var/obj/item/organ/organ = pick(carbon_owner.internal_organs) + var/datum/internal_organ/organ = pick(carbon_owner.internal_organs) if(organ) organ.get_damage(5) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index ca51d254726..660f2aa4f1c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -942,7 +942,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. return TRUE var/safety = user.get_eye_protection() var/mob/living/carbon/human/H = user - var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) switch(safety) if(1) E.get_damage(rand(1, 2), TRUE) diff --git a/code/game/objects/items/defibrillator.dm b/code/game/objects/items/defibrillator.dm index 82b55098c2a..5e31bb5797d 100644 --- a/code/game/objects/items/defibrillator.dm +++ b/code/game/objects/items/defibrillator.dm @@ -135,7 +135,7 @@ return null /mob/living/carbon/human/proc/has_working_organs() - var/obj/item/organ/heart/heart = get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/heart = get_organ_slot(ORGAN_SLOT_HEART) if(!heart || heart.organ_status == ORGAN_BROKEN || !has_brain()) return FALSE @@ -225,7 +225,7 @@ user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Defibrillation failed: Paddles registering >100,000 ohms, Possible cause: Suit or Armor interferring.")) return - var/obj/item/organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) if(!issynth(H) && !isrobot(H) && heart && prob(90) && !advanced) heart.get_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index aca521dee21..e53aa15eac6 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -858,7 +858,7 @@ var/mob/living/carbon/human/H = M var/datum/limb/E = H.get_limb("chest") E.fracture() - for(var/obj/item/organ/I in E.internal_organs) + for(var/datum/internal_organ/I in E.internal_organs) I.get_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) if(!E.hidden && prob(60)) //set it snuggly E.hidden = surprise diff --git a/code/game/objects/items/scanners.dm b/code/game/objects/items/scanners.dm index 2d571f38160..b1db9a39d5b 100644 --- a/code/game/objects/items/scanners.dm +++ b/code/game/objects/items/scanners.dm @@ -192,7 +192,7 @@ REAGENT SCANNER data["has_chemicals"] = length(patient.reagents.reagent_list) data["chemicals_lists"] = chemicals_lists - var/obj/item/organ/stomach/belly = patient.get_organ_slot(ORGAN_SLOT_STOMACH) // should it be this way? + var/datum/internal_organ/stomach/belly = patient.get_organ_slot(ORGAN_SLOT_STOMACH) // should it be this way? data["has_stomach_chemicals"] = length(belly.reagents.reagent_list) var/list/stomach_chemicals_lists = list() for(var/datum/reagent/reagent AS in belly.reagents.reagent_list) @@ -278,7 +278,7 @@ REAGENT SCANNER data["pulse"] = "[human_patient.get_pulse(GETPULSE_TOOL)] bpm" data["implants"] = unknown_implants var/damaged_organs = list() - for(var/obj/item/organ/organ AS in human_patient.internal_organs) + for(var/datum/internal_organ/organ AS in human_patient.internal_organs) if(organ.organ_status == ORGAN_HEALTHY) continue var/current_organ = list( diff --git a/code/game/objects/machinery.dm b/code/game/objects/machinery.dm index 79f2bdbf8c6..7ac7a34ca48 100644 --- a/code/game/objects/machinery.dm +++ b/code/game/objects/machinery.dm @@ -412,7 +412,7 @@ dat += "[e.display_name]--Not Found" dat += "" - for(var/obj/item/organ/i in occ["internal_organs"]) + for(var/datum/internal_organ/i in occ["internal_organs"]) dat += "" dat += "[i.name]N/A[i.damage]" dat += "" diff --git a/code/game/objects/machinery/autodoc.dm b/code/game/objects/machinery/autodoc.dm index 5693e6ed86f..4d42e0d1b9a 100644 --- a/code/game/objects/machinery/autodoc.dm +++ b/code/game/objects/machinery/autodoc.dm @@ -212,7 +212,7 @@ /datum/autodoc_surgery var/datum/limb/limb_ref = null - var/obj/item/organ/organ_ref = null + var/datum/internal_organ/organ_ref = null var/type_of_surgery = 0 // the above constants var/surgery_procedure = "" // text of surgery var/unneeded = 0 @@ -236,7 +236,7 @@ surgery_list += create_autodoc_surgery(L,LIMB_SURGERY,ADSURGERY_INTERNAL) var/organdamagesurgery = 0 - for(var/obj/item/organ/I in L.internal_organs) + for(var/datum/internal_organ/I in L.internal_organs) if(I.damage > 0) if(I.slot == ORGAN_SLOT_EYES) // treat eye surgery differently continue @@ -271,7 +271,7 @@ surgery_list += create_autodoc_surgery(L,LIMB_SURGERY,ADSURGERY_GERMS) if(L.surgery_open_stage) surgery_list += create_autodoc_surgery(L,LIMB_SURGERY,ADSURGERY_OPEN) - var/obj/item/organ/I = M.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/I = M.get_organ_slot(ORGAN_SLOT_EYES) if(I && (M.disabilities & NEARSIGHTED || M.disabilities & BLIND || I.damage > 0)) surgery_list += create_autodoc_surgery(null,ORGAN_SURGERY,ADSURGERY_EYES,0,I) if(M.getBruteLoss() > 0) @@ -409,7 +409,7 @@ surgery_todo_list -= S continue if(istype(S.organ_ref, /obj/item/organ/eyes)) - var/obj/item/organ/eyes/E = S.organ_ref + var/datum/internal_organ/eyes/E = S.organ_ref if(E.eye_surgery_stage == 0) sleep(EYE_CUT_MAX_DURATION) @@ -1215,7 +1215,7 @@ for(var/i in connected.occupant.limbs) var/datum/limb/L = i for(var/x in L.internal_organs) - var/obj/item/organ/I = x + var/datum/internal_organ/I = x if(I.damage > 0) N.fields["autodoc_manual"] += create_autodoc_surgery(L,ORGAN_SURGERY,ADSURGERY_DAMAGE,0,I) needed++ diff --git a/code/game/objects/machinery/flasher.dm b/code/game/objects/machinery/flasher.dm index fb346293ac8..046d4eecd0a 100644 --- a/code/game/objects/machinery/flasher.dm +++ b/code/game/objects/machinery/flasher.dm @@ -76,7 +76,7 @@ var/mob/living/carbon/human/H = L if(H.get_eye_protection() > 0) continue - var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) H.flash_act() E.get_damage(rand(1, 5)) diff --git a/code/game/objects/machinery/practice/medical.dm b/code/game/objects/machinery/practice/medical.dm index 6f28f0bf637..e387e4a17a5 100644 --- a/code/game/objects/machinery/practice/medical.dm +++ b/code/game/objects/machinery/practice/medical.dm @@ -46,8 +46,8 @@ if("damaged organs") humanspawned = new /mob/living/carbon/human(get_turf(src)) var/list/organs_to_hurt = list() - for(var/obj/item/organ/I in humanspawned.internal_organs) + for(var/datum/internal_organ/I in humanspawned.internal_organs) organs_to_hurt += I if(length(organs_to_hurt)) - var/obj/item/organ/O = pick(organs_to_hurt) + var/datum/internal_organ/O = pick(organs_to_hurt) O.get_damage(40) diff --git a/code/game/objects/structures/supplypod.dm b/code/game/objects/structures/supplypod.dm index 8591faf4ee4..8d9709002e7 100644 --- a/code/game/objects/structures/supplypod.dm +++ b/code/game/objects/structures/supplypod.dm @@ -125,7 +125,7 @@ GLOBAL_LIST_INIT(pod_styles, list(\ if(effectOrgans && ishuman(L)) var/mob/living/carbon/human/H = L - for(var/obj/item/organ/IO in H.internal_organs) + for(var/datum/internal_organ/IO in H.internal_organs) var/destination = get_edge_target_turf(T, pick(GLOB.alldirs)) IO.forceMove(T) IO.throw_at(destination, 2, 3) diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 104ebd23b61..9ddc7a53005 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -19,7 +19,7 @@ /obj/item/mmi/attackby(obj/item/O, mob/user) if(istype(O,/obj/item/organ/brain) && !brainmob) //Time to stick a brain in it --NEO - var/obj/item/organ/brain/B = O + var/datum/internal_organ/brain/B = O if(B.obj_integrity <= 0) to_chat(user, span_warning("That brain is well and truly dead.")) return @@ -67,7 +67,7 @@ to_chat(user, span_warning("You upend the MMI, but the brain is clamped into place.")) else to_chat(user, span_notice("You upend the MMI, spilling the brain onto the floor.")) - var/obj/item/organ/brain/brain = new(user.loc) + var/datum/internal_organ/brain/brain = new(user.loc) brainmob.container = null//Reset brainmob mmi var. brainmob.loc = brain//Throw mob into brain. GLOB.alive_living_list -= brainmob//Get outta here diff --git a/code/modules/mob/living/carbon/carbon_helpers.dm b/code/modules/mob/living/carbon/carbon_helpers.dm index 4500615570c..b3f86cb7506 100644 --- a/code/modules/mob/living/carbon/carbon_helpers.dm +++ b/code/modules/mob/living/carbon/carbon_helpers.dm @@ -15,8 +15,8 @@ ///Return the most damaged internal_organ that isn't at 0, or null. /mob/living/carbon/proc/get_damaged_organ() - var/obj/item/organ/chosen_organ - for(var/obj/item/organ/test_organ AS in internal_organs) + var/datum/internal_organ/chosen_organ + for(var/datum/internal_organ/test_organ AS in internal_organs) if(!test_organ.damage) continue if(!chosen_organ) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 2ca710ae7c5..c8ec8344ffe 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -654,7 +654,7 @@ if(!species.has_organ["eyes"]) return 2//No eyes, can't hurt them. - var/obj/item/organ/eyes/I = get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/I = get_organ_slot(ORGAN_SLOT_EYES) if(!I) return 2 @@ -692,11 +692,11 @@ /mob/living/carbon/human/proc/is_lung_ruptured() - var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) return L?.organ_status == ORGAN_BRUISED /mob/living/carbon/human/proc/rupture_lung() - var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) if(L?.organ_status == ORGAN_BRUISED) src.custom_pain("You feel a stabbing pain in your chest!", 1) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index d9532247b46..15e5589232f 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -39,7 +39,7 @@ return FALSE //godmode if(species?.has_organ[ORGAN_SLOT_BRAIN]) - var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.get_damage(amount, silent) sponge.damage = clamp(sponge.damage, 0, MAX_BRAINLOSS) @@ -55,7 +55,7 @@ return FALSE //godmode if(species?.has_organ[ORGAN_SLOT_BRAIN]) - var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.damage = clamp(amount, 0, MAX_BRAINLOSS) brainloss = sponge.damage @@ -70,7 +70,7 @@ return FALSE //godmode if(species?.has_organ[ORGAN_SLOT_BRAIN]) - var/obj/item/organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) //Make sure they actually have a brain brainloss = min(sponge.damage, MAX_BRAINLOSS) else @@ -315,7 +315,7 @@ This function restores all limbs. for(var/organ_slot in species.has_organ) var/internal_organ_type = species.has_organ[organ_slot] if(!get_organ_slot(organ_slot)) - var/obj/item/organ/IO = new internal_organ_type(src) + var/datum/internal_organ/IO = new internal_organ_type(src) internal_organs_by_name[organ_slot] = IO if(updating_health) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 2e0327984d6..9f6c3b758a4 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -91,7 +91,7 @@ Contains most of the procs that are called when a mob is attacked by something /mob/living/carbon/human/inhale_smoke(obj/effect/particle_effect/smoke/S) . = ..() if(CHECK_BITFIELD(S.smoke_traits, SMOKE_BLISTERING) && species.has_organ[ORGAN_SLOT_LUNGS]) - var/obj/item/organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) L?.get_damage(1, TRUE) @@ -410,7 +410,7 @@ Contains most of the procs that are called when a mob is attacked by something log_combat(user, src, "ripped [src]'s heart", I) visible_message(span_notice("[user] ripped off [src]'s heart!"), span_notice("You ripped off [src]'s heart!")) remove_organ_slot(ORGAN_SLOT_HEART) - var/obj/item/organ/heart/heart = new + var/datum/internal_organ/heart/heart = new user.put_in_hands(heart) chestburst = 2 update_burst() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 864a5b8e308..da0bd8d546d 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -185,14 +185,14 @@ /mob/living/carbon/human/has_brain() if(get_organ_slot(ORGAN_SLOT_BRAIN)) - var/obj/item/organ/brain = get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain = get_organ_slot(ORGAN_SLOT_BRAIN) if(brain && istype(brain)) return 1 return 0 /mob/living/carbon/human/has_eyes() if(get_organ_slot(ORGAN_SLOT_EYES)) - var/obj/item/organ/eyes = get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes = get_organ_slot(ORGAN_SLOT_EYES) if(eyes && istype(eyes)) return 1 return 0 @@ -250,6 +250,6 @@ ///Removes organ by name /mob/living/carbon/human/proc/remove_organ_slot(string) - var/obj/item/organ/organ = get_organ_slot(string) + var/datum/internal_organ/organ = get_organ_slot(string) internal_organs_by_name -= string internal_organs -= organ diff --git a/code/modules/mob/living/carbon/human/human_status_procs.dm b/code/modules/mob/living/carbon/human/human_status_procs.dm index 9b2d4fa372e..cc0c0b1827b 100644 --- a/code/modules/mob/living/carbon/human/human_status_procs.dm +++ b/code/modules/mob/living/carbon/human/human_status_procs.dm @@ -83,7 +83,7 @@ if(istype(location, /turf)) location.add_vomit_floor(src, 1) - var/obj/item/organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) + var/datum/internal_organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) for(var/datum/reagent/our_reagent in belly.reagents.reagent_list) belly.reagents.remove_reagent(our_reagent.type, our_reagent.volume / rand(2, 5)) // vomit out some reagents from our stomach diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index a363c3d34c6..1bf8239949c 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -3,7 +3,7 @@ . = ..() if(reagents && !CHECK_BITFIELD(species.species_flags, NO_CHEM_METABOLIZATION)) - var/obj/item/organ/liver/L + var/datum/internal_organ/liver/L if(species?.has_organ[ORGAN_SLOT_LIVER]) L = get_organ_slot(ORGAN_SLOT_LIVER) var/overdosable = CHECK_BITFIELD(species.species_flags, NO_OVERDOSE) ? FALSE : TRUE @@ -19,7 +19,7 @@ last_dam = getBruteLoss() + getFireLoss() + getToxLoss() - for(var/obj/item/organ/I in internal_organs) + for(var/datum/internal_organ/I in internal_organs) I.process() var/multi_limb_regen_penalty = 1 / (max(1, length(get_damaged_limbs(TRUE, TRUE))) ** 0.5) //Per-limb regen decreases with multiple damaged limbs, but slower than linear @@ -38,7 +38,7 @@ if(!lying_angle && world.time - last_move_time < 15) if(E.is_broken() && E.internal_organs && prob(15)) - var/obj/item/organ/I = pick(E.internal_organs) + var/datum/internal_organ/I = pick(E.internal_organs) custom_pain("You feel broken bones moving in your [E.display_name]!", 1) I.get_damage(rand(3, 5)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index cf83988852c..035a8693a3a 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -160,8 +160,8 @@ organless_human.limbs += new/datum/limb/foot/l_foot(new_l_leg, organless_human) organless_human.limbs += new/datum/limb/foot/r_foot(new_r_leg, organless_human) - for(var/obj/item/organ/organ AS in has_organ) - var/obj/item/organ/organ_type = has_organ[organ] + for(var/datum/internal_organ/organ AS in has_organ) + var/datum/internal_organ/organ_type = has_organ[organ] organless_human.internal_organs_by_name[organ] = new organ_type(organless_human) if(species_flags & ROBOTIC_LIMBS) diff --git a/code/modules/mob/living/carbon/human/zombie.dm b/code/modules/mob/living/carbon/human/zombie.dm index 408cdda6f66..72fd401665d 100644 --- a/code/modules/mob/living/carbon/human/zombie.dm +++ b/code/modules/mob/living/carbon/human/zombie.dm @@ -80,7 +80,7 @@ H.heal_limbs(heal_rate) for(var/organ_slot in has_organ) - var/obj/item/organ/internal_organ = H.get_organ_slot(organ_slot) + var/datum/internal_organ/internal_organ = H.get_organ_slot(organ_slot) internal_organ?.heal_organ_damage(1) H.updatehealth() diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index 7b9cc722438..62945f7a3e1 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -87,7 +87,7 @@ traumatic_shock += O.germ_level * 0.05 //Internal organs hurt too - for(var/obj/item/organ/O in M.internal_organs) + for(var/datum/internal_organ/O in M.internal_organs) if(O.damage) traumatic_shock += O.damage * 1.5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm index 761210a19a3..d0b00a609e6 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm @@ -439,7 +439,7 @@ GLOBAL_LIST_INIT(hugger_images_list, list( victim.adjust_slowdown(debuff) victim.apply_damage(stamina_dmg, STAMINA) - var/obj/item/organ/O + var/datum/internal_organ/O for(var/i in list(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_STOMACH)) O = victim.get_organ_slot(i) O.get_damage(debuff, TRUE) diff --git a/code/modules/mob/living/carbon/xenomorph/embryo.dm b/code/modules/mob/living/carbon/xenomorph/embryo.dm index 8c951f9a5ad..f47cb70b876 100644 --- a/code/modules/mob/living/carbon/xenomorph/embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/embryo.dm @@ -219,7 +219,7 @@ if(ishuman(victim)) var/mob/living/carbon/human/H = victim H.apply_damage(200, BRUTE, H.get_limb("chest"), updating_health = TRUE) //lethal armor ignoring brute damage - var/obj/item/organ/O + var/datum/internal_organ/O for(var/i in list(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_KIDNEYS, ORGAN_SLOT_APPENDIX, ORGAN_SLOT_STOMACH)) //Bruise all torso internal organs O = H.get_organ_slot(i) diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 50a3d615499..99b1f70b986 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -345,11 +345,11 @@ H.brainmob.mind.transfer_to(src) qdel(H) - for(var/obj/item/organ/I in internal_organs) + for(var/datum/internal_organ/I in internal_organs) I.heal_organ_damage(I.damage) reagents.clear_reagents() //and clear all reagents in them - var/obj/item/organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) + var/datum/internal_organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) belly.reagents.clear_reagents() REMOVE_TRAIT(src, TRAIT_UNDEFIBBABLE, TRAIT_UNDEFIBBABLE) REMOVE_TRAIT(src, TRAIT_PSY_DRAINED, TRAIT_PSY_DRAINED) diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index c8392b32e7b..6518b994136 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -184,7 +184,7 @@ //High brute damage or sharp objects may damage internal organs if(internal_organs && ((sharp && brute >= 10) || brute >= 20) && prob(5)) //Damage an internal organ - var/obj/item/organ/I = pick(internal_organs) + var/datum/internal_organ/I = pick(internal_organs) I.get_damage(brute / 2) brute -= brute / 2 RU TGMC EDIT */ @@ -316,7 +316,7 @@ RU TGMC EDIT */ // heal internal organs for(var/o in internal_organs) - var/obj/item/organ/current_organ = o + var/datum/internal_organ/current_organ = o current_organ.heal_organ_damage(current_organ.damage) // remove embedded objects and drop them on the floor @@ -508,7 +508,7 @@ Note that amputating the affected organ does in fact remove the infection from t to_chat(owner, span_notice("You have a high fever!")) //Not technically a germ effect, but derived from it if(limb_status & LIMB_NECROTIZED) - for(var/obj/item/organ/organ AS in internal_organs) + for(var/datum/internal_organ/organ AS in internal_organs) organ.get_damage(0.2, silent = TRUE) //1 point every 10 seconds, 100 seconds to bruise, five minutes to broken. ///Updating wounds. Handles natural damage healing from limb treatments and processes internal wounds diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index d7a6997e690..cf0795fdb8b 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -135,7 +135,7 @@ get_damage(0.2, TRUE) //Damaged one shares the fun else - var/obj/item/organ/O = pick(owner.internal_organs) + var/datum/internal_organ/O = pick(owner.internal_organs) O?.get_damage(0.2, TRUE) // Heal a bit if needed and we're not busy. This allows recovery from low amounts of toxins. diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index 73345fb2509..34d6c5ba1ff 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -117,7 +117,7 @@ // Damage to internal organs hurts a lot. var/datum/limb/parent - for(var/obj/item/organ/I in internal_organs) + for(var/datum/internal_organ/I in internal_organs) parent = get_limb(I.parent_limb) if(prob(2)) switch(I.damage) diff --git a/code/modules/reagents/holder.dm b/code/modules/reagents/holder.dm index c91143578ac..6b7b3600819 100644 --- a/code/modules/reagents/holder.dm +++ b/code/modules/reagents/holder.dm @@ -173,7 +173,7 @@ else if(transfer_to_stomach && ishuman(target)) var/mob/living/carbon/human/eater = target - var/obj/item/organ/stomach/belly = eater.get_organ_slot(ORGAN_SLOT_STOMACH) + var/datum/internal_organ/stomach/belly = eater.get_organ_slot(ORGAN_SLOT_STOMACH) if(belly.organ_status != ORGAN_HEALTHY && prob(belly.damage * 3)) var/expel_amount = round(amount, CHEMICAL_QUANTISATION_LEVEL) if(expel_amount > 0 ) diff --git a/code/modules/reagents/reagents/alcohol.dm b/code/modules/reagents/reagents/alcohol.dm index afcb5601ab9..aa5add9bfeb 100644 --- a/code/modules/reagents/reagents/alcohol.dm +++ b/code/modules/reagents/reagents/alcohol.dm @@ -40,7 +40,7 @@ All effects don't start immediately, but rather get worse over time; the rate is C.drunkenness = max((C.drunkenness + (sqrt(volume) * boozepwr * ALCOHOL_RATE)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk. if(ishuman(C)) var/mob/living/carbon/human/H = C - var/obj/item/organ/liver/O = H.get_organ_slot(ORGAN_SLOT_LIVER) + var/datum/internal_organ/liver/O = H.get_organ_slot(ORGAN_SLOT_LIVER) if (istype(O)) O.get_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * O.alcohol_tolerance, 0)) * 0.002), TRUE) @@ -279,7 +279,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(prob(5)) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(istype(E)) E.get_damage(2) if(200 to INFINITY) @@ -291,7 +291,7 @@ All effects don't start immediately, but rather get worse over time; the rate is L.druggy = max(L.druggy, 60) if(ishuman(L) && prob(10)) var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(istype(E)) if(H.species.species_flags ~! NO_PAIN) to_chat(H, span_danger("You clutch for a moment as you feel a scorching pain covering your abdomen!")) diff --git a/code/modules/reagents/reagents/drink.dm b/code/modules/reagents/reagents/drink.dm index a3fb4b98d1c..040b89f91de 100644 --- a/code/modules/reagents/reagents/drink.dm +++ b/code/modules/reagents/reagents/drink.dm @@ -215,7 +215,7 @@ L.jitter(2) if(prob(5) && ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.get_damage(1, TRUE) L.emote(pick("twitch", "blink_r", "shiver")) @@ -228,7 +228,7 @@ L.Unconscious(10 SECONDS) if(prob(30) && ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.get_damage(1, TRUE) diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index 5a0b0f30d0a..780fa202b13 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -41,7 +41,7 @@ L.setDrowsyness(L.drowsyness, 20) if(ishuman(L)) //Critical overdose causes total blackout and heart damage. Too much stimulant var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) E.get_damage(0.5*effect_str, TRUE) if(prob(10)) L.emote(pick("twitch","blink_r","shiver")) @@ -175,7 +175,7 @@ L.reagent_pain_modifier += PAIN_REDUCTION_VERY_HEAVY if(ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.get_damage(3*effect_str, TRUE) @@ -415,7 +415,7 @@ if(!ishuman(L)) return var/mob/living/carbon/human/H = L - var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) E.get_damage(0.5*effect_str, TRUE) @@ -423,7 +423,7 @@ L.apply_damages(2*effect_str, 2*effect_str) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) E.get_damage(1.5*effect_str, TRUE) @@ -690,7 +690,7 @@ L.reagent_shock_modifier += PAIN_REDUCTION_VERY_LIGHT if(ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/brain/B = H.get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/B = H.get_organ_slot(ORGAN_SLOT_BRAIN) if(B.damage < 30) L.adjustBrainLoss(-1.5*effect_str) L.adjustToxLoss(-1.5 * effect_str) @@ -717,7 +717,7 @@ L.adjust_blindness(-5) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E.damage < 30) E.heal_organ_damage(effect_str) L.adjustToxLoss(-1.5 * effect_str) @@ -742,7 +742,7 @@ if(!ishuman(L)) return ..() var/mob/living/carbon/human/H = L - for(var/obj/item/organ/I in H.internal_organs) + for(var/datum/internal_organ/I in H.internal_organs) if(I.damage) if(L.bodytemperature > 169 && I.damage > 5) continue @@ -757,12 +757,12 @@ /datum/reagent/medicine/research/stimulon/on_mob_add(mob/living/L, metabolism) . = ..() var/mob/living/carbon/human/H = L - for(var/obj/item/organ/I in H.internal_organs) + for(var/datum/internal_organ/I in H.internal_organs) I.set_organ_status() /datum/reagent/medicine/research/stimulon/on_mob_delete(mob/living/L, metabolism) var/mob/living/carbon/human/H = L - for(var/obj/item/organ/I in H.internal_organs) + for(var/datum/internal_organ/I in H.internal_organs) I.set_organ_status() return ..() @@ -781,7 +781,7 @@ if(!ishuman(L)) return ..() var/mob/living/carbon/human/H = L - var/obj/item/organ/organ = H.get_damaged_organ() + var/datum/internal_organ/organ = H.get_damaged_organ() if(!organ) return ..() organ.heal_organ_damage(3 * effect_str) @@ -1049,13 +1049,13 @@ if(prob(15) && ishuman(L)) var/mob/living/carbon/human/H = L var/affected_organ = pick(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_KIDNEYS, ORGAN_SLOT_STOMACH) - var/obj/item/organ/I = H.get_organ_slot(affected_organ) + var/datum/internal_organ/I = H.get_organ_slot(affected_organ) I.get_damage(5.5 * effect_str) /datum/reagent/medicine/ultrazine/overdose_process(mob/living/L, metabolism) if(ishuman(L)) var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.get_damage(0.5*effect_str, TRUE) else @@ -1068,7 +1068,7 @@ L.adjustToxLoss(1.5*effect_str) else var/mob/living/carbon/human/H = L - var/obj/item/organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) + var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) E.get_damage(1.5*effect_str, TRUE) @@ -1458,7 +1458,7 @@ if(!ishuman(L)) return ..() var/mob/living/carbon/human/H = L - var/obj/item/organ/organ = H.get_damaged_organ() + var/datum/internal_organ/organ = H.get_damaged_organ() if(!organ) return ..() L.adjustToxLoss(5*effect_str) diff --git a/code/modules/surgery/brainrepair.dm b/code/modules/surgery/brainrepair.dm index 912da89ae47..1973708edd6 100644 --- a/code/modules/surgery/brainrepair.dm +++ b/code/modules/surgery/brainrepair.dm @@ -7,7 +7,7 @@ var/dmg_max /datum/surgery_step/brain/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected, checks_only) - var/obj/item/organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) if(!sponge || sponge.damage <= dmg_min || affected.surgery_open_stage != 3 || target_zone != "head") return SURGERY_CANNOT_USE if(dmg_max && sponge.damage > dmg_max) @@ -38,7 +38,7 @@ user.visible_message(span_notice("[user] takes out all the bone chips in [target]'s brain with \the [tool]."), \ span_notice("You take out all the bone chips in [target]'s brain with \the [tool].")) target.balloon_alert_to_viewers("Success") - var/obj/item/organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.damage = 0 return ..() @@ -72,7 +72,7 @@ user.visible_message(span_notice("[user] mends hematoma in [target]'s brain with \the [tool]."), \ span_notice("You mend hematoma in [target]'s brain with \the [tool].")) target.balloon_alert_to_viewers("Success") - var/obj/item/organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) + var/datum/internal_organ/brain/sponge = target.get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) sponge.damage = BONECHIPS_MAX_DAMAGE return ..() diff --git a/code/modules/surgery/eye.dm b/code/modules/surgery/eye.dm index 160d4350297..bba0cf09534 100644 --- a/code/modules/surgery/eye.dm +++ b/code/modules/surgery/eye.dm @@ -15,7 +15,7 @@ if(target_zone != "eyes") return 0 - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) if(!E) return 0 if(E.eye_surgery_stage == eye_step) @@ -42,13 +42,13 @@ user.visible_message(span_notice("[user] has separated the cornea on [target]'s eyes with \the [tool].") , \ span_notice("You have separated the cornea on [target]'s eyes with \the [tool]."),) target.balloon_alert_to_viewers("Success") - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.eye_surgery_stage = 1 target.disabilities |= NEARSIGHTED // code\#define\mobs.dm return ..() /datum/surgery_step/eye/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, slicing [target]'s eyes with \the [tool]!") , \ span_warning("Your hand slips, slicing [target]'s eyes with \the [tool]!") ) target.balloon_alert_to_viewers("Slipped!") @@ -77,12 +77,12 @@ user.visible_message(span_notice("[user] has lifted the cornea from [target]'s eyes with \the [tool].") , \ span_notice("You have lifted the cornea from [target]'s eyes with \the [tool].") ) target.balloon_alert_to_viewers("Success") - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.eye_surgery_stage = 2 return ..() /datum/surgery_step/eye/lift_eyes/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/obj/item/organ/eyes/eyes = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/eyes = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, damaging [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, damaging [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") @@ -110,12 +110,12 @@ user.visible_message(span_notice("[user] mends the nerves and lenses in [target]'s with \the [tool].") , \ span_notice("You mend the nerves and lenses in [target]'s with \the [tool].")) target.balloon_alert_to_viewers("Success") - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.eye_surgery_stage = 3 return ..() /datum/surgery_step/eye/mend_eyes/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, stabbing \the [tool] into [target]'s eye!"), span_warning("Your hand slips, stabbing \the [tool] into [target]'s eye!")) target.balloon_alert_to_viewers("Slipped!") @@ -145,13 +145,13 @@ target.balloon_alert_to_viewers("Success") target.disabilities &= ~NEARSIGHTED target.disabilities &= ~BLIND - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) E.damage = 0 E.eye_surgery_stage = 0 return ..() /datum/surgery_step/eye/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - var/obj/item/organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) + var/datum/internal_organ/eyes/E = target.get_organ_slot(ORGAN_SLOT_EYES) user.visible_message(span_warning("[user]'s hand slips, searing [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, searing [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") diff --git a/code/modules/surgery/mcomp_tendwounds.dm b/code/modules/surgery/mcomp_tendwounds.dm index 13dc0e24b97..7a1acb0c92e 100644 --- a/code/modules/surgery/mcomp_tendwounds.dm +++ b/code/modules/surgery/mcomp_tendwounds.dm @@ -95,7 +95,7 @@ /datum/surgery_step/mcomp_wounds/mtend_wounds/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) target.heal_overall_damage(65,65) - for(var/obj/item/organ/organ in target.internal_organs) //Fixes all organs + for(var/datum/internal_organ/organ in target.internal_organs) //Fixes all organs organ.heal_organ_damage(100) affected.surgery_open_stage = 0.75 diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index e4e4a994f14..19410363a8b 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -85,13 +85,13 @@ if(..()) if(affected.body_part == HEAD)//brain and eye damage is fixed by a separate surgery return SURGERY_CANNOT_USE - for(var/obj/item/organ/I in affected.internal_organs) + for(var/datum/internal_organ/I in affected.internal_organs) if(I.damage > 0) return SURGERY_CAN_USE return SURGERY_CANNOT_USE /datum/surgery_step/internal/fix_organ/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - for(var/obj/item/organ/I in affected.internal_organs) + for(var/datum/internal_organ/I in affected.internal_organs) if(I?.damage > 0) user.visible_message(span_notice("[user] starts treating damage to [target]'s [I.name] with the surgical membrane."), \ span_notice("You start treating damage to [target]'s [I.name] with the surgical membrane.") ) @@ -101,7 +101,7 @@ ..() /datum/surgery_step/internal/fix_organ/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/limb/affected) - for(var/obj/item/organ/I in affected.internal_organs) + for(var/datum/internal_organ/I in affected.internal_organs) if(I?.damage > 0) user.visible_message(span_notice("[user] treats damage to [target]'s [I.name] with surgical membrane."), \ @@ -119,7 +119,7 @@ if(istype(tool, /obj/item/tool/surgery/surgical_membrane)) target.adjustToxLoss(5) - for(var/obj/item/organ/I in affected.internal_organs) + for(var/datum/internal_organ/I in affected.internal_organs) if(I?.damage > 0) I.get_damage(dam_amt,0) target.updatehealth() From f247aaa24f5434082ca98f7c283b7a4ca9f42f06 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 14:17:51 +0300 Subject: [PATCH 34/43] ueh --- code/game/objects/machinery/autodoc.dm | 6 +++--- code/modules/mob/living/carbon/human/species.dm | 16 ++++++++-------- code/modules/mob/living/carbon/human/zombie.dm | 16 ++++++++-------- code/modules/organs/limbs.dm | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/code/game/objects/machinery/autodoc.dm b/code/game/objects/machinery/autodoc.dm index 4d42e0d1b9a..7af99699b89 100644 --- a/code/game/objects/machinery/autodoc.dm +++ b/code/game/objects/machinery/autodoc.dm @@ -383,7 +383,7 @@ if(S.limb_ref.body_part != GROIN) open_encased(occupant, S.limb_ref) - if(!istype(S.organ_ref, /obj/item/organ/brain)) + if(!istype(S.organ_ref, /datum/internal_organ/brain)) sleep(FIX_ORGAN_MAX_DURATION*surgery_mod) else if(S.organ_ref.damage > BONECHIPS_MAX_DAMAGE) @@ -391,7 +391,7 @@ sleep(BONECHIPS_REMOVAL_MAX_DURATION * surgery_mod) if(!surgery) break - if(istype(S.organ_ref, /obj/item/organ)) + if(istype(S.organ_ref, /datum/internal_organ)) S.organ_ref.heal_organ_damage(S.organ_ref.damage) else say("Organ is missing.") @@ -408,7 +408,7 @@ say("Procedure has been deemed unnecessary.") surgery_todo_list -= S continue - if(istype(S.organ_ref, /obj/item/organ/eyes)) + if(istype(S.organ_ref, /datum/internal_organ/eyes)) var/datum/internal_organ/eyes/E = S.organ_ref if(E.eye_surgery_stage == 0) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 035a8693a3a..4e9529fc639 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -101,14 +101,14 @@ /// inherent species-specific actions var/list/inherent_actions var/list/has_organ = list( - ORGAN_SLOT_HEART = /obj/item/organ/heart, - ORGAN_SLOT_LUNGS = /obj/item/organ/lungs, - ORGAN_SLOT_LIVER = /obj/item/organ/liver, - ORGAN_SLOT_STOMACH = /obj/item/organ/stomach, - ORGAN_SLOT_KIDNEYS = /obj/item/organ/kidneys, - ORGAN_SLOT_BRAIN = /obj/item/organ/brain, - ORGAN_SLOT_APPENDIX = /obj/item/organ/appendix, - ORGAN_SLOT_EYES = /obj/item/organ/eyes + ORGAN_SLOT_HEART = /datum/internal_organ/heart, + ORGAN_SLOT_LUNGS = /datum/internal_organ/lungs, + ORGAN_SLOT_LIVER = /datum/internal_organ/liver, + ORGAN_SLOT_STOMACH = /datum/internal_organ/stomach, + ORGAN_SLOT_KIDNEYS = /datum/internal_organ/kidneys, + ORGAN_SLOT_BRAIN = /datum/internal_organ/brain, + ORGAN_SLOT_APPENDIX = /datum/internal_organ/appendix, + ORGAN_SLOT_EYES = /datum/internal_organ/eyes ) var/knock_down_reduction = 1 //how much the knocked_down effect is reduced per Life call. diff --git a/code/modules/mob/living/carbon/human/zombie.dm b/code/modules/mob/living/carbon/human/zombie.dm index 72fd401665d..f4230361587 100644 --- a/code/modules/mob/living/carbon/human/zombie.dm +++ b/code/modules/mob/living/carbon/human/zombie.dm @@ -11,14 +11,14 @@ slowdown = 0.5 default_language_holder = /datum/language_holder/zombie has_organ = list( - ORGAN_SLOT_HEART = /obj/item/organ/heart, - ORGAN_SLOT_LUNGS = /obj/item/organ/lungs, - ORGAN_SLOT_LIVER = /obj/item/organ/liver, - ORGAN_SLOT_STOMACH = /obj/item/organ/stomach, - ORGAN_SLOT_KIDNEYS = /obj/item/organ/kidneys, - ORGAN_SLOT_BRAIN = /obj/item/organ/brain, - ORGAN_SLOT_APPENDIX = /obj/item/organ/appendix, - ORGAN_SLOT_EYES = /obj/item/organ/eyes + ORGAN_SLOT_HEART = /datum/internal_organ/heart, + ORGAN_SLOT_LUNGS = /datum/internal_organ/lungs, + ORGAN_SLOT_LIVER = /datum/internal_organ/liver, + ORGAN_SLOT_STOMACH = /datum/internal_organ/stomach, + ORGAN_SLOT_KIDNEYS = /datum/internal_organ/kidneys, + ORGAN_SLOT_BRAIN = /datum/internal_organ/brain, + ORGAN_SLOT_APPENDIX = /datum/internal_organ/appendix, + ORGAN_SLOT_EYES = /datum/internal_organ/eyes ) ///Sounds made randomly by the zombie var/list/sounds = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg') diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index 6518b994136..fff18324af8 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -38,7 +38,7 @@ var/list/datum/limb/children ///List of Internal organs of this body part - var/list/obj/item/organ/internal_organs + var/list/datum/internal_organ/internal_organs /// Message that displays when you feel pain from this limb var/damage_msg = span_warning("You feel an intense pain") From 2e7a6a9d13a4d1eca0ade9e5d87fdd545749b6ca Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 14:34:53 +0300 Subject: [PATCH 35/43] mhm --- code/game/objects/structures/supplypod.dm | 9 -- .../admin/verbs/centcom_podlauncher.dm | 4 - code/modules/admin/verbs/podlauncher.dm | 5 - code/modules/mob/living/brain/MMI.dm | 139 ------------------ code/modules/mob/living/brain/death.dm | 10 -- code/modules/mob/living/brain/emote.dm | 40 ----- code/modules/mob/living/brain/life.dm | 21 +-- code/modules/organs/_organ.dm | 22 +-- code/modules/organs/organ_props.dm | 43 ++++++ code/modules/organs/organs.dm | 72 ++++----- tgmc.dme | 3 +- .../tgui/interfaces/CentcomPodLauncher.js | 9 -- tgui/packages/tgui/interfaces/PodLauncher.js | 1 - 13 files changed, 85 insertions(+), 293 deletions(-) delete mode 100644 code/modules/mob/living/brain/MMI.dm delete mode 100644 code/modules/mob/living/brain/emote.dm create mode 100644 code/modules/organs/organ_props.dm diff --git a/code/game/objects/structures/supplypod.dm b/code/game/objects/structures/supplypod.dm index 8d9709002e7..5e6c907ea5e 100644 --- a/code/game/objects/structures/supplypod.dm +++ b/code/game/objects/structures/supplypod.dm @@ -37,7 +37,6 @@ GLOBAL_LIST_INIT(pod_styles, list(\ var/damage = 0 var/effectStun = FALSE var/effectLimb = FALSE - var/effectOrgans = FALSE var/effectGib = FALSE var/effectStealth = FALSE var/effectQuiet = FALSE @@ -123,14 +122,6 @@ GLOBAL_LIST_INIT(pod_styles, list(\ continue E.droplimb() - if(effectOrgans && ishuman(L)) - var/mob/living/carbon/human/H = L - for(var/datum/internal_organ/IO in H.internal_organs) - var/destination = get_edge_target_turf(T, pick(GLOB.alldirs)) - IO.forceMove(T) - IO.throw_at(destination, 2, 3) - sleep(0.1 SECONDS) - if(effectGib) L.adjustBruteLoss(5000) L.gib() diff --git a/code/modules/admin/verbs/centcom_podlauncher.dm b/code/modules/admin/verbs/centcom_podlauncher.dm index 6af9f59582d..33d44a8ee2b 100644 --- a/code/modules/admin/verbs/centcom_podlauncher.dm +++ b/code/modules/admin/verbs/centcom_podlauncher.dm @@ -77,7 +77,6 @@ data["styleChoice"] = temp_pod.style //Style is a variable that keeps track of what the pod is supposed to look like. It acts as an index to the POD_STYLES list in cargo.dm defines to get the proper icon/name/desc for the pod. data["effectStun"] = temp_pod.effectStun //If true, stuns anyone under the pod when it launches until it lands, forcing them to get hit by the pod. Devilish! data["effectLimb"] = temp_pod.effectLimb //If true, pops off a limb (if applicable) from anyone caught under the pod when it lands - data["effectOrgans"] = temp_pod.effectOrgans //If true, yeets the organs out of any bodies caught under the pod when it lands data["effectBluespace"] = temp_pod.bluespace //If true, the pod deletes (in a shower of sparks) after landing data["effectStealth"] = temp_pod.effectStealth //If true, a target icon isnt displayed on the turf where the pod will land data["effectQuiet"] = temp_pod.effectQuiet //The female sniper. If true, the pod makes no noise (including related explosions, opening sounds, etc) @@ -241,9 +240,6 @@ if("effectLimb") //Toggle: Anyone carbon mob under the pod loses a limb when it lands temp_pod.effectLimb = !temp_pod.effectLimb . = TRUE - if("effectOrgans") //Toggle: Anyone carbon mob under the pod loses a limb when it lands - temp_pod.effectOrgans = !temp_pod.effectOrgans - . = TRUE if("effectBluespace") //Toggle: Deletes the pod after landing temp_pod.bluespace = !temp_pod.bluespace . = TRUE diff --git a/code/modules/admin/verbs/podlauncher.dm b/code/modules/admin/verbs/podlauncher.dm index 42e1495fb52..a84c7718e59 100644 --- a/code/modules/admin/verbs/podlauncher.dm +++ b/code/modules/admin/verbs/podlauncher.dm @@ -97,7 +97,6 @@ data["styleChoice"] = temp_pod.style data["effectStun"] = temp_pod.effectStun data["effectLimb"] = temp_pod.effectLimb - data["effectOrgans"] = temp_pod.effectOrgans data["effectBluespace"] = temp_pod.bluespace data["effectStealth"] = temp_pod.effectStealth data["effectQuiet"] = temp_pod.effectQuiet @@ -271,10 +270,6 @@ temp_pod.effectLimb = !temp_pod.effectLimb . = TRUE - if("effectOrgans") - temp_pod.effectOrgans = !temp_pod.effectOrgans - . = TRUE - if("effectBluespace") temp_pod.bluespace = !temp_pod.bluespace . = TRUE diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm deleted file mode 100644 index 9ddc7a53005..00000000000 --- a/code/modules/mob/living/brain/MMI.dm +++ /dev/null @@ -1,139 +0,0 @@ -/// this code sucks dont use it -/obj/item/mmi - name = "Man-Machine Interface" - desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity." - icon = 'icons/obj/items/assemblies.dmi' - icon_state = "mmi_empty" - w_class = WEIGHT_CLASS_NORMAL - - //these vars are so the mecha fabricator doesn't shit itself anymore. --NEO - - req_access = list(ACCESS_MARINE_RESEARCH) - - //Revised. Brainmob is now contained directly within object of transfer. MMI in this case. - - var/locked = 0 - var/mob/living/brain/brainmob = null//The current occupant. - - -/obj/item/mmi/attackby(obj/item/O, mob/user) - if(istype(O,/obj/item/organ/brain) && !brainmob) //Time to stick a brain in it --NEO - - var/datum/internal_organ/brain/B = O - if(B.obj_integrity <= 0) - to_chat(user, span_warning("That brain is well and truly dead.")) - return - else if(!B.brainmob) - to_chat(user, span_warning("You aren't sure where this brain came from, but you're pretty sure it's a useless brain.")) - return - - visible_message(span_notice("[user] sticks \a [O] into \the [src].")) - - brainmob = O:brainmob - O:brainmob = null - brainmob.loc = src - brainmob.container = src - brainmob.set_stat(CONSCIOUS) - GLOB.dead_mob_list -= brainmob//Update dem lists - GLOB.alive_living_list += brainmob - - user.drop_held_item() - qdel(O) - - name = "Man-Machine Interface: [brainmob.real_name]" - icon_state = "mmi_full" - - locked = 1 - - return - - if(istype(O,/obj/item/card/id) && brainmob) - if(allowed(user)) - locked = !locked - to_chat(user, span_notice("You [locked ? "lock" : "unlock"] the brain holder.")) - else - to_chat(user, span_warning("Access denied.")) - return - if(brainmob) - O.attack(brainmob, user)//Oh noooeeeee - return - ..() - - //TODO: ORGAN REMOVAL UPDATE. Make the brain remain in the MMI so it doesn't lose organ data. -/obj/item/mmi/attack_self(mob/user as mob) - if(!brainmob) - to_chat(user, span_warning("You upend the MMI, but there's nothing in it.")) - else if(locked) - to_chat(user, span_warning("You upend the MMI, but the brain is clamped into place.")) - else - to_chat(user, span_notice("You upend the MMI, spilling the brain onto the floor.")) - var/datum/internal_organ/brain/brain = new(user.loc) - brainmob.container = null//Reset brainmob mmi var. - brainmob.loc = brain//Throw mob into brain. - GLOB.alive_living_list -= brainmob//Get outta here - brain.brainmob = brainmob//Set the brain to use the brainmob - brainmob = null//Set mmi brainmob var to null - - icon_state = "mmi_empty" - name = "Man-Machine Interface" - -/obj/item/mmi/proc/transfer_identity(mob/living/carbon/human/H)//Same deal as the regular brain proc. Used for human-->robot people. - brainmob = new(src) - brainmob.name = H.real_name - brainmob.real_name = H.real_name - brainmob.container = src - - name = "Man-Machine Interface: [brainmob.real_name]" - icon_state = "mmi_full" - locked = 1 - return - -/obj/item/mmi/radio_enabled - name = "Radio-enabled Man-Machine Interface" - desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity. This one comes with a built-in radio." - - var/obj/item/radio/radio = null//Let's give it a radio. - -/obj/item/mmi/radio_enabled/Initialize(mapload) - . = ..() - radio = new(src)//Spawns a radio inside the MMI. - radio.broadcasting = 1//So it's broadcasting from the start. - -/obj/item/mmi/radio_enabled/verb/Toggle_Broadcasting() - set name = "Toggle Broadcasting" - set desc = "Toggle broadcasting channel on or off." - set category = "MMI" - set src = usr.loc//In user location, or in MMI in this case. - set popup_menu = 0//Will not appear when right clicking. - - if(brainmob.stat)//Only the brainmob will trigger these so no further check is necessary. - to_chat(brainmob, "Can't do that while incapacitated or dead.") - - radio.broadcasting = radio.broadcasting==1 ? 0 : 1 - to_chat(brainmob, span_notice("Radio is [radio.broadcasting==1 ? "now" : "no longer"] broadcasting.")) - -/obj/item/mmi/radio_enabled/verb/Toggle_Listening() - set name = "Toggle Listening" - set desc = "Toggle listening channel on or off." - set category = "MMI" - set src = usr.loc - set popup_menu = 0 - - if(brainmob.stat) - to_chat(brainmob, "Can't do that while incapacitated or dead.") - - radio.listening = radio.listening==1 ? 0 : 1 - to_chat(brainmob, span_notice("Radio is [radio.listening==1 ? "now" : "no longer"] receiving broadcast.")) - -/obj/item/mmi/emp_act(severity) - if(!brainmob) - return - else - switch(severity) - if(1) - brainmob.emp_damage += rand(20,30) - if(2) - brainmob.emp_damage += rand(10,20) - if(3) - brainmob.emp_damage += rand(0,10) - ..() diff --git a/code/modules/mob/living/brain/death.dm b/code/modules/mob/living/brain/death.dm index 71bd879e5ab..5e21e54aa24 100644 --- a/code/modules/mob/living/brain/death.dm +++ b/code/modules/mob/living/brain/death.dm @@ -1,14 +1,4 @@ -/mob/living/brain/death(gibbing, deathmessage = "beeps shrilly as the MMI flatlines!", silent) - if(stat == DEAD) - return ..() - if(!gibbing && istype(container, /obj/item/mmi)) //If not gibbing but in a container. - container.icon_state = "mmi_dead" - return ..() - - /mob/living/brain/gib() - if(istype(container, /obj/item/mmi)) - qdel(container)//Gets rid of the MMI if there is one if(loc) if(istype(loc,/obj/item/organ/brain)) qdel(loc)//Gets rid of the brain item diff --git a/code/modules/mob/living/brain/emote.dm b/code/modules/mob/living/brain/emote.dm deleted file mode 100644 index a518c9db5b0..00000000000 --- a/code/modules/mob/living/brain/emote.dm +++ /dev/null @@ -1,40 +0,0 @@ -/datum/emote/brain - mob_type_allowed_typecache = list(/mob/living/brain) - mob_type_blacklist_typecache = list() - - -/datum/emote/brain/can_run_emote(mob/user, status_check = TRUE, intentional = FALSE) - . = ..() - var/mob/living/brain/B = user - if(!istype(B) || (!(B.container && istype(B.container, /obj/item/mmi)))) - return FALSE - - -/datum/emote/brain/alarm - key = "alarm" - message = "sounds an alarm." - emote_type = EMOTE_AUDIBLE - - -/datum/emote/brain/alert - key = "alert" - message = "lets out a distressed noise." - emote_type = EMOTE_AUDIBLE - - -/datum/emote/brain/flash - key = "flash" - message = "blinks their lights." - - -/datum/emote/brain/notice - key = "notice" - message = "plays a loud tone." - emote_type = EMOTE_AUDIBLE - - -/datum/emote/brain/whistle - key = "whistle" - key_third_person = "whistles" - message = "whistles." - emote_type = EMOTE_AUDIBLE diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index ec65a88273e..f830572169b 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -28,11 +28,8 @@ return 1 //Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere - if(emp_damage) //This is pretty much a damage type only used by MMIs, dished out by the emp_act - if(!(container && istype(container, /obj/item/mmi))) - emp_damage = 0 - else - emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with + if(emp_damage) + emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with switch(emp_damage) if(31 to INFINITY) emp_damage = 30//Let's not overdo it @@ -110,17 +107,3 @@ interactee?.check_eye(src) return 1 - - -/*/mob/living/brain/emp_act(severity) - if(!(container && istype(container, /obj/item/mmi))) - return - else - switch(severity) - if(1) - emp_damage += rand(20,30) - if(2) - emp_damage += rand(10,20) - if(3) - emp_damage += rand(0,10) - ..()*/ diff --git a/code/modules/organs/_organ.dm b/code/modules/organs/_organ.dm index 6c7541d1144..61ae5cb73e9 100644 --- a/code/modules/organs/_organ.dm +++ b/code/modules/organs/_organ.dm @@ -1,11 +1,5 @@ -/obj/item/organ - name = "organ" - desc = "It looks like it probably just plopped out." - icon = 'icons/obj/items/organs.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/inhands/items/bodyparts_left.dmi', - slot_r_hand_str = 'icons/mob/inhands/items/bodyparts_right.dmi', - ) +/datum/internal_organ + var/name = "organ" /// Reference to the mob owning the organs var/mob/living/carbon/human/owner = null /// Reference to the limb we're inside of @@ -24,7 +18,7 @@ var/peri_effect = FALSE //This is used in the create_organs() which transfers human datums to organs -/obj/item/organ/New(mob/living/carbon/carbon_mob) +/datum/internal_organ/New(mob/living/carbon/carbon_mob) ..() if(!istype(carbon_mob)) return @@ -36,16 +30,16 @@ var/datum/limb/limb = human.get_limb(parent_limb) LAZYDISTINCTADD(limb.internal_organs, src) -/obj/item/organ/Destroy() +/datum/internal_organ/Destroy() clean_owner() return ..() ///Signal handler to prevent hard del -/obj/item/organ/proc/clean_owner() +/datum/internal_organ/proc/clean_owner() SIGNAL_HANDLER owner = null -/obj/item/organ/proc/get_damage(amount, silent = FALSE) +/datum/internal_organ/proc/get_damage(amount, silent = FALSE) if(SSticker.mode?.flags_round_type & MODE_NO_PERMANENT_WOUNDS) return if(amount <= 0) @@ -58,12 +52,12 @@ owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) set_organ_status() -/obj/item/organ/proc/heal_organ_damage(amount) +/datum/internal_organ/proc/heal_organ_damage(amount) damage = max(damage - amount, 0) set_organ_status() /// Set the correct organ state -/obj/item/organ/proc/set_organ_status() +/datum/internal_organ/proc/set_organ_status() if(owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.1 && peri_effect) //0.1 just in case if(organ_status != ORGAN_HEALTHY) organ_status = ORGAN_HEALTHY diff --git a/code/modules/organs/organ_props.dm b/code/modules/organs/organ_props.dm new file mode 100644 index 00000000000..c7054309aeb --- /dev/null +++ b/code/modules/organs/organ_props.dm @@ -0,0 +1,43 @@ +/obj/item/organ + name = "organ" + desc = "It looks like it probably just plopped out." + icon = 'icons/obj/items/organs.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/inhands/items/bodyparts_left.dmi', + slot_r_hand_str = 'icons/mob/inhands/items/bodyparts_right.dmi', + ) + +/obj/item/organ/heart + name = "heart" + icon_state = "heart-on" + +/obj/item/organ/lungs + name = "lungs" + icon_state = "lungs" + gender = PLURAL + +/obj/item/organ/kidneys + name = "kidneys" + icon_state = "kidneys" + gender = PLURAL + +/obj/item/organ/liver + name = "liver" + icon_state = "liver" + +/obj/item/organ/appendix + name = "appendix" + icon_state = "appendix" + +/obj/item/organ/stomach + name = "stomach" + icon_state = "stomach" + +/obj/item/organ/eyes + name = "eyeballs" + icon_state = "eyes" + gender = PLURAL + +/obj/item/organ/brain + name = "brain" + icon_state = "brain2" diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index cf0795fdb8b..c685858f81f 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -1,17 +1,15 @@ -// This is not set to vital because death immediately occurs in blood.dm if it is removed. Also, all damage effects are handled there. -/obj/item/organ/heart +/datum/internal_organ/heart name = "heart" - icon_state = "heart-on" slot = ORGAN_SLOT_HEART peri_effect = TRUE -/obj/item/organ/heart/process() +/datum/internal_organ/heart/process() if(organ_status == ORGAN_BRUISED && prob(5)) owner.emote("me", 1, "grabs at [owner.p_their()] chest!") else if(organ_status == ORGAN_BROKEN && prob(20)) owner.emote("me", 1, "clutches [owner.p_their()] chest!") -/obj/item/organ/heart/set_organ_status() +/datum/internal_organ/heart/set_organ_status() var/old_organ_status = organ_status . = ..() if(!.) @@ -19,18 +17,16 @@ owner.max_stamina_buffer += (old_organ_status - organ_status) * 25 owner.maxHealth += (old_organ_status - organ_status) * 20 -/obj/item/organ/lungs +/datum/internal_organ/lungs name = "lungs" - icon_state = "lungs" - gender = PLURAL slot = ORGAN_SLOT_LUNGS peri_effect = TRUE -/obj/item/organ/lungs/process() +/datum/internal_organ/lungs/process() if((organ_status == ORGAN_BRUISED && prob(5)) || (organ_status == ORGAN_BROKEN && prob(20))) owner.emote("me", 1, "gasps for air!") -/obj/item/organ/lungs/set_organ_status() +/datum/internal_organ/lungs/set_organ_status() . = ..() if(!.) return @@ -40,14 +36,12 @@ owner.add_movespeed_modifier(name, override = TRUE, multiplicative_slowdown = organ_status) //Hits of 1 damage or less won't do anything due to how losebreath works, but any stronger and we'll get the wind knocked out of us for a bit. Mostly just flavor. -/obj/item/organ/lungs/get_damage(amount, silent = FALSE) +/datum/internal_organ/lungs/get_damage(amount, silent = FALSE) owner.adjust_Losebreath(amount) return ..() -/obj/item/organ/kidneys +/datum/internal_organ/kidneys name = "kidneys" - icon_state = "kidneys" - gender = PLURAL slot = ORGAN_SLOT_KIDNEYS parent_limb = BODY_ZONE_PRECISE_GROIN peri_effect = TRUE @@ -62,39 +56,39 @@ ///Total medicines removed since last tick var/removed_medicines = 0 -/obj/item/organ/kidneys/New(mob/living/carbon/carbon_mob) +/datum/internal_organ/kidneys/New(mob/living/carbon/carbon_mob) . = ..() if(!owner) return RegisterSignal(owner.reagents, COMSIG_NEW_REAGENT_ADD, PROC_REF(owner_added_reagent)) RegisterSignal(owner.reagents, COMSIG_REAGENT_DELETING, PROC_REF(owner_removed_reagent)) -/obj/item/organ/kidneys/clean_owner() +/datum/internal_organ/kidneys/clean_owner() if(owner?.reagents) UnregisterSignal(owner.reagents, list(COMSIG_NEW_REAGENT_ADD, COMSIG_REAGENT_DELETING)) return ..() ///Signaled proc. Check if the added reagent was under reagent/medicine. If so, increment medicine counter and potentially notify owner. -/obj/item/organ/kidneys/proc/owner_added_reagent(datum/source, reagent_type, amount) +/datum/internal_organ/kidneys/proc/owner_added_reagent(datum/source, reagent_type, amount) SIGNAL_HANDLER if(!ispath(reagent_type, /datum/reagent/medicine)) return new_medicines++ ///Signaled proc. Check if the removed reagent was under reagent/medicine. If so, decrement medicine counter and potentially notify owner. -/obj/item/organ/kidneys/proc/owner_removed_reagent(datum/source, reagent_type) +/datum/internal_organ/kidneys/proc/owner_removed_reagent(datum/source, reagent_type) SIGNAL_HANDLER if(!ispath(reagent_type, /datum/reagent/medicine)) return removed_medicines++ -/obj/item/organ/kidneys/set_organ_status() +/datum/internal_organ/kidneys/set_organ_status() . = ..() if(!.) return current_medicine_cap = initial(current_medicine_cap) - 2 * organ_status -/obj/item/organ/kidneys/process() +/datum/internal_organ/kidneys/process() current_medicine_count += new_medicines //We want to include medicines that were individually both added and removed this tick var/overflow = current_medicine_count - current_medicine_cap //This catches any case where a reagent was added with volume below its metabolism current_medicine_count -= removed_medicines //Otherwise, you can microdose infinite chems without kidneys complaining @@ -117,9 +111,8 @@ if(prob(overflow * (organ_status + 1) * 10)) owner.Confused(2 SECONDS * (organ_status + 1)) -/obj/item/organ/liver +/datum/internal_organ/liver name = "liver" - icon_state = "liver" slot = ORGAN_SLOT_LIVER peri_effect = TRUE ///lower value, higher resistance. @@ -127,7 +120,7 @@ ///How fast we clean out toxins/toxloss. Adjusts based on organ damage. var/filter_rate = 3 -/obj/item/organ/liver/process() +/datum/internal_organ/liver/process() //High toxins levels are dangerous if you aren't actively treating them. 100 seconds to hit bruised from this alone if(owner.getToxLoss() >= (80 - 20 * organ_status)) //Healthy liver suffers on its own @@ -155,34 +148,34 @@ if(prob(organ_status)) //Just under once every three minutes while bruised, twice as often while broken. owner.vomit() //No stomach, so the liver can cause vomiting instead. Stagger and slowdown plus feedback that something's wrong. -/obj/item/organ/liver/set_organ_status() +/datum/internal_organ/liver/set_organ_status() . = ..() if(!.) return filter_rate = initial(filter_rate) - organ_status -/obj/item/organ/appendix +/datum/internal_organ/appendix name = "appendix" - icon_state = "appendix" slot = ORGAN_SLOT_APPENDIX parent_limb = BODY_ZONE_PRECISE_GROIN peri_effect = TRUE -/obj/item/organ/stomach +/datum/internal_organ/stomach name = "stomach" - icon_state = "stomach" slot = ORGAN_SLOT_STOMACH peri_effect = TRUE ///This is a reagent user and needs more then the 10u from edible component - var/reagent_vol = 1000 + //var/reagent_vol = 1000 ///The rate that the stomach will transfer reagents to the body var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 + /// Our reagents + var/datum/reagents/reagents = new /datum/reagents(1000) -/obj/item/organ/stomach/New(mob/living/carbon/carbon_mob) - . = ..() - create_reagents(reagent_vol) +///datum/internal_organ/stomach/New(mob/living/carbon/carbon_mob) +// . = ..() +// reagents.create_reagents(reagent_vol) -/obj/item/organ/stomach/process() +/datum/internal_organ/stomach/process() var/mob/living/carbon/human/body = owner // digest food, send all reagents that can be metabolized to the body @@ -211,28 +204,25 @@ to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down it's contents!")) return -/obj/item/organ/eyes +/datum/internal_organ/eyes name = "eyeballs" - icon_state = "eyes" - gender = PLURAL slot = ORGAN_SLOT_EYES parent_limb = BODY_ZONE_HEAD ///stores which stage of the eye surgery the eye is at var/eye_surgery_stage = 0 -/obj/item/organ/eyes/process() +/datum/internal_organ/eyes/process() if(organ_status == ORGAN_BRUISED) owner.set_blurriness(20) if(organ_status == ORGAN_BROKEN) owner.set_blindness(20) -/obj/item/organ/brain +/datum/internal_organ/brain name = "brain" - icon_state = "brain2" parent_limb = BODY_ZONE_HEAD var/mob/living/brain/brainmob = null -/obj/item/organ/brain/set_organ_status() +/datum/internal_organ/brain/set_organ_status() var/old_organ_status = organ_status . = ..() if(!.) @@ -244,7 +234,7 @@ REMOVE_TRAIT(owner, TRAIT_DROOLING, BRAIN_TRAIT) // I'm not sure if this proc is even used -/obj/item/organ/brain/proc/transfer_identity(mob/living/carbon/H) +/datum/internal_organ/brain/proc/transfer_identity(mob/living/carbon/H) name = "[H]'s brain" brainmob = new(src) brainmob.name = H.real_name diff --git a/tgmc.dme b/tgmc.dme index 210d8a0e605..d1aa55b8f99 100644 --- a/tgmc.dme +++ b/tgmc.dme @@ -1584,10 +1584,8 @@ #include "code\modules\mob\living\status_procs.dm" #include "code\modules\mob\living\brain\brain.dm" #include "code\modules\mob\living\brain\death.dm" -#include "code\modules\mob\living\brain\emote.dm" #include "code\modules\mob\living\brain\life.dm" #include "code\modules\mob\living\brain\login.dm" -#include "code\modules\mob\living\brain\MMI.dm" #include "code\modules\mob\living\carbon\carbon.dm" #include "code\modules\mob\living\carbon\carbon_defense.dm" #include "code\modules\mob\living\carbon\carbon_defines.dm" @@ -1792,6 +1790,7 @@ #include "code\modules\organs\_organ.dm" #include "code\modules\organs\limb_objects.dm" #include "code\modules\organs\limbs.dm" +#include "code\modules\organs\organ_props.dm" #include "code\modules\organs\organs.dm" #include "code\modules\organs\pain.dm" #include "code\modules\organs\wound.dm" diff --git a/tgui/packages/tgui/interfaces/CentcomPodLauncher.js b/tgui/packages/tgui/interfaces/CentcomPodLauncher.js index 01c49786927..e507246553e 100644 --- a/tgui/packages/tgui/interfaces/CentcomPodLauncher.js +++ b/tgui/packages/tgui/interfaces/CentcomPodLauncher.js @@ -160,15 +160,6 @@ export const CentcomPodLauncher = (props, context) => { `} onClick={() => act('effectLimb')} /> - -
From f51536714be625369b0973deaa75c07f3d4f7132 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 14:36:05 +0300 Subject: [PATCH 36/43] delete props --- .../Campaign maps/nt_base/nt_base.dmm | 2 +- .../Pillar_of_Spring/TGS_Pillar_of_Spring.dmm | 12 +++---- _maps/map_files/gelida_iv/gelida_iv.dmm | 2 +- .../effects/spawners/random/medical.dm | 14 ++++---- code/game/objects/structures/prop.dm | 34 ------------------- 5 files changed, 15 insertions(+), 49 deletions(-) diff --git a/_maps/map_files/Campaign maps/nt_base/nt_base.dmm b/_maps/map_files/Campaign maps/nt_base/nt_base.dmm index 381db7ed5c3..977e31aa3a0 100644 --- a/_maps/map_files/Campaign maps/nt_base/nt_base.dmm +++ b/_maps/map_files/Campaign maps/nt_base/nt_base.dmm @@ -21394,7 +21394,7 @@ pixel_x = -11 }, /obj/effect/decal/cleanable/blood/gibs/body, -/obj/item/prop/organ/heart, +/obj/item/organ/heart, /turf/open/floor/tile/dark2{ dir = 8 }, diff --git a/_maps/map_files/Pillar_of_Spring/TGS_Pillar_of_Spring.dmm b/_maps/map_files/Pillar_of_Spring/TGS_Pillar_of_Spring.dmm index f5dc9eb1b96..9ed559c6663 100644 --- a/_maps/map_files/Pillar_of_Spring/TGS_Pillar_of_Spring.dmm +++ b/_maps/map_files/Pillar_of_Spring/TGS_Pillar_of_Spring.dmm @@ -8543,7 +8543,7 @@ /area/mainship/command/self_destruct) "lcA" = ( /obj/machinery/optable, -/obj/item/prop/organ/kidneys, +/obj/item/organ/kidneys, /turf/open/floor/cult, /area/medical/morgue) "lcL" = ( @@ -9573,11 +9573,11 @@ "mcR" = ( /obj/structure/toilet, /obj/structure/closet/crate/freezer, -/obj/item/prop/organ/kidneys, -/obj/item/prop/organ/kidneys, -/obj/item/prop/organ/kidneys, -/obj/item/prop/organ/kidneys, -/obj/item/prop/organ/kidneys, +/obj/item/organ/kidneys, +/obj/item/organ/kidneys, +/obj/item/organ/kidneys, +/obj/item/organ/kidneys, +/obj/item/organ/kidneys, /turf/open/floor/mainship/floor, /area/mainship/medical/upper_medical) "mdp" = ( diff --git a/_maps/map_files/gelida_iv/gelida_iv.dmm b/_maps/map_files/gelida_iv/gelida_iv.dmm index b26e8f42cbc..b33d4197be5 100644 --- a/_maps/map_files/gelida_iv/gelida_iv.dmm +++ b/_maps/map_files/gelida_iv/gelida_iv.dmm @@ -23274,7 +23274,7 @@ pixel_x = -11 }, /obj/effect/decal/cleanable/blood/gibs/body, -/obj/item/prop/organ/heart, +/obj/item/organ/heart, /turf/open/floor/tile/dark2{ dir = 8 }, diff --git a/code/game/objects/effects/spawners/random/medical.dm b/code/game/objects/effects/spawners/random/medical.dm index 1b3d2e978df..558d762a05d 100644 --- a/code/game/objects/effects/spawners/random/medical.dm +++ b/code/game/objects/effects/spawners/random/medical.dm @@ -100,13 +100,13 @@ name = "Random surgical organ spawner" icon_state = "random_organ" loot = list( - /obj/item/prop/organ/brain, - /obj/item/prop/organ/heart, - /obj/item/prop/organ/lungs, - /obj/item/prop/organ/kidneys, - /obj/item/prop/organ/eyes, - /obj/item/prop/organ/liver, - /obj/item/prop/organ/appendix, + /obj/item/organ/brain, + /obj/item/organ/heart, + /obj/item/organ/lungs, + /obj/item/organ/kidneys, + /obj/item/organ/eyes, + /obj/item/organ/liver, + /obj/item/organ/appendix, ) /obj/effect/spawner/random/medical/medbottle diff --git a/code/game/objects/structures/prop.dm b/code/game/objects/structures/prop.dm index b22640e2060..c1c13824c6d 100644 --- a/code/game/objects/structures/prop.dm +++ b/code/game/objects/structures/prop.dm @@ -933,40 +933,6 @@ icon = 'icons/Marine/mainship_props.dmi' icon_state = "hangarbox" -/obj/item/prop/organ - name = "organ" - desc = "It looks like it probably just plopped out. It's too decayed to be reinserted in a patient." - icon = 'icons/obj/items/organs.dmi' - icon_state = "heart" - -/obj/item/prop/organ/heart - name = "heart" - icon_state = "heart-off" - -/obj/item/prop/organ/brain - name = "brain" - icon_state = "brain1" - -/obj/item/prop/organ/appendix - name = "appendix" - icon_state = "appendix" - -/obj/item/prop/organ/lungs - name = "lungs" - icon_state = "lungs" - -/obj/item/prop/organ/kidneys - name = "kidneys" - icon_state = "kidneys" - -/obj/item/prop/organ/eyes - name = "eyes" - icon_state = "eyes" - -/obj/item/prop/organ/liver - name = "liver" - icon_state = "liver" - /obj/item/prop/aimodule name = "AI module" desc = "An AI Module for programming laws to an AI." From 88870783b1ff637576069410f4491ecd97106495 Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 14:41:53 +0300 Subject: [PATCH 37/43] Update organs.dm --- code/modules/organs/organs.dm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index c685858f81f..ffe16a1a5f3 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -164,17 +164,11 @@ name = "stomach" slot = ORGAN_SLOT_STOMACH peri_effect = TRUE - ///This is a reagent user and needs more then the 10u from edible component - //var/reagent_vol = 1000 ///The rate that the stomach will transfer reagents to the body var/metabolism_efficiency = 0.05 // the lowest we should go is 0.025 /// Our reagents var/datum/reagents/reagents = new /datum/reagents(1000) -///datum/internal_organ/stomach/New(mob/living/carbon/carbon_mob) -// . = ..() -// reagents.create_reagents(reagent_vol) - /datum/internal_organ/stomach/process() var/mob/living/carbon/human/body = owner From 8381779db5438ea7eee7d445c3f068dddd6c703d Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 16:50:14 +0300 Subject: [PATCH 38/43] Update human_defense.dm --- code/modules/mob/living/carbon/human/human_defense.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 9f6c3b758a4..635cfe094ab 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -410,7 +410,7 @@ Contains most of the procs that are called when a mob is attacked by something log_combat(user, src, "ripped [src]'s heart", I) visible_message(span_notice("[user] ripped off [src]'s heart!"), span_notice("You ripped off [src]'s heart!")) remove_organ_slot(ORGAN_SLOT_HEART) - var/datum/internal_organ/heart/heart = new + var/obj/item/organ/heart/heart = new user.put_in_hands(heart) chestburst = 2 update_burst() From eb188dbc2189507f9d903c5a58fbad6b8571764f Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 17:22:25 +0300 Subject: [PATCH 39/43] meh --- code/datums/status_effects/debuffs.dm | 2 +- code/game/objects/items.dm | 6 +++--- code/game/objects/items/defibrillator.dm | 2 +- .../items/reagent_containers/food/snacks.dm | 2 +- code/game/objects/machinery/flasher.dm | 4 +--- code/game/objects/machinery/practice/medical.dm | 2 +- .../mob/living/carbon/human/human_damage.dm | 5 +---- .../mob/living/carbon/human/human_defense.dm | 3 +-- .../mob/living/carbon/human/life/handle_organs.dm | 2 +- .../xenomorph/castes/carrier/abilities_carrier.dm | 2 +- code/modules/mob/living/carbon/xenomorph/embryo.dm | 3 +-- code/modules/organs/_organ.dm | 2 +- code/modules/organs/limbs.dm | 2 +- code/modules/organs/organs.dm | 6 +++--- code/modules/reagents/reagents/alcohol.dm | 6 +++--- code/modules/reagents/reagents/drink.dm | 4 ++-- code/modules/reagents/reagents/medical.dm | 14 +++++++------- code/modules/surgery/eye.dm | 8 ++++---- code/modules/surgery/organs_internal.dm | 2 +- 19 files changed, 35 insertions(+), 42 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 01efaf954a3..c503d57e17b 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -503,7 +503,7 @@ if(carbon_owner && prob(15)) var/datum/internal_organ/organ = pick(carbon_owner.internal_organs) if(organ) - organ.get_damage(5) + organ.take_damage(5) /atom/movable/screen/alert/status_effect/irradiated name = "Irradiated" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 660f2aa4f1c..21ff161c204 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -945,12 +945,12 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) switch(safety) if(1) - E.get_damage(rand(1, 2), TRUE) + E.take_damage(rand(1, 2), TRUE) if(0) - E.get_damage(rand(2, 4), TRUE) + E.take_damage(rand(2, 4), TRUE) if(-1) H.blur_eyes(rand(12,20)) - E.get_damage(rand(12, 16), TRUE) + E.take_damage(rand(12, 16), TRUE) if(safety<2) if(E.damage >= E.min_broken_damage) to_chat(H, span_danger("You can't see anything!")) diff --git a/code/game/objects/items/defibrillator.dm b/code/game/objects/items/defibrillator.dm index 5e31bb5797d..60bfee22b3a 100644 --- a/code/game/objects/items/defibrillator.dm +++ b/code/game/objects/items/defibrillator.dm @@ -227,7 +227,7 @@ var/datum/internal_organ/heart/heart = H.get_organ_slot(ORGAN_SLOT_HEART) if(!issynth(H) && !isrobot(H) && heart && prob(90) && !advanced) - heart.get_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib + heart.take_damage(5) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib if(HAS_TRAIT(H, TRAIT_UNDEFIBBABLE) || H.suiciding) user.visible_message(span_warning("[icon2html(src, viewers(user))] \The [src] buzzes: Patient's brain has decayed too much. No remedy possible.")) diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index e53aa15eac6..cc961f883d5 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -859,7 +859,7 @@ var/datum/limb/E = H.get_limb("chest") E.fracture() for(var/datum/internal_organ/I in E.internal_organs) - I.get_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) + I.take_damage(rand(I.min_bruised_damage, I.min_broken_damage+1)) if(!E.hidden && prob(60)) //set it snuggly E.hidden = surprise E.cavity = 0 diff --git a/code/game/objects/machinery/flasher.dm b/code/game/objects/machinery/flasher.dm index 046d4eecd0a..19e1e98cd50 100644 --- a/code/game/objects/machinery/flasher.dm +++ b/code/game/objects/machinery/flasher.dm @@ -79,14 +79,12 @@ var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) H.flash_act() - E.get_damage(rand(1, 5)) + E.take_damage(rand(1, 5)) else L.flash_act() - L.Paralyze(strength) - /obj/machinery/flasher/emp_act(severity) if(machine_stat & (BROKEN|NOPOWER)) ..(severity) diff --git a/code/game/objects/machinery/practice/medical.dm b/code/game/objects/machinery/practice/medical.dm index e387e4a17a5..f09f0764a1f 100644 --- a/code/game/objects/machinery/practice/medical.dm +++ b/code/game/objects/machinery/practice/medical.dm @@ -50,4 +50,4 @@ organs_to_hurt += I if(length(organs_to_hurt)) var/datum/internal_organ/O = pick(organs_to_hurt) - O.get_damage(40) + O.take_damage(40) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 15e5589232f..3fb8014dbaa 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -25,14 +25,11 @@ var/health_deficiency = max(1 - (health / maxHealth) * 100, staminaloss) - //RUTGMC EDIT ADDITION BEGIN - Preds if(health_deficiency >= 50 && !(species?.species_flags & PARALYSE_RESISTANT)) -//RUTGMC EDIT ADDITION END add_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN, TRUE, 0, NONE, TRUE, health_deficiency / 50) else remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN) - /mob/living/carbon/human/adjustBrainLoss(amount, silent = FALSE) if(status_flags & GODMODE) @@ -41,7 +38,7 @@ if(species?.has_organ[ORGAN_SLOT_BRAIN]) var/datum/internal_organ/brain/sponge = get_organ_slot(ORGAN_SLOT_BRAIN) if(sponge) - sponge.get_damage(amount, silent) + sponge.take_damage(amount, silent) sponge.damage = clamp(sponge.damage, 0, MAX_BRAINLOSS) brainloss = sponge.damage else diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 635cfe094ab..e5f06bcc801 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -92,8 +92,7 @@ Contains most of the procs that are called when a mob is attacked by something . = ..() if(CHECK_BITFIELD(S.smoke_traits, SMOKE_BLISTERING) && species.has_organ[ORGAN_SLOT_LUNGS]) var/datum/internal_organ/lungs/L = get_organ_slot(ORGAN_SLOT_LUNGS) - L?.get_damage(1, TRUE) - + L?.take_damage(1, TRUE) //Returns 1 if the attack hit, 0 if it missed. /mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, def_zone) diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index 1bf8239949c..cec33540fe4 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -40,7 +40,7 @@ if(E.is_broken() && E.internal_organs && prob(15)) var/datum/internal_organ/I = pick(E.internal_organs) custom_pain("You feel broken bones moving in your [E.display_name]!", 1) - I.get_damage(rand(3, 5)) + I.take_damage(rand(3, 5)) //Moving makes open wounds get infected much faster if(!(E.limb_wound_status & LIMB_WOUND_DISINFECTED) && E.brute_dam >= 20) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm index d0b00a609e6..1b7690ac00a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm @@ -442,7 +442,7 @@ GLOBAL_LIST_INIT(hugger_images_list, list( var/datum/internal_organ/O for(var/i in list(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_STOMACH)) O = victim.get_organ_slot(i) - O.get_damage(debuff, TRUE) + O.take_damage(debuff, TRUE) young.adjust_boost_timer(20, 40) diff --git a/code/modules/mob/living/carbon/xenomorph/embryo.dm b/code/modules/mob/living/carbon/xenomorph/embryo.dm index f47cb70b876..33435bd6947 100644 --- a/code/modules/mob/living/carbon/xenomorph/embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/embryo.dm @@ -226,13 +226,12 @@ if(!H.mind && !H.client) //If we have no client or mind, permadeath time; remove the organs. Mainly for the NPC colonist bodies H.remove_organ_slot(O) else - O.get_damage(O.min_bruised_damage, TRUE) + O.take_damage(O.min_bruised_damage, TRUE) var/datum/limb/chest = H.get_limb("chest") new /datum/wound/internal_bleeding(15, chest) //Apply internal bleeding to chest chest.fracture() - victim.chestburst = 2 victim.update_burst() log_combat(src, null, "chestbursted as a larva.") diff --git a/code/modules/organs/_organ.dm b/code/modules/organs/_organ.dm index 61ae5cb73e9..e1153728b13 100644 --- a/code/modules/organs/_organ.dm +++ b/code/modules/organs/_organ.dm @@ -39,7 +39,7 @@ SIGNAL_HANDLER owner = null -/datum/internal_organ/proc/get_damage(amount, silent = FALSE) +/datum/internal_organ/proc/take_damage(amount, silent = FALSE) if(SSticker.mode?.flags_round_type & MODE_NO_PERMANENT_WOUNDS) return if(amount <= 0) diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index fff18324af8..84fe689a4c8 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -509,7 +509,7 @@ Note that amputating the affected organ does in fact remove the infection from t //Not technically a germ effect, but derived from it if(limb_status & LIMB_NECROTIZED) for(var/datum/internal_organ/organ AS in internal_organs) - organ.get_damage(0.2, silent = TRUE) //1 point every 10 seconds, 100 seconds to bruise, five minutes to broken. + organ.take_damage(0.2, silent = TRUE) //1 point every 10 seconds, 100 seconds to bruise, five minutes to broken. ///Updating wounds. Handles natural damage healing from limb treatments and processes internal wounds /datum/limb/proc/update_wounds(limb_regen_penalty = 1) diff --git a/code/modules/organs/organs.dm b/code/modules/organs/organs.dm index ffe16a1a5f3..d19190ddc59 100644 --- a/code/modules/organs/organs.dm +++ b/code/modules/organs/organs.dm @@ -36,7 +36,7 @@ owner.add_movespeed_modifier(name, override = TRUE, multiplicative_slowdown = organ_status) //Hits of 1 damage or less won't do anything due to how losebreath works, but any stronger and we'll get the wind knocked out of us for a bit. Mostly just flavor. -/datum/internal_organ/lungs/get_damage(amount, silent = FALSE) +/datum/internal_organ/lungs/take_damage(amount, silent = FALSE) owner.adjust_Losebreath(amount) return ..() @@ -125,11 +125,11 @@ if(owner.getToxLoss() >= (80 - 20 * organ_status)) //Healthy liver suffers on its own if(organ_status != ORGAN_BROKEN) - get_damage(0.2, TRUE) + take_damage(0.2, TRUE) //Damaged one shares the fun else var/datum/internal_organ/O = pick(owner.internal_organs) - O?.get_damage(0.2, TRUE) + O?.take_damage(0.2, TRUE) // Heal a bit if needed and we're not busy. This allows recovery from low amounts of toxins. if(!owner.drunkenness && owner.getToxLoss() <= 15 && organ_status == ORGAN_HEALTHY) diff --git a/code/modules/reagents/reagents/alcohol.dm b/code/modules/reagents/reagents/alcohol.dm index aa5add9bfeb..4b7b0af9ab6 100644 --- a/code/modules/reagents/reagents/alcohol.dm +++ b/code/modules/reagents/reagents/alcohol.dm @@ -42,7 +42,7 @@ All effects don't start immediately, but rather get worse over time; the rate is var/mob/living/carbon/human/H = C var/datum/internal_organ/liver/O = H.get_organ_slot(ORGAN_SLOT_LIVER) if (istype(O)) - O.get_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * O.alcohol_tolerance, 0)) * 0.002), TRUE) + O.take_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * O.alcohol_tolerance, 0)) * 0.002), TRUE) if(druggy != 0) L.set_drugginess(druggy) @@ -281,7 +281,7 @@ All effects don't start immediately, but rather get worse over time; the rate is var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(istype(E)) - E.get_damage(2) + E.take_damage(2) if(200 to INFINITY) L.set_timed_status_effect(5 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) L.adjustToxLoss(1) @@ -296,7 +296,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(H.species.species_flags ~! NO_PAIN) to_chat(H, span_danger("You clutch for a moment as you feel a scorching pain covering your abdomen!")) H.Stun(6 SECONDS) - E.get_damage(20) + E.take_damage(20) return ..() /datum/reagent/consumable/ethanol/deadrum diff --git a/code/modules/reagents/reagents/drink.dm b/code/modules/reagents/reagents/drink.dm index 040b89f91de..5534f1abc76 100644 --- a/code/modules/reagents/reagents/drink.dm +++ b/code/modules/reagents/reagents/drink.dm @@ -217,7 +217,7 @@ var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.get_damage(1, TRUE) + E.take_damage(1, TRUE) L.emote(pick("twitch", "blink_r", "shiver")) /datum/reagent/consumable/drink/coffee/overdose_crit_process(mob/living/L, metabolism) @@ -230,7 +230,7 @@ var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.get_damage(1, TRUE) + E.take_damage(1, TRUE) //nice one jpr~ /datum/reagent/consumable/drink/coffee/atomiccoffee diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index 780fa202b13..b75b9108b1e 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -42,7 +42,7 @@ if(ishuman(L)) //Critical overdose causes total blackout and heart damage. Too much stimulant var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) - E.get_damage(0.5*effect_str, TRUE) + E.take_damage(0.5*effect_str, TRUE) if(prob(10)) L.emote(pick("twitch","blink_r","shiver")) @@ -177,7 +177,7 @@ var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.get_damage(3*effect_str, TRUE) + E.take_damage(3*effect_str, TRUE) /datum/reagent/medicine/oxycodone/on_mob_delete(mob/living/L, metabolism) to_chat(L, span_userdanger("The room spins slightly as you start to come down off your painkillers!")) @@ -417,7 +417,7 @@ var/mob/living/carbon/human/H = L var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) - E.get_damage(0.5*effect_str, TRUE) + E.take_damage(0.5*effect_str, TRUE) /datum/reagent/medicine/dylovene/overdose_crit_process(mob/living/L, metabolism) L.apply_damages(2*effect_str, 2*effect_str) @@ -425,7 +425,7 @@ var/mob/living/carbon/human/H = L var/datum/internal_organ/eyes/E = H.get_organ_slot(ORGAN_SLOT_EYES) if(E) - E.get_damage(1.5*effect_str, TRUE) + E.take_damage(1.5*effect_str, TRUE) /datum/reagent/medicine/adminordrazine //An OP chemical for admins name = "Adminordrazine" @@ -1050,14 +1050,14 @@ var/mob/living/carbon/human/H = L var/affected_organ = pick(ORGAN_SLOT_HEART, ORGAN_SLOT_LUNGS, ORGAN_SLOT_LIVER, ORGAN_SLOT_KIDNEYS, ORGAN_SLOT_STOMACH) var/datum/internal_organ/I = H.get_organ_slot(affected_organ) - I.get_damage(5.5 * effect_str) + I.take_damage(5.5 * effect_str) /datum/reagent/medicine/ultrazine/overdose_process(mob/living/L, metabolism) if(ishuman(L)) var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.get_damage(0.5*effect_str, TRUE) + E.take_damage(0.5*effect_str, TRUE) else L.adjustToxLoss(0.5*effect_str) if(prob(10)) @@ -1070,7 +1070,7 @@ var/mob/living/carbon/human/H = L var/datum/internal_organ/heart/E = H.get_organ_slot(ORGAN_SLOT_HEART) if(E) - E.get_damage(1.5*effect_str, TRUE) + E.take_damage(1.5*effect_str, TRUE) /datum/reagent/medicine/cryoxadone name = "Cryoxadone" diff --git a/code/modules/surgery/eye.dm b/code/modules/surgery/eye.dm index bba0cf09534..72ec78131eb 100644 --- a/code/modules/surgery/eye.dm +++ b/code/modules/surgery/eye.dm @@ -53,7 +53,7 @@ span_warning("Your hand slips, slicing [target]'s eyes with \the [tool]!") ) target.balloon_alert_to_viewers("Slipped!") affected.createwound(CUT, 10) - E.get_damage(5, 0) + E.take_damage(5, 0) target.updatehealth() affected.update_wounds() @@ -86,7 +86,7 @@ user.visible_message(span_warning("[user]'s hand slips, damaging [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, damaging [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") - eyes.get_damage(5, 0) + eyes.take_damage(5, 0) target.apply_damage(10, BRUTE, affected, updating_health = TRUE) /datum/surgery_step/eye/mend_eyes @@ -119,7 +119,7 @@ user.visible_message(span_warning("[user]'s hand slips, stabbing \the [tool] into [target]'s eye!"), span_warning("Your hand slips, stabbing \the [tool] into [target]'s eye!")) target.balloon_alert_to_viewers("Slipped!") - E.get_damage(5, 0) + E.take_damage(5, 0) target.apply_damage(10, BRUTE, affected, 0, TRUE, updating_health = TRUE) /datum/surgery_step/eye/cauterize @@ -155,5 +155,5 @@ user.visible_message(span_warning("[user]'s hand slips, searing [target]'s eyes with \the [tool]!"), span_warning("Your hand slips, searing [target]'s eyes with \the [tool]!")) target.balloon_alert_to_viewers("Slipped!") - E.get_damage(5, 0) + E.take_damage(5, 0) target.apply_damage(5, BURN, affected, updating_health = TRUE) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 19410363a8b..8063e541617 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -121,6 +121,6 @@ for(var/datum/internal_organ/I in affected.internal_organs) if(I?.damage > 0) - I.get_damage(dam_amt,0) + I.take_damage(dam_amt,0) target.updatehealth() affected.update_wounds() From c6fafd87e5a2e1a39a238314de87a350681b8bbb Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 17:24:50 +0300 Subject: [PATCH 40/43] eh --- code/game/objects/items/scanners.dm | 3 ++- tgui/packages/tgui/interfaces/MedScanner.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/scanners.dm b/code/game/objects/items/scanners.dm index b1db9a39d5b..ecc8ea0cc9c 100644 --- a/code/game/objects/items/scanners.dm +++ b/code/game/objects/items/scanners.dm @@ -187,7 +187,8 @@ REAGENT SCANNER chemicals_lists["[reagent.name]"] = list( "name" = reagent.name, "amount" = round(reagent.volume, 0.1), - "od" = reagent.overdosed + "od" = reagent.overdosed, + "dangerous" = reagent.overdosed || istype(reagent, /datum/reagent/toxin) ) data["has_chemicals"] = length(patient.reagents.reagent_list) data["chemicals_lists"] = chemicals_lists diff --git a/tgui/packages/tgui/interfaces/MedScanner.js b/tgui/packages/tgui/interfaces/MedScanner.js index 61c25cd0355..2db6bb0afa0 100644 --- a/tgui/packages/tgui/interfaces/MedScanner.js +++ b/tgui/packages/tgui/interfaces/MedScanner.js @@ -169,8 +169,8 @@ export const MedScanner = (props, context) => { + color={chemical.dangerous ? 'red' : 'white'} + bold={chemical.dangerous}> {chemical.amount + 'u ' + chemical.name} From 94638844b3d41bab8918d211832f4a921fbb647f Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 17:31:45 +0300 Subject: [PATCH 41/43] vomit --- code/datums/status_effects/debuffs.dm | 8 ++--- code/modules/mob/living/carbon/carbon.dm | 28 +++++++++++++++++ .../living/carbon/human/human_status_procs.dm | 30 ++----------------- 3 files changed, 32 insertions(+), 34 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index c503d57e17b..a629aa5fd42 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -473,19 +473,15 @@ alert_type = /atom/movable/screen/alert/status_effect/irradiated ///Some effects only apply to carbons var/mob/living/carbon/carbon_owner - var/mob/living/carbon/human/human_owner /datum/status_effect/incapacitating/irradiated/on_creation(mob/living/new_owner, set_duration) . = ..() if(.) if(iscarbon(owner)) carbon_owner = owner - if(ishuman(owner)) // I hate my life - human_owner = owner /datum/status_effect/incapacitating/irradiated/Destroy() carbon_owner = null - human_owner = null return ..() /datum/status_effect/incapacitating/irradiated/tick() @@ -498,8 +494,8 @@ living_owner.adjustToxLoss(3) if(prob(15)) living_owner.adjust_Losebreath(5) - if(human_owner && prob(15)) - human_owner.vomit() + if(carbon_owner && prob(15)) + carbon_owner.vomit() if(carbon_owner && prob(15)) var/datum/internal_organ/organ = pick(carbon_owner.internal_organs) if(organ) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 06c14fa7fc9..73330baaaa4 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -64,6 +64,34 @@ return shock_damage +/mob/living/carbon/proc/vomit() + if(isspeciessynthetic(src)) + return //Machines don't throw up. + + if(stat == DEAD) //Corpses don't puke + return + + if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_PUKE)) + return + + TIMER_COOLDOWN_START(src, COOLDOWN_PUKE, 40 SECONDS) //5 seconds before the actual action plus 35 before the next one. + to_chat(src, span_warning("You feel like you are about to throw up!")) + addtimer(CALLBACK(src, PROC_REF(do_vomit)), 5 SECONDS) + +/mob/living/carbon/proc/do_vomit() + adjust_stagger(3 SECONDS) + add_slowdown(3) + + visible_message(span_warning("[src] throws up!"), span_warning("You throw up!"), null, 5) + playsound(loc, 'sound/effects/splat.ogg', 25, TRUE, 7) + + var/turf/location = loc + if(istype(location, /turf)) + location.add_vomit_floor(src, 1) + + adjust_nutrition(-40) + adjustToxLoss(-3) + /mob/living/carbon/proc/help_shake_act(mob/living/carbon/shaker) if(health < get_crit_threshold()) return diff --git a/code/modules/mob/living/carbon/human/human_status_procs.dm b/code/modules/mob/living/carbon/human/human_status_procs.dm index cc0c0b1827b..1fb03a4e392 100644 --- a/code/modules/mob/living/carbon/human/human_status_procs.dm +++ b/code/modules/mob/living/carbon/human/human_status_procs.dm @@ -58,38 +58,12 @@ if(!(species.species_flags & NO_BREATHE) || forced) return ..() -/mob/living/carbon/human/proc/vomit() - if(isspeciessynthetic(src)) - return //Machines don't throw up. - - if(stat == DEAD) //Corpses don't puke - return - - if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_PUKE)) - return - - TIMER_COOLDOWN_START(src, COOLDOWN_PUKE, 40 SECONDS) //5 seconds before the actual action plus 35 before the next one. - to_chat(src, span_warning("You feel like you are about to throw up!")) - addtimer(CALLBACK(src, PROC_REF(do_vomit)), 5 SECONDS) - -/mob/living/carbon/human/proc/do_vomit() - adjust_stagger(3 SECONDS) - add_slowdown(3) - - visible_message(span_warning("[src] throws up!"), span_warning("You throw up!"), null, 5) - playsound(loc, 'sound/effects/splat.ogg', 25, TRUE, 7) - - var/turf/location = loc - if(istype(location, /turf)) - location.add_vomit_floor(src, 1) - +/mob/living/carbon/human/do_vomit() + . = ..() var/datum/internal_organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) for(var/datum/reagent/our_reagent in belly.reagents.reagent_list) belly.reagents.remove_reagent(our_reagent.type, our_reagent.volume / rand(2, 5)) // vomit out some reagents from our stomach - adjust_nutrition(-40) - adjustToxLoss(-3) - /mob/living/carbon/human/adjust_ear_damage(damage = 0, deaf = 0) if(isspeciessynthetic(src)) return From 9d4cc141e6eeea530fc2421c7f775c1ad0f5df4a Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 20:35:18 +0300 Subject: [PATCH 42/43] Update human_status_procs.dm --- code/modules/mob/living/carbon/human/human_status_procs.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/mob/living/carbon/human/human_status_procs.dm b/code/modules/mob/living/carbon/human/human_status_procs.dm index 1fb03a4e392..31ee2e131fe 100644 --- a/code/modules/mob/living/carbon/human/human_status_procs.dm +++ b/code/modules/mob/living/carbon/human/human_status_procs.dm @@ -58,6 +58,11 @@ if(!(species.species_flags & NO_BREATHE) || forced) return ..() +/mob/living/carbon/human/vomit() + if(isspeciessynthetic(src)) + return //Machines don't throw up. + return ..() + /mob/living/carbon/human/do_vomit() . = ..() var/datum/internal_organ/stomach/belly = get_organ_slot(ORGAN_SLOT_STOMACH) From 7d9190520995e8753cc4994ebf2ee834f032e01d Mon Sep 17 00:00:00 2001 From: Helg2 Date: Wed, 7 Aug 2024 20:36:38 +0300 Subject: [PATCH 43/43] eh --- code/modules/mob/living/carbon/carbon.dm | 3 --- code/modules/mob/living/carbon/life.dm | 4 +--- code/modules/predator/yautja/chems.dm | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 73330baaaa4..059b33bad8c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -65,9 +65,6 @@ return shock_damage /mob/living/carbon/proc/vomit() - if(isspeciessynthetic(src)) - return //Machines don't throw up. - if(stat == DEAD) //Corpses don't puke return diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 51893ac6cda..267107bda31 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -125,9 +125,7 @@ if(drunkenness >= 51) if(prob(5)) AdjustConfused(10 SECONDS) - if(ishuman(src)) - var/mob/living/carbon/human/human = src - human.vomit() + vomit() if(dizziness < 600) dizzy(12) diff --git a/code/modules/predator/yautja/chems.dm b/code/modules/predator/yautja/chems.dm index 2b9ec502484..ea8da893fc3 100644 --- a/code/modules/predator/yautja/chems.dm +++ b/code/modules/predator/yautja/chems.dm @@ -17,7 +17,7 @@ to_chat(L, span_userdanger("Something feels off!")) L.AdjustParalyzed(20) -/datum/reagent/thwei/on_mob_life(mob/living/carbon/human/L, metabolism) +/datum/reagent/thwei/on_mob_life(mob/living/carbon/L, metabolism) . = ..() if(isyautja(L)) L.blood_volume += 3