Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructable exercise equipment #2839

Merged
merged 18 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/game/objects/items/stacks/sheets/sheet_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new/datum/stack_recipe("mortar", /obj/item/reagent_containers/glass/mortar/metal, 3), \
new/datum/stack_recipe("pestle", /obj/item/pestle, 1, time = 50), \
new/datum/stack_recipe("hygienebot assembly", /obj/item/bot_assembly/hygienebot, 2, time = 50), \
new/datum/stack_recipe_list("weight machines", list( \
new/datum/stack_recipe("chest press", /obj/structure/weightmachine/stacklifter, 5, time = 25, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("bench press", /obj/structure/weightmachine/weightlifter, 5, time = 25, one_per_turf = TRUE, on_floor = TRUE), \
)), \
new/datum/stack_recipe("shower", /obj/machinery/shower, 3, time = 25)
))

Expand Down Expand Up @@ -367,6 +371,7 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
new/datum/stack_recipe("19x19 canvas", /obj/item/canvas/nineteenXnineteen, 3), \
new/datum/stack_recipe("23x19 canvas", /obj/item/canvas/twentythreeXnineteen, 4), \
new/datum/stack_recipe("23x23 canvas", /obj/item/canvas/twentythreeXtwentythree, 5), \
new/datum/stack_recipe("punching bag", /obj/structure/punching_bag, 5, time = 25, one_per_turf = TRUE, on_floor = TRUE), \
))

/obj/item/stack/sheet/cotton/cloth
Expand Down
83 changes: 83 additions & 0 deletions code/modules/mining/lavaland/ruins/gym.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,47 @@
layer = WALL_OBJ_LAYER
var/list/hit_sounds = list('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg',\
'sound/weapons/punch1.ogg', 'sound/weapons/punch2.ogg', 'sound/weapons/punch3.ogg', 'sound/weapons/punch4.ogg')
var/buildstacktype = /obj/item/stack/sheet/cotton/cloth
var/buildstackamount = 5

/obj/structure/punching_bag/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(buildstacktype)
new buildstacktype(loc,buildstackamount)
return..()

/obj/structure/punching_bag/wrench_act(mob/living/user, obj/item/W)
if(..())
return TRUE
add_fingerprint(user)
var/action = anchored ? "unbolts [src] from" : "bolts [src] to"
var/uraction = anchored ? "unbolt [src] from" : "bolt [src] to"
user.visible_message("<span class='warning'>[user] [action] the floor.</span>", "<span class='notice'>You start to [uraction] the floor...</span>", "<span class='hear'>You hear rustling noises.</span>")
if(W.use_tool(src, user, 50, volume=100, extra_checks = CALLBACK(src, PROC_REF(check_anchored_state), anchored)))
set_anchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "bolt" : "unbolt"] [src] from the floor.</span>")
return TRUE

/obj/structure/punching_bag/wirecutter_act(mob/living/user, obj/item/W)
. = ..()
if(!anchored)
user.visible_message("<span class='warning'>[user] cuts apart [src].</span>", "<span class='notice'>You start to cut apart [src].</span>", "<span class='hear'>You hear cutting.</span>")
if(W.use_tool(src, user, 50, volume=100))
if(anchored)
return TRUE
to_chat(user, "<span class='notice'>You cut apart [src].</span>")
deconstruct(TRUE)
return TRUE
Gristlebee marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/punching_bag/proc/check_anchored_state(check_anchored)
return anchored == check_anchored

/obj/structure/punching_bag/examine(mob/user)
. = ..()
if(anchored)
. += "<span class='notice'>[src] is <b>bolted</b> to the floor.</span>"
Gristlebee marked this conversation as resolved.
Show resolved Hide resolved
else
. += "<span class='notice'>[src] is no longer <i>bolted</i> to the floor, and the seams can be <b>cut</b> apart.</span>"

/obj/structure/punching_bag/attack_hand(mob/user as mob)
. = ..()
Expand All @@ -25,6 +66,8 @@
icon = 'icons/obj/gym_equipment.dmi'
density = TRUE
anchored = TRUE
var/buildstacktype = /obj/item/stack/sheet/metal
var/buildstackamount = 5

/obj/structure/weightmachine/proc/AnimateMachine(mob/living/user)
return
Expand All @@ -33,6 +76,45 @@
. = ..()
icon_state = (obj_flags & IN_USE) ? "[base_icon_state]-u" : base_icon_state

/obj/structure/weightmachine/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(buildstacktype)
new buildstacktype(loc,buildstackamount)
return..()

/obj/structure/weightmachine/wrench_act(mob/living/user, obj/item/W)
if(..())
return TRUE
add_fingerprint(user)
var/action = anchored ? "unbolts [src] from" : "bolts [src] to"
var/uraction = anchored ? "unbolt [src] from" : "bolt [src] to"
user.visible_message("<span class='warning'>[user] [action] the floor.</span>", "<span class='notice'>You start to [uraction] the floor...</span>", "<span class='hear'>You hear rustling noises.</span>")
if(W.use_tool(src, user, 50, volume=100, extra_checks = CALLBACK(src, PROC_REF(check_anchored_state), anchored)))
set_anchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "bolt" : "unbolt"] [src] from the floor.</span>")
return TRUE

/obj/structure/weightmachine/screwdriver_act(mob/living/user, obj/item/W)
. = ..()
if(!anchored)
user.visible_message("<span class='warning'>[user] screws apart [src].</span>", "<span class='notice'>You start to screw apart [src].</span>", "<span class='hear'>You hear screwing.</span>")
if(W.use_tool(src, user, 50, volume=100))
if(anchored)
return TRUE
to_chat(user, "<span class='notice'>You screw apart [src].</span>")
deconstruct(TRUE)
return TRUE

/obj/structure/weightmachine/proc/check_anchored_state(check_anchored)
return anchored == check_anchored

/obj/structure/weightmachine/examine(mob/user)
. = ..()
if(anchored)
. += "<span class='notice'>[src] is <b>bolted</b> to the floor.</span>"
else
. += "<span class='notice'>[src] is no longer <i>bolted</i> to the floor, and the <b>screws</b> are exposed.</span>"

/obj/structure/weightmachine/update_overlays()
. = ..()

Expand Down Expand Up @@ -100,3 +182,4 @@
sleep(3)
animate(user, pixel_y = 2, time = 3)
sleep(3)

Loading