diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index d738e5aa1f63..93ceb912480b 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -462,6 +462,10 @@ #define COMPONENT_BLOCK_DEFIB (1<<0) /// If returned, don't even show the "failed" message, defer to the signal handler to do that. #define COMPONENT_DEFIB_OVERRIDE (1<<1) + /// If returned, allow to revive through false death. + #define COMPONENT_DEFIB_FAKEDEATH_ACCEPTED (1<<2) + /// If returned, make the fake death look like a unresponsive ghost. + #define COMPONENT_DEFIB_FAKEDEATH_DENIED (1<<3) ///send from defibs on ressurection: (defibber, defib_item, ghost) #define COMSIG_LIVING_DEFIBBED "living_defibbed" ///from base of mob/living/revive() (full_heal, admin_revive) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 174ecddda53c..f4efafba1488 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -79,7 +79,10 @@ var/datum/gear/G = geartype var/use_category = initial(G.sort_category) - + // SS220 EDIT - START + if(G.removed_from_loadout) + continue + // SS220 EDIT - END if(G == initial(G.main_typepath)) continue diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 76c4c5e978f9..b27f15a7ce77 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -870,3 +870,58 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." if(!istype(usr)) return living_owner.do_succumb(TRUE) + +/atom/movable/screen/alert/changeling_defib_revive + name = "Your heart is being defibrillated." + desc = "Click this status to be revived from fake death." + icon_state = "template" + timeout = 10 SECONDS + var/do_we_revive = FALSE + var/image/toggle_overlay + +/atom/movable/screen/alert/changeling_defib_revive/Initialize(mapload, parent_unit) + . = ..() + var/image/defib_appearance = image(parent_unit) + defib_appearance.layer = FLOAT_LAYER + defib_appearance.plane = FLOAT_PLANE + overlays += defib_appearance + +/atom/movable/screen/alert/changeling_defib_revive/attach_owner(mob/new_owner) + . = ..() + RegisterSignal(owner, COMSIG_LIVING_DEFIBBED, PROC_REF(on_defib_revive)) + +/atom/movable/screen/alert/changeling_defib_revive/Destroy() + if(owner) + UnregisterSignal(owner, COMSIG_LIVING_DEFIBBED) + if(toggle_overlay) + overlays -= toggle_overlay + qdel(toggle_overlay) + return ..() + +/atom/movable/screen/alert/changeling_defib_revive/Click() + if(!..()) + return + do_we_revive = !do_we_revive + if(!toggle_overlay) + toggle_overlay = image('icons/mob/screen_gen.dmi', icon_state = "selector") + toggle_overlay.layer = FLOAT_LAYER + toggle_overlay.plane = FLOAT_PLANE + 2 + if(do_we_revive) + overlays |= toggle_overlay + else + overlays -= toggle_overlay + +/atom/movable/screen/alert/changeling_defib_revive/proc/on_defib_revive() + . = COMPONENT_DEFIB_FAKEDEATH_DENIED + if(do_we_revive) + var/datum/antagonist/changeling/cling = owner.mind.has_antag_datum(/datum/antagonist/changeling) + cling.remove_specific_power(/datum/action/changeling/revive) + cling.regenerating = FALSE + var/heart_name = "heart" + if(iscarbon(owner)) + var/mob/living/carbon/C = owner + var/datum/organ/heart/heart = C.get_int_organ_datum(ORGAN_DATUM_HEART) + heart_name = heart.linked_organ.name + to_chat(owner, "Electricity flows through our [heart_name]! We have been brought back to life and have stopped our regeneration.") + . = COMPONENT_DEFIB_FAKEDEATH_ACCEPTED + owner.clear_alert("cling_defib") diff --git a/code/datums/components/defibrillator.dm b/code/datums/components/defibrillator.dm index ff1020e5eca5..fd51de84560c 100644 --- a/code/datums/components/defibrillator.dm +++ b/code/datums/components/defibrillator.dm @@ -173,6 +173,11 @@ to_chat(ghost, "Your heart is being defibrillated. Return to your body if you want to be revived! (Verbs -> Ghost -> Re-enter corpse)") window_flash(ghost.client) SEND_SOUND(ghost, sound('sound/effects/genetics.ogg')) + else if(HAS_TRAIT_FROM(target, TRAIT_FAKEDEATH, CHANGELING_TRAIT)) + to_chat(target, "Your heart is being defibrillated. Click the defibrillator status to be revived!") + window_flash(target.client) + SEND_SOUND(target, sound('sound/effects/genetics.ogg')) + target.throw_alert("cling_defib", /atom/movable/screen/alert/changeling_defib_revive, alert_args = list(parent, target)) if(!do_after(user, 3 SECONDS * speed_multiplier, target = target)) // Beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process busy = FALSE @@ -238,37 +243,39 @@ playsound(get_turf(defib_ref), 'sound/machines/defib_zap.ogg', 50, 1, -1) ghost = target.get_ghost(TRUE) // We have to double check whether the dead guy has entered their body during the above - var/defib_success = TRUE - // Run through some quick failure states after shocking. var/time_dead = world.time - target.timeofdeath + var/failure_message if(!target.is_revivable()) - user.visible_message("[defib_ref] buzzes: Resuscitation failed - Heart tissue damage beyond point of no return for defibrillation.") - defib_success = FALSE + failure_message = "[defib_ref] buzzes: Resuscitation failed - Heart tissue damage beyond point of no return for defibrillation." else if(target.getBruteLoss() >= 180 || target.getFireLoss() >= 180) - user.visible_message("[defib_ref] buzzes: Resuscitation failed - Severe tissue damage detected.") - defib_success = FALSE + failure_message = "[defib_ref] buzzes: Resuscitation failed - Severe tissue damage detected." else if(HAS_TRAIT(target, TRAIT_HUSK)) - user.visible_message("[defib_ref] buzzes: Resuscitation failed - Subject is husked.") - defib_success = FALSE + failure_message = "[defib_ref] buzzes: Resuscitation failed - Subject is husked." else if(target.blood_volume < BLOOD_VOLUME_SURVIVE) - user.visible_message("[defib_ref] buzzes: Resuscitation failed - Patient blood volume critically low.") - defib_success = FALSE + failure_message = "[defib_ref] buzzes: Resuscitation failed - Patient blood volume critically low." else if(!target.get_organ_slot("brain")) // So things like headless clings don't get outed - user.visible_message("[defib_ref] buzzes: Resuscitation failed - No brain detected within patient.") - defib_success = FALSE + failure_message = "[defib_ref] buzzes: Resuscitation failed - No brain detected within patient." else if(ghost) if(!ghost.can_reenter_corpse || target.suiciding) // DNR or AntagHUD - user.visible_message("[defib_ref] buzzes: Resuscitation failed - No electrical brain activity detected.") + failure_message = "[defib_ref] buzzes: Resuscitation failed - No electrical brain activity detected." + else + failure_message = "[defib_ref] buzzes: Resuscitation failed - Patient's brain is unresponsive. Further attempts may succeed." + else if(HAS_TRAIT(target, TRAIT_FAKEDEATH)) + if(signal_result & COMPONENT_DEFIB_FAKEDEATH_DENIED) + failure_message = "[defib_ref] buzzes: Resuscitation failed - Patient's brain is unresponsive. Further attempts may succeed." + else if(signal_result & COMPONENT_DEFIB_FAKEDEATH_ACCEPTED) + // as much as I hate that this is here, it has to come after the `Patient is not in a valid state. Operation aborted.` check. + REMOVE_TRAIT(target, TRAIT_FAKEDEATH, CHANGELING_TRAIT) else - user.visible_message("[defib_ref] buzzes: Resuscitation failed - Patient's brain is unresponsive. Further attempts may succeed.") - defib_success = FALSE - else if((signal_result & COMPONENT_BLOCK_DEFIB) || HAS_TRAIT(target, TRAIT_FAKEDEATH) || HAS_TRAIT(target, TRAIT_BADDNA) || target.suiciding) // these are a bit more arbitrary - user.visible_message("[defib_ref] buzzes: Resuscitation failed.") - defib_success = FALSE + failure_message = "[defib_ref] buzzes: Resuscitation failed." // has a fakedeath like capulettium + + else if((signal_result & COMPONENT_BLOCK_DEFIB) || HAS_TRAIT(target, TRAIT_BADDNA) || target.suiciding) // these are a bit more arbitrary + failure_message = "[defib_ref] buzzes: Resuscitation failed." - if(!defib_success) + if(failure_message) + user.visible_message(failure_message) playsound(get_turf(defib_ref), 'sound/machines/defib_failed.ogg', 50, 0) else // Heal each basic damage type by as much as we're under -100 health @@ -313,7 +320,7 @@ target.med_hud_set_status() add_attack_logs(user, target, "Revived with [defib_ref]") SSblackbox.record_feedback("tally", "players_revived", 1, "defibrillator") - SEND_SIGNAL(parent, COMSIG_DEFIB_SHOCK_APPLIED, user, target, should_cause_harm, defib_success) + SEND_SIGNAL(parent, COMSIG_DEFIB_SHOCK_APPLIED, user, target, should_cause_harm, isnull(failure_message)) set_cooldown(cooldown) busy = FALSE diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index d0497157ea7b..441278e98b98 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -178,6 +178,8 @@ SSticker.mode.remove_revolutionary(brain.brainmob.mind, 1) var/mob/living/silicon/ai/A = new /mob/living/silicon/ai(loc, laws, brain) + // Stop holding onto the laws so we don't qdel them and make the AI randomly lose its laws when GC gives up and hard deletes them. + laws = null if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created A.rename_self("ИИ", 1) SSblackbox.record_feedback("amount", "ais_created", 1) diff --git a/code/game/objects/effects/effect_system/effects_sparks.dm b/code/game/objects/effects/effect_system/effects_sparks.dm index 5c7c1254b8d6..c744bca02c36 100644 --- a/code/game/objects/effects/effect_system/effects_sparks.dm +++ b/code/game/objects/effects/effect_system/effects_sparks.dm @@ -23,7 +23,6 @@ /obj/effect/particle_effect/sparks/New() ..() - flick("sparks", src) // replay the animation playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) var/turf/T = loc if(isturf(T)) diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm index 786aaa072a21..239833432627 100644 --- a/code/game/objects/items/weapons/manuals.dm +++ b/code/game/objects/items/weapons/manuals.dm @@ -501,23 +501,16 @@ Anti-Plague Sequence Beta @@ -527,17 +520,33 @@
  • 1 unit of blood containing zombie plague cured by Anti-Plague Sequence Beta
  • 1 unit of blood containing an advanced virus with the "Necrotizing Fasciitis" symptom
  • 3 random chemicals from the list below, 1 unit of each (Unknown Random Recipe) + +
  • + + + Anti-Plague Sequence Omega +