mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Fixes CNS rebooter. (#44630)
* welp * h * fixes * slightly prettier * accounts for stun reduction
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
desc = "This implant will automatically give you back control over your central nervous system, reducing downtime when stunned."
|
||||
implant_color = "#FFFF00"
|
||||
slot = ORGAN_SLOT_BRAIN_ANTISTUN
|
||||
|
||||
|
||||
var/static/list/signalCache = list(
|
||||
COMSIG_LIVING_STATUS_STUN,
|
||||
COMSIG_LIVING_STATUS_KNOCKDOWN,
|
||||
@@ -107,7 +107,6 @@
|
||||
)
|
||||
|
||||
var/stun_cap_amount = 40
|
||||
var/working = FALSE
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/Remove(mob/living/carbon/M, special = FALSE)
|
||||
. = ..()
|
||||
@@ -117,19 +116,16 @@
|
||||
. = ..()
|
||||
RegisterSignal(owner, signalCache, .proc/on_signal)
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/proc/on_signal()
|
||||
if(broken_cyber_organ || working)
|
||||
return
|
||||
working = TRUE
|
||||
if(owner.AmountStun() > stun_cap_amount)
|
||||
owner.SetStun(stun_cap_amount)
|
||||
if(owner.AmountKnockdown() > stun_cap_amount)
|
||||
owner.SetKnockdown(stun_cap_amount)
|
||||
if(owner.AmountImmobilized() > stun_cap_amount)
|
||||
owner.SetImmobilized(stun_cap_amount)
|
||||
if(owner.AmountParalyzed() > stun_cap_amount)
|
||||
owner.SetParalyzed(stun_cap_amount)
|
||||
working = FALSE
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/proc/on_signal(datum/source, amount)
|
||||
if(!broken_cyber_organ && amount > 0)
|
||||
addtimer(CALLBACK(src, .proc/clear_stuns), stun_cap_amount, TIMER_UNIQUE|TIMER_OVERRIDE)
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/proc/clear_stuns()
|
||||
if(owner || !broken_cyber_organ)
|
||||
owner.SetStun(0)
|
||||
owner.SetKnockdown(0)
|
||||
owner.SetImmobilized(0)
|
||||
owner.SetParalyzed(0)
|
||||
|
||||
/obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user