From e184e46bf088c5156deaa3009fcbbc84edfd4c98 Mon Sep 17 00:00:00 2001 From: Zwei Date: Wed, 10 Apr 2024 16:24:40 +0300 Subject: [PATCH] Anchor Variable Setter --- code/__DEFINES/dcs/signals.dm | 2 ++ code/__HELPERS/icon_smoothing.dm | 1 - code/__HELPERS/unsorted.dm | 2 +- code/datums/components/ducttape.dm | 3 ++- code/datums/spell.dm | 2 +- code/datums/wires/syndicatebomb.dm | 2 +- code/game/atoms_movable.dm | 15 +++++++++++++++ .../clockwork/clockwork_structures.dm | 6 +++--- code/game/gamemodes/cult/cult_structures.dm | 2 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 8 ++++---- code/game/machinery/camera/camera.dm | 4 ++-- code/game/machinery/camera/camera_assembly.dm | 4 ++-- code/game/machinery/cell_charger.dm | 2 +- code/game/machinery/cloning.dm | 8 ++++---- code/game/machinery/computer/buildandrepair.dm | 4 ++-- code/game/machinery/computer/computer.dm | 2 +- code/game/machinery/constructable_frame.dm | 4 ++-- code/game/machinery/dance_machine.dm | 4 ++-- code/game/machinery/deployable.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 2 +- code/game/machinery/flasher.dm | 2 +- code/game/machinery/hologram.dm | 2 +- code/game/machinery/machinery.dm | 2 +- code/game/machinery/mass_driver.dm | 6 +++--- code/game/machinery/pipe/pipe_dispenser.dm | 4 ++-- code/game/machinery/portable_turret.dm | 6 +++--- code/game/machinery/shieldgen.dm | 10 +++++----- code/game/machinery/snow_machine.dm | 2 +- code/game/machinery/syndicatebeacon.dm | 4 ++-- code/game/machinery/syndicatebomb.dm | 4 ++-- code/game/mecha/equipment/tools/work_tools.dm | 12 ++++++------ code/game/objects/items.dm | 1 - code/game/objects/items/devices/powersink.dm | 6 +++--- code/game/objects/items/stacks/stack_recipe.dm | 2 +- .../items/weapons/grenades/ghettobomb.dm | 4 ++-- .../objects/items/weapons/storage/backpack.dm | 4 ++-- code/game/objects/objs.dm | 2 +- .../crates_lockers/closets/statue.dm | 6 ++---- code/game/objects/structures/curtains.dm | 4 ++-- code/game/objects/structures/door_assembly.dm | 2 +- code/game/objects/structures/engicart.dm | 4 ++-- code/game/objects/structures/foodcart.dm | 4 ++-- code/game/objects/structures/grille.dm | 4 ++-- code/game/objects/structures/guillotine.dm | 2 +- code/game/objects/structures/janicart.dm | 4 ++-- code/game/objects/structures/kitchen_spike.dm | 4 ++-- code/game/objects/structures/plasticflaps.dm | 4 ++-- code/game/objects/structures/railings.dm | 4 ++-- code/game/objects/structures/reflector.dm | 4 ++-- code/game/objects/structures/stairs.dm | 4 ++-- .../structures/stool_bed_chair_nest/chairs.dm | 4 ++-- code/game/objects/structures/tank_dispenser.dm | 4 ++-- code/game/objects/structures/watercloset.dm | 14 +++++++------- .../objects/structures/windoor_assembly.dm | 4 ++-- code/game/objects/structures/window.dm | 4 ++-- code/game/turfs/simulated/walls.dm | 2 +- code/modules/admin/verbs/debug.dm | 2 +- code/modules/admin/verbs/freeze.dm | 4 ++-- .../goon_vampire/goon_vampire_powers.dm | 4 ++-- .../portable/portable_atmospherics.dm | 4 ++-- .../machinery/portable/scrubber.dm | 2 +- .../food_and_drinks/drinks/bottler/bottler.dm | 2 +- .../kitchen_machinery/gibber.dm | 4 ++-- .../kitchen_machinery/kitchen_machine.dm | 10 ++++------ code/modules/holiday/new_year.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 4 ++-- code/modules/mining/fulton.dm | 6 +++--- code/modules/mob/living/silicon/ai/ai.dm | 10 +++++----- .../mob/living/simple_animal/bot/bot.dm | 2 +- .../mob/living/simple_animal/bot/cleanbot.dm | 4 ++-- .../mob/living/simple_animal/bot/ed209bot.dm | 16 ++++++++-------- .../mob/living/simple_animal/bot/floorbot.dm | 18 +++++++++--------- .../mob/living/simple_animal/bot/griefsky.dm | 4 ++-- .../mob/living/simple_animal/bot/honkbot.dm | 10 +++++----- .../mob/living/simple_animal/bot/secbot.dm | 14 +++++++------- .../simple_animal/hostile/floorcluwne.dm | 4 ++-- code/modules/paperwork/desk_bell.dm | 8 ++++---- code/modules/paperwork/papershredder.dm | 2 +- code/modules/power/generator.dm | 3 ++- code/modules/power/port_gen.dm | 2 +- code/modules/power/singularity/emitter.dm | 6 +++--- .../power/singularity/field_generator.dm | 6 +++--- code/modules/power/singularity/generator.dm | 2 +- .../particle_accelerator.dm | 8 ++++---- code/modules/power/solar.dm | 8 ++++---- code/modules/power/supermatter/supermatter.dm | 4 ++-- code/modules/power/tracker.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 7 +++---- code/modules/recycling/disposal.dm | 4 ++-- .../modules/recycling/disposal/construction.dm | 4 ++-- code/modules/recycling/disposal/outlet.dm | 4 ++-- code/modules/recycling/disposal/pipe.dm | 2 +- .../research/xenobiology/xenobiology.dm | 4 ++-- code/modules/spacepods/parts.dm | 2 +- .../station_goals/brs/brs_portable_scanner.dm | 2 +- code/modules/station_goals/shield.dm | 4 ++-- 97 files changed, 229 insertions(+), 217 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index b2a056f021f..a3da9670e78 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -303,6 +303,8 @@ /* #define HEARING_RADIO_FREQ 5 #define HEARING_SPANS 6 #define HEARING_MESSAGE_MODE 7 */ +///called when the movable sucessfully has it's anchored var changed, from base atom/movable/set_anchored(): (value) +#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored" ///called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source) #define COMSIG_MOVABLE_DISPOSING "movable_disposing" diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 73a7d4676f9..359a3ca18e0 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -51,7 +51,6 @@ /atom/var/bottom_left_corner /atom/var/bottom_right_corner /atom/var/list/canSmoothWith = null // TYPE PATHS I CAN SMOOTH WITH~~~~~ If this is null and atom is smooth, it smooths only with itself -/atom/movable/var/can_be_unanchored = FALSE /turf/var/list/fixed_underlay = null /proc/calculate_adjacencies(atom/A) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 8f2ffe5fd2c..d086899ec63 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -644,7 +644,7 @@ Returns 1 if the chain up to the area contains the given typepath var/obj/corner = new() corner.loc = X corner.density = 1 - corner.anchored = TRUE + corner.set_anchored(TRUE) corner.icon = X.icon corner.icon_state = replacetext(X.icon_state, "_s", "_f") corner.tag = "delete me" diff --git a/code/datums/components/ducttape.dm b/code/datums/components/ducttape.dm index 8327786aa2a..176ca6f6419 100644 --- a/code/datums/components/ducttape.dm +++ b/code/datums/components/ducttape.dm @@ -14,6 +14,7 @@ y_offset = y RegisterSignal(parent, COMSIG_ITEM_AFTERATTACK, PROC_REF(afterattack)) RegisterSignal(parent, COMSIG_ITEM_PICKUP, PROC_REF(pick_up)) + I.set_anchored(TRUE) I.update_icon() //Do this first so the action button properly shows the icon if(!hide_tape) //the tape can no longer be removed if TRUE var/datum/action/item_action/remove_tape/RT = new(I) @@ -38,7 +39,7 @@ playsound(I, 'sound/items/poster_ripped.ogg', 50, 1) new /obj/item/trash/tapetrash(user.loc) I.update_icon() - I.anchored = initial(I.anchored) + I.set_anchored(initial(I.anchored)) for(var/datum/action/item_action/remove_tape/RT in I.actions) RT.Remove(user) qdel(RT) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 0dc7b80de10..7387b3c9b22 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -488,7 +488,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) var/obj/effect/overlay/spell = new /obj/effect/overlay(location) spell.icon = overlay_icon spell.icon_state = overlay_icon_state - spell.anchored = TRUE + spell.set_anchored(TRUE) spell.density = FALSE spawn(overlay_lifespan) qdel(spell) diff --git a/code/datums/wires/syndicatebomb.dm b/code/datums/wires/syndicatebomb.dm index bd996f72fcc..8a6a9ef95fe 100644 --- a/code/datums/wires/syndicatebomb.dm +++ b/code/datums/wires/syndicatebomb.dm @@ -72,7 +72,7 @@ if(!mend && B.anchored) holder.visible_message("[bicon(B)] The bolts lift out of the ground!") playsound(B, 'sound/effects/stealthoff.ogg', 30, 1) - B.anchored = FALSE + B.set_anchored(FALSE) if(WIRE_BOMB_PROCEED) if(!mend && B.active) holder.visible_message("[bicon(B)] An alarm sounds! It's go-") diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 6a4fa84c8e3..6e7d84d6514 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -28,6 +28,9 @@ var/inertia_next_move = 0 var/inertia_move_delay = 5 + ///Used for the calculate_adjacencies proc for icon smoothing. + var/can_be_unanchored = FALSE + /** * In case you have multiple types, you automatically use the most useful one. * IE: Skating on ice, flippers on water, flying over chasm/space, etc. @@ -864,3 +867,15 @@ SHOULD_BE_PURE(TRUE) return blocker_opinion + +///Sets the anchored var and returns if it was sucessfully changed or not. +/atom/movable/proc/set_anchored(anchorvalue) + SHOULD_CALL_PARENT(TRUE) + if(anchored == anchorvalue) + return + . = anchored + anchored = anchorvalue + if(anchored && pulledby) + pulledby.stop_pulling() + SEND_SIGNAL(src, COMSIG_MOVABLE_SET_ANCHORED, anchorvalue) + diff --git a/code/game/gamemodes/clockwork/clockwork_structures.dm b/code/game/gamemodes/clockwork/clockwork_structures.dm index c3995892d8e..fe143525ede 100644 --- a/code/game/gamemodes/clockwork/clockwork_structures.dm +++ b/code/game/gamemodes/clockwork/clockwork_structures.dm @@ -124,7 +124,7 @@ to_chat(usr, "There is a structure here!") return TRUE add_fingerprint(user) - anchored = !anchored + set_anchored(!anchored) to_chat(user, "You [anchored ? "":"un"]secure [src] [anchored ? "to":"from"] the floor.") update_icon(UPDATE_ICON_STATE) return TRUE @@ -354,7 +354,7 @@ if(locate(/obj/structure/falsewall) in loc) to_chat(usr, "There is a structure here!") return TRUE - anchored = !anchored + set_anchored(!anchored) update_icon(UPDATE_ICON_STATE) to_chat(user, "You [anchored ? "":"un"]secure [src] [anchored ? "to":"from"] the floor.") if(!anchored) @@ -543,7 +543,7 @@ to_chat(usr, "There is a structure here!") return TRUE add_fingerprint(user) - anchored = !anchored + set_anchored(!anchored) update_icon(UPDATE_ICON_STATE) to_chat(user, "You [anchored ? "":"un"]secure [src] [anchored ? "to":"from"] the floor.") if(!anchored) diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index 242a7999d9e..ce1076d2755 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -76,7 +76,7 @@ /obj/structure/cult/functional/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/melee/cultblade/dagger) && iscultist(user)) add_fingerprint(user) - anchored = !anchored + set_anchored(!anchored) update_icon(UPDATE_ICON_STATE) to_chat(user, "You [anchored ? "":"un"]secure [src] [anchored ? "to":"from"] the floor.") return diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 7bbaca898cf..918744c305e 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -221,7 +221,7 @@ GLOBAL_VAR(bomb_set) if(!I.use_tool(src, user, 80, volume = I.tool_volume) || removal_stage != NUKE_UNWRENCHED) return user.visible_message("[user] crowbars [src] off of the anchors. It can now be moved.", "You jam the crowbar under the nuclear device and lift it off its anchors. You can now move it!") - anchored = FALSE + set_anchored(FALSE) removal_stage = NUKE_MOBILE /obj/machinery/nuclearbomb/wrench_act(mob/user, obj/item/I) @@ -384,7 +384,7 @@ GLOBAL_VAR(bomb_set) switch(action) if("deploy") if(removal_stage != NUKE_MOBILE) - anchored = TRUE + set_anchored(TRUE) visible_message("With a steely snap, bolts slide out of [src] and anchor it to the flooring!") else visible_message("[src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.") @@ -432,13 +432,13 @@ GLOBAL_VAR(bomb_set) switch(action) if("toggle_anchor") if(removal_stage == NUKE_MOBILE) - anchored = FALSE + set_anchored(FALSE) visible_message("[src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.") else if(isinspace()) to_chat(usr, "There is nothing to anchor to!") return FALSE else - anchored = !(anchored) + set_anchored(!anchored) if(anchored) visible_message("With a steely snap, bolts slide out of [src] and anchor it to the flooring.") else diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 8831f5c730d..bdfcb87b592 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -40,7 +40,7 @@ wires = new(src) assembly = new(src) assembly.state = 4 - assembly.anchored = TRUE + assembly.set_anchored(TRUE) assembly.update_icon(UPDATE_ICON_STATE) GLOB.cameranet.cameras += src @@ -425,7 +425,7 @@ /obj/machinery/camera/portable/Initialize(mapload) . = ..() assembly.state = 0 //These cameras are portable, and so shall be in the portable state if removed. - assembly.anchored = FALSE + assembly.set_anchored(FALSE) assembly.update_icon(UPDATE_ICON_STATE) /obj/machinery/camera/portable/process() //Updates whenever the camera is moved. diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 9ef6ebd632c..5393ea6c660 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -117,13 +117,13 @@ return if(state == ASSEMBLY_UNBUILT && isturf(loc)) WRENCH_ANCHOR_TO_WALL_MESSAGE - anchored = TRUE + set_anchored(TRUE) state = ASSEMBLY_WRENCHED update_icon(UPDATE_ICON_STATE) auto_turn() else if(state == ASSEMBLY_WRENCHED) WRENCH_UNANCHOR_WALL_MESSAGE - anchored = FALSE + set_anchored(FALSE) update_icon(UPDATE_ICON_STATE) state = ASSEMBLY_UNBUILT else diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index d47de7afbb2..0480d09d81f 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -78,7 +78,7 @@ return if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) if(anchored) WRENCH_ANCHOR_MESSAGE else diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 0ce1270439a..cbd88888f4b 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -471,14 +471,14 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\ if(occupant) to_chat(user, span_warning("Can not do that while [src] is in use.")) return + set_anchored(!anchored) if(anchored) + WRENCH_ANCHOR_MESSAGE + else WRENCH_UNANCHOR_MESSAGE - anchored = FALSE connected.pods -= src connected = null - else - WRENCH_ANCHOR_MESSAGE - anchored = TRUE + /obj/machinery/clonepod/emag_act(mob/user) if(isnull(occupant)) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index ca7c63935e6..a45a05b872a 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -595,10 +595,10 @@ if(anchored) to_chat(user, span_notice("You unfasten the frame.")) - anchored = FALSE + set_anchored(FALSE) else to_chat(user, span_notice("You wrench the frame into place.")) - anchored = TRUE + set_anchored(TRUE) /obj/structure/computerframe/crowbar_act(mob/living/user, obj/item/I) . = TRUE diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index b71384f7eb6..15933fb6707 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -153,7 +153,7 @@ A.name += " ([M.board_name])" A.setDir(dir) A.circuit = M - A.anchored = TRUE + A.set_anchored(TRUE) if(stat & BROKEN) if(user) to_chat(user, span_notice("The broken glass falls out.")) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 22878077bd2..27c5bb4ee0d 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -109,7 +109,7 @@ return . if(anchored) - anchored = FALSE + set_anchored(FALSE) WRENCH_UNANCHOR_MESSAGE return . @@ -117,7 +117,7 @@ to_chat(user, span_warning("You cannot tightens the bolts in space!")) return . - anchored = TRUE + set_anchored(TRUE) WRENCH_ANCHOR_MESSAGE diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 206b576e33c..e7947451825 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -64,10 +64,10 @@ if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return if(!anchored && !isinspace()) - anchored = TRUE + set_anchored(TRUE) WRENCH_ANCHOR_MESSAGE else if(anchored) - anchored = FALSE + set_anchored(FALSE) WRENCH_UNANCHOR_MESSAGE playsound(src, 'sound/items/deconstruct.ogg', 50, 1) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 1caed61319b..78eecdcdef0 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -150,7 +150,7 @@ /obj/structure/barricade/security/proc/deploy() icon_state = "barrier1" density = TRUE - anchored = TRUE + set_anchored(TRUE) if(deploy_message) visible_message(span_warning("[src] deploys!")) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 4be1855300f..3ee9239214e 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1515,7 +1515,7 @@ About the new airlock wires panel: DA = new /obj/structure/door_assembly(loc) //If you come across a null assemblytype, it will produce the default assembly instead of disintegrating. DA.heat_proof_finished = heat_proof //tracks whether there's rglass in - DA.anchored = TRUE + DA.set_anchored(TRUE) DA.glass = src.glass DA.state = AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS DA.created_name = name diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index d32b011735d..78d18e867b6 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -325,7 +325,7 @@ if("rightsecure") WA.facing = "r" WA.secure = TRUE - WA.anchored = TRUE + WA.set_anchored(TRUE) WA.state= "02" WA.setDir(dir) WA.ini_dir = dir diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 8cf6bc0bdc8..5b968e4afaf 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -132,7 +132,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) if(anchored) WRENCH_ANCHOR_MESSAGE else diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index d70b314cde5..28959d0588e 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -398,7 +398,7 @@ GLOBAL_LIST_EMPTY(holopads) hologram.mouse_opacity = MOUSE_OPACITY_TRANSPARENT//So you can't click on it. hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. - hologram.anchored = TRUE//So space wind cannot drag it. + hologram.set_anchored(TRUE) //So space wind cannot drag it. hologram.name = "[user.name] (hologram)"//If someone decides to right click. hologram.set_light(2) //hologram lighting move_hologram() diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 9e635801c09..4517119405f 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -342,7 +342,7 @@ Class Procs: /obj/machinery/proc/spawn_frame(disassembled) var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(loc) . = M - M.anchored = anchored + M.set_anchored(anchored) if(!disassembled) M.obj_integrity = M.max_integrity * 0.5 //the frame is already half broken transfer_fingerprints_to(M) diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index 9d9bdaad998..ed90efc5d8e 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -26,7 +26,7 @@ if(do_after(user, 30 * I.toolspeed * gettoolspeedmod(user), target = src)) var/obj/machinery/mass_driver_frame/F = new(get_turf(src)) F.dir = dir - F.anchored = TRUE + F.set_anchored(TRUE) F.build = 4 F.update_icon() qdel(src) @@ -101,7 +101,7 @@ if(do_after(user, 10 * W.toolspeed * gettoolspeedmod(user), target = src) && (build == 0)) add_fingerprint(user) to_chat(user, span_notice("You anchor \the [src]!")) - anchored = TRUE + set_anchored(TRUE) build++ return 1 return @@ -112,7 +112,7 @@ if(do_after(user, 10 * W.toolspeed * gettoolspeedmod(user), target = src) && (build == 1)) add_fingerprint(user) build-- - anchored = FALSE + set_anchored(FALSE) to_chat(user, span_notice("You de-anchored \the [src]!")) return 1 if(2) // Welded to the floor diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index b3231773dbb..2fa45d707d7 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -111,7 +111,7 @@ "[user] unfastens \the [src].", \ span_notice("You have unfastened \the [src]. Now it can be pulled somewhere else."), \ "You hear ratchet.") - anchored = FALSE + set_anchored(FALSE) stat |= MAINT unwrenched = 1 if(usr.machine==src) @@ -124,7 +124,7 @@ "[user] fastens \the [src].", \ span_notice("You have fastened \the [src]. Now it can dispense pipes."), \ "You hear ratchet.") - anchored = TRUE + set_anchored(TRUE) stat &= ~MAINT unwrenched = 0 power_change() diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index c2edb280932..203a4f4021e 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -354,7 +354,7 @@ GLOBAL_LIST_EMPTY(turret_icons) //This code handles moving the turret around. After all, it's a portable turret! add_fingerprint(user) playsound(loc, I.usesound, 100, TRUE) - anchored = !anchored + set_anchored(!anchored) update_icon(UPDATE_ICON_STATE) to_chat(user, "You [anchored ? "" : "un"]secure the exterior bolts on the turret.") wrenching = FALSE @@ -804,7 +804,7 @@ GLOBAL_LIST_EMPTY(turret_icons) add_fingerprint(user) playsound(loc, I.usesound, 100, 1) to_chat(user, span_notice("You secure the external bolts.")) - anchored = TRUE + set_anchored(TRUE) build_step = 1 return @@ -831,7 +831,7 @@ GLOBAL_LIST_EMPTY(turret_icons) add_fingerprint(user) playsound(loc, I.usesound, 75, 1) to_chat(user, span_notice("You unfasten the external bolts.")) - anchored = FALSE + set_anchored(FALSE) build_step = 0 return diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index a1c0b6315a8..b5ef1d595ee 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -152,7 +152,7 @@ return //If it's already turned on, how did this get called? active = 1 - anchored = TRUE + set_anchored(TRUE) update_icon(UPDATE_ICON_STATE) for(var/turf/target_tile in range(2, src)) @@ -289,12 +289,12 @@ if(active) visible_message(span_warning("[src] shuts off!")) shields_down() - anchored = FALSE + set_anchored(FALSE) else if(istype(get_turf(src), /turf/space)) return //No wrenching these in space! WRENCH_ANCHOR_MESSAGE - anchored = TRUE + set_anchored(TRUE) /obj/machinery/shieldgen/update_icon_state() @@ -475,7 +475,7 @@ state = 1 playsound(loc, I.usesound, 75, 1) to_chat(user, "You secure the external reinforcing bolts to the floor.") - anchored = TRUE + set_anchored(TRUE) return else if(state == 1) @@ -483,7 +483,7 @@ state = 0 playsound(loc, I.usesound, 75, 1) to_chat(user, "You undo the external reinforcing bolts.") - anchored = FALSE + set_anchored(FALSE) return if(I.GetID() || ispda(I)) diff --git a/code/game/machinery/snow_machine.dm b/code/game/machinery/snow_machine.dm index 8574f2b608d..c83524d5758 100644 --- a/code/game/machinery/snow_machine.dm +++ b/code/game/machinery/snow_machine.dm @@ -57,7 +57,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) to_chat(user, span_notice("You [anchored ? "tighten" : "loosen"] [src]'s wheels.")) turn_on_or_off(FALSE) diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index d230bb618f5..9a7a3844bf8 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -165,7 +165,7 @@ if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return if(anchored) - anchored = FALSE + set_anchored(FALSE) to_chat(user, span_notice("You unscrew the beacon from the floor.")) disconnect_from_network() return @@ -173,7 +173,7 @@ if(!connect_to_network()) to_chat(user, "This device must be placed over an exposed cable.") return - anchored = TRUE + set_anchored(TRUE) to_chat(user, span_notice("You screw the beacon to the floor and attach the cable.")) /obj/machinery/power/singularity_beacon/Destroy() diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 6a21f1fbabc..ea57a61cb16 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -138,13 +138,13 @@ to_chat(user, span_notice("The bomb must be placed on solid ground to attach it.")) else WRENCH_ANCHOR_MESSAGE - anchored = TRUE + set_anchored(TRUE) if(active) to_chat(user, span_notice("The bolts lock in place.")) else if(!active) WRENCH_UNANCHOR_MESSAGE - anchored = FALSE + set_anchored(FALSE) else to_chat(user, span_warning("The bolts are locked down!")) diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 180a1ec69eb..45f6d566c30 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -25,16 +25,16 @@ if(!O.anchored) if(length(chassis.cargo) < chassis.cargo_capacity) chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.") - O.anchored = TRUE + O.set_anchored(TRUE) if(do_after_cooldown(target)) LAZYADD(chassis.cargo, O) O.loc = chassis - O.anchored = FALSE + O.set_anchored(FALSE) occupant_message(span_notice("[target] successfully loaded.")) log_message("Loaded [O]. Cargo compartment capacity: [chassis.cargo_capacity - length(chassis.cargo)]") return TRUE else - O.anchored = initial(O.anchored) + O.set_anchored(initial(O.anchored)) else occupant_message(span_warning("Not enough room in cargo compartment!")) else @@ -59,16 +59,16 @@ if(!M.anchored) if(length(chassis.cargo) < chassis.cargo_capacity) chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.") - M.anchored = TRUE + M.set_anchored(TRUE) if(do_after_cooldown(target)) LAZYADD(chassis.cargo, M) M.loc = chassis - M.anchored = FALSE + M.set_anchored(FALSE) occupant_message(span_notice("[target] successfully loaded.")) log_message("Loaded [M]. Cargo compartment capacity: [chassis.cargo_capacity - length(chassis.cargo)]") return TRUE else - M.anchored = initial(M.anchored) + M.set_anchored(initial(M.anchored)) else occupant_message(span_warning("Not enough room in cargo compartment!")) else diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6366f15f6ad..b0fcf0c41e4 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -477,7 +477,6 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/g if(TR.use(1)) to_chat(user, "You apply some tape to [src].") AddComponent(/datum/component/ducttape, src, user, x_offset, y_offset) - anchored = TRUE user.transfer_fingerprints_to(src) else to_chat(user, "You don't have enough tape to do that!") diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 34a63fa4b6b..afc1f51d5ef 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -41,7 +41,7 @@ attached = null if(mode == OPERATING) STOP_PROCESSING(SSobj, src) - anchored = FALSE + set_anchored(FALSE) density = FALSE if(CLAMPED_OFF) @@ -49,14 +49,14 @@ return if(mode == OPERATING) STOP_PROCESSING(SSobj, src) - anchored = TRUE + set_anchored(TRUE) density = TRUE if(OPERATING) if(!attached) return START_PROCESSING(SSobj, src) - anchored = TRUE + set_anchored(TRUE) density = TRUE mode = value diff --git a/code/game/objects/items/stacks/stack_recipe.dm b/code/game/objects/items/stacks/stack_recipe.dm index 994874d2008..4ff1b97e930 100644 --- a/code/game/objects/items/stacks/stack_recipe.dm +++ b/code/game/objects/items/stacks/stack_recipe.dm @@ -60,7 +60,7 @@ else if(istype(result, /obj/structure/window)) var/obj/structure/window/W = result W.ini_dir = W.dir - W.anchored = FALSE + W.set_anchored(FALSE) W.state = WINDOW_OUT_OF_FRAME /* diff --git a/code/game/objects/items/weapons/grenades/ghettobomb.dm b/code/game/objects/items/weapons/grenades/ghettobomb.dm index 4f042afd323..061b6e62c3e 100644 --- a/code/game/objects/items/weapons/grenades/ghettobomb.dm +++ b/code/game/objects/items/weapons/grenades/ghettobomb.dm @@ -107,7 +107,7 @@ if(do_after(user, 50 * toolspeed * gettoolspeedmod(user), target = T)) if(!user.drop_transfer_item_to_loc(src, user.loc)) return - anchored = TRUE + set_anchored(TRUE) target = T pixel_w = (T.x - x)*32 @@ -169,7 +169,7 @@ pixel_z = 0 to_chat(user, span_notice("You unattached [src].")) layer = TURF_LAYER - anchored = FALSE + set_anchored(FALSE) update_icon(UPDATE_ICON_STATE) target = null diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index 6ba6f0c6fb7..dc1c30cb8ee 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -415,11 +415,11 @@ /obj/item/storage/backpack/satchel_flat/hide(intact) if(intact) invisibility = INVISIBILITY_MAXIMUM - anchored = TRUE //otherwise you can start pulling, cover it, and drag around an invisible backpack. + set_anchored(TRUE) //otherwise you can start pulling, cover it, and drag around an invisible backpack. icon_state = "[initial(icon_state)]2" else invisibility = initial(invisibility) - anchored = FALSE + set_anchored(FALSE) icon_state = initial(icon_state) /obj/item/storage/backpack/satchel_flat/populate_contents() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index ae12bcd4ff0..a8f53ddccb3 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -234,7 +234,7 @@ to_chat(user, "Now [anchored ? "un" : ""]securing [name].") if(I.use_tool(src, user, time, volume = I.tool_volume)) to_chat(user, "You've [anchored ? "un" : ""]secured [name].") - anchored = !anchored + set_anchored(!anchored) return TRUE return FALSE diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index fbde813eae2..ab310be0070 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -13,12 +13,10 @@ var/intialOxy = 0 var/timer = 240 //eventually the person will be freed -/obj/structure/closet/statue/Initialize(mapload, var/mob/living/L) +/obj/structure/closet/statue/Initialize(mapload, mob/living/L) . = ..() if(ishuman(L) || iscorgi(L)) - if(L.buckled) - L.buckled = 0 - L.anchored = FALSE + L.buckled?.unbuckle_mob(L, force = TRUE) L.forceMove(src) ADD_TRAIT(L, TRAIT_MUTE, "statue") max_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm index 629f4b052ab..48e83e53fe4 100644 --- a/code/game/objects/structures/curtains.dm +++ b/code/game/objects/structures/curtains.dm @@ -52,12 +52,12 @@ if(anchored) user.visible_message("[user] unscrews [src] from the floor.", "You start to unscrew [src] from the floor...", "You hear rustling noises.") if(I.use_tool(src, user, 50, volume = I.tool_volume) && anchored) - anchored = FALSE + set_anchored(FALSE) to_chat(user, "You unscrew [src] from the floor.") else user.visible_message("[user] screws [src] to the floor.", "You start to screw [src] to the floor...", "You hear rustling noises.") if(I.use_tool(src, user, 50, volume = I.tool_volume) && !anchored) - anchored = TRUE + set_anchored(TRUE) to_chat(user, "You screw [src] to the floor.") diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 4831618bfb7..4d506f3441a 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -275,7 +275,7 @@ if(!I.use_tool(src, user, 40, volume = I.tool_volume) || state != AIRLOCK_ASSEMBLY_NEEDS_WIRES) return to_chat(user, "You [anchored ? "un" : ""]secure the airlock assembly.") - anchored = !anchored + set_anchored(!anchored) /obj/structure/door_assembly/welder_act(mob/user, obj/item/I) . = TRUE diff --git a/code/game/objects/structures/engicart.dm b/code/game/objects/structures/engicart.dm index fba6f2a5f5b..0f80b916e61 100644 --- a/code/game/objects/structures/engicart.dm +++ b/code/game/objects/structures/engicart.dm @@ -97,14 +97,14 @@ "[user] tightens \the [src]'s casters.", \ " You have tightened \the [src]'s casters.", \ "You hear ratchet.") - anchored = TRUE + set_anchored(TRUE) else if(anchored) playsound(src.loc, I.usesound, 50, 1) user.visible_message( \ "[user] loosens \the [src]'s casters.", \ " You have loosened \the [src]'s casters.", \ "You hear ratchet.") - anchored = FALSE + set_anchored(FALSE) else to_chat(usr, "You cannot interface your modules [src]!") diff --git a/code/game/objects/structures/foodcart.dm b/code/game/objects/structures/foodcart.dm index 0abbccffb8d..bc7ccf81827 100644 --- a/code/game/objects/structures/foodcart.dm +++ b/code/game/objects/structures/foodcart.dm @@ -62,14 +62,14 @@ "[user] tightens \the [src]'s casters.", \ " You have tightened \the [src]'s casters.", \ "You hear ratchet.") - anchored = TRUE + set_anchored(TRUE) else if(anchored) playsound(src.loc, I.usesound, 50, 1) user.visible_message( \ "[user] loosens \the [src]'s casters.", \ " You have loosened \the [src]'s casters.", \ "You hear ratchet.") - anchored = FALSE + set_anchored(FALSE) else to_chat(usr, "You cannot interface your modules [src]!") diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index da5596692f8..46938a8c2af 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -190,7 +190,7 @@ return if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) user.visible_message("[user] [anchored ? "fastens" : "unfastens"] [src].", \ "You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.") @@ -239,7 +239,7 @@ S.use(1) W.setDir(dir_to_set) W.ini_dir = dir_to_set - W.anchored = FALSE + W.set_anchored(FALSE) W.state = WINDOW_OUT_OF_FRAME to_chat(user, "You place the [W] on [src].") W.update_nearby_icons() diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index 9106bf66cb6..eb37445dad3 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -213,7 +213,7 @@ current_action = NONE to_chat(user, "You [anchored ? "un" : ""]secure [src].") - anchored = !anchored + set_anchored(!anchored) playsound(src, 'sound/items/deconstruct.ogg', 50, 1) dir = SOUTH diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index ced660b34c8..def8387fc21 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -101,14 +101,14 @@ "[user] tightens \the [src]'s casters.", \ " You have tightened \the [src]'s casters.", \ "You hear ratchet.") - anchored = TRUE + set_anchored(TRUE) else if(anchored) playsound(src.loc, I.usesound, 50, 1) user.visible_message( \ "[user] loosens \the [src]'s casters.", \ " You have loosened \the [src]'s casters.", \ "You hear ratchet.") - anchored = FALSE + set_anchored(FALSE) else if(mybag) add_fingerprint(user) mybag.attackby(I, user, params) diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index 58764470efb..bc36fd45347 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -15,10 +15,10 @@ add_fingerprint(user) if(anchored) to_chat(user, "You unwrench [src] from the floor.") - anchored = FALSE + set_anchored(FALSE) else to_chat(user, "You wrench [src] into place.") - anchored = TRUE + set_anchored(TRUE) else if(istype(I, /obj/item/stack/rods)) var/obj/item/stack/rods/R = I if(R.get_amount() >= 4) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index f71c958704d..6f61be3e554 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -27,14 +27,14 @@ if(!I.use_tool(src, user, 180, volume = I.tool_volume) || state != PLASTIC_FLAPS_NORMAL) return state = PLASTIC_FLAPS_DETACHED - anchored = FALSE + set_anchored(FALSE) to_chat(user, "You unscrew [src] from the floor.") else if(state == PLASTIC_FLAPS_DETACHED) user.visible_message("[user] starts screwing [src] to the floor.", "You start to screw [src] to the floor...", "You hear rustling noises.") if(!I.use_tool(src, user, 40, volume = I.tool_volume) || state != PLASTIC_FLAPS_DETACHED) return state = PLASTIC_FLAPS_NORMAL - anchored = TRUE + set_anchored(TRUE) to_chat(user, "You screw [src] to the floor.") /obj/structure/plasticflaps/welder_act(mob/user, obj/item/I) diff --git a/code/game/objects/structures/railings.dm b/code/game/objects/structures/railings.dm index d071089ea1e..2e30afe07bb 100644 --- a/code/game/objects/structures/railings.dm +++ b/code/game/objects/structures/railings.dm @@ -55,7 +55,7 @@ return to_chat(user, "You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...") if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_anchored), anchored))) - anchored = !anchored + set_anchored(!anchored) to_chat(user, "You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor.") return TRUE @@ -160,7 +160,7 @@ icon_state = "railing_wood" resistance_flags = FLAMMABLE climbable = TRUE - can_be_unanchored = 1 + can_be_unanchored = TRUE flags = ON_BORDER buildstacktype = /obj/item/stack/sheet/wood buildstackamount = 5 diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm index c39bf139cd5..77b8a1ab889 100644 --- a/code/game/objects/structures/reflector.dm +++ b/code/game/objects/structures/reflector.dm @@ -92,13 +92,13 @@ if(!I.use_tool(src, user, 20, volume = I.tool_volume)) return WELDER_FLOOR_SLICE_SUCCESS_MESSAGE - anchored = FALSE + set_anchored(FALSE) else WELDER_ATTEMPT_FLOOR_WELD_MESSAGE if(!I.use_tool(src, user, 20, volume = I.tool_volume)) return WELDER_FLOOR_WELD_SUCCESS_MESSAGE - anchored = TRUE + set_anchored(TRUE) /obj/structure/reflector/proc/get_reflection(srcdir,pdir) return 0 diff --git a/code/game/objects/structures/stairs.dm b/code/game/objects/structures/stairs.dm index f28ecf57d5f..515f26e5d43 100644 --- a/code/game/objects/structures/stairs.dm +++ b/code/game/objects/structures/stairs.dm @@ -165,10 +165,10 @@ if(!I.use_tool(src, user, 3 SECONDS, volume = I.tool_volume)) return TRUE if(anchored) - anchored = FALSE + set_anchored(FALSE) playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE) return TRUE - anchored = TRUE + set_anchored(TRUE) playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE) return TRUE diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index f5388c5a97d..e897aa50d44 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -35,10 +35,10 @@ /obj/structure/chair/buckle_mob(mob/living/M, force, check_loc) . = ..() if(. && !movable) - anchored = TRUE + set_anchored(TRUE) /obj/structure/chair/unbuckle_mob(mob/living/buckled_mob, force, can_fall) - anchored = initial(anchored) + set_anchored(initial(anchored)) . = ..() /obj/structure/chair/attackby(obj/item/W as obj, mob/user as mob, params) diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 13d92ab5548..c1ecd9e8c93 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -107,10 +107,10 @@ add_fingerprint(user) if(anchored) to_chat(user, "You lean down and unwrench [src].") - anchored = FALSE + set_anchored(FALSE) else to_chat(user, "You wrench [src] into place.") - anchored = TRUE + set_anchored(TRUE) return return ..() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 27febace5d5..ffd70ac4852 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -157,14 +157,14 @@ if(!loc || !anchored) return user.visible_message("[user] disconnects [src]!", "You disconnect [src]!") - anchored = FALSE + set_anchored(FALSE) if("Connect") user.visible_message("[user] starts connecting [src].", "You begin connecting [src]...") if(I.use_tool(src, user, 40, volume = I.tool_volume)) if(!loc || anchored) return user.visible_message("[user] connects [src]!", "You connect [src]!") - anchored = TRUE + set_anchored(TRUE) if("Rotate") var/list/dir_choices = list("North" = NORTH, "East" = EAST, "South" = SOUTH, "West" = WEST) var/selected = input(user,"Select a direction for the connector.", "Connector Direction") in dir_choices @@ -269,7 +269,7 @@ if(!loc || !anchored) return user.visible_message("[user] disconnects [src]!", "You disconnect [src]!") - anchored = FALSE + set_anchored(FALSE) pixel_x = 0 pixel_y = 0 else @@ -278,7 +278,7 @@ if(!loc || anchored) return user.visible_message("[user] connects [src]!", "You connect [src]!") - anchored = TRUE + set_anchored(TRUE) pixel_x = 0 pixel_y = 32 @@ -632,14 +632,14 @@ if(!loc || !anchored) return user.visible_message("[user] disconnects [src]!", "You disconnect [src]!") - anchored = FALSE + set_anchored(FALSE) if("Connect") user.visible_message("[user] starts connecting [src].", "You begin connecting [src]...") if(I.use_tool(src, user, 40, volume = I.tool_volume)) if(!loc || anchored) return user.visible_message("[user] connects [src]!", "You connect [src]!") - anchored = TRUE + set_anchored(TRUE) if("Rotate") var/list/dir_choices = list("North" = NORTH, "East" = EAST, "South" = SOUTH, "West" = WEST) var/selected = input(user, "Select a direction for the connector.", "Connector Direction") in dir_choices @@ -763,7 +763,7 @@ if(do_after(user, 30, target = user)) user.visible_message("[user] finishes building a new [result_name]!", "You finish building a new [result_name]!") var/obj/structure/S = new result(T) - S.anchored = FALSE + S.set_anchored(FALSE) S.dir = user.dir S.update_icon(UPDATE_ICON_STATE) user.temporarily_remove_item_from_inventory(src, force = TRUE) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 0868e2b7545..68922053de3 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -268,14 +268,14 @@ to_chat(user, "There is already a windoor in that location!") return to_chat(user, "You tighten bolts on [src].") - anchored = TRUE + set_anchored(TRUE) name = "[(src.secure) ? "secure" : ""] anchored windoor assembly" else //Unwrenching an unsecure assembly un-anchors it. Step 4 undone user.visible_message("[user] begin loosening the bolts on [src]...", "You begin loosening the bolts on [src]...") if(!I.use_tool(src, user, 40, volume = I.tool_volume) || !anchored || state != "01") return to_chat(user, "You loosen bolts on [src].") - anchored = FALSE + set_anchored(FALSE) name = "[(src.secure) ? "secure" : ""] windoor assembly" update_icon(UPDATE_ICON_STATE) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 5981f4fabe5..e7c523bb15f 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -277,7 +277,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", to_chat(user, "You begin to [anchored ? "unscrew the frame from":"screw the frame to"] the floor...") if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored))) return - anchored = !anchored + set_anchored(!anchored) air_update_turf(TRUE) update_nearby_icons() to_chat(user, "You [anchored ? "fasten the frame to":"unfasten the frame from"] the floor.") @@ -287,7 +287,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", to_chat(user, "You begin to [anchored ? "unscrew the window from":"screw the window to"] the floor...") if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, PROC_REF(check_anchored), anchored))) return - anchored = !anchored + set_anchored(!anchored) air_update_turf(TRUE) update_nearby_icons() to_chat(user, "You [anchored ? "fasten the window to":"unfasten the window from"] the floor.") diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 8e3afe1025d..10d75a0ed08 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -275,7 +275,7 @@ visuals.desc = "Looks hot." visuals.icon = 'icons/effects/fire.dmi' visuals.icon_state = "2" - visuals.anchored = TRUE + visuals.set_anchored(TRUE) visuals.density = TRUE visuals.layer = FLY_LAYER diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 68a5a4d8380..564775e4fd8 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -691,7 +691,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) F.active = 1 F.state = 2 F.power = 250 - F.anchored = TRUE + F.set_anchored(TRUE) F.warming_up = 3 F.start_fields() F.update_icon() diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm index 85430bbdca4..e744d69ea88 100644 --- a/code/modules/admin/verbs/freeze.dm +++ b/code/modules/admin/verbs/freeze.dm @@ -41,7 +41,7 @@ GLOBAL_LIST_EMPTY(frozen_atom_list) // A list of admin-frozen atoms. if(skip_overlays) add_overlay(AO) - anchored = TRUE + set_anchored(TRUE) canmove = FALSE admin_prev_sleeping = AmountSleeping() PermaSleeping() @@ -53,7 +53,7 @@ GLOBAL_LIST_EMPTY(frozen_atom_list) // A list of admin-frozen atoms. if(skip_overlays) cut_overlay(frozen) - anchored = FALSE + set_anchored(FALSE) canmove = TRUE frozen = null SetSleeping(admin_prev_sleeping, TRUE) diff --git a/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm b/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm index 7ab0d23e1d0..6c213b2516c 100644 --- a/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm +++ b/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm @@ -518,7 +518,7 @@ var/atom/movable/overlay/animation = new /atom/movable/overlay(originalloc) animation.name = "water" animation.density = FALSE - animation.anchored = TRUE + animation.set_anchored(TRUE) animation.icon = 'icons/mob/mob.dmi' animation.icon_state = "liquify" animation.layer = 5 @@ -628,7 +628,7 @@ var/atom/movable/overlay/animation = new /atom/movable/overlay(get_turf(user)) animation.name = user.name animation.density = FALSE - animation.anchored = TRUE + animation.set_anchored(TRUE) animation.icon = user.icon animation.alpha = 127 animation.layer = 5 diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm index ed430b6175b..e0316a5a52e 100644 --- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm +++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm @@ -73,7 +73,7 @@ connected_port.build_network() connected_port.parent.reconcile_air() - anchored = TRUE //Prevent movement + set_anchored(TRUE) //Prevent movement return TRUE @@ -81,7 +81,7 @@ if(!connected_port) return FALSE - anchored = FALSE + set_anchored(FALSE) connected_port.connected_device = null connected_port = null diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index da0b72fc344..110a33def99 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -199,7 +199,7 @@ return if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) to_chat(user, span_notice("You [anchored ? "wrench" : "unwrench"] [src].")) /obj/machinery/portable_atmospherics/scrubber/huge/stationary diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm index 0d02f977481..71e37873cdb 100644 --- a/code/modules/food_and_drinks/drinks/bottler/bottler.dm +++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm @@ -93,7 +93,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) if(anchored) WRENCH_ANCHOR_MESSAGE else diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index c3a1249538b..b0126f198b2 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -212,14 +212,14 @@ holder.pixel_x = 2 holder.loc = get_turf(src) holder.layer = MOB_LAYER //simulate mob-like layering - holder.anchored = TRUE + holder.set_anchored(TRUE) var/atom/movable/holder2 = new //holder for gibber overlay, used to simulate 3D effect holder2.name = null holder2.add_overlay(gibberoverlay) holder2.loc = get_turf(src) holder2.layer = MOB_LAYER + 0.1 //3D, it's above the mob, rest of the gibber is behind - holder2.anchored = TRUE + holder2.set_anchored(TRUE) animate(holder, pixel_y = 16, time = animation_delay) //animate going down diff --git a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm index ae91aab6c56..df8bc171b63 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm @@ -74,14 +74,12 @@ if(!broken && O.tool_behaviour == TOOL_WRENCH) add_fingerprint(user) playsound(src, O.usesound, 50, 1) + set_anchored(!anchored) if(anchored) - anchored = FALSE - to_chat(user, "\The [src] can now be moved.") - return - else if(!anchored) - anchored = TRUE to_chat(user, "\The [src] is now secured.") - return + else + to_chat(user, "\The [src] can now be moved.") + return if(default_deconstruction_crowbar(user, O)) return diff --git a/code/modules/holiday/new_year.dm b/code/modules/holiday/new_year.dm index f62153f7ac4..55cf9c22567 100644 --- a/code/modules/holiday/new_year.dm +++ b/code/modules/holiday/new_year.dm @@ -21,7 +21,7 @@ /obj/structure/garland/wrench_act(mob/living/user, obj/item/wrench/I) . = ..() I.play_tool_sound(src, I.tool_volume) - anchored = !anchored + set_anchored(!anchored) to_chat(user, span_notice("You [anchored ? "un" : ""]wrenched [src]")) /obj/structure/garland/attackby(obj/item/P, mob/user, params) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 0e8815db190..eb90045b7dd 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -933,7 +933,7 @@ if(I.use_tool(src, user, 20, volume = I.tool_volume)) if(anchored) return - anchored = TRUE + set_anchored(TRUE) user.visible_message("[user] wrenches [src] into place.", \ "You wrench [src] in place.") else if(anchored) @@ -942,7 +942,7 @@ if(I.use_tool(src, user, 20, volume = I.tool_volume)) if(!anchored) return - anchored = FALSE + set_anchored(FALSE) user.visible_message("[user] unwrenches [src].", \ "You unwrench [src].") diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 3f2e15fa28b..a26f5922b8c 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -88,9 +88,9 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) if(isliving(A)) var/mob/living/M = A M.Weaken(32 SECONDS) // Keep them from moving during the duration of the extraction - M.buckled = 0 // Unbuckle them to prevent anchoring problems + M.buckled?.unbuckle_mob(force = TRUE) // Unbuckle them to prevent anchoring problems else - A.anchored = TRUE + A.set_anchored(TRUE) A.density = FALSE var/obj/effect/extraction_holder/holder_obj = new(A.loc) holder_obj.appearance = A.appearance @@ -146,7 +146,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) holder_obj.add_overlay(balloon3) sleep(4) holder_obj.cut_overlay(balloon3) - A.anchored = FALSE // An item has to be unanchored to be extracted in the first place. + A.set_anchored(FALSE) // An item has to be unanchored to be extracted in the first place. A.density = initial(A.density) animate(holder_obj, pixel_z = 0, time = 5) sleep(5) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 488e42f392d..1a50523ff57 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -139,7 +139,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( aiPDA = new/obj/item/pda/silicon/ai(src) rename_character(null, pickedName) - anchored = TRUE + set_anchored(TRUE) canmove = FALSE density = 1 loc = loc @@ -615,9 +615,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( return // stop if(anchored) - anchored = FALSE + set_anchored(FALSE) else - anchored = TRUE + set_anchored(TRUE) to_chat(src, "[anchored ? "You are now anchored." : "You are now unanchored."]") @@ -1251,7 +1251,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( user.visible_message("\The [user] decides not to unbolt \the [src].") return user.visible_message("\The [user] finishes unfastening \the [src]!") - anchored = FALSE + set_anchored(FALSE) return else user.visible_message("\The [user] starts to bolt \the [src] to the plating...") @@ -1259,7 +1259,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( user.visible_message("\The [user] decides not to bolt \the [src].") return user.visible_message("\The [user] finishes fastening down \the [src]!") - anchored = TRUE + set_anchored(TRUE) return else return ..() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 34e12a97161..9210219e934 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -501,7 +501,7 @@ pulse2.icon = 'icons/effects/effects.dmi' pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" - pulse2.anchored = TRUE + pulse2.set_anchored(TRUE) pulse2.dir = pick(GLOB.cardinal) QDEL_IN(pulse2, 10) diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index 5e464b20329..3f55574168c 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -191,7 +191,7 @@ /mob/living/simple_animal/bot/cleanbot/proc/start_clean(obj/effect/decal/cleanable/target) - anchored = TRUE + set_anchored(TRUE) visible_message(span_notice("[src] begins to clean up [target]")) mode = BOT_CLEANING update_icon() @@ -203,7 +203,7 @@ return if(mode == BOT_CLEANING) QDEL_NULL(target) - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE update_icon() diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index b3b7495944f..2b80f0f8288 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -110,7 +110,7 @@ ..() target = null oldtarget_name = null - anchored = FALSE + set_anchored(FALSE) walk_to(src,0) set_path(null) last_found = world.time @@ -298,7 +298,7 @@ stun_attack(target) if(!lasercolor) mode = BOT_PREP_ARREST - anchored = TRUE + set_anchored(TRUE) target_lastloc = target.loc return else @@ -338,7 +338,7 @@ if(BOT_ARREST) if(!target) - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE last_found = world.time frustration = 0 @@ -353,7 +353,7 @@ return else mode = BOT_PREP_ARREST - anchored = FALSE + set_anchored(FALSE) if(BOT_START_PATROL) look_for_perp() @@ -365,7 +365,7 @@ /mob/living/simple_animal/bot/ed209/proc/back_to_idle() - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE target = null last_found = world.time @@ -374,7 +374,7 @@ /mob/living/simple_animal/bot/ed209/proc/back_to_hunt() - anchored = FALSE + set_anchored(FALSE) frustration = 0 mode = BOT_HUNT INVOKE_ASYNC(src, PROC_REF(handle_automated_action)) @@ -386,7 +386,7 @@ /mob/living/simple_animal/bot/ed209/proc/look_for_perp() if(disabled) return - anchored = FALSE + set_anchored(FALSE) threatlevel = 0 for(var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal if((C.stat) || (C.handcuffed)) @@ -520,7 +520,7 @@ pulse2.icon = 'icons/effects/effects.dmi' pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" - pulse2.anchored = TRUE + pulse2.set_anchored(TRUE) pulse2.dir = pick(GLOB.cardinal) QDEL_IN(pulse2, 1 SECONDS) var/list/mob/living/carbon/targets = new diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 8f9e83d5007..41efd278234 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -62,7 +62,7 @@ oldloc = null ignore_list.Cut() nagged = 0 - anchored = FALSE + set_anchored(FALSE) update_icon() @@ -143,7 +143,7 @@ if("emptynag") nag_on_empty = !nag_on_empty if("anchor") - anchored = !anchored + set_anchored(!anchored) if("bridgemode") var/setdir = input("Select construction direction:") as null|anything in list("north","east","south","west","disable") @@ -230,7 +230,7 @@ repair(target) else if(emagged == 2 && isfloorturf(target)) var/turf/simulated/floor/F = target - anchored = TRUE + set_anchored(TRUE) mode = BOT_REPAIRING if(prob(90)) F.break_tile_to_plating() @@ -267,7 +267,7 @@ if(QDELETED(src)) return amount++ - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE target = null @@ -295,11 +295,11 @@ if(HULL_BREACH) //The most common job, patching breaches in the station's hull. if(is_hull_breach(scan_target)) //Ensure that the targeted space turf is actually part of the station, and not random space. result = scan_target - anchored = TRUE //Prevent the floorbot being blown off-course while trying to reach a hull breach. + set_anchored(TRUE) //Prevent the floorbot being blown off-course while trying to reach a hull breach. if(BRIDGE_MODE) //Only space turfs in our chosen direction are considered. if(get_dir(src, scan_target) == targetdirection) result = scan_target - anchored = TRUE + set_anchored(TRUE) if(REPLACE_TILE) F = scan_target if(istype(F, /turf/simulated/floor/plating)) //The floor must not already have a tile. @@ -332,7 +332,7 @@ target = null return - anchored = TRUE + set_anchored(TRUE) if(isspaceturf(target_turf)) //If we are fixing an area not part of pure space, it is visible_message(span_notice("[targetdirection ? "[src] begins installing a bridge plating." : "[src] begins to repair the hole."]")) @@ -357,7 +357,7 @@ mode = BOT_IDLE amount-- update_icon() - anchored = FALSE + set_anchored(FALSE) target = null @@ -371,7 +371,7 @@ mode = BOT_IDLE amount-- update_icon() - anchored = FALSE + set_anchored(FALSE) target = null diff --git a/code/modules/mob/living/simple_animal/bot/griefsky.dm b/code/modules/mob/living/simple_animal/bot/griefsky.dm index c68d1031fc2..3493c236d7a 100644 --- a/code/modules/mob/living/simple_animal/bot/griefsky.dm +++ b/code/modules/mob/living/simple_animal/bot/griefsky.dm @@ -169,7 +169,7 @@ if(Adjacent(target) && isturf(target.loc)) // if right next to perp target_lastloc = target.loc sword_attack(target) - anchored = TRUE + set_anchored(TRUE) frustration++ return else // not next to perp @@ -197,7 +197,7 @@ /mob/living/simple_animal/bot/secbot/griefsky/look_for_perp() - anchored = FALSE + set_anchored(FALSE) for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal if((C.stat) || (C.handcuffed)) continue diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index 1c4ade06d56..8e69a759c4d 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -66,7 +66,7 @@ ..() target = null oldtarget_name = null - anchored = FALSE + set_anchored(FALSE) walk_to(src, 0) last_found = world.time spam_flag = FALSE @@ -234,7 +234,7 @@ if(threatlevel >= 6) set waitfor = 0 stun_attack(target) - anchored = FALSE + set_anchored(FALSE) target_lastloc = target.loc return else // not next to perp @@ -258,7 +258,7 @@ /mob/living/simple_animal/bot/honkbot/proc/back_to_idle() - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE target = null last_found = world.time @@ -267,14 +267,14 @@ /mob/living/simple_animal/bot/honkbot/proc/back_to_hunt() - anchored = FALSE + set_anchored(FALSE) frustration = 0 mode = BOT_HUNT INVOKE_ASYNC(src, PROC_REF(handle_automated_action)) // responds quickly /mob/living/simple_animal/bot/honkbot/proc/look_for_perp() - anchored = FALSE + set_anchored(FALSE) for(var/mob/living/carbon/C in view(7, src)) if((C.stat) || (C.handcuffed)) continue diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 87976de7206..cce4415761e 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -139,7 +139,7 @@ ..() target = null oldtarget_name = null - anchored = FALSE + set_anchored(FALSE) walk_to(src,0) set_path(null) last_found = world.time @@ -380,7 +380,7 @@ stun_attack(target) mode = BOT_PREP_ARREST - anchored = TRUE + set_anchored(TRUE) target_lastloc = target.loc return @@ -414,7 +414,7 @@ if(BOT_ARREST) if(!target) - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE last_found = world.time frustration = 0 @@ -429,7 +429,7 @@ return else //Try arresting again if the target escapes. mode = BOT_PREP_ARREST - anchored = FALSE + set_anchored(FALSE) if(BOT_START_PATROL) look_for_perp() @@ -441,7 +441,7 @@ /mob/living/simple_animal/bot/secbot/proc/back_to_idle() - anchored = FALSE + set_anchored(FALSE) mode = BOT_IDLE target = null last_found = world.time @@ -450,7 +450,7 @@ /mob/living/simple_animal/bot/secbot/proc/back_to_hunt() - anchored = FALSE + set_anchored(FALSE) frustration = 0 mode = BOT_HUNT INVOKE_ASYNC(src, PROC_REF(handle_automated_action)) @@ -460,7 +460,7 @@ * Look for a criminal in view of the bot. */ /mob/living/simple_animal/bot/secbot/proc/look_for_perp() - anchored = FALSE + set_anchored(FALSE) for(var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal if((C.stat) || (C.handcuffed)) continue diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm index 73ab2c522b5..dceb3ff8105 100644 --- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm @@ -352,7 +352,7 @@ H.invisibility = INVISIBILITY_MAXIMUM H.mouse_opacity = 0 H.density = FALSE - H.anchored = TRUE + H.set_anchored(TRUE) addtimer(CALLBACK(src, TYPE_PROC_REF(/mob/living/simple_animal/hostile/floor_cluwne, Kill), H), 100) H.visible_message("[src] pulls [H] under the floor!") else//some fuck pulled away our food @@ -389,7 +389,7 @@ H.invisibility = initial(H.invisibility) H.mouse_opacity = initial(H.mouse_opacity) H.density = initial(H.density) - H.anchored = initial(H.anchored) + H.set_anchored(initial(H.anchored)) eating = FALSE if(prob(2)) diff --git a/code/modules/paperwork/desk_bell.dm b/code/modules/paperwork/desk_bell.dm index 67ea39a9248..0d1ac0c9a14 100644 --- a/code/modules/paperwork/desk_bell.dm +++ b/code/modules/paperwork/desk_bell.dm @@ -38,13 +38,13 @@ if(over_object != user || user.incapacitated() || !ishuman(user)) return FALSE - anchored = FALSE + set_anchored(FALSE) if(user.put_in_hands(src, ignore_anim = FALSE)) add_fingerprint(user) user.visible_message(span_notice("[user] picks up [src].")) return TRUE - anchored = TRUE + set_anchored(TRUE) return FALSE @@ -78,12 +78,12 @@ user.visible_message("[user] begins securing [src]...", "You begin securing [src]...") if(!tool.use_tool(src, user, 3 SECONDS, volume = tool.tool_volume)) return - anchored = TRUE + set_anchored(TRUE) else user.visible_message("[user] begins unsecuring [src]...", "You begin unsecuring [src]...") if(!tool.use_tool(src, user, 3 SECONDS, volume = tool.tool_volume)) return - anchored = FALSE + set_anchored(FALSE) /// Check if the clapper breaks, and if it does, break it diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index e78bad5b286..b2e13969b68 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -54,7 +54,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) if(anchored) WRENCH_ANCHOR_MESSAGE else diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 27857d53fc3..26e3a532302 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -67,6 +67,7 @@ /obj/machinery/power/generator/power_change(forced = FALSE) if(!anchored) stat |= NOPOWER + update_icon(UPDATE_OVERLAYS) return if(!..()) return @@ -185,7 +186,7 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - anchored = !anchored + set_anchored(!anchored) if(!anchored) disconnect() power_change() diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index dd637ec2470..8c26adaca5b 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -297,7 +297,7 @@ to_chat(user, "You unsecure the generator from the floor.") playsound(src.loc, O.usesound, 50, 1) - anchored = !anchored + set_anchored(!anchored) else if(O.tool_behaviour == TOOL_SCREWDRIVER) panel_open = !panel_open diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index c15d84d47bb..021abdd7717 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -130,7 +130,7 @@ /obj/machinery/power/emitter/attack_animal(mob/living/simple_animal/M) if(ismegafauna(M) && anchored) state = 0 - anchored = FALSE + set_anchored(FALSE) M.visible_message("[M] rips [src] free from its moorings!") else ..() @@ -262,14 +262,14 @@ user.visible_message("[user.name] secures [name] to the floor.", \ "You secure the external reinforcing bolts to the floor.", \ "You hear a ratchet") - src.anchored = TRUE + set_anchored(TRUE) if(1) state = 0 playsound(loc, I.usesound, 75, 1) user.visible_message("[user.name] unsecures [name] reinforcing bolts from the floor.", \ "You undo the external reinforcing bolts.", \ "You hear a ratchet") - src.anchored = FALSE + set_anchored(FALSE) if(2) to_chat(user, "The [name] needs to be unwelded from the floor.") diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 9957329286f..0a02ba62419 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -95,7 +95,7 @@ field_generator power level display user.visible_message("[user.name] secures [name] to the floor.", \ "You secure the external reinforcing bolts to the floor.", \ "You hear ratchet.") - anchored = TRUE + set_anchored(TRUE) if(FG_SECURED) add_fingerprint(user) state = FG_UNSECURED @@ -103,7 +103,7 @@ field_generator power level display user.visible_message("[user.name] unsecures [name] reinforcing bolts from the floor.", \ "You undo the external reinforcing bolts.", \ "You hear ratchet.") - anchored = FALSE + set_anchored(FALSE) if(FG_WELDED) to_chat(user, "The [name] needs to be unwelded from the floor!") else @@ -135,7 +135,7 @@ field_generator power level display /obj/machinery/field/generator/attack_animal(mob/living/simple_animal/M) if(M.environment_smash & ENVIRONMENT_SMASH_RWALLS && active == FG_OFFLINE && state != FG_UNSECURED) state = FG_UNSECURED - anchored = FALSE + set_anchored(FALSE) M.visible_message("[M] rips [src] free from its moorings!") else ..() diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm index 3d2fed7cc41..4f94722eb82 100644 --- a/code/modules/power/singularity/generator.dm +++ b/code/modules/power/singularity/generator.dm @@ -24,7 +24,7 @@ /obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params) if(W.tool_behaviour == TOOL_WRENCH) add_fingerprint(user) - anchored = !anchored + set_anchored(!anchored) playsound(src.loc, W.usesound, 75, 1) if(anchored) user.visible_message("[user.name] secures [src.name] to the floor.", \ diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index 78921d257a6..709ae0d0ed5 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -222,11 +222,11 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return if(construction_state == ACCELERATOR_UNWRENCHED) - anchored = TRUE + set_anchored(TRUE) WRENCH_ANCHOR_MESSAGE construction_state = ACCELERATOR_WRENCHED else - anchored = FALSE + set_anchored(FALSE) WRENCH_UNANCHOR_MESSAGE construction_state = ACCELERATOR_UNWRENCHED update_icon(UPDATE_ICON_STATE) @@ -321,11 +321,11 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return if(construction_state == ACCELERATOR_UNWRENCHED) - anchored = TRUE + set_anchored(TRUE) WRENCH_ANCHOR_MESSAGE construction_state = ACCELERATOR_WRENCHED else - anchored = FALSE + set_anchored(FALSE) WRENCH_UNANCHOR_MESSAGE construction_state = ACCELERATOR_UNWRENCHED update_icon() diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 561897d3072..f9f808f12f5 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -46,7 +46,7 @@ if(!S) S = new /obj/item/solar_assembly(src) S.glass_type = /obj/item/stack/sheet/glass - S.anchored = TRUE + S.set_anchored(TRUE) S.loc = src if(S.glass_type == /obj/item/stack/sheet/rglass) //if the panel is in reinforced glass max_integrity *= 2 //this need to be placed here, because panels already on the map don't have an assembly linked to @@ -214,13 +214,13 @@ if(!anchored && isturf(loc)) if(W.tool_behaviour == TOOL_WRENCH) - anchored = TRUE + set_anchored(TRUE) user.visible_message("[user] wrenches the solar assembly into place.", "You wrench the solar assembly into place.") playsound(src.loc, W.usesound, 50, 1) return TRUE else if(W.tool_behaviour == TOOL_WRENCH) - anchored = FALSE + set_anchored(FALSE) user.visible_message("[user] unwrenches the solar assembly from its place.", "You unwrench the solar assembly from its place.") playsound(src.loc, W.usesound, 50, 1) return TRUE @@ -465,7 +465,7 @@ A.dir = dir A.circuit = M A.update_icon(UPDATE_ICON_STATE) - A.anchored = TRUE + A.set_anchored(TRUE) qdel(src) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 6d2299018a6..359b8f25636 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -357,7 +357,7 @@ if(istype(W,/obj/item/wrench)) //allows wrench/unwrench shards add_fingerprint(user) if(!anchored) - anchored = !anchored + set_anchored(TRUE) WRENCH_ANCHOR_MESSAGE playsound(src.loc,W.usesound, 75, 1) if(isrobot(user)) @@ -373,7 +373,7 @@ consume_wrench(W) user.visible_message("As [user] tighten bolts of \the [src] with \a [W] the tool disappears") else if (anchored) - anchored = !anchored + set_anchored(FALSE) WRENCH_UNANCHOR_MESSAGE playsound(src.loc,W.usesound, 75, 1) if(isrobot(user)) diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm index 02a179a487d..48761694eab 100644 --- a/code/modules/power/tracker.dm +++ b/code/modules/power/tracker.dm @@ -45,7 +45,7 @@ S = new /obj/item/solar_assembly(src) S.glass_type = /obj/item/stack/sheet/glass S.tracker = TRUE - S.anchored = TRUE + S.set_anchored(TRUE) S.forceMove(src) update_icon() diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 358e86b033a..50acc03a9ad 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -318,12 +318,11 @@ . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return + set_anchored(!anchored) if(anchored) - anchored = FALSE - WRENCH_UNANCHOR_MESSAGE - else if(!anchored) - anchored = TRUE WRENCH_ANCHOR_MESSAGE + else + WRENCH_UNANCHOR_MESSAGE /obj/machinery/chem_dispenser/attack_ai(mob/user) return attack_hand(user) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 0723c7f8d0a..396e71ddbc6 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -66,7 +66,7 @@ transfer_fingerprints_to(C) C.ptype = ptype C.update() - C.anchored = FALSE + C.set_anchored(FALSE) C.density = TRUE if(!QDELING(src)) qdel(src) @@ -217,7 +217,7 @@ var/obj/structure/disposalconstruct/C = new(loc) C.ptype = deconstructs_to C.update() - C.anchored = TRUE + C.set_anchored(TRUE) C.density = TRUE qdel(src) diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm index 70f1f7e2284..ff3f2bf274b 100644 --- a/code/modules/recycling/disposal/construction.dm +++ b/code/modules/recycling/disposal/construction.dm @@ -198,7 +198,7 @@ if(!pipe_check(user)) return if(anchored) - anchored = FALSE + set_anchored(FALSE) if(ispipe) level = 2 density = 0 @@ -206,7 +206,7 @@ density = 1 to_chat(user, "You detach the [nicetype] from the underfloor.") else - anchored = TRUE + set_anchored(TRUE) if(ispipe) level = 1 // We don't want disposal bins to disappear under the floors density = 0 diff --git a/code/modules/recycling/disposal/outlet.dm b/code/modules/recycling/disposal/outlet.dm index 5f5cb56899c..f05192559ec 100644 --- a/code/modules/recycling/disposal/outlet.dm +++ b/code/modules/recycling/disposal/outlet.dm @@ -74,7 +74,7 @@ var/obj/structure/disposalconstruct/C = new (src.loc) C.ptype = PIPE_DISPOSALS_OUTLET C.update() - C.anchored = TRUE + C.set_anchored(TRUE) C.density = TRUE transfer_fingerprints_to(C) qdel(src) @@ -96,6 +96,6 @@ transfer_fingerprints_to(C) C.ptype = PIPE_DISPOSALS_OUTLET C.update() - C.anchored = FALSE + C.set_anchored(FALSE) C.density = TRUE qdel(src) diff --git a/code/modules/recycling/disposal/pipe.dm b/code/modules/recycling/disposal/pipe.dm index 4fb413adb08..d4dcd013aaf 100644 --- a/code/modules/recycling/disposal/pipe.dm +++ b/code/modules/recycling/disposal/pipe.dm @@ -260,7 +260,7 @@ src.transfer_fingerprints_to(C) C.dir = dir C.density = FALSE - C.anchored = TRUE + C.set_anchored(TRUE) C.update() qdel(src) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index fcb614a04b0..3dbcf1a9f39 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -785,7 +785,7 @@ if(M in immune) continue M.notransform = 1 - M.anchored = TRUE + M.set_anchored(TRUE) if(istype(M, /mob/living/simple_animal/hostile)) var/mob/living/simple_animal/hostile/H = M H.AIStatus = AI_OFF @@ -813,7 +813,7 @@ /obj/effect/timestop/proc/unfreeze_mob(mob/living/M) M.notransform = 0 - M.anchored = FALSE + M.set_anchored(FALSE) if(istype(M, /mob/living/simple_animal/hostile)) var/mob/living/simple_animal/hostile/H = M H.AIStatus = initial(H.AIStatus) diff --git a/code/modules/spacepods/parts.dm b/code/modules/spacepods/parts.dm index edafdd18ebe..49309e261f4 100644 --- a/code/modules/spacepods/parts.dm +++ b/code/modules/spacepods/parts.dm @@ -76,7 +76,7 @@ playsound(get_turf(src), O.usesound, 50, 1) if(O.tool_behaviour == TOOL_WRENCH) to_chat(user, "You [!anchored ? "secure \the [src] in place." : "remove the securing bolts."]") - anchored = !anchored + set_anchored(!anchored) density = anchored playsound(get_turf(src), O.usesound, 50, 1) diff --git a/code/modules/station_goals/brs/brs_portable_scanner.dm b/code/modules/station_goals/brs/brs_portable_scanner.dm index bcb917aea8a..1d2e98bc5c3 100644 --- a/code/modules/station_goals/brs/brs_portable_scanner.dm +++ b/code/modules/station_goals/brs/brs_portable_scanner.dm @@ -239,7 +239,7 @@ if(scanner == src) continue if(scanner.anchored) - anchored = FALSE + set_anchored(FALSE) update_icon(UPDATE_ICON_STATE) return diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index 9c99ee3e4df..c9d971cd59d 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -149,13 +149,13 @@ GLOBAL_LIST_INIT(meteor_shields, list()) active = !active COOLDOWN_START(src, toggle_sat_cooldown, 1 SECONDS) if(active) - anchored = TRUE + set_anchored(TRUE) if(pulledby) pulledby.stop_pulling() animate(src, pixel_y = 2, time = 10, loop = -1) else animate(src, pixel_y = 0, time = 10) - anchored = FALSE + set_anchored(FALSE) update_icon(UPDATE_ICON_STATE) return TRUE