Wrench interactions with closets migrated to wrench_act_secondary (#64724)

Backend cleanup of the code involving anchoring and unanchoring lockers.
Moved feedback to balloon alerts as well.
This commit is contained in:
Cameron!
2022-02-08 18:22:27 -03:00
committed by GitHub
parent c8a4fee9bc
commit 95dad15410
@@ -409,14 +409,6 @@
span_hear("You hear welding."))
log_game("[key_name(user)] [welded ? "welded":"unwelded"] closet [src] with [W] at [AREACOORD(src)]")
update_appearance()
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
if(isinspace() && !anchored)
return
set_anchored(!anchored)
W.play_tool_sound(src, 75)
user.visible_message(span_notice("[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
span_notice("You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground."), \
span_hear("You hear a ratchet."))
else if (can_install_electronics && istype(W, /obj/item/electronics/airlock)\
&& !secure && !electronics && !locked && (welded || !can_weld_shut) && !broken)
user.visible_message(span_notice("[user] installs the electronics into the [src]."),\
@@ -470,6 +462,18 @@
else
return FALSE
/obj/structure/closet/wrench_act_secondary(mob/living/user, obj/item/tool)
if(!anchorable)
balloon_alert(user, "no anchor bolts!")
return TRUE
if(isinspace() && !anchored) // We want to prevent anchoring a locker in space, but we should still be able to unanchor it there
balloon_alert(user, "nothing to anchor to!")
return TRUE
set_anchored(!anchored)
tool.play_tool_sound(src, 75)
user.balloon_alert_to_viewers("[anchored ? "anchored" : "unanchored"]")
return TRUE
/obj/structure/closet/proc/after_weld(weld_state)
return