From 65f1f81597fa61002c40e3b2a0bfcf28ab8493d1 Mon Sep 17 00:00:00 2001 From: Lumipharon Date: Tue, 1 Aug 2023 10:08:26 +1200 Subject: [PATCH] Stagger and stun improvement and refactor (#13604) * stagger status effect * normalised amounts to SECONDS * SECONDS define * autodoc and new Stagger proc * apply_effect(s) cleanup * made status procs consistant * fuck it, just load on the main pr * railgun tweaks * made stagger scatter just use the mob modifier * funny id bug * fixed setstatus procs and null amounts * fix funny slow and eyeblur bug --- code/__DEFINES/dcs/signals.dm | 2 - code/__DEFINES/mobs.dm | 6 +- code/__DEFINES/status_effects.dm | 2 + code/__DEFINES/traits.dm | 1 + code/datums/actions/xeno_action.dm | 2 +- code/datums/components/shield.dm | 2 +- code/datums/components/stun_mitigation.dm | 2 +- code/datums/status_effects/debuffs.dm | 15 + code/game/data_huds.dm | 2 +- code/game/objects/items/defibrillator.dm | 2 +- .../items/explosives/grenades/flashbang.dm | 22 +- .../items/explosives/grenades/grenade.dm | 4 +- .../reagent_containers/food/drinks/bottle.dm | 2 +- .../items/reagent_containers/hypospray.dm | 2 +- .../items/reagent_containers/syringes.dm | 2 +- code/game/objects/items/shards.dm | 2 +- .../game/objects/items/tools/kitchen_tools.dm | 8 +- code/game/objects/items/weapons/stunbaton.dm | 12 +- code/game/objects/items/weapons/twohanded.dm | 10 +- code/game/objects/structures/fence.dm | 2 +- .../structures/stool_bed_chair_nest/chairs.dm | 12 +- .../stool_bed_chair_nest/wheelchair.dm | 12 +- code/game/objects/structures/window.dm | 2 +- code/game/objects/structures/window_frame.dm | 2 +- code/modules/admin/smites/knot_shoes.dm | 10 +- code/modules/admin/smites/lightning.dm | 2 +- code/modules/assembly/mousetrap.dm | 4 +- code/modules/hydroponics/grown_inedible.dm | 4 +- code/modules/mob/living/blood.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 8 +- code/modules/mob/living/carbon/human/emote.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 2 +- .../living/carbon/human/human_attackhand.dm | 4 +- .../mob/living/carbon/human/human_defense.dm | 34 +- .../living/carbon/human/life/handle_shock.dm | 10 +- .../mob/living/carbon/human/species.dm | 2 +- code/modules/mob/living/carbon/life.dm | 6 +- .../carbon/xenomorph/castes/beetle/beetle.dm | 2 +- .../castes/carrier/abilities_carrier.dm | 4 +- .../castes/defender/abilities_defender.dm | 4 +- .../xenomorph/castes/defender/defender.dm | 2 +- .../castes/defiler/abilities_defiler.dm | 8 +- .../castes/hunter/abilities_hunter.dm | 4 +- .../xenomorph/castes/king/abilities_king.dm | 4 +- .../castes/runner/abilities_runner.dm | 2 +- .../castes/sentinel/abilities_sentinel.dm | 2 +- .../castes/shrike/abilities_shrike.dm | 4 +- .../castes/warlock/abilities_warlock.dm | 8 +- .../castes/warrior/abilities_warrior.dm | 4 +- .../xenomorph/castes/warrior/warrior.dm | 2 +- .../living/carbon/xenomorph/charge_crush.dm | 4 +- .../living/carbon/xenomorph/damage_procs.dm | 2 +- .../living/carbon/xenomorph/facehuggers.dm | 4 +- .../mob/living/carbon/xenomorph/xenoprocs.dm | 4 +- code/modules/mob/living/damage_procs.dm | 50 +- code/modules/mob/living/living.dm | 1 - code/modules/mob/living/living_defense.dm | 33 +- code/modules/mob/living/living_defines.dm | 3 - .../modules/mob/living/living_health_procs.dm | 5 +- code/modules/mob/living/silicon/silicon.dm | 7 +- code/modules/mob/living/status_procs.dm | 715 +++++++++++------- code/modules/orbits/spaceship.dm | 4 +- code/modules/power/smes_construction.dm | 2 +- code/modules/projectiles/ammo_datums.dm | 94 +-- code/modules/projectiles/gun_system.dm | 9 +- code/modules/projectiles/guns/specialist.dm | 2 +- code/modules/projectiles/projectile.dm | 2 +- code/modules/reagents/reagents/alcohol.dm | 8 +- code/modules/reagents/reagents/drink.dm | 18 +- code/modules/reagents/reagents/food.dm | 6 +- code/modules/reagents/reagents/medical.dm | 38 +- code/modules/reagents/reagents/toxin.dm | 2 +- code/modules/recycling/disposal.dm | 4 +- code/modules/shuttle/marine_dropship.dm | 2 +- code/modules/vehicles/multitile/cm_armored.dm | 6 +- code/modules/vehicles/multitile/tank.dm | 2 +- code/modules/vehicles/sealed.dm | 4 +- code/modules/xenomorph/xeno_structures.dm | 2 +- 78 files changed, 680 insertions(+), 625 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index c2cecc44153bb..c92e6246519b5 100755 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -488,8 +488,6 @@ #define COMSIG_LIVING_STATUS_SLOWDOWN "living_slowdown" //from base of mob/living/set_slowdown() (amount, update) #define COMPONENT_NO_STUN (1<<0) //For all of them -#define COMSIG_LIVING_STAGGER_CHANGED "living_stagger_changed" - ///from end of fully_heal(): (admin_revive) #define COMSIG_LIVING_POST_FULLY_HEAL "living_post_fully_heal" diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index bfd8b5e499c03..298686c9db40d 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -106,6 +106,7 @@ #define STUN "stun" #define WEAKEN "weaken" #define PARALYZE "paralize" +#define STAGGER "stagger" #define AGONY "agony" // Added in PAIN! #define STUTTER "stutter" #define EYE_BLUR "eye_blur" @@ -446,7 +447,8 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA ///Stamina exhaustion #define LIVING_STAMINA_EXHAUSTION_COOLDOWN 10 SECONDS //Amount of time between 0 stamina exhaustion events -#define STAMINA_EXHAUSTION_DEBUFF_STACKS 6 //Amount of slow and stagger stacks applied on stamina exhaustion events +#define STAMINA_EXHAUSTION_STAGGER_DURATION 10 SECONDS //Amount of stagger applied on stamina exhaustion events +#define STAMINA_EXHAUSTION_DEBUFF_STACKS 6 //Amount of slow and eyeblur stacks applied on stamina exhaustion events //Shock defines @@ -713,7 +715,7 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA #define WRAITH_BANISH_NONFRIENDLY_LIVING_MULTIPLIER 0.5 #define WRAITH_BANISH_VERY_SHORT_MULTIPLIER 0.3 -#define WRAITH_TELEPORT_DEBUFF_STAGGER_STACKS 2 //Stagger and slow stacks applied to adjacent living hostiles before/after a teleport +#define WRAITH_TELEPORT_DEBUFF_STAGGER_STACKS 2 SECONDS //Stagger and slow stacks applied to adjacent living hostiles before/after a teleport #define WRAITH_TELEPORT_DEBUFF_SLOWDOWN_STACKS 3 //Stagger and slow stacks applied to adjacent living hostiles before/after a teleport //Warrior defines diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 88448dc1e1de6..fa05f4306f780 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -43,6 +43,8 @@ // DEBUFFS // ///////////// +#define STATUS_EFFECT_STAGGER /datum/status_effect/incapacitating/stagger //reduces human gun damage or impairs xeno ability use + #define STATUS_EFFECT_STUN /datum/status_effect/incapacitating/stun //the affected is unable to move or use items #define STATUS_EFFECT_KNOCKDOWN /datum/status_effect/incapacitating/knockdown //the affected is unable to stand up diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index f8e43806c4f80..a97fe11e51be8 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -132,6 +132,7 @@ #define TRAIT_POSSESSING "possessing" // Prevents mob from being taken by ghosts #define TRAIT_BURROWED "burrowed" // Burrows the xeno #define TRAIT_KNOCKEDOUT "knockedout" //Forces the user to stay unconscious. +#define TRAIT_STAGGERED "staggered" //damage or ability debuffs #define TRAIT_INCAPACITATED "incapacitated" #define TRAIT_FLOORED "floored" //User is forced to the ground on a prone position. #define TRAIT_IMMOBILE "immobile" //User is unable to move by its own volition. diff --git a/code/datums/actions/xeno_action.dm b/code/datums/actions/xeno_action.dm index 9c0954ac562e9..f2d4e0053c043 100644 --- a/code/datums/actions/xeno_action.dm +++ b/code/datums/actions/xeno_action.dm @@ -75,7 +75,7 @@ X.balloon_alert(X, "Cannot while buckled") return FALSE - if(!(flags_to_check & XACT_USE_STAGGERED) && X.stagger) + if(!(flags_to_check & XACT_USE_STAGGERED) && X.IsStaggered()) if(!silent) X.balloon_alert(X, "Cannot while staggered") return FALSE diff --git a/code/datums/components/shield.dm b/code/datums/components/shield.dm index 6996ecdeedbe7..9bd43c5b4a0bd 100644 --- a/code/datums/components/shield.dm +++ b/code/datums/components/shield.dm @@ -158,7 +158,7 @@ if(iscarbon(affected)) var/mob/living/carbon/C = affected - if(C.stagger) //Lesser penalty to shield cover for being staggered. + if(C.IsStaggered()) //Lesser penalty to shield cover for being staggered. status_cover_modifier *= 0.75 switch(attack_type) diff --git a/code/datums/components/stun_mitigation.dm b/code/datums/components/stun_mitigation.dm index 8a646134aa78f..3e90a43b99ada 100644 --- a/code/datums/components/stun_mitigation.dm +++ b/code/datums/components/stun_mitigation.dm @@ -125,7 +125,7 @@ if(iscarbon(affected)) var/mob/living/carbon/C = affected - if(C.stagger) + if(C.IsStaggered()) mitigation_prob *= 0.4 if(!prob(mitigation_prob)) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 267228467ea36..5aeb2692bccfc 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -16,6 +16,21 @@ duration = set_duration return ..() +//STAGGERED +/datum/status_effect/incapacitating/stagger + id = "stagger" + +/datum/status_effect/incapacitating/stagger/on_apply() + . = ..() + if(!.) + return + ADD_TRAIT(owner, TRAIT_STAGGERED, TRAIT_STATUS_EFFECT(id)) + owner.adjust_mob_scatter(5) + +/datum/status_effect/incapacitating/stagger/on_remove() + REMOVE_TRAIT(owner, TRAIT_STAGGERED, TRAIT_STATUS_EFFECT(id)) + owner.adjust_mob_scatter(-5) + //STUN /datum/status_effect/incapacitating/stun id = "stun" diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 29a87137a90a2..d7726080e133c 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -343,7 +343,7 @@ simple_status_hud.icon_state = "hud_con_stun" status_hud.icon_state = "hud_con_stun" return TRUE - if(stagger) + if(IsStaggered()) simple_status_hud.icon_state = "hud_con_stagger" status_hud.icon_state = "hud_con_stagger" return TRUE diff --git a/code/game/objects/items/defibrillator.dm b/code/game/objects/items/defibrillator.dm index 664584361b8bf..48a2de16154b3 100644 --- a/code/game/objects/items/defibrillator.dm +++ b/code/game/objects/items/defibrillator.dm @@ -297,7 +297,7 @@ H.reload_fullscreens() H.flash_act() H.apply_effect(10, EYE_BLUR) - H.apply_effect(10, PARALYZE) + H.apply_effect(20 SECONDS, PARALYZE) H.handle_regular_hud_updates() H.updatehealth() //One more time, so it doesn't show the target as dead on HUDs H.dead_ticks = 0 //We reset the DNR time diff --git a/code/game/objects/items/explosives/grenades/flashbang.dm b/code/game/objects/items/explosives/grenades/flashbang.dm index d33456afe91e1..9832e2ceb6c41 100644 --- a/code/game/objects/items/explosives/grenades/flashbang.dm +++ b/code/game/objects/items/explosives/grenades/flashbang.dm @@ -59,9 +59,7 @@ ///The effects applied to all mobs in range /obj/item/explosive/grenade/flashbang/proc/base_effect(turf/T , mob/living/carbon/M, ear_safety) if(M.flash_act()) - M.Stun(40) - M.Paralyze(20 SECONDS) - + M.apply_effects(stun = 4 SECONDS, paralyze = 2 SECONDS) if(M.ear_damage >= 15) to_chat(M, span_warning("Your ears start to ring badly!")) if(!banglet) @@ -75,11 +73,9 @@ ///The effects applied to mobs in the inner_range /obj/item/explosive/grenade/flashbang/proc/inner_effect(turf/T , mob/living/carbon/M, ear_safety) if(ear_safety > 0) - M.Stun(40) - M.Paralyze(20) + M.apply_effects(stun = 4 SECONDS, paralyze = 2 SECONDS) else - M.Stun(20 SECONDS) - M.Paralyze(60) + M.apply_effects(stun = 20 SECONDS, paralyze = 6 SECONDS) if((prob(14) || (M == src.loc && prob(70)))) M.adjust_ear_damage(rand(1, 10),15) else @@ -88,13 +84,13 @@ ///The effects applied to mobs in the outer_range /obj/item/explosive/grenade/flashbang/proc/outer_effect(turf/T , mob/living/carbon/M, ear_safety) if(!ear_safety) - M.Stun(16 SECONDS) + M.apply_effect(16 SECONDS, STUN) M.adjust_ear_damage(rand(0, 3),8) ///The effects applied to mobs outside of outer_range /obj/item/explosive/grenade/flashbang/proc/max_range_effect(turf/T , mob/living/carbon/M, ear_safety) if(!ear_safety) - M.Stun(80) + M.apply_effect(8 SECONDS, STUN) M.adjust_ear_damage(rand(0, 1),6) @@ -185,10 +181,10 @@ M.blur_eyes(7) if(ear_safety > 0) - M.adjust_stagger(3) + M.adjust_stagger(3 SECONDS) M.add_slowdown(3) else - M.adjust_stagger(6) + M.adjust_stagger(6 SECONDS) M.add_slowdown(6) if((prob(14) || (M == src.loc && prob(70)))) M.adjust_ear_damage(rand(1, 10),15) @@ -200,7 +196,7 @@ M.blur_eyes(6) if(!ear_safety) - M.adjust_stagger(4) + M.adjust_stagger(4 SECONDS) M.add_slowdown(4) M.adjust_ear_damage(rand(0, 3),8) @@ -209,6 +205,6 @@ M.blur_eyes(4) if(!ear_safety) - M.adjust_stagger(2) + M.adjust_stagger(2 SECONDS) M.add_slowdown(2) M.adjust_ear_damage(rand(0, 1),6) diff --git a/code/game/objects/items/explosives/grenades/grenade.dm b/code/game/objects/items/explosives/grenades/grenade.dm index 2b757b1eef67b..9212cfad2ab8f 100644 --- a/code/game/objects/items/explosives/grenades/grenade.dm +++ b/code/game/objects/items/explosives/grenades/grenade.dm @@ -145,8 +145,8 @@ var/effective_strength = max(victim.modify_by_armor(strength, BIO), strength * 0.25) victim.adjustCloneLoss(effective_strength) victim.adjustStaminaLoss(effective_strength * 7) - victim.adjust_stagger(effective_strength / 2) - victim.add_slowdown(effective_strength / 2) + victim.adjust_stagger(effective_strength SECONDS * 0.5) + victim.add_slowdown(effective_strength * 0.5) victim.blur_eyes(effective_strength) //adds a visual indicator that you've just been irradiated victim.adjust_radiation(effective_strength * 20) //Radiation status effect, duration is in deciseconds balloon_alert(victim, "weakened by radiation") diff --git a/code/game/objects/items/reagent_containers/food/drinks/bottle.dm b/code/game/objects/items/reagent_containers/food/drinks/bottle.dm index d43c694affe8b..4d090809ee197 100644 --- a/code/game/objects/items/reagent_containers/food/drinks/bottle.dm +++ b/code/game/objects/items/reagent_containers/food/drinks/bottle.dm @@ -53,7 +53,7 @@ else user.visible_message(span_danger("[user] has hit [user.p_them()]self with the bottle of [name] on the head!")) if(weaken_duration >= force) //if they have armor, no stun - target.apply_effect(2, WEAKEN) + target.apply_effect(4 SECONDS, WEAKEN) else if(target != user) diff --git a/code/game/objects/items/reagent_containers/hypospray.dm b/code/game/objects/items/reagent_containers/hypospray.dm index 4e10074ca0d55..02c75fd5b2344 100644 --- a/code/game/objects/items/reagent_containers/hypospray.dm +++ b/code/game/objects/items/reagent_containers/hypospray.dm @@ -84,7 +84,7 @@ if(!M.can_inject(user, TRUE, user.zone_selected, TRUE)) return if(M != user && M.stat != DEAD && M.a_intent != INTENT_HELP && !M.incapacitated() && M.skills.getRating(SKILL_CQC) >= SKILL_CQC_MP) - user.Paralyze(60) + user.Paralyze(6 SECONDS) log_combat(M, user, "blocked", addition="using their cqc skill (hypospray injection)") M.visible_message(span_danger("[M]'s reflexes kick in and knock [user] to the ground before they could use \the [src]'!"), \ span_warning("You knock [user] to the ground before they could inject you!"), null, 5) diff --git a/code/game/objects/items/reagent_containers/syringes.dm b/code/game/objects/items/reagent_containers/syringes.dm index 8d7cee84522f0..00041ec29408e 100644 --- a/code/game/objects/items/reagent_containers/syringes.dm +++ b/code/game/objects/items/reagent_containers/syringes.dm @@ -69,7 +69,7 @@ var/mob/M = target var/mob/living/L = user if(M != L && M.stat != DEAD && M.a_intent != INTENT_HELP && !M.incapacitated() && M.skills.getRating(SKILL_CQC) >= SKILL_CQC_MP) - L.Paralyze(60) + L.Paralyze(6 SECONDS) log_combat(M, L, "blocked", addition="using their cqc skill (syringe injection)") M.visible_message(span_danger("[M]'s reflexes kick in and knock [L] to the ground before they could use \the [src]'!"), \ span_warning("You knock [L] to the ground before they could inject you!"), null, 5) diff --git a/code/game/objects/items/shards.dm b/code/game/objects/items/shards.dm index 512155e94645d..bd7897f561a56 100644 --- a/code/game/objects/items/shards.dm +++ b/code/game/objects/items/shards.dm @@ -110,7 +110,7 @@ var/datum/limb/affecting = target.get_limb(pick("l_foot", "r_foot")) if(affecting.limb_status & LIMB_ROBOT) return - target.Paralyze(60) + target.Paralyze(6 SECONDS) if(affecting.take_damage_limb(5)) UPDATEHEALTH(target) diff --git a/code/game/objects/items/tools/kitchen_tools.dm b/code/game/objects/items/tools/kitchen_tools.dm index ac4c9b39463e6..d13bfea7b9b59 100644 --- a/code/game/objects/items/tools/kitchen_tools.dm +++ b/code/game/objects/items/tools/kitchen_tools.dm @@ -244,7 +244,7 @@ log_combat(user, M, "attacked", src) if(prob(15)) - M.Paralyze(60) + M.Paralyze(6 SECONDS) M.take_limb_damage(3) else M.take_limb_damage(5) @@ -281,7 +281,7 @@ playsound(M, 'sound/items/trayhit2.ogg', 25, 1) //sound playin' visible_message(span_danger("[user] slams [M] with the tray!")) if(prob(10)) - M.Stun(rand(20,60)) + M.Stun(rand(2 SECONDS, 6 SECONDS)) M.take_limb_damage(3) return else @@ -303,13 +303,13 @@ playsound(M, 'sound/items/trayhit2.ogg', 25, 1) //sound playin' again visible_message(span_danger("[user] slams [M] in the face with the tray!")) if(prob(30)) - M.Stun(rand(40,80)) + M.Stun(rand(4 SECONDS, 8 SECONDS)) M.take_limb_damage(4) return else M.take_limb_damage(8) if(prob(30)) - M.Paralyze(40) + M.Paralyze(4 SECONDS) return return diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 1ae7e5f8147fb..5c264d6b0966f 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -134,16 +134,16 @@ to_chat(user, span_warning("You don't seem to know how to use [src]...")) return - var/agony = agonyforce - var/stun = stunforce + var/agony_applied = agonyforce + var/stun_applied = stunforce var/mob/living/L = M var/target_zone = check_zone(user.zone_selected) if(user.a_intent == INTENT_HARM) if (!..()) //item/attack() does it's own messaging and logs return 0 // item/attack() will return 1 if they hit, 0 if they missed. - agony *= 0.5 //whacking someone causes a much poorer contact than prodding them. - stun *= 0.5 + agony_applied *= 0.5 //whacking someone causes a much poorer contact than prodding them. + stun_applied *= 0.5 //we can't really extract the actual hit zone from ..(), unfortunately. Just act like they attacked the area they intended to. else //copied from human_defense.dm - human defence code should really be refactored some time. @@ -173,8 +173,8 @@ //stun effects if(!HAS_TRAIT(L, TRAIT_BATONIMMUNE)) - L.stun_effect_act(stun, agony, target_zone) - L.ParalyzeNoChain(80) + L.apply_effects(stun = stun_applied, stutter = agony_applied * 0.1, eyeblur = agony_applied * 0.1, agony = agony_applied) + L.ParalyzeNoChain(8 SECONDS) playsound(loc, 'sound/weapons/egloves.ogg', 25, 1, 6) log_combat(user, L, "stunned", src) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 776e06550d892..c9bb5265ae4f1 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -512,15 +512,15 @@ /obj/item/weapon/twohanded/rocketsledge/unique_action(mob/user) . = ..() if (knockback) - stun = 1 - weaken = 2 + stun = 2 SECONDS + weaken = 4 SECONDS knockback = 0 balloon_alert(user, "Selected mode: CRUSH.") playsound(loc, 'sound/machines/switch.ogg', 25) return - stun = 1 - weaken = 1 + stun = 2 SECONDS + weaken = 2 SECONDS knockback = 1 balloon_alert(user, "Selected mode: KNOCKBACK.") playsound(loc, 'sound/machines/switch.ogg', 25) @@ -562,7 +562,7 @@ if(xeno_victim.crest_defense) //Crest defense protects us from the stun. stun = 0 else - stun = 1 + stun = 2 SECONDS if(!M.IsStun() && !M.IsParalyzed() && !isxenoqueen(M)) //Prevent chain stunning. Queen is protected. M.apply_effects(stun,weaken) diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm index a2ba9edcef178..883d01e627527 100644 --- a/code/game/objects/structures/fence.dm +++ b/code/game/objects/structures/fence.dm @@ -86,7 +86,7 @@ if(GRAB_AGGRESSIVE) M.visible_message(span_danger("[user] bashes [M] against \the [src]!")) if(prob(50)) - M.Paralyze(20) + M.Paralyze(2 SECONDS) M.apply_damage(10, blocked = MELEE) UPDATEHEALTH(M) take_damage(25) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 7abadbf406cf0..70d924ae3261c 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -235,9 +235,9 @@ var/def_zone = ran_zone() var/armor_modifier = occupant.modify_by_armor(1, MELEE, 0, def_zone) occupant.throw_at(A, 3, propelled) - occupant.apply_effect(6 * armor_modifier, STUN) - occupant.apply_effect(6 * armor_modifier, WEAKEN) - occupant.apply_effect(6 * armor_modifier, STUTTER) + occupant.apply_effect(12 SECONDS * armor_modifier, STUN) + occupant.apply_effect(12 SECONDS * armor_modifier, WEAKEN) + occupant.apply_effect(12 SECONDS * armor_modifier, STUTTER) occupant.apply_damage(10 * armor_modifier, BRUTE, def_zone) UPDATEHEALTH(occupant) playsound(src.loc, 'sound/weapons/punch1.ogg', 25, 1) @@ -245,9 +245,9 @@ var/mob/living/victim = A def_zone = ran_zone() armor_modifier = victim.modify_by_armor(1, MELEE, 0, def_zone) - victim.apply_effect(6 * armor_modifier, STUN) - victim.apply_effect(6 * armor_modifier, WEAKEN) - victim.apply_effect(6 * armor_modifier, STUTTER) + victim.apply_effect(12 SECONDS * armor_modifier, STUN) + victim.apply_effect(12 SECONDS * armor_modifier, WEAKEN) + victim.apply_effect(12 SECONDS * armor_modifier, STUTTER) victim.apply_damage(10 * armor_modifier, BRUTE, def_zone) UPDATEHEALTH(victim) occupant.visible_message(span_danger("[occupant] crashed into \the [A]!")) diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index a5a6a82e160ce..45f2ee2e077fd 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -107,9 +107,9 @@ var/def_zone = ran_zone() var/armor_modifier = occupant.modify_by_armor(1, MELEE, 0, def_zone) occupant.throw_at(A, 3, propelled) - occupant.apply_effect(6 * armor_modifier, STUN) - occupant.apply_effect(6 * armor_modifier, WEAKEN) - occupant.apply_effect(6 * armor_modifier, STUTTER) + occupant.apply_effect(12 SECONDS * armor_modifier, STUN) + occupant.apply_effect(12 SECONDS * armor_modifier, WEAKEN) + occupant.apply_effect(12 SECONDS * armor_modifier, STUTTER) occupant.apply_damage(10 * armor_modifier, BRUTE, def_zone) UPDATEHEALTH(occupant) playsound(src.loc, 'sound/weapons/punch1.ogg', 25, 1) @@ -117,9 +117,9 @@ var/mob/living/victim = A def_zone = ran_zone() armor_modifier = victim.modify_by_armor(1, MELEE, 0, def_zone) - victim.apply_effect(6 * armor_modifier, STUN) - victim.apply_effect(6 * armor_modifier, WEAKEN) - victim.apply_effect(6 * armor_modifier, STUTTER) + victim.apply_effect(12 SECONDS * armor_modifier, STUN) + victim.apply_effect(12 SECONDS * armor_modifier, WEAKEN) + victim.apply_effect(12 SECONDS * armor_modifier, STUTTER) victim.apply_damage(10 * armor_modifier, BRUTE, def_zone) UPDATEHEALTH(victim) occupant.visible_message(span_danger("[occupant] crashed into \the [A]!")) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 7613f2ff26a12..0f4b0f76e6015 100755 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -130,7 +130,7 @@ M.visible_message(span_danger("[user] bashes [M] against \the [src]!")) log_combat(user, M, "bashed", "", "against \the [src]") if(prob(50)) - M.Paralyze(20) + M.Paralyze(2 SECONDS) M.apply_damage(10, blocked = MELEE) UPDATEHEALTH(M) take_damage(25, BRUTE, MELEE) diff --git a/code/game/objects/structures/window_frame.dm b/code/game/objects/structures/window_frame.dm index 92cdc13bb75ee..f1a924c04e502 100755 --- a/code/game/objects/structures/window_frame.dm +++ b/code/game/objects/structures/window_frame.dm @@ -105,7 +105,7 @@ var/oldloc = loc if(!do_mob(user, M, 20, BUSY_ICON_GENERIC) || loc != oldloc) return - M.Paralyze(40) + M.Paralyze(4 SECONDS) user.visible_message(span_warning("[user] pulls [M] onto [src]."), span_notice("You pull [M] onto [src].")) M.forceMove(loc) diff --git a/code/modules/admin/smites/knot_shoes.dm b/code/modules/admin/smites/knot_shoes.dm index 37ebb280db3bb..537eb82ee62fd 100644 --- a/code/modules/admin/smites/knot_shoes.dm +++ b/code/modules/admin/smites/knot_shoes.dm @@ -12,14 +12,14 @@ to_chat(user, span_warning("[target] does not have knottable shoes!"), confidential = TRUE) return if (sick_kicks.tied == SHOES_TIED) //if tied knot the shoes of our victim - sick_kicks.adjust_laces(SHOES_KNOTTED) + sick_kicks.adjust_laces(SHOES_KNOTTED) else //If we're already knotted, revert them back to being tied. Marines aren't smart enough to unknot their own shoes without divine intervention. if (tgui_alert(usr, "Unknot the shoes of [target]?", "Continue?", list("Yes", "No")) != "Yes") return sick_kicks.adjust_laces(SHOES_TIED) to_chat(target, span_warning("Your knotted shoelaces unravel again as a divine force washes over them."), confidential = TRUE) -/obj/item/clothing/shoes/proc/adjust_laces(state, mob/user) //adjust the state of target shoes to be tied/untied +/obj/item/clothing/shoes/proc/adjust_laces(state, mob/user) //adjust the state of target shoes to be tied/untied if(!can_be_tied) return tied = state @@ -27,7 +27,7 @@ UnregisterSignal(src, COMSIG_SHOES_STEP_ACTION) else RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, PROC_REF(check_trip), override=TRUE) - + /obj/item/clothing/shoes/proc/check_trip() //check the state of our shoe laces SIGNAL_HANDLER @@ -35,7 +35,7 @@ if(!istype(our_guy)) // are they REALLY /our guy/? return if(tied == SHOES_KNOTTED) - our_guy.Paralyze(10) - our_guy.Knockdown(20) + our_guy.Paralyze(1 SECONDS) + our_guy.Knockdown(2 SECONDS) our_guy.adjustStaminaLoss(10) //smacking into the ground drains energy our_guy.visible_message(span_danger("[our_guy] trips on [our_guy.p_their()] knotted shoelaces and falls! What a klutz!"), span_userdanger("You trip on your knotted shoelaces and smack into the ground!")) diff --git a/code/modules/admin/smites/lightning.dm b/code/modules/admin/smites/lightning.dm index fc33d84538837..26eb826f88ca2 100644 --- a/code/modules/admin/smites/lightning.dm +++ b/code/modules/admin/smites/lightning.dm @@ -12,7 +12,7 @@ playsound(get_turf(lightning_source), 'sound/effects/lightningbolt.ogg', 50, TRUE, 10) if(ishuman(target)) //knockdown and make humans jitter after being struck by lightning var/mob/living/carbon/human/human_target = target - human_target.Knockdown(100) + human_target.Knockdown(10 SECONDS) human_target.jitter(150) to_chat(target, span_userdanger("The gods have punished you for your sins!"), confidential = TRUE) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index e3dec349ad11e..6000955237a47 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -48,11 +48,11 @@ if("feet") if(!H.shoes) affecting = H.get_limb(pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) - H.Paralyze(60) + H.Paralyze(6 SECONDS) if(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND) if(!H.gloves) affecting = H.get_limb(type) - H.Stun(60) + H.Stun(6 SECONDS) affecting?.take_damage_limb(1, 0) else if(ismouse(target)) var/mob/living/simple_animal/mouse/M = target diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm index 8767ee3604693..f97471464857b 100644 --- a/code/modules/hydroponics/grown_inedible.dm +++ b/code/modules/hydroponics/grown_inedible.dm @@ -156,8 +156,8 @@ M.adjust_blurriness(force/7) if(prob(20)) - M.Unconscious(force/6 *20) - M.Paralyze(force/15 *20) + M.Unconscious(force/3 SECONDS) + M.Paralyze(force/7.5 SECONDS) M.drop_held_item() /obj/item/corncob diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index e6298ecd72eb2..a8b2d524bf96f 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -58,7 +58,7 @@ if(prob(10) && stat == UNCONSCIOUS) adjustToxLoss(1) if(prob(15)) - Unconscious(rand(20,60)) + Unconscious(rand(2 SECONDS,6 SECONDS)) var/word = pick("dizzy","woozy","faint") to_chat(src, span_warning("You feel extremely [word]")) if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7c19dd1bcf265..f07ef0c561cdb 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -77,7 +77,7 @@ /mob/living/carbon/proc/do_vomit() - adjust_stagger(3) + adjust_stagger(3 SECONDS) add_slowdown(3) visible_message("[src] throws up!","You throw up!", null, 5) @@ -110,12 +110,12 @@ shaker.visible_message("[shaker] shakes [src] trying to get [p_them()] up!", "You shake [src] trying to get [p_them()] up!", null, 4) - AdjustUnconscious(-60) - AdjustStun(-60) + AdjustUnconscious(-6 SECONDS) + AdjustStun(-6 SECONDS) if(IsParalyzed()) if(staminaloss) adjustStaminaLoss(-20, FALSE) - AdjustParalyzed(-60) + AdjustParalyzed(-6 SECONDS) playsound(loc, 'sound/weapons/thudswoosh.ogg', 25, TRUE, 5) return diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index ea0ea99beec98..6596e296d466b 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -68,7 +68,7 @@ . = ..() if(!.) return - user.Unconscious(40) + user.Unconscious(4 SECONDS) /datum/emote/living/carbon/human/cough @@ -115,7 +115,7 @@ . = ..() if(!.) return - user.AdjustSleeping(10) + user.AdjustSleeping(1 SECONDS) /datum/emote/living/carbon/human/frown diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fa1cf9a88fcf4..a9a00a582fe9d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -157,7 +157,7 @@ if(!istype(wear_ear, /obj/item/clothing/ears/earmuffs)) adjust_ear_damage(ear_damage_amount * armor_modifier, ear_damage_amount * 4 * armor_modifier) - adjust_stagger(stagger_slow_amount * armor_modifier) + adjust_stagger(stagger_slow_amount SECONDS * armor_modifier) add_slowdown(stagger_slow_amount * armor_modifier) #ifdef DEBUG_HUMAN_ARMOR diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index e89a1a80580bc..1819310ef916b 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -118,7 +118,7 @@ var/list/hit_report = list() if(damage >= 5 && prob(50)) visible_message(span_danger("[H] has weakened [src]!"), null, null, 5) - apply_effect(modify_by_armor(3, MELEE, def_zone = target_zone), WEAKEN) + apply_effect(modify_by_armor(6 SECONDS, MELEE, def_zone = target_zone), WEAKEN) hit_report += "(KO)" damage += attack.damage @@ -165,7 +165,7 @@ var/randn = rand(1, 100) + skills.getRating(SKILL_CQC) * 5 - H.skills.getRating(SKILL_CQC) * 5 if (randn <= 25) - apply_effect(modify_by_armor(3, MELEE, def_zone = target_zone), WEAKEN) + apply_effect(modify_by_armor(6 SECONDS, MELEE, def_zone = target_zone), WEAKEN) playsound(loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) visible_message(span_danger("[H] has pushed [src]!"), null, null, 5) log_combat(user, src, "pushed") diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index cf3aacbecc906..3659d92cd9221 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -4,34 +4,6 @@ Contains most of the procs that are called when a mob is attacked by something //#define DEBUG_HUMAN_EXPLOSIONS -/mob/living/carbon/human/stun_effect_act(stun_amount, agony_amount, def_zone) - var/datum/limb/affected = get_limb(check_zone(def_zone)) - var/siemens_coeff = get_siemens_coefficient_organ(affected) - stun_amount *= siemens_coeff - agony_amount *= siemens_coeff - - switch (def_zone) - if("head") - agony_amount *= 1.50 - if("l_hand", "r_hand") - var/c_hand - if (def_zone == "l_hand") - c_hand = l_hand - else - c_hand = r_hand - - if(c_hand && (stun_amount || agony_amount > 10)) - - dropItemToGround(c_hand) - if (affected.limb_status & LIMB_ROBOT) - emote("me", 1, "drops what they were holding, [p_their()] [affected.display_name] malfunctioning!") - else - var/emote_scream = pick("screams in pain and", "lets out a sharp cry and", "cries out and") - emote("me", 1, "[(species?.species_flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in [p_their()] [affected.display_name]!") - - return ..() - - //this proc returns the Siemens coefficient of electrical resistivity for a particular external organ. /mob/living/carbon/human/proc/get_siemens_coefficient_organ(datum/limb/def_zone) if (!def_zone) @@ -200,7 +172,7 @@ Contains most of the procs that are called when a mob is attacked by something switch(hit_area) if("head")//Harder to score a stun but if you do it lasts a bit longer if(prob(applied_damage) && stat == CONSCIOUS) - apply_effect(modify_by_armor(10, MELEE, def_zone = target_zone), WEAKEN) + apply_effect(modify_by_armor(20 SECONDS, MELEE, def_zone = target_zone), WEAKEN) visible_message(span_danger("[src] has been knocked unconscious!"), span_danger("You have been knocked unconscious!"), null, 5) hit_report += "(KO)" @@ -218,7 +190,7 @@ Contains most of the procs that are called when a mob is attacked by something if("chest")//Easier to score a stun but lasts less time if(prob((applied_damage + 5)) && !incapacitated()) - apply_effect(modify_by_armor(6, MELEE, def_zone = target_zone), WEAKEN) + apply_effect(modify_by_armor(12 SECONDS, MELEE, def_zone = target_zone), WEAKEN) visible_message(span_danger("[src] has been knocked down!"), span_danger("You have been knocked down!"), null, 5) hit_report += "(KO)" @@ -397,7 +369,7 @@ Contains most of the procs that are called when a mob is attacked by something Stun(stun_duration) Paralyze(stun_duration) //15 Next to queen , 3 at max distance. - adjust_stagger(LERP(7, 3, dist_pct) * reduction) + adjust_stagger(LERP(7, 3, dist_pct) * reduction SECONDS) //Max 140 under Queen, 130 beside Queen, 70 at the edge. Reduction of 10 per tile distance from Queen. apply_damage(LERP(140, 70, dist_pct) * reduction, STAMINA, updating_health = TRUE) if(!ear_deaf) diff --git a/code/modules/mob/living/carbon/human/life/handle_shock.dm b/code/modules/mob/living/carbon/human/life/handle_shock.dm index 2e59aed7450e9..abe2c45c42849 100644 --- a/code/modules/mob/living/carbon/human/life/handle_shock.dm +++ b/code/modules/mob/living/carbon/human/life/handle_shock.dm @@ -22,35 +22,35 @@ to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) blur_eyes(1) set_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) - adjust_stagger(1, FALSE, 1) + Stagger(1 SECONDS) add_slowdown(1) if(60 to 79) if(!lying_angle && prob(20)) emote("me", 1, " is having trouble standing.") blur_eyes(2) set_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) - adjust_stagger(3, FALSE, 3) + Stagger(3 SECONDS) add_slowdown(3) if(prob(20)) to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) if(80 to 119) blur_eyes(2) set_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) - adjust_stagger(6, FALSE, 6) + Stagger(6 SECONDS) add_slowdown(6) if(prob(20)) to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb")]!")) if(120 to 149) blur_eyes(2) set_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) - adjust_stagger(9, FALSE, 9) + Stagger(9 SECONDS) add_slowdown(9) if(prob(20)) to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb", "You feel like you could die any moment now")]!")) if(150 to INFINITY) blur_eyes(2) set_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter, only_if_higher = TRUE) - adjust_stagger(12, FALSE, 12) + Stagger(12 SECONDS) add_slowdown(12) if(prob(20)) to_chat(src, span_danger("[pick("The pain is excruciating", "Please, just end the pain", "Your whole body is going numb", "You feel like you could die any moment now")]!")) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 2efe4f674c632..707a0517026f1 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -478,7 +478,7 @@ H.clear_fullscreen("robotlow") if(H.health > -25) //Staggerslowed if below crit threshold. return - H.adjust_stagger(2, capped = 10) + H.Stagger(2 SECONDS) H.adjust_slowdown(1) ///Lets a robot repair itself over time at the cost of being stunned and blind diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index e9981e1a2e8c0..2c363c84446b9 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -84,7 +84,7 @@ adjustDrowsyness(-restingpwr) blur_eyes(2) if(drowsyness > 18 && prob(5)) - Sleeping(20) + Sleeping(2 SECONDS) Unconscious(10 SECONDS) if(jitteriness) @@ -103,7 +103,7 @@ handle_dreams() if(mind) if((mind.active && client != null) || immune_to_ssd) //This also checks whether a client is connected, if not, sleep is not reduced. - AdjustSleeping(-20) + AdjustSleeping(-2 SECONDS) if(!isxeno(src)) if(prob(2) && health && !hallucination) emote("snore") @@ -120,7 +120,7 @@ if(drunkenness >= 41) if(prob(25)) - AdjustConfused(40) + AdjustConfused(4 SECONDS) if(dizziness < 450) // To avoid giving the player overly dizzy too dizzy(8) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/beetle/beetle.dm b/code/modules/mob/living/carbon/xenomorph/castes/beetle/beetle.dm index 1220ad7eb1317..8912a9facb22a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/beetle/beetle.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/beetle/beetle.dm @@ -24,4 +24,4 @@ var/target_turf = get_step_away(src, H, rand(1, 2)) //This is where we blast our target target_turf = get_step_rand(target_turf) //Scatter H.throw_at(get_turf(target_turf), 4, 70, H) - H.Paralyze(20) + H.Paralyze(2 SECONDS) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm index fd0e4af86df5d..12b4d1f0eaf47 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/abilities_carrier.dm @@ -407,8 +407,8 @@ GLOBAL_LIST_INIT(hugger_images_list, list( victim.visible_message(span_xenowarning("\The [victim] loses his balance, falling to the side!"), \ span_xenowarning("You feel like something inside you is tearing out!")) - victim.apply_effects(1, 0.5) - victim.adjust_stagger(debuff) + victim.apply_effects(2 SECONDS, 1 SECONDS) + victim.adjust_stagger(debuff SECONDS) victim.adjust_slowdown(debuff) victim.apply_damage(stamina_dmg, STAMINA) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/defender/abilities_defender.dm b/code/modules/mob/living/carbon/xenomorph/castes/defender/abilities_defender.dm index 6074fbf892823..2be054fb1c6e0 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/defender/abilities_defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/defender/abilities_defender.dm @@ -48,7 +48,7 @@ affecting = H.get_limb("chest") //Gotta have a torso?! H.apply_damage(damage, BRUTE, affecting, MELEE) H.apply_damage(damage, STAMINA, updating_health = TRUE) - H.Paralyze(5) //trip and go + H.Paralyze(0.5 SECONDS) //trip and go GLOB.round_statistics.defender_tail_sweep_hits++ SSblackbox.record_feedback("tally", "round_statistics", 1, "defender_tail_sweep_hits") shake_camera(H, 2, 1) @@ -450,7 +450,7 @@ affecting = slapped.get_limb("chest") slapped.apply_damage(damage, BRUTE, affecting, MELEE) slapped.apply_damage(damage, STAMINA, updating_health = TRUE) - slapped.Paralyze(3) + slapped.Paralyze(0.3 SECONDS) shake_camera(slapped, 2, 1) to_chat(slapped, span_xenowarning("We are struck by \the [X]'s flying tail!")) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/defender/defender.dm b/code/modules/mob/living/carbon/xenomorph/castes/defender/defender.dm index 8610d57aa221e..824e5dff0d307 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/defender/defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/defender/defender.dm @@ -59,7 +59,7 @@ var/target_turf = get_step_away(src, H, rand(1, 2)) //This is where we blast our target target_turf = get_step_rand(target_turf) //Scatter H.throw_at(get_turf(target_turf), 4, 70, H) - H.Paralyze(40) + H.Paralyze(4 SECONDS) /mob/living/carbon/xenomorph/defender/Initialize(mapload) . = ..() diff --git a/code/modules/mob/living/carbon/xenomorph/castes/defiler/abilities_defiler.dm b/code/modules/mob/living/carbon/xenomorph/castes/defiler/abilities_defiler.dm index c07b46742e6ee..b2dc7f76b3f62 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/defiler/abilities_defiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/defiler/abilities_defiler.dm @@ -207,7 +207,7 @@ add_cooldown() succeed_activate() - if(X.stagger) //If we got staggered, return + if(X.IsStaggered()) //If we got staggered, return to_chat(X, span_xenowarning("We try to emit toxins but are staggered!")) return fail_activate() @@ -239,7 +239,7 @@ if(/datum/reagent/toxin/xeno_ozelomelyn) emitted_gas = new /datum/effect_system/smoke_spread/xeno/ozelomelyn(defiler_owner) - if(defiler_owner.stagger) //If we got staggered, return + if(defiler_owner.IsStaggered()) //If we got staggered, return to_chat(defiler_owner, span_xenowarning("We try to emit toxins but are staggered!")) toggle_particles(FALSE) return @@ -581,8 +581,8 @@ target.throw_at(owner, TENTACLE_ABILITY_RANGE, 1, owner, FALSE) if(isliving(target)) var/mob/living/loser = target - loser.apply_effects(weaken = 0.1) - loser.adjust_stagger(5) + loser.apply_effect(0.2 SECONDS, WEAKEN) + loser.adjust_stagger(5 SECONDS) ///signal handler to delete tetacle after we are done draggging owner along /datum/action/xeno_action/activable/tentacle/proc/delete_beam(datum/source, atom/impacted) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/hunter/abilities_hunter.dm b/code/modules/mob/living/carbon/xenomorph/castes/hunter/abilities_hunter.dm index efbd7f8c5be16..3837bba64fc54 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/hunter/abilities_hunter.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/hunter/abilities_hunter.dm @@ -160,7 +160,7 @@ if(M.stat || isxeno(M)) return if(can_sneak_attack) - M.adjust_stagger(3) + M.adjust_stagger(3 SECONDS) M.add_slowdown(1) to_chat(owner, span_xenodanger("Pouncing from the shadows, we stagger our victim.")) @@ -180,7 +180,7 @@ owner.visible_message(span_danger("\The [owner] strikes [target] with [flavour] precision!"), \ span_danger("We strike [target] with [flavour] precision!")) - target.adjust_stagger(staggerslow_stacks) + target.adjust_stagger(staggerslow_stacks SECONDS) target.add_slowdown(staggerslow_stacks) target.ParalyzeNoChain(1 SECONDS) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/king/abilities_king.dm b/code/modules/mob/living/carbon/xenomorph/castes/king/abilities_king.dm index 9a98fcf9ede26..1fe42875e3136 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/king/abilities_king.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/king/abilities_king.dm @@ -257,10 +257,10 @@ continue carbon_victim.apply_damage(SHATTERING_ROAR_DAMAGE * severity, BRUTE, blocked = MELEE) carbon_victim.apply_damage(SHATTERING_ROAR_DAMAGE * severity, STAMINA) - carbon_victim.adjust_stagger(6 * severity) + carbon_victim.adjust_stagger(6 SECONDS * severity) carbon_victim.add_slowdown(6 * severity) shake_camera(carbon_victim, 3 * severity, 3 * severity) - carbon_victim.apply_effect(0.5, WEAKEN) + carbon_victim.apply_effect(1 SECONDS, WEAKEN) to_chat(carbon_victim, "You are smashed to the ground!") else if(ismecha(victim)) var/obj/vehicle/sealed/mecha/mecha_victim = victim diff --git a/code/modules/mob/living/carbon/xenomorph/castes/runner/abilities_runner.dm b/code/modules/mob/living/carbon/xenomorph/castes/runner/abilities_runner.dm index 6258d8b017d0d..cef7c4e091840 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/runner/abilities_runner.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/runner/abilities_runner.dm @@ -38,7 +38,7 @@ to_chat(src, span_xenowarning("We're too tired to savage right now.")) return - if(stagger) + if(IsStaggered()) to_chat(src, span_xenodanger("We're too disoriented from the shock to savage!")) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/sentinel/abilities_sentinel.dm b/code/modules/mob/living/carbon/xenomorph/castes/sentinel/abilities_sentinel.dm index ca9378c895cba..5663d057d6b7e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/sentinel/abilities_sentinel.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/sentinel/abilities_sentinel.dm @@ -179,7 +179,7 @@ xeno_owner.apply_status_effect(STATUS_EFFECT_DRAIN_SURGE) new /obj/effect/temp_visual/drain_sting_crit(get_turf(xeno_target)) xeno_target.adjustFireLoss(drain_potency / 5) - xeno_target.AdjustKnockdown(max(0.1, debuff.stacks - 10)) + xeno_target.AdjustKnockdown(max(0.1 SECONDS, debuff.stacks - 10)) HEAL_XENO_DAMAGE(xeno_owner, drain_potency, FALSE) xeno_owner.gain_plasma(drain_potency * 3.5) xeno_owner.do_attack_animation(xeno_target, ATTACK_EFFECT_DRAIN_STING) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/shrike/abilities_shrike.dm b/code/modules/mob/living/carbon/xenomorph/castes/shrike/abilities_shrike.dm index 056b1a84cb2ea..b2859e2cb005a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/shrike/abilities_shrike.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/shrike/abilities_shrike.dm @@ -118,7 +118,7 @@ succeed_activate() add_cooldown() if(ishuman(victim)) - victim.apply_effects(1, 0.1) // The fling stuns you enough to remove your gun, otherwise the marine effectively isn't stunned for long. + victim.apply_effects(2 SECONDS, 0.2 SECONDS) // The fling stuns you enough to remove your gun, otherwise the marine effectively isn't stunned for long. shake_camera(victim, 2, 1) var/facing = get_dir(owner, victim) @@ -191,7 +191,7 @@ var/mob/living/carbon/human/H = affected if(H.stat == DEAD) //unless they are dead, then the blast mysteriously ignores them. continue - H.apply_effects(1, 1) // Stun + H.apply_effects(2 SECONDS, 2 SECONDS) // Stun shake_camera(H, 2, 1) var/throwlocation = affected.loc //first we get the target's location for(var/x in 1 to 6) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm b/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm index 511ae2c09349b..124ad88fc9ea0 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm @@ -163,7 +163,7 @@ var/mob/living/carbon/human/H = affected if(H.stat == DEAD) continue - H.apply_effects(0.5, 0.5) + H.apply_effects(1 SECONDS, 1 SECONDS) shake_camera(H, 2, 1) var/throwlocation = affected.loc for(var/x in 1 to 6) @@ -216,11 +216,11 @@ alpha = obj_integrity * 255 / max_integrity if(obj_integrity <= 0) release_projectiles() - owner.apply_effects(weaken = 0.5) + owner.apply_effect(1 SECONDS, WEAKEN) /obj/effect/xeno/shield/obj_destruction() release_projectiles() - owner.apply_effects(weaken = 0.5) + owner.apply_effect(1 SECONDS, WEAKEN) return ..() ///Unfeezes the projectiles on their original path @@ -390,7 +390,7 @@ continue carbon_victim.apply_damage(xeno_owner.xeno_caste.crush_strength, BRUTE, blocked = BOMB) carbon_victim.apply_damage(xeno_owner.xeno_caste.crush_strength * 1.5, STAMINA, blocked = BOMB) - carbon_victim.adjust_stagger(5) + carbon_victim.adjust_stagger(5 SECONDS) carbon_victim.add_slowdown(6) else if(ismecha(victim)) var/obj/vehicle/sealed/mecha/mecha_victim = victim diff --git a/code/modules/mob/living/carbon/xenomorph/castes/warrior/abilities_warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/warrior/abilities_warrior.dm index f4831d5450013..e55c064abce93 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/warrior/abilities_warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/warrior/abilities_warrior.dm @@ -326,7 +326,7 @@ stagger_slow_stacks = 0 stun_duration = 0 - victim.adjust_stagger(stagger_slow_stacks) + victim.adjust_stagger(stagger_slow_stacks SECONDS) victim.add_slowdown(stagger_slow_stacks) victim.adjust_blurriness(stagger_slow_stacks) //Cosmetic eye blur SFX victim.ParalyzeNoChain(stun_duration) @@ -539,7 +539,7 @@ X.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH) X.do_attack_animation(src, ATTACK_EFFECT_DISARM2) - adjust_stagger(stagger_stacks) + adjust_stagger(stagger_stacks SECONDS) add_slowdown(slowdown_stacks) adjust_blurriness(slowdown_stacks) //Cosmetic eye blur SFX diff --git a/code/modules/mob/living/carbon/xenomorph/castes/warrior/warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/warrior/warrior.dm index 83164ed15e297..026d4259eddd1 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/warrior/warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/warrior/warrior.dm @@ -70,7 +70,7 @@ ENABLE_BITFIELD(L.restrained_flags, RESTRAINED_NECKGRAB) RegisterSignal(L, COMSIG_LIVING_DO_RESIST, TYPE_PROC_REF(/atom/movable, resisted_against)) L.drop_all_held_items() - L.Paralyze(1) + L.Paralyze(0.1 SECONDS) visible_message(span_xenowarning("\The [src] grabs [L] by the throat!"), \ span_xenowarning("We grab [L] by the throat!")) return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/charge_crush.dm b/code/modules/mob/living/carbon/xenomorph/charge_crush.dm index 9f88b73f85834..667ea87a8ef66 100644 --- a/code/modules/mob/living/carbon/xenomorph/charge_crush.dm +++ b/code/modules/mob/living/carbon/xenomorph/charge_crush.dm @@ -552,9 +552,9 @@ switch(charge_datum.charge_type) if(CHARGE_CRUSH) - Paralyze(CHARGE_SPEED(charge_datum) * 20) + Paralyze(CHARGE_SPEED(charge_datum) * 2 SECONDS) if(CHARGE_BULL_HEADBUTT) - Paralyze(CHARGE_SPEED(charge_datum) * 25) + Paralyze(CHARGE_SPEED(charge_datum) * 2.5 SECONDS) if(anchored) charge_datum.do_stop_momentum(FALSE) diff --git a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm index 2e114316d5ac4..3ed2f06913892 100644 --- a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm @@ -34,7 +34,7 @@ var/severity_strength = (4 - severity) add_slowdown(max(0, (severity_strength + 2) * bomb_armor_ratio)) //3 slowdown from a light explosion if you have no bomb armour - adjust_stagger(max(0, ((severity_strength + 1) * bomb_armor_ratio) - 1)) //enough armour makes you immune to the stagger + adjust_stagger(max(0, ((severity_strength + 1) SECONDS * bomb_armor_ratio) - 1 SECONDS)) //enough armour makes you immune to the stagger adjust_sunder(max(0, 10 * severity_strength * bomb_armor_ratio)) //Damage diff --git a/code/modules/mob/living/carbon/xenomorph/facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/facehuggers.dm index b81b191eb0d08..3e329561cba90 100644 --- a/code/modules/mob/living/carbon/xenomorph/facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/facehuggers.dm @@ -374,7 +374,7 @@ step(src, REVERSE_DIR(dir)) //We want the hugger to bounce off if it hits a mob. update_icon() if(!issamexenohive(M)) //If the target is not friendly, stagger and slow it, and activate faster. - M.adjust_stagger(3) //Apply stagger and slowdown so the carrier doesn't have to suicide when going for direct hugger hits. + M.adjust_stagger(3 SECONDS) //Apply stagger and slowdown so the carrier doesn't have to suicide when going for direct hugger hits. M.add_slowdown(3) pre_leap(impact_time) //Go into the universal leap set up proc return @@ -757,7 +757,7 @@ if(isxeno(target)) //Xenos aren't affected by sticky resin continue - target.adjust_stagger(3) + target.adjust_stagger(3 SECONDS) target.add_slowdown(15) target.apply_damage(100, STAMINA, BODY_ZONE_HEAD, BIO, updating_health = TRUE) //This should prevent sprinting diff --git a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm index 62c9aee3edc88..87333eb4bb8e7 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm @@ -427,7 +427,7 @@ /mob/living/carbon/human/apply_acid_spray_damage(damage) take_overall_damage(damage, BURN, ACID, updating_health = TRUE) emote("scream") - Paralyze(20) + Paralyze(2 SECONDS) /mob/living/carbon/xenomorph/acid_spray_act(mob/living/carbon/xenomorph/X) ExtinguishMob() @@ -472,7 +472,7 @@ playsound(C, "alien_drool", 15, TRUE) do face_atom(C) - if(stagger) + if(IsStaggered()) return FALSE do_attack_animation(C) C.reagents.add_reagent(toxin, transfer_amount) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index edbbfe466659c..c5b9bafbad749 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -82,54 +82,56 @@ Apply status effect to mob Arguments - effect {int} how much of an effect to apply - effecttype {enum} which affect to apply - blocked {int} an amount of the effect that is blocked - updating_health {boolean} if we should update health [/mob/living/updatehealth] + *effect: duration or amount of effect + *effecttype which affect to apply + *updating_health if we should update health [/mob/living/updatehealth] */ -/mob/living/proc/apply_effect(effect = 0, effecttype = STUN, blocked = 0, updating_health = FALSE) +/mob/living/proc/apply_effect(effect = 0, effecttype = STUN, updating_health = FALSE) if(status_flags & GODMODE) return FALSE - if(!effect || (blocked >= 2)) + if(effect <= 0) return FALSE + switch(effecttype) if(STUN) - Stun(effect/(blocked+1) * 20) // TODO: replace these * 20 with proper amounts in apply_effect() calls + Stun(effect) if(WEAKEN) - Paralyze(effect/(blocked+1) * 20) + Paralyze(effect) if(PARALYZE) - Unconscious(effect/(blocked+1) * 20) + Unconscious(effect) + if(STAGGER) + Stagger(effect) if(AGONY) - adjustStaminaLoss(effect/(blocked+1)) + adjustStaminaLoss(effect) if(STUTTER) if(status_flags & CANSTUN) // stun is usually associated with stutter - set_timed_status_effect(effect/(blocked+1), /datum/status_effect/speech/stutter, only_if_higher = TRUE) + set_timed_status_effect(effect, /datum/status_effect/speech/stutter, only_if_higher = TRUE) if(EYE_BLUR) - blur_eyes(effect/(blocked+1)) + blur_eyes(effect) if(DROWSY) - adjustDrowsyness(effect / (blocked + 1)) + adjustDrowsyness(effect) if(updating_health) updatehealth() return TRUE - -/mob/living/proc/apply_effects(stun = 0, weaken = 0, paralyze = 0, stutter = 0, eyeblur = 0, drowsy = 0, agony = 0, blocked = 0, updating_health = FALSE) - if(blocked >= 2) - return FALSE +///Applies multiple negative effects to a mob +/mob/living/proc/apply_effects(stun = 0, weaken = 0, paralyze = 0, stagger = 0,stutter = 0, eyeblur = 0, drowsy = 0, agony = 0, updating_health = FALSE) if(stun) - apply_effect(stun, STUN, blocked) + apply_effect(stun, STUN) if(weaken) - apply_effect(weaken, WEAKEN, blocked) + apply_effect(weaken, WEAKEN) if(paralyze) - apply_effect(paralyze, PARALYZE, blocked) + apply_effect(paralyze, PARALYZE) + if(stagger) + apply_effect(stagger, STAGGER) if(stutter) - apply_effect(stutter, STUTTER, blocked) + apply_effect(stutter, STUTTER) if(eyeblur) - apply_effect(eyeblur, EYE_BLUR, blocked) + apply_effect(eyeblur, EYE_BLUR) if(drowsy) - apply_effect(drowsy, DROWSY, blocked) + apply_effect(drowsy, DROWSY) if(agony) - apply_effect(agony, AGONY, blocked) + apply_effect(agony, AGONY) if(updating_health) updatehealth() return TRUE diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a131207c68380..f930ee9c9763a 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -18,7 +18,6 @@ handle_drugged() handle_slowdown() - handle_stagger() ///Adjusts our stats based on the auras we've received and care about, then cleans out the list for next tick. /mob/living/proc/finish_aura_cycle() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 64d4039af217b..ab26b51fdfe2c 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -1,30 +1,3 @@ -//Handles the effects of "stun" weapons -/** - stun_effect_act(stun_amount, agony_amount, def_zone) - - Handle the effects of a "stun" weapon - - Arguments - stun_amount {int} applied as Stun and Paralyze - def_zone {enum} which body part to target -*/ -/mob/living/proc/stun_effect_act(stun_amount, agony_amount, def_zone) - if(status_flags & GODMODE) - return FALSE - - flash_pain() - - if(stun_amount) - Stun(stun_amount * 20) // TODO: replace these amounts in stun_effect_stun() calls - Paralyze(stun_amount * 20) - apply_effect(STUTTER, stun_amount) - apply_effect(EYE_BLUR, stun_amount) - - if(agony_amount) - apply_effect(STUTTER, agony_amount/10) - apply_effect(EYE_BLUR, agony_amount/10) - - /mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0) return 0 //only carbon liveforms have this proc @@ -216,7 +189,7 @@ /mob/living/proc/resist_fire(datum/source) SIGNAL_HANDLER fire_stacks = max(fire_stacks - rand(3, 6), 0) - Paralyze(30) + Paralyze(3 SECONDS) var/turf/T = get_turf(src) if(istype(T, /turf/open/floor/plating/ground/snow)) visible_message(span_danger("[src] rolls in the snow, putting themselves out!"), \ @@ -298,8 +271,8 @@ adjustCloneLoss(rad_strength) adjustStaminaLoss(rad_strength * 7) - adjust_stagger(rad_strength / 2) - add_slowdown(rad_strength / 2) + adjust_stagger(rad_strength SECONDS * 0.5) + add_slowdown(rad_strength * 0.5) blur_eyes(rad_strength) //adds a visual indicator that you've just been irradiated adjust_radiation(rad_strength * 20) //Radiation status effect, duration is in deciseconds to_chat(src, span_warning("Your body tingles as you suddenly feel the strength drain from your body!")) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 76aab9b24f02e..81d8818867013 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -134,11 +134,8 @@ /// How much friendly fire damage has this mob done in the last 30 seconds. var/list/friendly_fire = list() - ///Stagger and slow vars; Stagger penalizes projectile damage for non-Xenos and disables ability use for Xenos. Slowdown is obvious. ///Temporary penalty on movement. Regenerates each tick. var/slowdown = 0 - ///Temporary inability to use special actions; hurts projectile damage. Regenerates each tick. - var/stagger = 0 ///Id of the timer to set the afk status to MOB_DISCONNECTED var/afk_timer_id ///If this mob is afk diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 1e102a1dd9585..dc6594737723e 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -100,7 +100,7 @@ span_warning("You slump to the ground, you're too exhausted to keep going...")) ParalyzeNoChain(1 SECONDS) //Short stun - adjust_stagger(STAMINA_EXHAUSTION_DEBUFF_STACKS) + adjust_stagger(STAMINA_EXHAUSTION_STAGGER_DURATION) add_slowdown(STAMINA_EXHAUSTION_DEBUFF_STACKS) adjust_blurriness(STAMINA_EXHAUSTION_DEBUFF_STACKS) COOLDOWN_START(src, last_stamina_exhaustion, LIVING_STAMINA_EXHAUSTION_COOLDOWN) //set the cooldown. @@ -287,6 +287,7 @@ set_blurriness(0, TRUE) set_ear_damage(0, 0) heal_overall_damage(getBruteLoss(), getFireLoss(), robo_repair = TRUE) + set_slowdown(0) // fix all of our organs restore_all_organs() @@ -367,9 +368,7 @@ /mob/living/carbon/xenomorph/revive(admin_revive = FALSE) plasma_stored = xeno_caste.plasma_max - set_stagger(0) sunder = 0 - set_slowdown(0) if(stat == DEAD) hive?.on_xeno_revive(src) return ..() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 7cce15877e1ca..128a2e40eade0 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -86,12 +86,7 @@ to_chat(src, span_warning("Warning: Electromagnetic pulse detected.")) return ..() - -/mob/living/silicon/stun_effect_act(stun_amount, agony_amount, def_zone) - return - - -/mob/living/silicon/apply_effect(effect = 0, effecttype = STUN, blocked = 0, updating_health = FALSE) +/mob/living/silicon/apply_effect(effect = 0, effecttype = STUN, updating_health = FALSE) return FALSE diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 1017b7385d588..11ec9b77c9c4a 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -1,144 +1,165 @@ ////////////////////////////// STUN //////////////////////////////////// -/mob/living/proc/IsStun() //If we're stunned +///Returns if stunned +/mob/living/proc/IsStun() return has_status_effect(STATUS_EFFECT_STUN) -/mob/living/proc/AmountStun() //How many deciseconds remain in our stun - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(S) - return S.duration - world.time - return 0 +///Returns remaining stun duration +/mob/living/proc/AmountStun() + var/datum/status_effect/incapacitating/stun/current_stun = IsStun() + return current_stun ? current_stun.duration - world.time : 0 -/mob/living/proc/Stun(amount, ignore_canstun = FALSE) //Can't go below remaining duration +///Applies stun from current world time unless existing duration is higher +/mob/living/proc/Stun(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(S) - S.duration = max(world.time + amount, S.duration) - else if(amount > 0) - S = apply_status_effect(STATUS_EFFECT_STUN, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return -/mob/living/proc/SetStun(amount, ignore_canstun = FALSE) //Sets remaining duration + var/datum/status_effect/incapacitating/stun/current_stun = IsStun() + if(current_stun) + current_stun.duration = max(world.time + amount, current_stun.duration) + else if(amount > 0) + current_stun = apply_status_effect(STATUS_EFFECT_STUN, amount) + + return current_stun + +///Used to set stun to a set amount, commonly to remove it +/mob/living/proc/SetStun(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/stun/current_stun = IsStun() + if(amount <= 0) + if(current_stun) + qdel(current_stun) + return if(status_flags & GODMODE) return + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(amount <= 0) - if(S) - qdel(S) - else - if(absorb_stun(amount, ignore_canstun)) - return - if(S) - S.duration = world.time + amount - else - S = apply_status_effect(STATUS_EFFECT_STUN, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return + + if(current_stun) + current_stun.duration = world.time + amount + else + current_stun = apply_status_effect(STATUS_EFFECT_STUN, amount) + + return current_stun -/mob/living/proc/AdjustStun(amount, ignore_canstun = FALSE) //Adds to remaining duration +///Applies stun or adds to existing duration +/mob/living/proc/AdjustStun(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(S) - S.duration += amount - else if(amount > 0) - S = apply_status_effect(STATUS_EFFECT_STUN, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return -///////////////////////////////// KNOCKDOWN ///////////////////////////////////// + var/datum/status_effect/incapacitating/stun/current_stun = IsStun() + if(current_stun) + current_stun.duration += amount + else if(amount > 0) + current_stun = apply_status_effect(STATUS_EFFECT_STUN, amount) -/mob/living/proc/IsKnockdown() //If we're knocked down + return current_stun + +///////////////////////////////// KNOCKDOWN ///////////////////////////////////// +///Returns if knockeddown +/mob/living/proc/IsKnockdown() return has_status_effect(STATUS_EFFECT_KNOCKDOWN) -/mob/living/proc/AmountKnockdown() //How many deciseconds remain in our knockdown - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(K) - return K.duration - world.time - return 0 +///Returns remaining knockdown duration +/mob/living/proc/AmountKnockdown() + var/datum/status_effect/incapacitating/knockdown/current_knockdown = IsKnockdown() + return current_knockdown ? current_knockdown.duration - world.time : 0 -/mob/living/proc/KnockdownNoChain(amount, ignore_canstun = FALSE) // knockdown only if not already knockeddown +///Applies knockdown only if not currently applied +/mob/living/proc/KnockdownNoChain(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return if(IsKnockdown()) return 0 return Knockdown(amount, ignore_canstun) -/mob/living/proc/Knockdown(amount, ignore_canstun = FALSE) //Can't go below remaining duration +///Applies knockdown from current world time unless existing duration is higher +/mob/living/proc/Knockdown(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(K) - K.duration = max(world.time + amount, K.duration) - else if(amount > 0) - K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) - return K + if(absorb_stun(amount, ignore_canstun)) + return -/mob/living/proc/SetKnockdown(amount, ignore_canstun = FALSE) //Sets remaining duration + var/datum/status_effect/incapacitating/knockdown/current_knockdown = IsKnockdown() + if(current_knockdown) + current_knockdown.duration = max(world.time + amount, current_knockdown.duration) + else if(amount > 0) + current_knockdown = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) + + return current_knockdown + +///Used to set knockdown to a set amount, commonly to remove it +/mob/living/proc/SetKnockdown(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/knockdown/current_knockdown = IsKnockdown() + if(amount <= 0) + if(current_knockdown) + qdel(current_knockdown) + return if(status_flags & GODMODE) return + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(amount <= 0) - if(K) - qdel(K) - else - if(absorb_stun(amount, ignore_canstun)) - return - if(K) - K.duration = world.time + amount - else - K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) - return K + if(absorb_stun(amount, ignore_canstun)) + return + + if(current_knockdown) + current_knockdown.duration = world.time + amount + else + current_knockdown = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) -/mob/living/proc/AdjustKnockdown(amount, ignore_canstun = FALSE) //Adds to remaining duration + return current_knockdown + +///Applies knockdown or adds to existing duration +/mob/living/proc/AdjustKnockdown(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(K) - K.duration += amount - else if(amount > 0) - K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) - return K + if(absorb_stun(amount, ignore_canstun)) + return -///////////////////////////////// IMMOBILIZED ///////////////////////////////////// + var/datum/status_effect/incapacitating/knockdown/current_knockdown = IsKnockdown() + if(current_knockdown) + current_knockdown.duration += amount + else if(amount > 0) + current_knockdown = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) + + return current_knockdown -///If we're immobilized. +///////////////////////////////// IMMOBILIZED ///////////////////////////////////// +///Returns if immobilized /mob/living/proc/IsImmobilized() return has_status_effect(STATUS_EFFECT_IMMOBILIZED) -///How many deciseconds remain in our Immobilized status effect. +///Returns remaining immobilize duration /mob/living/proc/AmountImmobilized() - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(I) - return I.duration - world.time - return 0 + var/datum/status_effect/incapacitating/immobilized/current_immobilized = IsImmobilized() + return current_immobilized ? current_immobilized.duration - world.time : 0 -///Immobilize only if not already immobilized. +///Applies immobilize only if not currently applied /mob/living/proc/ImmobilizeNoChain(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return @@ -146,89 +167,103 @@ return 0 return Immobilize(amount, ignore_canstun) -///Can't go below remaining duration. +///Applies immobilize from current world time unless existing duration is higher /mob/living/proc/Immobilize(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(I) - I.duration = max(world.time + amount, I.duration) - else if(amount > 0) - I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) - return I + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/immobilized/current_immobilized = IsImmobilized() + if(current_immobilized) + current_immobilized.duration = max(world.time + amount, current_immobilized.duration) + else if(amount > 0) + current_immobilized = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) -///Sets remaining duration. -/mob/living/proc/SetImmobilized(amount, ignore_canstun = FALSE) //Sets remaining duration + return current_immobilized + +///Used to set immobilize to a set amount, commonly to remove it +/mob/living/proc/SetImmobilized(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/immobilized/current_immobilized = IsImmobilized() + if(amount <= 0) + if(current_immobilized) + qdel(current_immobilized) + return if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(amount <= 0) - if(I) - qdel(I) - else - if(absorb_stun(amount, ignore_canstun)) - return - if(I) - I.duration = world.time + amount - else - I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) - return I - -///Adds to remaining duration. + if(absorb_stun(amount, ignore_canstun)) + return + + if(current_immobilized) + current_immobilized.duration = world.time + amount + else + current_immobilized = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) + + return current_immobilized + +///Applies immobilized or adds to existing duration /mob/living/proc/AdjustImmobilized(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(I) - I.duration += amount - else if(amount > 0) - I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) - return I + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/immobilized/current_immobilized = IsImmobilized() + if(current_immobilized) + current_immobilized.duration += amount + else if(amount > 0) + current_immobilized = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) + + return current_immobilized ///////////////////////////////// PARALYZED ////////////////////////////////// -/mob/living/proc/IsParalyzed() //If we're immobilized +///Returns if paralyzed +/mob/living/proc/IsParalyzed() return has_status_effect(STATUS_EFFECT_PARALYZED) -/mob/living/proc/AmountParalyzed() //How many deciseconds remain in our Paralyzed status effect - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(P) - return P.duration - world.time - return 0 +///Returns remaining paralyzed duration +/mob/living/proc/AmountParalyzed() + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = IsParalyzed() + return current_paralyzed ? current_paralyzed.duration - world.time : 0 -/mob/living/proc/ParalyzeNoChain(amount, ignore_canstun = FALSE) // knockdown only if not already knockeddown +///Applies paralyze only if not currently applied +/mob/living/proc/ParalyzeNoChain(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return if(IsParalyzed()) return 0 return Paralyze(amount, ignore_canstun) -/mob/living/proc/Paralyze(amount, ignore_canstun = FALSE) //Can't go below remaining duration +///Applies paralyze from current world time unless existing duration is higher +/mob/living/proc/Paralyze(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(P) - P.duration = max(world.time + amount, P.duration) - else if(amount > 0) - P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) - return P + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = IsParalyzed() + if(current_paralyzed) + current_paralyzed.duration = max(world.time + amount, current_paralyzed.duration) + else if(amount > 0) + current_paralyzed = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) + + return current_paralyzed /mob/living/carbon/Paralyze(amount, ignore_canstun) if(species?.species_flags & PARALYSE_RESISTANT) @@ -238,92 +273,118 @@ amount /= 4 return ..() -/mob/living/proc/SetParalyzed(amount, ignore_canstun = FALSE) //Sets remaining duration +///Used to set paralyzed to a set amount, commonly to remove it +/mob/living/proc/SetParalyzed(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = IsParalyzed() + if(amount <= 0) + if(current_paralyzed) + qdel(current_paralyzed) + return if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(amount <= 0) - if(P) - qdel(P) - else - if(absorb_stun(amount, ignore_canstun)) - return - if(P) - P.duration = world.time + amount - else - P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) - return P + if(absorb_stun(amount, ignore_canstun)) + return + + if(current_paralyzed) + current_paralyzed.duration = world.time + amount + else + current_paralyzed = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) -/mob/living/proc/AdjustParalyzed(amount, ignore_canstun = FALSE) //Adds to remaining duration + return current_paralyzed + +///Applies paralyzed or adds to existing duration +/mob/living/proc/AdjustParalyzed(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(P) - P.duration += amount - else if(amount > 0) - P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) - return P + if(absorb_stun(amount, ignore_canstun)) + return -/////////////////////////////////// SLEEPING //////////////////////////////////// + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = IsParalyzed() + if(current_paralyzed) + current_paralyzed.duration += amount + else if(amount > 0) + current_paralyzed = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) + + return current_paralyzed -/mob/living/proc/IsSleeping() //If we're asleep +/////////////////////////////////// SLEEPING //////////////////////////////////// +///Returns if sleeping +/mob/living/proc/IsSleeping() return has_status_effect(STATUS_EFFECT_SLEEPING) -/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep - var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() - if(S) - return S.duration - world.time - return 0 +///Returns remaining sleeping duration +/mob/living/proc/AmountSleeping() + var/datum/status_effect/incapacitating/sleeping/current_sleeping = IsSleeping() + return current_sleeping ? current_sleeping.duration - world.time : 0 -/mob/living/proc/Sleeping(amount, ignore_canstun = FALSE) //Can't go below remaining duration +///Applies sleeping from current world time unless existing duration is higher +/mob/living/proc/Sleeping(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if(HAS_TRAIT(src, TRAIT_STUNIMMUNE) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() - if(S) - S.duration = max(world.time + amount, S.duration) - else if(amount > 0) - S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/sleeping/current_sleeping = IsSleeping() + if(current_sleeping) + current_sleeping.duration = max(world.time + amount, current_sleeping.duration) + else if(amount > 0) + current_sleeping = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) + + return current_sleeping -/mob/living/proc/SetSleeping(amount, ignore_canstun = FALSE) //Sets remaining duration +///Used to set sleeping to a set amount, commonly to remove it +/mob/living/proc/SetSleeping(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/sleeping/current_sleeping = IsSleeping() + if(amount <= 0) + if(current_sleeping) + qdel(current_sleeping) + return if(status_flags & GODMODE) return + if(HAS_TRAIT(src, TRAIT_STUNIMMUNE) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() - if(amount <= 0) - if(S) - qdel(S) - else if(S) - S.duration = world.time + amount - else - S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return + + if(current_sleeping) + current_sleeping.duration = world.time + amount + else + current_sleeping = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) + + return current_sleeping -/mob/living/proc/AdjustSleeping(amount, ignore_canstun = FALSE) //Adds to remaining duration +///Applies sleeping or adds to existing duration +/mob/living/proc/AdjustSleeping(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if(HAS_TRAIT(src, TRAIT_STUNIMMUNE) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() - if(S) - S.duration += amount - else if(amount > 0) - S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/sleeping/current_sleeping = IsSleeping() + if(current_sleeping) + current_sleeping.duration += amount + else if(amount > 0) + current_sleeping = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) + + return current_sleeping /////////////////////////////////// ADMIN SLEEP //////////////////////////////////// @@ -347,113 +408,146 @@ return S //////////////////UNCONSCIOUS -/mob/living/proc/IsUnconscious() //If we're unconscious +///Returns if unconscious +/mob/living/proc/IsUnconscious() return has_status_effect(STATUS_EFFECT_UNCONSCIOUS) -/mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(U) - return U.duration - world.time - return 0 +///Returns remaining unconscious duration +/mob/living/proc/AmountUnconscious() + var/datum/status_effect/incapacitating/unconscious/current_unconscious = IsUnconscious() + return current_unconscious ? current_unconscious.duration - world.time : 0 -/mob/living/proc/Unconscious(amount, ignore_canstun = FALSE) //Can't go below remaining duration +///Applies unconscious from current world time unless existing duration is higher +/mob/living/proc/Unconscious(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANUNCONSCIOUS) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(U) - U.duration = max(world.time + amount, U.duration) - else if(amount > 0) - U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) - return U + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/unconscious/current_unconscious = IsUnconscious() + if(current_unconscious) + current_unconscious.duration = max(world.time + amount, current_unconscious.duration) + else if(amount > 0) + current_unconscious = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + + return current_unconscious -/mob/living/proc/SetUnconscious(amount, ignore_canstun = FALSE) //Sets remaining duration +///Used to set unconscious to a set amount, commonly to remove it +/mob/living/proc/SetUnconscious(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/unconscious/current_unconscious = IsUnconscious() + if(amount <= 0) + if(current_unconscious) + qdel(current_unconscious) + return if(status_flags & GODMODE) return + if((!(status_flags & CANUNCONSCIOUS) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(amount <= 0) - if(U) - qdel(U) - else if(U) - U.duration = world.time + amount - else - U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) - return U + if(absorb_stun(amount, ignore_canstun)) + return -/mob/living/proc/AdjustUnconscious(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(current_unconscious) + current_unconscious.duration = world.time + amount + else + current_unconscious = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + + return current_unconscious + +///Applies unconscious or adds to existing duration +/mob/living/proc/AdjustUnconscious(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANUNCONSCIOUS) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(U) - U.duration += amount - else if(amount > 0) - U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) - return U + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/unconscious/current_unconscious = IsUnconscious() + if(current_unconscious) + current_unconscious.duration += amount + else if(amount > 0) + current_unconscious = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + + return current_unconscious //////////////////CONFUSED -///Returns the current confuse status effect if any, else FALSE +///Returns if confused /mob/living/proc/IsConfused() return has_status_effect(STATUS_EFFECT_CONFUSED) -///Returns the remaining duration if a confuse effect exists, else 0 +///Returns remaining confused duration /mob/living/proc/AmountConfused() - var/datum/status_effect/incapacitating/confused/C = IsConfused() - if(C) - return C.duration - world.time - return 0 + var/datum/status_effect/incapacitating/confused/current_confused = IsConfused() + return current_confused ? current_confused.duration - world.time : 0 -///Set confused effect duration to the provided value if not less than current duration +///Applies confused from current world time unless existing duration is higher /mob/living/proc/Confused(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANCONFUSE) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_CONFUSED, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANCONFUSE) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/confused/C = IsConfused() - if(C) - C.duration = max(world.time + amount, C.duration) - else if(amount > 0) - C = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) - return C + if(absorb_stun(amount, ignore_canstun)) + return -///Set confused effect duration to the provided value -/mob/living/proc/SetConfused(amount, ignore_canstun = FALSE) //Sets remaining duration + var/datum/status_effect/incapacitating/confused/current_confused = IsConfused() + if(current_confused) + current_confused.duration = max(world.time + amount, current_confused.duration) + else if(amount > 0) + current_confused = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) + + return current_confused + +///Used to set confused to a set amount, commonly to remove it +/mob/living/proc/SetConfused(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/confused/current_confused = IsConfused() + if(amount <= 0) + if(current_confused) + qdel(current_confused) + return if(status_flags & GODMODE) return + if((!(status_flags & CANCONFUSE) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_CONFUSED, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANCONFUSE) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/confused/C = IsConfused() - if(amount <= 0) - if(C) - qdel(C) - else if(C) - C.duration = world.time + amount - else - C = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) - return C + if(absorb_stun(amount, ignore_canstun)) + return + + if(current_confused) + current_confused.duration = world.time + amount + else + current_confused = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) -///Increases confused effect duration by the provided value. -/mob/living/proc/AdjustConfused(amount, ignore_canstun = FALSE) //Adds to remaining duration + return current_confused + +///Applies confused or adds to existing duration +/mob/living/proc/AdjustConfused(amount, ignore_canstun = FALSE) if(status_flags & GODMODE) return + if((!(status_flags & CANCONFUSE) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) && !ignore_canstun) + return if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_CONFUSED, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(((status_flags & CANCONFUSE) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/confused/C = IsConfused() - if(C) - C.duration += amount - else if(amount > 0) - C = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) - return C + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/confused/current_confused = IsConfused() + if(current_confused) + current_confused.duration += amount + else if(amount > 0) + current_confused = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) + + return current_confused ///////////////////////////////////// STUN ABSORPTION ///////////////////////////////////// @@ -612,42 +706,75 @@ ////////////////////////////// STAGGER //////////////////////////////////// -///Returns number of stagger stacks if any -/mob/living/proc/IsStaggered() //If we're staggered - return stagger +///Returns if staggered +/mob/living/proc/IsStaggered() + return has_status_effect(STATUS_EFFECT_STAGGER) -///Standard stagger regen called by life.dm -/mob/living/proc/handle_stagger() - if(stagger) - adjust_stagger(-1) - return stagger +///Returns remaining stagger duration +/mob/living/proc/AmountStaggered() + var/datum/status_effect/incapacitating/stagger/current_stagger = IsStaggered() + return current_stagger ? current_stagger.duration - world.time : 0 -///Where the magic happens. Actually applies stagger stacks. -/mob/living/proc/adjust_stagger(amount, ignore_canstun = FALSE, capped = 0) - if(amount == 0) +///Applies stagger from current world time unless existing duration is higher +/mob/living/proc/Stagger(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) return - - if(amount > 0 && HAS_TRAIT(src, TRAIT_STAGGERIMMUNE)) + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STAGGERIMMUNE)) && !ignore_canstun) + return + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, ignore_canstun) & COMPONENT_NO_STUN) + return + if(absorb_stun(amount, ignore_canstun)) return - if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) //Stun immunity also provides immunity to its lesser cousin stagger + var/datum/status_effect/incapacitating/stagger/current_stagger = IsStaggered() + if(current_stagger) + current_stagger.duration = max(world.time + amount, current_stagger.duration) + else if(amount > 0) + current_stagger = apply_status_effect(STATUS_EFFECT_STAGGER, amount) + + return current_stagger + +///Used to set stagger to a set amount, commonly to remove it +/mob/living/proc/set_stagger(amount, ignore_canstun = FALSE) + var/datum/status_effect/incapacitating/stagger/current_stagger = IsStaggered() + if(amount <= 0) + if(current_stagger) + qdel(current_stagger) + return + if(status_flags & GODMODE) + return + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STAGGERIMMUNE)) && !ignore_canstun) + return + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, ignore_canstun) & COMPONENT_NO_STUN) + return + if(absorb_stun(amount, ignore_canstun)) return - if(capped) - stagger = clamp(stagger + amount, 0, capped) - return stagger + if(current_stagger) + current_stagger.duration = world.time + amount + else + current_stagger = apply_status_effect(STATUS_EFFECT_STAGGER, amount) - set_stagger(max(stagger + amount,0)) - return stagger + return current_stagger -///Used to set stagger to a set number -/mob/living/proc/set_stagger(amount) - if(stagger == amount) +///Applies stagger or adds to existing duration +/mob/living/proc/adjust_stagger(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) return - if(amount > 0 && HAS_TRAIT(src, TRAIT_STAGGERIMMUNE)) + if((!(status_flags & CANSTUN) || HAS_TRAIT(src, TRAIT_STAGGERIMMUNE)) && !ignore_canstun) return - stagger = max(amount, 0) - SEND_SIGNAL(src, COMSIG_LIVING_STAGGER_CHANGED, stagger) + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, ignore_canstun) & COMPONENT_NO_STUN) + return + if(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/stagger/current_stagger = IsStaggered() + if(current_stagger) + current_stagger.duration += amount + else if(amount > 0) + current_stagger = apply_status_effect(STATUS_EFFECT_STAGGER, amount) + + return current_stagger ////////////////////////////// SLOW //////////////////////////////////// diff --git a/code/modules/orbits/spaceship.dm b/code/modules/orbits/spaceship.dm index 80ffb68ed30e3..4b366b3f972b3 100644 --- a/code/modules/orbits/spaceship.dm +++ b/code/modules/orbits/spaceship.dm @@ -158,7 +158,7 @@ GLOBAL_VAR_INIT(current_orbit,STANDARD_ORBIT) if(!can_change_orbit(current_orbit, direction)) return - message_admins("[ADMIN_TPMONTY(usr)] Has sent the ship [direction == "UP" ? "UPWARD" : "DOWNWARD"] in orbit") + message_admins("[ADMIN_TPMONTY(usr)] Has sent the ship [direction == "UP" ? "UPWARD" : "DOWNWARD"] in orbit") var/message = "Prepare for orbital change in 10 seconds.\nMoving [direction] the gravity well.\nSecure all belongings and prepare for engine ignition." priority_announce(message, title = "Orbit Change") addtimer(CALLBACK(src, PROC_REF(do_change_orbit), current_orbit, direction), 10 SECONDS) @@ -226,5 +226,5 @@ GLOBAL_VAR_INIT(current_orbit,STANDARD_ORBIT) else to_chat(M, span_warning("The floor jolts under your feet!")) shake_camera(M, 10, 1) - M.Knockdown(3) + M.Knockdown(0.3 SECONDS) CHECK_TICK diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index 60af6d68594df..34269e6716439 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -89,7 +89,7 @@ else to_chat(h_user, "Small electrical arc sparks and burns your hand as you touch the [src]!") h_user.adjustFireLoss(rand(5,10)) - h_user.Unconscious(40) + h_user.Unconscious(4 SECONDS) charge = 0 if (16 to 35) diff --git a/code/modules/projectiles/ammo_datums.dm b/code/modules/projectiles/ammo_datums.dm index a0dbe71acfeee..9dc4396f203f4 100644 --- a/code/modules/projectiles/ammo_datums.dm +++ b/code/modules/projectiles/ammo_datums.dm @@ -111,24 +111,6 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh /datum/ammo/proc/on_leave_turf(turf/T, atom/firer, obj/projectile/proj) return -/datum/ammo/proc/knockback(mob/victim, obj/projectile/proj, max_range = 2) - if(!victim || victim == proj.firer) - CRASH("knockback called [victim ? "without a mob target" : "while the mob target was the firer"]") - - else //Two tiles away or less. - if(isliving(victim)) //This is pretty ugly, but what can you do. - if(isxeno(victim)) - var/mob/living/carbon/xenomorph/target = victim - if(target.mob_size == MOB_SIZE_BIG) - return //Big xenos are not affected. - target.apply_effects(0, 1) //Smaller ones just get shaken. - to_chat(target, span_xenodanger("You are shaken by the sudden impact!")) - else - var/mob/living/target = victim - target.apply_effects(1, 2) //Humans get stunned a bit. - to_chat(target, span_highdanger("The blast knocks you off your feet!")) - step_away(victim, proj) - ///Handles CC application on the victim /datum/ammo/proc/staggerstun(mob/victim, obj/projectile/proj, max_range = 5, stun = 0, weaken = 0, stagger = 0, slowdown = 0, knockback = 0, soft_size_threshold = 3, hard_size_threshold = 2) if(!victim) @@ -182,12 +164,12 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh if(iscarbon(victim)) var/mob/living/carbon/carbon_victim = victim #if DEBUG_STAGGER_SLOWDOWN - to_chat(world, span_debuginfo("Damage: Initial stagger is: [target.stagger]")) + to_chat(world, span_debuginfo("Damage: Initial stagger is: [target.IsStaggered()]")) #endif if(!HAS_TRAIT(carbon_victim, TRAIT_STAGGER_RESISTANT)) //Some mobs like the Queen are immune to projectile stagger carbon_victim.adjust_stagger(stagger) #if DEBUG_STAGGER_SLOWDOWN - to_chat(world, span_debuginfo("Damage: Final stagger is: [target.stagger]")) + to_chat(world, span_debuginfo("Damage: Final stagger is: [target.IsStaggered()]")) #endif #if DEBUG_STAGGER_SLOWDOWN to_chat(world, span_debuginfo("Damage: Initial slowdown is: [target.slowdown]")) @@ -236,7 +218,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh //Damages the victims, inflicts brief stagger+slow, and ignites victim.apply_damage(fire_burst_damage, BURN, blocked = FIRE, updating_health = TRUE) - staggerstun(victim, proj, 30, stagger = 0.5, slowdown = 0.5) + staggerstun(victim, proj, 30, stagger = 1 SECONDS, slowdown = 0.5) victim.adjust_fire_stacks(5) victim.IgniteMob() @@ -417,7 +399,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 2 /datum/ammo/bullet/pistol/hollow/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 1, slowdown = 0.5, knockback = 1) + staggerstun(M, P, stagger = 2 SECONDS, slowdown = 0.5, knockback = 1) /datum/ammo/bullet/pistol/ap name = "armor-piercing pistol bullet" @@ -443,14 +425,14 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 3.5 /datum/ammo/bullet/pistol/superheavy/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 1, slowdown = 1) + staggerstun(M, P, stagger = 2 SECONDS, slowdown = 1) /datum/ammo/bullet/pistol/superheavy/derringer handful_amount = 2 handful_icon_state = "derringer" /datum/ammo/bullet/pistol/superheavy/derringer/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 0, slowdown = 0, knockback = 1) + staggerstun(M, P, knockback = 1) /datum/ammo/bullet/pistol/mech name = "super-heavy pistol bullet" @@ -516,7 +498,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 3 /datum/ammo/bullet/revolver/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 1, slowdown = 0.5, knockback = 1) + staggerstun(M, P, stagger = 2 SECONDS, slowdown = 0.5, knockback = 1) /datum/ammo/bullet/revolver/tp44 name = "standard revolver bullet" @@ -525,7 +507,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 1 /datum/ammo/bullet/revolver/tp44/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 0, slowdown = 0, knockback = 1) + staggerstun(M, P, knockback = 1) /datum/ammo/bullet/revolver/small name = "small revolver bullet" @@ -560,7 +542,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 0.5 /datum/ammo/bullet/revolver/t76/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, weaken = 1, slowdown = 0, knockback = 1) + staggerstun(M, P, weaken = 2 SECONDS, knockback = 1) /datum/ammo/bullet/revolver/highimpact name = "high-impact revolver bullet" @@ -571,7 +553,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 3 /datum/ammo/bullet/revolver/highimpact/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, weaken = 1, stagger = 1, slowdown = 1, knockback = 1) + staggerstun(M, P, weaken = 2 SECONDS, stagger = 2 SECONDS, slowdown = 1, knockback = 1) /datum/ammo/bullet/revolver/ricochet bonus_projectiles_type = /datum/ammo/bullet/revolver/small @@ -707,7 +689,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 1.25 /datum/ammo/bullet/rifle/repeater/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, max_range = 3, slowdown = 2, stagger = 1) + staggerstun(M, P, max_range = 3, slowdown = 2, stagger = 1 SECONDS) /datum/ammo/bullet/rifle/incendiary name = "incendiary rifle bullet" @@ -851,7 +833,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 7.5 /datum/ammo/bullet/shotgun/slug/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, weaken = 1, stagger = 2, knockback = 1, slowdown = 2) + staggerstun(M, P, weaken = 2 SECONDS, stagger = 2 SECONDS, knockback = 1, slowdown = 2) /datum/ammo/bullet/shotgun/beanbag @@ -866,7 +848,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh accuracy = 5 /datum/ammo/bullet/shotgun/beanbag/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, weaken = 1, stagger = 2, knockback = 1, slowdown = 2, hard_size_threshold = 1) + staggerstun(M, P, weaken = 2 SECONDS, stagger = 4 SECONDS, knockback = 1, slowdown = 2, hard_size_threshold = 1) /datum/ammo/bullet/shotgun/incendiary name = "incendiary slug" @@ -921,7 +903,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh damage_falloff = 4 /datum/ammo/bullet/shotgun/buckshot/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, weaken = 1, stagger = 1, knockback = 2, slowdown = 0.5, max_range = 3) + staggerstun(M, P, weaken = 2 SECONDS, stagger = 2 SECONDS, knockback = 2, slowdown = 0.5, max_range = 3) /datum/ammo/bullet/shotgun/spread name = "additional buckshot" @@ -1090,7 +1072,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh damage_falloff = 4 /datum/ammo/bullet/shotgun/mech/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, weaken = 1, stagger = 1, knockback = 2, slowdown = 0.5, max_range = 3) + staggerstun(M, proj, weaken = 2 SECONDS, stagger = 2 SECONDS, knockback = 2, slowdown = 0.5, max_range = 3) /* //================================================ @@ -1192,7 +1174,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh damage_falloff = 0.25 /datum/ammo/bullet/sniper/pfc/flak/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, knockback = 4, slowdown = 1.5, stagger = 1, max_range = 17) + staggerstun(M, P, knockback = 4, slowdown = 1.5, stagger = 2 SECONDS, max_range = 17) /datum/ammo/bullet/sniper/auto @@ -1359,7 +1341,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh on_pierce_multiplier = 0.85 /datum/ammo/bullet/railgun/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, weaken = 1, stagger = 3, slowdown = 2, knockback = 2) + staggerstun(M, P, weaken = 2 SECONDS, stagger = 4 SECONDS, slowdown = 2, knockback = 2) /datum/ammo/bullet/railgun/hvap name = "high velocity railgun slug" @@ -1371,7 +1353,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 50 /datum/ammo/bullet/railgun/hvap/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, stagger = 2, knockback = 3) + staggerstun(M, P, stagger = 2 SECONDS, knockback = 3) /datum/ammo/bullet/railgun/smart name = "smart armor piercing railgun slug" @@ -1382,7 +1364,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 20 /datum/ammo/bullet/railgun/smart/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, stagger = 3, slowdown = 3) + staggerstun(M, P, stagger = 3 SECONDS, slowdown = 3) /datum/ammo/bullet/apfsds name = "\improper APFSDS round" @@ -1428,7 +1410,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh projectile_greyscale_colors = COLOR_AMMO_AIRBURST /datum/ammo/tx54/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, stagger = 0, slowdown = 0.5, knockback = 1) + staggerstun(M, proj, slowdown = 0.5, knockback = 1) playsound(proj, sound(get_sfx("explosion_micro")), 30, falloff = 5) fire_directionalburst(proj, proj.firer, proj.shot_from, bonus_projectile_quantity, 4, 3, Get_Angle(proj.firer, M) ) @@ -1521,7 +1503,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh damage_falloff = 0 /datum/ammo/bullet/tx54_spread/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, max_range = 3, stagger = 0.3, slowdown = 0.3) + staggerstun(M, proj, max_range = 3, stagger = 0.6 SECONDS, slowdown = 0.3) /datum/ammo/bullet/tx54_spread/incendiary name = "incendiary flechette" @@ -1619,7 +1601,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh sundering = 0.5 /datum/ammo/bullet/tx54_spread/mech/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, max_range = 3, stagger = 0, slowdown = 0.2) + staggerstun(M, proj, max_range = 3, slowdown = 0.2) //10-gauge Micro rail shells - aka micronades /datum/ammo/bullet/micro_rail @@ -1694,7 +1676,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh damage_falloff = 1 /datum/ammo/bullet/micro_rail_spread/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, stagger = 0.5, slowdown = 0.5) + staggerstun(M, proj, stagger = 1 SECONDS, slowdown = 0.5) /datum/ammo/bullet/micro_rail_spread/incendiary name = "incendiary flechette" @@ -1705,7 +1687,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh max_range = 6 /datum/ammo/bullet/micro_rail_spread/incendiary/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, stagger = 0.2, slowdown = 0.2) + staggerstun(M, proj, stagger = 0.4 SECONDS, slowdown = 0.2) /datum/ammo/bullet/micro_rail_spread/incendiary/drop_flame(turf/T) if(!istype(T)) @@ -1734,8 +1716,10 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh var/datum/effect_system/smoke_spread/smoketype = /datum/effect_system/smoke_spread ///Total damage applied to victims by the exploding bomblet var/explosion_damage = 20 - ///Amount of stagger and slowdown applied by the exploding bomblet - var/stagger_slow = 1 + ///Amount of stagger applied by the exploding bomblet + var/stagger_amount = 2 SECONDS + ///Amount of slowdown applied by the exploding bomblet + var/slow_amount = 1 ///range of bomblet explosion var/explosion_range = 2 @@ -1754,7 +1738,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh living_target.visible_message(span_danger("[living_target] is hit by the bomblet blast!"), isxeno(living_target) ? span_xenodanger("We are hit by the bomblet blast!") : span_highdanger("you are hit by the bomblet blast!")) living_target.apply_damages(explosion_damage * 0.5, explosion_damage * 0.5, 0, 0, 0, blocked = BOMB, updating_health = TRUE) - staggerstun(living_target, P, stagger = stagger_slow, slowdown = stagger_slow) + staggerstun(living_target, P, stagger = stagger_amount, slowdown = slow_amount) else if(isobj(target)) var/obj/obj_victim = target obj_victim.take_damage(explosion_damage, BRUTE, BOMB) @@ -1899,7 +1883,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh on_pierce_multiplier = 0.85 /datum/ammo/bullet/coilgun/on_hit_mob(mob/M, obj/projectile/P) - staggerstun(M, P, weaken = 0.1, slowdown = 1, knockback = 3) + staggerstun(M, P, weaken = 0.2 SECONDS, slowdown = 1, knockback = 3) /* @@ -2297,7 +2281,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh /datum/ammo/rocket/atgun_shell/apcr/on_hit_mob(mob/M, obj/projectile/P) drop_nade(get_turf(M)) P.proj_max_range -= 5 - staggerstun(M, P, max_range = 20, stagger = 0.5, slowdown = 0.5, knockback = 2, hard_size_threshold = 3) + staggerstun(M, P, max_range = 20, stagger = 1 SECONDS, slowdown = 0.5, knockback = 2, hard_size_threshold = 3) /datum/ammo/rocket/atgun_shell/apcr/on_hit_obj(obj/O, obj/projectile/P) P.proj_max_range -= 5 @@ -2335,7 +2319,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh explosion(T, 0, 0, 0, 1) /datum/ammo/rocket/atgun_shell/beehive/on_hit_mob(mob/M, obj/projectile/proj) - staggerstun(M, proj, stagger = 0, slowdown = 0.2, knockback = 1) + staggerstun(M, proj, slowdown = 0.2, knockback = 1) drop_nade(get_turf(M)) playsound(proj, sound(get_sfx("explosion_micro")), 30, falloff = 5) fire_directionalburst(proj, proj.firer, proj.shot_from, bonus_projectile_quantity, 5, 3, Get_Angle(proj.firer, M) ) @@ -2555,7 +2539,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh accurate_range = 10 bullet_color = COLOR_VIVID_YELLOW /datum/ammo/energy/taser/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stun = 10) + staggerstun(M, P, stun = 20 SECONDS) /datum/ammo/energy/tesla name = "energy ball" @@ -2661,7 +2645,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh bullet_color = COLOR_DISABLER_BLUE /datum/ammo/energy/lasgun/M43/disabler/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 0.5, slowdown = 0.75) + staggerstun(M, P, stagger = 1 SECONDS, slowdown = 0.75) /datum/ammo/energy/lasgun/pulsebolt name = "pulse bolt" @@ -2690,7 +2674,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh if(isnestedhost(C)) return - staggerstun(C, P, stagger = 1, slowdown = 1) //Staggers and slows down briefly + staggerstun(C, P, stagger = 2 SECONDS, slowdown = 1) //Staggers and slows down briefly return ..() @@ -2966,7 +2950,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh bullet_color = COLOR_LASER_RED /datum/ammo/energy/lasgun/pistol/disabler/on_hit_mob(mob/M,obj/projectile/P) - staggerstun(M, P, stagger = 0.5, slowdown = 0.75) + staggerstun(M, P, stagger = 1 SECONDS, slowdown = 0.75) /datum/ammo/energy/lasgun/marine/xray name = "xray heat bolt" @@ -3108,7 +3092,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh /datum/ammo/energy/xeno/psy_blast/psy_lance/on_hit_mob(mob/M, obj/projectile/P) if(isxeno(M)) return - staggerstun(M, P, 9, stagger = 2, slowdown = 2, knockback = 1) + staggerstun(M, P, 9, stagger = 4 SECONDS, slowdown = 2, knockback = 1) /datum/ammo/energy/xeno/psy_blast/psy_lance/on_hit_turf(turf/T, obj/projectile/P) return @@ -3310,7 +3294,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh accuracy_var_low = 3 accuracy_var_high = 3 damage = 40 - stagger_stacks = 1.1 + stagger_stacks = 1.1 SECONDS slowdown_stacks = 1.5 smoke_strength = 0.5 smoke_range = 0 @@ -3786,7 +3770,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh ///How long the victim will be snared for var/hit_immobilize = 2 SECONDS ///How long the victim will be KO'd - var/hit_weaken = 1 + var/hit_weaken = 2 SECONDS ///List for bodyparts that upon being hit cause the target to become weakened var/list/weaken_list = list(BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND) ///List for bodyparts that upon being hit cause the target to become ensnared diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 7fbbcc182b428..aef53d983c510 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -450,8 +450,7 @@ COMSIG_RANGED_SCATTER_MOD_CHANGED, COMSIG_MOB_SKILLS_CHANGED, COMSIG_MOB_SHOCK_STAGE_CHANGED, - COMSIG_HUMAN_MARKSMAN_AURA_CHANGED, - COMSIG_LIVING_STAGGER_CHANGED,)) + COMSIG_HUMAN_MARKSMAN_AURA_CHANGED)) gun_user.client?.mouse_pointer_icon = initial(gun_user.client.mouse_pointer_icon) SEND_SIGNAL(gun_user, COMSIG_GUN_USER_UNSET) gun_user.hud_used.remove_ammo_hud(src) @@ -468,8 +467,7 @@ COMSIG_RANGED_SCATTER_MOD_CHANGED, COMSIG_MOB_SKILLS_CHANGED, COMSIG_MOB_SHOCK_STAGE_CHANGED, - COMSIG_HUMAN_MARKSMAN_AURA_CHANGED, - COMSIG_LIVING_STAGGER_CHANGED), PROC_REF(setup_bullet_accuracy)) + COMSIG_HUMAN_MARKSMAN_AURA_CHANGED), PROC_REF(setup_bullet_accuracy)) SEND_SIGNAL(gun_user, COMSIG_GUN_USER_SET, src) if(flags_gun_features & GUN_AMMO_COUNTER) gun_user.hud_used.add_ammo_hud(src, get_ammo_list(), get_display_ammo_count()) @@ -1748,9 +1746,6 @@ gun_accuracy_mod += living_user.ranged_accuracy_mod gun_scatter += living_user.ranged_scatter_mod - if(living_user.stagger) - gun_scatter += 5 - if(ishuman(gun_user)) var/mob/living/carbon/human/shooter_human = gun_user gun_accuracy_mod -= round(min(20, (shooter_human.shock_stage * 0.2))) //Accuracy declines with pain, being reduced by 0.2% per point of pain. diff --git a/code/modules/projectiles/guns/specialist.dm b/code/modules/projectiles/guns/specialist.dm index 507adee31eb2a..ee7fad1beffef 100644 --- a/code/modules/projectiles/guns/specialist.dm +++ b/code/modules/projectiles/guns/specialist.dm @@ -624,7 +624,7 @@ Note that this means that snipers will have a slowdown of 3, due to the scope if(victim.lying_angle || victim.stat == DEAD) //Have to be standing up to get the fun stuff continue victim.adjustBruteLoss(15) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life - victim.Paralyze(60) //For good measure + victim.Paralyze(6 SECONDS) //For good measure victim.emote("pain") victim.throw_at(get_step(backblast_loc, thrown_dir), 1, 2) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 4cc9189a892ba..0b0a9f5e622c7 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -867,7 +867,7 @@ So if we are on the 32th absolute pixel coordinate we are on tile 1, but if we a if(iscarbon(proj.firer)) var/mob/living/carbon/shooter_carbon = proj.firer - if(shooter_carbon.stagger) + if(shooter_carbon.IsStaggered()) damage *= STAGGER_DAMAGE_MULTIPLIER //Since we hate RNG, stagger reduces damage by a % instead of reducing accuracy; consider it a 'glancing' hit due to being disoriented. var/original_damage = damage damage = modify_by_armor(damage, proj.armor_type, proj.penetration, proj.def_zone) diff --git a/code/modules/reagents/reagents/alcohol.dm b/code/modules/reagents/reagents/alcohol.dm index 242afb066abd1..1736816036e49 100644 --- a/code/modules/reagents/reagents/alcohol.dm +++ b/code/modules/reagents/reagents/alcohol.dm @@ -94,7 +94,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/kahlua/on_mob_life(mob/living/L, metabolism) L.dizzy(-4) L.adjustDrowsyness(-2) - L.AdjustSleeping(-60) + L.AdjustSleeping(-6 SECONDS) L.jitter(5) return ..() @@ -288,7 +288,7 @@ All effects don't start immediately, but rather get worse over time; the rate is if(istype(E)) if(H.species.species_flags ~! NO_PAIN) to_chat(H, span_danger("You clutch for a moment as you feel a scorching pain covering your abdomen!")) - H.Stun(60) + H.Stun(6 SECONDS) E.take_damage(20) return ..() @@ -428,7 +428,7 @@ All effects don't start immediately, but rather get worse over time; the rate is boozepwr = 90 //THE FIST OF THE LAW IS STRONG AND HARD /datum/reagent/consumable/ethanol/beepsky_smash/on_mob_life(mob/living/L, metabolism) - L.Stun(40) + L.Stun(4 SECONDS) return ..() /datum/reagent/consumable/ethanol/irish_cream @@ -732,7 +732,7 @@ All effects don't start immediately, but rather get worse over time; the rate is L.dizzy(5) L.adjust_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter) if(prob(20)) - L.AdjustConfused(60) + L.AdjustConfused(6 SECONDS) if(101 to INFINITY) L.dizzy(6) L.adjust_timed_status_effect(10 SECONDS, /datum/status_effect/speech/stutter) diff --git a/code/modules/reagents/reagents/drink.dm b/code/modules/reagents/reagents/drink.dm index 3e70203f69951..b61028aebbd10 100644 --- a/code/modules/reagents/reagents/drink.dm +++ b/code/modules/reagents/reagents/drink.dm @@ -488,15 +488,15 @@ /datum/reagent/consumable/drink/atomicbomb/on_mob_life(mob/living/L, metabolism) L.set_drugginess(50) - L.AdjustConfused(40) + L.AdjustConfused(4 SECONDS) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/slurring/drunk) switch(current_cycle) if(40 to 49) L.adjustDrowsyness(2) if(51 to 200) - L.Sleeping(60) + L.Sleeping(6 SECONDS) if(201 to INFINITY) - L.Sleeping(60) + L.Sleeping(6 SECONDS) L.adjustToxLoss(2) return ..() @@ -513,7 +513,7 @@ L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/slurring/drunk) L.jitter(2) if(46 to 65) - L.AdjustConfused(40) + L.AdjustConfused(4 SECONDS) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/slurring/drunk) L.jitter(3) if(66 to 199) @@ -525,13 +525,13 @@ L.Sleeping(16 SECONDS) if(200 to INFINITY) L.set_drugginess(50) - L.AdjustConfused(40) + L.AdjustConfused(4 SECONDS) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/slurring/drunk) L.adjustToxLoss(2) L.jitter(5) if(prob(10)) L.vomit() - L.Sleeping(60) + L.Sleeping(6 SECONDS) return ..() /datum/reagent/consumable/drink/neurotoxin @@ -543,16 +543,16 @@ trait_flags = BRADYCARDICS /datum/reagent/consumable/drink/neurotoxin/on_mob_life(mob/living/L, metabolism) - L.Paralyze(60) + L.Paralyze(6 SECONDS) switch(current_cycle) if(15 to 35) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/stutter) if(36 to 55) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/stutter) - L.AdjustConfused(40) + L.AdjustConfused(4 SECONDS) if(56 to 200) L.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/stutter) - L.AdjustConfused(40) + L.AdjustConfused(4 SECONDS) L.set_drugginess(30) if(201 to INFINITY) L.set_drugginess(30) diff --git a/code/modules/reagents/reagents/food.dm b/code/modules/reagents/reagents/food.dm index fd4878e7e278c..fe156088ab262 100644 --- a/code/modules/reagents/reagents/food.dm +++ b/code/modules/reagents/reagents/food.dm @@ -184,15 +184,13 @@ victim.blind_eyes(5) victim.Stun(10 SECONDS) victim.Paralyze(10 SECONDS) - //victim.Unconscious(10) - //victim.drop_held_item() return else if( eyes_covered ) // Mouth cover is better than eye cover, except it's actually the opposite. if(show_message) to_chat(victim, span_danger("Your [safe_thing] protects you from most of the pepperspray!")) if(!(victim.species && (victim.species.species_flags & NO_PAIN))) if(prob(10)) - victim.Stun(20) + victim.Stun(2 SECONDS) victim.blur_eyes(5) return else // Oh dear :D @@ -305,7 +303,7 @@ /datum/reagent/consumable/psilocybin/overdose_crit_process(mob/living/L, metabolism) L.apply_damage(2, TOX) if(prob(60)) - L.Unconscious(60) + L.Unconscious(6 SECONDS) L.setDrowsyness(max(L.drowsyness, 30)) /datum/reagent/consumable/sprinkles diff --git a/code/modules/reagents/reagents/medical.dm b/code/modules/reagents/reagents/medical.dm index 2816c48b84c01..98ca56f9293f0 100644 --- a/code/modules/reagents/reagents/medical.dm +++ b/code/modules/reagents/reagents/medical.dm @@ -159,7 +159,7 @@ L.adjustStaminaLoss(5*effect_str) L.set_drugginess(10) L.jitter(3) - L.AdjustConfused(6) + L.AdjustConfused(0.6 SECONDS) /datum/reagent/medicine/oxycodone/overdose_crit_process(mob/living/L, metabolism) L.apply_damage(3*effect_str, TOX) @@ -455,10 +455,10 @@ /datum/reagent/medicine/synaptizine/on_mob_life(mob/living/L, metabolism) L.reagent_shock_modifier += PAIN_REDUCTION_MEDIUM - L.adjustDrowsyness(-5) - L.AdjustUnconscious(-20) - L.AdjustStun(-20) - L.AdjustParalyzed(-20) + L.adjustDrowsyness(-0.5 SECONDS) + L.AdjustUnconscious(-2 SECONDS) + L.AdjustStun(-2 SECONDS) + L.AdjustParalyzed(-2 SECONDS) L.adjustToxLoss(effect_str) L.hallucination = max(0, L.hallucination - 10) switch(current_cycle) @@ -510,10 +510,10 @@ C.drunkenness = max(C.drunkenness-5, 0) L.AdjustConfused(-10 SECONDS) L.adjust_blurriness(-5) - L.AdjustUnconscious(-40) - L.AdjustStun(-40) - L.AdjustParalyzed(-20) - L.AdjustSleeping(-40) + L.AdjustUnconscious(-4 SECONDS) + L.AdjustStun(-4 SECONDS) + L.AdjustParalyzed(-2 SECONDS) + L.AdjustSleeping(-4 SECONDS) L.adjustStaminaLoss(-30*effect_str) L.heal_limb_damage(7.5*effect_str, 7.5*effect_str) L.adjustToxLoss(3.75*effect_str) @@ -847,7 +847,7 @@ if(L.blood_volume < BLOOD_VOLUME_BAD) L.blood_volume = (BLOOD_VOLUME_BAD+1) L.reagents.add_reagent(/datum/reagent/toxin,25) - L.AdjustSleeping(100) + L.AdjustSleeping(10 SECONDS) return ..() /datum/reagent/medicine/nanoblood/overdose_process(mob/living/L, metabolism) @@ -875,9 +875,9 @@ /datum/reagent/medicine/ultrazine/on_mob_life(mob/living/L, metabolism) if(prob(50)) - L.AdjustParalyzed(-20) - L.AdjustStun(-20) - L.AdjustUnconscious(-20) + L.AdjustParalyzed(-2 SECONDS) + L.AdjustStun(-2 SECONDS) + L.AdjustUnconscious(-2 SECONDS) L.adjustStaminaLoss(-2*effect_str) if(prob(2)) L.emote(pick("twitch","blink_r","shiver")) @@ -898,7 +898,7 @@ if(prob(5)) L.emote("me", EMOTE_VISIBLE, pick("winces slightly.", "grimaces.")) L.adjustStaminaLoss(35) - L.Stun(20) + L.Stun(2 SECONDS) if(prob(20)) L.hallucination += 15 @@ -908,7 +908,7 @@ to_chat(L, span_warning("[pick("You need more.", "It's hard to go on like this.", "You want more. You need more.", "Just take another hit. Now.", "One more.")]")) if(prob(5)) L.emote("me", EMOTE_VISIBLE, pick("winces.", "grimaces.", "groans!")) - L.Stun(30) + L.Stun(3 SECONDS) if(prob(20)) L.hallucination += 20 L.dizzy(60) @@ -920,7 +920,7 @@ to_chat(L, span_danger("[pick("You need another dose, now. NOW.", "You can't stand it. You have to go back. You have to go back.", "You need more. YOU NEED MORE.", "MORE", "TAKE MORE.")]")) if(prob(5)) L.emote("me", EMOTE_VISIBLE, pick("groans painfully!", "contorts with pain!")) - L.Stun(80) + L.Stun(8 SECONDS) L.do_jitter_animation(200) if(prob(20)) L.hallucination += 30 @@ -1104,7 +1104,7 @@ L.dizzy(-1) L.adjustDrowsyness(-1) L.adjust_timed_status_effect(-2 SECONDS, /datum/status_effect/speech/stutter) - L.AdjustConfused(-20) + L.AdjustConfused(-2 SECONDS) var/mob/living/carbon/C = L C.drunkenness = max(C.drunkenness-4, 0) L.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 0.5*effect_str, 0, 1) @@ -1160,7 +1160,7 @@ L.adjustToxLoss(-30*effect_str) L.heal_limb_damage(30*effect_str, 30*effect_str) L.adjustStaminaLoss(-30*effect_str) - L.AdjustStun(-100) + L.AdjustStun(-10 SECONDS) if(prob(5)) L.adjustBruteLoss(1200*effect_str) //the big oof. No, it's not kill or gib, I want them to nugget. @@ -1342,7 +1342,7 @@ /datum/reagent/medicine/research/stimulon/on_mob_delete(mob/living/L, metabolism) L.remove_movespeed_modifier(type) - L.Paralyze(20) + L.Paralyze(2 SECONDS) to_chat(L, span_warning("You reel as the stimulant departs your bloodstream!")) /datum/reagent/medicine/research/stimulon/on_mob_life(mob/living/L, metabolism) diff --git a/code/modules/reagents/reagents/toxin.dm b/code/modules/reagents/reagents/toxin.dm index 017fd0b585e3f..af686e8901928 100644 --- a/code/modules/reagents/reagents/toxin.dm +++ b/code/modules/reagents/reagents/toxin.dm @@ -98,7 +98,7 @@ /datum/reagent/toxin/cyanide/on_mob_life(mob/living/L, metabolism) L.adjustOxyLoss(2*effect_str) if(current_cycle > 10) - L.Sleeping(40) + L.Sleeping(4 SECONDS) return ..() /datum/reagent/toxin/minttoxin diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 74f88a845320a..46c8a6da4099d 100755 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -197,7 +197,7 @@ user.forceMove(loc) if(isliving(user)) var/mob/living/L = user - L.Stun(40) + L.Stun(4 SECONDS) if(!user.lying_angle) user.visible_message("[user] suddenly climbs out of [src]!", "You climb out of [src] and get your bearings!") @@ -284,7 +284,7 @@ "You get pushed out of [src] and get your bearings!") if(isliving(M)) var/mob/living/L = M - L.Stun(40) + L.Stun(4 SECONDS) update() //Pipe affected by explosion diff --git a/code/modules/shuttle/marine_dropship.dm b/code/modules/shuttle/marine_dropship.dm index be9fb91c7b9b9..2f150e7f7fa17 100644 --- a/code/modules/shuttle/marine_dropship.dm +++ b/code/modules/shuttle/marine_dropship.dm @@ -29,7 +29,7 @@ else to_chat(M, span_warning("The floor jolts under your feet!")) shake_camera(M, 10, 1) - M.Paralyze(60) + M.Paralyze(6 SECONDS) CHECK_TICK for(var/i in GLOB.ai_list) diff --git a/code/modules/vehicles/multitile/cm_armored.dm b/code/modules/vehicles/multitile/cm_armored.dm index 2fe14f0c57ec2..f57777c2af2ae 100644 --- a/code/modules/vehicles/multitile/cm_armored.dm +++ b/code/modules/vehicles/multitile/cm_armored.dm @@ -289,7 +289,7 @@ GLOBAL_LIST_INIT(armorvic_dmg_distributions, list( if(stat == DEAD) //We don't care about the dead return if(loc == C.loc) // treaded over. - ParalyzeNoChain(20) + ParalyzeNoChain(2 SECONDS) var/target_dir = turn(C.dir, 180) temp = get_step(C.loc, target_dir) T = temp @@ -307,7 +307,7 @@ GLOBAL_LIST_INIT(armorvic_dmg_distributions, list( throw_at(T, 3, 2, C, 0) else throw_at(T, 3, 2, C, 1) - ParalyzeNoChain(20) + ParalyzeNoChain(2 SECONDS) apply_damage(rand(10, 15), BRUTE, blocked = MELEE) visible_message(span_danger("[C] bumps into [src], throwing [p_them()] away!"), span_danger("[C] violently bumps into you!")) var/obj/vehicle/multitile/root/cm_armored/CA = C.root @@ -336,7 +336,7 @@ GLOBAL_LIST_INIT(armorvic_dmg_distributions, list( /mob/living/carbon/xenomorph/larva/tank_collision(obj/vehicle/multitile/hitbox/cm_armored/C, facing, turf/T, turf/temp) if(loc == C.loc) // treaded over. - ParalyzeNoChain(20) + ParalyzeNoChain(2 SECONDS) apply_damage(rand(5, 7.5), BRUTE, blocked = MELEE) return var/obj/vehicle/multitile/root/cm_armored/CA = C.root diff --git a/code/modules/vehicles/multitile/tank.dm b/code/modules/vehicles/multitile/tank.dm index ea2cf3bafa56f..0f0e16adfcbff 100644 --- a/code/modules/vehicles/multitile/tank.dm +++ b/code/modules/vehicles/multitile/tank.dm @@ -135,7 +135,7 @@ if(!isliving(occupant)) return var/mob/living/L = occupant - L.Paralyze(80) + L.Paralyze(8 SECONDS) //Two seats, gunner and driver //Must have the skills to do so diff --git a/code/modules/vehicles/sealed.dm b/code/modules/vehicles/sealed.dm index 6d3e0f419da87..090550a717ae8 100644 --- a/code/modules/vehicles/sealed.dm +++ b/code/modules/vehicles/sealed.dm @@ -125,7 +125,7 @@ mob_exit(i, null, randomstep) if(iscarbon(i)) var/mob/living/carbon/Carbon = i - Carbon.Paralyze(40) + Carbon.Paralyze(4 SECONDS) /obj/vehicle/sealed/proc/dump_specific_mobs(flag, randomstep = TRUE) for(var/i in occupants) @@ -134,7 +134,7 @@ mob_exit(i, null, randomstep) if(iscarbon(i)) var/mob/living/carbon/C = i - C.Paralyze(40) + C.Paralyze(4 SECONDS) /obj/vehicle/sealed/AllowDrop() diff --git a/code/modules/xenomorph/xeno_structures.dm b/code/modules/xenomorph/xeno_structures.dm index 2c0c434092ea7..ff814830c0d53 100644 --- a/code/modules/xenomorph/xeno_structures.dm +++ b/code/modules/xenomorph/xeno_structures.dm @@ -1478,7 +1478,7 @@ TUNNEL to_chat(user, span_warning("[src] bursts, releasing a strong gust of pressurised gas!")) if(ishuman(user)) var/mob/living/carbon/human/H = user - H.adjust_stagger(3) + H.adjust_stagger(3 SECONDS) H.apply_damage(30, BRUTE, "chest", BOMB) qdel(src) return TRUE