Why do surgeries always end up with jank

This commit is contained in:
Thalpy
2019-11-21 15:57:21 +00:00
parent 46076c95c7
commit 00bffba7ea
7 changed files with 37 additions and 32 deletions
-2
View File
@@ -762,5 +762,3 @@
desc = "An upgrade to the defibrillator capacitors, which let it charge faster"
icon_state = "fast_disk"
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_GOLD = 26000, MAT_SILVER = 26000)
#undef HALFWAYCRITDEATH
@@ -406,8 +406,8 @@
. = ..()
if(!.) //if the item loads, clear can_decompose
return
var/obj/item/organ/organ = O
if(organ)
if(istype(O, /obj/item/organ))
var/obj/item/organ/organ = O
organ.organ_flags |= ORGAN_FROZEN
/obj/machinery/smartfridge/organ/RefreshParts()
@@ -436,7 +436,7 @@
..()
var/list = list(/obj/item/organ/tongue, /obj/item/organ/brain, /obj/item/organ/heart, /obj/item/organ/liver, /obj/item/organ/ears, /obj/item/organ/eyes, /obj/item/organ/tail, /obj/item/organ/stomach)
var/newtype = pick(list)
load(new newtype)
load(new newtype(src.loc))
// -----------------------------
// Chemistry Medical Smartfridge
@@ -10,14 +10,14 @@
time = 50
repeatable = TRUE //So you can retry
/datum/surgery_step/incise_heart/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin apply an electrical charge directly to the heart and across the body...</span>",
/datum/surgery_step/ventricular_electrotherapy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to apply an electrical charge directly to the heart body...</span>",
"[user] begins to make an incision in [target]'s heart.",
"[user] begins to make an incision in [target]'s heart.")
target.notify_ghost_cloning("Your heart is undergoing Emergency Cardioversion Induction!")
target.notify_ghost_cloning("Your heart is undergoing Emergency Cardioversion Induction Surgery!")
playsound(src, 'sound/machines/defib_charge.ogg', 75, 0)
/datum/surgery_step/incise_heart/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/ventricular_electrotherapy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/mob/living/carbon/human/H = target
playsound(src, 'sound/machines/defib_zap.ogg', 75, 1, -1)
playsound(src, "bodyfall", 50, 1)
@@ -25,51 +25,56 @@
display_results(user, target, "<span class='warning'>You can't use this procedure on the living! [H]'s body flops madly like a wild fish on the table from the current, and your crazed surgical methods.</span>",
"<span class='warning'>[user] screws up, causing [H] to flop around violently as they're zapped!</span>",
"<span class='warning'>[user] screws up, causing [H] to flop around violently as they're zapped!</span>")
M.emote("scream")
H.electrocute_act(25, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE)
H.emote("scream")
H.electrocute_act(25, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE)
H.adjustFireLoss(10)
H.emote("flip")
H.Jitter(100)
return FALSE
display_results(user, target, "<span class='notice'>induces a stable rythum in [H]'s heart.</span>",
"[H]'s heart is shocked, attemping to bring them back to a stable rythum!.",
display_results(user, target, "<span class='notice'>You induce a stable cardio in [H]'s heart.</span>",
"[H]'s heart is shocked, attemping to bring them back to a stable rhythm!",
"")
if (!(NOBLOOD in H.dna.species.species_traits))
H.bleed_rate += 10
H.adjustBruteLoss(10)
H.adjustOrganLoss(ORGAN_SLOT_HEART, -10)
H.adjustOrganLoss(ORGAN_SLOT_HEART, -15)
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, -5)
H.electrocute_act(0, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE)
H.electrocute_act(0, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE)
if(istype(tool, /obj/item/twohanded/shockpaddles))
display_results(user, target, "<span class='notice'>You move the paddles to the restart position.</span>",
"[user] moves the paddles to the restart position...",
"")
return TRUE
if(!do_they_live(H))
playsound(src, 'sound/machines/defib_failed.ogg', 50, 0)
log_combat(user, H, "revived", "Emergency Cardioversion Induction")
return TRUE
/datum/surgery_step/incise_heart/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/ventricular_electrotherapy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
playsound(src, 'sound/machines/defib_zap.ogg', 75, 1, -1)
playsound(src, "bodyfall", 50, 1)
var/mob/living/carbon/human/H = target
display_results(user, target, "<span class='warning'>You screw up, sending current racing though their body!</span>",
display_results(user, target, "<span class='warning'>You screw up, sending a current through their body!</span>",
"<span class='warning'>[user] screws up, causing [H] to flop around violently as they're zapped!</span>",
"<span class='warning'>[user] screws up, causing [H] to flop around violently as they're zapped!</span>")
H.electrocute_act(25, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE)
H.electrocute_act(25, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE)
H.adjustFireLoss(5)
H.emote("flip")
H.adjustOrganLoss(ORGAN_SLOT_HEART, 10)
/datum/surgery_step/incise_heart/do_they_live(mob/living/carbon/human/H)
/datum/surgery_step/ventricular_electrotherapy/proc/do_they_live(mob/living/carbon/human/H)
var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart)
H.visible_message("<span class='warning'>[H]'s body convulses a bit.</span>")
total_brute = H.getBruteLoss()
total_burn = H.getFireLoss()
shock_touching(30, H)
var/total_brute = H.getBruteLoss()
var/total_burn = H.getFireLoss()
var/failed
var/tdelta = round(world.time - timeofdeath)
var/tdelta = round(world.time - H.timeofdeath)
if (H.suiciding || (HAS_TRAIT(H, TRAIT_NOCLONE)))
failed = "<span class='warning'>The [src] equipment buzzes: Resuscitation failed - Recovery of patient impossible. Further attempts futile.</span>"
else if (H.hellbound)
failed = "<span class='warning'>The [src] equipment buzzes: Resuscitation failed - Patient's soul appears to be on another plane of existence. Further attempts futile.</span>"
else if(tdelta < (DEFIB_TIME_LIMIT * 10))
else if(world.time < (DEFIB_TIME_LIMIT * 10))
failed = "<span class='warning'>The [src] equipment buzzes: Resuscitation failed - Body has decayed for too long. Further attempts futile.</span>"
else if (!heart)
failed = "<span class='warning'>The [src] equipment buzzes: Resuscitation failed - Patient's heart is missing.</span>"
@@ -93,7 +98,7 @@
if(failed)
user.visible_message(failed)
H.visible_message(failed)
playsound(src, 'sound/machines/defib_failed.ogg', 50, 0)
else
//If the body has been fixed so that they would not be in crit when defibbed, give them oxyloss to put them back into crit
@@ -107,11 +112,10 @@
H.adjustFireLoss((mobhealth - HALFWAYCRITDEATH) * (total_burn / overall_damage), 0)
H.adjustBruteLoss((mobhealth - HALFWAYCRITDEATH) * (total_brute / overall_damage), 0)
H.updatehealth() // Previous "adjust" procs don't update health, so we do it manually.
user.visible_message("<span class='notice'>The [src] equipment pings: Resuscitation successful.</span>")
H.visible_message("<span class='notice'>The [src] equipment pings: Resuscitation successful.</span>")
playsound(src, 'sound/machines/defib_success.ogg', 50, 0)
H.set_heartattack(FALSE)
H.revive()
H.emote("gasp")
H.Jitter(100)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK)
log_combat(user, H, "revived", "Emergency Cardioversion Induction")
+1 -1
View File
@@ -6,7 +6,7 @@
slot = ORGAN_SLOT_HEART
healing_factor = STANDARD_ORGAN_HEALING
decay_factor = 3 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death
decay_factor = 2.5 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death
low_threshold_passed = "<span class='info'>Prickles of pain appear then die out from within your chest...</span>"
high_threshold_passed = "<span class='warning'>Something inside your chest hurts, and the pain isn't subsiding. You notice yourself breathing far faster than before.</span>"
@@ -238,7 +238,8 @@
if(delta > 0)
if(damage >= maxHealth)
organ_flags |= ORGAN_FAILING
owner.med_hud_set_status()
if(owner)
owner.med_hud_set_status()
return now_failing
if(damage > high_threshold && prev_damage <= high_threshold)
return high_threshold_passed
@@ -246,7 +247,8 @@
return low_threshold_passed
else
organ_flags &= ~ORGAN_FAILING
owner.med_hud_set_status()
if(owner)
owner.med_hud_set_status()
if(!owner)//Processing is stopped when the organ is dead and outside of someone. This hopefully should restart it if a removed organ is repaired outside of a body.
START_PROCESSING(SSobj, src)
if(prev_damage > low_threshold && damage <= low_threshold)
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

+1
View File
@@ -2825,6 +2825,7 @@
#include "code\modules\surgery\coronary_bypass.dm"
#include "code\modules\surgery\dental_implant.dm"
#include "code\modules\surgery\embalming.dm"
#include "code\modules\surgery\emergency_cardioversion_recovery.dm"
#include "code\modules\surgery\experimental_dissection.dm"
#include "code\modules\surgery\eye_surgery.dm"
#include "code\modules\surgery\graft_synthtissue.dm"