Skip to content

Commit

Permalink
ErisMed fixes Season 1 Episode 2 (discordia-space#8413)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* 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 <[email protected]>
  • Loading branch information
AltHit and hyperioo authored Feb 2, 2024
1 parent fe12eea commit 270dc98
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 21 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions code/datums/outfits/jobs/science.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
..()
Expand Down
14 changes: 13 additions & 1 deletion code/game/objects/items/weapons/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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."
Expand Down
50 changes: 47 additions & 3 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand All @@ -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, "<font color='blue'>You can identify that [src]'s circulatory and central neural systems are failing, preventing them from resurrection.</font>")
if(2) //heart fail
to_chat(O, "<font color='blue'>You can identify that [src]'s circulatory system is unable to restart in this state.</font>")
if(3) //brain fail
to_chat(O, "<font color='blue'>You can identify that [src]'s central neural system is too damaged to be resurrected.</font>")
if(4) //corpse is too old
to_chat(O, "<font color='blue'>You see that rotting process in [src]'s body already gone too far. This is nothing but a corpse now.</font>")
if(5) //too much damage
to_chat(O, "<font color='blue'>[src]'s body is too damaged to sustain life.</font>")
else
to_chat(O, "<font color='red'>You're too unskilled to understand what's happening...</font>")

/mob/living/carbon/human/proc/generate_dna()
if(!b_type)
b_type = pick(GLOB.blood_types)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/organs/external/dismemberment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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/))
Expand Down
17 changes: 16 additions & 1 deletion code/modules/organs/internal/_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -85,14 +90,24 @@
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

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))
Expand Down
1 change: 1 addition & 0 deletions code/modules/organs/internal/carrion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions code/modules/organs/internal/internal_wounds/eyes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/internal/internal_wounds/organic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions code/modules/reagents/reagents/other.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down
3 changes: 2 additions & 1 deletion code/modules/surgery/organic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions code/modules/surgery/robotic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 270dc98

Please sign in to comment.