diff --git a/code/datums/components/crafting/crafting_lists/misc.dm b/code/datums/components/crafting/crafting_lists/misc.dm index 1fde5d3a2cbbe..747f3c9b05f15 100644 --- a/code/datums/components/crafting/crafting_lists/misc.dm +++ b/code/datums/components/crafting/crafting_lists/misc.dm @@ -12,6 +12,26 @@ parts = list(/obj/item/camera = 1) category = CAT_MISC +/datum/crafting_recipe/barbell + name = "Barbell" + result = /obj/item/barbell + time = 2 SECONDS + reqs = list( + /obj/item/stack/sheet/iron = 4, + /obj/item/stack/rods = 2, + ) + category = CAT_MISC + +/datum/crafting_recipe/chestpress + name = "Chest press handle" + result = /obj/item/barbell/stacklifting + time = 2 SECONDS + reqs = list( + /obj/item/stack/sheet/iron = 4, + /obj/item/stack/rods = 2, + ) + category = CAT_MISC + /datum/crafting_recipe/lizardhat name = "Lizard Cloche Hat" result = /obj/item/clothing/head/costume/lizard diff --git a/code/datums/components/crafting/crafting_lists/structures.dm b/code/datums/components/crafting/crafting_lists/structures.dm index d9d38f67d0ab7..835719293a27b 100644 --- a/code/datums/components/crafting/crafting_lists/structures.dm +++ b/code/datums/components/crafting/crafting_lists/structures.dm @@ -120,3 +120,40 @@ category = CAT_STRUCTURE one_per_turf = TRUE +/datum/crafting_recipe/weightmachine + name = "Chest press machine" + result = /obj/structure/weightmachine + time = 6 SECONDS + reqs = list( + /obj/item/stack/sheet/iron = 2, + /obj/item/stack/rods = 6, + /obj/item/barbell/stacklifting = 1, + ) + tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH) + category = CAT_STRUCTURE + one_per_turf = TRUE + +/datum/crafting_recipe/weightmachine/weightlifter + name = "Inline bench press" + result = /obj/structure/weightmachine/weightlifter + time = 6 SECONDS + reqs = list( + /obj/item/stack/sheet/iron = 2, + /obj/item/stack/rods = 6, + /obj/item/barbell = 1, + ) + tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH) + category = CAT_STRUCTURE + one_per_turf = TRUE + +/datum/crafting_recipe/punching_bag + name = "Punching bag" + result = /obj/structure/punching_bag + time = 6 SECONDS + reqs = list( + /obj/item/stack/sheet/cotton/cloth = 10, + ) + tools = list(TOOL_WIRECUTTER) + category = CAT_STRUCTURE + one_per_turf = TRUE + diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 1b8fb6f032f34..8e3789bcb5025 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -68,7 +68,7 @@ */ /atom/movable/proc/mouse_buckle_handling(mob/living/M, mob/living/user) if(can_buckle && istype(M) && istype(user)) - return user_buckle_mob(M, user) + return user_buckle_mob(M, user, check_loc = FALSE) // Mobs have custom behaviour for buckling /mob/mouse_buckle_handling(mob/living/M, mob/living/user) @@ -92,10 +92,14 @@ * force - Set to TRUE to ignore src's can_buckle and M's can_buckle_to * check_loc - Set to FALSE to allow buckling from adjacent turfs, or TRUE if buckling is only allowed with src and M on the same turf. */ -/atom/movable/proc/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE) +/atom/movable/proc/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE, needs_anchored = FALSE) if(!buckled_mobs) buckled_mobs = list() + if(!anchored && needs_anchored) + to_chat(M, "Secure [src] first!") + return FALSE + if(!is_buckle_possible(M, force, check_loc)) return FALSE @@ -131,7 +135,7 @@ SEND_SIGNAL(src, COMSIG_MOVABLE_BUCKLE, M, force) return TRUE -/obj/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE) +/obj/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE, needs_anchored = FALSE) . = ..() if(.) if(resistance_flags & ON_FIRE) //Sets the mob on fire if you buckle them to a burning atom/movableect diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index da22f2bf66ba3..eb02c1d4658dc 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -203,7 +203,7 @@ if (istype(S)) H.cut_overlays() H.update_body_parts_head_only() - H.pixel_y += -GUILLOTINE_HEAD_OFFSET // Offset their body so it looks like they're in the guillotine + H.pixel_y -= GUILLOTINE_HEAD_OFFSET // Offset their body so it looks like they're in the guillotine H.layer += GUILLOTINE_LAYER_DIFF else unbuckle_all_mobs() @@ -212,12 +212,10 @@ else unbuckle_all_mobs() - ..() - /obj/structure/guillotine/post_unbuckle_mob(mob/living/M) M.regenerate_icons() - M.pixel_y -= -GUILLOTINE_HEAD_OFFSET // Move their body back - M.layer -= GUILLOTINE_LAYER_DIFF + M.pixel_y = M.base_pixel_y // Move their body back + M.layer = MOB_LAYER ..() /obj/structure/guillotine/can_be_unfasten_wrench(mob/user, silent) diff --git a/code/game/objects/structures/gym/exercise_status.dm b/code/game/objects/structures/gym/exercise_status.dm index 2a33c99a6f520..004db4f8ea8e2 100644 --- a/code/game/objects/structures/gym/exercise_status.dm +++ b/code/game/objects/structures/gym/exercise_status.dm @@ -19,7 +19,6 @@ /datum/status_effect/exercised/on_creation(mob/living/new_owner, exercise_amount) src.exercise_amount = exercise_amount * EXERCISE_INCREMENT - update_exercise() return ..() /datum/status_effect/exercised/merge(exercise_amount) @@ -49,6 +48,7 @@ var/delta = exercise_amount - applied_amount var/mob/living/carbon/human/human_owner = owner human_owner.physiology.stun_add -= delta + human_owner.physiology.stamina_mod -= delta applied_amount = exercise_amount switch (exercise_amount) if (0.3 to 0.5) diff --git a/code/game/objects/structures/gym/punching_bag.dm b/code/game/objects/structures/gym/punching_bag.dm index 49792013754e9..83acce444a7a8 100644 --- a/code/game/objects/structures/gym/punching_bag.dm +++ b/code/game/objects/structures/gym/punching_bag.dm @@ -24,3 +24,10 @@ SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "exercise", /datum/mood_event/exercise) user.apply_status_effect(STATUS_EFFECT_EXERCISED, 1) +/obj/structure/punching_bag/wirecutter_act(mob/living/user, obj/item/I) + to_chat(user, "You begin to cut [src] apart...") + if(I.use_tool(src, user, 40, volume=50)) + to_chat(user, "You cut [src] apart.") + new /obj/item/stack/sheet/cotton/cloth(loc, 10) + qdel(src) + return TRUE diff --git a/code/game/objects/structures/gym/weight_machine.dm b/code/game/objects/structures/gym/weight_machine.dm index b8e000a215779..705019f86c93b 100644 --- a/code/game/objects/structures/gym/weight_machine.dm +++ b/code/game/objects/structures/gym/weight_machine.dm @@ -9,6 +9,8 @@ density = TRUE anchored = TRUE blocks_emissive = EMISSIVE_BLOCK_UNIQUE + var/mutable_appearance/overlay + var/weight_type = /obj/item/barbell/stacklifting ///How much we shift the user's pixel y when using the weight machine. var/pixel_shift_y = -3 @@ -41,42 +43,61 @@ /obj/structure/weightmachine/Initialize(mapload) . = ..() - + overlay = mutable_appearance(icon, "[base_icon_state]-s") + src.add_overlay(overlay) weight_action = new(src) weight_action.weightpress = src /obj/structure/weightmachine/Destroy() + new /obj/item/stack/sheet/iron(loc, 2) + new /obj/item/stack/rods(loc, 6) + new weight_type(loc) + unbuckle_all_mobs() QDEL_NULL(weight_action) + qdel(overlay) return ..() -/obj/structure/weightmachine/buckle_mob(mob/living/buckled, force, check_loc) +/obj/structure/weightmachine/wrench_act(mob/living/user, obj/item/I) + if (default_unfasten_wrench(user, I, 50) == 2 && anchored) + setDir(SOUTH) + unbuckle_all_mobs() + return TRUE + +/obj/structure/weightmachine/screwdriver_act(mob/living/user, obj/item/I) + to_chat(user, "You begin to take apart [src]...") + if(I.use_tool(src, user, 40, volume=50)) + to_chat(user, "You deconstruct [src].") + qdel(src) + return TRUE + +/obj/structure/weightmachine/buckle_mob(mob/living/buckled, force, check_loc, needs_anchored = TRUE) . = ..() - weight_action.Grant(buckled) -// /obj/structure/weightmachine/post_buckle_mob(mob/living/buckled) -// add_overlay("[base_icon_state]-e") -// layer = ABOVE_MOB_LAYER +/obj/structure/weightmachine/post_buckle_mob(mob/living/buckled) + weight_action.Grant(buckled) + buckled.add_overlay(overlay) + src.cut_overlay(overlay) /obj/structure/weightmachine/unbuckle_mob(mob/living/buckled_mob, force, can_fall) . = ..() + src.add_overlay(overlay) + buckled_mob.cut_overlay(overlay) weight_action.Remove(buckled_mob) -// /obj/structure/weightmachine/post_unbuckle_mob(mob/living/buckled) -// cut_overlays() - /obj/structure/weightmachine/proc/perform_workout(mob/living/user) user.balloon_alert_to_viewers("[pick(more_weight)]") START_PROCESSING(SSobj, src) if(do_after(user, 8 SECONDS, src) && user.has_gravity()) - user.Stun(2 SECONDS) + user.Stun(0.5 SECONDS) if(issilicon(user) || isipc(user)) //IPCs don't have muscle mass... i think user.balloon_alert(user, pick(finished_silicon_message)) else user.balloon_alert(user, pick(finished_message)) if (user.client) user.client.give_award(/datum/award/achievement/misc/weights, user) - SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "exercise", /datum/mood_event/exercise) - user.apply_status_effect(STATUS_EFFECT_EXERCISED, 10) + if(ishuman(user)) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "exercise", /datum/mood_event/exercise) + user.apply_status_effect(STATUS_EFFECT_EXERCISED, 40) end_workout() /obj/structure/weightmachine/proc/end_workout() @@ -88,12 +109,8 @@ if(!has_buckled_mobs()) end_workout() return FALSE - var/image/workout = image(icon, "[base_icon_state]-o", layer = ABOVE_MOB_LAYER) - workout.plane = GAME_PLANE //I hate the plane cube - workout.layer = FLY_LAYER - flick_overlay_view(workout,0.8 SECONDS) - flick("[base_icon_state]-u", src) var/mob/living/user = buckled_mobs[1] + flick("[base_icon_state]-u", src) animate(user, pixel_y = pixel_shift_y, time = 4, SINE_EASING) playsound(user, 'sound/machines/creak.ogg', 60, TRUE) animate(pixel_y = user.base_pixel_y, time = 4, SINE_EASING) @@ -109,3 +126,32 @@ icon_state = "benchpress" base_icon_state = "benchpress" pixel_shift_y = 5 + weight_type = /obj/item/barbell + +/obj/item/barbell + name = "barbell" + desc = "A long bar with some huge weights on the ends. Very impressive." + icon = 'icons/obj/fitness.dmi' + icon_state = "barbell" + lefthand_file = 'icons/mob/inhands/equipment/weightlifting.dmi' + righthand_file = 'icons/mob/inhands/equipment/weightlifting.dmi' + flags_1 = CONDUCT_1 + force = 16 + throwforce = 16 + block_flags = BLOCKING_ACTIVE | BLOCKING_NASTY + attack_weight = 2 + w_class = WEIGHT_CLASS_HUGE + item_flags = SLOWS_WHILE_IN_HAND + custom_materials = list(/datum/material/iron=10000) + throw_speed = 1 + throw_range = 2 + slowdown = 2 + +/obj/item/barbell/ComponentInitialize() + . = ..() + AddComponent(/datum/component/two_handed, require_twohands=TRUE, block_power_unwielded=block_power, block_power_wielded=block_power) + +/obj/item/barbell/stacklifting + name = "chest press handle" + desc = "A handle that attaches to some heavy weights. Looks complicated." + icon_state = "chestpress" diff --git a/icons/mob/inhands/equipment/weightlifting.dmi b/icons/mob/inhands/equipment/weightlifting.dmi new file mode 100644 index 0000000000000..8d45776dd527c Binary files /dev/null and b/icons/mob/inhands/equipment/weightlifting.dmi differ diff --git a/icons/obj/fitness.dmi b/icons/obj/fitness.dmi index 88faf3c44a697..163262f59d23d 100644 Binary files a/icons/obj/fitness.dmi and b/icons/obj/fitness.dmi differ