mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
Maybe makes stuff like zombie powder more consistent / less buggy with status effects (#93836)
This commit is contained in:
@@ -98,34 +98,39 @@
|
||||
status_type = STATUS_EFFECT_UNIQUE
|
||||
duration = STATUS_EFFECT_PERMANENT //Will remove self when block breaks.
|
||||
alert_type = /atom/movable/screen/alert/status_effect/freon/stasis
|
||||
tick_interval = STATUS_EFFECT_NO_TICK
|
||||
/// The cube we will place our mob into.
|
||||
var/obj/structure/ice_stasis/cube
|
||||
/// Whether or not this version of the status effect can be resisted out of.
|
||||
var/resistable = TRUE
|
||||
|
||||
/datum/status_effect/frozenstasis/on_apply()
|
||||
if(resistable)
|
||||
RegisterSignal(owner, COMSIG_LIVING_RESIST, PROC_REF(breakCube))
|
||||
cube = new /obj/structure/ice_stasis(get_turf(owner))
|
||||
owner.forceMove(cube)
|
||||
RegisterSignal(cube, COMSIG_QDELETING, PROC_REF(clear_effect))
|
||||
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(has_escaped))
|
||||
if(resistable)
|
||||
RegisterSignal(owner, COMSIG_LIVING_RESIST, PROC_REF(clear_effect))
|
||||
ADD_TRAIT(owner, TRAIT_GODMODE, TRAIT_STATUS_EFFECT(id))
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/frozenstasis/tick(seconds_between_ticks)
|
||||
if(!cube || owner.loc != cube)
|
||||
owner.remove_status_effect(src)
|
||||
|
||||
/datum/status_effect/frozenstasis/proc/breakCube()
|
||||
/datum/status_effect/frozenstasis/proc/clear_effect(...)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
owner.remove_status_effect(src)
|
||||
qdel(src)
|
||||
|
||||
/datum/status_effect/frozenstasis/proc/has_escaped(...)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(owner.loc != cube)
|
||||
qdel(src)
|
||||
|
||||
/datum/status_effect/frozenstasis/on_remove()
|
||||
if(cube)
|
||||
qdel(cube)
|
||||
REMOVE_TRAIT(owner, TRAIT_GODMODE, TRAIT_STATUS_EFFECT(id))
|
||||
if(resistable)
|
||||
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
|
||||
UnregisterSignal(owner, COMSIG_MOVABLE_MOVED)
|
||||
UnregisterSignal(owner, COMSIG_LIVING_RESIST)
|
||||
UnregisterSignal(cube, COMSIG_QDELETING)
|
||||
QDEL_NULL(cube)
|
||||
|
||||
/datum/status_effect/frozenstasis/irresistable
|
||||
resistable = FALSE
|
||||
|
||||
Reference in New Issue
Block a user