mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +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:
@@ -8,9 +8,9 @@
|
||||
/// Chance to trip when crossing.
|
||||
var/trip_chance = 100
|
||||
/// Stun to add when crossed.
|
||||
var/stun = 4 SECONDS_TO_LIFE_CYCLES
|
||||
var/stun = 4 SECONDS
|
||||
/// Weaken to add when crossed.
|
||||
var/weaken = 4 SECONDS_TO_LIFE_CYCLES
|
||||
var/weaken = 4 SECONDS
|
||||
|
||||
/obj/effect/hallucination/tripper/CanPass(atom/movable/mover, turf/T)
|
||||
. = TRUE
|
||||
@@ -18,7 +18,6 @@
|
||||
var/mob/living/M = mover
|
||||
if(M.lying || !prob(trip_chance))
|
||||
return
|
||||
M.Stun(stun)
|
||||
M.Weaken(weaken)
|
||||
on_crossed()
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
return
|
||||
|
||||
step_towards(target, get_turf(src))
|
||||
target.Weaken(4 SECONDS_TO_LIFE_CYCLES)
|
||||
target.Weaken(4 SECONDS)
|
||||
target.visible_message("<span class='warning'>[target] flails [target.p_their()] [I.name] as if striking something, only to trip!</span>",
|
||||
"<span class='userdanger'>[src] vanishes as you strike it with [I], causing you to stumble forward!</span>")
|
||||
qdel(src)
|
||||
@@ -381,7 +381,7 @@
|
||||
/obj/effect/hallucination/xeno_pouncer/throw_impact(A)
|
||||
if(A == target)
|
||||
forceMove(get_turf(target))
|
||||
target.Weaken(5)
|
||||
target.Weaken(10 SECONDS)
|
||||
target.visible_message("<span class='danger'>[target] recoils backwards and falls flat!</span>",
|
||||
"<span class='userdanger'>[name] pounces on you!</span>")
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
to_chat(user, "<span class='warning'>You try to move your [temp.name], but cannot!</span>")
|
||||
return
|
||||
|
||||
user.Weaken(4 SECONDS_TO_LIFE_CYCLES)
|
||||
user.Weaken(4 SECONDS)
|
||||
user.visible_message("<span class='warning'>[user] does a grabbing motion towards [get_turf(src)] but [user.p_they()] stumble[user.p_s()] - nothing is there!</span>",
|
||||
"<span class='userdanger'>[src] vanishes as you try grabbing it, causing you to stumble!</span>")
|
||||
qdel(src)
|
||||
@@ -216,8 +216,8 @@
|
||||
hallucination_icon_state = "smooth"
|
||||
hallucination_override = TRUE
|
||||
hallucination_layer = HIGH_TURF_LAYER
|
||||
stun = 8 SECONDS_TO_LIFE_CYCLES
|
||||
weaken = 8 SECONDS_TO_LIFE_CYCLES
|
||||
stun = 8 SECONDS
|
||||
weaken = 8 SECONDS
|
||||
|
||||
/obj/effect/hallucination/tripper/chasm/on_crossed()
|
||||
target.visible_message("<span class='warning'>[target] trips over nothing and flails on [get_turf(target)] as if they were falling!</span>",
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
#define HALLUCINATE_COOLDOWN_MIN 20 SECONDS
|
||||
#define HALLUCINATE_COOLDOWN_MAX 50 SECONDS
|
||||
/// This is multiplied with [/mob/var/hallucination] to determine the final cooldown. A higher hallucination value means shorter cooldown.
|
||||
#define HALLUCINATE_COOLDOWN_FACTOR 0.03
|
||||
/// Percentage defining the chance at which an hallucination may spawn past the cooldown.
|
||||
#define HALLUCINATE_CHANCE 80
|
||||
// Severity weights, should sum up to 100!
|
||||
#define HALLUCINATE_MINOR_WEIGHT 60
|
||||
#define HALLUCINATE_MODERATE_WEIGHT 30
|
||||
#define HALLUCINATE_MAJOR_WEIGHT 10
|
||||
|
||||
GLOBAL_LIST_INIT(hallucinations, list(
|
||||
HALLUCINATE_MINOR = list(
|
||||
/obj/effect/hallucination/bolts = 10,
|
||||
@@ -40,41 +29,6 @@ GLOBAL_LIST_INIT(hallucinations, list(
|
||||
)
|
||||
))
|
||||
|
||||
/**
|
||||
* Called as part of [/mob/living/proc/handle_status_effects] to handle hallucinations.
|
||||
*/
|
||||
/mob/living/carbon/proc/handle_hallucinations()
|
||||
if(!hallucination || next_hallucination > world.time)
|
||||
return
|
||||
|
||||
next_hallucination = world.time + rand(HALLUCINATE_COOLDOWN_MIN, HALLUCINATE_COOLDOWN_MAX) / (hallucination * HALLUCINATE_COOLDOWN_FACTOR)
|
||||
if(!prob(HALLUCINATE_CHANCE))
|
||||
return
|
||||
|
||||
// Pick a severity
|
||||
var/severity = HALLUCINATE_MINOR
|
||||
switch(rand(100))
|
||||
if(0 to HALLUCINATE_MINOR_WEIGHT)
|
||||
severity = HALLUCINATE_MINOR
|
||||
if((HALLUCINATE_MINOR_WEIGHT + 1) to (HALLUCINATE_MINOR_WEIGHT + HALLUCINATE_MODERATE_WEIGHT))
|
||||
severity = HALLUCINATE_MODERATE
|
||||
if((HALLUCINATE_MINOR_WEIGHT + HALLUCINATE_MODERATE_WEIGHT + 1) to 100)
|
||||
severity = HALLUCINATE_MAJOR
|
||||
|
||||
hallucinate(pickweight(GLOB.hallucinations[severity]))
|
||||
|
||||
/**
|
||||
* Spawns an hallucination for the mob.
|
||||
*
|
||||
* Arguments:
|
||||
* * H - The type path of the hallucination to spawn.
|
||||
*/
|
||||
/mob/living/carbon/proc/hallucinate(obj/effect/hallucination/H)
|
||||
ASSERT(ispath(H))
|
||||
if(ckey)
|
||||
add_attack_logs(null, src, "Received hallucination [H]", ATKLOG_ALL)
|
||||
return new H(get_turf(src), src)
|
||||
|
||||
/**
|
||||
* # Hallucination
|
||||
*
|
||||
@@ -188,11 +142,3 @@ GLOBAL_LIST_INIT(hallucinations, list(
|
||||
target?.playsound_local(source, snd, volume, vary, frequency)
|
||||
return
|
||||
addtimer(CALLBACK(target, /mob/.proc/playsound_local, source, snd, volume, vary, frequency), time)
|
||||
|
||||
#undef HALLUCINATE_COOLDOWN_MIN
|
||||
#undef HALLUCINATE_COOLDOWN_MAX
|
||||
#undef HALLUCINATE_COOLDOWN_FACTOR
|
||||
#undef HALLUCINATE_CHANCE
|
||||
#undef HALLUCINATE_MINOR_WEIGHT
|
||||
#undef HALLUCINATE_MODERATE_WEIGHT
|
||||
#undef HALLUCINATE_MAJOR_WEIGHT
|
||||
|
||||
Reference in New Issue
Block a user