From 270dc989e5177f71139f8b783fd462b00981e520 Mon Sep 17 00:00:00 2001
From: AltHit <52506929+AltHit@users.noreply.github.com>
Date: Fri, 2 Feb 2024 21:49:17 +0300
Subject: [PATCH] ErisMed fixes Season 1 Episode 2 (#8413)
* Not so sus now
Fixed typo in comment
Removed excess whitespace in techno belt line
Fixed people walking without vital organs like they are still inside
Now you actually need to attach organs in order for them to work and by default they are unattached
Resuscitator now actually tells you what's wrong during resurection
Also robotist got a new fancy belt instead of toolbox
* Update carrion.dm
Fixed Carrion organs attachment
* Update other.dm
Updated heart damage
* Update other.dm
Tweaking resus damage again
* Update eyes.dm
Should heal the unhealable
* Apply suggestions from code review
Goodbye for good detatch()
Co-authored-by: hyperioo <64754494+hyperioo@users.noreply.github.com>
* Review time
Removes useless stuff
* Update human.dm
Redid the notification system in resus, now you'll get clear reason why patient is still dead, but only if your BIO stat is high enough
---------
Co-authored-by: hyperioo <64754494+hyperioo@users.noreply.github.com>
---
code/__DEFINES/dcs/signals.dm | 2 +-
code/datums/outfits/jobs/science.dm | 3 +-
.../objects/items/weapons/storage/belt.dm | 14 +++++-
code/modules/mob/living/carbon/human/human.dm | 50 +++++++++++++++++--
code/modules/organs/external/dismemberment.dm | 2 +
code/modules/organs/internal/_internal.dm | 17 ++++++-
code/modules/organs/internal/carrion.dm | 1 +
.../internal_wounds/_internal_wound.dm | 2 +-
.../organs/internal/internal_wounds/eyes.dm | 8 +--
.../internal/internal_wounds/organic.dm | 2 +-
code/modules/reagents/reagents/other.dm | 16 +++---
code/modules/surgery/organic.dm | 3 +-
code/modules/surgery/robotic.dm | 2 +
13 files changed, 101 insertions(+), 21 deletions(-)
diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm
index 6a7ed02f7bf..3f0be9ca684 100644
--- a/code/__DEFINES/dcs/signals.dm
+++ b/code/__DEFINES/dcs/signals.dm
@@ -81,7 +81,7 @@
// /mob/living signals
#define COMSIG_LIVING_STUN_EFFECT "stun_effect_act" //mob/living/proc/stun_effect_act()
-#define COMSIG_CARBON_HAPPY "carbon_happy" //drugs o ethanol in blood
+#define COMSIG_CARBON_HAPPY "carbon_happy" //drugs or ethanol in blood
// /mob/living/carbon signals
#define COMSIG_CARBON_ELECTROCTE "carbon_electrocute act" //mob/living/carbon/electrocute_act()
diff --git a/code/datums/outfits/jobs/science.dm b/code/datums/outfits/jobs/science.dm
index 15569b74105..56711c3c5a0 100644
--- a/code/datums/outfits/jobs/science.dm
+++ b/code/datums/outfits/jobs/science.dm
@@ -31,11 +31,10 @@
name = OUTFIT_JOB_NAME("Moebius Roboticist")
uniform = /obj/item/clothing/under/rank/roboticist
suit = /obj/item/clothing/suit/storage/robotech_jacket
- belt = /obj/item/storage/belt/utility/full
+ belt = /obj/item/storage/belt/utility/roboticist
pda_slot = slot_r_store
id_type = /obj/item/card/id/dkgrey
pda_type = /obj/item/modular_computer/pda/moebius/roboticist
- l_hand = /obj/item/storage/toolbox/mechanical
/decl/hierarchy/outfit/job/science/roboticist/New()
..()
diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm
index e1cb24453e0..762e704c7a9 100644
--- a/code/game/objects/items/weapons/storage/belt.dm
+++ b/code/game/objects/items/weapons/storage/belt.dm
@@ -80,7 +80,7 @@
new /obj/item/tool/wirecutters(src)
new /obj/item/stack/cable_coil/random(src)
-/obj/item/storage/belt/utility/technomancer
+/obj/item/storage/belt/utility/technomancer
spawn_blacklisted = TRUE
/obj/item/storage/belt/utility/technomancer/populate_contents()
@@ -92,6 +92,18 @@
new /obj/item/tool/shovel/power(src)
new /obj/item/stack/cable_coil/random(src)
+/obj/item/storage/belt/utility/roboticist
+ spawn_blacklisted = TRUE
+
+/obj/item/storage/belt/utility/roboticist/populate_contents()
+ new /obj/item/tool/screwdriver(src)
+ new /obj/item/tool/wrench(src)
+ new /obj/item/tool/weldingtool(src)
+ new /obj/item/tool/crowbar(src)
+ new /obj/item/tool/wirecutters/pliers(src)
+ new /obj/item/stack/cable_coil/random(src)
+ new /obj/item/tool/multitool(src)
+
/obj/item/storage/belt/utility/neotheology
name = "neotheology utility belt"
desc = "Waist-held holy items."
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index bdb97628fc2..639e5f002d4 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -4,6 +4,7 @@
voice_name = "unknown"
icon = 'icons/mob/human.dmi'
icon_state = "body_m_s"
+ status_flags = REBUILDING_ORGANS //will protect from gibbing before organs are built. flag should be removed by set_species in initialize
var/list/hud_list[10]
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
@@ -1020,6 +1021,10 @@ var/list/rank_prefix = list(\
for(var/obj/item/organ/internal/carrion/C in organs_to_readd)
C.replaced(get_organ(C.parent_organ_base))
+ for(var/obj/item/organ/internal/I in internal_organs)
+ I.status &= ~ORGAN_CUT_AWAY
+ I.handle_organ_eff()
+
status_flags &= ~REBUILDING_ORGANS
species.organs_spawned(src)
@@ -1348,21 +1353,32 @@ var/list/rank_prefix = list(\
reset_view(A)
/mob/living/carbon/human/proc/resuscitate()
+
var/obj/item/organ/internal/vital/heart_organ = random_organ_by_process(OP_HEART)
var/obj/item/organ/internal/vital/brain_organ = random_organ_by_process(BP_BRAIN)
- if(!is_asystole() && !(heart_organ && brain_organ) || (heart_organ.is_broken() || brain_organ.is_broken()))
+ if((!heart_organ || heart_organ.is_broken()) && (!brain_organ || brain_organ.is_broken()))
+ resuscitate_notify(1)
+ return 0
+
+ if(!heart_organ || heart_organ.is_broken())
+ resuscitate_notify(2)
+ return 0
+
+ if(!brain_organ || brain_organ.is_broken())
+ resuscitate_notify(3)
return 0
if(world.time >= (timeofdeath + NECROZTIME))
+ resuscitate_notify(4)
return 0
var/oxyLoss = getOxyLoss()
if(oxyLoss > 20)
setOxyLoss(20)
- if(health <= (HEALTH_THRESHOLD_DEAD - oxyLoss))
- visible_message(SPAN_WARNING("\The [src] twitches a bit, but their body is too damaged to sustain life!"))
+ if(getBruteLoss() + getFireLoss() >= abs(HEALTH_THRESHOLD_DEAD))
+ resuscitate_notify(5)
timeofdeath = 0
return 0
@@ -1384,6 +1400,34 @@ var/list/rank_prefix = list(\
break
return 1
+/mob/living/carbon/human/proc/resuscitate_notify(type)
+ if(prob(50))
+ return
+ visible_message(SPAN_WARNING("\The [src] twitches and twists intensely"))
+ for(var/mob/O in viewers(world.view, src.loc))
+ if(O == src)
+ continue
+ if(!Adjacent(O))
+ continue
+ var/bio_stat = 0
+ if(O.stats)
+ bio_stat = O.stats.getStat(STAT_BIO)
+
+ if(bio_stat >= STAT_LEVEL_ADEPT)
+ switch(type)
+ if(1) //brain and heart fail
+ to_chat(O, "You can identify that [src]'s circulatory and central neural systems are failing, preventing them from resurrection.")
+ if(2) //heart fail
+ to_chat(O, "You can identify that [src]'s circulatory system is unable to restart in this state.")
+ if(3) //brain fail
+ to_chat(O, "You can identify that [src]'s central neural system is too damaged to be resurrected.")
+ if(4) //corpse is too old
+ to_chat(O, "You see that rotting process in [src]'s body already gone too far. This is nothing but a corpse now.")
+ if(5) //too much damage
+ to_chat(O, "[src]'s body is too damaged to sustain life.")
+ else
+ to_chat(O, "You're too unskilled to understand what's happening...")
+
/mob/living/carbon/human/proc/generate_dna()
if(!b_type)
b_type = pick(GLOB.blood_types)
diff --git a/code/modules/organs/external/dismemberment.dm b/code/modules/organs/external/dismemberment.dm
index 026406752d5..61741a08578 100644
--- a/code/modules/organs/external/dismemberment.dm
+++ b/code/modules/organs/external/dismemberment.dm
@@ -70,6 +70,7 @@
for(var/obj/item/organ/I in internal_organs)
I.removed()
I.forceMove(get_turf(src))
+ I.status |= ORGAN_CUT_AWAY
for(var/obj/item/I in src)
if(I.w_class > ITEM_SIZE_SMALL)
@@ -88,6 +89,7 @@
I.removed()
I.forceMove(get_turf(src))
I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30)
+ I.status |= ORGAN_CUT_AWAY
for(var/mob/living/I in src) // check for mobs inside you... yeah
if(istype(I, /mob/living/simple_animal/borer/))
diff --git a/code/modules/organs/internal/_internal.dm b/code/modules/organs/internal/_internal.dm
index 159ab29d34f..0c703eb6026 100644
--- a/code/modules/organs/internal/_internal.dm
+++ b/code/modules/organs/internal/_internal.dm
@@ -7,6 +7,7 @@
min_bruised_damage = IORGAN_STANDARD_BRUISE
min_broken_damage = IORGAN_STANDARD_BREAK
desc = "A vital organ."
+ status = ORGAN_CUT_AWAY
var/list/owner_verbs = list()
var/list/initial_owner_verbs = list()
var/list/organ_efficiency = list() //Efficency of an organ, should become the most important variable
@@ -35,6 +36,10 @@
..()
handle_blood()
+/obj/item/organ/internal/die()
+ handle_organ_eff()
+ ..()
+
/obj/item/organ/internal/Destroy()
QDEL_LIST(item_upgrades)
for(var/comp in GetComponents(/datum/component/internal_wound))
@@ -85,7 +90,10 @@
for(var/process in organ_efficiency)
if(!islist(owner.internal_organs_by_efficiency[process]))
owner.internal_organs_by_efficiency[process] = list()
- owner.internal_organs_by_efficiency[process] += src
+ if(is_usable())
+ owner.internal_organs_by_efficiency[process] += src
+ else
+ owner.internal_organs_by_efficiency[process] -= src
for(var/proc_path in owner_verbs)
verbs |= proc_path
@@ -93,6 +101,13 @@
if(GetComponent(/datum/component/internal_wound/organic/parenchyma))
owner.mutation_index++
+/obj/item/organ/internal/proc/handle_organ_eff()
+ for(var/process in organ_efficiency)
+ if(is_usable())
+ owner.internal_organs_by_efficiency[process] += src
+ else
+ owner.internal_organs_by_efficiency[process] -= src
+
/obj/item/organ/internal/proc/get_process_efficiency(process_define)
var/organ_eff = organ_efficiency[process_define]
return organ_eff - (organ_eff * (damage / max_damage))
diff --git a/code/modules/organs/internal/carrion.dm b/code/modules/organs/internal/carrion.dm
index 01177f80772..f35cff889dc 100644
--- a/code/modules/organs/internal/carrion.dm
+++ b/code/modules/organs/internal/carrion.dm
@@ -32,6 +32,7 @@
/obj/item/organ/internal/carrion
max_damage = 15 //resilient
scanner_hidden = TRUE //sneaky
+ status = 0 // Carrion organs are attached by default because they are only grown inside and not printed
/obj/item/organ/internal/carrion/chemvessel
name = "chemical vessel"
diff --git a/code/modules/organs/internal/internal_wounds/_internal_wound.dm b/code/modules/organs/internal/internal_wounds/_internal_wound.dm
index d07f1323dfe..e323dedf459 100644
--- a/code/modules/organs/internal/internal_wounds/_internal_wound.dm
+++ b/code/modules/organs/internal/internal_wounds/_internal_wound.dm
@@ -181,7 +181,7 @@
is_treated = TRUE
else
is_treated = S.use(charges_needed)
- if(istype(I)) // check for using items without stacks
+ else if(istype(I)) // check for using items without stacks
is_treated = TRUE
qdel(I)
if(is_treated)
diff --git a/code/modules/organs/internal/internal_wounds/eyes.dm b/code/modules/organs/internal/internal_wounds/eyes.dm
index dea26b94b80..78da8a5633e 100644
--- a/code/modules/organs/internal/internal_wounds/eyes.dm
+++ b/code/modules/organs/internal/internal_wounds/eyes.dm
@@ -82,12 +82,14 @@
treatments_tool = list(QUALITY_RETRACTING = FAILCHANCE_HARD)
scar = /datum/component/internal_wound/organic/eyes_deep_burn
-/datum/component/internal_wound/organic/eyes_deep_burn //stage 2
+/datum/component/internal_wound/organic/eyes_deep_burn/stage2 //stage 2
name = "scorched deep tissue"
- severity = 3 // starts with max damage as it is a second stage
- severity_max = 3
treatments_item = list(/obj/item/stack/medical/advanced/ointment = 2)
treatments_chem = list(CE_EYEHEAL = 1)
+ severity = 3 //starting at max damage because stage 2
+ severity_max = 3
+ hal_damage = IWOUND_HEAVY_DAMAGE
+ diagnosis_difficulty = STAT_LEVEL_EXPERT
// Tox (toxins)
/datum/component/internal_wound/organic/eyes_poisoning
diff --git a/code/modules/organs/internal/internal_wounds/organic.dm b/code/modules/organs/internal/internal_wounds/organic.dm
index 8993c851293..d9189fc3376 100644
--- a/code/modules/organs/internal/internal_wounds/organic.dm
+++ b/code/modules/organs/internal/internal_wounds/organic.dm
@@ -138,7 +138,7 @@
treatments_tool = list(QUALITY_CUTTING = FAILCHANCE_NORMAL)
treatments_chem = list(CE_ANTITOX = 2)
severity = 0
- severity_max = 3
+ severity_max = 4
hal_damage = IWOUND_LIGHT_DAMAGE
/// Cheap hack, but prevents unbalanced toxins from killing someone immediately
diff --git a/code/modules/reagents/reagents/other.dm b/code/modules/reagents/reagents/other.dm
index 23bda10f1d2..29d85b7072b 100644
--- a/code/modules/reagents/reagents/other.dm
+++ b/code/modules/reagents/reagents/other.dm
@@ -492,15 +492,17 @@
/datum/reagent/resuscitator/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(ishuman(M))
var/mob/living/carbon/human/H = M
- var/obj/item/organ/internal/vital/heart/heart = H.random_organ_by_process(OP_HEART)
- if(BP_IS_ROBOTIC(heart)) // neither it should work on robotic hearts, chemistry and stuf
- return
- if(heart)
- heart.damage += 0.5
+ var/obj/item/organ/internal/vital/heart = H.random_organ_by_process(OP_HEART)
+ if(heart) //Check for existence of the heart BEFORE checking for robotic heart, otherwise function WILL return null
+ if(BP_IS_ROBOTIC(heart)) // neither it should work on robotic hearts, chemistry and stuff
+ return
+ heart.take_damage(64, TOX)
if(prob(30))
to_chat(H, SPAN_DANGER("Your heart feels like it's going to tear itself out of you!"))
- if(H.stat == DEAD)
- H.resuscitate()
+ if(H.stat == DEAD)
+ H.resuscitate()
+ else
+ H.resuscitate() //it will fail and give explanations why
/datum/reagent/resuscitator/overdose(mob/living/carbon/M, alien)
. = ..()
diff --git a/code/modules/surgery/organic.dm b/code/modules/surgery/organic.dm
index d88108af39c..5053331eb04 100644
--- a/code/modules/surgery/organic.dm
+++ b/code/modules/surgery/organic.dm
@@ -142,7 +142,7 @@
)
organ.status &= ~ORGAN_CUT_AWAY
- organ.replaced(organ.get_limb())
+ organ.handle_organ_eff() //organ is attached. Refreshing eff. list
/datum/surgery_step/attach_organ/fail_step(mob/living/user, obj/item/organ/internal/organ, obj/item/stack/tool)
user.visible_message(
@@ -178,6 +178,7 @@
SPAN_NOTICE("You separate [organ.get_surgery_name()] with \the [tool].")
)
organ.status |= ORGAN_CUT_AWAY
+ organ.handle_organ_eff() //detach of organ. Refreshing eff. list
/datum/surgery_step/detach_organ/fail_step(mob/living/user, obj/item/organ/internal/organ, obj/item/stack/tool)
user.visible_message(
diff --git a/code/modules/surgery/robotic.dm b/code/modules/surgery/robotic.dm
index 1b81628f5ca..75d55353d23 100644
--- a/code/modules/surgery/robotic.dm
+++ b/code/modules/surgery/robotic.dm
@@ -67,8 +67,10 @@
)
if(organ.status & ORGAN_CUT_AWAY)
organ.status &= ~ORGAN_CUT_AWAY
+ organ.handle_organ_eff()
else
organ.status |= ORGAN_CUT_AWAY
+ organ.handle_organ_eff()
/datum/surgery_step/robotic/connect_organ/fail_step(mob/living/user, obj/item/organ/internal/organ, obj/item/stack/tool)
user.visible_message(