mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 18:13:34 +01:00
Stunbaton delayed knockdown now respects antistuns (#21069)
* stunbaton delayed knockdown now moved into status effect * renaming proc to keep its meaning * made STATUS_EFFECT_DELAYED as status effect for any delayed logic, removed STATUS_EFFECT_BATONNED * cleanup, little bug fixing * cleanup * whoopsie * updates * signal string changed * Update code/datums/status_effects/neutral.dm Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> --------- Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
This commit is contained in:
@@ -867,3 +867,5 @@
|
||||
#define COMSIG_OBJECTIVE_CHECK_VALID_TARGET "objective_check_valid_target"
|
||||
#define OBJECTIVE_VALID_TARGET (1<<0)
|
||||
#define OBJECTIVE_INVALID_TARGET (1<<1)
|
||||
|
||||
#define COMSIG_LIVING_CLEAR_STUNS "living_clear_stuns"
|
||||
|
||||
@@ -74,6 +74,8 @@
|
||||
|
||||
#define STATUS_EFFECT_SUMMONEDGHOST /datum/status_effect/cultghost //is a cult ghost: can see dead people, can't manifest more ghosts
|
||||
|
||||
#define STATUS_EFFECT_DELAYED /datum/status_effect/delayed //delayed status effect: gets /datum/callback to call on expire, signal if we want to prevent and duration
|
||||
|
||||
#define STATUS_EFFECT_CRUSHERMARK /datum/status_effect/crusher_mark //if struck with a proto-kinetic crusher, takes a ton of damage
|
||||
|
||||
#define STATUS_EFFECT_SAWBLEED /datum/status_effect/saw_bleed //if the bleed builds up enough, takes a ton of damage
|
||||
@@ -160,4 +162,4 @@
|
||||
/// gives you fluff messages for cough, sneeze, headache, etc but without an actual virus
|
||||
#define STATUS_EFFECT_FAKE_VIRUS /datum/status_effect/fake_virus
|
||||
/// This status effect lets the user see the lwap dots.
|
||||
#define STATUS_EFFECT_LWAPSCOPE /datum/status_effect/lwap_scope
|
||||
#define STATUS_EFFECT_LWAPSCOPE /datum/status_effect/lwap_scope
|
||||
|
||||
@@ -218,3 +218,34 @@
|
||||
/// Remove the image from the lwap user's screen
|
||||
/obj/effect/temp_visual/lwap_ping/proc/remove_mind(mob/living/looker)
|
||||
looker.client?.images -= lwap_image
|
||||
|
||||
/datum/status_effect/delayed
|
||||
id = "delayed_status_effect"
|
||||
status_type = STATUS_EFFECT_MULTIPLE
|
||||
alert_type = null
|
||||
var/prevent_signal = null
|
||||
var/datum/callback/expire_proc = null
|
||||
|
||||
/datum/status_effect/delayed/on_creation(mob/living/new_owner, new_duration, datum/callback/new_expire_proc, new_prevent_signal = null)
|
||||
if(!new_duration || !istype(new_expire_proc))
|
||||
qdel(src)
|
||||
return
|
||||
duration = new_duration
|
||||
expire_proc = new_expire_proc
|
||||
. = ..()
|
||||
if(new_prevent_signal)
|
||||
RegisterSignal(owner, new_prevent_signal, PROC_REF(prevent_action))
|
||||
prevent_signal = new_prevent_signal
|
||||
|
||||
/datum/status_effect/proc/prevent_action()
|
||||
SIGNAL_HANDLER
|
||||
qdel(src)
|
||||
|
||||
/datum/status_effect/delayed/on_remove()
|
||||
if(prevent_signal)
|
||||
UnregisterSignal(owner, prevent_signal)
|
||||
. = ..()
|
||||
|
||||
/datum/status_effect/delayed/on_timeout()
|
||||
. = ..()
|
||||
expire_proc.Invoke()
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
imp_in.SetParalysis(0)
|
||||
imp_in.adjustStaminaLoss(-75)
|
||||
imp_in.stand_up(TRUE)
|
||||
SEND_SIGNAL(imp_in, COMSIG_LIVING_CLEAR_STUNS)
|
||||
|
||||
imp_in.reagents.add_reagent("synaptizine", 10)
|
||||
imp_in.reagents.add_reagent("omnizine", 10)
|
||||
|
||||
@@ -207,7 +207,8 @@
|
||||
H.SetStuttering(10 SECONDS)
|
||||
|
||||
ADD_TRAIT(L, TRAIT_WAS_BATONNED, user_UID) // so one person cannot hit the same person with two separate batons
|
||||
addtimer(CALLBACK(src, PROC_REF(baton_knockdown), L, user_UID, knockdown_duration), knockdown_delay)
|
||||
L.apply_status_effect(STATUS_EFFECT_DELAYED, knockdown_delay, CALLBACK(L, TYPE_PROC_REF(/mob/living/, KnockDown), knockdown_duration), COMSIG_LIVING_CLEAR_STUNS)
|
||||
addtimer(CALLBACK(src, PROC_REF(baton_delay), L, user_UID), knockdown_delay)
|
||||
|
||||
SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK, 33)
|
||||
|
||||
@@ -221,8 +222,7 @@
|
||||
deductcharge(hitcost)
|
||||
return TRUE
|
||||
|
||||
/obj/item/melee/baton/proc/baton_knockdown(mob/living/target, user_UID, knockdown_duration)
|
||||
target.KnockDown(knockdown_duration)
|
||||
/obj/item/melee/baton/proc/baton_delay(mob/living/target, user_UID)
|
||||
REMOVE_TRAIT(target, TRAIT_WAS_BATONNED, user_UID)
|
||||
|
||||
/obj/item/melee/baton/emp_act(severity)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
user.SetWeakened(0)
|
||||
user.setStaminaLoss(0)
|
||||
user.SetKnockDown(0)
|
||||
SEND_SIGNAL(user, COMSIG_LIVING_CLEAR_STUNS)
|
||||
user.reagents.add_reagent("synaptizine", 15)
|
||||
user.reagents.add_reagent("stimulative_cling", 1)
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
U.SetSleeping(0)
|
||||
U.SetConfused(0)
|
||||
U.adjustStaminaLoss(-100)
|
||||
SEND_SIGNAL(U, COMSIG_LIVING_CLEAR_STUNS)
|
||||
to_chat(user, "<span class='notice'>You instill your body with clean blood and remove any incapacitating effects.</span>")
|
||||
var/datum/antagonist/vampire/V = U.mind.has_antag_datum(/datum/antagonist/vampire)
|
||||
var/rejuv_bonus = V.get_rejuv_bonus()
|
||||
|
||||
@@ -486,6 +486,7 @@
|
||||
RestoreEars()
|
||||
heal_overall_damage(1000, 1000)
|
||||
ExtinguishMob()
|
||||
SEND_SIGNAL(src, COMSIG_LIVING_CLEAR_STUNS)
|
||||
fire_stacks = 0
|
||||
on_fire = 0
|
||||
suiciding = 0
|
||||
|
||||
@@ -576,7 +576,7 @@
|
||||
C.SetStuttering(10 SECONDS)
|
||||
C.adjustStaminaLoss(60)
|
||||
baton_delayed = TRUE
|
||||
addtimer(CALLBACK(C, PROC_REF(KnockDown), 10 SECONDS), 2.5 SECONDS)
|
||||
C.apply_status_effect(STATUS_EFFECT_DELAYED, 2.5 SECONDS, CALLBACK(C, TYPE_PROC_REF(/mob/living/, KnockDown), 10 SECONDS), COMSIG_LIVING_CLEAR_STUNS)
|
||||
addtimer(VARSET_CALLBACK(src, baton_delayed, FALSE), BATON_COOLDOWN)
|
||||
add_attack_logs(src, C, "batoned")
|
||||
if(declare_arrests)
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
C.SetStuttering(10 SECONDS)
|
||||
C.adjustStaminaLoss(60)
|
||||
baton_delayed = TRUE
|
||||
addtimer(CALLBACK(C, PROC_REF(KnockDown), 10 SECONDS), 2.5 SECONDS)
|
||||
C.apply_status_effect(STATUS_EFFECT_DELAYED, 2.5 SECONDS, CALLBACK(C, TYPE_PROC_REF(/mob/living/, KnockDown), 10 SECONDS), COMSIG_LIVING_CLEAR_STUNS)
|
||||
addtimer(VARSET_CALLBACK(src, baton_delayed, FALSE), BATON_COOLDOWN)
|
||||
add_attack_logs(src, C, "batoned")
|
||||
if(declare_arrests)
|
||||
|
||||
Reference in New Issue
Block a user