diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index bbf8fda99f61..af8af22ca707 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -143,6 +143,8 @@ // #define TRAIT_X "t_x" //-- mob traits -- +/// Prevents voluntary movement. +#define TRAIT_IMMOBILIZED "immobilized" /// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! #define TRAIT_UNDENSE "undense" @@ -294,6 +296,7 @@ GLOBAL_LIST_INIT(mob_traits, list( */ GLOBAL_LIST_INIT(traits_by_type, list( /mob = list( + "TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED, "TRAIT_UNDENSE" = TRAIT_UNDENSE, "TRAIT_YAUTJA_TECH" = TRAIT_YAUTJA_TECH, "TRAIT_SUPER_STRONG" = TRAIT_SUPER_STRONG, @@ -411,6 +414,8 @@ GLOBAL_LIST(trait_name_map) //Status trait coming from clothing. #define TRAIT_SOURCE_CLOTHING "t_s_clothing" +/// traits associated with actively interacted machinery +#define INTERACTION_TRAIT "interaction" /// trait effect related to active specialist gear #define SPECIALIST_GEAR_TRAIT "specialist_gear" /// traits associated with usage of snowflake dropship double seats diff --git a/code/datums/agents/tools/chloroform.dm b/code/datums/agents/tools/chloroform.dm index cc804c1d270c..c6e3320688eb 100644 --- a/code/datums/agents/tools/chloroform.dm +++ b/code/datums/agents/tools/chloroform.dm @@ -47,7 +47,7 @@ /obj/item/weapon/chloroform/proc/grab_stun(mob/living/M, mob/living/user) M.anchored = TRUE - M.frozen = TRUE + ADD_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) ADD_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) M.able_to_speak = FALSE M.update_canmove() @@ -82,7 +82,7 @@ M.density = TRUE M.able_to_speak = TRUE M.layer = MOB_LAYER - M.unfreeze() + REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) REMOVE_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) QDEL_NULL(mask_item) diff --git a/code/datums/effects/xeno_strains/boiler_trap.dm b/code/datums/effects/xeno_strains/boiler_trap.dm index 61451391e816..1833b9641a9a 100644 --- a/code/datums/effects/xeno_strains/boiler_trap.dm +++ b/code/datums/effects/xeno_strains/boiler_trap.dm @@ -4,19 +4,17 @@ effect_name = "boiler trap" duration = null flags = INF_DURATION - /// Ghetto flag indicating whether we actually placed the freeze or not, until we have an actual effects system - var/freezer = FALSE /datum/effects/boiler_trap/New(atom/A, mob/from, last_dmg_source, zone) . = ..() if(!QDELETED(src)) var/mob/M = affected_atom - freezer = M.freeze() + ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) /datum/effects/boiler_trap/Destroy(force) - if(ismob(affected_atom) && freezer) + if(ismob(affected_atom)) var/mob/M = affected_atom - M.unfreeze() + REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return ..() /datum/effects/boiler_trap/validate_atom(atom/A) @@ -29,7 +27,5 @@ . = ..() if(!.) return FALSE var/mob/M = affected_atom - if(M.frozen) return TRUE - if(!freezer) - freezer = M.freeze() + ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return TRUE diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 65c5a47896fa..b0df9bca7745 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -798,7 +798,7 @@ var/global/image/hud_icon_hudfocus tag_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag") // Hacky, but works. Currently effects are hard to make with precise timings - var/freeze_found = frozen + var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && !buckled && !lying if (freeze_found) freeze_holder.overlays += image('icons/mob/hud/hud.dmi', src, "xeno_freeze") diff --git a/code/game/objects/items/storage/smartpack.dm b/code/game/objects/items/storage/smartpack.dm index 8df079c92ca4..0b0fd05eac17 100644 --- a/code/game/objects/items/storage/smartpack.dm +++ b/code/game/objects/items/storage/smartpack.dm @@ -144,7 +144,7 @@ immobile_form = FALSE M.status_flags |= CANPUSH M.anchored = FALSE - M.unfreeze() + REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_EQUIPMENT(WEAR_BACK)) ..() /obj/item/storage/backpack/marine/smartpack/attack_self(mob/user) @@ -236,7 +236,7 @@ battery_charge -= IMMOBILE_COST user.status_flags &= ~CANPUSH user.anchored = TRUE - user.frozen = TRUE + ADD_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_EQUIPMENT(WEAR_BACK)) to_chat(user, SPAN_DANGER("[name] beeps, \"You are anchored in place and cannot be moved.\"")) to_chat(user, SPAN_INFO("The current charge reads [battery_charge]/[SMARTPACK_MAX_POWER_STORED]")) @@ -248,7 +248,7 @@ else user.status_flags |= CANPUSH user.anchored = FALSE - user.unfreeze() + REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_EQUIPMENT(WEAR_BACK)) to_chat(user, SPAN_DANGER("[name] beeps, \"You can now move again.\"")) user.remove_filter("synth_immobile_form") diff --git a/code/game/objects/structures/vulture_spotter.dm b/code/game/objects/structures/vulture_spotter.dm index 50505ab239b8..44efd5ce84ea 100644 --- a/code/game/objects/structures/vulture_spotter.dm +++ b/code/game/objects/structures/vulture_spotter.dm @@ -92,7 +92,7 @@ user.lighting_alpha = 127 user.sync_lighting_plane_alpha() user.overlay_fullscreen("vulture_spotter", /atom/movable/screen/fullscreen/vulture/spotter) - user.freeze() + ADD_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Vulture spotter")) user.status_flags |= IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] looks through [src]."),SPAN_NOTICE("You look through [src], ready to go!")) user.forceMove(loc) @@ -105,7 +105,7 @@ /obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/user) user.status_flags &= ~IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] looks up from [src]."),SPAN_NOTICE("You look up from [src].")) - user.unfreeze() + REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Vulture spotter")) user.reset_view(null) user.Move(get_step(src, reverse_direction(src.dir))) user.client?.change_view(world_view_size, src) diff --git a/code/modules/admin/player_panel/actions/general.dm b/code/modules/admin/player_panel/actions/general.dm index 79cf192fa420..a47a42d44cc2 100644 --- a/code/modules/admin/player_panel/actions/general.dm +++ b/code/modules/admin/player_panel/actions/general.dm @@ -113,9 +113,13 @@ name = "Toggle Frozen" /datum/player_action/toggle_frozen/act(client/user, mob/target, list/params) - target.frozen = text2num(params["freeze"]) + var/frozen = text2num(params["freeze"]) + if(frozen) + ADD_TRAIT(target, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ADMIN) + else + REMOVE_TRAIT(target, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ADMIN) - message_admins("[key_name_admin(user)] [target.frozen? "froze" : "unfroze"] [key_name_admin(target)]") + message_admins("[key_name_admin(user)] [frozen? "froze" : "unfroze"] [key_name_admin(target)]") return TRUE // MESSAGE diff --git a/code/modules/admin/player_panel/player_panel.dm b/code/modules/admin/player_panel/player_panel.dm index a8217b5d9402..e29ea83ef5ce 100644 --- a/code/modules/admin/player_panel/player_panel.dm +++ b/code/modules/admin/player_panel/player_panel.dm @@ -480,7 +480,7 @@ else .["mob_sleeping"] = 0 - .["mob_frozen"] = targetMob.frozen + .["mob_frozen"] = HAS_TRAIT_FROM(targetMob, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ADMIN) .["mob_speed"] = targetMob.speed .["mob_status_flags"] = targetMob.status_flags diff --git a/code/modules/cm_marines/m2c.dm b/code/modules/cm_marines/m2c.dm index a0943bb7f0a6..75c96f67176b 100644 --- a/code/modules/cm_marines/m2c.dm +++ b/code/modules/cm_marines/m2c.dm @@ -466,7 +466,7 @@ return if(user.get_active_hand() == null && user.get_inactive_hand() == null) - user.freeze() + ADD_TRAIT(user, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) user.set_interaction(src) give_action(user, /datum/action/human_action/mg_exit) else diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index b450f5f02841..225b85506279 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -831,7 +831,7 @@ to_chat(user, SPAN_WARNING("You aren't allowed to use firearms!")) return else - user.freeze() + ADD_TRAIT(user, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) user.set_interaction(src) give_action(user, /datum/action/human_action/mg_exit) @@ -859,7 +859,7 @@ SEND_SIGNAL(src, COMSIG_GUN_INTERRUPT_FIRE) user.status_flags &= ~IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] lets go of \the [src]."),SPAN_NOTICE("You let go of \the [src], letting the gun rest.")) - user.unfreeze() + REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) UnregisterSignal(user, list(COMSIG_MOB_MOUSEUP, COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEDRAG)) user.reset_view(null) user.remove_temp_pass_flags(PASS_MOB_THRU) // this is necessary because being knocked over while using the gun makes you incorporeal diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index fda4cea20ad1..027e279e2983 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -456,21 +456,21 @@ CULT to_chat(chosen, SPAN_HIGHDANGER("You feel a dangerous presence in the back of your head. You find yourself unable to move!")) - chosen.frozen = TRUE + ADD_TRAIT(chosen, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cultist Stun")) chosen.update_canmove() chosen.update_xeno_hostile_hud() if(!do_after(H, 2 SECONDS, INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE, chosen, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) to_chat(H, SPAN_XENOMINORWARNING("You decide not to stun [chosen].")) - unroot_human(chosen) + unroot_human(chosen, TRAIT_SOURCE_ABILITY("Cultist Stun")) enter_cooldown(5 SECONDS) return enter_cooldown() - unroot_human(chosen) + unroot_human(chosen, TRAIT_SOURCE_ABILITY("Cultist Stun")) chosen.apply_effect(10, PARALYZE) chosen.make_jittery(105) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 56eba38a4000..f3f58b859e25 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -378,16 +378,6 @@ Contains most of the procs that are called when a mob is attacked by something var/list/overlap = compare_group & access_to_check return length(overlap) -/mob/living/carbon/human/freeze() - . = ..() - if(.) - update_xeno_hostile_hud() - -/mob/living/carbon/human/unfreeze() - . = ..() - if(.) - update_xeno_hostile_hud() - /mob/living/carbon/human/get_target_lock(access_to_check) if(isnull(access_to_check)) return diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 7f36df8ceae2..c4690c03068f 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -230,7 +230,6 @@ /mob/living/carbon/human/proc/disable_special_flags() status_flags |= CANPUSH anchored = FALSE - frozen = FALSE /mob/living/carbon/human/proc/disable_special_items() set waitfor = FALSE // Scout decloak animation uses sleep(), which is problematic for taser gun diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index fd9c786bd147..1dcefec9b63b 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -799,3 +799,11 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, #undef FIRE_LAYER #undef BURST_LAYER +/* To update the rooting graphic effect. Surely there's a better way... */ +/mob/living/carbon/human/on_immobilized_trait_gain(datum/source) + . = ..() + update_xeno_hostile_hud() + +/mob/living/carbon/human/on_immobilized_trait_loss(datum/source) + . = ..() + update_xeno_hostile_hud() diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 27895555a9f1..780299547a51 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -320,9 +320,8 @@ if(pounceAction.freeze_play_sound) playsound(loc, rand(0, 100) < 95 ? 'sound/voice/alien_pounce.ogg' : 'sound/voice/alien_pounce2.ogg', 25, 1) canmove = FALSE - frozen = TRUE - pounceAction.freeze_timer_id = addtimer(CALLBACK(src, PROC_REF(unfreeze)), pounceAction.freeze_time, TIMER_STOPPABLE) - + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) + pounceAction.freeze_timer_id = addtimer(CALLBACK(src, PROC_REF(unfreeze_pounce)), pounceAction.freeze_time, TIMER_STOPPABLE) pounceAction.additional_effects(M) if(pounceAction.slash) @@ -330,6 +329,9 @@ throwing = FALSE //Reset throwing since something was hit. +/mob/living/carbon/xenomorph/proc/unfreeze_pounce() + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) + /mob/living/carbon/xenomorph/proc/pounced_mob_wrapper(mob/living/L) pounced_mob(L) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 6b1c7d14b262..6ce6de84a086 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm @@ -160,11 +160,11 @@ SPAN_XENOWARNING("You vomit globs of vile stuff all over [O]. It begins to sizzle and melt under the bubbling mess of acid!"), null, 5) playsound(loc, "sound/bullets/acid_impact1.ogg", 25) -/proc/unroot_human(mob/living/carbon/H) +/proc/unroot_human(mob/living/carbon/H, trait_source) if (!isxeno_human(H)) return - H.frozen = 0 + REMOVE_TRAIT(H, TRAIT_IMMOBILIZED, trait_source) H.update_canmove() if(ishuman(H)) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm index 4ce83f37592c..8b8e3f9c86a3 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm @@ -35,7 +35,6 @@ return // TODO Make immune to all damage here. to_chat(src, SPAN_XENOWARNING("You burrow yourself into the ground.")) - frozen = TRUE invisibility = 101 anchored = TRUE density = FALSE @@ -45,6 +44,7 @@ COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, ), PROC_REF(flamer_crossed_immune)) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) ADD_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) playsound(src.loc, 'sound/effects/burrowing_b.ogg', 25) @@ -74,9 +74,9 @@ COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, )) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) REMOVE_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) - frozen = FALSE invisibility = FALSE anchored = FALSE density = TRUE @@ -166,9 +166,7 @@ /mob/living/carbon/xenomorph/proc/do_tunnel(turf/T) to_chat(src, SPAN_NOTICE("You tunnel to your destination.")) anchored = FALSE - unfreeze() forceMove(T) - UnregisterSignal(src, COMSIG_LIVING_FLAMER_FLAMED) burrow_off() /mob/living/carbon/xenomorph/proc/do_tunnel_cooldown() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm index bf773645e491..bbb202fef3c2 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm @@ -217,7 +217,7 @@ else X.armor_deflection_buff += 30 X.armor_explosive_buff += 60 - X.frozen = TRUE + ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) X.anchored = TRUE X.small_explosives_stun = FALSE X.update_canmove() @@ -228,7 +228,7 @@ X.fortify = TRUE else to_chat(X, SPAN_XENOWARNING("You resume your normal stance.")) - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) X.anchored = FALSE if(X.mutation_type == DEFENDER_STEELCREST) X.armor_deflection_buff -= 10 diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index c1b1ee5f8902..5e3ab3b0afd9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -251,7 +251,7 @@ if(freeze_timer_id == TIMER_ID_NULL) return var/mob/living/carbon/xenomorph/X = owner - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.update_canmove() deltimer(freeze_timer_id) freeze_timer_id = TIMER_ID_NULL diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 1882f2b69157..270ddbdfcc82 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -411,7 +411,7 @@ if (windup) X.set_face_dir(get_cardinal_dir(X, A)) if (!windup_interruptable) - X.frozen = TRUE + ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = TRUE X.update_canmove() pre_windup_effects() @@ -419,14 +419,14 @@ if (!do_after(X, windup_duration, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) to_chat(X, SPAN_XENODANGER("You cancel your [ability_name]!")) if (!windup_interruptable) - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE X.update_canmove() post_windup_effects(interrupted = TRUE) return if (!windup_interruptable) - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE X.update_canmove() post_windup_effects() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm index e926349af60d..0d7a86c58318 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm @@ -175,14 +175,14 @@ vanguard_user.visible_message(SPAN_XENODANGER("[vanguard_user] slams [target_atom] into the ground!"), SPAN_XENOHIGHDANGER("You slam [target_atom] into the ground!")) - target_carbon.frozen = TRUE + ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cleave")) target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon Hu.update_xeno_hostile_hud() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target_carbon), get_xeno_stun_duration(target_carbon, root_duration)) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target_carbon, TRAIT_SOURCE_ABILITY("Cleave")), get_xeno_stun_duration(target_carbon, root_duration)) to_chat(target_carbon, SPAN_XENOHIGHDANGER("[vanguard_user] has pinned you to the ground! You cannot move!")) vanguard_user.flick_attack_overlay(target_carbon, "punch") @@ -292,7 +292,7 @@ var/throw_target_turf = get_step(X.loc, facing) - X.frozen = TRUE + ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) X.update_canmove() if(!do_after(X, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) to_chat(X, SPAN_XENOWARNING("You relax your tail.")) @@ -302,7 +302,7 @@ telegraph_atom_list -= XT qdel(XT) - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) X.update_canmove() return @@ -310,7 +310,7 @@ if(!check_and_use_plasma_owner()) return - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) X.update_canmove() playsound(get_turf(X), 'sound/effects/bang.ogg', 25, 0) @@ -340,7 +340,7 @@ H.apply_effect(1, SLOW) else if (LAZYLEN(targets) == 2) - H.frozen = TRUE + ADD_TRAIT(H, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) H.update_canmove() if (ishuman(H)) var/mob/living/carbon/human/Hu = H @@ -409,16 +409,16 @@ oppressor_user.animation_attack_on(target_carbon) oppressor_user.flick_attack_overlay(target_carbon, "punch") - if (target_carbon.frozen || target_carbon.slowed || target_carbon.knocked_down) + if (HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed || target_carbon.knocked_down) target_carbon.apply_damage(get_xeno_damage_slash(target_carbon, damage), BRUTE, target_limb? target_limb.name : "chest") - target_carbon.frozen = TRUE + ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Oppressor Punch")) target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon Hu.update_xeno_hostile_hud() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target_carbon), get_xeno_stun_duration(target_carbon, 12)) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target_carbon, TRAIT_SOURCE_ABILITY("Oppressor Punch")), get_xeno_stun_duration(target_carbon, 1.2 SECONDS)) to_chat(target_carbon, SPAN_XENOHIGHDANGER("[oppressor_user] has pinned you to the ground! You cannot move!")) var/datum/action/xeno_action/activable/prae_abduct/abduct_action = get_xeno_action_by_type(oppressor_user, /datum/action/xeno_action/activable/prae_abduct) @@ -1012,7 +1012,7 @@ if(!(behind_turf.density)) throw_target_turf = behind_turf - X.frozen = TRUE + ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) X.update_canmove() if(windup) if(!do_after(X, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) @@ -1023,12 +1023,12 @@ telegraph_atom_list -= XT qdel(XT) - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) X.update_canmove() return - X.frozen = FALSE + REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) X.update_canmove() playsound(get_turf(X), 'sound/effects/bang.ogg', 25, 0) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm index 3b52a60419df..a26cc922c528 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm @@ -78,14 +78,14 @@ for(var/mob/living/carbon/carbon in oview(round(behavior.kills * 0.5 + 2), xeno)) if(!xeno.can_not_harm(carbon) && carbon.stat != DEAD) - carbon.frozen = 1 + ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Smash")) carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon human.update_xeno_hostile_hud() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), carbon), get_xeno_stun_duration(carbon, freeze_duration)) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), carbon, TRAIT_SOURCE_ABILITY("Smash")), get_xeno_stun_duration(carbon, freeze_duration)) for(var/mob/M in view(xeno)) @@ -125,7 +125,7 @@ if (!check_and_use_plasma_owner()) return - carbon.frozen = 1 + ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) carbon.update_canmove() if (ishuman(carbon)) @@ -134,7 +134,7 @@ apply_cooldown() - xeno.frozen = 1 + ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = TRUE xeno.update_canmove() @@ -151,8 +151,9 @@ playsound(owner, 'sound/voice/predalien_growl.ogg', 75, 0, status = 0) - xeno.frozen = 0 + REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = FALSE + unroot_human(carbon, TRAIT_SOURCE_ABILITY("Devastate")) xeno.update_canmove() unroot_human(carbon) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm index cd4533eabc83..ae28cd63fef9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm @@ -385,7 +385,7 @@ else xeno.visible_message(SPAN_XENODANGER("[xeno] begins digging in for a strike!"), SPAN_XENOHIGHDANGER("You begin digging in for a strike!")) - xeno.frozen = 1 + ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = TRUE xeno.update_canmove() @@ -430,7 +430,7 @@ if(!xeno.on_fire) xeno.gain_health(Clamp(valid_count * lifesteal_per_marine, 0, max_lifesteal)) - xeno.frozen = 0 + REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = FALSE xeno.update_canmove() diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm index 4a3bd3a7d182..ecb0e1eff51e 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm @@ -56,7 +56,7 @@ if(target_carbon.stat == DEAD) return - if(!(target_carbon.knocked_down || target_carbon.frozen || target_carbon.slowed)) + if(!(target_carbon.knocked_down || HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed)) return target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index b591844a937a..d7edd02893b3 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -1,7 +1,22 @@ /// Called on [/mob/living/Initialize(mapload)], for the mob to register to relevant signals. /mob/living/proc/register_init_signals() + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_loss)) RegisterSignal(src, list(SIGNAL_ADDTRAIT(TRAIT_UNDENSE), SIGNAL_REMOVETRAIT(TRAIT_UNDENSE)), PROC_REF(undense_changed)) +/// Called when [TRAIT_IMMOBILIZED] is added to the mob. +/mob/living/proc/on_immobilized_trait_gain(datum/source) + SIGNAL_HANDLER +// mobility_flags &= ~MOBILITY_MOVE + update_canmove() + +/// Called when [TRAIT_IMMOBILIZED] is removed from the mob. +/mob/living/proc/on_immobilized_trait_loss(datum/source) + SIGNAL_HANDLER +// mobility_flags |= MOBILITY_MOVE + update_canmove() + /// Called when [TRAIT_UNDENSE] is gained or lost /mob/living/proc/undense_changed(datum/source) SIGNAL_HANDLER diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 827b94394671..c28de81ecfc1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -724,7 +724,7 @@ note dizziness decrements automatically in the mob's Life() proc. else lying = FALSE - canmove = !frozen + canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED) if(isliving(src)) // Temporary I SWEAR. This whole proc is going down var/mob/living/living = src @@ -799,22 +799,6 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/get_species() return "" -/// Sets freeze if possible and wasn't already set, returning success -/mob/proc/freeze() - if(frozen) - return FALSE - frozen = TRUE - update_canmove() - return TRUE - -/// Attempts to unfreeze mob, returning success -/mob/proc/unfreeze() - if(!frozen) - return FALSE - frozen = FALSE - update_canmove() - return TRUE - /mob/proc/flash_weak_pain() overlay_fullscreen("pain", /atom/movable/screen/fullscreen/pain, 1) clear_fullscreen("pain") diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index eec0ca75af8d..dc107e1bd190 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -65,7 +65,6 @@ var/dizziness = 0//Carbon var/jitteriness = 0//Carbon var/floatiness = 0 - var/frozen = 0 var/losebreath = 0.0//Carbon var/shakecamera = 0