From effa98d9a3a39bd03b03a452010e14cb8d5c3218 Mon Sep 17 00:00:00 2001
From: Guti <32563288+TheCaramelion@users.noreply.github.com>
Date: Sun, 25 Feb 2024 20:54:39 +0100
Subject: [PATCH] Movable grand piano (#7832)
---
code/modules/instruments/stationary.dm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/code/modules/instruments/stationary.dm b/code/modules/instruments/stationary.dm
index 62e9d500dc..e745e67e8b 100644
--- a/code/modules/instruments/stationary.dm
+++ b/code/modules/instruments/stationary.dm
@@ -17,9 +17,27 @@
/obj/structure/musician/attack_hand(mob/M)
if(!M.IsAdvancedToolUser())
return
-
+
interact(M)
+// CHOMPAdd - Grand piano moving
+
+/obj/structure/musician/attackby(obj/item/weapon/W as obj, mob/user as mob)
+ if(W.has_tool_quality(TOOL_WRENCH))
+ playsound(src, W.usesound, 100, 1)
+ if(anchored)
+ user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
+ else
+ user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
+
+ if(do_after(user, 20 * W.toolspeed))
+ if(!src) return
+ to_chat(user, "You [anchored? "un" : ""]secured \the [src]!")
+ anchored = !anchored
+ return
+
+// CHOMPEnd
+
/obj/structure/musician/proc/should_stop_playing(mob/user)
if(!(anchored || can_play_unanchored))
return TRUE