From b86d5f0d73b2060ee3d851bf07d6e02ef799cc97 Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Thu, 2 Nov 2023 22:34:31 -0700
Subject: [PATCH 01/10] Sets up event based incapacitated
Rather then calling a proc every time we want to know if we're incap or
not, let's store all possible responses as a bitflag and update a var
whenever we change.
This way we can react to incap changes in an event based way!
Now to do the mass updating
---
.../mob/living/carbon/alien/adult/adult.dm | 1 +
code/modules/mob/living/living.dm | 19 ++++++++++++++++
code/modules/mob/mob.dm | 22 +++++++++++++++++--
code/modules/mob/mob_defines.dm | 3 +++
4 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/code/modules/mob/living/carbon/alien/adult/adult.dm b/code/modules/mob/living/carbon/alien/adult/adult.dm
index d2ee7432b3cc9..0ef62eda37ced 100644
--- a/code/modules/mob/living/carbon/alien/adult/adult.dm
+++ b/code/modules/mob/living/carbon/alien/adult/adult.dm
@@ -77,6 +77,7 @@ GLOBAL_LIST_INIT(strippable_alien_humanoid_items, create_strippable_list(list(
SEND_SIGNAL(src, COMSIG_MOVABLE_SET_GRAB_STATE, newstate)
. = grab_state
grab_state = newstate
+ update_incapacitated()
switch(grab_state) // Current state.
if(GRAB_PASSIVE)
REMOVE_TRAIT(pulling, TRAIT_IMMOBILIZED, CHOKEHOLD_TRAIT)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 46d65b376bdcf..d1a784bbdf3b8 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -511,6 +511,24 @@
investigate_log("has succumbed to death.", INVESTIGATE_DEATHS)
death()
+/mob/living/setup_incapacitated()
+ RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_INCAPACITATED), SIGNAL_REMOVETRAIT(TRAIT_INCAPACITATED)), PROC_REF(update_incapacitated))
+ RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_RESTRAINED), SIGNAL_REMOVETRAIT(TRAIT_RESTRAINED)), PROC_REF(update_incapacitated))
+ RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_STASIS), SIGNAL_REMOVETRAIT(TRAIT_STASIS)), PROC_REF(update_incapacitated))
+
+/mob/living/build_incapacitated()
+ // Blocks all incap flags
+ if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
+ return ALL
+ var/incap_status = NONE
+ if(HAS_TRAIT(src, TRAIT_RESTRAINED))
+ incap_status |= ~IGNORE_RESTRAINTS
+ if(pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)
+ incap_status |= ~IGNORE_GRAB
+ if(HAS_TRAIT(src, TRAIT_STASIS))
+ incap_status |= ~IGNORE_STASIS
+ return incap_status
+
/**
* Checks if a mob is incapacitated
*
@@ -2257,6 +2275,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
/// Updates the grab state of the mob and updates movespeed
/mob/living/setGrabState(newstate)
. = ..()
+ update_incapacitated()
switch(grab_state)
if(GRAB_PASSIVE)
remove_movespeed_modifier(MOVESPEED_ID_MOB_GRAB_STATE)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 7577563c6df9e..664fe1364aac3 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -85,6 +85,8 @@
add_to_dead_mob_list()
else
add_to_alive_mob_list()
+ update_incapacitated()
+ setup_incapacitated()
set_focus(src)
prepare_huds()
for(var/v in GLOB.active_alternate_appearances)
@@ -386,10 +388,26 @@
return null
-///Is the mob incapacitated
-/mob/proc/incapacitated(flags)
+/// Register signals to call update_incapacitated whenever anything it cares about changes
+/mob/proc/setup_incapacitated()
return
+/// Called whenever anything that modifes incapacitated is ran, updates it and sends a signal if it changes
+/// Returns TRUE if anything changed, FALSE otherwise
+/mob/proc/update_incapacitated()
+ SIGNAL_HANDLER
+ var/old_incap = incapacitated
+ incapacitated = build_incapacitated()
+ if(old_incap == incapacitated)
+ return FALSE
+
+ SEND_SIGNAL(src, COMSIG_MOB_INCAPACITATE_CHANGED, old_incap, incapacitated)
+ return TRUE
+
+/// Returns an updated incapacitated bitflag. If a flag is set it means we're incap in that case
+/mob/proc/build_incapacitated()
+ return NONE
+
/**
* This proc is called whenever someone clicks an inventory ui slot.
*
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 2a5be377ecd10..18b31a481fda7 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -66,6 +66,9 @@
/// Whether a mob is alive or dead. TODO: Move this to living - Nodrak (2019, still here)
var/stat = CONSCIOUS
+ /// Whether and how a mob is incapacitated. Bitfield of incapacitated flags from [code/__DEFINES/status_effects.dm]
+ var/incapacitated = NONE
+
/* A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.
The current method unnecessarily clusters up the variable list, especially for humans (although rearranging won't really clean it up a lot but the difference will be noticable for other mobs).
From d91cfc640ae83d3acaade164c38ddf3fe8884ede Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Thu, 2 Nov 2023 22:48:02 -0700
Subject: [PATCH 02/10] Implements var read for incapacitated for all consumers
Regexes used:
incapacitated\(\) -> incapacitated
incapacitated\(([^\)]*)\) -> (incapacitated & $1)
I wrapped the flag bits with () cause I don't trust binary ops
---
code/__DEFINES/ai/ai.dm | 2 +-
code/__HELPERS/paths/path.dm | 2 +-
code/_onclick/ai.dm | 4 ++--
code/_onclick/click.dm | 4 ++--
code/_onclick/cyborg.dm | 2 +-
code/_onclick/hud/ai.dm | 2 +-
code/_onclick/hud/screen_objects.dm | 10 ++++-----
code/_onclick/other_mobs.dm | 2 +-
.../ai/basic_mobs/base_basic_controller.dm | 2 +-
code/datums/ai/oldhostile/hostile_tameable.dm | 2 +-
code/datums/components/cult_ritual_item.dm | 4 ++--
code/datums/components/fullauto.dm | 4 ++--
code/datums/components/riding/riding_mob.dm | 4 ++--
code/datums/components/subtype_picker.dm | 2 +-
code/datums/components/tackle.dm | 2 +-
code/datums/components/toggle_suit.dm | 2 +-
code/datums/elements/drag_pickup.dm | 2 +-
code/datums/elements/waddling.dm | 2 +-
code/datums/elements/wheel.dm | 2 +-
code/datums/holocall.dm | 2 +-
code/datums/martial/sleeping_carp.dm | 2 +-
code/datums/mutations/hulk.dm | 6 ++---
code/datums/status_effects/debuffs/debuffs.dm | 2 +-
.../status_effects/debuffs/strandling.dm | 2 +-
code/datums/storage/storage.dm | 6 ++---
.../orders/order_computer/mining_order.dm | 2 +-
code/game/machinery/hologram.dm | 4 ++--
code/game/machinery/iv_drip.dm | 4 ++--
code/game/machinery/pipe/construction.dm | 2 +-
code/game/machinery/pipe/pipe_dispenser.dm | 2 +-
code/game/objects/buckling.dm | 2 +-
code/game/objects/items.dm | 4 ++--
code/game/objects/items/bodybag.dm | 4 ++--
code/game/objects/items/cardboard_cutouts.dm | 2 +-
code/game/objects/items/cards_ids.dm | 2 +-
code/game/objects/items/cosmetics.dm | 2 +-
code/game/objects/items/debug_items.dm | 2 +-
code/game/objects/items/defib.dm | 2 +-
.../objects/items/devices/laserpointer.dm | 2 +-
.../objects/items/devices/radio/headset.dm | 2 +-
.../items/devices/scanners/health_analyzer.dm | 8 +++----
.../objects/items/devices/taperecorder.dm | 2 +-
code/game/objects/items/paint.dm | 2 +-
code/game/objects/items/pinpointer.dm | 2 +-
code/game/objects/items/rcd/RHD.dm | 2 +-
code/game/objects/items/rcd/RPD.dm | 2 +-
code/game/objects/items/rcd/RPLD.dm | 2 +-
code/game/objects/items/rcd/RSF.dm | 2 +-
code/game/objects/items/rcd/RWD.dm | 2 +-
code/game/objects/items/scrolls.dm | 2 +-
code/game/objects/items/stacks/stack.dm | 2 +-
code/game/objects/items/storage/bags.dm | 2 +-
.../objects/items/storage/boxes/food_boxes.dm | 2 +-
code/game/objects/items/tanks/jetpack.dm | 2 +-
code/game/objects/items/tanks/watertank.dm | 2 +-
code/game/objects/items/tcg/tcg.dm | 4 ++--
code/game/objects/items/tcg/tcg_machines.dm | 4 ++--
code/game/objects/items/teleportation.dm | 2 +-
code/game/objects/items/toy_mechs.dm | 4 ++--
code/game/objects/objs.dm | 2 +-
.../structures/beds_chairs/alien_nest.dm | 2 +-
.../structures/crates_lockers/closets.dm | 2 +-
.../crates_lockers/closets/cardboardbox.dm | 4 ++--
.../objects/structures/deployable_turret.dm | 8 +++----
code/game/objects/structures/guncase.dm | 2 +-
code/game/objects/structures/janitor.dm | 2 +-
code/game/objects/structures/ladders.dm | 2 +-
code/game/objects/structures/maintenance.dm | 2 +-
code/game/objects/structures/morgue.dm | 2 +-
.../structures/transit_tubes/station.dm | 2 +-
.../transit_tubes/transit_tube_pod.dm | 2 +-
code/game/turfs/closed/walls.dm | 2 +-
code/game/turfs/open/floor/light_floor.dm | 2 +-
.../abductor/equipment/gear/abductor_items.dm | 4 ++--
code/modules/antagonists/cult/blood_magic.dm | 10 ++++-----
code/modules/antagonists/cult/cult_comms.dm | 10 ++++-----
code/modules/antagonists/cult/cult_items.dm | 2 +-
.../antagonists/cult/cult_structures.dm | 2 +-
code/modules/antagonists/cult/runes.dm | 6 ++---
.../heretic/knowledge/blade_lore.dm | 2 +-
.../antagonists/malf_ai/malf_ai_modules.dm | 18 +++++++--------
.../antagonists/revolution/revolution.dm | 2 +-
.../antagonists/wizard/equipment/soulstone.dm | 4 ++--
.../components/unary_devices/cryo.dm | 4 ++--
code/modules/cards/cardhand.dm | 2 +-
code/modules/cargo/universal_scanner.dm | 2 +-
code/modules/clothing/clothing.dm | 4 ++--
code/modules/clothing/head/helmet.dm | 2 +-
code/modules/clothing/head/jobs.dm | 4 ++--
code/modules/clothing/head/soft_caps.dm | 2 +-
code/modules/clothing/masks/_masks.dm | 2 +-
code/modules/clothing/masks/gasmask.dm | 8 +++----
code/modules/events/ion_storm.dm | 2 +-
code/modules/fishing/fishing_minigame.dm | 2 +-
code/modules/instruments/items.dm | 2 +-
code/modules/jobs/job_types/mime.dm | 2 +-
code/modules/library/bibles.dm | 2 +-
.../ruins/objects_and_mobs/necropolis_gate.dm | 2 +-
.../ruins/spaceruin_code/hilbertshotel.dm | 2 +-
code/modules/mining/equipment/mining_tools.dm | 2 +-
code/modules/mining/ores_coins.dm | 4 ++--
code/modules/mob/living/basic/basic.dm | 2 +-
code/modules/mob/living/basic/drone/_drone.dm | 2 +-
.../mob/living/basic/drone/visuals_icons.dm | 2 +-
.../living/basic/guardian/guardian_creator.dm | 2 +-
.../spider/spider_abilities/wrap.dm | 2 +-
.../mob/living/carbon/alien/adult/adult.dm | 2 +-
.../mob/living/carbon/carbon_defense.dm | 2 +-
code/modules/mob/living/carbon/human/human.dm | 6 ++---
.../mob/living/carbon/human/inventory.dm | 2 +-
code/modules/mob/living/living.dm | 8 +++----
code/modules/mob/living/living_movement.dm | 2 +-
code/modules/mob/living/navigation.dm | 4 ++--
code/modules/mob/living/silicon/ai/ai.dm | 22 +++++++++----------
code/modules/mob/living/silicon/ai/ai_say.dm | 6 ++---
.../mob/living/silicon/ai/freelook/eye.dm | 2 +-
.../mob/living/silicon/ai/robot_control.dm | 2 +-
.../modules/mob/living/silicon/robot/robot.dm | 4 ++--
.../mob/living/silicon/robot/robot_model.dm | 2 +-
code/modules/mob/living/silicon/silicon.dm | 2 +-
.../mob/living/simple_animal/bot/ed209bot.dm | 2 +-
.../mob/living/simple_animal/bot/mulebot.dm | 6 ++---
.../living/simple_animal/hostile/hostile.dm | 2 +-
.../mob/living/simple_animal/simple_animal.dm | 4 ++--
code/modules/mob/mob.dm | 4 ++--
code/modules/mod/mod_activation.dm | 2 +-
code/modules/mod/mod_control.dm | 2 +-
code/modules/mod/mod_paint.dm | 2 +-
code/modules/mod/modules/_module.dm | 2 +-
code/modules/mod/modules/module_kinesis.dm | 2 +-
code/modules/pai/hud.dm | 2 +-
code/modules/pai/shell.dm | 2 +-
code/modules/paperwork/paper.dm | 4 ++--
code/modules/paperwork/paper_cutter.dm | 2 +-
.../photography/camera/silicon_camera.dm | 2 +-
code/modules/photography/photos/photo.dm | 2 +-
code/modules/power/cable.dm | 4 ++--
code/modules/power/pipecleaners.dm | 2 +-
code/modules/power/singularity/emitter.dm | 2 +-
.../projectiles/guns/energy/beam_rifle.dm | 2 +-
.../guns/energy/kinetic_accelerator.dm | 2 +-
.../projectiles/guns/energy/laser_gatling.dm | 2 +-
.../impure_medicine_reagents.dm | 2 +-
.../reagents/reagent_containers/spray.dm | 2 +-
code/modules/recycling/disposal/holder.dm | 2 +-
.../spells/spell_types/pointed/finger_guns.dm | 2 +-
.../spell_types/shapeshift/_shapeshift.dm | 2 +-
.../spells/spell_types/teleport/teleport.dm | 2 +-
.../surgery/bodyparts/robot_bodyparts.dm | 4 ++--
code/modules/tgui/states.dm | 2 +-
code/modules/tgui/states/not_incapacitated.dm | 2 +-
code/modules/transport/transport_module.dm | 4 ++--
code/modules/vehicles/cars/car.dm | 2 +-
code/modules/vehicles/mecha/_mecha.dm | 4 ++--
.../vehicles/mecha/mecha_mob_interaction.dm | 2 +-
code/modules/vehicles/scooter.dm | 2 +-
156 files changed, 238 insertions(+), 238 deletions(-)
diff --git a/code/__DEFINES/ai/ai.dm b/code/__DEFINES/ai/ai.dm
index fc8d5f3491c30..6a52ae3b77a8a 100644
--- a/code/__DEFINES/ai/ai.dm
+++ b/code/__DEFINES/ai/ai.dm
@@ -58,7 +58,7 @@
///macro for whether it's appropriate to resist right now, used by resist subtree
#define SHOULD_RESIST(source) (source.on_fire || source.buckled || HAS_TRAIT(source, TRAIT_RESTRAINED) || (source.pulledby && source.pulledby.grab_state > GRAB_PASSIVE))
///macro for whether the pawn can act, used generally to prevent some horrifying ai disasters
-#define IS_DEAD_OR_INCAP(source) (source.incapacitated() || source.stat)
+#define IS_DEAD_OR_INCAP(source) (source.incapacitated || source.stat)
GLOBAL_LIST_INIT(all_radial_directions, list(
"NORTH" = image(icon = 'icons/testing/turf_analysis.dmi', icon_state = "red_arrow", dir = NORTH),
diff --git a/code/__HELPERS/paths/path.dm b/code/__HELPERS/paths/path.dm
index 61e50601e7848..d865dbe5a5123 100644
--- a/code/__HELPERS/paths/path.dm
+++ b/code/__HELPERS/paths/path.dm
@@ -335,7 +335,7 @@
src.has_gravity = construct_from.has_gravity()
if(ismob(construct_from))
var/mob/living/mob_construct = construct_from
- src.incapacitated = mob_construct.incapacitated()
+ src.incapacitated = mob_construct.incapacitated
if(mob_construct.buckled)
src.buckled_info = new(mob_construct.buckled, access, no_id, call_depth + 1)
if(isobserver(construct_from))
diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm
index 8f95bdadda934..02b52e7dfa5a3 100644
--- a/code/_onclick/ai.dm
+++ b/code/_onclick/ai.dm
@@ -7,7 +7,7 @@
Note that AI have no need for the adjacency proc, and so this proc is a lot cleaner.
*/
/mob/living/silicon/ai/DblClickOn(atom/A, params)
- if(control_disabled || incapacitated())
+ if(control_disabled || incapacitated)
return
if(ismob(A))
@@ -39,7 +39,7 @@
if(check_click_intercept(params,A))
return
- if(control_disabled || incapacitated())
+ if(control_disabled || incapacitated)
return
var/turf/pixel_turf = get_turf_pixel(A)
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index cd06f0c2fd87f..8949f2bd19289 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -102,7 +102,7 @@
CtrlClickOn(A)
return
- if(incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if((incapacitated & IGNORE_RESTRAINTS|IGNORE_STASIS))
return
face_atom(A)
@@ -366,7 +366,7 @@
return FALSE
/mob/living/CtrlClick(mob/living/user)
- if(!isliving(user) || !user.CanReach(src) || user.incapacitated())
+ if(!isliving(user) || !user.CanReach(src) || user.incapacitated)
return ..()
if(world.time < user.next_move)
diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm
index b1b27c3400f42..ae186978d777c 100644
--- a/code/_onclick/cyborg.dm
+++ b/code/_onclick/cyborg.dm
@@ -55,7 +55,7 @@
return
if(W)
- if(incapacitated())
+ if(incapacitated)
return
//while buckled, you can still connect to and control things like doors, but you can't use your modules
diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm
index e9650e35d1fc8..fb439c9300319 100644
--- a/code/_onclick/hud/ai.dm
+++ b/code/_onclick/hud/ai.dm
@@ -2,7 +2,7 @@
icon = 'icons/hud/screen_ai.dmi'
/atom/movable/screen/ai/Click()
- if(isobserver(usr) || usr.incapacitated())
+ if(isobserver(usr) || usr.incapacitated)
return TRUE
/atom/movable/screen/ai/aicore
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index ea22327f13592..f2b6a96ff9398 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -89,7 +89,7 @@
if(world.time <= usr.next_move)
return 1
- if(usr.incapacitated())
+ if(usr.incapacitated)
return 1
if(ismob(usr))
@@ -122,7 +122,7 @@
screen_loc = ui_building
/atom/movable/screen/area_creator/Click()
- if(usr.incapacitated() || (isobserver(usr) && !isAdminGhostAI(usr)))
+ if(usr.incapacitated || (isobserver(usr) && !isAdminGhostAI(usr)))
return TRUE
var/area/A = get_area(usr)
if(!A.outdoors)
@@ -183,7 +183,7 @@
if(world.time <= usr.next_move)
return TRUE
- if(usr.incapacitated(IGNORE_STASIS))
+ if(usr.(incapacitated & IGNORE_STASIS))
return TRUE
if(ismecha(usr.loc)) // stops inventory actions in a mech
return TRUE
@@ -272,7 +272,7 @@
return TRUE
if(world.time <= user.next_move)
return TRUE
- if(user.incapacitated())
+ if(user.incapacitated)
return TRUE
if (ismecha(user.loc)) // stops inventory actions in a mech
return TRUE
@@ -448,7 +448,7 @@
if(world.time <= usr.next_move)
return TRUE
- if(usr.incapacitated())
+ if(usr.incapacitated)
return TRUE
if(ismecha(usr.loc)) // stops inventory actions in a mech
return TRUE
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index f46ab02433ddc..47e0ce1027283 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -113,7 +113,7 @@
if(!(interaction_flags_atom & INTERACT_ATOM_CHECK_GRAB))
ignore_flags |= IGNORE_GRAB
- if(user.incapacitated(ignore_flags))
+ if(user.(incapacitated & ignore_flags))
return FALSE
return TRUE
diff --git a/code/datums/ai/basic_mobs/base_basic_controller.dm b/code/datums/ai/basic_mobs/base_basic_controller.dm
index cd025b28bcb2b..5985332b29ca3 100644
--- a/code/datums/ai/basic_mobs/base_basic_controller.dm
+++ b/code/datums/ai/basic_mobs/base_basic_controller.dm
@@ -21,7 +21,7 @@
var/incap_flags = NONE
if (ai_traits & CAN_ACT_IN_STASIS)
incap_flags |= IGNORE_STASIS
- if(!(ai_traits & CAN_ACT_WHILE_DEAD) && (living_pawn.incapacitated(incap_flags) || living_pawn.stat))
+ if(!(ai_traits & CAN_ACT_WHILE_DEAD) && (living_pawn.(incapacitated & incap_flags) || living_pawn.stat))
return FALSE
if(ai_traits & PAUSE_DURING_DO_AFTER && LAZYLEN(living_pawn.do_afters))
return FALSE
diff --git a/code/datums/ai/oldhostile/hostile_tameable.dm b/code/datums/ai/oldhostile/hostile_tameable.dm
index 5c96eca17da43..254a165e18b7f 100644
--- a/code/datums/ai/oldhostile/hostile_tameable.dm
+++ b/code/datums/ai/oldhostile/hostile_tameable.dm
@@ -128,7 +128,7 @@
/datum/ai_controller/hostile_friend/proc/check_menu(mob/user)
if(!istype(user))
CRASH("A non-mob is trying to issue an order to [pawn].")
- if(user.incapacitated() || !can_see(user, pawn))
+ if(user.incapacitated || !can_see(user, pawn))
return FALSE
return TRUE
diff --git a/code/datums/components/cult_ritual_item.dm b/code/datums/components/cult_ritual_item.dm
index 7d9710977cecb..c48fdd729988d 100644
--- a/code/datums/components/cult_ritual_item.dm
+++ b/code/datums/components/cult_ritual_item.dm
@@ -403,7 +403,7 @@
if(!rune.Adjacent(cultist))
return FALSE
- if(cultist.incapacitated())
+ if(cultist.incapacitated)
return FALSE
if(cultist.stat == DEAD)
@@ -426,7 +426,7 @@
if(QDELETED(tool) || !cultist.is_holding(tool))
return FALSE
- if(cultist.incapacitated() || cultist.stat == DEAD)
+ if(cultist.incapacitated || cultist.stat == DEAD)
to_chat(cultist, span_warning("You can't draw a rune right now."))
return FALSE
diff --git a/code/datums/components/fullauto.dm b/code/datums/components/fullauto.dm
index 33b713e8a57d4..c1ad180a1a5a3 100644
--- a/code/datums/components/fullauto.dm
+++ b/code/datums/components/fullauto.dm
@@ -275,7 +275,7 @@
// Gun procs.
/obj/item/gun/proc/on_autofire_start(mob/living/shooter)
- if(semicd || shooter.incapacitated() || !can_trigger_gun(shooter))
+ if(semicd || shooter.incapacitated || !can_trigger_gun(shooter))
return FALSE
if(!can_shoot())
shoot_with_empty_chamber(shooter)
@@ -295,7 +295,7 @@
/obj/item/gun/proc/do_autofire(datum/source, atom/target, mob/living/shooter, allow_akimbo, params)
SIGNAL_HANDLER
- if(semicd || shooter.incapacitated())
+ if(semicd || shooter.incapacitated)
return NONE
if(!can_shoot())
shoot_with_empty_chamber(shooter)
diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm
index 20afd23272607..4e3e459d78877 100644
--- a/code/datums/components/riding/riding_mob.dm
+++ b/code/datums/components/riding/riding_mob.dm
@@ -56,10 +56,10 @@
if(living_parent.body_position != STANDING_UP) // if we move while on the ground, the rider falls off
. = FALSE
// for piggybacks and (redundant?) borg riding, check if the rider is stunned/restrained
- else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || rider.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB)))
+ else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || rider.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
. = FALSE
// for fireman carries, check if the ridden is stunned/restrained
- else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || living_parent.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB)))
+ else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || living_parent.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
. = FALSE
else if((ride_check_flags & JUST_FRIEND_RIDERS) && !(living_parent.faction.Find(REF(rider))))
. = FALSE
diff --git a/code/datums/components/subtype_picker.dm b/code/datums/components/subtype_picker.dm
index 78401c9e02293..2cc76e42ecf1f 100644
--- a/code/datums/components/subtype_picker.dm
+++ b/code/datums/components/subtype_picker.dm
@@ -87,6 +87,6 @@
return FALSE
if(QDELETED(target))
return FALSE
- if(user.incapacitated() || !user.is_holding(target))
+ if(user.incapacitated || !user.is_holding(target))
return FALSE
return TRUE
diff --git a/code/datums/components/tackle.dm b/code/datums/components/tackle.dm
index 28fc3be29c2fd..74c57b470f0aa 100644
--- a/code/datums/components/tackle.dm
+++ b/code/datums/components/tackle.dm
@@ -74,7 +74,7 @@
if(modifiers[ALT_CLICK] || modifiers[SHIFT_CLICK] || modifiers[CTRL_CLICK] || modifiers[MIDDLE_CLICK])
return
- if(!user.throw_mode || user.get_active_held_item() || user.pulling || user.buckled || user.incapacitated())
+ if(!user.throw_mode || user.get_active_held_item() || user.pulling || user.buckled || user.incapacitated)
return
if(!clicked_atom || !(isturf(clicked_atom) || isturf(clicked_atom.loc)))
diff --git a/code/datums/components/toggle_suit.dm b/code/datums/components/toggle_suit.dm
index 596bf3b3252d2..0efb990108bda 100644
--- a/code/datums/components/toggle_suit.dm
+++ b/code/datums/components/toggle_suit.dm
@@ -45,7 +45,7 @@
if(!living_user.Adjacent(source))
return
- if(living_user.incapacitated())
+ if(living_user.incapacitated)
source.balloon_alert(user, "you're incapacitated!")
return
diff --git a/code/datums/elements/drag_pickup.dm b/code/datums/elements/drag_pickup.dm
index ffce267a895a1..d4b40ae451770 100644
--- a/code/datums/elements/drag_pickup.dm
+++ b/code/datums/elements/drag_pickup.dm
@@ -18,7 +18,7 @@
/datum/element/drag_pickup/proc/pick_up(atom/source, atom/over, mob/user)
SIGNAL_HANDLER
var/mob/living/picker = user
- if(!istype(picker) || picker.incapacitated() || !source.Adjacent(picker))
+ if(!istype(picker) || picker.incapacitated || !source.Adjacent(picker))
return
if(over == picker)
diff --git a/code/datums/elements/waddling.dm b/code/datums/elements/waddling.dm
index e63d0329bb630..45c7fe5e93773 100644
--- a/code/datums/elements/waddling.dm
+++ b/code/datums/elements/waddling.dm
@@ -18,7 +18,7 @@
return
if(isliving(moved))
var/mob/living/living_moved = moved
- if (living_moved.incapacitated() || living_moved.body_position == LYING_DOWN)
+ if (living_moved.incapacitated || living_moved.body_position == LYING_DOWN)
return
waddling_animation(moved)
diff --git a/code/datums/elements/wheel.dm b/code/datums/elements/wheel.dm
index 2bb8977ca5cae..a50addb15a382 100644
--- a/code/datums/elements/wheel.dm
+++ b/code/datums/elements/wheel.dm
@@ -17,7 +17,7 @@
return
if(isliving(moved))
var/mob/living/living_moved = moved
- if (living_moved.incapacitated() || living_moved.body_position == LYING_DOWN)
+ if (living_moved.incapacitated || living_moved.body_position == LYING_DOWN)
return
var/rotation_degree = (360 / 3)
if(direction & SOUTHWEST)
diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm
index 78ec5f133066c..2498a570674e9 100644
--- a/code/datums/holocall.dm
+++ b/code/datums/holocall.dm
@@ -179,7 +179,7 @@
if(QDELETED(src))
return FALSE
- . = !QDELETED(user) && !user.incapacitated() && !QDELETED(calling_holopad) && calling_holopad.is_operational && user.loc == calling_holopad.loc
+ . = !QDELETED(user) && !user.incapacitated && !QDELETED(calling_holopad) && calling_holopad.is_operational && user.loc == calling_holopad.loc
if(.)
if(!connected_holopad)
diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm
index c55f95d4bd6af..a87baeb988712 100644
--- a/code/datums/martial/sleeping_carp.dm
+++ b/code/datums/martial/sleeping_carp.dm
@@ -184,7 +184,7 @@
/datum/martial_art/the_sleeping_carp/proc/can_deflect(mob/living/carp_user)
if(!can_use(carp_user) || !carp_user.combat_mode)
return FALSE
- if(carp_user.incapacitated(IGNORE_GRAB)) //NO STUN
+ if(carp_user.(incapacitated & IGNORE_GRAB)) //NO STUN
return FALSE
if(!(carp_user.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
return FALSE
diff --git a/code/datums/mutations/hulk.dm b/code/datums/mutations/hulk.dm
index 5db065609644a..d9dc639ffe97b 100644
--- a/code/datums/mutations/hulk.dm
+++ b/code/datums/mutations/hulk.dm
@@ -120,7 +120,7 @@
return
if(!user.throw_mode || user.get_active_held_item() || user.zone_selected != BODY_ZONE_PRECISE_GROIN)
return
- if(user.grab_state < GRAB_NECK || !iscarbon(user.pulling) || user.buckled || user.incapacitated())
+ if(user.grab_state < GRAB_NECK || !iscarbon(user.pulling) || user.buckled || user.incapacitated)
return
var/mob/living/carbon/possible_throwable = user.pulling
@@ -173,7 +173,7 @@
* For each step of the swinging, with the delay getting shorter along the way. Checks to see we still have them in our grasp at each step.
*/
/datum/mutation/human/hulk/proc/swing_loop(mob/living/carbon/human/the_hulk, mob/living/carbon/yeeted_person, step, original_dir)
- if(!yeeted_person || !the_hulk || the_hulk.incapacitated())
+ if(!yeeted_person || !the_hulk || the_hulk.incapacitated)
return
if(get_dist(the_hulk, yeeted_person) > 1 || !isturf(the_hulk.loc) || !isturf(yeeted_person.loc))
to_chat(the_hulk, span_warning("You lose your grasp on [yeeted_person]!"))
@@ -244,7 +244,7 @@
/// Time to toss the victim at high speed
/datum/mutation/human/hulk/proc/finish_swing(mob/living/carbon/human/the_hulk, mob/living/carbon/yeeted_person, original_dir)
- if(!yeeted_person || !the_hulk || the_hulk.incapacitated())
+ if(!yeeted_person || !the_hulk || the_hulk.incapacitated)
return
if(get_dist(the_hulk, yeeted_person) > 1 || !isturf(the_hulk.loc) || !isturf(yeeted_person.loc))
to_chat(the_hulk, span_warning("You lose your grasp on [yeeted_person]!"))
diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm
index b2a37356e53c0..04ed1df9ecf4c 100644
--- a/code/datums/status_effects/debuffs/debuffs.dm
+++ b/code/datums/status_effects/debuffs/debuffs.dm
@@ -611,7 +611,7 @@
alert_type = null
/datum/status_effect/spasms/tick(seconds_between_ticks)
- if(owner.stat >= UNCONSCIOUS || owner.incapacitated() || HAS_TRAIT(owner, TRAIT_HANDS_BLOCKED) || HAS_TRAIT(owner, TRAIT_IMMOBILIZED))
+ if(owner.stat >= UNCONSCIOUS || owner.incapacitated || HAS_TRAIT(owner, TRAIT_HANDS_BLOCKED) || HAS_TRAIT(owner, TRAIT_IMMOBILIZED))
return
if(!prob(15))
return
diff --git a/code/datums/status_effects/debuffs/strandling.dm b/code/datums/status_effects/debuffs/strandling.dm
index 6050a3df304da..0ce0ad4188221 100644
--- a/code/datums/status_effects/debuffs/strandling.dm
+++ b/code/datums/status_effects/debuffs/strandling.dm
@@ -57,7 +57,7 @@
* tool - the tool the user's using to remove the strange. Can be null.
*/
/datum/status_effect/strandling/proc/try_remove_effect(mob/user, obj/item/tool)
- if(user.incapacitated() || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
+ if(user.incapacitated || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return
user.visible_message(
diff --git a/code/datums/storage/storage.dm b/code/datums/storage/storage.dm
index 87398f52555f3..be2bc6c172e1d 100644
--- a/code/datums/storage/storage.dm
+++ b/code/datums/storage/storage.dm
@@ -701,7 +701,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
/datum/storage/proc/on_mousedrop_onto(datum/source, atom/over_object, mob/user)
SIGNAL_HANDLER
- if(ismecha(user.loc) || user.incapacitated() || !user.canUseStorage())
+ if(ismecha(user.loc) || user.incapacitated || !user.canUseStorage())
return
parent.add_fingerprint(user)
@@ -776,7 +776,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
if(!iscarbon(user) && !isdrone(user))
return
var/mob/living/user_living = user
- if(user_living.incapacitated())
+ if(user_living.incapacitated)
return
attempt_insert(dropping, user)
@@ -928,7 +928,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
parent.balloon_alert(to_show, "can't reach!")
return FALSE
- if(!isliving(to_show) || to_show.incapacitated())
+ if(!isliving(to_show) || to_show.incapacitated)
return FALSE
if(locked)
diff --git a/code/game/machinery/computer/orders/order_computer/mining_order.dm b/code/game/machinery/computer/orders/order_computer/mining_order.dm
index 7e7eabcc1bfd5..fda571157c434 100644
--- a/code/game/machinery/computer/orders/order_computer/mining_order.dm
+++ b/code/game/machinery/computer/orders/order_computer/mining_order.dm
@@ -121,7 +121,7 @@
/obj/machinery/computer/order_console/mining/proc/check_menu(obj/item/mining_voucher/voucher, mob/living/redeemer)
if(!istype(redeemer))
return FALSE
- if(redeemer.incapacitated())
+ if(redeemer.incapacitated)
return FALSE
if(QDELETED(voucher))
return FALSE
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 16f89fdf3c103..cfd7dd7764dba 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -170,7 +170,7 @@ Possible to do for anyone motivated enough:
/obj/machinery/holopad/tutorial/attack_hand(mob/user, list/modifiers)
if(!istype(user))
return
- if(user.incapacitated() || !is_operational)
+ if(user.incapacitated || !is_operational)
return
if(replay_mode)
replay_stop()
@@ -677,7 +677,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(!isliving(owner))
return TRUE
var/mob/living/user = owner
- if(user.incapacitated() || !user.client)
+ if(user.incapacitated || !user.client)
return FALSE
return TRUE
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 6244dcdd2dbc5..e3db76360b60a 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -329,7 +329,7 @@
return
if(!usr.can_perform_action(src))
return
- if(usr.incapacitated())
+ if(usr.incapacitated)
return
if(reagent_container)
if(attached)
@@ -347,7 +347,7 @@
if(!isliving(usr))
to_chat(usr, span_warning("You can't do that!"))
return
- if(!usr.can_perform_action(src) || usr.incapacitated())
+ if(!usr.can_perform_action(src) || usr.incapacitated)
return
if(inject_only)
mode = IV_INJECTING
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index d9e3787fd9ead..445c6615bd9b1 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -169,7 +169,7 @@ Buildable meters
set name = "Invert Pipe"
set src in view(1)
- if ( usr.incapacitated() )
+ if ( usr.incapacitated )
return
do_a_flip()
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index d65f33e95878c..83f03bccc1a8e 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -186,7 +186,7 @@
//Allow you to drag-drop disposal pipes and transit tubes into it
/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/usr)
- if(!usr.incapacitated())
+ if(!usr.incapacitated)
return
if (!istype(pipe, /obj/structure/disposalconstruct) && !istype(pipe, /obj/structure/c_transit_tube) && !istype(pipe, /obj/structure/c_transit_tube_pod))
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index e4fc4592b7930..9c3cd99c42b5d 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -274,7 +274,7 @@
*/
/atom/movable/proc/is_user_buckle_possible(mob/living/target, mob/user, check_loc = TRUE)
// Standard adjacency and other checks.
- if(!Adjacent(user) || !Adjacent(target) || !isturf(user.loc) || user.incapacitated() || target.anchored)
+ if(!Adjacent(user) || !Adjacent(target) || !isturf(user.loc) || user.incapacitated || target.anchored)
return FALSE
if(iscarbon(user))
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 0abe9312a5f98..ebf8f470cd895 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -746,7 +746,7 @@
set category = "Object"
set name = "Pick up"
- if(usr.incapacitated() || !Adjacent(usr))
+ if(usr.incapacitated || !Adjacent(usr))
return
if(isliving(usr))
@@ -1031,7 +1031,7 @@
var/timedelay = usr.client.prefs.read_preference(/datum/preference/numeric/tooltip_delay) / 100
tip_timer = addtimer(CALLBACK(src, PROC_REF(openTip), location, control, params, usr), timedelay, TIMER_STOPPABLE)//timer takes delay in deciseconds, but the pref is in milliseconds. dividing by 100 converts it.
if(usr.client.prefs.read_preference(/datum/preference/toggle/item_outlines))
- if(istype(L) && L.incapacitated())
+ if(istype(L) && L.incapacitated)
apply_outline(COLOR_RED_GRAY) //if they're dead or handcuffed, let's show the outline as red to indicate that they can't interact with that right now
else
apply_outline() //if the player's alive and well we send the command with no color set, so it uses the theme's color
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 7e67b23c3b716..68f1579eb380f 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -86,7 +86,7 @@
return item_bag
/obj/item/bodybag/bluespace/container_resist_act(mob/living/user)
- if(user.incapacitated())
+ if(user.incapacitated)
to_chat(user, span_warning("You can't get out while you're restrained like this!"))
return
user.changeNext_move(CLICK_CD_BREAKOUT)
@@ -97,7 +97,7 @@
return
// you are still in the bag? time to go unless you KO'd, honey!
// if they escape during this time and you rebag them the timer is still clocking down and does NOT reset so they can very easily get out.
- if(user.incapacitated())
+ if(user.incapacitated)
to_chat(loc, span_warning("The pressure subsides. It seems that they've stopped resisting..."))
return
loc.visible_message(span_warning("[user] suddenly appears in front of [loc]!"), span_userdanger("[user] breaks free of [src]!"))
diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm
index 71f3a244a3081..63ea95fdafe6e 100644
--- a/code/game/objects/items/cardboard_cutouts.dm
+++ b/code/game/objects/items/cardboard_cutouts.dm
@@ -149,7 +149,7 @@
/obj/item/cardboard_cutout/proc/check_menu(mob/living/user, obj/item/toy/crayon/crayon)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(pushed_over)
to_chat(user, span_warning("Right [src] first!"))
diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm
index b0502c34144f5..d4043162b74c7 100644
--- a/code/game/objects/items/cards_ids.dm
+++ b/code/game/objects/items/cards_ids.dm
@@ -1830,7 +1830,7 @@
/obj/item/card/cardboard/proc/after_input_check(mob/living/user, obj/item/item, input, value)
if(!input || (value && input == value))
return FALSE
- if(QDELETED(user) || QDELETED(item) || QDELETED(src) || user.incapacitated() || !user.is_holding(item) || !user.CanReach(src) || !user.can_write(item))
+ if(QDELETED(user) || QDELETED(item) || QDELETED(src) || user.incapacitated || !user.is_holding(item) || !user.CanReach(src) || !user.can_write(item))
return FALSE
return TRUE
diff --git a/code/game/objects/items/cosmetics.dm b/code/game/objects/items/cosmetics.dm
index 12d71db1d5a1e..65f3e30d5c12a 100644
--- a/code/game/objects/items/cosmetics.dm
+++ b/code/game/objects/items/cosmetics.dm
@@ -77,7 +77,7 @@
/obj/item/lipstick/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.is_holding(src))
+ if(user.incapacitated || !user.is_holding(src))
return FALSE
return TRUE
diff --git a/code/game/objects/items/debug_items.dm b/code/game/objects/items/debug_items.dm
index 4f6239acbe817..fbd0f49590a4a 100644
--- a/code/game/objects/items/debug_items.dm
+++ b/code/game/objects/items/debug_items.dm
@@ -42,7 +42,7 @@
/obj/item/debug/omnitool/proc/check_menu(mob/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index 7a661b640baa1..1acd6f3570171 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -140,7 +140,7 @@
. = ..()
if(ismob(loc))
var/mob/M = loc
- if(!M.incapacitated() && istype(over_object, /atom/movable/screen/inventory/hand))
+ if(!M.incapacitated && istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index e670fdec914f7..b10871f112f5b 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -272,7 +272,7 @@
//catpeople: make any felinid near the target to face the target, chance for felinids to pounce at the light, stepping to the target
for(var/mob/living/carbon/human/target_felinid in view(1, targloc))
- if(!isfelinid(target_felinid) || target_felinid.stat == DEAD || target_felinid.is_blind() || target_felinid.incapacitated())
+ if(!isfelinid(target_felinid) || target_felinid.stat == DEAD || target_felinid.is_blind() || target_felinid.incapacitated)
continue
if(target_felinid.body_position == STANDING_UP)
target_felinid.setDir(get_dir(target_felinid, targloc)) // kitty always looks at the light
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index 310df72dbdadc..43763f9a7d525 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -448,7 +448,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
grant_headset_languages(mob_loc)
/obj/item/radio/headset/AltClick(mob/living/user)
- if(!istype(user) || !Adjacent(user) || user.incapacitated())
+ if(!istype(user) || !Adjacent(user) || user.incapacitated)
return
if (command)
use_command = !use_command
diff --git a/code/game/objects/items/devices/scanners/health_analyzer.dm b/code/game/objects/items/devices/scanners/health_analyzer.dm
index 83ea668a9fb28..072fed2eda830 100644
--- a/code/game/objects/items/devices/scanners/health_analyzer.dm
+++ b/code/game/objects/items/devices/scanners/health_analyzer.dm
@@ -128,7 +128,7 @@
* tochat - Whether to immediately post the result into the chat of the user, otherwise it will return the results.
*/
/proc/healthscan(mob/user, mob/living/target, mode = SCANNER_VERBOSE, advanced = FALSE, tochat = TRUE)
- if(user.incapacitated())
+ if(user.incapacitated)
return
// the final list of strings to render
@@ -405,7 +405,7 @@
return(jointext(render_list, ""))
/proc/chemscan(mob/living/user, mob/living/target)
- if(user.incapacitated())
+ if(user.incapacitated)
return
if(istype(target) && target.reagents)
@@ -495,7 +495,7 @@
/// Displays wounds with extended information on their status vs medscanners
/proc/woundscan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/scanner, simple_scan = FALSE)
- if(!istype(patient) || user.incapacitated())
+ if(!istype(patient) || user.incapacitated)
return
var/render_list = ""
@@ -664,7 +664,7 @@
/// Checks the individual for any diseases that are visible to the scanner, and displays the diseases in the attacked to the attacker.
/proc/diseasescan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/simple/scanner)
- if(!istype(patient) || user.incapacitated())
+ if(!istype(patient) || user.incapacitated)
return
var/list/render = list()
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index c686eeb04a7a7..4cb46f838fbef 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -124,7 +124,7 @@
/obj/item/taperecorder/proc/can_use(mob/user)
if(user && ismob(user))
- if(!user.incapacitated())
+ if(!user.incapacitated)
return TRUE
return FALSE
diff --git a/code/game/objects/items/paint.dm b/code/game/objects/items/paint.dm
index 0b357c3c728c2..fabcff1706619 100644
--- a/code/game/objects/items/paint.dm
+++ b/code/game/objects/items/paint.dm
@@ -108,7 +108,7 @@
return FALSE
if(!user.is_holding(src))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
return TRUE
diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm
index 3a020ec5393ea..7ff1bf0c8c253 100644
--- a/code/game/objects/items/pinpointer.dm
+++ b/code/game/objects/items/pinpointer.dm
@@ -152,7 +152,7 @@
return
if(isnull(names[pinpoint_target]))
return
- if(QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated())
+ if(QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated)
return
target = names[pinpoint_target]
toggle_on()
diff --git a/code/game/objects/items/rcd/RHD.dm b/code/game/objects/items/rcd/RHD.dm
index 9151c85ed0311..40f1b9d5275a6 100644
--- a/code/game/objects/items/rcd/RHD.dm
+++ b/code/game/objects/items/rcd/RHD.dm
@@ -276,7 +276,7 @@
/obj/item/construction/proc/check_menu(mob/living/user, remote_anchor)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(remote_anchor && user.remote_control != remote_anchor)
return FALSE
diff --git a/code/game/objects/items/rcd/RPD.dm b/code/game/objects/items/rcd/RPD.dm
index e47779776059b..f43d6ae8d71cf 100644
--- a/code/game/objects/items/rcd/RPD.dm
+++ b/code/game/objects/items/rcd/RPD.dm
@@ -681,7 +681,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(multi_layer)
balloon_alert(source_mob, "turn off multi layer!")
return
- if(source_mob.incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if(source_mob.incapacitated & (IGNORE_RESTRAINTS|IGNORE_STASIS))
return
if(source_mob.get_active_held_item() != src)
return
diff --git a/code/game/objects/items/rcd/RPLD.dm b/code/game/objects/items/rcd/RPLD.dm
index de7e80cf190cf..2383219444232 100644
--- a/code/game/objects/items/rcd/RPLD.dm
+++ b/code/game/objects/items/rcd/RPLD.dm
@@ -280,7 +280,7 @@
/obj/item/construction/plumbing/proc/mouse_wheeled(mob/source, atom/A, delta_x, delta_y, params)
SIGNAL_HANDLER
- if(source.incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if(source.(incapacitated & IGNORE_RESTRAINTS|IGNORE_STASIS))
return
if(delta_y == 0)
return
diff --git a/code/game/objects/items/rcd/RSF.dm b/code/game/objects/items/rcd/RSF.dm
index 8db8c2a91161a..1f20bc3da27bb 100644
--- a/code/game/objects/items/rcd/RSF.dm
+++ b/code/game/objects/items/rcd/RSF.dm
@@ -121,7 +121,7 @@ RSF
return radial_list
/obj/item/rsf/proc/check_menu(mob/user)
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/game/objects/items/rcd/RWD.dm b/code/game/objects/items/rcd/RWD.dm
index a20946e322fae..fe4b504d7db1a 100644
--- a/code/game/objects/items/rcd/RWD.dm
+++ b/code/game/objects/items/rcd/RWD.dm
@@ -152,7 +152,7 @@
if(!ISADVANCEDTOOLUSER(user))
to_chat(user, span_warning("You don't have the dexterity to do this!"))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/game/objects/items/scrolls.dm b/code/game/objects/items/scrolls.dm
index 65d9000728d53..3fea8376eb3d2 100644
--- a/code/game/objects/items/scrolls.dm
+++ b/code/game/objects/items/scrolls.dm
@@ -55,7 +55,7 @@
if(!ishuman(user))
return
var/mob/living/carbon/human/human_user = user
- if(human_user.incapacitated() || !human_user.is_holding(src))
+ if(human_user.incapacitated || !human_user.is_holding(src))
return
var/datum/action/cooldown/spell/teleport/area_teleport/wizard/scroll/teleport = locate() in actions
if(!teleport)
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index 18a95cd77d378..3bf61fe392afb 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -375,7 +375,7 @@
/obj/item/stack/proc/radial_check(mob/builder)
if(QDELETED(builder) || QDELETED(src))
return FALSE
- if(builder.incapacitated())
+ if(builder.incapacitated)
return FALSE
if(!builder.is_holding(src))
return FALSE
diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm
index cc548be16d27e..42548ae702ea4 100644
--- a/code/game/objects/items/storage/bags.dm
+++ b/code/game/objects/items/storage/bags.dm
@@ -272,7 +272,7 @@
. += span_notice("Ctrl-click to activate seed extraction.")
/obj/item/storage/bag/plants/portaseeder/CtrlClick(mob/user)
- if(user.incapacitated())
+ if(user.incapacitated)
return
for(var/obj/item/plant in contents)
seedify(plant, 1)
diff --git a/code/game/objects/items/storage/boxes/food_boxes.dm b/code/game/objects/items/storage/boxes/food_boxes.dm
index c49fa288eb38b..1c8e2ff7af282 100644
--- a/code/game/objects/items/storage/boxes/food_boxes.dm
+++ b/code/game/objects/items/storage/boxes/food_boxes.dm
@@ -126,7 +126,7 @@
/obj/item/storage/box/papersack/proc/check_menu(mob/user, obj/item/pen/P)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(contents.len)
balloon_alert(user, "items inside!")
diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm
index 339894eb2d8f0..b1b71494a34bd 100644
--- a/code/game/objects/items/tanks/jetpack.dm
+++ b/code/game/objects/items/tanks/jetpack.dm
@@ -74,7 +74,7 @@
toggle_internals(user)
/obj/item/tank/jetpack/proc/cycle(mob/user)
- if(user.incapacitated())
+ if(user.incapacitated)
return
if(!on)
diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm
index 9950b8e9c931e..d8f88dc3de2a2 100644
--- a/code/game/objects/items/tanks/watertank.dm
+++ b/code/game/objects/items/tanks/watertank.dm
@@ -46,7 +46,7 @@
if(user.get_item_by_slot(user.getBackSlot()) != src)
to_chat(user, span_warning("The watertank must be worn properly to use!"))
return
- if(user.incapacitated())
+ if(user.incapacitated)
return
if(QDELETED(noz))
diff --git a/code/game/objects/items/tcg/tcg.dm b/code/game/objects/items/tcg/tcg.dm
index 61d0dbe071d9c..68deb8393bdff 100644
--- a/code/game/objects/items/tcg/tcg.dm
+++ b/code/game/objects/items/tcg/tcg.dm
@@ -151,7 +151,7 @@ GLOBAL_LIST_EMPTY(tcgcard_radial_choices)
/obj/item/tcgcard/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
@@ -248,7 +248,7 @@ GLOBAL_LIST_EMPTY(tcgcard_radial_choices)
/obj/item/tcgcard_deck/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/game/objects/items/tcg/tcg_machines.dm b/code/game/objects/items/tcg/tcg_machines.dm
index 78854afdd5b39..77b6891e4c17a 100644
--- a/code/game/objects/items/tcg/tcg_machines.dm
+++ b/code/game/objects/items/tcg/tcg_machines.dm
@@ -105,7 +105,7 @@ GLOBAL_LIST_EMPTY(tcgcard_machine_radial_choices)
/obj/machinery/trading_card_holder/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
@@ -356,7 +356,7 @@ GLOBAL_LIST_EMPTY(tcgcard_mana_bar_radial_choices)
/obj/machinery/trading_card_button/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm
index 38a8195319357..ec28c93fb0983 100644
--- a/code/game/objects/items/teleportation.dm
+++ b/code/game/objects/items/teleportation.dm
@@ -188,7 +188,7 @@
var/teleport_location_key = tgui_input_list(user, "Teleporter to lock on", "Hand Teleporter", sort_list(locations))
if (isnull(teleport_location_key))
return
- if(user.get_active_held_item() != src || user.incapacitated())
+ if(user.get_active_held_item() != src || user.incapacitated)
return
// Not always a datum, but needed for IS_WEAKREF_OF to cast properly.
diff --git a/code/game/objects/items/toy_mechs.dm b/code/game/objects/items/toy_mechs.dm
index c50908738fe94..7511ef063b708 100644
--- a/code/game/objects/items/toy_mechs.dm
+++ b/code/game/objects/items/toy_mechs.dm
@@ -96,7 +96,7 @@
return FALSE
//dead men tell no tales, incapacitated men fight no fights
- if(attacker_controller.incapacitated())
+ if(attacker_controller.incapacitated)
return FALSE
//if the attacker_controller isn't next to the attacking toy (and doesn't have telekinesis), the battle ends
if(!in_range(attacker, attacker_controller) && !(attacker_controller.dna.check_mutation(/datum/mutation/human/telekinesis)))
@@ -106,7 +106,7 @@
//if it's PVP and the opponent is not next to the defending(src) toy (and doesn't have telekinesis), the battle ends
if(opponent)
- if(opponent.incapacitated())
+ if(opponent.incapacitated)
return FALSE
if(!in_range(src, opponent) && !(opponent.dna.check_mutation(/datum/mutation/human/telekinesis)))
opponent.visible_message(span_notice("[opponent.name] separates from [src], ending the battle."), \
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index b6946dffc9aca..7b7a29b7d7fb3 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -239,7 +239,7 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag)
return FALSE
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
return TRUE
diff --git a/code/game/objects/structures/beds_chairs/alien_nest.dm b/code/game/objects/structures/beds_chairs/alien_nest.dm
index 77759c9e309b0..2eb63324f1f64 100644
--- a/code/game/objects/structures/beds_chairs/alien_nest.dm
+++ b/code/game/objects/structures/beds_chairs/alien_nest.dm
@@ -59,7 +59,7 @@
add_fingerprint(hero)
/obj/structure/bed/nest/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
- if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.incapacitated() || M.buckled )
+ if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.incapacitated || M.buckled )
return
if(M.get_organ_by_type(/obj/item/organ/internal/alien/plasmavessel))
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 4a201cba5b8a4..20f41742b9ed0 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -909,7 +909,7 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets)
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
if(!istype(O) || O.anchored || istype(O, /atom/movable/screen))
return
- if(!istype(user) || user.incapacitated() || user.body_position == LYING_DOWN)
+ if(!istype(user) || user.incapacitated || user.body_position == LYING_DOWN)
return
if(!Adjacent(user) || !user.Adjacent(O))
return
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index f0d1eaa0cc819..cbee321c485d6 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -32,7 +32,7 @@
var/move_delay = FALSE
/obj/structure/closet/cardboard/relaymove(mob/living/user, direction)
- if(opened || move_delay || user.incapacitated() || !isturf(loc) || !has_gravity(loc))
+ if(opened || move_delay || user.incapacitated || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
var/oldloc = loc
@@ -72,7 +72,7 @@
for(var/mob/living/alerted_mob as anything in alerted)
if(alerted_mob.stat != CONSCIOUS || alerted_mob.is_blind())
continue
- if(!alerted_mob.incapacitated(IGNORE_RESTRAINTS))
+ if(!alerted_mob.(incapacitated & IGNORE_RESTRAINTS))
alerted_mob.face_atom(src)
alerted_mob.do_alert_animation()
diff --git a/code/game/objects/structures/deployable_turret.dm b/code/game/objects/structures/deployable_turret.dm
index ac4b35678c9b1..7dd5783215936 100644
--- a/code/game/objects/structures/deployable_turret.dm
+++ b/code/game/objects/structures/deployable_turret.dm
@@ -83,7 +83,7 @@
STOP_PROCESSING(SSfastprocess, src)
/obj/machinery/deployable_turret/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
- if(user.incapacitated() || !istype(user))
+ if(user.incapacitated || !istype(user))
return
M.forceMove(get_turf(src))
. = ..()
@@ -127,7 +127,7 @@
calculated_projectile_vars = calculate_projectile_angle_and_pixel_offsets(controller, target_turf, modifiers)
/obj/machinery/deployable_turret/proc/direction_track(mob/user, atom/targeted)
- if(user.incapacitated())
+ if(user.incapacitated)
return
setDir(get_dir(src,targeted))
user.setDir(dir)
@@ -167,7 +167,7 @@
/obj/machinery/deployable_turret/proc/checkfire(atom/targeted_atom, mob/user)
target = targeted_atom
- if(target == user || user.incapacitated() || target == get_turf(src))
+ if(target == user || user.incapacitated || target == get_turf(src))
return
if(world.time < cooldown)
if(!warned && world.time > (cooldown - cooldown_duration + rate_of_fire*number_of_shots)) // To capture the window where one is done firing
@@ -185,7 +185,7 @@
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/deployable_turret/, fire_helper), user), i*rate_of_fire)
/obj/machinery/deployable_turret/proc/fire_helper(mob/user)
- if(user.incapacitated() || !(user in buckled_mobs))
+ if(user.incapacitated || !(user in buckled_mobs))
return
update_positioning() //REFRESH MOUSE TRACKING!!
var/turf/targets_from = get_turf(src)
diff --git a/code/game/objects/structures/guncase.dm b/code/game/objects/structures/guncase.dm
index 4f4972d486415..b297b670b0ebe 100644
--- a/code/game/objects/structures/guncase.dm
+++ b/code/game/objects/structures/guncase.dm
@@ -104,7 +104,7 @@
return FALSE
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
return TRUE
diff --git a/code/game/objects/structures/janitor.dm b/code/game/objects/structures/janitor.dm
index 4f5bdf2812732..12a5abb3170bb 100644
--- a/code/game/objects/structures/janitor.dm
+++ b/code/game/objects/structures/janitor.dm
@@ -336,7 +336,7 @@
* * user The mob interacting with a menu
*/
/obj/structure/mop_bucket/janitorialcart/proc/check_menu(mob/living/user)
- return istype(user) && !user.incapacitated()
+ return istype(user) && !user.incapacitated
/obj/structure/mop_bucket/janitorialcart/update_overlays()
. = ..()
diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm
index ef6ea9d433e8f..d24dc90b22763 100644
--- a/code/game/objects/structures/ladders.dm
+++ b/code/game/objects/structures/ladders.dm
@@ -169,7 +169,7 @@
INVOKE_ASYNC(src, PROC_REF(start_travelling), user, going_up)
/obj/structure/ladder/proc/check_menu(mob/user, is_ghost)
- if(user.incapacitated() || (!user.Adjacent(src)))
+ if(user.incapacitated || (!user.Adjacent(src)))
return FALSE
return TRUE
diff --git a/code/game/objects/structures/maintenance.dm b/code/game/objects/structures/maintenance.dm
index ecd6f54d2557a..a9838f688a420 100644
--- a/code/game/objects/structures/maintenance.dm
+++ b/code/game/objects/structures/maintenance.dm
@@ -226,7 +226,7 @@ at the cost of risking a vicious bite.**/
/obj/structure/destructible/cult/pants_altar/proc/check_menu(mob/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index bbdf209148c53..f0eeb83085582 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -509,7 +509,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
var/mob/M = O
if(M.buckled)
return
- if(!ismob(user) || user.incapacitated())
+ if(!ismob(user) || user.incapacitated)
return
if(isliving(user))
var/mob/living/L = user
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index 3eeb81cb8aca5..634dae6b2b4b4 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -45,7 +45,7 @@
/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/user)
if(isliving(user))
var/mob/living/L = user
- if(L.incapacitated())
+ if(L.incapacitated)
return
if (!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
return
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index b1168302f683f..59283af315b3a 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -69,7 +69,7 @@
deconstruct(FALSE)
/obj/structure/transit_tube_pod/container_resist_act(mob/living/user)
- if(!user.incapacitated())
+ if(!user.incapacitated)
empty_pod()
return
if(!moving)
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index 6797f5a379f0f..6646e0b01d68f 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -40,7 +40,7 @@
if(!iscarbon(dropping) && !iscyborg(dropping))
return
var/mob/living/leaner = dropping
- if(leaner.incapacitated(IGNORE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
+ if(leaner.(incapacitated & IGNORE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
return
if(!leaner.density || leaner.pulledby || leaner.buckled || !(leaner.mobility_flags & MOBILITY_STAND))
return
diff --git a/code/game/turfs/open/floor/light_floor.dm b/code/game/turfs/open/floor/light_floor.dm
index dd30a86d8de45..793e4ce8e55e4 100644
--- a/code/game/turfs/open/floor/light_floor.dm
+++ b/code/game/turfs/open/floor/light_floor.dm
@@ -184,7 +184,7 @@
/turf/open/floor/light/proc/check_menu(mob/living/user, obj/item/multitool)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(!multitool || !user.is_holding(multitool))
return FALSE
diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
index 07e8dad2aa659..eb1e68e84508b 100644
--- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
+++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
@@ -394,7 +394,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/melee/baton/abductor/proc/SleepAttack(mob/living/target, mob/living/user)
playsound(src, on_stun_sound, 50, TRUE, -1)
- if(target.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB))
+ if(target.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB))
if(target.can_block_magic(MAGIC_RESISTANCE_MIND))
to_chat(user, span_warning("The specimen has some kind of mental protection that is interfering with the sleep inducement! It seems you've been foiled."))
target.visible_message(span_danger("[user] tried to induced sleep in [target] with [src], but is unsuccessful!"), \
@@ -699,7 +699,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/abductor/alien_omnitool/proc/check_menu(mob/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm
index fa144811fb385..dec2945c3be02 100644
--- a/code/modules/antagonists/cult/blood_magic.dm
+++ b/code/modules/antagonists/cult/blood_magic.dm
@@ -77,7 +77,7 @@
return
qdel(nullify_spell)
BS = possible_spells[entered_spell_name]
- if(QDELETED(src) || owner.incapacitated() || !BS || (rune && !(locate(/obj/effect/rune/empower) in range(1, owner))) || (length(spells) >= limit))
+ if(QDELETED(src) || owner.incapacitated || !BS || (rune && !(locate(/obj/effect/rune/empower) in range(1, owner))) || (length(spells) >= limit))
return
to_chat(owner,span_warning("You begin to carve unnatural symbols into your flesh!"))
SEND_SOUND(owner, sound('sound/weapons/slice.ogg',0,1,10))
@@ -130,7 +130,7 @@
..()
/datum/action/innate/cult/blood_spell/IsAvailable(feedback = FALSE)
- if(!IS_CULTIST(owner) || owner.incapacitated() || (!charges && deletes_on_empty))
+ if(!IS_CULTIST(owner) || owner.incapacitated || (!charges && deletes_on_empty))
return FALSE
return ..()
@@ -478,7 +478,7 @@
to_chat(user, span_warning("You must pick a valid rune!"))
return
var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to?
- if(QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated() || !actual_selected_rune || !proximity)
+ if(QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated || !actual_selected_rune || !proximity)
return
var/turf/dest = get_turf(actual_selected_rune)
if(dest.is_blocked_turf(TRUE))
@@ -649,7 +649,7 @@
/obj/item/melee/blood_magic/construction/proc/check_menu(mob/user)
if(!istype(user))
CRASH("The cult construct selection radial menu was accessed by something other than a valid user.")
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
@@ -918,7 +918,7 @@
/obj/item/melee/blood_magic/manipulator/proc/check_menu(mob/living/user)
if(!istype(user))
CRASH("The Blood Rites manipulator radial menu was accessed by something other than a valid user.")
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm
index 1d2e0dc08e4cf..17a5f3f6c4e9f 100644
--- a/code/modules/antagonists/cult/cult_comms.dm
+++ b/code/modules/antagonists/cult/cult_comms.dm
@@ -120,7 +120,7 @@
if(!team_member.current)
continue
team_member.current.update_mob_action_buttons()
- if(team_member.current.incapacitated())
+ if(team_member.current.incapacitated)
continue
SEND_SOUND(team_member.current, 'sound/hallucinations/im_here1.ogg')
to_chat(team_member.current, span_cult_large("Acolyte [nominee] has asserted that [nominee.p_theyre()] worthy of leading the cult. A vote will be called shortly."))
@@ -135,7 +135,7 @@
if(!team_member.current)
continue
team_member.current.update_mob_action_buttons()
- if(team_member.current.incapacitated())
+ if(team_member.current.incapacitated)
continue
to_chat(team_member.current,span_cult_large("[nominee] has died in the process of attempting to start a vote!"))
return FALSE
@@ -167,7 +167,7 @@
if(!team_member.current)
continue
team_member.current.update_mob_action_buttons()
- if(team_member.current.incapacitated())
+ if(team_member.current.incapacitated)
continue
to_chat(team_member.current,span_cult_large("[nominee] has died in the process of attempting to win the cult's support!"))
return FALSE
@@ -177,7 +177,7 @@
if(!team_member.current)
continue
team_member.current.update_mob_action_buttons()
- if(team_member.current.incapacitated())
+ if(team_member.current.incapacitated)
continue
to_chat(team_member.current,span_cult_large("[nominee] has gone catatonic in the process of attempting to win the cult's support!"))
return FALSE
@@ -187,7 +187,7 @@
if(!team_member.current)
continue
team_member.current.update_mob_action_buttons()
- if(team_member.current.incapacitated())
+ if(team_member.current.incapacitated)
continue
to_chat(team_member.current, span_cult_large("[nominee] could not win the cult's support and shall continue to serve as an acolyte."))
return FALSE
diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm
index ca4161c752b9a..ffbc07bb49b7a 100644
--- a/code/modules/antagonists/cult/cult_items.dm
+++ b/code/modules/antagonists/cult/cult_items.dm
@@ -658,7 +658,7 @@ Striking a noncultist, however, will tear their flesh."}
if(M.current && M.current.stat != DEAD)
cultists |= M.current
var/mob/living/cultist_to_receive = tgui_input_list(user, "Who do you wish to call to [src]?", "Followers of the Geometer", (cultists - user))
- if(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated())
+ if(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated)
return
if(isnull(cultist_to_receive))
to_chat(user, "You require a destination!")
diff --git a/code/modules/antagonists/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm
index 932c3ac03c1f6..b6c65a376ac5a 100644
--- a/code/modules/antagonists/cult/cult_structures.dm
+++ b/code/modules/antagonists/cult/cult_structures.dm
@@ -150,7 +150,7 @@
* Returns TRUE if the user is a living mob that is a cultist and is not incapacitated.
*/
/obj/structure/destructible/cult/item_dispenser/proc/check_menu(mob/user)
- return isliving(user) && IS_CULTIST(user) && !user.incapacitated()
+ return isliving(user) && IS_CULTIST(user) && !user.incapacitated
// Spooky looking door used in gateways. Or something.
/obj/effect/gateway
diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm
index cc4a80d980fe3..d163fab00e617 100644
--- a/code/modules/antagonists/cult/runes.dm
+++ b/code/modules/antagonists/cult/runes.dm
@@ -491,7 +491,7 @@ structure_check() searches for nearby cultist structures required for the invoca
fail_invoke()
return
var/obj/effect/rune/teleport/actual_selected_rune = potential_runes[input_rune_key] //what rune does that key correspond to?
- if(!Adjacent(user) || QDELETED(src) || user.incapacitated() || !actual_selected_rune)
+ if(!Adjacent(user) || QDELETED(src) || user.incapacitated || !actual_selected_rune)
fail_invoke()
return
@@ -758,7 +758,7 @@ GLOBAL_VAR_INIT(narsie_summon_count, 0)
/obj/effect/rune/raise_dead/proc/validness_checks(mob/living/target_mob, mob/living/user)
if(QDELETED(user))
return FALSE
- if(!Adjacent(user) || user.incapacitated())
+ if(!Adjacent(user) || user.incapacitated)
return FALSE
if(QDELETED(target_mob))
return FALSE
@@ -823,7 +823,7 @@ GLOBAL_VAR_INIT(narsie_summon_count, 0)
return
var/mob/living/cultist_to_summon = tgui_input_list(user, "Who do you wish to call to [src]?", "Followers of the Geometer", cultists)
var/fail_logmsg = "Summon Cultist rune activated by [user] at [COORD(src)] failed - "
- if(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated())
+ if(!Adjacent(user) || !src || QDELETED(src) || user.incapacitated)
return
if(isnull(cultist_to_summon))
to_chat(user, "You require a summoning target!")
diff --git a/code/modules/antagonists/heretic/knowledge/blade_lore.dm b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
index 93983c41e0d7d..6a5624cd426b9 100644
--- a/code/modules/antagonists/heretic/knowledge/blade_lore.dm
+++ b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
@@ -139,7 +139,7 @@
if(!riposte_ready)
return
- if(source.incapacitated(IGNORE_GRAB))
+ if(source.(incapacitated & IGNORE_GRAB))
return
var/mob/living/attacker = hitby.loc
diff --git a/code/modules/antagonists/malf_ai/malf_ai_modules.dm b/code/modules/antagonists/malf_ai/malf_ai_modules.dm
index 75c3c98e3f614..bfc4ecb931090 100644
--- a/code/modules/antagonists/malf_ai/malf_ai_modules.dm
+++ b/code/modules/antagonists/malf_ai/malf_ai_modules.dm
@@ -442,7 +442,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
desc = "[desc] It has [uses] use\s remaining."
/datum/action/innate/ai/ranged/override_machine/do_ability(mob/living/caller, atom/clicked_on)
- if(caller.incapacitated())
+ if(caller.incapacitated)
unset_ranged_ability(caller)
return FALSE
if(!ismachinery(clicked_on))
@@ -530,7 +530,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
qdel(to_explode)
/datum/action/innate/ai/ranged/overload_machine/do_ability(mob/living/caller, atom/clicked_on)
- if(caller.incapacitated())
+ if(caller.incapacitated)
unset_ranged_ability(caller)
return FALSE
if(!ismachinery(clicked_on))
@@ -664,7 +664,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
C.images -= I
/mob/living/silicon/ai/proc/can_place_transformer(datum/action/innate/ai/place_transformer/action)
- if(!eyeobj || !isturf(loc) || incapacitated() || !action)
+ if(!eyeobj || !isturf(loc) || incapacitated || !action)
return
var/turf/middle = get_turf(eyeobj)
var/list/turfs = list(middle, locate(middle.x - 1, middle.y, middle.z), locate(middle.x + 1, middle.y, middle.z))
@@ -1062,7 +1062,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
var/mob/living/silicon/ai/ai_caller = caller
- if(ai_caller.incapacitated())
+ if(ai_caller.incapacitated)
unset_ranged_ability(caller)
return FALSE
@@ -1152,7 +1152,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
return FALSE
var/mob/living/silicon/ai/ai_caller = caller
- if (ai_caller.incapacitated() || !isturf(ai_caller.loc))
+ if (ai_caller.incapacitated || !isturf(ai_caller.loc))
return FALSE
var/turf/target = get_turf(clicked_on)
@@ -1180,7 +1180,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
COOLDOWN_START(src, time_til_next_tilt, roll_over_cooldown)
/datum/action/innate/ai/ranged/core_tilt/proc/do_roll_over(mob/living/silicon/ai/ai_caller, picked_dir)
- if (ai_caller.incapacitated() || !isturf(ai_caller.loc)) // prevents bugs where the ai is carded and rolls
+ if (ai_caller.incapacitated || !isturf(ai_caller.loc)) // prevents bugs where the ai is carded and rolls
return
var/turf/target = get_step(ai_caller, picked_dir) // in case we moved we pass the dir not the target turf
@@ -1194,7 +1194,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
/// Used in our radial menu, state-checking proc after the radial menu sleeps
/datum/action/innate/ai/ranged/core_tilt/proc/radial_check(mob/living/silicon/ai/caller)
- if (QDELETED(caller) || caller.incapacitated() || caller.stat == DEAD)
+ if (QDELETED(caller) || caller.incapacitated || caller.stat == DEAD)
return FALSE
if (uses <= 0)
@@ -1241,7 +1241,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
return FALSE
var/mob/living/silicon/ai/ai_caller = caller
- if(ai_caller.incapacitated())
+ if(ai_caller.incapacitated)
unset_ranged_ability(caller)
return FALSE
@@ -1297,7 +1297,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
/// Used in our radial menu, state-checking proc after the radial menu sleeps
/datum/action/innate/ai/ranged/remote_vendor_tilt/proc/radial_check(mob/living/silicon/ai/caller, obj/machinery/vending/clicked_vendor)
- if (QDELETED(caller) || caller.incapacitated() || caller.stat == DEAD)
+ if (QDELETED(caller) || caller.incapacitated || caller.stat == DEAD)
return FALSE
if (QDELETED(clicked_vendor))
diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm
index e34907d64ae46..ec6207d3d12ac 100644
--- a/code/modules/antagonists/revolution/revolution.dm
+++ b/code/modules/antagonists/revolution/revolution.dm
@@ -433,7 +433,7 @@
var/list/datum/mind/promotable = list()
var/list/datum/mind/monkey_promotable = list()
for(var/datum/mind/khrushchev in non_heads)
- if(khrushchev.current && !khrushchev.current.incapacitated() && !HAS_TRAIT(khrushchev.current, TRAIT_RESTRAINED) && khrushchev.current.client)
+ if(khrushchev.current && !khrushchev.current.incapacitated && !HAS_TRAIT(khrushchev.current, TRAIT_RESTRAINED) && khrushchev.current.client)
if((ROLE_REV_HEAD in khrushchev.current.client.prefs.be_special) || (ROLE_PROVOCATEUR in khrushchev.current.client.prefs.be_special))
if(!ismonkey(khrushchev.current))
promotable += khrushchev
diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm
index b5ed82a7f2b50..3ff6e1a9cd455 100644
--- a/code/modules/antagonists/wizard/equipment/soulstone.dm
+++ b/code/modules/antagonists/wizard/equipment/soulstone.dm
@@ -365,7 +365,7 @@
/obj/item/soulstone/proc/check_menu(mob/user, obj/structure/constructshell/shell)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.is_holding(src) || !user.CanReach(shell, src))
+ if(user.incapacitated || !user.is_holding(src) || !user.CanReach(shell, src))
return FALSE
return TRUE
@@ -437,7 +437,7 @@
/// Called when a ghost is chosen to become a shade.
/obj/item/soulstone/proc/on_poll_concluded(mob/living/master, mob/living/victim, mob/dead/observer/ghost)
- if(isnull(victim) || master.incapacitated() || !master.is_holding(src) || !master.CanReach(victim, src))
+ if(isnull(victim) || master.incapacitated || !master.is_holding(src) || !master.CanReach(victim, src))
return FALSE
if(isnull(ghost?.client))
to_chat(master, span_danger("There were no spirits willing to become a shade."))
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index 4d35875f1d742..12972e4cadfc8 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -437,11 +437,11 @@
open_machine()
/obj/machinery/cryo_cell/MouseDrop_T(mob/target, mob/user)
- if(user.incapacitated() || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !ISADVANCEDTOOLUSER(user))
+ if(user.incapacitated || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !ISADVANCEDTOOLUSER(user))
return
if(isliving(target))
var/mob/living/L = target
- if(L.incapacitated())
+ if(L.incapacitated)
close_machine(target)
else
user.visible_message(span_notice("[user] starts shoving [target] inside [src]."), span_notice("You start shoving [target] inside [src]."))
diff --git a/code/modules/cards/cardhand.dm b/code/modules/cards/cardhand.dm
index ac14e17fea61b..8fc9b4d0dc70a 100644
--- a/code/modules/cards/cardhand.dm
+++ b/code/modules/cards/cardhand.dm
@@ -67,7 +67,7 @@
qdel(src) // cardhand is empty now so delete it
/obj/item/toy/cards/cardhand/proc/check_menu(mob/living/user)
- return isliving(user) && !user.incapacitated()
+ return isliving(user) && !user.incapacitated
/obj/item/toy/cards/cardhand/attackby(obj/item/weapon, mob/living/user, params, flip_card = FALSE)
var/obj/item/toy/singlecard/card
diff --git a/code/modules/cargo/universal_scanner.dm b/code/modules/cargo/universal_scanner.dm
index 68fe533959acb..3336900f984cb 100644
--- a/code/modules/cargo/universal_scanner.dm
+++ b/code/modules/cargo/universal_scanner.dm
@@ -257,7 +257,7 @@
/obj/item/universal_scanner/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
return TRUE
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 587e9c6628714..2c39f54343d2f 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -70,7 +70,7 @@
if(ismecha(M.loc)) // stops inventory actions in a mech
return
- if(!M.incapacitated() && loc == M && istype(over_object, /atom/movable/screen/inventory/hand))
+ if(!M.incapacitated && loc == M && istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
if(M.putItemFromInventoryInHandIfPossible(src, H.held_index))
add_fingerprint(usr)
@@ -504,7 +504,7 @@ BLIND // can't see anything
/obj/item/clothing/proc/can_use(mob/user)
if(user && ismob(user))
- if(!user.incapacitated())
+ if(!user.incapacitated)
return 1
return 0
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 236d94c39fabc..25e11141e2339 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -152,7 +152,7 @@
. = ..()
if(.)
return
- if(user.incapacitated() || !try_toggle())
+ if(user.incapacitated || !try_toggle())
return
up = !up
flags_1 ^= visor_flags
diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm
index f68523fcdaef6..16bfcf11678c2 100644
--- a/code/modules/clothing/head/jobs.dm
+++ b/code/modules/clothing/head/jobs.dm
@@ -54,7 +54,7 @@
/obj/item/clothing/head/utility/chefhat/proc/on_mouse_emote(mob/living/source, key, emote_message, type_override)
SIGNAL_HANDLER
var/mob/living/carbon/wearer = loc
- if(!wearer || wearer.incapacitated(IGNORE_RESTRAINTS))
+ if(!wearer || wearer.(incapacitated & IGNORE_RESTRAINTS))
return
if (!prob(mouse_control_probability))
return COMPONENT_CANT_EMOTE
@@ -68,7 +68,7 @@
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Didn't roll well enough or on cooldown
var/mob/living/carbon/wearer = loc
- if(!wearer || wearer.incapacitated(IGNORE_RESTRAINTS))
+ if(!wearer || wearer.(incapacitated & IGNORE_RESTRAINTS))
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Not worn or can't move
var/move_direction = get_dir(wearer, moved_to)
diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm
index 0b0a6fb4d50cb..894308e7c532a 100644
--- a/code/modules/clothing/head/soft_caps.dm
+++ b/code/modules/clothing/head/soft_caps.dm
@@ -31,7 +31,7 @@
/obj/item/clothing/head/soft/proc/flip(mob/user)
- if(!user.incapacitated())
+ if(!user.incapacitated)
flipped = !flipped
if(flipped)
icon_state = "[soft_type][soft_suffix]_flipped"
diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm
index 23fc2272229af..d8df2ac12f898 100644
--- a/code/modules/clothing/masks/_masks.dm
+++ b/code/modules/clothing/masks/_masks.dm
@@ -70,7 +70,7 @@
//Proc that moves gas/breath masks out of the way, disabling them and allowing pill/food consumption
/obj/item/clothing/mask/proc/adjustmask(mob/living/carbon/user)
- if(user?.incapacitated())
+ if(user?.incapacitated)
return
mask_adjusted = !mask_adjusted
if(!mask_adjusted)
diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm
index f5653bcacba91..4de860a997724 100644
--- a/code/modules/clothing/masks/gasmask.dm
+++ b/code/modules/clothing/masks/gasmask.dm
@@ -292,14 +292,14 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
AddElement(/datum/element/swabable, CELL_LINE_TABLE_CLOWN, CELL_VIRUS_TABLE_GENERIC, rand(2,3), 0)
/obj/item/clothing/mask/gas/clown_hat/ui_action_click(mob/user)
- if(!istype(user) || user.incapacitated())
+ if(!istype(user) || user.incapacitated)
return
var/choice = show_radial_menu(user,src, clownmask_designs, custom_check = FALSE, radius = 36, require_near = TRUE)
if(!choice)
return FALSE
- if(src && choice && !user.incapacitated() && in_range(user,src))
+ if(src && choice && !user.incapacitated && in_range(user,src))
var/list/options = GLOB.clown_mask_options
icon_state = options[choice]
user.update_worn_mask()
@@ -346,7 +346,7 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
)
/obj/item/clothing/mask/gas/mime/ui_action_click(mob/user)
- if(!istype(user) || user.incapacitated())
+ if(!istype(user) || user.incapacitated)
return
var/list/options = list()
@@ -359,7 +359,7 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
if(!choice)
return FALSE
- if(src && choice && !user.incapacitated() && in_range(user,src))
+ if(src && choice && !user.incapacitated && in_range(user,src))
icon_state = options[choice]
user.update_worn_mask()
update_item_action_buttons()
diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm
index 772d1576cdc08..964449675fd43 100644
--- a/code/modules/events/ion_storm.dm
+++ b/code/modules/events/ion_storm.dm
@@ -34,7 +34,7 @@
//AI laws
for(var/mob/living/silicon/ai/M in GLOB.alive_mob_list)
M.laws_sanity_check()
- if(M.stat != DEAD && !M.incapacitated())
+ if(M.stat != DEAD && !M.incapacitated)
if(prob(replaceLawsetChance))
var/datum/ai_laws/ion_lawset = pick_weighted_lawset()
// pick_weighted_lawset gives us a typepath,
diff --git a/code/modules/fishing/fishing_minigame.dm b/code/modules/fishing/fishing_minigame.dm
index 14c1d88390ccb..8c9f8d9538c14 100644
--- a/code/modules/fishing/fishing_minigame.dm
+++ b/code/modules/fishing/fishing_minigame.dm
@@ -414,7 +414,7 @@
///Initialize the minigame hud and register some signals to make it work.
/datum/fishing_challenge/proc/prepare_minigame_hud()
- if(!user.client || user.incapacitated())
+ if(!user.client || user.incapacitated)
return FALSE
. = TRUE
fishing_hud = new
diff --git a/code/modules/instruments/items.dm b/code/modules/instruments/items.dm
index dcc4ef8daba3d..c84bcc8e04545 100644
--- a/code/modules/instruments/items.dm
+++ b/code/modules/instruments/items.dm
@@ -27,7 +27,7 @@
if(!ismob(music_player))
return STOP_PLAYING
var/mob/user = music_player
- if(user.incapacitated() || !((loc == user) || (isturf(loc) && Adjacent(user)))) // sorry, no more TK playing.
+ if(user.incapacitated || !((loc == user) || (isturf(loc) && Adjacent(user)))) // sorry, no more TK playing.
return STOP_PLAYING
/obj/item/instrument/suicide_act(mob/living/user)
diff --git a/code/modules/jobs/job_types/mime.dm b/code/modules/jobs/job_types/mime.dm
index eba86ec2af07a..46090cdbe30ac 100644
--- a/code/modules/jobs/job_types/mime.dm
+++ b/code/modules/jobs/job_types/mime.dm
@@ -131,7 +131,7 @@
return FALSE
if(!user.is_holding(src))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(!user.mind)
return FALSE
diff --git a/code/modules/library/bibles.dm b/code/modules/library/bibles.dm
index 31630c550a1d5..e1f9b7bf3cb6b 100644
--- a/code/modules/library/bibles.dm
+++ b/code/modules/library/bibles.dm
@@ -186,7 +186,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
return FALSE
if(!istype(user) || !user.is_holding(src))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(user.mind?.holy_role != HOLY_ROLE_HIGHPRIEST)
return FALSE
diff --git a/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm
index 6ce6056b477e7..9b0d76fa1d417 100644
--- a/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm
+++ b/code/modules/mapfluff/ruins/objects_and_mobs/necropolis_gate.dm
@@ -160,7 +160,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate)
/obj/structure/necropolis_gate/legion_gate/attack_hand(mob/user, list/modifiers)
if(!open && !changing_openness)
var/safety = tgui_alert(user, "You think this might be a bad idea...", "Knock on the door?", list("Proceed", "Abort"))
- if(safety == "Abort" || !in_range(src, user) || !src || open || changing_openness || user.incapacitated())
+ if(safety == "Abort" || !in_range(src, user) || !src || open || changing_openness || user.incapacitated)
return
user.visible_message(span_warning("[user] knocks on [src]..."), span_boldannounce("You tentatively knock on [src]..."))
playsound(user.loc, 'sound/effects/shieldbash.ogg', 100, TRUE)
diff --git a/code/modules/mapfluff/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/mapfluff/ruins/spaceruin_code/hilbertshotel.dm
index a8fac3da76c4c..73a153ba53287 100644
--- a/code/modules/mapfluff/ruins/spaceruin_code/hilbertshotel.dm
+++ b/code/modules/mapfluff/ruins/spaceruin_code/hilbertshotel.dm
@@ -72,7 +72,7 @@ GLOBAL_VAR_INIT(hhMysteryRoomNumber, rand(1, 999999))
to_chat(target, span_warning("You too far away from \the [src] to enter it!"))
// If the target is incapacitated after selecting a room, they're not allowed to teleport.
- if(target.incapacitated())
+ if(target.incapacitated)
to_chat(target, span_warning("You aren't able to activate \the [src] anymore!"))
// Has the user thrown it away or otherwise disposed of it such that it's no longer in their hands or in some storage connected to them?
diff --git a/code/modules/mining/equipment/mining_tools.dm b/code/modules/mining/equipment/mining_tools.dm
index 2c8a6af786475..f8d2f5426e4c9 100644
--- a/code/modules/mining/equipment/mining_tools.dm
+++ b/code/modules/mining/equipment/mining_tools.dm
@@ -283,7 +283,7 @@
/obj/item/trench_tool/proc/check_menu(mob/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index e94b8d981ffeb..1594ed92fb19b 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -511,7 +511,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
playsound(user.loc, 'sound/items/coinflip.ogg', 50, TRUE)
var/oldloc = loc
sleep(1.5 SECONDS)
- if(loc == oldloc && user && !user.incapacitated())
+ if(loc == oldloc && user && !user.incapacitated)
user.visible_message(span_notice("[user] flips [src]. It lands on [coinflip]."), \
span_notice("You flip [src]. It lands on [coinflip]."), \
span_hear("You hear the clattering of loose change."))
@@ -593,7 +593,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
playsound(user.loc, 'sound/items/coinflip.ogg', 50, TRUE)
var/oldloc = loc
sleep(1.5 SECONDS)
- if(loc == oldloc && user && !user.incapacitated())
+ if(loc == oldloc && user && !user.incapacitated)
user.visible_message(span_notice("[user] flips [src]. It lands on [coinflip]."), \
span_notice("You flip [src]. It lands on [coinflip]."), \
span_hear("You hear the clattering of loose change."))
diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm
index 3e26246829827..9469668133b7d 100644
--- a/code/modules/mob/living/basic/basic.dm
+++ b/code/modules/mob/living/basic/basic.dm
@@ -260,7 +260,7 @@
REMOVE_TRAIT(src, TRAIT_NO_GLIDE, SPEED_TRAIT)
/mob/living/basic/relaymove(mob/living/user, direction)
- if(user.incapacitated())
+ if(user.incapacitated)
return
return relaydrive(user, direction)
diff --git a/code/modules/mob/living/basic/drone/_drone.dm b/code/modules/mob/living/basic/drone/_drone.dm
index ae72054899b11..33ad925488a17 100644
--- a/code/modules/mob/living/basic/drone/_drone.dm
+++ b/code/modules/mob/living/basic/drone/_drone.dm
@@ -222,7 +222,7 @@
holder.pixel_y = hud_icon.Height() - world.icon_size
if(stat == DEAD)
holder.icon_state = "huddead2"
- else if(incapacitated())
+ else if(incapacitated)
holder.icon_state = "hudoffline"
else
holder.icon_state = "hudstat"
diff --git a/code/modules/mob/living/basic/drone/visuals_icons.dm b/code/modules/mob/living/basic/drone/visuals_icons.dm
index ec01d7d2d7892..7e774539a8df7 100644
--- a/code/modules/mob/living/basic/drone/visuals_icons.dm
+++ b/code/modules/mob/living/basic/drone/visuals_icons.dm
@@ -108,7 +108,7 @@
/mob/living/basic/drone/proc/check_menu()
if(!istype(src))
return FALSE
- if(incapacitated())
+ if(incapacitated)
return FALSE
return TRUE
diff --git a/code/modules/mob/living/basic/guardian/guardian_creator.dm b/code/modules/mob/living/basic/guardian/guardian_creator.dm
index 441a60124a7bf..08a28041cc845 100644
--- a/code/modules/mob/living/basic/guardian/guardian_creator.dm
+++ b/code/modules/mob/living/basic/guardian/guardian_creator.dm
@@ -129,7 +129,7 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial())
/obj/item/guardian_creator/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
- if(user.incapacitated() || !user.is_holding(src) || used)
+ if(user.incapacitated || !user.is_holding(src) || used)
return FALSE
return TRUE
diff --git a/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/wrap.dm b/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/wrap.dm
index e7771f075a871..088905a5ae2f3 100644
--- a/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/wrap.dm
+++ b/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/wrap.dm
@@ -26,7 +26,7 @@
/datum/action/cooldown/mob_cooldown/wrap/IsAvailable(feedback = FALSE)
. = ..()
- if(!. || owner.incapacitated())
+ if(!. || owner.incapacitated)
return FALSE
if(DOING_INTERACTION(owner, DOAFTER_SOURCE_SPIDER))
if (feedback)
diff --git a/code/modules/mob/living/carbon/alien/adult/adult.dm b/code/modules/mob/living/carbon/alien/adult/adult.dm
index 0ef62eda37ced..f87bd1cf3da44 100644
--- a/code/modules/mob/living/carbon/alien/adult/adult.dm
+++ b/code/modules/mob/living/carbon/alien/adult/adult.dm
@@ -101,7 +101,7 @@ GLOBAL_LIST_INIT(strippable_alien_humanoid_items, create_strippable_list(list(
/mob/living/carbon/alien/adult/proc/can_consume(atom/movable/poor_soul)
if(!isliving(poor_soul) || pulling != poor_soul)
return FALSE
- if(incapacitated() || grab_state < GRAB_AGGRESSIVE || stat != CONSCIOUS)
+ if(incapacitated || grab_state < GRAB_AGGRESSIVE || stat != CONSCIOUS)
return FALSE
if(get_dir(src, poor_soul) != dir) // Gotta face em 4head
return FALSE
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index e6f614ca07ad5..c58116a40a3a1 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -397,7 +397,7 @@
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
// Shake animation
- if (incapacitated())
+ if (incapacitated)
var/direction = prob(50) ? -1 : 1
animate(src, pixel_x = pixel_x + SHAKE_ANIMATION_OFFSET * direction, time = 1, easing = QUAD_EASING | EASE_OUT, flags = ANIMATION_PARALLEL)
animate(pixel_x = pixel_x - (SHAKE_ANIMATION_OFFSET * 2 * direction), time = 1)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 0794bd99fc201..10d555cbe6401 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -914,7 +914,7 @@
return ishuman(target) && target.body_position == LYING_DOWN
/mob/living/carbon/human/proc/fireman_carry(mob/living/carbon/target)
- if(!can_be_firemanned(target) || incapacitated(IGNORE_GRAB))
+ if(!can_be_firemanned(target) || (incapacitated & IGNORE_GRAB))
to_chat(src, span_warning("You can't fireman carry [target] while [target.p_they()] [target.p_are()] standing!"))
return
@@ -941,7 +941,7 @@
return
//Second check to make sure they're still valid to be carried
- if(!can_be_firemanned(target) || incapacitated(IGNORE_GRAB) || target.buckled)
+ if(!can_be_firemanned(target) || (incapacitated & IGNORE_GRAB) || target.buckled)
visible_message(span_warning("[src] fails to fireman carry [target]!"))
return
@@ -957,7 +957,7 @@
visible_message(span_warning("[target] fails to climb onto [src]!"))
return
- if(target.incapacitated(IGNORE_GRAB) || incapacitated(IGNORE_GRAB))
+ if(target.(incapacitated & IGNORE_GRAB) || (incapacitated & IGNORE_GRAB))
target.visible_message(span_warning("[target] can't hang onto [src]!"))
return
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index aede1e69a7289..7a39827f6d374 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -382,7 +382,7 @@
/// take the most recent item out of a slot or place held item in a slot
/mob/living/carbon/human/proc/smart_equip_targeted(slot_type = ITEM_SLOT_BELT, slot_item_name = "belt")
- if(incapacitated())
+ if(incapacitated)
return
var/obj/item/thing = get_active_held_item()
var/obj/item/equipped_item = get_item_by_slot(slot_type)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index d1a784bbdf3b8..ae81a51cf4e6b 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -482,7 +482,7 @@
//same as above
/mob/living/pointed(atom/A as mob|obj|turf in view(client.view, src))
- if(incapacitated())
+ if(incapacitated)
return FALSE
return ..()
@@ -543,7 +543,7 @@
* * IGNORE_STASIS - mob in stasis (stasis bed, etc.) is not considered incapacitated
* * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
**/
-/mob/living/incapacitated(flags)
+/mob/living/(incapacitated & flags)
if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
return TRUE
@@ -1795,7 +1795,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
if(registered_z && old_level_new_clients == 0)
for(var/datum/ai_controller/controller as anything in SSai_controllers.ai_controllers_by_zlevel[registered_z])
controller.set_ai_status(AI_STATUS_OFF)
-
+
//Check the amount of clients exists on the Z level we're moving towards, excluding ourselves.
var/new_level_old_clients = SSmobs.clients_by_zlevel[new_z].len
@@ -2077,7 +2077,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
/mob/living/proc/can_look_up()
if(next_move > world.time)
return FALSE
- if(incapacitated(IGNORE_RESTRAINTS))
+ if(incapacitated & IGNORE_RESTRAINTS)
return FALSE
return TRUE
diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm
index 62c290217fd3f..4522b6ca69a52 100644
--- a/code/modules/mob/living/living_movement.dm
+++ b/code/modules/mob/living/living_movement.dm
@@ -124,7 +124,7 @@
return ..()
/mob/living/can_z_move(direction, turf/start, turf/destination, z_move_flags = ZMOVE_FLIGHT_FLAGS, mob/living/rider)
- if(z_move_flags & ZMOVE_INCAPACITATED_CHECKS && incapacitated())
+ if(z_move_flags & ZMOVE_INCAPACITATED_CHECKS && incapacitated)
if(z_move_flags & ZMOVE_FEEDBACK)
to_chat(rider || src, span_warning("[rider ? src : "You"] can't do that right now!"))
return FALSE
diff --git a/code/modules/mob/living/navigation.dm b/code/modules/mob/living/navigation.dm
index 98f1080c79192..4ec4951b30806 100644
--- a/code/modules/mob/living/navigation.dm
+++ b/code/modules/mob/living/navigation.dm
@@ -12,7 +12,7 @@
set name = "Navigate"
set category = "IC"
- if(incapacitated())
+ if(incapacitated)
return
if(length(client.navigation_images))
addtimer(CALLBACK(src, PROC_REF(cut_navigation)), world.tick_lag)
@@ -46,7 +46,7 @@
if(isnull(navigate_target))
return
- if(incapacitated())
+ if(incapacitated)
return
COOLDOWN_START(src, navigate_cooldown, 15 SECONDS)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index f759f6a0dc845..d48fbfccb8018 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -289,7 +289,7 @@
/mob/living/silicon/ai/verb/pick_icon()
set category = "AI Commands"
set name = "Set AI Core Display"
- if(incapacitated())
+ if(incapacitated)
return
icon = initial(icon)
icon_state = "ai"
@@ -307,7 +307,7 @@
view_core()
var/ai_core_icon = show_radial_menu(src, src , iconstates, radius = 42)
- if(!ai_core_icon || incapacitated())
+ if(!ai_core_icon || incapacitated)
return
display_icon_override = ai_core_icon
@@ -348,7 +348,7 @@
var/reason = tgui_input_text(src, "What is the nature of your emergency? ([CALL_SHUTTLE_REASON_LENGTH] characters required.)", "Confirm Shuttle Call")
- if(incapacitated())
+ if(incapacitated)
return
if(trim(reason))
@@ -410,7 +410,7 @@
return // stop
if(stat == DEAD)
return
- if(incapacitated())
+ if(incapacitated)
if(battery < 50)
to_chat(src, span_warning("Insufficient backup power!"))
return
@@ -478,14 +478,14 @@
if(usr != src)
return
- if(href_list["emergencyAPC"]) //This check comes before incapacitated() because the only time it would be useful is when we have no power.
+ if(href_list["emergencyAPC"]) //This check comes before incapacitated because the only time it would be useful is when we have no power.
if(!apc_override)
to_chat(src, span_notice("APC backdoor is no longer available."))
return
apc_override.ui_interact(src)
return
- if(incapacitated())
+ if(incapacitated)
return
if (href_list["switchcamera"])
@@ -635,7 +635,7 @@
ai_tracking_tool.reset_tracking()
var/cameralist[0]
- if(incapacitated())
+ if(incapacitated)
return
var/mob/living/silicon/ai/U = usr
@@ -677,7 +677,7 @@
set desc = "Change the default hologram available to AI to something else."
set category = "AI Commands"
- if(incapacitated())
+ if(incapacitated)
return
var/input
switch(tgui_input_list(usr, "Would you like to select a hologram based on a custom character, an animal, or switch to a unique avatar?", "Customize", list("Custom Character","Unique","Animal")))
@@ -827,7 +827,7 @@
set desc = "Allows you to change settings of your radio."
set category = "AI Commands"
- if(incapacitated())
+ if(incapacitated)
return
to_chat(src, "Accessing Subspace Transceiver control...")
@@ -843,7 +843,7 @@
set desc = "Modify the default radio setting for your automatic announcements."
set category = "AI Commands"
- if(incapacitated())
+ if(incapacitated)
return
set_autosay()
@@ -1037,7 +1037,7 @@
set category = "AI Commands"
set name = "Deploy to Shell"
- if(incapacitated())
+ if(incapacitated)
return
if(control_disabled)
to_chat(src, span_warning("Wireless networking module is offline."))
diff --git a/code/modules/mob/living/silicon/ai/ai_say.dm b/code/modules/mob/living/silicon/ai/ai_say.dm
index 967cbb2b984f8..41d9a8966a643 100644
--- a/code/modules/mob/living/silicon/ai/ai_say.dm
+++ b/code/modules/mob/living/silicon/ai/ai_say.dm
@@ -35,7 +35,7 @@
return ..()
/mob/living/silicon/ai/radio(message, list/message_mods = list(), list/spans, language)
- if(incapacitated())
+ if(incapacitated)
return FALSE
if(!radio_enabled) //AI cannot speak if radio is disabled (via intellicard) or depowered.
to_chat(src, span_danger("Your radio transmitter is offline!"))
@@ -73,7 +73,7 @@
set desc = "Display a list of vocal words to announce to the crew."
set category = "AI Commands"
- if(incapacitated())
+ if(incapacitated)
return
var/dat = {"
@@ -112,7 +112,7 @@
last_announcement = message
- if(incapacitated())
+ if(incapacitated)
return
if(control_disabled)
diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm
index 98a2e629776b1..32382b663398b 100644
--- a/code/modules/mob/living/silicon/ai/freelook/eye.dm
+++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm
@@ -235,7 +235,7 @@
set category = "AI Commands"
set name = "Toggle Camera Acceleration"
- if(incapacitated())
+ if(incapacitated)
return
acceleration = !acceleration
to_chat(usr, "Camera acceleration has been toggled [acceleration ? "on" : "off"].")
diff --git a/code/modules/mob/living/silicon/ai/robot_control.dm b/code/modules/mob/living/silicon/ai/robot_control.dm
index d963fc77be62f..a04d1c3af75c4 100644
--- a/code/modules/mob/living/silicon/ai/robot_control.dm
+++ b/code/modules/mob/living/silicon/ai/robot_control.dm
@@ -7,7 +7,7 @@
owner = new_owner
/datum/robot_control/proc/is_interactable(mob/user)
- if(user != owner || owner.incapacitated())
+ if(user != owner || owner.incapacitated)
return FALSE
if(owner.control_disabled)
to_chat(user, span_warning("Wireless control is disabled."))
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 1bcd703365102..2e94f3b1b7bc1 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -367,7 +367,7 @@
return ..()
/mob/living/silicon/robot/execute_mode()
- if(incapacitated())
+ if(incapacitated)
return
var/obj/item/W = get_active_held_item()
if(W)
@@ -910,7 +910,7 @@
M.visible_message(span_warning("[M] really can't seem to mount [src]..."))
return
- if(stat || incapacitated())
+ if(stat || incapacitated)
return
if(model && !model.allow_riding)
M.visible_message(span_boldwarning("Unfortunately, [M] just can't seem to hold onto [src]!"))
diff --git a/code/modules/mob/living/silicon/robot/robot_model.dm b/code/modules/mob/living/silicon/robot/robot_model.dm
index 18bb3e5114754..edceb5f3a955d 100644
--- a/code/modules/mob/living/silicon/robot/robot_model.dm
+++ b/code/modules/mob/living/silicon/robot/robot_model.dm
@@ -308,7 +308,7 @@
/obj/item/robot_model/proc/check_menu(mob/living/silicon/robot/user, obj/item/robot_model/old_model)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
if(user.model != old_model)
return FALSE
diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm
index b43a625b1e482..fb5d0c0d59196 100644
--- a/code/modules/mob/living/silicon/silicon.dm
+++ b/code/modules/mob/living/silicon/silicon.dm
@@ -406,7 +406,7 @@
diagsensor.show_to(src)
/mob/living/silicon/proc/toggle_sensors()
- if(incapacitated())
+ if(incapacitated)
return
sensors_on = !sensors_on
if (!sensors_on)
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index 6c0cd6d16ab55..bbd45e12a2733 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -42,7 +42,7 @@
var/list/targets = list()
for(var/mob/living/carbon/nearby_carbon in view(7, src)) //Let's find us a target
var/threatlevel = 0
- if(nearby_carbon.incapacitated())
+ if(nearby_carbon.incapacitated)
continue
threatlevel = nearby_carbon.assess_threat(judgement_criteria)
if(threatlevel < THREAT_ASSESS_DANGEROUS)
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 71292405faa7d..ced54319b9fdc 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -384,7 +384,7 @@
if (!istype(L))
return
- if(user.incapacitated() || (istype(L) && L.body_position == LYING_DOWN))
+ if(user.incapacitated || (istype(L) && L.body_position == LYING_DOWN))
return
if(!istype(AM) || isdead(AM) || iscameramob(AM) || istype(AM, /obj/effect/dummy/phased_mob))
@@ -720,7 +720,7 @@
// player on mulebot attempted to move
/mob/living/simple_animal/bot/mulebot/relaymove(mob/living/user, direction)
- if(user.incapacitated())
+ if(user.incapacitated)
return
if(load == user)
unload(0)
@@ -816,7 +816,7 @@
/mob/living/simple_animal/bot/mulebot/paranormal/MouseDrop_T(atom/movable/AM, mob/user)
var/mob/living/L = user
- if(user.incapacitated() || (istype(L) && L.body_position == LYING_DOWN))
+ if(user.incapacitated || (istype(L) && L.body_position == LYING_DOWN))
return
if(!istype(AM) || iscameramob(AM) || istype(AM, /obj/effect/dummy/phased_mob)) //allows ghosts!
diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm
index 1c9a67fafbe67..b4a63c2d80345 100644
--- a/code/modules/mob/living/simple_animal/hostile/hostile.dm
+++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm
@@ -320,7 +320,7 @@
/mob/living/simple_animal/hostile/proc/CheckAndAttack()
var/atom/target_from = GET_TARGETS_FROM(src)
- if(target && isturf(target_from.loc) && target.Adjacent(target_from) && !incapacitated())
+ if(target && isturf(target_from.loc) && target.Adjacent(target_from) && !incapacitated)
AttackingTarget(target)
/mob/living/simple_animal/hostile/proc/MoveToTarget(list/possible_targets)//Step 5, handle movement between us and our target
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 47d3ddcf20f60..9739ef280cb07 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -495,7 +495,7 @@
//ANIMAL RIDING
/mob/living/simple_animal/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
- if(user.incapacitated())
+ if(user.incapacitated)
return
for(var/atom/movable/A in get_turf(src))
if(A != src && A != M && A.density)
@@ -521,7 +521,7 @@
return
/mob/living/simple_animal/relaymove(mob/living/user, direction)
- if(user.incapacitated())
+ if(user.incapacitated)
return
return relaydrive(user, direction)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 664fe1364aac3..bbe898a44ca06 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -615,7 +615,7 @@
/mob/living/blind_examine_check(atom/examined_thing)
//need to be next to something and awake
- if(!Adjacent(examined_thing) || incapacitated())
+ if(!Adjacent(examined_thing) || incapacitated)
to_chat(src, span_warning("Something is there, but you can't see it!"))
return FALSE
@@ -774,7 +774,7 @@
if(ismecha(loc))
return
- if(incapacitated())
+ if(incapacitated)
return
var/obj/item/I = get_active_held_item()
diff --git a/code/modules/mod/mod_activation.dm b/code/modules/mod/mod_activation.dm
index 9e5b8ea5277ed..c669101c3ea00 100644
--- a/code/modules/mod/mod_activation.dm
+++ b/code/modules/mod/mod_activation.dm
@@ -17,7 +17,7 @@
return
var/part_reference = display_names[pick]
var/obj/item/part = locate(part_reference) in mod_parts
- if(!istype(part) || user.incapacitated())
+ if(!istype(part) || user.incapacitated)
return
if(active || activating)
balloon_alert(user, "deactivate the suit first!")
diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm
index 1dd7fceae3dd2..aa6e4356969f2 100644
--- a/code/modules/mod/mod_control.dm
+++ b/code/modules/mod/mod_control.dm
@@ -295,7 +295,7 @@
balloon_alert(wearer, "retract parts first!")
playsound(src, 'sound/machines/scanbuzz.ogg', 25, FALSE, SILENCED_SOUND_EXTRARANGE)
return
- if(!wearer.incapacitated())
+ if(!wearer.incapacitated)
var/atom/movable/screen/inventory/hand/ui_hand = over_object
if(wearer.putItemFromInventoryInHandIfPossible(src, ui_hand.held_index))
add_fingerprint(usr)
diff --git a/code/modules/mod/mod_paint.dm b/code/modules/mod/mod_paint.dm
index 240c0897b33a1..a9a9d7f187cd4 100644
--- a/code/modules/mod/mod_paint.dm
+++ b/code/modules/mod/mod_paint.dm
@@ -154,7 +154,7 @@
mod.set_mod_skin(pick)
/obj/item/mod/paint/proc/check_menu(obj/item/mod/control/mod, mob/user)
- if(user.incapacitated() || !user.is_holding(src) || !mod || mod.active || mod.activating)
+ if(user.incapacitated || !user.is_holding(src) || !mod || mod.active || mod.activating)
return FALSE
return TRUE
diff --git a/code/modules/mod/modules/_module.dm b/code/modules/mod/modules/_module.dm
index 8b3166f811b4a..95d88583f3655 100644
--- a/code/modules/mod/modules/_module.dm
+++ b/code/modules/mod/modules/_module.dm
@@ -168,7 +168,7 @@
/// Called when an activated module without a device is used
/obj/item/mod/module/proc/on_select_use(atom/target)
- if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && mod.wearer.incapacitated(IGNORE_GRAB))
+ if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && mod.wearer.(incapacitated & IGNORE_GRAB))
return FALSE
mod.wearer.face_atom(target)
if(!on_use())
diff --git a/code/modules/mod/modules/module_kinesis.dm b/code/modules/mod/modules/module_kinesis.dm
index 4f4fa44ff966c..dca4c995055a7 100644
--- a/code/modules/mod/modules/module_kinesis.dm
+++ b/code/modules/mod/modules/module_kinesis.dm
@@ -69,7 +69,7 @@
clear_grab(playsound = !deleting)
/obj/item/mod/module/anomaly_locked/kinesis/process(seconds_per_tick)
- if(!mod.wearer.client || mod.wearer.incapacitated(IGNORE_GRAB))
+ if(!mod.wearer.client || mod.wearer.(incapacitated & IGNORE_GRAB))
clear_grab()
return
if(!range_check(grabbed_atom))
diff --git a/code/modules/pai/hud.dm b/code/modules/pai/hud.dm
index b104c7b90eab4..77bcafefc82d2 100644
--- a/code/modules/pai/hud.dm
+++ b/code/modules/pai/hud.dm
@@ -5,7 +5,7 @@
var/required_software
/atom/movable/screen/pai/Click()
- if(isobserver(usr) || usr.incapacitated())
+ if(isobserver(usr) || usr.incapacitated)
return FALSE
var/mob/living/silicon/pai/user = usr
if(required_software && !user.installed_software.Find(required_software))
diff --git a/code/modules/pai/shell.dm b/code/modules/pai/shell.dm
index 2ef3cf3d8e2dd..6a8a8e709c82b 100644
--- a/code/modules/pai/shell.dm
+++ b/code/modules/pai/shell.dm
@@ -30,7 +30,7 @@
* FALSE otherwise.
*/
/mob/living/silicon/pai/proc/check_menu(atom/anchor)
- if(incapacitated())
+ if(incapacitated)
return FALSE
if(get_turf(src) != get_turf(anchor))
return FALSE
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 5aac6d93bc3a3..d4577bf1a9c5f 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -296,7 +296,7 @@
set category = "Object"
set src in usr
- if(!usr.can_read(src) || usr.is_blind() || usr.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
+ if(!usr.can_read(src) || usr.is_blind() || usr.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
return
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
@@ -341,7 +341,7 @@
return UI_UPDATE
if(!in_range(user, src) && !isobserver(user))
return UI_CLOSE
- if(user.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
+ if(user.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
return UI_UPDATE
// Even harder to read if your blind...braile? humm
// .. or if you cannot read
diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm
index ae93a1daad870..00dae660b9590 100644
--- a/code/modules/paperwork/paper_cutter.dm
+++ b/code/modules/paperwork/paper_cutter.dm
@@ -182,7 +182,7 @@
/obj/item/papercutter/MouseDrop(atom/over_object)
. = ..()
var/mob/user = usr
- if(user.incapacitated() || !Adjacent(user))
+ if(user.incapacitated || !Adjacent(user))
return
if(over_object == user)
diff --git a/code/modules/photography/camera/silicon_camera.dm b/code/modules/photography/camera/silicon_camera.dm
index 9cdbee1bc2b7a..a8bf7a3ba90e7 100644
--- a/code/modules/photography/camera/silicon_camera.dm
+++ b/code/modules/photography/camera/silicon_camera.dm
@@ -7,7 +7,7 @@
/// Checks if we can take a picture at this moment. Returns TRUE if we can, FALSE if we can't.
/obj/item/camera/siliconcam/proc/can_take_picture(mob/living/silicon/clicker)
- if(clicker.stat != CONSCIOUS || clicker.incapacitated())
+ if(clicker.stat != CONSCIOUS || clicker.incapacitated)
return FALSE
return TRUE
diff --git a/code/modules/photography/photos/photo.dm b/code/modules/photography/photos/photo.dm
index b34ff459c0075..407a13ba85806 100644
--- a/code/modules/photography/photos/photo.dm
+++ b/code/modules/photography/photos/photo.dm
@@ -104,7 +104,7 @@
var/n_name = tgui_input_text(usr, "What would you like to label the photo?", "Photo Labelling", max_length = MAX_NAME_LEN)
//loc.loc check is for making possible renaming photos in clipboards
- if(n_name && (loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && !usr.incapacitated())
+ if(n_name && (loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && !usr.incapacitated)
name = "photo[(n_name ? "- '[n_name]'" : null)]"
add_fingerprint(usr)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 2e95b12914650..11c88d2dd2068 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -497,7 +497,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
if(!ISADVANCEDTOOLUSER(user))
to_chat(user, span_warning("You don't have the dexterity to do this!"))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
@@ -746,7 +746,7 @@ GLOBAL_LIST(hub_radial_layer_list)
if(!ISADVANCEDTOOLUSER(user))
to_chat(user, span_warning("You don't have the dexterity to do this!"))
return FALSE
- if(user.incapacitated() || !user.Adjacent(src))
+ if(user.incapacitated || !user.Adjacent(src))
return FALSE
return TRUE
diff --git a/code/modules/power/pipecleaners.dm b/code/modules/power/pipecleaners.dm
index 2a41c70bdfe10..44ebfb6562553 100644
--- a/code/modules/power/pipecleaners.dm
+++ b/code/modules/power/pipecleaners.dm
@@ -233,7 +233,7 @@ By design, d1 is the smallest direction and d2 is the highest
return FALSE
if(!user.is_holding(src))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
return TRUE
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 084f74d50ec1f..e468c0615cb17 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -421,7 +421,7 @@
. = ..()
/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/buckled_mob, mob/user, check_loc = TRUE)
- if(user.incapacitated() || !istype(user))
+ if(user.incapacitated || !istype(user))
return
for(var/atom/movable/atom in get_turf(src))
if(atom.density && (atom != src && atom != buckled_mob))
diff --git a/code/modules/projectiles/guns/energy/beam_rifle.dm b/code/modules/projectiles/guns/energy/beam_rifle.dm
index 1c5b025baea80..e374276d9dd19 100644
--- a/code/modules/projectiles/guns/energy/beam_rifle.dm
+++ b/code/modules/projectiles/guns/energy/beam_rifle.dm
@@ -225,7 +225,7 @@
last_process = world.time
/obj/item/gun/energy/beam_rifle/proc/check_user(automatic_cleanup = TRUE)
- if(!istype(current_user) || !isturf(current_user.loc) || !(src in current_user.held_items) || current_user.incapacitated()) //Doesn't work if you're not holding it!
+ if(!istype(current_user) || !isturf(current_user.loc) || !(src in current_user.held_items) || current_user.incapacitated) //Doesn't work if you're not holding it!
if(automatic_cleanup)
stop_aiming()
return FALSE
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index 5037d26d144bb..1ab54b9346979 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -119,7 +119,7 @@
/obj/item/gun/energy/recharge/kinetic_accelerator/proc/check_menu(mob/living/carbon/human/user)
if(!istype(user))
return FALSE
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
return TRUE
diff --git a/code/modules/projectiles/guns/energy/laser_gatling.dm b/code/modules/projectiles/guns/energy/laser_gatling.dm
index 7b80e0c69f5cb..ad84e4f7fa01a 100644
--- a/code/modules/projectiles/guns/energy/laser_gatling.dm
+++ b/code/modules/projectiles/guns/energy/laser_gatling.dm
@@ -73,7 +73,7 @@
if(!over_object)
return
- if(!M.incapacitated())
+ if(!M.incapacitated)
if(istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm
index 3c677e43d1c07..f9f4e7ce58b4f 100644
--- a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm
@@ -241,7 +241,7 @@ Basically, we fill the time between now and 2s from now with hands based off the
//Just the removed itching mechanism - omage to it's origins.
/datum/reagent/inverse/ichiyuri/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
- if(prob(resetting_probability) && !(HAS_TRAIT(affected_mob, TRAIT_RESTRAINED) || affected_mob.incapacitated()))
+ if(prob(resetting_probability) && !(HAS_TRAIT(affected_mob, TRAIT_RESTRAINED) || affected_mob.incapacitated))
. = TRUE
if(spammer < world.time)
to_chat(affected_mob,span_warning("You can't help but itch yourself."))
diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm
index 52968cac22fe1..45952f0cd6a52 100644
--- a/code/modules/reagents/reagent_containers/spray.dm
+++ b/code/modules/reagents/reagent_containers/spray.dm
@@ -148,7 +148,7 @@
set name = "Empty Spray Bottle"
set category = "Object"
set src in usr
- if(usr.incapacitated())
+ if(usr.incapacitated)
return
if (tgui_alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", list("Yes", "No")) != "Yes")
return
diff --git a/code/modules/recycling/disposal/holder.dm b/code/modules/recycling/disposal/holder.dm
index fff78f74bef44..5a387521c0bd3 100644
--- a/code/modules/recycling/disposal/holder.dm
+++ b/code/modules/recycling/disposal/holder.dm
@@ -195,7 +195,7 @@
// called when player tries to move while in a pipe
/obj/structure/disposalholder/relaymove(mob/living/user, direction)
- if(user.incapacitated())
+ if(user.incapacitated)
return
for(var/mob/M in range(5, get_turf(src)))
M.show_message("CLONG, clong!", MSG_AUDIBLE)
diff --git a/code/modules/spells/spell_types/pointed/finger_guns.dm b/code/modules/spells/spell_types/pointed/finger_guns.dm
index 24f51a0e90862..cf80489fc916a 100644
--- a/code/modules/spells/spell_types/pointed/finger_guns.dm
+++ b/code/modules/spells/spell_types/pointed/finger_guns.dm
@@ -33,7 +33,7 @@
return FALSE
var/mob/living/carbon/human/human_invoker = invoker
- if(human_invoker.incapacitated())
+ if(human_invoker.incapacitated)
if(feedback)
to_chat(human_invoker, span_warning("You can't properly point your fingers while incapacitated."))
return FALSE
diff --git a/code/modules/spells/spell_types/shapeshift/_shapeshift.dm b/code/modules/spells/spell_types/shapeshift/_shapeshift.dm
index 59c9ffdde3b0b..b7542d4077f3c 100644
--- a/code/modules/spells/spell_types/shapeshift/_shapeshift.dm
+++ b/code/modules/spells/spell_types/shapeshift/_shapeshift.dm
@@ -141,7 +141,7 @@
if(QDELETED(caster))
return FALSE
- return !caster.incapacitated()
+ return !caster.incapacitated
/// Actually does the shapeshift, for the caster.
/datum/action/cooldown/spell/shapeshift/proc/do_shapeshift(mob/living/caster)
diff --git a/code/modules/spells/spell_types/teleport/teleport.dm b/code/modules/spells/spell_types/teleport/teleport.dm
index d486157204283..57e88b9852025 100644
--- a/code/modules/spells/spell_types/teleport/teleport.dm
+++ b/code/modules/spells/spell_types/teleport/teleport.dm
@@ -48,5 +48,5 @@
return
var/mob/living/carbon/caster = cast_on
- if(caster.incapacitated() || !caster.is_holding(target))
+ if(caster.incapacitated || !caster.is_holding(target))
return . | SPELL_CANCEL_CAST
diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm
index ca4b61228da42..af9ece6e5050b 100644
--- a/code/modules/surgery/bodyparts/robot_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm
@@ -124,7 +124,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(owner.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(owner.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
@@ -172,7 +172,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(owner.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(owner.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm
index dc3d543f14364..a29279457a04a 100644
--- a/code/modules/tgui/states.dm
+++ b/code/modules/tgui/states.dm
@@ -67,7 +67,7 @@
else if(stat)
return UI_DISABLED
// Update UIs if incapicitated but concious.
- else if(incapacitated())
+ else if(incapacitated)
return UI_UPDATE
return UI_INTERACTIVE
diff --git a/code/modules/tgui/states/not_incapacitated.dm b/code/modules/tgui/states/not_incapacitated.dm
index f7278c86de473..ab8cd5f6246fd 100644
--- a/code/modules/tgui/states/not_incapacitated.dm
+++ b/code/modules/tgui/states/not_incapacitated.dm
@@ -29,6 +29,6 @@ GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/ui_state/not_incapacitate
/datum/ui_state/not_incapacitated_state/can_use_topic(src_object, mob/user)
if(user.stat != CONSCIOUS)
return UI_CLOSE
- if(HAS_TRAIT(src, TRAIT_UI_BLOCKED) || user.incapacitated() || (turf_check && !isturf(user.loc)))
+ if(HAS_TRAIT(src, TRAIT_UI_BLOCKED) || user.incapacitated || (turf_check && !isturf(user.loc)))
return UI_DISABLED
return UI_INTERACTIVE
diff --git a/code/modules/transport/transport_module.dm b/code/modules/transport/transport_module.dm
index a2ba6f5167b47..f667653b1ec7c 100644
--- a/code/modules/transport/transport_module.dm
+++ b/code/modules/transport/transport_module.dm
@@ -606,7 +606,7 @@
if(!isliving(user))
return FALSE
// Gotta be awake and aware
- if(user.incapacitated())
+ if(user.incapacitated)
return FALSE
// Maintain the god given right to fight an elevator
if(user.combat_mode)
@@ -698,7 +698,7 @@
* * boolean, FALSE if the menu should be closed, TRUE if the menu is clear to stay opened.
*/
/obj/structure/transport/linear/proc/check_menu(mob/user, starting_loc)
- if(user.incapacitated() || !user.Adjacent(src) || starting_loc != src.loc)
+ if(user.incapacitated || !user.Adjacent(src) || starting_loc != src.loc)
return FALSE
return TRUE
diff --git a/code/modules/vehicles/cars/car.dm b/code/modules/vehicles/cars/car.dm
index 46a9c6f7f56ca..5e3933b63fb9f 100644
--- a/code/modules/vehicles/cars/car.dm
+++ b/code/modules/vehicles/cars/car.dm
@@ -22,7 +22,7 @@
initialize_controller_action_type(/datum/action/vehicle/sealed/dump_kidnapped_mobs, VEHICLE_CONTROL_DRIVE)
/obj/vehicle/sealed/car/MouseDrop_T(atom/dropping, mob/M)
- if(M.incapacitated() || (HAS_TRAIT(M, TRAIT_HANDS_BLOCKED) && !is_driver(M)))
+ if(M.incapacitated || (HAS_TRAIT(M, TRAIT_HANDS_BLOCKED) && !is_driver(M)))
return FALSE
if((car_traits & CAN_KIDNAP) && isliving(dropping) && M != dropping)
var/mob/living/kidnapped = dropping
diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm
index 995764e0bb7d1..9df6308344ab3 100644
--- a/code/modules/vehicles/mecha/_mecha.dm
+++ b/code/modules/vehicles/mecha/_mecha.dm
@@ -578,7 +578,7 @@
/obj/vehicle/sealed/mecha/proc/process_occupants(seconds_per_tick)
for(var/mob/living/occupant as anything in occupants)
- if(!(mecha_flags & IS_ENCLOSED) && occupant?.incapacitated()) //no sides mean it's easy to just sorta fall out if you're incapacitated.
+ if(!(mecha_flags & IS_ENCLOSED) && occupant?.incapacitated) //no sides mean it's easy to just sorta fall out if you're incapacitated.
mob_exit(occupant, randomstep = TRUE) //bye bye
continue
if(cell && cell.maxcharge)
@@ -650,7 +650,7 @@
if(phasing)
balloon_alert(user, "not while [phasing]!")
return
- if(user.incapacitated())
+ if(user.incapacitated)
return
if(!get_charge())
return
diff --git a/code/modules/vehicles/mecha/mecha_mob_interaction.dm b/code/modules/vehicles/mecha/mecha_mob_interaction.dm
index 7accab008f10e..0e19c9141f1ac 100644
--- a/code/modules/vehicles/mecha/mecha_mob_interaction.dm
+++ b/code/modules/vehicles/mecha/mecha_mob_interaction.dm
@@ -20,7 +20,7 @@
moved_inside(M)
/obj/vehicle/sealed/mecha/enter_checks(mob/M)
- if(M.incapacitated())
+ if(M.incapacitated)
return FALSE
if(atom_integrity <= 0)
to_chat(M, span_warning("You cannot get in the [src], it has been destroyed!"))
diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm
index a4f3652448342..b7d2fd557be74 100644
--- a/code/modules/vehicles/scooter.dm
+++ b/code/modules/vehicles/scooter.dm
@@ -170,7 +170,7 @@
pick_up_board(skater)
/obj/vehicle/ridden/scooter/skateboard/proc/pick_up_board(mob/living/carbon/skater)
- if (skater.incapacitated() || !Adjacent(skater))
+ if (skater.incapacitated || !Adjacent(skater))
return
if(has_buckled_mobs())
to_chat(skater, span_warning("You can't lift this up when somebody's on it."))
From bd2b44634f0bfc8d42942265fc0ca50269caae7f Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Thu, 2 Nov 2023 22:55:10 -0700
Subject: [PATCH 03/10] updates all the bits the regex fucked
---
code/_onclick/hud/screen_objects.dm | 2 +-
code/_onclick/other_mobs.dm | 2 +-
code/datums/ai/basic_mobs/base_basic_controller.dm | 2 +-
code/datums/components/riding/riding_mob.dm | 4 ++--
code/datums/martial/sleeping_carp.dm | 2 +-
code/game/objects/items/rcd/RPLD.dm | 2 +-
.../objects/structures/crates_lockers/closets/cardboardbox.dm | 2 +-
code/game/turfs/closed/walls.dm | 2 +-
.../antagonists/abductor/equipment/gear/abductor_items.dm | 2 +-
code/modules/antagonists/heretic/knowledge/blade_lore.dm | 2 +-
code/modules/clothing/head/jobs.dm | 4 ++--
code/modules/mob/living/carbon/human/human.dm | 2 +-
code/modules/mod/modules/_module.dm | 2 +-
code/modules/mod/modules/module_kinesis.dm | 2 +-
code/modules/paperwork/paper.dm | 4 ++--
code/modules/surgery/bodyparts/robot_bodyparts.dm | 4 ++--
16 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index f2b6a96ff9398..841a3e36f8157 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -183,7 +183,7 @@
if(world.time <= usr.next_move)
return TRUE
- if(usr.(incapacitated & IGNORE_STASIS))
+ if(usr.incapacitated & IGNORE_STASIS)
return TRUE
if(ismecha(usr.loc)) // stops inventory actions in a mech
return TRUE
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index 47e0ce1027283..751cd98967ab6 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -113,7 +113,7 @@
if(!(interaction_flags_atom & INTERACT_ATOM_CHECK_GRAB))
ignore_flags |= IGNORE_GRAB
- if(user.(incapacitated & ignore_flags))
+ if(user.incapacitated & ignore_flags)
return FALSE
return TRUE
diff --git a/code/datums/ai/basic_mobs/base_basic_controller.dm b/code/datums/ai/basic_mobs/base_basic_controller.dm
index 5985332b29ca3..e348a3ed297cf 100644
--- a/code/datums/ai/basic_mobs/base_basic_controller.dm
+++ b/code/datums/ai/basic_mobs/base_basic_controller.dm
@@ -21,7 +21,7 @@
var/incap_flags = NONE
if (ai_traits & CAN_ACT_IN_STASIS)
incap_flags |= IGNORE_STASIS
- if(!(ai_traits & CAN_ACT_WHILE_DEAD) && (living_pawn.(incapacitated & incap_flags) || living_pawn.stat))
+ if(!(ai_traits & CAN_ACT_WHILE_DEAD) && ((living_pawn.incapacitated & incap_flags) || living_pawn.stat))
return FALSE
if(ai_traits & PAUSE_DURING_DO_AFTER && LAZYLEN(living_pawn.do_afters))
return FALSE
diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm
index 4e3e459d78877..d2698205b284d 100644
--- a/code/datums/components/riding/riding_mob.dm
+++ b/code/datums/components/riding/riding_mob.dm
@@ -56,10 +56,10 @@
if(living_parent.body_position != STANDING_UP) // if we move while on the ground, the rider falls off
. = FALSE
// for piggybacks and (redundant?) borg riding, check if the rider is stunned/restrained
- else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || rider.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
+ else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || (rider.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
. = FALSE
// for fireman carries, check if the ridden is stunned/restrained
- else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || living_parent.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
+ else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || (living_parent.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
. = FALSE
else if((ride_check_flags & JUST_FRIEND_RIDERS) && !(living_parent.faction.Find(REF(rider))))
. = FALSE
diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm
index a87baeb988712..0f17d5382fbc1 100644
--- a/code/datums/martial/sleeping_carp.dm
+++ b/code/datums/martial/sleeping_carp.dm
@@ -184,7 +184,7 @@
/datum/martial_art/the_sleeping_carp/proc/can_deflect(mob/living/carp_user)
if(!can_use(carp_user) || !carp_user.combat_mode)
return FALSE
- if(carp_user.(incapacitated & IGNORE_GRAB)) //NO STUN
+ if(carp_user.incapacitated & IGNORE_GRAB) //NO STUN
return FALSE
if(!(carp_user.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
return FALSE
diff --git a/code/game/objects/items/rcd/RPLD.dm b/code/game/objects/items/rcd/RPLD.dm
index 2383219444232..2631568b2d4a8 100644
--- a/code/game/objects/items/rcd/RPLD.dm
+++ b/code/game/objects/items/rcd/RPLD.dm
@@ -280,7 +280,7 @@
/obj/item/construction/plumbing/proc/mouse_wheeled(mob/source, atom/A, delta_x, delta_y, params)
SIGNAL_HANDLER
- if(source.(incapacitated & IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if(source.incapacitated & IGNORE_RESTRAINTS|IGNORE_STASIS)
return
if(delta_y == 0)
return
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index cbee321c485d6..3e64f885e7235 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -72,7 +72,7 @@
for(var/mob/living/alerted_mob as anything in alerted)
if(alerted_mob.stat != CONSCIOUS || alerted_mob.is_blind())
continue
- if(!alerted_mob.(incapacitated & IGNORE_RESTRAINTS))
+ if(!alerted_mob.incapacitated & IGNORE_RESTRAINTS)
alerted_mob.face_atom(src)
alerted_mob.do_alert_animation()
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index 6646e0b01d68f..0521937db7a37 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -40,7 +40,7 @@
if(!iscarbon(dropping) && !iscyborg(dropping))
return
var/mob/living/leaner = dropping
- if(leaner.(incapacitated & IGNORE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
+ if((leaner.incapacitated & IGNORE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
return
if(!leaner.density || leaner.pulledby || leaner.buckled || !(leaner.mobility_flags & MOBILITY_STAND))
return
diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
index eb1e68e84508b..18d75ef795362 100644
--- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
+++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
@@ -394,7 +394,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/melee/baton/abductor/proc/SleepAttack(mob/living/target, mob/living/user)
playsound(src, on_stun_sound, 50, TRUE, -1)
- if(target.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB))
+ if(target.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)
if(target.can_block_magic(MAGIC_RESISTANCE_MIND))
to_chat(user, span_warning("The specimen has some kind of mental protection that is interfering with the sleep inducement! It seems you've been foiled."))
target.visible_message(span_danger("[user] tried to induced sleep in [target] with [src], but is unsuccessful!"), \
diff --git a/code/modules/antagonists/heretic/knowledge/blade_lore.dm b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
index 6a5624cd426b9..2e11e31aa607e 100644
--- a/code/modules/antagonists/heretic/knowledge/blade_lore.dm
+++ b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
@@ -139,7 +139,7 @@
if(!riposte_ready)
return
- if(source.(incapacitated & IGNORE_GRAB))
+ if(source.incapacitated & IGNORE_GRAB)
return
var/mob/living/attacker = hitby.loc
diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm
index 16bfcf11678c2..5640f6838f0f0 100644
--- a/code/modules/clothing/head/jobs.dm
+++ b/code/modules/clothing/head/jobs.dm
@@ -54,7 +54,7 @@
/obj/item/clothing/head/utility/chefhat/proc/on_mouse_emote(mob/living/source, key, emote_message, type_override)
SIGNAL_HANDLER
var/mob/living/carbon/wearer = loc
- if(!wearer || wearer.(incapacitated & IGNORE_RESTRAINTS))
+ if(!wearer || wearer.incapacitated & IGNORE_RESTRAINTS)
return
if (!prob(mouse_control_probability))
return COMPONENT_CANT_EMOTE
@@ -68,7 +68,7 @@
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Didn't roll well enough or on cooldown
var/mob/living/carbon/wearer = loc
- if(!wearer || wearer.(incapacitated & IGNORE_RESTRAINTS))
+ if(!wearer || wearer.incapacitated & IGNORE_RESTRAINTS)
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Not worn or can't move
var/move_direction = get_dir(wearer, moved_to)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 10d555cbe6401..d5b087aade47a 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -957,7 +957,7 @@
visible_message(span_warning("[target] fails to climb onto [src]!"))
return
- if(target.(incapacitated & IGNORE_GRAB) || (incapacitated & IGNORE_GRAB))
+ if((target.incapacitated & IGNORE_GRAB) || (incapacitated & IGNORE_GRAB))
target.visible_message(span_warning("[target] can't hang onto [src]!"))
return
diff --git a/code/modules/mod/modules/_module.dm b/code/modules/mod/modules/_module.dm
index 95d88583f3655..82be062843150 100644
--- a/code/modules/mod/modules/_module.dm
+++ b/code/modules/mod/modules/_module.dm
@@ -168,7 +168,7 @@
/// Called when an activated module without a device is used
/obj/item/mod/module/proc/on_select_use(atom/target)
- if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && mod.wearer.(incapacitated & IGNORE_GRAB))
+ if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && (mod.wearer.incapacitated & IGNORE_GRAB))
return FALSE
mod.wearer.face_atom(target)
if(!on_use())
diff --git a/code/modules/mod/modules/module_kinesis.dm b/code/modules/mod/modules/module_kinesis.dm
index dca4c995055a7..f5e490cc03a93 100644
--- a/code/modules/mod/modules/module_kinesis.dm
+++ b/code/modules/mod/modules/module_kinesis.dm
@@ -69,7 +69,7 @@
clear_grab(playsound = !deleting)
/obj/item/mod/module/anomaly_locked/kinesis/process(seconds_per_tick)
- if(!mod.wearer.client || mod.wearer.(incapacitated & IGNORE_GRAB))
+ if(!mod.wearer.client || (mod.wearer.incapacitated & IGNORE_GRAB))
clear_grab()
return
if(!range_check(grabbed_atom))
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index d4577bf1a9c5f..728e068f4a37d 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -296,7 +296,7 @@
set category = "Object"
set src in usr
- if(!usr.can_read(src) || usr.is_blind() || usr.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
+ if(!usr.can_read(src) || usr.is_blind() || (usr.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
return
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
@@ -341,7 +341,7 @@
return UI_UPDATE
if(!in_range(user, src) && !isobserver(user))
return UI_CLOSE
- if(user.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
+ if((user.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
return UI_UPDATE
// Even harder to read if your blind...braile? humm
// .. or if you cannot read
diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm
index af9ece6e5050b..e770870f41dfc 100644
--- a/code/modules/surgery/bodyparts/robot_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm
@@ -124,7 +124,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(owner.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(owner.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
@@ -172,7 +172,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(owner.(incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(owner.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
From 8886e91e480bf8dd7bb68181103c0a73890c8406 Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Thu, 2 Nov 2023 22:58:36 -0700
Subject: [PATCH 04/10] doc comment
---
code/modules/mob/living/living.dm | 26 --------------------------
code/modules/mob/mob_defines.dm | 15 +++++++++++++--
2 files changed, 13 insertions(+), 28 deletions(-)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index ae81a51cf4e6b..5a39a46a9d117 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -529,32 +529,6 @@
incap_status |= ~IGNORE_STASIS
return incap_status
-/**
- * Checks if a mob is incapacitated
- *
- * Normally being restrained, agressively grabbed, or in stasis counts as incapacitated
- * unless there is a flag being used to check if it's ignored
- *
- * args:
- * * flags (optional) bitflags that determine if special situations are exempt from being considered incapacitated
- *
- * bitflags: (see code/__DEFINES/status_effects.dm)
- * * IGNORE_RESTRAINTS - mob in a restraint (handcuffs) is not considered incapacitated
- * * IGNORE_STASIS - mob in stasis (stasis bed, etc.) is not considered incapacitated
- * * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
-**/
-/mob/living/(incapacitated & flags)
- if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
- return TRUE
-
- if(!(flags & IGNORE_RESTRAINTS) && HAS_TRAIT(src, TRAIT_RESTRAINED))
- return TRUE
- if(!(flags & IGNORE_GRAB) && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)
- return TRUE
- if(!(flags & IGNORE_STASIS) && HAS_TRAIT(src, TRAIT_STASIS))
- return TRUE
- return FALSE
-
/mob/living/canUseStorage()
if (usable_hands <= 0)
return FALSE
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 18b31a481fda7..ba798d6bcf94e 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -66,8 +66,19 @@
/// Whether a mob is alive or dead. TODO: Move this to living - Nodrak (2019, still here)
var/stat = CONSCIOUS
- /// Whether and how a mob is incapacitated. Bitfield of incapacitated flags from [code/__DEFINES/status_effects.dm]
- var/incapacitated = NONE
+ /**
+ * Whether and how a mob is incapacitated
+ *
+ * Normally being restrained, agressively grabbed, or in stasis counts as incapacitated
+ * unless there is a flag being used to check if it's ignored
+ *
+ * * bitflags: (see code/__DEFINES/status_effects.dm)
+ * * IGNORE_RESTRAINTS - mob in a restraint (handcuffs) is not considered incapacitated
+ * * IGNORE_STASIS - mob in stasis (stasis bed, etc.) is not considered incapacitated
+ * * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
+ *
+ **/
+ VAR_FINAL/incapacitated = NONE
/* A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.
From 2fb26b4a648fd142f3594f63d1f466b220cb65e5 Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Thu, 2 Nov 2023 23:08:57 -0700
Subject: [PATCH 05/10] Implements event based able_to_run(), which should save
a good portion off ai work
We've reached the point where we have a TON of basic mobs. we need to
start microing the plumbing that they flow through so we can continue
using them at scale
---
.../dcs/signals/signals_mob/signals_mob_ai.dm | 2 ++
.../signals/signals_mob/signals_mob_main.dm | 3 ++
code/datums/ai/_ai_controller.dm | 36 +++++++++++++++----
code/datums/ai/bane/bane_controller.dm | 11 +++++-
.../ai/basic_mobs/base_basic_controller.dm | 25 ++++++++-----
code/datums/ai/monkey/monkey_controller.dm | 13 +++++--
code/datums/ai/movement/_ai_movement.dm | 2 +-
code/datums/ai/oldhostile/hostile_tameable.dm | 11 +++++-
code/datums/brain_damage/severe.dm | 2 +-
code/datums/martial/cqc.dm | 2 +-
code/game/machinery/syndicatebomb.dm | 2 +-
.../crates_lockers/closets/cardboardbox.dm | 2 +-
code/modules/antagonists/cult/cult_comms.dm | 6 ++--
code/modules/antagonists/spy/spy_bounty.dm | 2 +-
code/modules/mob/living/basic/bots/_bots.dm | 5 +++
code/modules/mob/living/basic/bots/bot_ai.dm | 10 +++++-
code/modules/mob/living/living.dm | 4 +--
code/modules/power/apc/apc_tool_act.dm | 2 +-
code/modules/power/smes.dm | 2 +-
.../machinery/portable_chem_mixer.dm | 2 +-
20 files changed, 110 insertions(+), 34 deletions(-)
diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_ai.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_ai.dm
index 6cca71839a927..0ed9b9ac93909 100644
--- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_ai.dm
+++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_ai.dm
@@ -6,3 +6,5 @@
///Signal sent when a bot is reset
#define COMSIG_BOT_RESET "bot_reset"
+///Sent off /mob/living/basic/bot/proc/set_mode_flags() : (new_flags)
+#define COMSIG_BOT_MODE_FLAGS_SET "bot_mode_flags_set"
diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
index 068aadf6a5e1f..301c2da6c7953 100644
--- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
+++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
@@ -246,3 +246,6 @@
/// from /mob/proc/key_down(): (key, client/client, full_key)
#define COMSIG_MOB_KEYDOWN "mob_key_down"
+
+/// from /mob/update_incapacitated(): (old_incap, new_incap)
+#define COMSIG_MOB_INCAPACITATE_CHANGED "mob_incapacitated"
diff --git a/code/datums/ai/_ai_controller.dm b/code/datums/ai/_ai_controller.dm
index 0a7fc959e4416..8a8919718daaf 100644
--- a/code/datums/ai/_ai_controller.dm
+++ b/code/datums/ai/_ai_controller.dm
@@ -61,6 +61,12 @@ multiple modular subtrees with behaviors
///What distance should we be checking for interesting things when considering idling/deidling? Defaults to AI_DEFAULT_INTERESTING_DIST
var/interesting_dist = AI_DEFAULT_INTERESTING_DIST
+ /// TRUE if we're able to run, FALSE if we aren't
+ /// Should not be set manually, override get_able_to_run() instead
+ /// Make sure you hook update_able_to_run() in setup_able_to_run() to whatever parameters changing that you added
+ /// Otherwise we will not pay attention to them changing
+ var/able_to_run = FALSE
+
/datum/ai_controller/New(atom/new_pawn)
change_ai_movement_type(ai_movement)
init_subtrees()
@@ -106,6 +112,7 @@ multiple modular subtrees with behaviors
///Proc to move from one pawn to another, this will destroy the target's existing controller.
/datum/ai_controller/proc/PossessPawn(atom/new_pawn)
+ SHOULD_CALL_PARENT(TRUE)
if(pawn) //Reset any old signals
UnpossessPawn(FALSE)
@@ -130,6 +137,8 @@ multiple modular subtrees with behaviors
RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_changed))
RegisterSignal(pawn, COMSIG_MOB_LOGIN, PROC_REF(on_sentience_gained))
RegisterSignal(pawn, COMSIG_QDELETING, PROC_REF(on_pawn_qdeleted))
+ update_able_to_run()
+ setup_able_to_run()
/// Sets the AI on or off based on current conditions, call to reset after you've manually disabled it somewhere
/datum/ai_controller/proc/reset_ai_status()
@@ -152,7 +161,7 @@ multiple modular subtrees with behaviors
if(ai_traits & CAN_ACT_WHILE_DEAD)
return AI_STATUS_ON
return AI_STATUS_OFF
-
+
var/turf/pawn_turf = get_turf(mob_pawn)
#ifdef TESTING
if(!pawn_turf)
@@ -189,11 +198,13 @@ multiple modular subtrees with behaviors
///Proc for deinitializing the pawn to the old controller
/datum/ai_controller/proc/UnpossessPawn(destroy)
+ SHOULD_CALL_PARENT(TRUE)
if(isnull(pawn))
return // instantiated without an applicable pawn, fine
set_ai_status(AI_STATUS_OFF)
UnregisterSignal(pawn, list(COMSIG_MOVABLE_Z_CHANGED, COMSIG_MOB_LOGIN, COMSIG_MOB_LOGOUT, COMSIG_MOB_STATCHANGE, COMSIG_QDELETING))
+ clear_able_to_run()
if(ai_movement.moving_controllers[src])
ai_movement.stop_moving_towards(src)
var/turf/pawn_turf = get_turf(pawn)
@@ -206,19 +217,28 @@ multiple modular subtrees with behaviors
if(destroy)
qdel(src)
-///Returns TRUE if the ai controller can actually run at the moment.
-/datum/ai_controller/proc/able_to_run()
+/datum/ai_controller/proc/setup_able_to_run()
+ // paused_until is handled by PauseAi() manually
+ RegisterSignals(pawn, list(SIGNAL_ADDTRAIT(TRAIT_AI_PAUSED), SIGNAL_REMOVETRAIT(TRAIT_AI_PAUSED)), PROC_REF(update_able_to_run))
+
+/datum/ai_controller/proc/clear_able_to_run()
+ UnregisterSignal(pawn, list(SIGNAL_ADDTRAIT(TRAIT_AI_PAUSED), SIGNAL_REMOVETRAIT(TRAIT_AI_PAUSED)))
+
+/datum/ai_controller/proc/update_able_to_run()
+ SIGNAL_HANDLER
+ able_to_run = get_able_to_run()
+
+///Returns TRUE if the ai controller can actually run at the moment, FALSE otherwise
+/datum/ai_controller/proc/get_able_to_run()
if(HAS_TRAIT(pawn, TRAIT_AI_PAUSED))
return FALSE
if(world.time < paused_until)
return FALSE
return TRUE
-
///Runs any actions that are currently running
/datum/ai_controller/process(seconds_per_tick)
-
- if(!able_to_run())
+ if(!able_to_run)
SSmove_manager.stop_looping(pawn) //stop moving
return //this should remove them from processing in the future through event-based stuff.
@@ -311,7 +331,7 @@ multiple modular subtrees with behaviors
/datum/ai_controller/proc/set_ai_status(new_ai_status)
if(ai_status == new_ai_status)
return FALSE //no change
-
+
//remove old status, if we've got one
if(ai_status)
SSai_controllers.ai_controllers_by_status[ai_status] -= src
@@ -329,6 +349,8 @@ multiple modular subtrees with behaviors
/datum/ai_controller/proc/PauseAi(time)
paused_until = world.time + time
+ update_able_to_run()
+ addtimer(CALLBACK(src, PROC_REF(update_able_to_run)), time)
///Call this to add a behavior to the stack.
/datum/ai_controller/proc/queue_behavior(behavior_type, ...)
diff --git a/code/datums/ai/bane/bane_controller.dm b/code/datums/ai/bane/bane_controller.dm
index 8d6820a800bdc..3eec392fbecf7 100644
--- a/code/datums/ai/bane/bane_controller.dm
+++ b/code/datums/ai/bane/bane_controller.dm
@@ -12,7 +12,16 @@ And the only victory you achieved was a lie. Now you understand Gotham is beyond
return AI_CONTROLLER_INCOMPATIBLE
return ..() //Run parent at end
-/datum/ai_controller/bane/able_to_run()
+/datum/ai_controller/bane/setup_able_to_run()
+ . = ..()
+ RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
+ RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
+
+/datum/ai_controller/bane/clear_able_to_run()
+ UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
+ return ..()
+
+/datum/ai_controller/bane/get_able_to_run()
var/mob/living/living_pawn = pawn
if(IS_DEAD_OR_INCAP(living_pawn))
return FALSE
diff --git a/code/datums/ai/basic_mobs/base_basic_controller.dm b/code/datums/ai/basic_mobs/base_basic_controller.dm
index e348a3ed297cf..eabcaf3f23c4e 100644
--- a/code/datums/ai/basic_mobs/base_basic_controller.dm
+++ b/code/datums/ai/basic_mobs/base_basic_controller.dm
@@ -12,17 +12,26 @@
return ..() //Run parent at end
+/datum/ai_controller/basic_controller/setup_able_to_run()
+ . = ..()
+ RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
+ RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
+
+/datum/ai_controller/basic_controller/clear_able_to_run()
+ UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
+ return ..()
-/datum/ai_controller/basic_controller/able_to_run()
+/datum/ai_controller/basic_controller/get_able_to_run()
. = ..()
- if(!isliving(pawn))
- return
- var/mob/living/living_pawn = pawn
- var/incap_flags = NONE
- if (ai_traits & CAN_ACT_IN_STASIS)
- incap_flags |= IGNORE_STASIS
- if(!(ai_traits & CAN_ACT_WHILE_DEAD) && ((living_pawn.incapacitated & incap_flags) || living_pawn.stat))
+ if(!.)
return FALSE
+ var/mob/living/living_pawn = pawn
+ if(!(ai_traits & CAN_ACT_WHILE_DEAD))
+ // Unroll for flags here
+ if (ai_traits & CAN_ACT_IN_STASIS && (living_pawn.stat || living_pawn.incapacitated & IGNORE_STASIS))
+ return FALSE
+ else if(IS_DEAD_OR_INCAP(living_pawn))
+ return FALSE
if(ai_traits & PAUSE_DURING_DO_AFTER && LAZYLEN(living_pawn.do_afters))
return FALSE
diff --git a/code/datums/ai/monkey/monkey_controller.dm b/code/datums/ai/monkey/monkey_controller.dm
index 215f0a96302f3..7f0c585443cb4 100644
--- a/code/datums/ai/monkey/monkey_controller.dm
+++ b/code/datums/ai/monkey/monkey_controller.dm
@@ -103,10 +103,19 @@ have ways of interacting with a specific mob and control it.
. = ..()
set_trip_mode(mode = TRUE)
-/datum/ai_controller/monkey/able_to_run()
+/datum/ai_controller/monkey/setup_able_to_run()
+ . = ..()
+ RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
+ RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
+
+/datum/ai_controller/monkey/clear_able_to_run()
+ UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
+ return ..()
+
+/datum/ai_controller/monkey/get_able_to_run()
var/mob/living/living_pawn = pawn
- if(living_pawn.incapacitated(IGNORE_RESTRAINTS | IGNORE_GRAB | IGNORE_STASIS) || living_pawn.stat > CONSCIOUS)
+ if(living_pawn & (IGNORE_RESTRAINTS | IGNORE_GRAB | IGNORE_STASIS) || living_pawn.stat > CONSCIOUS)
return FALSE
return ..()
diff --git a/code/datums/ai/movement/_ai_movement.dm b/code/datums/ai/movement/_ai_movement.dm
index 3f455b2acd0ab..b86bda050ee04 100644
--- a/code/datums/ai/movement/_ai_movement.dm
+++ b/code/datums/ai/movement/_ai_movement.dm
@@ -56,7 +56,7 @@
var/datum/ai_controller/controller = source.extra_info
// Check if this controller can actually run, so we don't chase people with corpses
- if(!controller.able_to_run())
+ if(!controller.able_to_run)
controller.CancelActions()
qdel(source) //stop moving
return MOVELOOP_SKIP_STEP
diff --git a/code/datums/ai/oldhostile/hostile_tameable.dm b/code/datums/ai/oldhostile/hostile_tameable.dm
index 254a165e18b7f..27aa7f758d92a 100644
--- a/code/datums/ai/oldhostile/hostile_tameable.dm
+++ b/code/datums/ai/oldhostile/hostile_tameable.dm
@@ -50,7 +50,16 @@
if(buckler != blackboard[BB_HOSTILE_FRIEND])
return COMPONENT_BLOCK_BUCKLE
-/datum/ai_controller/hostile_friend/able_to_run()
+/datum/ai_controller/hostile_friend/setup_able_to_run()
+ . = ..()
+ RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
+ RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
+
+/datum/ai_controller/hostile_friend/clear_able_to_run()
+ UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
+ return ..()
+
+/datum/ai_controller/hostile_friend/get_able_to_run()
var/mob/living/living_pawn = pawn
if(IS_DEAD_OR_INCAP(living_pawn))
diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm
index f22b0ab44b331..1da6bfeb79e58 100644
--- a/code/datums/brain_damage/severe.dm
+++ b/code/datums/brain_damage/severe.dm
@@ -407,7 +407,7 @@
var/obj/item/bodypart/bodypart = owner.get_bodypart(owner.get_random_valid_zone(even_weights = TRUE))
if(!(bodypart && IS_ORGANIC_LIMB(bodypart)) && bodypart.bodypart_flags & BODYPART_PSEUDOPART)
return
- if(owner.incapacitated())
+ if(owner.incapacitated)
return
bodypart.receive_damage(scratch_damage)
if(SPT_PROB(33, seconds_per_tick))
diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm
index 8e33ac5a851ea..00c922f660411 100644
--- a/code/datums/martial/cqc.dm
+++ b/code/datums/martial/cqc.dm
@@ -46,7 +46,7 @@
/datum/martial_art/cqc/proc/check_block(mob/living/cqc_user, atom/movable/hitby, damage, attack_text, attack_type, ...)
SIGNAL_HANDLER
- if(!can_use(cqc_user) || !cqc_user.throw_mode || cqc_user.incapacitated(IGNORE_GRAB))
+ if(!can_use(cqc_user) || !cqc_user.throw_mode || cqc_user.incapacitated & IGNORE_GRAB)
return NONE
if(attack_type == PROJECTILE_ATTACK)
return NONE
diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm
index 693668e9e8900..0ab5640e626dc 100644
--- a/code/game/machinery/syndicatebomb.dm
+++ b/code/game/machinery/syndicatebomb.dm
@@ -622,7 +622,7 @@
balloon_alert(user, "set to [chosen_theme?.name || DIMENSION_CHOICE_RANDOM]")
/obj/item/bombcore/dimensional/proc/check_menu(mob/user)
- if(!user.is_holding(src) || user.incapacitated())
+ if(!user.is_holding(src) || user.incapacitated)
return FALSE
return TRUE
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index 3e64f885e7235..8aedf2331b4e1 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -72,7 +72,7 @@
for(var/mob/living/alerted_mob as anything in alerted)
if(alerted_mob.stat != CONSCIOUS || alerted_mob.is_blind())
continue
- if(!alerted_mob.incapacitated & IGNORE_RESTRAINTS)
+ if(!(alerted_mob.incapacitated & IGNORE_RESTRAINTS))
alerted_mob.face_atom(src)
alerted_mob.do_alert_animation()
diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm
index 17a5f3f6c4e9f..adef8f1876131 100644
--- a/code/modules/antagonists/cult/cult_comms.dm
+++ b/code/modules/antagonists/cult/cult_comms.dm
@@ -129,7 +129,7 @@
///Polls all Cultists on whether the person putting themselves forward should be made the Cult Leader, if they can actually be such.
/proc/poll_cultists_for_leader(mob/living/nominee, datum/team/cult/team)
- if(QDELETED(nominee) || nominee.incapacitated())
+ if(QDELETED(nominee) || nominee.incapacitated)
team.cult_vote_called = FALSE
for(var/datum/mind/team_member as anything in team.members)
if(!team_member.current)
@@ -141,7 +141,7 @@
return FALSE
var/list/mob/living/asked_cultists = list()
for(var/datum/mind/team_member as anything in team.members)
- if(!team_member.current || team_member.current == nominee || team_member.current.incapacitated())
+ if(!team_member.current || team_member.current == nominee || team_member.current.incapacitated)
continue
SEND_SOUND(team_member.current, 'sound/magic/exit_blood.ogg')
asked_cultists += team_member.current
@@ -161,7 +161,7 @@
chat_text_border_icon = mutable_appearance('icons/effects/effects.dmi', "cult_master_logo")
)
)
- if(QDELETED(nominee) || nominee.incapacitated())
+ if(QDELETED(nominee) || nominee.incapacitated)
team.cult_vote_called = FALSE
for(var/datum/mind/team_member as anything in team.members)
if(!team_member.current)
diff --git a/code/modules/antagonists/spy/spy_bounty.dm b/code/modules/antagonists/spy/spy_bounty.dm
index 0a9422e07b807..136c8a6d37071 100644
--- a/code/modules/antagonists/spy/spy_bounty.dm
+++ b/code/modules/antagonists/spy/spy_bounty.dm
@@ -529,7 +529,7 @@
return TRUE
if(IS_WEAKREF_OF(stealing, target_ref))
var/mob/living/carbon/human/target = stealing
- if(!target.incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if(!(target.incapacitated & (IGNORE_RESTRAINTS|IGNORE_STASIS)))
return FALSE
if(find_desired_thing(target))
return TRUE
diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm
index 206ba88b317e7..c3cae075bb07d 100644
--- a/code/modules/mob/living/basic/bots/_bots.dm
+++ b/code/modules/mob/living/basic/bots/_bots.dm
@@ -143,6 +143,11 @@ GLOBAL_LIST_INIT(command_strings, list(
ai_controller.set_blackboard_key(BB_RADIO_CHANNEL, radio_channel)
update_appearance()
+/mob/living/basic/bot/proc/set_mode_flags(mode_flags)
+ SHOULD_CALL_PARENT(TRUE)
+ bot_mode_flags = mode_flags
+ SEND_SIGNAL(src, COMSIG_BOT_MODE_FLAGS_SET, mode_flags)
+
/mob/living/basic/bot/proc/get_mode()
if(client) //Player bots do not have modes, thus the override. Also an easy way for PDA users/AI to know when a bot is a player.
return span_bold("[paicard ? "pAI Controlled" : "Autonomous"]")
diff --git a/code/modules/mob/living/basic/bots/bot_ai.dm b/code/modules/mob/living/basic/bots/bot_ai.dm
index 36600f244e7d5..fd1b024607827 100644
--- a/code/modules/mob/living/basic/bots/bot_ai.dm
+++ b/code/modules/mob/living/basic/bots/bot_ai.dm
@@ -35,7 +35,15 @@
return
RegisterSignal(new_pawn, COMSIG_BOT_RESET, PROC_REF(reset_bot))
-/datum/ai_controller/basic_controller/bot/able_to_run()
+/datum/ai_controller/basic_controller/bot/setup_able_to_run()
+ . = ..()
+ RegisterSignal(pawn, COMSIG_BOT_MODE_FLAGS_SET, PROC_REF(update_able_to_run))
+
+/datum/ai_controller/basic_controller/bot/clear_able_to_run()
+ UnregisterSignal(pawn, list(COMSIG_BOT_MODE_FLAGS_SET))
+ return ..()
+
+/datum/ai_controller/basic_controller/bot/get_able_to_run()
var/mob/living/basic/bot/bot_pawn = pawn
if(!(bot_pawn.bot_mode_flags & BOT_MODE_ON))
return FALSE
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 5a39a46a9d117..33d1bf8e511a3 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -64,7 +64,7 @@
return .
// If you are incapped, you probably can't brace yourself
- var/can_help_themselves = !incapacitated(IGNORE_RESTRAINTS)
+ var/can_help_themselves = !(incapacitated & IGNORE_RESTRAINTS)
if(levels <= 1 && can_help_themselves)
var/obj/item/organ/external/wings/gliders = get_organ_by_type(/obj/item/organ/external/wings)
if(HAS_TRAIT(src, TRAIT_FREERUNNING) || gliders?.can_soften_fall()) // the power of parkour or wings allows falling short distances unscathed
@@ -1074,7 +1074,7 @@
/mob/living/proc/itch(obj/item/bodypart/target_part = null, damage = 0.5, can_scratch = TRUE, silent = FALSE)
if ((mob_biotypes & (MOB_ROBOTIC | MOB_SPIRIT)))
return FALSE
- var/will_scratch = can_scratch && !incapacitated()
+ var/will_scratch = can_scratch && !incapacitated
var/applied_damage = 0
if (will_scratch && damage)
applied_damage = apply_damage(damage, damagetype = BRUTE, def_zone = target_part)
diff --git a/code/modules/power/apc/apc_tool_act.dm b/code/modules/power/apc/apc_tool_act.dm
index 981e35fe7803a..94d4c1d627074 100644
--- a/code/modules/power/apc/apc_tool_act.dm
+++ b/code/modules/power/apc/apc_tool_act.dm
@@ -113,7 +113,7 @@
if(isnull(choice) \
|| !user.is_holding(installing_cable) \
|| !user.Adjacent(src) \
- || user.incapacitated() \
+ || user.incapacitated \
|| !can_place_terminal(user, installing_cable, silent = TRUE) \
)
return ITEM_INTERACT_BLOCKING
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 4938a0328ee6b..529288aeecfbf 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -121,7 +121,7 @@
if(isnull(choice) \
|| !user.is_holding(item) \
|| !user.Adjacent(src) \
- || user.incapacitated() \
+ || user.incapacitated \
|| !can_place_terminal(user, item, silent = TRUE) \
)
return
diff --git a/code/modules/reagents/chemistry/machinery/portable_chem_mixer.dm b/code/modules/reagents/chemistry/machinery/portable_chem_mixer.dm
index a6113d2f0c6e4..756b6b50a81e7 100644
--- a/code/modules/reagents/chemistry/machinery/portable_chem_mixer.dm
+++ b/code/modules/reagents/chemistry/machinery/portable_chem_mixer.dm
@@ -246,7 +246,7 @@
. = ..()
if(ismob(loc))
var/mob/M = loc
- if(!M.incapacitated() && istype(over_object, /atom/movable/screen/inventory/hand))
+ if(!M.incapacitated && istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
From 961c320282e1c1b7103fe7fdf8f6f20564df88c4 Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Fri, 3 Nov 2023 11:03:15 -0700
Subject: [PATCH 06/10] Refactors incapacitated to support multiple flags
correctly
Includes a macro to make it easier to reason about.
Also moved all my signal stuff to init_signals, rip
setup_incapacitated()
---
code/__DEFINES/status_effects.dm | 18 ++++++++-----
code/_onclick/click.dm | 2 +-
code/_onclick/hud/screen_objects.dm | 2 +-
code/_onclick/other_mobs.dm | 6 ++---
code/datums/ai/bane/bane_controller.dm | 5 +++-
.../ai/basic_mobs/base_basic_controller.dm | 7 +++--
code/datums/ai/monkey/monkey_controller.dm | 7 +++--
code/datums/ai/oldhostile/hostile_tameable.dm | 5 +++-
code/datums/components/riding/riding_mob.dm | 4 +--
code/datums/martial/cqc.dm | 2 +-
code/datums/martial/sleeping_carp.dm | 2 +-
code/game/objects/items/rcd/RPD.dm | 2 +-
code/game/objects/items/rcd/RPLD.dm | 2 +-
.../crates_lockers/closets/cardboardbox.dm | 2 +-
code/game/turfs/closed/walls.dm | 2 +-
.../abductor/equipment/gear/abductor_items.dm | 2 +-
.../heretic/knowledge/blade_lore.dm | 2 +-
code/modules/antagonists/spy/spy_bounty.dm | 2 +-
code/modules/clothing/head/jobs.dm | 4 +--
code/modules/mob/living/carbon/human/human.dm | 6 ++---
code/modules/mob/living/init_signals.dm | 17 +++++++++++-
code/modules/mob/living/living.dm | 27 +++++++++----------
code/modules/mob/mob.dm | 7 +----
code/modules/mob/mob_defines.dm | 6 ++---
code/modules/mod/modules/_module.dm | 2 +-
code/modules/mod/modules/module_kinesis.dm | 2 +-
code/modules/paperwork/paper.dm | 4 +--
.../surgery/bodyparts/robot_bodyparts.dm | 4 +--
28 files changed, 89 insertions(+), 64 deletions(-)
diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm
index 8ada83a2109cb..dfc008d982d50 100644
--- a/code/__DEFINES/status_effects.dm
+++ b/code/__DEFINES/status_effects.dm
@@ -24,12 +24,18 @@
#define CURSE_GRASPING (1<<3)
//Incapacitated status effect flags
-/// If the incapacitated status effect will ignore a mob in restraints (handcuffs)
-#define IGNORE_RESTRAINTS (1<<0)
-/// If the incapacitated status effect will ignore a mob in stasis (stasis beds)
-#define IGNORE_STASIS (1<<1)
-/// If the incapacitated status effect will ignore a mob being agressively grabbed
-#define IGNORE_GRAB (1<<2)
+/// If the mob is normal incapacitated. Should never need this, just avoids issues if we ever overexpand this
+#define TRADITIONAL_INCAPACITATED (1<<0)
+/// If the incapacitated status effect is being caused by restraints (handcuffs)
+#define INCAPABLE_RESTRAINTS (1<<1)
+/// If the incapacitated status effect is being caused by stasis (stasis beds)
+#define INCAPABLE_STASIS (1<<2)
+/// If the incapacitated status effect is being caused by being agressively grabbed
+#define INCAPABLE_GRAB (1<<3)
+
+/// Checks to see if a mob would be incapacitated even while ignoring some types
+/// Does this by inverting the passed in flags and seeing if we're still incapacitated
+#define INCAPABLE_WITHOUT(mob, flags) (mob.incapacitated & ~(flags))
/// Maxamounts of fire stacks a mob can get
#define MAX_FIRE_STACKS 20
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index 8949f2bd19289..15e8b6b3884f2 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -102,7 +102,7 @@
CtrlClickOn(A)
return
- if((incapacitated & IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if(INCAPABLE_WITHOUT(src, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
face_atom(A)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index 841a3e36f8157..2ee39715359b6 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -183,7 +183,7 @@
if(world.time <= usr.next_move)
return TRUE
- if(usr.incapacitated & IGNORE_STASIS)
+ if(INCAPABLE_WITHOUT(usr, INCAPABLE_STASIS))
return TRUE
if(ismecha(usr.loc)) // stops inventory actions in a mech
return TRUE
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index 751cd98967ab6..c022439ac9c79 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -109,11 +109,11 @@
if(!(interaction_flags_atom & INTERACT_ATOM_IGNORE_INCAPACITATED))
var/ignore_flags = NONE
if(interaction_flags_atom & INTERACT_ATOM_IGNORE_RESTRAINED)
- ignore_flags |= IGNORE_RESTRAINTS
+ ignore_flags |= INCAPABLE_RESTRAINTS
if(!(interaction_flags_atom & INTERACT_ATOM_CHECK_GRAB))
- ignore_flags |= IGNORE_GRAB
+ ignore_flags |= INCAPABLE_GRAB
- if(user.incapacitated & ignore_flags)
+ if(INCAPABLE_WITHOUT(user, ignore_flags))
return FALSE
return TRUE
diff --git a/code/datums/ai/bane/bane_controller.dm b/code/datums/ai/bane/bane_controller.dm
index 3eec392fbecf7..64e1dcf31af3a 100644
--- a/code/datums/ai/bane/bane_controller.dm
+++ b/code/datums/ai/bane/bane_controller.dm
@@ -12,10 +12,13 @@ And the only victory you achieved was a lie. Now you understand Gotham is beyond
return AI_CONTROLLER_INCOMPATIBLE
return ..() //Run parent at end
+/datum/ai_controller/bane/on_stat_changed(mob/living/source, new_stat)
+ . = ..()
+ update_able_to_run()
+
/datum/ai_controller/bane/setup_able_to_run()
. = ..()
RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
- RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
/datum/ai_controller/bane/clear_able_to_run()
UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
diff --git a/code/datums/ai/basic_mobs/base_basic_controller.dm b/code/datums/ai/basic_mobs/base_basic_controller.dm
index eabcaf3f23c4e..ab357718749f7 100644
--- a/code/datums/ai/basic_mobs/base_basic_controller.dm
+++ b/code/datums/ai/basic_mobs/base_basic_controller.dm
@@ -12,10 +12,13 @@
return ..() //Run parent at end
+/datum/ai_controller/basic_controller/on_stat_changed(mob/living/source, new_stat)
+ . = ..()
+ update_able_to_run()
+
/datum/ai_controller/basic_controller/setup_able_to_run()
. = ..()
RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
- RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
/datum/ai_controller/basic_controller/clear_able_to_run()
UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
@@ -28,7 +31,7 @@
var/mob/living/living_pawn = pawn
if(!(ai_traits & CAN_ACT_WHILE_DEAD))
// Unroll for flags here
- if (ai_traits & CAN_ACT_IN_STASIS && (living_pawn.stat || living_pawn.incapacitated & IGNORE_STASIS))
+ if (ai_traits & CAN_ACT_IN_STASIS && (living_pawn.stat || INCAPABLE_WITHOUT(living_pawn, INCAPABLE_STASIS)))
return FALSE
else if(IS_DEAD_OR_INCAP(living_pawn))
return FALSE
diff --git a/code/datums/ai/monkey/monkey_controller.dm b/code/datums/ai/monkey/monkey_controller.dm
index 7f0c585443cb4..940cbbacc56f9 100644
--- a/code/datums/ai/monkey/monkey_controller.dm
+++ b/code/datums/ai/monkey/monkey_controller.dm
@@ -103,10 +103,13 @@ have ways of interacting with a specific mob and control it.
. = ..()
set_trip_mode(mode = TRUE)
+/datum/ai_controller/monkey/on_stat_changed(mob/living/source, new_stat)
+ . = ..()
+ update_able_to_run()
+
/datum/ai_controller/monkey/setup_able_to_run()
. = ..()
RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
- RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
/datum/ai_controller/monkey/clear_able_to_run()
UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
@@ -115,7 +118,7 @@ have ways of interacting with a specific mob and control it.
/datum/ai_controller/monkey/get_able_to_run()
var/mob/living/living_pawn = pawn
- if(living_pawn & (IGNORE_RESTRAINTS | IGNORE_GRAB | IGNORE_STASIS) || living_pawn.stat > CONSCIOUS)
+ if(INCAPABLE_WITHOUT(living_pawn, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS|INCAPABLE_GRAB) || living_pawn.stat > CONSCIOUS)
return FALSE
return ..()
diff --git a/code/datums/ai/oldhostile/hostile_tameable.dm b/code/datums/ai/oldhostile/hostile_tameable.dm
index 27aa7f758d92a..97f0231ad6118 100644
--- a/code/datums/ai/oldhostile/hostile_tameable.dm
+++ b/code/datums/ai/oldhostile/hostile_tameable.dm
@@ -50,10 +50,13 @@
if(buckler != blackboard[BB_HOSTILE_FRIEND])
return COMPONENT_BLOCK_BUCKLE
+/datum/ai_controller/hostile_friend/on_stat_changed(mob/living/source, new_stat)
+ . = ..()
+ update_able_to_run()
+
/datum/ai_controller/hostile_friend/setup_able_to_run()
. = ..()
RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
- RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(update_able_to_run))
/datum/ai_controller/hostile_friend/clear_able_to_run()
UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm
index d2698205b284d..f64d6e6d61131 100644
--- a/code/datums/components/riding/riding_mob.dm
+++ b/code/datums/components/riding/riding_mob.dm
@@ -56,10 +56,10 @@
if(living_parent.body_position != STANDING_UP) // if we move while on the ground, the rider falls off
. = FALSE
// for piggybacks and (redundant?) borg riding, check if the rider is stunned/restrained
- else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || (rider.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
+ else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || INCAPABLE_WITHOUT(rider, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)))
. = FALSE
// for fireman carries, check if the ridden is stunned/restrained
- else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || (living_parent.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)))
+ else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || INCAPABLE_WITHOUT(living_parent, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)))
. = FALSE
else if((ride_check_flags & JUST_FRIEND_RIDERS) && !(living_parent.faction.Find(REF(rider))))
. = FALSE
diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm
index 00c922f660411..25abbd3a6f7a7 100644
--- a/code/datums/martial/cqc.dm
+++ b/code/datums/martial/cqc.dm
@@ -46,7 +46,7 @@
/datum/martial_art/cqc/proc/check_block(mob/living/cqc_user, atom/movable/hitby, damage, attack_text, attack_type, ...)
SIGNAL_HANDLER
- if(!can_use(cqc_user) || !cqc_user.throw_mode || cqc_user.incapacitated & IGNORE_GRAB)
+ if(!can_use(cqc_user) || !cqc_user.throw_mode || INCAPABLE_WITHOUT(cqc_user, INCAPABLE_GRAB))
return NONE
if(attack_type == PROJECTILE_ATTACK)
return NONE
diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm
index 0f17d5382fbc1..cfc5a55da15c1 100644
--- a/code/datums/martial/sleeping_carp.dm
+++ b/code/datums/martial/sleeping_carp.dm
@@ -184,7 +184,7 @@
/datum/martial_art/the_sleeping_carp/proc/can_deflect(mob/living/carp_user)
if(!can_use(carp_user) || !carp_user.combat_mode)
return FALSE
- if(carp_user.incapacitated & IGNORE_GRAB) //NO STUN
+ if(INCAPABLE_WITHOUT(carp_user, INCAPABLE_GRAB)) //NO STUN
return FALSE
if(!(carp_user.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
return FALSE
diff --git a/code/game/objects/items/rcd/RPD.dm b/code/game/objects/items/rcd/RPD.dm
index f43d6ae8d71cf..18e281873b2ed 100644
--- a/code/game/objects/items/rcd/RPD.dm
+++ b/code/game/objects/items/rcd/RPD.dm
@@ -681,7 +681,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(multi_layer)
balloon_alert(source_mob, "turn off multi layer!")
return
- if(source_mob.incapacitated & (IGNORE_RESTRAINTS|IGNORE_STASIS))
+ if(INCAPABLE_WITHOUT(source_mob, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
if(source_mob.get_active_held_item() != src)
return
diff --git a/code/game/objects/items/rcd/RPLD.dm b/code/game/objects/items/rcd/RPLD.dm
index 2631568b2d4a8..da2d529b25616 100644
--- a/code/game/objects/items/rcd/RPLD.dm
+++ b/code/game/objects/items/rcd/RPLD.dm
@@ -280,7 +280,7 @@
/obj/item/construction/plumbing/proc/mouse_wheeled(mob/source, atom/A, delta_x, delta_y, params)
SIGNAL_HANDLER
- if(source.incapacitated & IGNORE_RESTRAINTS|IGNORE_STASIS)
+ if(INCAPABLE_WITHOUT(source, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
if(delta_y == 0)
return
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index 8aedf2331b4e1..cb2b1eec99ec7 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -72,7 +72,7 @@
for(var/mob/living/alerted_mob as anything in alerted)
if(alerted_mob.stat != CONSCIOUS || alerted_mob.is_blind())
continue
- if(!(alerted_mob.incapacitated & IGNORE_RESTRAINTS))
+ if(!INCAPABLE_WITHOUT(alerted_mob, INCAPABLE_RESTRAINTS))
alerted_mob.face_atom(src)
alerted_mob.do_alert_animation()
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index 0521937db7a37..877db6eec1708 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -40,7 +40,7 @@
if(!iscarbon(dropping) && !iscyborg(dropping))
return
var/mob/living/leaner = dropping
- if((leaner.incapacitated & IGNORE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
+ if(INCAPABLE_WITHOUT(leaner, INCAPABLE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
return
if(!leaner.density || leaner.pulledby || leaner.buckled || !(leaner.mobility_flags & MOBILITY_STAND))
return
diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
index 18d75ef795362..974442d7e2e83 100644
--- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
+++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
@@ -394,7 +394,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/melee/baton/abductor/proc/SleepAttack(mob/living/target, mob/living/user)
playsound(src, on_stun_sound, 50, TRUE, -1)
- if(target.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB)
+ if(INCAPABLE_WITHOUT(target, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB))
if(target.can_block_magic(MAGIC_RESISTANCE_MIND))
to_chat(user, span_warning("The specimen has some kind of mental protection that is interfering with the sleep inducement! It seems you've been foiled."))
target.visible_message(span_danger("[user] tried to induced sleep in [target] with [src], but is unsuccessful!"), \
diff --git a/code/modules/antagonists/heretic/knowledge/blade_lore.dm b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
index 2e11e31aa607e..d36243d1d13a7 100644
--- a/code/modules/antagonists/heretic/knowledge/blade_lore.dm
+++ b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
@@ -139,7 +139,7 @@
if(!riposte_ready)
return
- if(source.incapacitated & IGNORE_GRAB)
+ if(INCAPABLE_WITHOUT(source, INCAPABLE_GRAB))
return
var/mob/living/attacker = hitby.loc
diff --git a/code/modules/antagonists/spy/spy_bounty.dm b/code/modules/antagonists/spy/spy_bounty.dm
index 136c8a6d37071..64b171aa884bf 100644
--- a/code/modules/antagonists/spy/spy_bounty.dm
+++ b/code/modules/antagonists/spy/spy_bounty.dm
@@ -529,7 +529,7 @@
return TRUE
if(IS_WEAKREF_OF(stealing, target_ref))
var/mob/living/carbon/human/target = stealing
- if(!(target.incapacitated & (IGNORE_RESTRAINTS|IGNORE_STASIS)))
+ if(!INCAPABLE_WITHOUT(target, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return FALSE
if(find_desired_thing(target))
return TRUE
diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm
index 5640f6838f0f0..ebf2c28b86f31 100644
--- a/code/modules/clothing/head/jobs.dm
+++ b/code/modules/clothing/head/jobs.dm
@@ -54,7 +54,7 @@
/obj/item/clothing/head/utility/chefhat/proc/on_mouse_emote(mob/living/source, key, emote_message, type_override)
SIGNAL_HANDLER
var/mob/living/carbon/wearer = loc
- if(!wearer || wearer.incapacitated & IGNORE_RESTRAINTS)
+ if(!wearer || INCAPABLE_WITHOUT(wearer, INCAPABLE_RESTRAINTS))
return
if (!prob(mouse_control_probability))
return COMPONENT_CANT_EMOTE
@@ -68,7 +68,7 @@
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Didn't roll well enough or on cooldown
var/mob/living/carbon/wearer = loc
- if(!wearer || wearer.incapacitated & IGNORE_RESTRAINTS)
+ if(!wearer || INCAPABLE_WITHOUT(wearer, INCAPABLE_RESTRAINTS))
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Not worn or can't move
var/move_direction = get_dir(wearer, moved_to)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index d5b087aade47a..4cc788bcdf200 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -914,7 +914,7 @@
return ishuman(target) && target.body_position == LYING_DOWN
/mob/living/carbon/human/proc/fireman_carry(mob/living/carbon/target)
- if(!can_be_firemanned(target) || (incapacitated & IGNORE_GRAB))
+ if(!can_be_firemanned(target) || INCAPABLE_WITHOUT(src, INCAPABLE_GRAB))
to_chat(src, span_warning("You can't fireman carry [target] while [target.p_they()] [target.p_are()] standing!"))
return
@@ -941,7 +941,7 @@
return
//Second check to make sure they're still valid to be carried
- if(!can_be_firemanned(target) || (incapacitated & IGNORE_GRAB) || target.buckled)
+ if(!can_be_firemanned(target) || INCAPABLE_WITHOUT(src, INCAPABLE_GRAB) || target.buckled)
visible_message(span_warning("[src] fails to fireman carry [target]!"))
return
@@ -957,7 +957,7 @@
visible_message(span_warning("[target] fails to climb onto [src]!"))
return
- if((target.incapacitated & IGNORE_GRAB) || (incapacitated & IGNORE_GRAB))
+ if(INCAPABLE_WITHOUT(target, INCAPABLE_GRAB) || INCAPABLE_WITHOUT(src, INCAPABLE_GRAB))
target.visible_message(span_warning("[target] can't hang onto [src]!"))
return
diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm
index b8f1e60a6124f..397cc65b323fc 100644
--- a/code/modules/mob/living/init_signals.dm
+++ b/code/modules/mob/living/init_signals.dm
@@ -38,6 +38,9 @@
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_RESTRAINED), PROC_REF(on_restrained_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_RESTRAINED), PROC_REF(on_restrained_trait_loss))
+ RegisterSignals(src, SIGNAL_ADDTRAIT(TRAIT_STASIS), PROC_REF(on_stasis_trait_gain))
+ RegisterSignals(src, SIGNAL_REMOVETRAIT(TRAIT_STASIS), PROC_REF(on_stasis_trait_loss))
+
RegisterSignals(src, list(
SIGNAL_ADDTRAIT(TRAIT_CRITICAL_CONDITION),
SIGNAL_REMOVETRAIT(TRAIT_CRITICAL_CONDITION),
@@ -184,24 +187,36 @@
SIGNAL_HANDLER
add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED)
update_appearance()
+ update_incapacitated()
/// Called when [TRAIT_INCAPACITATED] is removed from the mob.
/mob/living/proc/on_incapacitated_trait_loss(datum/source)
SIGNAL_HANDLER
remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED)
update_appearance()
-
+ update_incapacitated()
/// Called when [TRAIT_RESTRAINED] is added to the mob.
/mob/living/proc/on_restrained_trait_gain(datum/source)
SIGNAL_HANDLER
ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_RESTRAINED)
+ update_incapacitated()
/// Called when [TRAIT_RESTRAINED] is removed from the mob.
/mob/living/proc/on_restrained_trait_loss(datum/source)
SIGNAL_HANDLER
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, TRAIT_RESTRAINED)
+ update_incapacitated()
+/// Called when [TRAIT_STASIS] is added to the mob
+/mob/living/proc/on_stasis_trait_gain(datum/source)
+ SIGNAL_HANDLER
+ update_incapacitated()
+
+/// Called when [TRAIT_STASIS] is removed from the mob
+/mob/living/proc/on_stasis_trait_loss(datum/source)
+ SIGNAL_HANDLER
+ update_incapacitated()
/**
* Called when traits that alter succumbing are added/removed.
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 33d1bf8e511a3..91e11e2aa90ca 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -64,7 +64,7 @@
return .
// If you are incapped, you probably can't brace yourself
- var/can_help_themselves = !(incapacitated & IGNORE_RESTRAINTS)
+ var/can_help_themselves = !INCAPABLE_WITHOUT(src, INCAPABLE_RESTRAINTS)
if(levels <= 1 && can_help_themselves)
var/obj/item/organ/external/wings/gliders = get_organ_by_type(/obj/item/organ/external/wings)
if(HAS_TRAIT(src, TRAIT_FREERUNNING) || gliders?.can_soften_fall()) // the power of parkour or wings allows falling short distances unscathed
@@ -511,22 +511,20 @@
investigate_log("has succumbed to death.", INVESTIGATE_DEATHS)
death()
-/mob/living/setup_incapacitated()
- RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_INCAPACITATED), SIGNAL_REMOVETRAIT(TRAIT_INCAPACITATED)), PROC_REF(update_incapacitated))
- RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_RESTRAINED), SIGNAL_REMOVETRAIT(TRAIT_RESTRAINED)), PROC_REF(update_incapacitated))
- RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_STASIS), SIGNAL_REMOVETRAIT(TRAIT_STASIS)), PROC_REF(update_incapacitated))
-
-/mob/living/build_incapacitated()
- // Blocks all incap flags
- if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
- return ALL
+// Remember, anything that influences this needs to call update_incapacitated somehow when it changes
+// Most often best done in [code/modules/mob/living/init_signals.dm]
+/mob/living/build_incapacitated(flags)
+ // Holds a set of flags that describe how we are currently incapacitated
var/incap_status = NONE
+ if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
+ incap_status |= TRADITIONAL_INCAPACITATED
if(HAS_TRAIT(src, TRAIT_RESTRAINED))
- incap_status |= ~IGNORE_RESTRAINTS
+ incap_status |= INCAPABLE_RESTRAINTS
if(pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)
- incap_status |= ~IGNORE_GRAB
+ incap_status |= INCAPABLE_GRAB
if(HAS_TRAIT(src, TRAIT_STASIS))
- incap_status |= ~IGNORE_STASIS
+ incap_status |= INCAPABLE_STASIS
+
return incap_status
/mob/living/canUseStorage()
@@ -2051,10 +2049,9 @@ GLOBAL_LIST_EMPTY(fire_appearances)
/mob/living/proc/can_look_up()
if(next_move > world.time)
return FALSE
- if(incapacitated & IGNORE_RESTRAINTS)
+ if(INCAPABLE_WITHOUT(src, INCAPABLE_RESTRAINTS))
return FALSE
return TRUE
-
/**
* look_up Changes the perspective of the mob to any openspace turf above the mob
*
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index bbe898a44ca06..6dd74fe27f96a 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -86,7 +86,6 @@
else
add_to_alive_mob_list()
update_incapacitated()
- setup_incapacitated()
set_focus(src)
prepare_huds()
for(var/v in GLOB.active_alternate_appearances)
@@ -388,10 +387,6 @@
return null
-/// Register signals to call update_incapacitated whenever anything it cares about changes
-/mob/proc/setup_incapacitated()
- return
-
/// Called whenever anything that modifes incapacitated is ran, updates it and sends a signal if it changes
/// Returns TRUE if anything changed, FALSE otherwise
/mob/proc/update_incapacitated()
@@ -404,7 +399,7 @@
SEND_SIGNAL(src, COMSIG_MOB_INCAPACITATE_CHANGED, old_incap, incapacitated)
return TRUE
-/// Returns an updated incapacitated bitflag. If a flag is set it means we're incap in that case
+/// Returns an updated incapacitated bitflag. If a flag is set it means we're incapacitated in that case
/mob/proc/build_incapacitated()
return NONE
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index ba798d6bcf94e..7ce8a2b92c9cd 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -73,9 +73,9 @@
* unless there is a flag being used to check if it's ignored
*
* * bitflags: (see code/__DEFINES/status_effects.dm)
- * * IGNORE_RESTRAINTS - mob in a restraint (handcuffs) is not considered incapacitated
- * * IGNORE_STASIS - mob in stasis (stasis bed, etc.) is not considered incapacitated
- * * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
+ * * INCAPABLE_RESTRAINTS - if our mob is in a restraint (handcuffs)
+ * * INCAPABLE_STASIS - if our mob is in stasis (stasis bed, etc.)
+ * * INCAPABLE_GRAB - if our mob is being agressively grabbed
*
**/
VAR_FINAL/incapacitated = NONE
diff --git a/code/modules/mod/modules/_module.dm b/code/modules/mod/modules/_module.dm
index 82be062843150..ac0b8c0138ded 100644
--- a/code/modules/mod/modules/_module.dm
+++ b/code/modules/mod/modules/_module.dm
@@ -168,7 +168,7 @@
/// Called when an activated module without a device is used
/obj/item/mod/module/proc/on_select_use(atom/target)
- if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && (mod.wearer.incapacitated & IGNORE_GRAB))
+ if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && INCAPABLE_WITHOUT(mod.wearer, INCAPABLE_GRAB))
return FALSE
mod.wearer.face_atom(target)
if(!on_use())
diff --git a/code/modules/mod/modules/module_kinesis.dm b/code/modules/mod/modules/module_kinesis.dm
index f5e490cc03a93..ab4ee218cdef5 100644
--- a/code/modules/mod/modules/module_kinesis.dm
+++ b/code/modules/mod/modules/module_kinesis.dm
@@ -69,7 +69,7 @@
clear_grab(playsound = !deleting)
/obj/item/mod/module/anomaly_locked/kinesis/process(seconds_per_tick)
- if(!mod.wearer.client || (mod.wearer.incapacitated & IGNORE_GRAB))
+ if(!mod.wearer.client || INCAPABLE_WITHOUT(mod.wearer, INCAPABLE_GRAB))
clear_grab()
return
if(!range_check(grabbed_atom))
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 728e068f4a37d..ce8f7e3396bf7 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -296,7 +296,7 @@
set category = "Object"
set src in usr
- if(!usr.can_read(src) || usr.is_blind() || (usr.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
+ if(!usr.can_read(src) || usr.is_blind() || INCAPABLE_WITHOUT(usr, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
return
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
@@ -341,7 +341,7 @@
return UI_UPDATE
if(!in_range(user, src) && !isobserver(user))
return UI_CLOSE
- if((user.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
+ if(INCAPABLE_WITHOUT(user, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
return UI_UPDATE
// Even harder to read if your blind...braile? humm
// .. or if you cannot read
diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm
index e770870f41dfc..344b0f8a0f2b8 100644
--- a/code/modules/surgery/bodyparts/robot_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm
@@ -124,7 +124,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(owner.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(INCAPABLE_WITHOUT(owner, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
@@ -172,7 +172,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(owner.incapacitated & IGNORE_RESTRAINTS|IGNORE_GRAB) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(INCAPABLE_WITHOUT(owner, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
From 78a4ef6d4d1c0767368a8acca1ebce062a8b6734 Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Fri, 12 Apr 2024 18:30:55 -0700
Subject: [PATCH 07/10] renames INCAPABLE_WITHOUT to be more clear
---
code/__DEFINES/status_effects.dm | 2 +-
code/_onclick/click.dm | 2 +-
code/_onclick/hud/screen_objects.dm | 2 +-
code/_onclick/other_mobs.dm | 2 +-
code/datums/ai/basic_mobs/base_basic_controller.dm | 2 +-
code/datums/ai/monkey/monkey_controller.dm | 2 +-
code/datums/components/riding/riding_mob.dm | 4 ++--
code/datums/martial/cqc.dm | 2 +-
code/datums/martial/sleeping_carp.dm | 2 +-
code/game/objects/items/rcd/RPD.dm | 2 +-
code/game/objects/items/rcd/RPLD.dm | 2 +-
.../structures/crates_lockers/closets/cardboardbox.dm | 2 +-
code/game/turfs/closed/walls.dm | 2 +-
.../antagonists/abductor/equipment/gear/abductor_items.dm | 2 +-
code/modules/antagonists/heretic/knowledge/blade_lore.dm | 2 +-
code/modules/antagonists/spy/spy_bounty.dm | 2 +-
code/modules/clothing/head/jobs.dm | 4 ++--
code/modules/mob/living/carbon/human/human.dm | 6 +++---
code/modules/mob/living/living.dm | 4 ++--
code/modules/mod/modules/_module.dm | 2 +-
code/modules/mod/modules/module_kinesis.dm | 2 +-
code/modules/paperwork/paper.dm | 4 ++--
code/modules/surgery/bodyparts/robot_bodyparts.dm | 4 ++--
23 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm
index dfc008d982d50..ead7764d60523 100644
--- a/code/__DEFINES/status_effects.dm
+++ b/code/__DEFINES/status_effects.dm
@@ -35,7 +35,7 @@
/// Checks to see if a mob would be incapacitated even while ignoring some types
/// Does this by inverting the passed in flags and seeing if we're still incapacitated
-#define INCAPABLE_WITHOUT(mob, flags) (mob.incapacitated & ~(flags))
+#define INCAPACITATED_IGNORING(mob, flags) (mob.incapacitated & ~(flags))
/// Maxamounts of fire stacks a mob can get
#define MAX_FIRE_STACKS 20
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index 15e8b6b3884f2..830d5a9666949 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -102,7 +102,7 @@
CtrlClickOn(A)
return
- if(INCAPABLE_WITHOUT(src, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
+ if(INCAPACITATED_IGNORING(src, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
face_atom(A)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index 2ee39715359b6..7ba4914ba9bc5 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -183,7 +183,7 @@
if(world.time <= usr.next_move)
return TRUE
- if(INCAPABLE_WITHOUT(usr, INCAPABLE_STASIS))
+ if(INCAPACITATED_IGNORING(usr, INCAPABLE_STASIS))
return TRUE
if(ismecha(usr.loc)) // stops inventory actions in a mech
return TRUE
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index c022439ac9c79..59a77dc9341da 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -113,7 +113,7 @@
if(!(interaction_flags_atom & INTERACT_ATOM_CHECK_GRAB))
ignore_flags |= INCAPABLE_GRAB
- if(INCAPABLE_WITHOUT(user, ignore_flags))
+ if(INCAPACITATED_IGNORING(user, ignore_flags))
return FALSE
return TRUE
diff --git a/code/datums/ai/basic_mobs/base_basic_controller.dm b/code/datums/ai/basic_mobs/base_basic_controller.dm
index ab357718749f7..a14630fa0e83a 100644
--- a/code/datums/ai/basic_mobs/base_basic_controller.dm
+++ b/code/datums/ai/basic_mobs/base_basic_controller.dm
@@ -31,7 +31,7 @@
var/mob/living/living_pawn = pawn
if(!(ai_traits & CAN_ACT_WHILE_DEAD))
// Unroll for flags here
- if (ai_traits & CAN_ACT_IN_STASIS && (living_pawn.stat || INCAPABLE_WITHOUT(living_pawn, INCAPABLE_STASIS)))
+ if (ai_traits & CAN_ACT_IN_STASIS && (living_pawn.stat || INCAPACITATED_IGNORING(living_pawn, INCAPABLE_STASIS)))
return FALSE
else if(IS_DEAD_OR_INCAP(living_pawn))
return FALSE
diff --git a/code/datums/ai/monkey/monkey_controller.dm b/code/datums/ai/monkey/monkey_controller.dm
index 940cbbacc56f9..a2cb7d37c5e3e 100644
--- a/code/datums/ai/monkey/monkey_controller.dm
+++ b/code/datums/ai/monkey/monkey_controller.dm
@@ -118,7 +118,7 @@ have ways of interacting with a specific mob and control it.
/datum/ai_controller/monkey/get_able_to_run()
var/mob/living/living_pawn = pawn
- if(INCAPABLE_WITHOUT(living_pawn, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS|INCAPABLE_GRAB) || living_pawn.stat > CONSCIOUS)
+ if(INCAPACITATED_IGNORING(living_pawn, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS|INCAPABLE_GRAB) || living_pawn.stat > CONSCIOUS)
return FALSE
return ..()
diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm
index f64d6e6d61131..ed82b5f2b43a9 100644
--- a/code/datums/components/riding/riding_mob.dm
+++ b/code/datums/components/riding/riding_mob.dm
@@ -56,10 +56,10 @@
if(living_parent.body_position != STANDING_UP) // if we move while on the ground, the rider falls off
. = FALSE
// for piggybacks and (redundant?) borg riding, check if the rider is stunned/restrained
- else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || INCAPABLE_WITHOUT(rider, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)))
+ else if((ride_check_flags & RIDER_NEEDS_ARMS) && (HAS_TRAIT(rider, TRAIT_RESTRAINED) || INCAPACITATED_IGNORING(rider, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)))
. = FALSE
// for fireman carries, check if the ridden is stunned/restrained
- else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || INCAPABLE_WITHOUT(living_parent, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)))
+ else if((ride_check_flags & CARRIER_NEEDS_ARM) && (HAS_TRAIT(living_parent, TRAIT_RESTRAINED) || INCAPACITATED_IGNORING(living_parent, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)))
. = FALSE
else if((ride_check_flags & JUST_FRIEND_RIDERS) && !(living_parent.faction.Find(REF(rider))))
. = FALSE
diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm
index 25abbd3a6f7a7..28b820278e21b 100644
--- a/code/datums/martial/cqc.dm
+++ b/code/datums/martial/cqc.dm
@@ -46,7 +46,7 @@
/datum/martial_art/cqc/proc/check_block(mob/living/cqc_user, atom/movable/hitby, damage, attack_text, attack_type, ...)
SIGNAL_HANDLER
- if(!can_use(cqc_user) || !cqc_user.throw_mode || INCAPABLE_WITHOUT(cqc_user, INCAPABLE_GRAB))
+ if(!can_use(cqc_user) || !cqc_user.throw_mode || INCAPACITATED_IGNORING(cqc_user, INCAPABLE_GRAB))
return NONE
if(attack_type == PROJECTILE_ATTACK)
return NONE
diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm
index cfc5a55da15c1..a2cb64d6e2dc2 100644
--- a/code/datums/martial/sleeping_carp.dm
+++ b/code/datums/martial/sleeping_carp.dm
@@ -184,7 +184,7 @@
/datum/martial_art/the_sleeping_carp/proc/can_deflect(mob/living/carp_user)
if(!can_use(carp_user) || !carp_user.combat_mode)
return FALSE
- if(INCAPABLE_WITHOUT(carp_user, INCAPABLE_GRAB)) //NO STUN
+ if(INCAPACITATED_IGNORING(carp_user, INCAPABLE_GRAB)) //NO STUN
return FALSE
if(!(carp_user.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
return FALSE
diff --git a/code/game/objects/items/rcd/RPD.dm b/code/game/objects/items/rcd/RPD.dm
index 18e281873b2ed..e2ab3a0f118cb 100644
--- a/code/game/objects/items/rcd/RPD.dm
+++ b/code/game/objects/items/rcd/RPD.dm
@@ -681,7 +681,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if(multi_layer)
balloon_alert(source_mob, "turn off multi layer!")
return
- if(INCAPABLE_WITHOUT(source_mob, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
+ if(INCAPACITATED_IGNORING(source_mob, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
if(source_mob.get_active_held_item() != src)
return
diff --git a/code/game/objects/items/rcd/RPLD.dm b/code/game/objects/items/rcd/RPLD.dm
index da2d529b25616..68a14acc56674 100644
--- a/code/game/objects/items/rcd/RPLD.dm
+++ b/code/game/objects/items/rcd/RPLD.dm
@@ -280,7 +280,7 @@
/obj/item/construction/plumbing/proc/mouse_wheeled(mob/source, atom/A, delta_x, delta_y, params)
SIGNAL_HANDLER
- if(INCAPABLE_WITHOUT(source, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
+ if(INCAPACITATED_IGNORING(source, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
if(delta_y == 0)
return
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index cb2b1eec99ec7..2f555ed84dea5 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -72,7 +72,7 @@
for(var/mob/living/alerted_mob as anything in alerted)
if(alerted_mob.stat != CONSCIOUS || alerted_mob.is_blind())
continue
- if(!INCAPABLE_WITHOUT(alerted_mob, INCAPABLE_RESTRAINTS))
+ if(!INCAPACITATED_IGNORING(alerted_mob, INCAPABLE_RESTRAINTS))
alerted_mob.face_atom(src)
alerted_mob.do_alert_animation()
diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm
index 877db6eec1708..8d46559d8e81b 100644
--- a/code/game/turfs/closed/walls.dm
+++ b/code/game/turfs/closed/walls.dm
@@ -40,7 +40,7 @@
if(!iscarbon(dropping) && !iscyborg(dropping))
return
var/mob/living/leaner = dropping
- if(INCAPABLE_WITHOUT(leaner, INCAPABLE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
+ if(INCAPACITATED_IGNORING(leaner, INCAPABLE_RESTRAINTS) || leaner.stat != CONSCIOUS || HAS_TRAIT(leaner, TRAIT_NO_TRANSFORM))
return
if(!leaner.density || leaner.pulledby || leaner.buckled || !(leaner.mobility_flags & MOBILITY_STAND))
return
diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
index 974442d7e2e83..a9337df337a01 100644
--- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
+++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm
@@ -394,7 +394,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/melee/baton/abductor/proc/SleepAttack(mob/living/target, mob/living/user)
playsound(src, on_stun_sound, 50, TRUE, -1)
- if(INCAPABLE_WITHOUT(target, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB))
+ if(INCAPACITATED_IGNORING(target, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB))
if(target.can_block_magic(MAGIC_RESISTANCE_MIND))
to_chat(user, span_warning("The specimen has some kind of mental protection that is interfering with the sleep inducement! It seems you've been foiled."))
target.visible_message(span_danger("[user] tried to induced sleep in [target] with [src], but is unsuccessful!"), \
diff --git a/code/modules/antagonists/heretic/knowledge/blade_lore.dm b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
index d36243d1d13a7..e5e851f22730c 100644
--- a/code/modules/antagonists/heretic/knowledge/blade_lore.dm
+++ b/code/modules/antagonists/heretic/knowledge/blade_lore.dm
@@ -139,7 +139,7 @@
if(!riposte_ready)
return
- if(INCAPABLE_WITHOUT(source, INCAPABLE_GRAB))
+ if(INCAPACITATED_IGNORING(source, INCAPABLE_GRAB))
return
var/mob/living/attacker = hitby.loc
diff --git a/code/modules/antagonists/spy/spy_bounty.dm b/code/modules/antagonists/spy/spy_bounty.dm
index 64b171aa884bf..c8702c03f3e07 100644
--- a/code/modules/antagonists/spy/spy_bounty.dm
+++ b/code/modules/antagonists/spy/spy_bounty.dm
@@ -529,7 +529,7 @@
return TRUE
if(IS_WEAKREF_OF(stealing, target_ref))
var/mob/living/carbon/human/target = stealing
- if(!INCAPABLE_WITHOUT(target, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
+ if(!INCAPACITATED_IGNORING(target, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return FALSE
if(find_desired_thing(target))
return TRUE
diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm
index ebf2c28b86f31..76fbcb56019dd 100644
--- a/code/modules/clothing/head/jobs.dm
+++ b/code/modules/clothing/head/jobs.dm
@@ -54,7 +54,7 @@
/obj/item/clothing/head/utility/chefhat/proc/on_mouse_emote(mob/living/source, key, emote_message, type_override)
SIGNAL_HANDLER
var/mob/living/carbon/wearer = loc
- if(!wearer || INCAPABLE_WITHOUT(wearer, INCAPABLE_RESTRAINTS))
+ if(!wearer || INCAPACITATED_IGNORING(wearer, INCAPABLE_RESTRAINTS))
return
if (!prob(mouse_control_probability))
return COMPONENT_CANT_EMOTE
@@ -68,7 +68,7 @@
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Didn't roll well enough or on cooldown
var/mob/living/carbon/wearer = loc
- if(!wearer || INCAPABLE_WITHOUT(wearer, INCAPABLE_RESTRAINTS))
+ if(!wearer || INCAPACITATED_IGNORING(wearer, INCAPABLE_RESTRAINTS))
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE // Not worn or can't move
var/move_direction = get_dir(wearer, moved_to)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 4cc788bcdf200..829ac6400a304 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -914,7 +914,7 @@
return ishuman(target) && target.body_position == LYING_DOWN
/mob/living/carbon/human/proc/fireman_carry(mob/living/carbon/target)
- if(!can_be_firemanned(target) || INCAPABLE_WITHOUT(src, INCAPABLE_GRAB))
+ if(!can_be_firemanned(target) || INCAPACITATED_IGNORING(src, INCAPABLE_GRAB))
to_chat(src, span_warning("You can't fireman carry [target] while [target.p_they()] [target.p_are()] standing!"))
return
@@ -941,7 +941,7 @@
return
//Second check to make sure they're still valid to be carried
- if(!can_be_firemanned(target) || INCAPABLE_WITHOUT(src, INCAPABLE_GRAB) || target.buckled)
+ if(!can_be_firemanned(target) || INCAPACITATED_IGNORING(src, INCAPABLE_GRAB) || target.buckled)
visible_message(span_warning("[src] fails to fireman carry [target]!"))
return
@@ -957,7 +957,7 @@
visible_message(span_warning("[target] fails to climb onto [src]!"))
return
- if(INCAPABLE_WITHOUT(target, INCAPABLE_GRAB) || INCAPABLE_WITHOUT(src, INCAPABLE_GRAB))
+ if(INCAPACITATED_IGNORING(target, INCAPABLE_GRAB) || INCAPACITATED_IGNORING(src, INCAPABLE_GRAB))
target.visible_message(span_warning("[target] can't hang onto [src]!"))
return
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 91e11e2aa90ca..7360f3dd7d972 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -64,7 +64,7 @@
return .
// If you are incapped, you probably can't brace yourself
- var/can_help_themselves = !INCAPABLE_WITHOUT(src, INCAPABLE_RESTRAINTS)
+ var/can_help_themselves = !INCAPACITATED_IGNORING(src, INCAPABLE_RESTRAINTS)
if(levels <= 1 && can_help_themselves)
var/obj/item/organ/external/wings/gliders = get_organ_by_type(/obj/item/organ/external/wings)
if(HAS_TRAIT(src, TRAIT_FREERUNNING) || gliders?.can_soften_fall()) // the power of parkour or wings allows falling short distances unscathed
@@ -2049,7 +2049,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
/mob/living/proc/can_look_up()
if(next_move > world.time)
return FALSE
- if(INCAPABLE_WITHOUT(src, INCAPABLE_RESTRAINTS))
+ if(INCAPACITATED_IGNORING(src, INCAPABLE_RESTRAINTS))
return FALSE
return TRUE
/**
diff --git a/code/modules/mod/modules/_module.dm b/code/modules/mod/modules/_module.dm
index ac0b8c0138ded..0462456eaa775 100644
--- a/code/modules/mod/modules/_module.dm
+++ b/code/modules/mod/modules/_module.dm
@@ -168,7 +168,7 @@
/// Called when an activated module without a device is used
/obj/item/mod/module/proc/on_select_use(atom/target)
- if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && INCAPABLE_WITHOUT(mod.wearer, INCAPABLE_GRAB))
+ if(!(allow_flags & MODULE_ALLOW_INCAPACITATED) && INCAPACITATED_IGNORING(mod.wearer, INCAPABLE_GRAB))
return FALSE
mod.wearer.face_atom(target)
if(!on_use())
diff --git a/code/modules/mod/modules/module_kinesis.dm b/code/modules/mod/modules/module_kinesis.dm
index ab4ee218cdef5..e200228ce9c37 100644
--- a/code/modules/mod/modules/module_kinesis.dm
+++ b/code/modules/mod/modules/module_kinesis.dm
@@ -69,7 +69,7 @@
clear_grab(playsound = !deleting)
/obj/item/mod/module/anomaly_locked/kinesis/process(seconds_per_tick)
- if(!mod.wearer.client || INCAPABLE_WITHOUT(mod.wearer, INCAPABLE_GRAB))
+ if(!mod.wearer.client || INCAPACITATED_IGNORING(mod.wearer, INCAPABLE_GRAB))
clear_grab()
return
if(!range_check(grabbed_atom))
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index ce8f7e3396bf7..650f27e1d8a53 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -296,7 +296,7 @@
set category = "Object"
set src in usr
- if(!usr.can_read(src) || usr.is_blind() || INCAPABLE_WITHOUT(usr, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
+ if(!usr.can_read(src) || usr.is_blind() || INCAPACITATED_IGNORING(usr, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB) || (isobserver(usr) && !isAdminGhostAI(usr)))
return
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
@@ -341,7 +341,7 @@
return UI_UPDATE
if(!in_range(user, src) && !isobserver(user))
return UI_CLOSE
- if(INCAPABLE_WITHOUT(user, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
+ if(INCAPACITATED_IGNORING(user, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB) || (isobserver(user) && !isAdminGhostAI(user)))
return UI_UPDATE
// Even harder to read if your blind...braile? humm
// .. or if you cannot read
diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm
index 344b0f8a0f2b8..c18d718f3429d 100644
--- a/code/modules/surgery/bodyparts/robot_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm
@@ -124,7 +124,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(INCAPABLE_WITHOUT(owner, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(INCAPACITATED_IGNORING(owner, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
@@ -172,7 +172,7 @@
if (severity == EMP_HEAVY)
knockdown_time *= 2
owner.Knockdown(knockdown_time)
- if(INCAPABLE_WITHOUT(owner, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
+ if(INCAPACITATED_IGNORING(owner, INCAPABLE_RESTRAINTS|INCAPABLE_GRAB)) // So the message isn't duplicated. If they were stunned beforehand by something else, then the message not showing makes more sense anyways.
return
to_chat(owner, span_danger("As your [plaintext_zone] unexpectedly malfunctions, it causes you to fall to the ground!"))
From 9df15a0953f746b643ebf2dac7b29acfe6c21fd7 Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Sat, 13 Apr 2024 01:27:15 -0700
Subject: [PATCH 08/10] yeeeet
---
code/modules/mob/living/basic/bots/_bots.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm
index c3cae075bb07d..90f62fcf4523c 100644
--- a/code/modules/mob/living/basic/bots/_bots.dm
+++ b/code/modules/mob/living/basic/bots/_bots.dm
@@ -48,7 +48,7 @@ GLOBAL_LIST_INIT(command_strings, list(
///All initial access this bot started with.
var/list/initial_access = list()
///Bot-related mode flags on the Bot indicating how they will act. BOT_MODE_ON | BOT_MODE_AUTOPATROL | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION
- var/bot_mode_flags = BOT_MODE_ON | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION
+ VAR_PROTECTED/bot_mode_flags = BOT_MODE_ON | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION
///Bot-related cover flags on the Bot to deal with what has been done to their cover, including emagging. BOT_COVER_MAINTS_OPEN | BOT_COVER_LOCKED | BOT_COVER_EMAGGED | BOT_COVER_HACKED
var/bot_access_flags = BOT_COVER_LOCKED
///Small name of what the bot gets messed with when getting hacked/emagged.
From c786674ee7d4471ed5142b6e74ea013ff36b549d Mon Sep 17 00:00:00 2001
From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Date: Sat, 13 Apr 2024 03:06:55 -0700
Subject: [PATCH 09/10] forgot to actually implment it whoopers
---
code/modules/mob/living/basic/bots/_bots.dm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm
index 90f62fcf4523c..ed17ce5d7dda9 100644
--- a/code/modules/mob/living/basic/bots/_bots.dm
+++ b/code/modules/mob/living/basic/bots/_bots.dm
@@ -48,7 +48,8 @@ GLOBAL_LIST_INIT(command_strings, list(
///All initial access this bot started with.
var/list/initial_access = list()
///Bot-related mode flags on the Bot indicating how they will act. BOT_MODE_ON | BOT_MODE_AUTOPATROL | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION
- VAR_PROTECTED/bot_mode_flags = BOT_MODE_ON | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION
+ /// DO NOT MODIFY MANUALLY, USE set_bot_mode_flags. If you don't shit breaks BAD
+ var/bot_mode_flags = BOT_MODE_ON | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION
///Bot-related cover flags on the Bot to deal with what has been done to their cover, including emagging. BOT_COVER_MAINTS_OPEN | BOT_COVER_LOCKED | BOT_COVER_EMAGGED | BOT_COVER_HACKED
var/bot_access_flags = BOT_COVER_LOCKED
///Small name of what the bot gets messed with when getting hacked/emagged.
@@ -178,7 +179,7 @@ GLOBAL_LIST_INIT(command_strings, list(
/mob/living/basic/bot/proc/turn_on()
if(stat == DEAD)
return FALSE
- bot_mode_flags |= BOT_MODE_ON
+ set_mode_flags(bot_mode_flags | BOT_MODE_ON)
remove_traits(list(TRAIT_INCAPACITATED, TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), POWER_LACK_TRAIT)
set_light_on(bot_mode_flags & BOT_MODE_ON ? TRUE : FALSE)
update_appearance()
@@ -187,7 +188,7 @@ GLOBAL_LIST_INIT(command_strings, list(
return TRUE
/mob/living/basic/bot/proc/turn_off()
- bot_mode_flags &= ~BOT_MODE_ON
+ set_mode_flags(bot_mode_flags & ~BOT_MODE_ON)
add_traits(on_toggle_traits, POWER_LACK_TRAIT)
set_light_on(bot_mode_flags & BOT_MODE_ON ? TRUE : FALSE)
bot_reset() //Resets an AI's call, should it exist.
@@ -305,7 +306,7 @@ GLOBAL_LIST_INIT(command_strings, list(
return FALSE
bot_access_flags |= BOT_COVER_EMAGGED
bot_access_flags |= BOT_COVER_LOCKED
- bot_mode_flags &= ~BOT_MODE_REMOTE_ENABLED //Manually emagging the bot also locks the AI from controlling it.
+ set_mode_flags(bot_mode_flags & ~BOT_MODE_REMOTE_ENABLED) //Manually emagging the bot also locks the AI from controlling it.
bot_reset()
turn_on() //The bot automatically turns on when emagged, unless recently hit with EMP.
to_chat(src, span_userdanger("(#$*#$^^( OVERRIDE DETECTED"))
@@ -555,9 +556,9 @@ GLOBAL_LIST_INIT(command_strings, list(
switch(command)
if("patroloff")
bot_reset() //HOLD IT!! //OBJECTION!!
- bot_mode_flags &= ~BOT_MODE_AUTOPATROL
+ set_mode_flags(bot_mode_flags & ~BOT_MODE_AUTOPATROL)
if("patrolon")
- bot_mode_flags |= BOT_MODE_AUTOPATROL
+ set_mode_flags(bot_mode_flags | BOT_MODE_AUTOPATROL)
if("summon")
summon_bot(user, user_access = user_access)
if("ejectpai")
@@ -609,10 +610,10 @@ GLOBAL_LIST_INIT(command_strings, list(
if("maintenance")
bot_access_flags ^= BOT_COVER_MAINTS_OPEN
if("patrol")
- bot_mode_flags ^= BOT_MODE_AUTOPATROL
+ set_mode_flags(bot_mode_flags ^ BOT_MODE_AUTOPATROL)
bot_reset()
if("airplane")
- bot_mode_flags ^= BOT_MODE_REMOTE_ENABLED
+ set_mode_flags(bot_mode_flags ^ BOT_MODE_REMOTE_ENABLED)
if("hack")
if(!HAS_SILICON_ACCESS(the_user))
return
From e05ddbb9dd955c7d864638bcc470b3266e9eb91c Mon Sep 17 00:00:00 2001
From: ZephyrTFA
Date: Tue, 16 Apr 2024 16:46:02 -0400
Subject: [PATCH 10/10] fix this
---
code/modules/lootpanel/_lootpanel.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/lootpanel/_lootpanel.dm b/code/modules/lootpanel/_lootpanel.dm
index 86a94cc9957c0..6b995074939d8 100644
--- a/code/modules/lootpanel/_lootpanel.dm
+++ b/code/modules/lootpanel/_lootpanel.dm
@@ -58,7 +58,7 @@
if(!source_turf.Adjacent(user))
return UI_CLOSE
- if(user.incapacitated())
+ if(user.incapacitated)
return UI_DISABLED
return UI_INTERACTIVE