From 92359325222df262e2e242390da6f9f20d31107a Mon Sep 17 00:00:00 2001 From: Alphas00 <154434082+Alphas00@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:18:42 +0200 Subject: [PATCH] Dumbbell and treadmill Added dumbbell, a item held in hand that can be used to burn some fat. Can be used faster the more it is used consecutively. Added treadmill, a placed item that functions as a conveyor belt (activated with a switch too), that burns some fat of people moved by it --- GainStation13/code/modules/gym/gym.dm | 115 ++++++++++++++++++++++++++ GainStation13/icons/obj/dumbbell.dmi | Bin 0 -> 292 bytes tgstation.dme | 1 + 3 files changed, 116 insertions(+) create mode 100644 GainStation13/code/modules/gym/gym.dm create mode 100644 GainStation13/icons/obj/dumbbell.dmi diff --git a/GainStation13/code/modules/gym/gym.dm b/GainStation13/code/modules/gym/gym.dm new file mode 100644 index 00000000..33fbcefc --- /dev/null +++ b/GainStation13/code/modules/gym/gym.dm @@ -0,0 +1,115 @@ +/obj/item/dumbbell + desc = "A weighty dumbbell, perfect for arm exercise!" + name = "dumbbell" + icon = 'GainStation13/icons/obj/dumbbell.dmi' + icon_state = "pen" + item_state = "pen" + throwforce = 20 + w_class = WEIGHT_CLASS_BULKY + throw_speed = 2 + throw_range = 3 + materials = list(MAT_METAL=10) + pressure_resistance = 2 + var/reps = 0 + var/using = FALSE + +/obj/item/dumbbell/dropped(mob/user, silent) + reps = 0 + . = ..() + +/obj/item/dumbbell/attack_self(mob/user) + . = ..() + if(!using) + using = TRUE + visible_message("[user] does a rep with the [src]. YEEEEEAH!!!") + if(do_after(usr, CLICK_CD_RESIST-reps, 0, usr, 1)) + if(iscarbon(user)) + var/mob/living/carbon/U = user + U.adjust_fatness(-10, FATTENING_TYPE_WEIGHT_LOSS) + if(reps < 16) + reps += 0.4 + else + visible_message("[user] couldn't complete the rep. YOU'LL GET IT NEXT TIME CHAMP!!!") + using = FALSE + +/obj/machinery/conveyor/treadmill + name = "treadmill" + desc = "A treadmil, for losing weight!" + +/obj/machinery/conveyor/treadmill/convey(list/affecting) + var/turf/T = get_step(src, movedir) + if(length(T.contents) > 150) + return + for(var/atom/movable/A in affecting) + if((A.loc == loc) && A.has_gravity()) + A.ConveyorMove(movedir) + if(iscarbon(A)) + var/mob/living/carbon/C = A + C.adjust_fatness(-10, FATTENING_TYPE_WEIGHT_LOSS) + +/obj/machinery/conveyor/treadmill/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/crowbar)) + user.visible_message("[user] struggles to pry up \the [src] with \the [I].", \ + "You struggle to pry up \the [src] with \the [I].") + if(I.use_tool(src, user, 40, volume=40)) + if(!(stat & BROKEN)) + var/obj/item/conveyor_construct/treadmill/C = new/obj/item/conveyor_construct/treadmill(src.loc) + C.id = id + transfer_fingerprints_to(C) + to_chat(user, "You remove the conveyor belt.") + qdel(src) + + else if(istype(I, /obj/item/wrench)) + if(!(stat & BROKEN)) + I.play_tool_sound(src) + setDir(turn(dir,-45)) + update_move_direction() + to_chat(user, "You rotate [src].") + + else if(istype(I, /obj/item/screwdriver)) + if(!(stat & BROKEN)) + verted = verted * -1 + update_move_direction() + to_chat(user, "You reverse [src]'s direction.") + + else if(user.a_intent != INTENT_HARM) + user.transferItemToLoc(I, drop_location()) + else + return ..() + +/obj/item/conveyor_construct/treadmill + icon = 'icons/obj/recycling.dmi' + icon_state = "conveyor_construct" + name = "treadmill assembly" + desc = "A treadmill assembly." + w_class = WEIGHT_CLASS_BULKY + id = "" //inherited by the belt + +/obj/item/conveyor_construct/afterattack(atom/A, mob/user, proximity, click_parameters) + SEND_SIGNAL(src, COMSIG_ITEM_AFTERATTACK, A, user, proximity, click_parameters) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_AFTERATTACK, A, user, proximity, click_parameters) + if(!proximity || user.stat || !isfloorturf(A) || istype(A, /area/shuttle)) + return + var/cdir = get_dir(A, user) + if(A == user.loc) + to_chat(user, "You cannot place a conveyor belt under yourself.") + return + var/obj/machinery/conveyor/treadmill/C = new/obj/machinery/conveyor/treadmill(A, cdir, id) + transfer_fingerprints_to(C) + qdel(src) + +/datum/design/dumbbell + name = "Dumbbell" + id = "dumbbell" + build_type = AUTOLATHE + materials = list(MAT_METAL = 2000) + build_path = /obj/item/dumbbell + category = list("initial", "Tools") + +/datum/design/treadmill + name = "Treadmill" + id = "treadmill" + build_type = AUTOLATHE + materials = list(MAT_METAL = 5000) + build_path = /obj/item/conveyor_construct/treadmill + category = list("initial", "Construction") diff --git a/GainStation13/icons/obj/dumbbell.dmi b/GainStation13/icons/obj/dumbbell.dmi new file mode 100644 index 0000000000000000000000000000000000000000..696bbfca05011c1a3dbe422934b00209e0ab2f53 GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvi2$Dv*8^ZMZQ8WEckllA@x#~G zchja##>U1K=bBo8Y8Xp`{DK)Ap4~_Ta?-0pB1&9Ri<65o3raHc^B5Q^<^+co6qSDe z5?t`{>k}<+U9EFx&IfM@HMnT};E~RGAI*~tMLoScER2JUFB^L)%y~5F$fOX3;FSud z{+->%s+(6xoG^a!$Vc1jjBo3PsiHA|V-B=2G5iRU^yB)KcmimpyQhm|h{nX^1c`SJ z0SqoiT!&bvh&ZTB7TVO%$=TJgY2)I>8wH&dOacrH0|QJ%6a@|_s2w}drNqGE!Ss|> iVbb0?QTHSi7#M!*a^&bK^os+HWbkzLb6Mw<&;$TK