mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 01:53:35 +01:00
[Ready] Refactors stuns and status effects. (#17579)
* Fixes reviver runtime * Confusion status effect * Dizzy status effect * Drowsiness status effect * decaying -> transient * Drunkenness status effect * why use timer when SSfastprocessing work good * stuns (mostly) * weaken and immobalise * stun/weaken times * update_flags redundancies. * Slowed() * Silence + fixes transient decay * Jittery * sleeping * Paralyze -> weaken * Cult sluring * paralyse * Stammer * slurring + projectile cleanups * losebreath * Hallucination * forgor this * eyeblurry * eye blind * Druggy * affected didn't like my spacing * review pass * second review pass * some cleanups * documentation and signal framework * confusion fix * Fixes spec_stun * rejuv fix * removes a TODO * conflicted myself * fixes * self review * review * removes TODOs * adminfreeze * TM fixes * hallucination fix + others * tones down alchol and runtime fixes * confusion overlay suggestion * more fixes * runtime fix * losebreath fix * clamp => directional bounded sum * steel review * oops Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> * reduces the dizziness cycle rate * borg hotfix * sanctified decursening Co-authored-by: mochi <1496804+dearmochi@users.noreply.github.com> Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
if(!owner)
|
||||
qdel(src)
|
||||
return
|
||||
if(tick_interval < world.time)
|
||||
if(tick_interval <= world.time)
|
||||
tick()
|
||||
tick_interval = world.time + initial(tick_interval)
|
||||
if(duration != -1 && duration < world.time)
|
||||
@@ -272,3 +272,35 @@
|
||||
/datum/status_effect/grouped/before_remove(source)
|
||||
sources -= source
|
||||
return !length(sources)
|
||||
|
||||
/**
|
||||
* # Transient Status Effect (basetype)
|
||||
*
|
||||
* A status effect that works off a (possibly decimal) counter before expiring, rather than a specified world.time.
|
||||
* This allows for a more precise tweaking of status durations at runtime (e.g. paralysis).
|
||||
*/
|
||||
/datum/status_effect/transient
|
||||
tick_interval = 0.2 SECONDS // SSfastprocess interval
|
||||
alert_type = null
|
||||
/// How much strength left before expiring? time in deciseconds.
|
||||
var/strength = 0
|
||||
|
||||
/datum/status_effect/transient/on_creation(mob/living/new_owner, set_duration)
|
||||
if(isnum(set_duration))
|
||||
strength = set_duration
|
||||
. = ..()
|
||||
|
||||
/datum/status_effect/transient/tick()
|
||||
if(QDELETED(src) || QDELETED(owner))
|
||||
return FALSE
|
||||
. = TRUE
|
||||
strength += calc_decay()
|
||||
if(strength <= 0)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Returns how much strength should be adjusted per tick.
|
||||
*/
|
||||
/datum/status_effect/transient/proc/calc_decay()
|
||||
return -0.2 SECONDS // 1 per second by default
|
||||
|
||||
Reference in New Issue
Block a user