diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 90b80eab6ce..4c740d88bb5 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -507,6 +507,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Trait applied when the MMI component is added to an [/obj/item/integrated_circuit] #define TRAIT_COMPONENT_MMI "component_mmi" +/// If present on a [/mob/living/carbon], will make them appear to have a medium level disease on health HUDs. +#define TRAIT_DISEASELIKE_SEVERITY_MEDIUM "diseaselike_severity_medium" + //Medical Categories for quirks #define CAT_QUIRK_ALL 0 #define CAT_QUIRK_NOTES 1 diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm deleted file mode 100644 index 0a4ca6cf927..00000000000 --- a/code/datums/diseases/appendicitis.dm +++ /dev/null @@ -1,40 +0,0 @@ -/datum/disease/appendicitis - form = "Condition" - name = "Appendicitis" - max_stages = 3 - cure_text = "Surgery" - agent = "Shitty Appendix" - viable_mobtypes = list(/mob/living/carbon/human) - permeability_mod = 1 - desc = "If left untreated the subject will become very weak, and may vomit often." - severity = DISEASE_SEVERITY_MEDIUM - disease_flags = CAN_CARRY|CAN_RESIST - spread_flags = DISEASE_SPREAD_NON_CONTAGIOUS - visibility_flags = HIDDEN_PANDEMIC - required_organs = list(/obj/item/organ/appendix) - bypasses_immunity = TRUE // Immunity is based on not having an appendix; this isn't a virus - - -/datum/disease/appendicitis/stage_act(delta_time, times_fired) - . = ..() - if(!.) - return - - switch(stage) - if(1) - if(DT_PROB(2.5, delta_time)) - affected_mob.emote("cough") - if(2) - var/obj/item/organ/appendix/A = affected_mob.getorgan(/obj/item/organ/appendix) - if(A) - A.inflamed = 1 - A.update_appearance() - if(DT_PROB(1.5, delta_time)) - to_chat(affected_mob, span_warning("You feel a stabbing pain in your abdomen!")) - affected_mob.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 5) - affected_mob.Stun(rand(40, 60)) - affected_mob.adjustToxLoss(1, FALSE) - if(3) - if(DT_PROB(0.5, delta_time)) - affected_mob.vomit(95) - affected_mob.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 15) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 55f4a587c0f..50b0770604b 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -95,6 +95,10 @@ Medical HUD! Basic mode needs suit sensors on. /mob/living/carbon/proc/check_virus() var/threat var/severity + if(HAS_TRAIT(src, TRAIT_DISEASELIKE_SEVERITY_MEDIUM)) + severity = DISEASE_SEVERITY_MEDIUM + threat = get_disease_severity_value(severity) + for(var/thing in diseases) var/datum/disease/D = thing if(!(D.visibility_flags & HIDDEN_SCANNER)) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 2b243e9a79d..5b76faea2f2 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -325,17 +325,7 @@ GENE SCANNER Status" for(var/obj/item/organ/organ in H.internal_organs) - var/status = "" - if(H.has_reagent(/datum/reagent/inverse/technetium)) - if(organ.damage) - status = " organ is [round((organ.damage/organ.maxHealth)*100, 1)]% damaged." - else - if (organ.organ_flags & ORGAN_FAILING) - status = "Non-Functional" - else if (organ.damage > organ.high_threshold) - status = "Severely Damaged" - else if (organ.damage > organ.low_threshold) - status = "Mildly Damaged" + var/status = organ.get_status_text() if (status != "") render = TRUE toReport += "[organ.name]:\ diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm deleted file mode 100644 index 7e7570a35f1..00000000000 --- a/code/modules/events/spontaneous_appendicitis.dm +++ /dev/null @@ -1,34 +0,0 @@ -/datum/round_event_control/spontaneous_appendicitis - name = "Spontaneous Appendicitis" - typepath = /datum/round_event/spontaneous_appendicitis - weight = 20 - max_occurrences = 4 - earliest_start = 10 MINUTES - min_players = 5 // To make your chance of getting help a bit higher. - -/datum/round_event/spontaneous_appendicitis - fakeable = FALSE - -/datum/round_event/spontaneous_appendicitis/start() - for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) - if(!H.client) - continue - if(H.stat == DEAD) - continue - if(!H.getorgan(/obj/item/organ/appendix)) //Don't give the disease to some who lacks it, only for it to be auto-cured - continue - if(!(H.mob_biotypes & MOB_ORGANIC)) //biotype sleeper bugs strike again, once again making appendicitis pick a target that can't take it - continue - if(H.z in SSmapping.levels_by_trait(ZTRAIT_CENTCOM))//not for admin/ooc stuff - continue - var/foundAlready = FALSE //don't infect someone that already has appendicitis - for(var/datum/disease/appendicitis/A in H.diseases) - foundAlready = TRUE - break - if(foundAlready) - continue - - var/datum/disease/D = new /datum/disease/appendicitis() - H.ForceContractDisease(D, FALSE, TRUE) - announce_to_ghosts(H) - break diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm index 07ce047b374..4d26156adb6 100644 --- a/code/modules/surgery/organs/appendix.dm +++ b/code/modules/surgery/organs/appendix.dm @@ -1,3 +1,7 @@ +// A 10% chance that out of a group of 25 people, one person will get appendicitis in 1 hour. +#define APPENDICITIS_PROB 100 * (0.1 * (1 / 25) / 3600) +#define INFLAMATION_ADVANCEMENT_PROB 2 + /obj/item/organ/appendix name = "appendix" icon_state = "appendix" @@ -12,35 +16,77 @@ now_failing = "An explosion of pain erupts in your lower right abdomen!" now_fixed = "The pain in your abdomen has subsided." - var/inflamed + var/inflamation_stage = 0 /obj/item/organ/appendix/update_name() . = ..() - name = "[inflamed ? "inflamed " : null][initial(name)]" + name = "[inflamation_stage ? "inflamed " : null][initial(name)]" /obj/item/organ/appendix/update_icon_state() - icon_state = "[base_icon_state][inflamed ? "inflamed" : ""]" + icon_state = "[base_icon_state][inflamation_stage ? "inflamed" : ""]" return ..() /obj/item/organ/appendix/on_life(delta_time, times_fired) ..() - if(!(organ_flags & ORGAN_FAILING)) - return var/mob/living/carbon/organ_owner = owner - if(organ_owner) - organ_owner.adjustToxLoss(2 * delta_time, TRUE, TRUE) //forced to ensure people don't use it to gain tox as slime person + if(!organ_owner) + return + + if(organ_flags & ORGAN_FAILING) + // forced to ensure people don't use it to gain tox as slime person + organ_owner.adjustToxLoss(2 * delta_time, updating_health = TRUE, forced = TRUE) + else if(inflamation_stage) + inflamation(delta_time) + else if(DT_PROB(APPENDICITIS_PROB, delta_time)) + become_inflamed() + +/obj/item/organ/appendix/proc/become_inflamed() + inflamation_stage = 1 + update_appearance() + if(owner) + ADD_TRAIT(owner, TRAIT_DISEASELIKE_SEVERITY_MEDIUM, type) + owner.med_hud_set_status() + +/obj/item/organ/appendix/proc/inflamation(delta_time) + var/mob/living/carbon/organ_owner = owner + if(inflamation_stage < 3 && DT_PROB(INFLAMATION_ADVANCEMENT_PROB, delta_time)) + inflamation_stage += 1 + + switch(inflamation_stage) + if(1) + if(DT_PROB(2.5, delta_time)) + organ_owner.emote("cough") + if(2) + if(DT_PROB(1.5, delta_time)) + to_chat(organ_owner, span_warning("You feel a stabbing pain in your abdomen!")) + organ_owner.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 5) + organ_owner.Stun(rand(40, 60)) + organ_owner.adjustToxLoss(1, updating_health = TRUE, forced = TRUE) + if(3) + if(DT_PROB(0.5, delta_time)) + organ_owner.vomit(95) + organ_owner.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 15) + /obj/item/organ/appendix/get_availability(datum/species/owner_species) return !(TRAIT_NOHUNGER in owner_species.inherent_traits) -/obj/item/organ/appendix/Remove(mob/living/carbon/organ_owner, special = 0) - for(var/datum/disease/appendicitis/appendicitis in organ_owner.diseases) - appendicitis.cure() - inflamed = TRUE - update_appearance() +/obj/item/organ/appendix/Remove(mob/living/carbon/organ_owner, special = FALSE) + REMOVE_TRAIT(organ_owner, TRAIT_DISEASELIKE_SEVERITY_MEDIUM, type) + organ_owner.med_hud_set_status() ..() -/obj/item/organ/appendix/Insert(mob/living/carbon/organ_owner, special = 0) +/obj/item/organ/appendix/Insert(mob/living/carbon/organ_owner, special = FALSE) ..() - if(inflamed) - organ_owner.ForceContractDisease(new /datum/disease/appendicitis(), FALSE, TRUE) + if(inflamation_stage) + ADD_TRAIT(organ_owner, TRAIT_DISEASELIKE_SEVERITY_MEDIUM, type) + organ_owner.med_hud_set_status() + +/obj/item/organ/appendix/get_status_text() + if((!(organ_flags & ORGAN_FAILING)) && inflamation_stage) + return "Inflamed" + else + return ..() + +#undef APPENDICITIS_PROB +#undef INFLAMATION_ADVANCEMENT_PROB diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 395f1badda5..0441a7ba465 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -279,3 +279,17 @@ /// Called before organs are replaced in regenerate_organs with new ones /obj/item/organ/proc/before_organ_replacement(obj/item/organ/replacement) return + +/// Called by medical scanners to get a simple summary of how healthy the organ is. Returns an empty string if things are fine. +/obj/item/organ/proc/get_status_text() + var/status = "" + if(owner.has_reagent(/datum/reagent/inverse/technetium)) + status = " organ is [round((damage/maxHealth)*100, 1)]% damaged." + else if(organ_flags & ORGAN_FAILING) + status = "Non-Functional" + else if(damage > high_threshold) + status = "Severely Damaged" + else if (damage > low_threshold) + status = "Mildly Damaged" + + return status diff --git a/tgstation.dme b/tgstation.dme index 79468747c56..227bdaab9f5 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -634,7 +634,6 @@ #include "code\datums\diseases\_disease.dm" #include "code\datums\diseases\_MobProcs.dm" #include "code\datums\diseases\anxiety.dm" -#include "code\datums\diseases\appendicitis.dm" #include "code\datums\diseases\beesease.dm" #include "code\datums\diseases\brainrot.dm" #include "code\datums\diseases\cold.dm" @@ -2163,7 +2162,6 @@ #include "code\modules\events\space_ninja.dm" #include "code\modules\events\spacevine.dm" #include "code\modules\events\spider_infestation.dm" -#include "code\modules\events\spontaneous_appendicitis.dm" #include "code\modules\events\stray_cargo.dm" #include "code\modules\events\swarmer.dm" #include "code\modules\events\wisdomcow.dm"