Changelings now get an option to be revived by defibrillator when faking death (#25623)

* wow

* forgot to push

* oops

* lewc review
This commit is contained in:
Contrabang
2024-06-12 22:09:40 +00:00
committed by GitHub
parent b297a543df
commit 439918fdcc
7 changed files with 110 additions and 21 deletions
@@ -24,7 +24,7 @@
var/req_stat = CONSCIOUS
/// If this power is active or not. Used for toggleable abilities.
var/active = FALSE
/// If this power can be used while the changeling has the `TRAIT_FAKE_DEATH` trait.
/// If this power can be used while the changeling has the `TRAIT_FAKEDEATH` trait.
var/bypass_fake_death = FALSE
/*
@@ -277,6 +277,22 @@ RESTRICT_TYPE(/datum/antagonist/changeling)
acquired_powers += power
power.on_purchase(changeling || owner.current, src)
/**
* Removes all `power_type` abilities that the changeling has. Refunds the cost of the power from our genetic points.
*
* Arugments:
* * datum/action/changeling/power - the typepath power to remove from the changeling.
* * refund_cost - if we should refund genetic points when giving the power
*/
/datum/antagonist/changeling/proc/remove_specific_power(datum/action/changeling/power_type, refund_cost = TRUE)
for(var/datum/action/changeling/power in acquired_powers)
if(!istype(power, power_type))
continue
if(refund_cost)
genetic_points -= power.dna_cost
acquired_powers -= power
qdel(power)
/**
* Store the languages from the `new_languages` list into the `absorbed_languages` list. Teaches the changeling the new languages.
*
@@ -18,11 +18,14 @@
user.updatehealth("fakedeath sting")
cling.regenerating = TRUE
cling.remove_specific_power(/datum/action/changeling/revive)
addtimer(CALLBACK(src, PROC_REF(ready_to_regenerate), user), CHANGELING_FAKEDEATH_TIME)
SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]"))
return TRUE
/datum/action/changeling/fakedeath/proc/ready_to_regenerate(mob/user)
if(!HAS_TRAIT_FROM(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT))
return
if(!QDELETED(user) && user.mind && cling?.acquired_powers)
to_chat(user, "<span class='notice'>We are ready to regenerate.</span>")
cling.give_power(new /datum/action/changeling/revive)
@@ -11,6 +11,10 @@
if(HAS_TRAIT(user, TRAIT_UNREVIVABLE))
to_chat(user, "<span class='notice'>Something is preventing us from regenerating, we will need to revive at another point.</span>")
return FALSE
if(!HAS_TRAIT_FROM(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT))
cling.acquired_powers -= src
Remove(user)
return
REMOVE_TRAIT(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT)
for(var/obj/item/grab/G in user.grabbed_by)
var/mob/living/carbon/M = G.assailant