diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 464840878c4..5c69080ce8d 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -491,7 +491,6 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA #define HIVE_CAN_HIJACK (1<<0) #define XENO_PULL_CHARGE_TIME 2 SECONDS -#define XENO_SLOWDOWN_REGEN 0.4 #define XENO_DEADHUMAN_DRAG_SLOWDOWN 2 @@ -744,8 +743,8 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA #define TIME_TO_DISSOLVE 5 SECONDS //misc - #define STANDARD_SLOWDOWN_REGEN 0.3 +#define XENO_SLOWDOWN_REGEN 0.4 #define HYPERVENE_REMOVAL_AMOUNT 8 diff --git a/code/datums/actions/ability_actions.dm b/code/datums/actions/ability_actions.dm index 5c8c7fbb02c..92286cf6c5a 100644 --- a/code/datums/actions/ability_actions.dm +++ b/code/datums/actions/ability_actions.dm @@ -78,7 +78,7 @@ carbon_owner.balloon_alert(carbon_owner, "Cannot while buckled") return FALSE - if(!(flags_to_check & ABILITY_USE_STAGGERED) && carbon_owner.IsStaggered()) + if(!(flags_to_check & ABILITY_USE_STAGGERED) && carbon_owner.has_status_effect(STATUS_EFFECT_STAGGER)) if(!silent) carbon_owner.balloon_alert(carbon_owner, "Cannot while staggered") return FALSE diff --git a/code/datums/components/shield.dm b/code/datums/components/shield.dm index 07a1a89723b..50dfb265f76 100644 --- a/code/datums/components/shield.dm +++ b/code/datums/components/shield.dm @@ -149,15 +149,15 @@ if(parent_item.obj_integrity <= parent_item.integrity_failure) return incoming_damage - if(affected.IsSleeping() || affected.IsUnconscious() || affected.IsAdminSleeping()) //We don't do jack if we're literally KOed/sleeping/paralyzed. + if(affected.has_status_effect(STATUS_EFFECT_SLEEPING) || affected.has_status_effect(STATUS_EFFECT_UNCONSCIOUS) || affected.IsAdminSleeping()) //We don't do jack if we're literally KOed/sleeping/paralyzed. return incoming_damage - if(affected.IsStun() || affected.IsKnockdown() || affected.IsParalyzed()) //Halve shield cover if we're paralyzed or stunned + if(affected.has_status_effect(STATUS_EFFECT_STUN) || affected.has_status_effect(STATUS_EFFECT_KNOCKDOWN) || affected.has_status_effect(STATUS_EFFECT_PARALYZED)) //Halve shield cover if we're paralyzed or stunned status_cover_modifier *= 0.5 if(iscarbon(affected)) var/mob/living/carbon/C = affected - if(C.IsStaggered()) //Lesser penalty to shield cover for being staggered. + if(C.has_status_effect(STATUS_EFFECT_STAGGER)) //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 3ae59d1e2f1..fc72d2f2053 100644 --- a/code/datums/components/stun_mitigation.dm +++ b/code/datums/components/stun_mitigation.dm @@ -117,15 +117,15 @@ if(parent_item.obj_integrity <= parent_item.integrity_failure) return FALSE - if(affected.IsSleeping() || affected.IsUnconscious() || affected.IsAdminSleeping()) + if(affected.has_status_effect(STATUS_EFFECT_SLEEPING) || affected.has_status_effect(STATUS_EFFECT_UNCONSCIOUS) || affected.IsAdminSleeping()) return FALSE - if(affected.IsStun() || affected.IsKnockdown() || affected.IsParalyzed()) + if(affected.has_status_effect(STATUS_EFFECT_STUN) || affected.has_status_effect(STATUS_EFFECT_KNOCKDOWN) || affected.has_status_effect(STATUS_EFFECT_PARALYZED)) mitigation_prob *= 0.5 if(iscarbon(affected)) var/mob/living/carbon/C = affected - if(C.IsStaggered()) + if(C.has_status_effect(STATUS_EFFECT_STAGGER)) mitigation_prob *= 0.4 if(!prob(mitigation_prob)) diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index 1b6069c8113..43962e07db7 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -107,14 +107,17 @@ var/datum/status_effect/S1 = effect LAZYINITLIST(status_effects) for(var/datum/status_effect/S in status_effects) - if(S.id == initial(S1.id) && S.status_type) - if(S.status_type == STATUS_EFFECT_REPLACE) - qdel(S) - else if(S.status_type == STATUS_EFFECT_REFRESH) - S.refresh() - return - else - return + if(S.id != initial(S1.id)) + continue + if(!S.status_type) + continue + if(S.status_type == STATUS_EFFECT_REPLACE) + qdel(S) + else if(S.status_type == STATUS_EFFECT_REFRESH) + S.refresh() + return + else + return var/list/arguments = args.Copy() arguments[1] = src S1 = new effect(arguments) @@ -125,25 +128,28 @@ if(status_effects) var/datum/status_effect/S1 = effect for(var/datum/status_effect/S in status_effects) - if(initial(S1.id) == S.id) - qdel(S) - . = TRUE + if(initial(S1.id) != S.id) + continue + qdel(S) + . = TRUE /mob/living/proc/has_status_effect(effect) //returns the effect if the mob calling the proc owns the given status effect . = FALSE if(status_effects) var/datum/status_effect/S1 = effect for(var/datum/status_effect/S in status_effects) - if(initial(S1.id) == S.id) - return S + if(initial(S1.id) != S.id) + continue + return S /mob/living/proc/has_status_effect_list(effect) //returns a list of effects with matching IDs that the mod owns; use for effects there can be multiple of . = list() if(status_effects) var/datum/status_effect/S1 = effect for(var/datum/status_effect/S in status_effects) - if(initial(S1.id) == S.id) - . += S + if(initial(S1.id) != S.id) + continue + . += S /mob/living/proc/remove_all_status_effect() . = 0 diff --git a/code/game/data_huds/human.dm b/code/game/data_huds/human.dm index 01de9a221bf..7259e1c5ba5 100644 --- a/code/game/data_huds/human.dm +++ b/code/game/data_huds/human.dm @@ -92,7 +92,7 @@ if(!client) //Nobody home. status_hud.icon_state = "afk" return TRUE - if(IsUnconscious()) //Should hopefully get out of it soon. + if(has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) //Should hopefully get out of it soon. status_hud.icon_state = "knockout" return TRUE status_hud.icon_state = "sleep" //Regular sleep, else. @@ -101,13 +101,13 @@ if(!key) //Nobody home. Shouldn't affect aghosting. status_hud.icon_state = "afk" return TRUE - if(IsParalyzed()) //I've fallen and I can't get up. + if(has_status_effect(STATUS_EFFECT_PARALYZED)) //I've fallen and I can't get up. status_hud.icon_state = "knockdown" return TRUE - if(IsStun()) + if(has_status_effect(STATUS_EFFECT_STUN)) status_hud.icon_state = "stun" return TRUE - if(IsStaggered()) + if(has_status_effect(STATUS_EFFECT_STAGGER)) return TRUE if(slowdown) status_hud.icon_state = "slowdown" @@ -170,7 +170,7 @@ if(!client) //Nobody home. simple_status_hud.icon_state = "afk" return TRUE - if(IsUnconscious()) //Should hopefully get out of it soon. + if(has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) //Should hopefully get out of it soon. simple_status_hud.icon_state = "knockout" return TRUE simple_status_hud.icon_state = "sleep" @@ -179,13 +179,13 @@ if(!key) //Nobody home. Shouldn't affect aghosting. simple_status_hud.icon_state = "afk" return TRUE - if(IsParalyzed()) //I've fallen and I can't get up. + if(has_status_effect(STATUS_EFFECT_PARALYZED)) //I've fallen and I can't get up. simple_status_hud.icon_state = "knockdown" return TRUE - if(IsStun()) + if(has_status_effect(STATUS_EFFECT_STUN)) simple_status_hud.icon_state = "stun" return TRUE - if(IsStaggered()) + if(has_status_effect(STATUS_EFFECT_STAGGER)) simple_status_hud.icon_state = "stagger" return TRUE if(slowdown) @@ -287,7 +287,7 @@ xeno_debuff.overlays.Cut() xeno_debuff.icon_state = "" - if(stat != DEAD && IsMute()) + if(stat != DEAD && has_status_effect(STATUS_EFFECT_MUTED)) xeno_debuff.overlays += hunter_silence_image if(HAS_TRAIT(src, TRAIT_HIVE_TARGET)) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index c978f0e3c86..c141b71041e 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -592,7 +592,7 @@ else stun = knockback ? knockback_stun_amount : crush_stun_amount - if(!M.IsStun() && !M.IsParalyzed() && !isxenoqueen(M) && !isxenoking(M)) //Prevent chain stunning. Queen and King are protected. + if(!M.has_status_effect(STATUS_EFFECT_STUN) && !M.has_status_effect(STATUS_EFFECT_PARALYZED) && !isxenoqueen(M) && !isxenoking(M)) //Prevent chain stunning. Queen and King are protected. M.apply_effects(stun,weaken) return ..() diff --git a/code/game/objects/machinery/overwatch.dm b/code/game/objects/machinery/overwatch.dm index 9411f2a0039..00c4bc6f461 100644 --- a/code/game/objects/machinery/overwatch.dm +++ b/code/game/objects/machinery/overwatch.dm @@ -909,7 +909,7 @@ GLOBAL_LIST_EMPTY(active_cas_targets) to_chat(src, span_warning("You cannot give an order in your current state.")) return - if(IsMute()) + if(has_status_effect(STATUS_EFFECT_MUTED)) to_chat(src, span_warning("You cannot give an order while muted.")) return diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 30011df9edb..23bebb220de 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -431,7 +431,7 @@ /mob/living/proc/on_closet_dump(obj/structure/closet/origin) SetStun(origin.closet_stun_delay)//Action delay when going out of a closet - if(!lying_angle && IsStun()) + if(!lying_angle && has_status_effect(STATUS_EFFECT_STUN)) balloon_alert_to_viewers("Gets out of [origin]", ignored_mobs = src) balloon_alert(src, "You struggle to get your bearings") diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index fa571c809ad..7ca43d840f6 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -301,7 +301,7 @@ else visible_message(span_notice("[usr] climbs into [src]."), 3) M.forceMove(src) - if(M.health > -100 && (M.health < 0 || M.IsSleeping())) + if(M.health > -100 && (M.health < 0 || M.has_status_effect(STATUS_EFFECT_SLEEPING))) to_chat(M, span_boldnotice("You feel a cold liquid surround you. Your skin starts to freeze up.")) occupant = M occupant.time_entered_cryo = world.time diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 1e6dd1d1076..0aa70b21888 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -16,7 +16,7 @@ GLOBAL_LIST_INIT(dream_topics, list( /mob/living/carbon/proc/dream() if(!dream_amounts) dream_amounts = rand(1,5) - if(!IsUnconscious()) + if(!has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) dream_amounts = 0 return FALSE to_chat(src, span_notice("... [pick(GLOB.dream_topics)] ...")) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index d1cf923526a..d1df5b0f13d 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -99,17 +99,17 @@ to_chat(shaker, span_highdanger("This player has been admin slept, do not interfere with them.")) return - if(lying_angle || IsSleeping()) + if(lying_angle || has_status_effect(STATUS_EFFECT_SLEEPING)) if(client) AdjustSleeping(-10 SECONDS) - if(!IsSleeping()) + if(!has_status_effect(STATUS_EFFECT_SLEEPING)) set_resting(FALSE) shaker.visible_message(span_notice("[shaker] shakes [src] trying to get [p_them()] up!"), span_notice("You shake [src] trying to get [p_them()] up!"), null, 4) AdjustUnconscious(-6 SECONDS) AdjustStun(-6 SECONDS) - if(IsParalyzed()) + if(has_status_effect(STATUS_EFFECT_PARALYZED)) if(staminaloss) adjustStaminaLoss(-20, FALSE) AdjustParalyzed(-6 SECONDS) @@ -234,7 +234,7 @@ if(species.species_flags & ROBOTIC_LIMBS) to_chat(src, span_warning("Your artificial body does not require sleep.")) return - if(IsSleeping()) + if(has_status_effect(STATUS_EFFECT_SLEEPING)) to_chat(src, span_warning("You are already sleeping")) return if(tgui_alert(src, "You sure you want to sleep for a while?", "Sleep", list("Yes","No")) == "Yes") diff --git a/code/modules/mob/living/carbon/carbon_status_procs.dm b/code/modules/mob/living/carbon/carbon_status_procs.dm index 54b54c172fc..db465952f12 100644 --- a/code/modules/mob/living/carbon/carbon_status_procs.dm +++ b/code/modules/mob/living/carbon/carbon_status_procs.dm @@ -30,3 +30,9 @@ if(old_nutrition > NUTRITION_OVERFED) return add_movespeed_modifier(MOVESPEED_ID_HUNGRY, TRUE, 0, NONE, TRUE, 0.5) + +/mob/living/carbon/dizzy(amount) + dizziness = clamp(dizziness + amount, 0, 1000) + + if(dizziness > 100 && !is_dizzy) + INVOKE_ASYNC(src, PROC_REF(dizzy_process)) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 267107bda31..e39a9fc3660 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -97,7 +97,7 @@ if(staminaloss > -max_stamina) handle_staminaloss() - if(IsSleeping()) + if(has_status_effect(STATUS_EFFECT_SLEEPING)) 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. diff --git a/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm b/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm index 49894ad7bb5..893808f8ee6 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm @@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(boiler_glob_image_list, list( gas = new /datum/effect_system/smoke_spread/xeno/acid/light owner.add_movespeed_modifier(MOVESPEED_ID_BOILER_DUMP, TRUE, 0, NONE, TRUE, BOILER_DUMP_SPEED) - if(caster.IsStun() || caster.IsParalyzed()) + if(caster.has_status_effect(STATUS_EFFECT_STUN) || caster.has_status_effect(STATUS_EFFECT_PARALYZED)) to_chat(caster, span_xenohighdanger("We try to emit acid but are disabled!")) owner.remove_movespeed_modifier(MOVESPEED_ID_BOILER_DUMP) toggle_particles(FALSE) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/carrier/carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/carrier/carrier.dm index 7b7390f21c7..428b3ba7b46 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/carrier/carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/carrier/carrier.dm @@ -52,7 +52,7 @@ if(stat == DEAD) hugger_overlays_icon.overlays += mutable_appearance(effects_icon, "clinger_[i] Knocked Down") else if(lying_angle) - if((resting || IsSleeping()) && (!IsParalyzed() && !IsUnconscious() && health > 0)) + if((resting || has_status_effect(STATUS_EFFECT_SLEEPING)) && (!has_status_effect(STATUS_EFFECT_PARALYZED) && !has_status_effect(STATUS_EFFECT_UNCONSCIOUS) && health > 0)) hugger_overlays_icon.overlays += mutable_appearance(effects_icon, "clinger_[i] Sleeping") else hugger_overlays_icon.overlays += mutable_appearance(effects_icon, "clinger_[i] Knocked Down") 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 24817534501..7138d5ce902 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 @@ -204,7 +204,7 @@ add_cooldown() succeed_activate() - if(X.IsStaggered()) //If we got staggered, return + if(X.has_status_effect(STATUS_EFFECT_STAGGER)) //If we got staggered, return to_chat(X, span_xenowarning("We try to emit toxins but are staggered!")) return fail_activate() @@ -237,11 +237,11 @@ if(/datum/reagent/toxin/acid) emitted_gas = new /datum/effect_system/smoke_spread/xeno/acid/light(defiler_owner) - if(defiler_owner.IsStaggered()) //If we got staggered, return + if(defiler_owner.has_status_effect(STATUS_EFFECT_STAGGER)) //If we got staggered, return to_chat(defiler_owner, span_xenowarning("We try to emit toxins but are staggered!")) toggle_particles(FALSE) return - if(defiler_owner.IsStun() || defiler_owner.IsParalyzed()) + if(defiler_owner.has_status_effect(STATUS_EFFECT_STUN) || defiler_owner.has_status_effect(STATUS_EFFECT_PARALYZED)) to_chat(defiler_owner, span_xenowarning("We try to emit toxins but are disabled!")) toggle_particles(FALSE) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/larva/larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/larva/larva.dm index e366c34f66d..e422061bc9d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/larva/larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/larva/larva.dm @@ -81,7 +81,7 @@ icon_state = "[bloody][base_icon_state] Cuff" else if(lying_angle) - if((resting || IsSleeping()) && (!IsParalyzed() && !IsUnconscious() && health > 0)) + if((resting || has_status_effect(STATUS_EFFECT_SLEEPING)) && (!has_status_effect(STATUS_EFFECT_PARALYZED) && !has_status_effect(STATUS_EFFECT_UNCONSCIOUS) && health > 0)) icon_state = "[bloody][base_icon_state] Sleeping" else icon_state = "[bloody][base_icon_state] Stunned" @@ -195,7 +195,7 @@ icon_state = "[base_icon_state] Cuff" else if(lying_angle) - if((resting || IsSleeping()) && (!IsParalyzed() && !IsUnconscious() && health > 0)) + if((resting || has_status_effect(STATUS_EFFECT_SLEEPING)) && (!has_status_effect(STATUS_EFFECT_PARALYZED) && !has_status_effect(STATUS_EFFECT_UNCONSCIOUS) && health > 0)) icon_state = "[base_icon_state] Sleeping" else icon_state = "[base_icon_state] Stunned" diff --git a/code/modules/mob/living/carbon/xenomorph/embryo.dm b/code/modules/mob/living/carbon/xenomorph/embryo.dm index 01ceed82799..d057b92cba9 100644 --- a/code/modules/mob/living/carbon/xenomorph/embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/embryo.dm @@ -109,7 +109,7 @@ affected_mob.emote("[pick("sneeze", "cough")]") if(4) if(prob(1)) - if(!affected_mob.IsUnconscious()) + if(!affected_mob.has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) affected_mob.visible_message(span_danger("\The [affected_mob] starts shaking uncontrollably!"), \ span_danger("You start shaking uncontrollably!")) affected_mob.Unconscious(20 SECONDS) diff --git a/code/modules/mob/living/carbon/xenomorph/update_icons.dm b/code/modules/mob/living/carbon/xenomorph/update_icons.dm index 55fc77ac05b..f598d50581f 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -28,7 +28,7 @@ else if(HAS_TRAIT(src, TRAIT_BURROWED)) icon_state = "[xeno_caste.caste_name] Burrowed" else if(lying_angle) - if((resting || IsSleeping()) && (!IsParalyzed() && !IsUnconscious() && health > 0)) + if((resting || has_status_effect(STATUS_EFFECT_SLEEPING)) && (!has_status_effect(STATUS_EFFECT_PARALYZED) && !has_status_effect(STATUS_EFFECT_UNCONSCIOUS) && health > 0)) icon_state = "[xeno_caste.caste_name] Sleeping" else icon_state = "[xeno_caste.caste_name] Knocked Down" @@ -119,7 +119,7 @@ health_thresholds = 3 var/overlay_to_show if(lying_angle) - if((resting || IsSleeping()) && (!IsParalyzed() && !IsUnconscious() && health > 0)) + if((resting || has_status_effect(STATUS_EFFECT_SLEEPING)) && (!has_status_effect(STATUS_EFFECT_PARALYZED) && !has_status_effect(STATUS_EFFECT_UNCONSCIOUS) && health > 0)) overlay_to_show = "wounded_resting_[health_thresholds]" else overlay_to_show = "wounded_stunned_[health_thresholds]" @@ -183,7 +183,7 @@ icon_state = "" return layer = layer + 0.4 - if((!owner.lying_angle && !owner.resting && !owner.IsSleeping())) + if((!owner.lying_angle && !owner.resting && !owner.has_status_effect(STATUS_EFFECT_SLEEPING))) icon_state = "alien_fire" else icon_state = "alien_fire_lying" diff --git a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm index 60ebf5a4e94..9d7fd1df2b0 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm @@ -553,7 +553,7 @@ playsound(C, SFX_ALIEN_DROOL, 15, TRUE) do face_atom(C) - if(IsStaggered()) + if(has_status_effect(STATUS_EFFECT_STAGGER)) return FALSE do_attack_animation(C) C.reagents.add_reagent(toxin, transfer_amount) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7fd5a5060d6..e24eab86296 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -568,37 +568,6 @@ else smokecloak_off() - -/* -adds a dizziness amount to a mob -use this rather than directly changing var/dizziness -since this ensures that the dizzy_process proc is started -currently only humans get dizzy -value of dizziness ranges from 0 to 1000 -below 100 is not dizzy -*/ - -/mob/living/carbon/dizzy(amount) - dizziness = clamp(dizziness + amount, 0, 1000) - - if(dizziness > 100 && !is_dizzy) - INVOKE_ASYNC(src, PROC_REF(dizzy_process)) - -/mob/living/proc/dizzy_process() - is_dizzy = TRUE - while(dizziness > 100) - if(client) - var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 - client.pixel_x = amplitude * sin(0.008 * dizziness * world.time) - client.pixel_y = amplitude * cos(0.008 * dizziness * world.time) - - sleep(0.1 SECONDS) - //endwhile - reset the pixel offsets to zero - is_dizzy = FALSE - if(client) - client.pixel_x = 0 - client.pixel_y = 0 - /mob/living/proc/update_action_button_icons() for(var/X in actions) var/datum/action/A = X diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm deleted file mode 100644 index 11ec9b77c9c..00000000000 --- a/code/modules/mob/living/status_procs.dm +++ /dev/null @@ -1,933 +0,0 @@ -////////////////////////////// STUN //////////////////////////////////// - -///Returns if stunned -/mob/living/proc/IsStun() - return has_status_effect(STATUS_EFFECT_STUN) - -///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 - -///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(absorb_stun(amount, ignore_canstun)) - return - - 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(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 - -///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(absorb_stun(amount, ignore_canstun)) - return - - 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) - - return current_stun - -///////////////////////////////// KNOCKDOWN ///////////////////////////////////// -///Returns if knockeddown -/mob/living/proc/IsKnockdown() - return has_status_effect(STATUS_EFFECT_KNOCKDOWN) - -///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 - -///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) - -///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(absorb_stun(amount, ignore_canstun)) - return - - 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(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) - - 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(absorb_stun(amount, ignore_canstun)) - return - - 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 - -///////////////////////////////// IMMOBILIZED ///////////////////////////////////// -///Returns if immobilized -/mob/living/proc/IsImmobilized() - return has_status_effect(STATUS_EFFECT_IMMOBILIZED) - -///Returns remaining immobilize duration -/mob/living/proc/AmountImmobilized() - var/datum/status_effect/incapacitating/immobilized/current_immobilized = IsImmobilized() - return current_immobilized ? current_immobilized.duration - world.time : 0 - -///Applies immobilize only if not currently applied -/mob/living/proc/ImmobilizeNoChain(amount, ignore_canstun = FALSE) - if(status_flags & GODMODE) - return - if(IsImmobilized()) - return 0 - return Immobilize(amount, ignore_canstun) - -///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(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) - - 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(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(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 ////////////////////////////////// -///Returns if paralyzed -/mob/living/proc/IsParalyzed() - return has_status_effect(STATUS_EFFECT_PARALYZED) - -///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 - -///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) - -///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(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) - if(amount > MAX_PARALYSE_AMOUNT_FOR_PARALYSE_RESISTANT * 4) - amount = MAX_PARALYSE_AMOUNT_FOR_PARALYSE_RESISTANT - return ..() - amount /= 4 - return ..() - -///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(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) - - 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(absorb_stun(amount, ignore_canstun)) - return - - 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 - -/////////////////////////////////// SLEEPING //////////////////////////////////// -///Returns if sleeping -/mob/living/proc/IsSleeping() - return has_status_effect(STATUS_EFFECT_SLEEPING) - -///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 - -///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(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 - -///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(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 - -///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(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 //////////////////////////////////// - -/mob/living/proc/IsAdminSleeping() - return has_status_effect(STATUS_EFFECT_ADMINSLEEP) - -/mob/living/proc/ToggleAdminSleep() - var/datum/status_effect/incapacitating/adminsleep/S = IsAdminSleeping() - if(S) - qdel(S) - else - S = apply_status_effect(STATUS_EFFECT_ADMINSLEEP) - return S - -/mob/living/proc/SetAdminSleep(remove = FALSE) - var/datum/status_effect/incapacitating/adminsleep/S = IsAdminSleeping() - if(remove) - qdel(S) - else - S = apply_status_effect(STATUS_EFFECT_ADMINSLEEP) - return S - -//////////////////UNCONSCIOUS -///Returns if unconscious -/mob/living/proc/IsUnconscious() - return has_status_effect(STATUS_EFFECT_UNCONSCIOUS) - -///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 - -///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(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 - -///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(absorb_stun(amount, ignore_canstun)) - return - - 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(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 if confused -/mob/living/proc/IsConfused() - return has_status_effect(STATUS_EFFECT_CONFUSED) - -///Returns remaining confused duration -/mob/living/proc/AmountConfused() - var/datum/status_effect/incapacitating/confused/current_confused = IsConfused() - return current_confused ? current_confused.duration - world.time : 0 - -///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(absorb_stun(amount, ignore_canstun)) - return - - 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(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) - - 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(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 ///////////////////////////////////// - -/mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message) -//adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stun/examined, if any - if(!islist(stun_absorption)) - stun_absorption = list() - if(stun_absorption[key]) - stun_absorption[key]["end_time"] = world.time + duration - stun_absorption[key]["priority"] = priority - stun_absorption[key]["stuns_absorbed"] = 0 - else - stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \ - "visible_message" = message, "self_message" = self_message, "examine_message" = examine_message) - -/mob/living/proc/absorb_stun(amount, ignoring_flag_presence) - if(amount < 0 || stat || ignoring_flag_presence || !islist(stun_absorption)) - return FALSE - if(!amount) - amount = 0 - var/priority_absorb_key - var/highest_priority - for(var/i in stun_absorption) - if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority)) - priority_absorb_key = stun_absorption[i] - highest_priority = priority_absorb_key["priority"] - if(priority_absorb_key) - if(amount) //don't spam up the chat for continuous stuns - if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"]) - if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"]) - visible_message(span_warning("[src][priority_absorb_key["visible_message"]]"), span_boldwarning("[priority_absorb_key["self_message"]]")) - else if(priority_absorb_key["visible_message"]) - visible_message(span_warning("[src][priority_absorb_key["visible_message"]]")) - else if(priority_absorb_key["self_message"]) - to_chat(src, span_boldwarning("[priority_absorb_key["self_message"]]")) - priority_absorb_key["stuns_absorbed"] += amount - return TRUE - -/mob/living/proc/jitter(amount) - jitteriness = clamp(jitteriness + amount,0, 1000) - -/mob/living/proc/dizzy(amount) - return // For the time being, only carbons get dizzy. - -/mob/living/proc/blind_eyes(amount) - if(amount>0) - var/old_eye_blind = eye_blind - eye_blind = max(eye_blind, amount) - if(!old_eye_blind) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind) - -/mob/living/proc/adjust_blindness(amount) - if(amount>0) - var/old_eye_blind = eye_blind - eye_blind += amount - if(!old_eye_blind) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind) - else if(eye_blind) - var/blind_minimum = 0 - if(stat != CONSCIOUS) - blind_minimum = 1 - if(isliving(src)) - var/mob/living/L = src - if(!L.has_vision()) - blind_minimum = 1 - eye_blind = max(eye_blind+amount, blind_minimum) - if(!eye_blind) - clear_fullscreen("blind") - -/mob/living/proc/set_blindness(amount) - if(amount>0) - var/old_eye_blind = eye_blind - eye_blind = amount - if(client && !old_eye_blind) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind) - else if(eye_blind) - var/blind_minimum = 0 - if(stat != CONSCIOUS) - blind_minimum = 1 - if(isliving(src)) - var/mob/living/L = src - if(!L.has_vision()) - blind_minimum = 1 - eye_blind = blind_minimum - if(!eye_blind) - clear_fullscreen("blind") - -/mob/living/proc/blur_eyes(amount) - if(amount>0) - eye_blurry = max(amount, eye_blurry) - update_eye_blur() - -/mob/living/proc/adjust_blurriness(amount) - eye_blurry = max(eye_blurry+amount, 0) - update_eye_blur() - -/mob/living/proc/set_blurriness(amount) - eye_blurry = max(amount, 0) - update_eye_blur() - -/mob/living/proc/update_eye_blur() - if(!client) - return - var/atom/movable/screen/plane_master/floor/OT = locate(/atom/movable/screen/plane_master/floor) in client.screen - var/atom/movable/screen/plane_master/game_world/GW = locate(/atom/movable/screen/plane_master/game_world) in client.screen - GW.backdrop(src) - OT.backdrop(src) - -/mob/living/proc/adjust_ear_damage(damage = 0, deaf = 0) - ear_damage = max(0, ear_damage + damage) - ear_deaf = max((disabilities & DEAF|| ear_damage >= 100) ? 1 : 0, ear_deaf + deaf) - - -/mob/living/proc/set_ear_damage(damage = 0, deaf = 0) - if(!isnull(damage)) - ear_damage = damage - if(!isnull(deaf)) - ear_deaf = max((disabilities & DEAF|| ear_damage >= 100) ? 1 : 0, deaf) - -///Modify mob's drugginess in either direction, minimum zero. Adds or removes druggy overlay as appropriate. -/mob/living/proc/adjust_drugginess(amount) - druggy = max(druggy + amount, 0) - if(druggy) - overlay_fullscreen("high", /atom/movable/screen/fullscreen/high) - else - clear_fullscreen("high") - -///Sets mob's drugginess to provided amount, minimum 0. Adds or removes druggy overlay as appropriate. -/mob/living/proc/set_drugginess(amount) - druggy = max(amount, 0) - if(druggy) - overlay_fullscreen("high", /atom/movable/screen/fullscreen/high) - else - clear_fullscreen("high") - - -/mob/living/proc/adjust_bodytemperature(amount, min_temp = 0, max_temp = INFINITY) - if(bodytemperature < min_temp || bodytemperature > max_temp) - return - . = bodytemperature - bodytemperature = clamp(bodytemperature + amount, min_temp, max_temp) - - -/mob/living/carbon/human/adjust_bodytemperature(amount, min_temp = 0, max_temp = INFINITY) - . = ..() - adjust_bodytemperature_speed_mod(.) - - -/mob/living/carbon/human/proc/adjust_bodytemperature_speed_mod(old_temperature) - if(bodytemperature < species.cold_level_1) - if(old_temperature < species.cold_level_1) - return - add_movespeed_modifier(MOVESPEED_ID_COLD, TRUE, 0, NONE, TRUE, 2) - else if(old_temperature < species.cold_level_1) - remove_movespeed_modifier(MOVESPEED_ID_COLD) - -////////////////////////////// STAGGER //////////////////////////////////// - -///Returns if staggered -/mob/living/proc/IsStaggered() - return has_status_effect(STATUS_EFFECT_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 - -///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((!(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 - - 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(current_stagger) - current_stagger.duration = world.time + amount - else - current_stagger = apply_status_effect(STATUS_EFFECT_STAGGER, amount) - - return current_stagger - -///Applies stagger or adds to existing duration -/mob/living/proc/adjust_stagger(amount, ignore_canstun = FALSE) - 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 - - 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 //////////////////////////////////// - -///Returns number of slowdown stacks if any -/mob/living/proc/IsSlowed() //If we're slowed - return slowdown - -///Where the magic happens. Actually applies slow stacks. -/mob/living/proc/set_slowdown(amount) - if(slowdown == amount) - return - if(amount > 0 && HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE)) //We're immune to slowdown - return - SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLOWDOWN, amount) - slowdown = amount - if(slowdown) - add_movespeed_modifier(MOVESPEED_ID_STAGGERSTUN, TRUE, 0, NONE, TRUE, slowdown) - return - remove_movespeed_modifier(MOVESPEED_ID_STAGGERSTUN) - -///This is where we normalize the set_slowdown input to be at least 0 -/mob/living/proc/adjust_slowdown(amount) - if(amount > 0) - if(HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE)) - return slowdown - set_slowdown(max(slowdown, amount)) //Slowdown overlaps rather than stacking. - else - set_slowdown(max(slowdown + amount, 0)) - return slowdown - -/mob/living/proc/add_slowdown(amount, capped = 0) - if(HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE)) - return - adjust_slowdown(amount * STANDARD_SLOWDOWN_REGEN) - -///Standard slowdown regen called by life.dm -/mob/living/proc/handle_slowdown() - if(slowdown) - adjust_slowdown(-STANDARD_SLOWDOWN_REGEN) - return slowdown - -/mob/living/carbon/xenomorph/add_slowdown(amount) - if(HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE) || is_charging >= CHARGE_ON) - return - adjust_slowdown(amount * XENO_SLOWDOWN_REGEN) - -////////////////////////////// MUTE //////////////////////////////////// - -///Checks to see if we're muted -/mob/living/proc/IsMute() - return has_status_effect(STATUS_EFFECT_MUTED) - -///Checks the duration left on our mute status effect -/mob/living/proc/AmountMute() - var/datum/status_effect/mute/M = IsMute() - if(M) - return M.duration - world.time - return 0 - -///Mutes the target for the stated duration -/mob/living/proc/Mute(amount) //Can't go below remaining duration - if(status_flags & GODMODE) - return - if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_MUTE, amount) & COMPONENT_NO_MUTE) - return - var/datum/status_effect/mute/M = IsMute() - if(M) - M.duration = max(world.time + amount, M.duration) - else if(amount > 0) - M = apply_status_effect(STATUS_EFFECT_MUTED, amount) - return M - -//Sets remaining mute duration -/mob/living/proc/SetMute(amount) - if(status_flags & GODMODE) - return - if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_MUTE, amount) & COMPONENT_NO_MUTE) - return - var/datum/status_effect/mute/M = IsMute() - - if(M) - if(amount <= 0) - qdel(M) - return - - M.duration = world.time + amount - return - - M = apply_status_effect(STATUS_EFFECT_MUTED, amount) - return M - -///Adds to remaining mute duration -/mob/living/proc/AdjustMute(amount) - if(!amount) - return - if(status_flags & GODMODE) - return - if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_MUTE, amount) & COMPONENT_NO_MUTE) - return - - var/datum/status_effect/mute/M = IsMute() - if(M) - M.duration += amount - else if(amount > 0) - M = apply_status_effect(STATUS_EFFECT_MUTED, amount) - return M - -///////////////////////////////// Irradiated ////////////////////////////////// - -///Returns whether the mob is irradiated or not -/mob/living/proc/is_irradiated() - return has_status_effect(STATUS_EFFECT_IRRADIATED) - -///How many deciseconds remain in our irradiated status effect -/mob/living/proc/amount_irradiated() - var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE) - if(irradiated) - return irradiated.duration - world.time - return 0 - -///Applies irradiation from a source -/mob/living/proc/irradiate(amount, ignore_canstun = FALSE) //Can't go below remaining duration - if(status_flags & GODMODE) - return - var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE) - if(irradiated) - irradiated.duration = max(world.time + amount, irradiated.duration) - else if(amount > 0) - irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount) - return irradiated - -///Sets irradiation duration -/mob/living/proc/set_radiation(amount, ignore_canstun = FALSE) - if(status_flags & GODMODE) - return - var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE) - if(amount <= 0) - if(irradiated) - qdel(irradiated) - else - if(irradiated) - irradiated.duration = world.time + amount - else - irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount) - return irradiated - -///Modifies irradiation duration -/mob/living/proc/adjust_radiation(amount, ignore_canstun = FALSE) - if(status_flags & GODMODE) - return - var/datum/status_effect/incapacitating/irradiated/irradiated = is_irradiated(FALSE) - if(irradiated) - irradiated.duration += amount - else if(amount > 0) - irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount) - return irradiated diff --git a/code/modules/mob/living/status_procs/blindness.dm b/code/modules/mob/living/status_procs/blindness.dm new file mode 100644 index 00000000000..2ecfb8c317d --- /dev/null +++ b/code/modules/mob/living/status_procs/blindness.dm @@ -0,0 +1,43 @@ +/mob/living/proc/blind_eyes(amount) + if(amount <= 0) + return + var/old_eye_blind = eye_blind + eye_blind = max(eye_blind, amount) + if(!old_eye_blind) + overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind) + +/mob/living/proc/adjust_blindness(amount) + if(amount > 0) + var/old_eye_blind = eye_blind + eye_blind += amount + if(!old_eye_blind) + overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind) + else if(eye_blind) + var/blind_minimum = 0 + if(stat != CONSCIOUS) + blind_minimum = 1 + if(isliving(src)) + var/mob/living/L = src + if(!L.has_vision()) + blind_minimum = 1 + eye_blind = max(eye_blind+amount, blind_minimum) + if(!eye_blind) + clear_fullscreen("blind") + +/mob/living/proc/set_blindness(amount) + if(amount > 0) + var/old_eye_blind = eye_blind + eye_blind = amount + if(client && !old_eye_blind) + overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind) + else if(eye_blind) + var/blind_minimum = 0 + if(stat != CONSCIOUS) + blind_minimum = 1 + if(isliving(src)) + var/mob/living/L = src + if(!L.has_vision()) + blind_minimum = 1 + eye_blind = blind_minimum + if(!eye_blind) + clear_fullscreen("blind") diff --git a/code/modules/mob/living/status_procs/blur.dm b/code/modules/mob/living/status_procs/blur.dm new file mode 100644 index 00000000000..cc54da105c4 --- /dev/null +++ b/code/modules/mob/living/status_procs/blur.dm @@ -0,0 +1,20 @@ +/mob/living/proc/blur_eyes(amount) + if(amount > 0) + eye_blurry = max(amount, eye_blurry) + update_eye_blur() + +/mob/living/proc/adjust_blurriness(amount) + eye_blurry = max(eye_blurry + amount, 0) + update_eye_blur() + +/mob/living/proc/set_blurriness(amount) + eye_blurry = max(amount, 0) + update_eye_blur() + +/mob/living/proc/update_eye_blur() + if(!client) + return + var/atom/movable/screen/plane_master/floor/OT = locate(/atom/movable/screen/plane_master/floor) in client.screen + var/atom/movable/screen/plane_master/game_world/GW = locate(/atom/movable/screen/plane_master/game_world) in client.screen + GW.backdrop(src) + OT.backdrop(src) diff --git a/code/modules/mob/living/status_procs/confused.dm b/code/modules/mob/living/status_procs/confused.dm new file mode 100644 index 00000000000..2b73d986d2c --- /dev/null +++ b/code/modules/mob/living/status_procs/confused.dm @@ -0,0 +1,65 @@ +///Returns remaining confused duration +/mob/living/proc/AmountConfused() + var/datum/status_effect/incapacitating/confused/current_confused = has_status_effect(STATUS_EFFECT_CONFUSED) + return current_confused ? current_confused.duration - world.time : 0 + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/confused/current_confused = has_status_effect(STATUS_EFFECT_CONFUSED) + 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 = has_status_effect(STATUS_EFFECT_CONFUSED) + 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(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) + + 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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/confused/current_confused = has_status_effect(STATUS_EFFECT_CONFUSED) + if(current_confused) + current_confused.duration += amount + else if(amount > 0) + current_confused = apply_status_effect(STATUS_EFFECT_CONFUSED, amount) + + return current_confused diff --git a/code/modules/mob/living/status_procs/dizzy.dm b/code/modules/mob/living/status_procs/dizzy.dm new file mode 100644 index 00000000000..28dcb88817b --- /dev/null +++ b/code/modules/mob/living/status_procs/dizzy.dm @@ -0,0 +1,20 @@ +/// Adds a dizziness amount to a mob, use this rather than directly changing var/dizziness +/// since this ensures that the dizzy_process proc is started, currently only carbons get dizzy +/// value of dizziness ranges from 0 to 1000, below 100 is not dizzy +/mob/living/proc/dizzy(amount) + return + +/mob/living/proc/dizzy_process() + is_dizzy = TRUE + while(dizziness > 100) + if(client) + var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 + client.pixel_x = amplitude * sin(0.008 * dizziness * world.time) + client.pixel_y = amplitude * cos(0.008 * dizziness * world.time) + + sleep(0.1 SECONDS) + //endwhile - reset the pixel offsets to zero + is_dizzy = FALSE + if(client) + client.pixel_x = 0 + client.pixel_y = 0 diff --git a/code/modules/mob/living/status_procs/drugginess.dm b/code/modules/mob/living/status_procs/drugginess.dm new file mode 100644 index 00000000000..d99dda16e58 --- /dev/null +++ b/code/modules/mob/living/status_procs/drugginess.dm @@ -0,0 +1,15 @@ +///Modify mob's drugginess in either direction, minimum zero. Adds or removes druggy overlay as appropriate. +/mob/living/proc/adjust_drugginess(amount) + druggy = max(druggy + amount, 0) + if(druggy) + overlay_fullscreen("high", /atom/movable/screen/fullscreen/high) + else + clear_fullscreen("high") + +///Sets mob's drugginess to provided amount, minimum 0. Adds or removes druggy overlay as appropriate. +/mob/living/proc/set_drugginess(amount) + druggy = max(amount, 0) + if(druggy) + overlay_fullscreen("high", /atom/movable/screen/fullscreen/high) + else + clear_fullscreen("high") diff --git a/code/modules/mob/living/status_procs/ear_damage.dm b/code/modules/mob/living/status_procs/ear_damage.dm new file mode 100644 index 00000000000..d8498b0a2fb --- /dev/null +++ b/code/modules/mob/living/status_procs/ear_damage.dm @@ -0,0 +1,9 @@ +/mob/living/proc/adjust_ear_damage(damage = 0, deaf = 0) + ear_damage = max(0, ear_damage + damage) + ear_deaf = max((disabilities & DEAF|| ear_damage >= 100) ? 1 : 0, ear_deaf + deaf) + +/mob/living/proc/set_ear_damage(damage = 0, deaf = 0) + if(!isnull(damage)) + ear_damage = damage + if(!isnull(deaf)) + ear_deaf = max((disabilities & DEAF|| ear_damage >= 100) ? 1 : 0, deaf) diff --git a/code/modules/mob/living/status_procs/immobilize.dm b/code/modules/mob/living/status_procs/immobilize.dm new file mode 100644 index 00000000000..c461acb0c97 --- /dev/null +++ b/code/modules/mob/living/status_procs/immobilize.dm @@ -0,0 +1,73 @@ +///Returns remaining immobilize duration +/mob/living/proc/AmountImmobilized() + var/datum/status_effect/incapacitating/immobilized/current_immobilized = has_status_effect(STATUS_EFFECT_IMMOBILIZED) + return current_immobilized ? current_immobilized.duration - world.time : 0 + +///Applies immobilize only if not currently applied +/mob/living/proc/ImmobilizeNoChain(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) + return + if(has_status_effect(STATUS_EFFECT_IMMOBILIZED)) + return 0 + return Immobilize(amount, ignore_canstun) + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/immobilized/current_immobilized = has_status_effect(STATUS_EFFECT_IMMOBILIZED) + 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) + + 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 = has_status_effect(STATUS_EFFECT_IMMOBILIZED) + 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(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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/immobilized/current_immobilized = has_status_effect(STATUS_EFFECT_IMMOBILIZED) + if(current_immobilized) + current_immobilized.duration += amount + else if(amount > 0) + current_immobilized = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) + + return current_immobilized diff --git a/code/modules/mob/living/status_procs/irradiated.dm b/code/modules/mob/living/status_procs/irradiated.dm new file mode 100644 index 00000000000..8e304d17ddf --- /dev/null +++ b/code/modules/mob/living/status_procs/irradiated.dm @@ -0,0 +1,43 @@ +///How many deciseconds remain in our irradiated status effect +/mob/living/proc/amount_irradiated() + var/datum/status_effect/incapacitating/irradiated/irradiated = has_status_effect(STATUS_EFFECT_IRRADIATED) + if(irradiated) + return irradiated.duration - world.time + return 0 + +///Applies irradiation from a source +/mob/living/proc/irradiate(amount, ignore_canstun = FALSE) //Can't go below remaining duration + if(status_flags & GODMODE) + return + var/datum/status_effect/incapacitating/irradiated/irradiated = has_status_effect(STATUS_EFFECT_IRRADIATED) + if(irradiated) + irradiated.duration = max(world.time + amount, irradiated.duration) + else if(amount > 0) + irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount) + return irradiated + +///Sets irradiation duration +/mob/living/proc/set_radiation(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) + return + var/datum/status_effect/incapacitating/irradiated/irradiated = has_status_effect(STATUS_EFFECT_IRRADIATED) + if(amount <= 0) + if(irradiated) + qdel(irradiated) + else + if(irradiated) + irradiated.duration = world.time + amount + else + irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount) + return irradiated + +///Modifies irradiation duration +/mob/living/proc/adjust_radiation(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) + return + var/datum/status_effect/incapacitating/irradiated/irradiated = has_status_effect(STATUS_EFFECT_IRRADIATED) + if(irradiated) + irradiated.duration += amount + else if(amount > 0) + irradiated = apply_status_effect(STATUS_EFFECT_IRRADIATED, amount) + return irradiated diff --git a/code/modules/mob/living/status_procs/jitter.dm b/code/modules/mob/living/status_procs/jitter.dm new file mode 100644 index 00000000000..ecd0e49ed3b --- /dev/null +++ b/code/modules/mob/living/status_procs/jitter.dm @@ -0,0 +1,2 @@ +/mob/living/proc/jitter(amount) + jitteriness = clamp(jitteriness + amount, 0, 1000) diff --git a/code/modules/mob/living/status_procs/knockdown.dm b/code/modules/mob/living/status_procs/knockdown.dm new file mode 100644 index 00000000000..b154e6616eb --- /dev/null +++ b/code/modules/mob/living/status_procs/knockdown.dm @@ -0,0 +1,73 @@ +///Returns remaining knockdown duration +/mob/living/proc/AmountKnockdown() + var/datum/status_effect/incapacitating/knockdown/current_knockdown = has_status_effect(STATUS_EFFECT_KNOCKDOWN) + return current_knockdown ? current_knockdown.duration - world.time : 0 + +///Applies knockdown only if not currently applied +/mob/living/proc/KnockdownNoChain(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) + return + if(has_status_effect(STATUS_EFFECT_KNOCKDOWN)) + return 0 + return Knockdown(amount, ignore_canstun) + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/knockdown/current_knockdown = has_status_effect(STATUS_EFFECT_KNOCKDOWN) + 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 = has_status_effect(STATUS_EFFECT_KNOCKDOWN) + 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(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) + + 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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/knockdown/current_knockdown = has_status_effect(STATUS_EFFECT_KNOCKDOWN) + if(current_knockdown) + current_knockdown.duration += amount + else if(amount > 0) + current_knockdown = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) + + return current_knockdown diff --git a/code/modules/mob/living/status_procs/mute.dm b/code/modules/mob/living/status_procs/mute.dm new file mode 100644 index 00000000000..154aab00755 --- /dev/null +++ b/code/modules/mob/living/status_procs/mute.dm @@ -0,0 +1,54 @@ +///Checks the duration left on our mute status effect +/mob/living/proc/AmountMute() + var/datum/status_effect/mute/M = has_status_effect(STATUS_EFFECT_MUTED) + if(M) + return M.duration - world.time + return 0 + +///Mutes the target for the stated duration +/mob/living/proc/Mute(amount) //Can't go below remaining duration + if(status_flags & GODMODE) + return + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_MUTE, amount) & COMPONENT_NO_MUTE) + return + var/datum/status_effect/mute/M = has_status_effect(STATUS_EFFECT_MUTED) + if(M) + M.duration = max(world.time + amount, M.duration) + else if(amount > 0) + M = apply_status_effect(STATUS_EFFECT_MUTED, amount) + return M + +//Sets remaining mute duration +/mob/living/proc/SetMute(amount) + if(status_flags & GODMODE) + return + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_MUTE, amount) & COMPONENT_NO_MUTE) + return + var/datum/status_effect/mute/M = has_status_effect(STATUS_EFFECT_MUTED) + + if(M) + if(amount <= 0) + qdel(M) + return + + M.duration = world.time + amount + return + + M = apply_status_effect(STATUS_EFFECT_MUTED, amount) + return M + +///Adds to remaining mute duration +/mob/living/proc/AdjustMute(amount) + if(!amount) + return + if(status_flags & GODMODE) + return + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_MUTE, amount) & COMPONENT_NO_MUTE) + return + + var/datum/status_effect/mute/M = has_status_effect(STATUS_EFFECT_MUTED) + if(M) + M.duration += amount + else if(amount > 0) + M = apply_status_effect(STATUS_EFFECT_MUTED, amount) + return M diff --git a/code/modules/mob/living/status_procs/paralyze.dm b/code/modules/mob/living/status_procs/paralyze.dm new file mode 100644 index 00000000000..a27951e4bfb --- /dev/null +++ b/code/modules/mob/living/status_procs/paralyze.dm @@ -0,0 +1,81 @@ +///Returns remaining paralyzed duration +/mob/living/proc/AmountParalyzed() + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = has_status_effect(STATUS_EFFECT_PARALYZED) + return current_paralyzed ? current_paralyzed.duration - world.time : 0 + +///Applies paralyze only if not currently applied +/mob/living/proc/ParalyzeNoChain(amount, ignore_canstun = FALSE) + if(status_flags & GODMODE) + return + if(has_status_effect(STATUS_EFFECT_PARALYZED)) + return 0 + return Paralyze(amount, ignore_canstun) + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = has_status_effect(STATUS_EFFECT_PARALYZED) + 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) + if(amount > MAX_PARALYSE_AMOUNT_FOR_PARALYSE_RESISTANT * 4) + amount = MAX_PARALYSE_AMOUNT_FOR_PARALYSE_RESISTANT + return ..() + amount /= 4 + return ..() + +///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 = has_status_effect(STATUS_EFFECT_PARALYZED) + 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(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) + + 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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/paralyzed/current_paralyzed = has_status_effect(STATUS_EFFECT_PARALYZED) + if(current_paralyzed) + current_paralyzed.duration += amount + else if(amount > 0) + current_paralyzed = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) + + return current_paralyzed diff --git a/code/modules/mob/living/status_procs/sleeping.dm b/code/modules/mob/living/status_procs/sleeping.dm new file mode 100644 index 00000000000..a27b869d9f1 --- /dev/null +++ b/code/modules/mob/living/status_procs/sleeping.dm @@ -0,0 +1,84 @@ +///Returns remaining sleeping duration +/mob/living/proc/AmountSleeping() + var/datum/status_effect/incapacitating/sleeping/current_sleeping = has_status_effect(STATUS_EFFECT_SLEEPING) + return current_sleeping ? current_sleeping.duration - world.time : 0 + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/sleeping/current_sleeping = has_status_effect(STATUS_EFFECT_SLEEPING) + 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 + +///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 = has_status_effect(STATUS_EFFECT_SLEEPING) + 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(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 + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/sleeping/current_sleeping = has_status_effect(STATUS_EFFECT_SLEEPING) + if(current_sleeping) + current_sleeping.duration += amount + else if(amount > 0) + current_sleeping = apply_status_effect(STATUS_EFFECT_SLEEPING, amount) + + return current_sleeping + +/mob/living/proc/IsAdminSleeping() + return has_status_effect(STATUS_EFFECT_ADMINSLEEP) + +/mob/living/proc/ToggleAdminSleep() + var/datum/status_effect/incapacitating/adminsleep/S = IsAdminSleeping() + if(S) + qdel(S) + else + S = apply_status_effect(STATUS_EFFECT_ADMINSLEEP) + return S + +/mob/living/proc/SetAdminSleep(remove = FALSE) + var/datum/status_effect/incapacitating/adminsleep/S = IsAdminSleeping() + if(remove) + qdel(S) + else + S = apply_status_effect(STATUS_EFFECT_ADMINSLEEP) + return S diff --git a/code/modules/mob/living/status_procs/slowdown.dm b/code/modules/mob/living/status_procs/slowdown.dm new file mode 100644 index 00000000000..83b2c41cb57 --- /dev/null +++ b/code/modules/mob/living/status_procs/slowdown.dm @@ -0,0 +1,42 @@ +///Returns number of slowdown stacks if any +/mob/living/proc/IsSlowed() //If we're slowed + return slowdown + +///Where the magic happens. Actually applies slow stacks. +/mob/living/proc/set_slowdown(amount) + if(slowdown == amount) + return + if(amount > 0 && HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE)) //We're immune to slowdown + return + SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLOWDOWN, amount) + slowdown = amount + if(slowdown) + add_movespeed_modifier(MOVESPEED_ID_STAGGERSTUN, TRUE, 0, NONE, TRUE, slowdown) + return + remove_movespeed_modifier(MOVESPEED_ID_STAGGERSTUN) + +///This is where we normalize the set_slowdown input to be at least 0 +/mob/living/proc/adjust_slowdown(amount) + if(amount > 0) + if(HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE)) + return slowdown + set_slowdown(max(slowdown, amount)) //Slowdown overlaps rather than stacking. + else + set_slowdown(max(slowdown + amount, 0)) + return slowdown + +/mob/living/proc/add_slowdown(amount, capped = 0) + if(HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE)) + return + adjust_slowdown(amount * STANDARD_SLOWDOWN_REGEN) + +///Standard slowdown regen called by life.dm +/mob/living/proc/handle_slowdown() + if(slowdown) + adjust_slowdown(-STANDARD_SLOWDOWN_REGEN) + return slowdown + +/mob/living/carbon/xenomorph/add_slowdown(amount) + if(HAS_TRAIT(src, TRAIT_SLOWDOWNIMMUNE) || is_charging >= CHARGE_ON) + return + adjust_slowdown(amount * XENO_SLOWDOWN_REGEN) diff --git a/code/modules/mob/living/status_procs/stagger.dm b/code/modules/mob/living/status_procs/stagger.dm new file mode 100644 index 00000000000..11ebdffe291 --- /dev/null +++ b/code/modules/mob/living/status_procs/stagger.dm @@ -0,0 +1,65 @@ +///Returns remaining stagger duration +/mob/living/proc/AmountStaggered() + var/datum/status_effect/incapacitating/stagger/current_stagger = has_status_effect(STATUS_EFFECT_STAGGER) + return current_stagger ? current_stagger.duration - world.time : 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((!(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 + + var/datum/status_effect/incapacitating/stagger/current_stagger = has_status_effect(STATUS_EFFECT_STAGGER) + 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 = has_status_effect(STATUS_EFFECT_STAGGER) + 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(current_stagger) + current_stagger.duration = world.time + amount + else + current_stagger = apply_status_effect(STATUS_EFFECT_STAGGER, amount) + + return current_stagger + +///Applies stagger or adds to existing duration +/mob/living/proc/adjust_stagger(amount, ignore_canstun = FALSE) + 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 + + var/datum/status_effect/incapacitating/stagger/current_stagger = has_status_effect(STATUS_EFFECT_STAGGER) + if(current_stagger) + current_stagger.duration += amount + else if(amount > 0) + current_stagger = apply_status_effect(STATUS_EFFECT_STAGGER, amount) + + return current_stagger diff --git a/code/modules/mob/living/status_procs/stun.dm b/code/modules/mob/living/status_procs/stun.dm new file mode 100644 index 00000000000..0c52a830158 --- /dev/null +++ b/code/modules/mob/living/status_procs/stun.dm @@ -0,0 +1,65 @@ +///Returns remaining stun duration +/mob/living/proc/AmountStun() + var/datum/status_effect/incapacitating/stun/current_stun = has_status_effect(STATUS_EFFECT_STUN) + return current_stun ? current_stun.duration - world.time : 0 + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/stun/current_stun = has_status_effect(STATUS_EFFECT_STUN) + 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 = has_status_effect(STATUS_EFFECT_STUN) + 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(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 + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/stun/current_stun = has_status_effect(STATUS_EFFECT_STUN) + if(current_stun) + current_stun.duration += amount + else if(amount > 0) + current_stun = apply_status_effect(STATUS_EFFECT_STUN, amount) + + return current_stun diff --git a/code/modules/mob/living/status_procs/stun_absorption.dm b/code/modules/mob/living/status_procs/stun_absorption.dm new file mode 100644 index 00000000000..015517a25da --- /dev/null +++ b/code/modules/mob/living/status_procs/stun_absorption.dm @@ -0,0 +1,40 @@ +/mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message) +//adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stun/examined, if any + if(!islist(stun_absorption)) + stun_absorption = list() + if(stun_absorption[key]) + stun_absorption[key]["end_time"] = world.time + duration + stun_absorption[key]["priority"] = priority + stun_absorption[key]["stuns_absorbed"] = 0 + else + stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \ + "visible_message" = message, "self_message" = self_message, "examine_message" = examine_message) + +/mob/living/proc/absorb_stun(amount, ignoring_flag_presence) + if(amount < 0 || stat || ignoring_flag_presence || !islist(stun_absorption)) + return FALSE + if(!amount) + amount = 0 + var/priority_absorb_key + var/highest_priority + + for(var/i in stun_absorption) + if(stun_absorption[i]["end_time"] <= world.time) + continue + if(priority_absorb_key && stun_absorption[i]["priority"] <= highest_priority) + continue + priority_absorb_key = stun_absorption[i] + highest_priority = priority_absorb_key["priority"] + + if(!priority_absorb_key) + return TRUE + if(!amount) //don't spam up the chat for continuous stuns + return TRUE + priority_absorb_key["stuns_absorbed"] += amount + if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"]) + visible_message(span_warning("[src][priority_absorb_key["visible_message"]]"), span_boldwarning("[priority_absorb_key["self_message"]]")) + else if(priority_absorb_key["visible_message"]) + visible_message(span_warning("[src][priority_absorb_key["visible_message"]]")) + else if(priority_absorb_key["self_message"]) + to_chat(src, span_boldwarning("[priority_absorb_key["self_message"]]")) + return TRUE diff --git a/code/modules/mob/living/status_procs/temperature.dm b/code/modules/mob/living/status_procs/temperature.dm new file mode 100644 index 00000000000..ecaf0dd5f6c --- /dev/null +++ b/code/modules/mob/living/status_procs/temperature.dm @@ -0,0 +1,17 @@ +/mob/living/proc/adjust_bodytemperature(amount, min_temp = 0, max_temp = INFINITY) + if(bodytemperature < min_temp || bodytemperature > max_temp) + return + . = bodytemperature + bodytemperature = clamp(bodytemperature + amount, min_temp, max_temp) + +/mob/living/carbon/human/adjust_bodytemperature(amount, min_temp = 0, max_temp = INFINITY) + . = ..() + adjust_bodytemperature_speed_mod(.) + +/mob/living/carbon/human/proc/adjust_bodytemperature_speed_mod(old_temperature) + if(bodytemperature < species.cold_level_1) + if(old_temperature < species.cold_level_1) + return + add_movespeed_modifier(MOVESPEED_ID_COLD, TRUE, 0, NONE, TRUE, 2) + else if(old_temperature < species.cold_level_1) + remove_movespeed_modifier(MOVESPEED_ID_COLD) diff --git a/code/modules/mob/living/status_procs/unconscious.dm b/code/modules/mob/living/status_procs/unconscious.dm new file mode 100644 index 00000000000..790c6453b28 --- /dev/null +++ b/code/modules/mob/living/status_procs/unconscious.dm @@ -0,0 +1,65 @@ +///Returns remaining unconscious duration +/mob/living/proc/AmountUnconscious() + var/datum/status_effect/incapacitating/unconscious/current_unconscious = has_status_effect(STATUS_EFFECT_UNCONSCIOUS) + return current_unconscious ? current_unconscious.duration - world.time : 0 + +///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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/unconscious/current_unconscious = has_status_effect(STATUS_EFFECT_UNCONSCIOUS) + 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 + +///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 = has_status_effect(STATUS_EFFECT_UNCONSCIOUS) + 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(absorb_stun(amount, ignore_canstun)) + return + + 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(absorb_stun(amount, ignore_canstun)) + return + + var/datum/status_effect/incapacitating/unconscious/current_unconscious = has_status_effect(STATUS_EFFECT_UNCONSCIOUS) + if(current_unconscious) + current_unconscious.duration += amount + else if(amount > 0) + current_unconscious = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + + return current_unconscious diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 387fdd96485..09649588a16 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -133,7 +133,7 @@ L.last_move_intent = world.time + 1 SECONDS - if(L.IsConfused()) + if(L.has_status_effect(STATUS_EFFECT_CONFUSED)) var/newdir = 0 if(L.AmountConfused() > 40) newdir = pick(GLOB.alldirs) diff --git a/code/modules/predator/falcon.dm b/code/modules/predator/falcon.dm index be2db58f05a..0d541bb762e 100644 --- a/code/modules/predator/falcon.dm +++ b/code/modules/predator/falcon.dm @@ -23,7 +23,7 @@ set src in usr var/mob/living/mob = usr - if(mob.stat || (mob.lying_angle && !mob.resting && !mob.IsSleeping()) || (mob.IsParalyzed() || mob.IsUnconscious())) + if(mob.stat || (mob.lying_angle && !mob.resting && !mob.has_status_effect(STATUS_EFFECT_SLEEPING)) || (mob.has_status_effect(STATUS_EFFECT_PARALYZED) || mob.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return var/mob/living/carbon/human/H = usr diff --git a/code/modules/predator/predator_action.dm b/code/modules/predator/predator_action.dm index a45b04af1a6..44ced63785d 100644 --- a/code/modules/predator/predator_action.dm +++ b/code/modules/predator/predator_action.dm @@ -11,7 +11,7 @@ var/mob/living/carbon/human/human = owner if(!istype(human)) return FALSE - if(human.stat || (human.lying_angle && !human.resting && !human.IsSleeping()) || (human.IsParalyzed() || human.IsUnconscious())) + if(human.stat || (human.lying_angle && !human.resting && !human.has_status_effect(STATUS_EFFECT_SLEEPING)) || (human.has_status_effect(STATUS_EFFECT_PARALYZED) || human.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return FALSE return TRUE diff --git a/code/modules/predator/thrall/procs.dm b/code/modules/predator/thrall/procs.dm index 175762e31cd..b7abd69e280 100644 --- a/code/modules/predator/thrall/procs.dm +++ b/code/modules/predator/thrall/procs.dm @@ -8,7 +8,7 @@ to_chat(wearer, span_warning("You've already claimed your equipment.")) return - if(wearer.stat || (wearer.lying_angle && !wearer.resting && !wearer.IsSleeping()) || (wearer.IsParalyzed() || wearer.IsUnconscious()) || wearer.lying_angle || wearer.buckled) + if(wearer.stat || (wearer.lying_angle && !wearer.resting && !wearer.has_status_effect(STATUS_EFFECT_SLEEPING)) || (wearer.has_status_effect(STATUS_EFFECT_PARALYZED) || wearer.has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) || wearer.lying_angle || wearer.buckled) to_chat(wearer, span_warning("You're not able to do that right now.")) return diff --git a/code/modules/predator/yautja/bracers.dm b/code/modules/predator/yautja/bracers.dm index 81dba336a05..b666d88ae03 100644 --- a/code/modules/predator/yautja/bracers.dm +++ b/code/modules/predator/yautja/bracers.dm @@ -152,7 +152,7 @@ if(forced || HAS_TRAIT(user, TRAIT_YAUTJA_TECH)) return FALSE - if(user.stat || (user.lying_angle && !user.resting && !user.IsSleeping()) || (user.IsParalyzed() || user.IsUnconscious())) //let's do this here to avoid to_chats to dead guys + if(user.stat || (user.lying_angle && !user.resting && !user.has_status_effect(STATUS_EFFECT_SLEEPING)) || (user.has_status_effect(STATUS_EFFECT_PARALYZED) || user.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) //let's do this here to avoid to_chats to dead guys return TRUE var/workingProbability = 20 @@ -367,7 +367,7 @@ . = healing_capsule_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/proc/healing_capsule_internal(mob/living/caller, forced = FALSE) - if(caller.stat || (caller.lying_angle && !caller.resting && !caller.IsSleeping()) || (caller.IsParalyzed() || caller.IsUnconscious())) + if(caller.stat || (caller.lying_angle && !caller.resting && !caller.has_status_effect(STATUS_EFFECT_SLEEPING)) || (caller.has_status_effect(STATUS_EFFECT_PARALYZED) || caller.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return FALSE . = check_random_function(caller, forced) @@ -470,7 +470,7 @@ var/mob/living/carbon/human/M = caller var/new_alpha = cloak_alpha - if(!istype(M) || caller.stat || (caller.lying_angle && !caller.resting && !caller.IsSleeping()) || (caller.IsParalyzed() || caller.IsUnconscious())) + if(!istype(M) || caller.stat || (caller.lying_angle && !caller.resting && !caller.has_status_effect(STATUS_EFFECT_SLEEPING)) || (caller.has_status_effect(STATUS_EFFECT_PARALYZED) || caller.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return FALSE if(cloaked) //Turn it off. @@ -896,7 +896,7 @@ to_chat(wearer, span_warning("You've already claimed your equipment.")) return - if(wearer.stat || (wearer.lying_angle && !wearer.resting && !wearer.IsSleeping()) || (wearer.IsParalyzed() || wearer.IsUnconscious()) || wearer.lying_angle || wearer.buckled) + if(wearer.stat || (wearer.lying_angle && !wearer.resting && !wearer.has_status_effect(STATUS_EFFECT_SLEEPING)) || (wearer.has_status_effect(STATUS_EFFECT_PARALYZED) || wearer.has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) || wearer.lying_angle || wearer.buckled) to_chat(wearer, span_warning("You're not able to do that right now.")) return @@ -1155,7 +1155,7 @@ . = remove_tracked_item_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/remove_tracked_item_internal(mob/living/caller, forced = FALSE) - if(caller.stat || (caller.lying_angle && !caller.resting && !caller.IsSleeping()) || (caller.IsParalyzed() || caller.IsUnconscious())) + if(caller.stat || (caller.lying_angle && !caller.resting && !caller.has_status_effect(STATUS_EFFECT_SLEEPING)) || (caller.has_status_effect(STATUS_EFFECT_PARALYZED) || caller.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return FALSE . = check_random_function(caller, forced) @@ -1183,7 +1183,7 @@ . = add_tracked_item_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/add_tracked_item_internal(mob/living/caller, forced = FALSE) - if(caller.stat || (caller.lying_angle && !caller.resting && !caller.IsSleeping()) || (caller.IsParalyzed() || caller.IsUnconscious())) + if(caller.stat || (caller.lying_angle && !caller.resting && !caller.has_status_effect(STATUS_EFFECT_SLEEPING)) || (caller.has_status_effect(STATUS_EFFECT_PARALYZED) || caller.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return FALSE . = check_random_function(caller, forced) @@ -1209,7 +1209,7 @@ set src in usr var/mob/living/mob = usr - if(mob.stat || (mob.lying_angle && !mob.resting && !mob.IsSleeping()) || (mob.IsParalyzed() || mob.IsUnconscious())) + if(mob.stat || (mob.lying_angle && !mob.resting && !mob.has_status_effect(STATUS_EFFECT_SLEEPING)) || (mob.has_status_effect(STATUS_EFFECT_PARALYZED) || mob.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return name_active = !name_active @@ -1222,7 +1222,7 @@ set src in usr var/mob/living/mob = usr - if(mob.stat || (mob.lying_angle && !mob.resting && !mob.IsSleeping()) || (mob.IsParalyzed() || mob.IsUnconscious())) + if(mob.stat || (mob.lying_angle && !mob.resting && !mob.has_status_effect(STATUS_EFFECT_SLEEPING)) || (mob.has_status_effect(STATUS_EFFECT_PARALYZED) || mob.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) return var/mob/living/carbon/human/H = usr diff --git a/code/modules/predator/yautja/hudprocs.dm b/code/modules/predator/yautja/hudprocs.dm index ef64534adfb..c3d6ffbaa4b 100644 --- a/code/modules/predator/yautja/hudprocs.dm +++ b/code/modules/predator/yautja/hudprocs.dm @@ -1,5 +1,5 @@ /mob/living/carbon/human/proc/mark_panel() - if(stat || (lying_angle && !resting && !IsSleeping()) || (IsParalyzed() || IsUnconscious())) + if(stat || (lying_angle && !resting && !has_status_effect(STATUS_EFFECT_SLEEPING)) || (has_status_effect(STATUS_EFFECT_PARALYZED) || has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) to_chat(src, span_danger("You're not able to do that right now.")) return diff --git a/code/modules/predator/yautja/items.dm b/code/modules/predator/yautja/items.dm index 3587c0e7811..ff01395dda0 100644 --- a/code/modules/predator/yautja/items.dm +++ b/code/modules/predator/yautja/items.dm @@ -660,7 +660,7 @@ return /obj/item/explosive/grenade/spawnergrenade/hellhound/check_eye(mob/living/user) - if(user.stat || (user.lying_angle && !user.resting && !user.IsSleeping()) || (user.IsParalyzed() || user.IsUnconscious())) + if(user.stat || (user.lying_angle && !user.resting && !user.has_status_effect(STATUS_EFFECT_SLEEPING)) || (user.has_status_effect(STATUS_EFFECT_PARALYZED) || user.has_status_effect(STATUS_EFFECT_UNCONSCIOUS))) user.unset_interaction() else if (!current || get_turf(user) != activated_turf || src.loc != user ) //camera doesn't work, or we moved. user.unset_interaction() diff --git a/code/modules/predator/yautja/procs.dm b/code/modules/predator/yautja/procs.dm index 2164cd2f1c0..4a63b4c0dfc 100644 --- a/code/modules/predator/yautja/procs.dm +++ b/code/modules/predator/yautja/procs.dm @@ -48,7 +48,7 @@ set name = "Butcher" set desc = "Butcher a corpse you're standing on for its tasty meats." - if(stat || (lying_angle && !resting && !IsSleeping()) || (IsParalyzed() || IsUnconscious()) || lying_angle || buckled) + if(stat || (lying_angle && !resting && !has_status_effect(STATUS_EFFECT_SLEEPING)) || (has_status_effect(STATUS_EFFECT_PARALYZED) || has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) || lying_angle || buckled) return var/list/choices = list() @@ -77,7 +77,7 @@ to_chat(src, span_warning("This tiny worm is not even worth using your tools on.")) return - if(stat || (lying_angle && !resting && !IsSleeping()) || (IsParalyzed() || IsUnconscious()) || lying_angle || buckled) + if(stat || (lying_angle && !resting && !has_status_effect(STATUS_EFFECT_SLEEPING)) || (has_status_effect(STATUS_EFFECT_PARALYZED) || has_status_effect(STATUS_EFFECT_UNCONSCIOUS)) || lying_angle || buckled) return if(isxeno(T)) diff --git a/code/modules/projectiles/ammo_datums/_ammo_datums.dm b/code/modules/projectiles/ammo_datums/_ammo_datums.dm index 9883933415f..313b30db24e 100644 --- a/code/modules/projectiles/ammo_datums/_ammo_datums.dm +++ b/code/modules/projectiles/ammo_datums/_ammo_datums.dm @@ -141,7 +141,7 @@ //Check for and apply hard CC. if(hard_size_threshold >= victim.mob_size && (stun || weaken || knockback)) var/mob/living/living_victim = victim - if(living_victim.IsStun() || living_victim.IsParalyzed()) //Prevent chain stunning. + if(living_victim.has_status_effect(STATUS_EFFECT_STUN) || living_victim.has_status_effect(STATUS_EFFECT_PARALYZED)) //Prevent chain stunning. stun = 0 weaken = 0 @@ -165,14 +165,12 @@ if(iscarbon(victim)) var/mob/living/carbon/carbon_victim = victim #if DEBUG_STAGGER_SLOWDOWN - to_chat(world, span_debuginfo("Damage: Initial stagger is: [target.IsStaggered()]")) + to_chat(world, span_debuginfo("Damage: Initial stagger is: [target.has_status_effect(STATUS_EFFECT_STAGGER)]")) #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.IsStaggered()]")) - #endif - #if DEBUG_STAGGER_SLOWDOWN + to_chat(world, span_debuginfo("Damage: Final stagger is: [target.has_status_effect(STATUS_EFFECT_STAGGER)]")) to_chat(world, span_debuginfo("Damage: Initial slowdown is: [target.slowdown]")) #endif carbon_victim.add_slowdown(slowdown) diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 6b4b744f213..3ddb7ac80b3 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -1735,7 +1735,7 @@ projectile_to_fire.point_blank_range = 0 if(isliving(firer)) var/mob/living/living_firer = firer - if(living_firer.IsStaggered()) + if(living_firer.has_status_effect(STATUS_EFFECT_STAGGER)) projectile_to_fire.damage *= STAGGER_DAMAGE_MULTIPLIER ///Sets the projectile accuracy and scatter diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index d1b8a971a11..f7170f216d1 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -185,7 +185,7 @@ if(!isliving(user)) return var/mob/living/L = user - if(L.stat || L.IsStun() || L.IsParalyzed() || flushing) + if(L.stat || L.has_status_effect(STATUS_EFFECT_STUN) || L.has_status_effect(STATUS_EFFECT_PARALYZED) || flushing) return if(L.loc == src) go_out(L) diff --git a/code/modules/vehicles/armored/armored_weapons.dm b/code/modules/vehicles/armored/armored_weapons.dm index 722eba41616..c1696665477 100644 --- a/code/modules/vehicles/armored/armored_weapons.dm +++ b/code/modules/vehicles/armored/armored_weapons.dm @@ -170,7 +170,7 @@ if(!isliving(firer)) return var/mob/living/living_firer = firer - if(living_firer.IsStaggered()) + if(living_firer.has_status_effect(STATUS_EFFECT_STAGGER)) projectile_to_fire.damage *= STAGGER_DAMAGE_MULTIPLIER if((projectile_to_fire.ammo.flags_ammo_behavior & AMMO_IFF) && ishuman(firer)) var/mob/living/carbon/human/human_firer = firer diff --git a/code/modules/vehicles/mecha/equipment/weapons/weapons.dm b/code/modules/vehicles/mecha/equipment/weapons/weapons.dm index 39c1031d577..7fe92c84d2a 100644 --- a/code/modules/vehicles/mecha/equipment/weapons/weapons.dm +++ b/code/modules/vehicles/mecha/equipment/weapons/weapons.dm @@ -151,7 +151,7 @@ if(!isliving(firer)) return var/mob/living/living_firer = firer - if(living_firer.IsStaggered()) + if(living_firer.has_status_effect(STATUS_EFFECT_STAGGER)) projectile_to_fire.damage *= STAGGER_DAMAGE_MULTIPLIER if((projectile_to_fire.ammo.flags_ammo_behavior & AMMO_IFF) && ishuman(firer)) var/mob/living/carbon/human/human_firer = firer diff --git a/tgmc.dme b/tgmc.dme index de70c70aecb..40ea9eca17b 100644 --- a/tgmc.dme +++ b/tgmc.dme @@ -1603,7 +1603,6 @@ #include "code\modules\mob\living\login.dm" #include "code\modules\mob\living\logout.dm" #include "code\modules\mob\living\say.dm" -#include "code\modules\mob\living\status_procs.dm" #include "code\modules\mob\living\brain\brain.dm" #include "code\modules\mob\living\brain\death.dm" #include "code\modules\mob\living\brain\life.dm" @@ -1818,6 +1817,25 @@ #include "code\modules\mob\living\simple_animal\hostile\hostile.dm" #include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm" #include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm" +#include "code\modules\mob\living\status_procs\blindness.dm" +#include "code\modules\mob\living\status_procs\blur.dm" +#include "code\modules\mob\living\status_procs\confused.dm" +#include "code\modules\mob\living\status_procs\dizzy.dm" +#include "code\modules\mob\living\status_procs\drugginess.dm" +#include "code\modules\mob\living\status_procs\ear_damage.dm" +#include "code\modules\mob\living\status_procs\immobilize.dm" +#include "code\modules\mob\living\status_procs\irradiated.dm" +#include "code\modules\mob\living\status_procs\jitter.dm" +#include "code\modules\mob\living\status_procs\knockdown.dm" +#include "code\modules\mob\living\status_procs\mute.dm" +#include "code\modules\mob\living\status_procs\paralyze.dm" +#include "code\modules\mob\living\status_procs\sleeping.dm" +#include "code\modules\mob\living\status_procs\slowdown.dm" +#include "code\modules\mob\living\status_procs\stagger.dm" +#include "code\modules\mob\living\status_procs\stun.dm" +#include "code\modules\mob\living\status_procs\stun_absorption.dm" +#include "code\modules\mob\living\status_procs\temperature.dm" +#include "code\modules\mob\living\status_procs\unconscious.dm" #include "code\modules\mob\new_player\ethnicity.dm" #include "code\modules\mob\new_player\login.dm" #include "code\modules\mob\new_player\logout.dm"