mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
Lets you enter fakedeath when dead (#76666)
## About The Pull Request Fixes #76665 `fakedeath` early returned if the mob was dead, I guess it assumed if you were dead dead you wouldn't want to become fake dead as well I removed that because it's definitely a valid use case, in my eyes, that you would be able to apply the fakedeath traits to a mob who is dead, for the event they are revived at some point (to still appear dead) ## Why It's Good For The Game Lings rely on this ## Changelog 🆑 Melbert fix: Fix ling revival for full-dead lings /🆑
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
else
|
||||
changeling.fully_heal(heal_flags)
|
||||
|
||||
changeling.cure_fakedeath(CHANGELING_TRAIT) // rips us out of revival stasis (if we're in it)
|
||||
changeling.buckled?.unbuckle_mob(changeling) // get us off of stasis beds please
|
||||
changeling.set_resting(FALSE)
|
||||
changeling.adjust_jitter(20 SECONDS)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
ignores_fakedeath = TRUE
|
||||
|
||||
/// How long it takes for revival to ready upon entering stasis.
|
||||
/// The changelin can opt to stay in fakedeath for longer, though.
|
||||
/// The changeling can opt to stay in fakedeath for longer, though.
|
||||
var/fakedeath_duration = 40 SECONDS
|
||||
/// If TRUE, we're ready to revive and can click the button to heal.
|
||||
var/revive_ready = FALSE
|
||||
@@ -21,9 +21,11 @@
|
||||
INVOKE_ASYNC(src, PROC_REF(revive), user)
|
||||
disable_revive(user) // this should be already called via signal, but just incase something wacky happens
|
||||
|
||||
else if(enable_fakedeath(user))
|
||||
to_chat(user, span_changeling("We begin our stasis, preparing energy to arise once more."))
|
||||
|
||||
else
|
||||
to_chat(user, span_notice("We begin our stasis, preparing energy to arise once more."))
|
||||
enable_fakedeath(user)
|
||||
stack_trace("Changeling revive failed to enter fakedeath when it should have been in a valid state to.")
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -34,17 +36,21 @@
|
||||
|
||||
changeling.fakedeath(CHANGELING_TRAIT)
|
||||
addtimer(CALLBACK(src, PROC_REF(ready_to_regenerate), changeling), fakedeath_duration, TIMER_UNIQUE)
|
||||
// Basically, these let the ling exit stasis without giving away their ling-y-ness if revived through other means
|
||||
RegisterSignal(changeling, SIGNAL_REMOVETRAIT(TRAIT_DEATHCOMA), PROC_REF(fakedeath_reset))
|
||||
RegisterSignal(changeling, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change))
|
||||
return TRUE
|
||||
|
||||
/// Sets [revive_ready] to FALSE and updates the button icons.
|
||||
/// Can be called mid-revival if the process is being cancelled
|
||||
/datum/action/changeling/fakedeath/proc/disable_revive(mob/living/changeling)
|
||||
if(!revive_ready)
|
||||
return
|
||||
if(revive_ready)
|
||||
chemical_cost = 15
|
||||
revive_ready = FALSE
|
||||
build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
|
||||
|
||||
chemical_cost = 15
|
||||
revive_ready = FALSE
|
||||
build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
|
||||
UnregisterSignal(changeling, SIGNAL_REMOVETRAIT(TRAIT_DEATHCOMA))
|
||||
UnregisterSignal(changeling, COMSIG_MOB_STATCHANGE)
|
||||
|
||||
/// Sets [revive_ready] to TRUE and updates the button icons.
|
||||
/datum/action/changeling/fakedeath/proc/enable_revive(mob/living/changeling)
|
||||
@@ -56,7 +62,7 @@
|
||||
build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
|
||||
|
||||
/// Signal proc to stop the revival process if the changeling exits their stasis early.
|
||||
/datum/action/changeling/fakedeath/proc/fakedeath_reset(datum/source)
|
||||
/datum/action/changeling/fakedeath/proc/fakedeath_reset(mob/living/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(HAS_TRAIT_FROM(source, TRAIT_DEATHCOMA, CHANGELING_TRAIT))
|
||||
@@ -64,6 +70,16 @@
|
||||
|
||||
disable_revive(source)
|
||||
|
||||
/// Signal proc to exit fakedeath early if we're revived from being previously dead
|
||||
/datum/action/changeling/fakedeath/proc/on_stat_change(mob/living/source, new_stat, old_stat)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(old_stat != DEAD)
|
||||
return
|
||||
|
||||
source.cure_fakedeath(CHANGELING_TRAIT)
|
||||
to_chat(source, span_changeling("We exit our stasis early."))
|
||||
|
||||
/datum/action/changeling/fakedeath/proc/revive(mob/living/carbon/user)
|
||||
if(!istype(user))
|
||||
return
|
||||
@@ -75,7 +91,7 @@
|
||||
var/flags_to_heal = (HEAL_DAMAGE|HEAL_BODY|HEAL_STATUS|HEAL_CC_STATUS)
|
||||
// but leave out limbs so we can do it specially
|
||||
user.revive(flags_to_heal & ~HEAL_LIMBS)
|
||||
to_chat(user, span_notice("We have revived ourselves."))
|
||||
to_chat(user, span_changeling("We have revived ourselves."))
|
||||
|
||||
var/static/list/dont_regenerate = list(BODY_ZONE_HEAD) // headless changelings are funny
|
||||
if(!length(user.get_missing_limbs() - dont_regenerate))
|
||||
@@ -101,7 +117,7 @@
|
||||
if(!HAS_TRAIT_FROM(user, TRAIT_DEATHCOMA, CHANGELING_TRAIT))
|
||||
return
|
||||
|
||||
to_chat(user, span_notice("We are ready to revive."))
|
||||
to_chat(user, span_changeling("We are ready to revive."))
|
||||
enable_revive(user)
|
||||
|
||||
/datum/action/changeling/fakedeath/can_sting(mob/living/user)
|
||||
|
||||
@@ -517,12 +517,12 @@
|
||||
|
||||
/// Induces fake death on a living mob.
|
||||
/mob/living/proc/fakedeath(source, silent = FALSE)
|
||||
if(stat == DEAD)
|
||||
return
|
||||
if(!silent)
|
||||
emote("deathgasp")
|
||||
if(stat != DEAD)
|
||||
if(!silent)
|
||||
emote("deathgasp")
|
||||
tod = station_time_timestamp()
|
||||
|
||||
add_traits(list(TRAIT_FAKEDEATH, TRAIT_DEATHCOMA), source)
|
||||
tod = station_time_timestamp()
|
||||
|
||||
///Unignores all slowdowns that lack the IGNORE_NOSLOW flag.
|
||||
/mob/living/proc/unignore_slowdown(source)
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_metabolize(mob/living/holder_mob)
|
||||
. = ..()
|
||||
holder_mob.adjustOxyLoss(0.5*REM, FALSE, required_biotype = affected_biotype, required_respiration_type = affected_respiration_type)
|
||||
if(data?["method"] & INGEST)
|
||||
if((data?["method"] & INGEST) && holder_mob.stat != DEAD)
|
||||
holder_mob.fakedeath(type)
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_end_metabolize(mob/living/holder_mob)
|
||||
@@ -274,7 +274,8 @@
|
||||
if(5 to 8)
|
||||
affected_mob.adjustStaminaLoss(40 * REM * seconds_per_tick, 0)
|
||||
if(9 to INFINITY)
|
||||
affected_mob.fakedeath(type)
|
||||
if(affected_mob.stat != DEAD)
|
||||
affected_mob.fakedeath(type)
|
||||
..()
|
||||
return TRUE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user