/obj/structure/scale name = "weighing scale" desc = "You can weigh yourself with this." icon = 'GainStation13/icons/obj/scale.dmi' icon_state = "scale" anchored = TRUE resistance_flags = NONE max_integrity = 250 integrity_failure = 25 var/buildstacktype = /obj/item/stack/sheet/metal var/buildstackamount = 3 layer = OBJ_LAYER //stores the weight of the last person to step on in Lbs var/lastreading = 0 //the conversion ratio for how much a point of fatness weighs on a 6' person var/fatnessToWeight = 0.25 /obj/structure/scale/deconstruct() // If we have materials, and don't have the NOCONSTRUCT flag if(buildstacktype && (!(flags_1 & NODECONSTRUCT_1))) new buildstacktype(loc,buildstackamount) ..() /obj/structure/scale/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1)) W.play_tool_sound(src) deconstruct() else if(istype(W, /obj/item/assembly/shock_kit)) if(!user.temporarilyRemoveItemFromInventory(W)) return var/obj/item/assembly/shock_kit/SK = W var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc) playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) E.setDir(dir) E.part = SK SK.forceMove(E) SK.master = E qdel(src) else return ..() /obj/structure/scale/examine(mob/user) . = ..() . += "Its last reading was: [src.lastreading]Lbs" . += "It's held together by a couple of bolts." /obj/structure/scale/proc/weighEffect(mob/living/carbon/human/fatty) to_chat(fatty, "You weigh yourself.") to_chat(fatty, "The numbers on the screen tick up and eventually settle on:") //The appearance of the numbers changes with the fat level of the character if (HAS_TRAIT(fatty, TRAIT_BLOB)) to_chat(fatty, "[round(src.lastreading/2000, 0.01)]TONS!!!") else if (HAS_TRAIT(fatty, TRAIT_IMMOBILE)) to_chat(fatty, "[src.lastreading]Lbs!") else if(HAS_TRAIT(fatty, TRAIT_OBESE) || HAS_TRAIT(fatty, TRAIT_MORBIDLYOBESE)) to_chat(fatty, "[src.lastreading]Lbs!") else to_chat(fatty, "[src.lastreading]Lbs.") /obj/structure/scale/Crossed(AM as mob|obj) if(isturf(loc)) //need to be sure the thing that just crossed the scale is human if(ishuman(AM)) var/mob/living/carbon/human/HM = AM if(!(HM.movement_type & FLYING)) weighperson(HM) /obj/structure/scale/proc/weighperson(mob/living/carbon/human/fatty) src.lastreading = round((140 + (fatty.fatness*src.fatnessToWeight))*(fatty.size_multiplier**2)) weighEffect(fatty) visible_message("[fatty] weighs themselves.") visible_message("The numbers on the screen settle on: [src.lastreading]Lbs.")