From 01caa93c4add09a579143b8b9a04818d8a4baa4b Mon Sep 17 00:00:00 2001
From: Bokkiewokkie <43698041+Bokkiewokkie@users.noreply.github.com>
Date: Fri, 14 Jun 2024 22:21:05 +0200
Subject: [PATCH] Adds the ability to (de)construct pool ladders (#2660)
---
code/modules/pool/pool.dm | 86 ++++++++++++++++++++++++++-------------
1 file changed, 58 insertions(+), 28 deletions(-)
diff --git a/code/modules/pool/pool.dm b/code/modules/pool/pool.dm
index c8ae9c8606e..eb253ed709b 100644
--- a/code/modules/pool/pool.dm
+++ b/code/modules/pool/pool.dm
@@ -9,7 +9,7 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
*/
/obj/effect/overlay/poolwater
- name = "Pool water"
+ name = "pool water"
icon = 'icons/obj/pool.dmi'
icon_state = "water"
anchored = TRUE
@@ -17,7 +17,7 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/turf/open/indestructible/sound/pool
- name = "Swimming pool"
+ name = "swimming pool"
desc = "A fun place where you go to swim! Drag and drop yourself onto it to climb in..."
icon = 'icons/obj/pool.dmi'
icon_state = "pool"
@@ -111,6 +111,22 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
mood_change = -4
timeout = 4 MINUTES
+/turf/open/indestructible/sound/pool/attackby(obj/item/W, mob/user, params)
+ if(..())
+ return
+ if(!istype(W, /obj/item/stack/rods))
+ return
+ if(locate(/obj/structure/pool_ladder) in src)
+ return
+ if(!W.tool_use_check(user,10))
+ return
+ if(!istype(get_step(src,NORTH), /turf/open/indestructible/sound/pool)) //Ladders only face up, and no stacking!
+ balloon_alert(user, "You start installing a pool ladder...")
+ if(do_after(user, 5 SECONDS, target=src))
+ W.use(10)
+ new /obj/structure/pool_ladder(src)
+ return TRUE
+
/turf/open/indestructible/sound/pool/proc/splash(mob/user)
user.forceMove(src)
playsound(src, 'sound/effects/splosh.ogg', 100, 1) //Credit to hippiestation for this sound file!
@@ -162,7 +178,7 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
return TRUE
/obj/effect/turf_decal/pool
- name = "Pool siding"
+ name = "pool siding"
icon = 'icons/obj/pool.dmi'
icon_state = "poolborder"
@@ -175,16 +191,52 @@ Place a pool filter somewhere in the pool if you want people to be able to modif
//Pool machinery
/obj/structure/pool_ladder
- name = "Pool ladder"
- desc = "Click this to get out of a pool quickly."
+ name = "pool ladder"
+ desc = "A faster and safer way to leave the pool."
icon = 'icons/obj/pool.dmi'
icon_state = "ladder"
+ anchored = TRUE
pixel_y = 12
+/obj/structure/pool_ladder/examine(mob/user)
+ . = ..()
+ . += "There are bolts securing it to the side of the pool."
+
+/obj/structure/pool_ladder/wrench_act(mob/living/user, obj/item/I)
+ balloon_alert(user, "You start disassembling [src].")
+ if(I.use_tool(src, user, 5 SECONDS))
+ deconstruct()
+
+/obj/structure/pool_ladder/deconstruct(disassembled = TRUE)
+ new /obj/item/stack/rods/ten(get_turf(src))
+ ..()
+
+/obj/structure/pool_ladder/attack_hand(mob/user)
+ var/datum/component/swimming/S = user.GetComponent(/datum/component/swimming)
+ if(S)
+ to_chat(user, "You start to climb out of the pool...")
+ if(do_after(user, 1 SECONDS, target=src))
+ S.RemoveComponent()
+ visible_message("[user] climbs out of the pool.")
+ user.forceMove(get_turf(get_step(src, NORTH))) //Ladders shouldn't adjoin another pool section. Ever.
+ else
+ to_chat(user, "You start to climb into the pool...")
+ var/turf/T = get_turf(src)
+ if(do_after(user, 1 SECONDS, target=src))
+ if(!istype(T, /turf/open/indestructible/sound/pool)) //Ugh, fine. Whatever.
+ user.forceMove(get_turf(src))
+ else
+ var/turf/open/indestructible/sound/pool/P = T
+ P.splash(user)
+
+/obj/structure/pool_ladder/attack_robot(mob/user)
+ . = ..()
+ attack_hand(user)
+
GLOBAL_LIST_EMPTY(pool_filters)
/obj/machinery/pool_filter
- name = "Pool filter"
+ name = "pool filter"
desc = "A device which can help you regulate conditions in a pool. Use a wrench to change its operating temperature, or hit it with a reagent container to load in new liquid to add to the pool."
icon = 'icons/obj/pool.dmi'
icon_state = "poolfilter"
@@ -272,25 +324,3 @@ GLOBAL_LIST_EMPTY(pool_filters)
C.adjust_bodytemperature(35, 0, 500)
M.adjustFireLoss(2.5 * delta_time)
to_chat(M, "The water is searing hot!")
-
-/obj/structure/pool_ladder/attack_hand(mob/user)
- var/datum/component/swimming/S = user.GetComponent(/datum/component/swimming)
- if(S)
- to_chat(user, "You start to climb out of the pool...")
- if(do_after(user, 1 SECONDS, target=src))
- S.RemoveComponent()
- visible_message("[user] climbs out of the pool.")
- user.forceMove(get_turf(get_step(src, NORTH))) //Ladders shouldn't adjoin another pool section. Ever.
- else
- to_chat(user, "You start to climb into the pool...")
- var/turf/T = get_turf(src)
- if(do_after(user, 1 SECONDS, target=src))
- if(!istype(T, /turf/open/indestructible/sound/pool)) //Ugh, fine. Whatever.
- user.forceMove(get_turf(src))
- else
- var/turf/open/indestructible/sound/pool/P = T
- P.splash(user)
-
-/obj/structure/pool_ladder/attack_robot(mob/user)
- . = ..()
- attack_hand(user)