Skip to content

Commit

Permalink
Adds the ability to (de)construct pool ladders (#2660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bokkiewokkie authored Jun 14, 2024
1 parent 0681152 commit 01caa93
Showing 1 changed file with 58 additions and 28 deletions.
86 changes: 58 additions & 28 deletions code/modules/pool/pool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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
layer = ABOVE_ALL_MOB_LAYER
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! <b>Drag and drop yourself onto it to climb in...</b>"
icon = 'icons/obj/pool.dmi'
icon_state = "pool"
Expand Down Expand Up @@ -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!
Expand Down Expand Up @@ -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"

Expand All @@ -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)
. = ..()
. += "<span class='notice'>There are <b>bolts</b> securing it to the side of the pool.</span>"

/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, "<span class='notice'>You start to climb out of the pool...</span>")
if(do_after(user, 1 SECONDS, target=src))
S.RemoveComponent()
visible_message("<span class='notice'>[user] climbs out of the pool.</span>")
user.forceMove(get_turf(get_step(src, NORTH))) //Ladders shouldn't adjoin another pool section. Ever.
else
to_chat(user, "<span class='notice'>You start to climb into the pool...</span>")
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 <b>wrench</b> 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"
Expand Down Expand Up @@ -272,25 +324,3 @@ GLOBAL_LIST_EMPTY(pool_filters)
C.adjust_bodytemperature(35, 0, 500)
M.adjustFireLoss(2.5 * delta_time)
to_chat(M, "<span class='danger'>The water is searing hot!</span>")

/obj/structure/pool_ladder/attack_hand(mob/user)
var/datum/component/swimming/S = user.GetComponent(/datum/component/swimming)
if(S)
to_chat(user, "<span class='notice'>You start to climb out of the pool...</span>")
if(do_after(user, 1 SECONDS, target=src))
S.RemoveComponent()
visible_message("<span class='notice'>[user] climbs out of the pool.</span>")
user.forceMove(get_turf(get_step(src, NORTH))) //Ladders shouldn't adjoin another pool section. Ever.
else
to_chat(user, "<span class='notice'>You start to climb into the pool...</span>")
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)

0 comments on commit 01caa93

Please sign in to comment.