From a8c3d3c233b5c945b1f6b4040e6c67916470943e Mon Sep 17 00:00:00 2001
From: Metis <100518708+sheepishgoat@users.noreply.github.com>
Date: Sat, 25 May 2024 18:42:19 -0400
Subject: [PATCH 1/6] to make things more transparent
---
GainStation13/code/obj/structure/scale.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/GainStation13/code/obj/structure/scale.dm b/GainStation13/code/obj/structure/scale.dm
index 214f28e6..c77f6cd5 100644
--- a/GainStation13/code/obj/structure/scale.dm
+++ b/GainStation13/code/obj/structure/scale.dm
@@ -60,6 +60,7 @@
else
to_chat(fatty, "[src.lastreading]Lbs.")
+ visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatness].")
/obj/structure/scale/Crossed(AM as mob|obj)
if(isturf(loc))
@@ -74,3 +75,4 @@
weighEffect(fatty)
visible_message("[fatty] weighs themselves.")
visible_message("The numbers on the screen settle on: [src.lastreading]Lbs.")
+ visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatness].")
From 8b19a80454b6ff3d00d7fad9782603153aaff905 Mon Sep 17 00:00:00 2001
From: Metis <100518708+sheepishgoat@users.noreply.github.com>
Date: Sun, 26 May 2024 04:19:16 -0400
Subject: [PATCH 2/6] emitter
---
GainStation13/code/mechanics/fatness.dm | 22 ++++++
.../modules/research/designs/autolathe.dm | 7 ++
.../code/obj/items/sensors/weight_infared.dm | 79 +++++++++++++++++++
GainStation13/code/obj/structure/scale.dm | 4 +-
tgstation.dme | 2 +
5 files changed, 112 insertions(+), 2 deletions(-)
create mode 100644 GainStation13/code/modules/research/designs/autolathe.dm
create mode 100644 GainStation13/code/obj/items/sensors/weight_infared.dm
diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm
index e275defd..5d6cc33f 100644
--- a/GainStation13/code/mechanics/fatness.dm
+++ b/GainStation13/code/mechanics/fatness.dm
@@ -124,3 +124,25 @@
xwg_size = min(xwg_size, RESIZE_HUGE)
xwg_size = max(xwg_size, custom_body_size*0.01)
resize(xwg_size)
+
+/proc/get_fatness_level_name(fatness_amount)
+ if(fatness_amount < FATNESS_LEVEL_FAT)
+ return "Normal"
+ if(fatness_amount < FATNESS_LEVEL_FATTER)
+ return "Fat"
+ if(fatness_amount < FATNESS_LEVEL_VERYFAT)
+ return "Fatter"
+ if(fatness_amount < FATNESS_LEVEL_OBESE)
+ return "Very Fat"
+ if(fatness_amount < FATNESS_LEVEL_MORBIDLY_OBESE)
+ return "Obese"
+ if(fatness_amount < FATNESS_LEVEL_EXTREMELY_OBESE)
+ return "Morbidly Obese"
+ if(fatness_amount < FATNESS_LEVEL_BARELYMOBILE)
+ return "Extremely Obese"
+ if(fatness_amount < FATNESS_LEVEL_IMMOBILE)
+ return "Barely Mobile"
+ if(fatness_amount < FATNESS_LEVEL_BLOB)
+ return "Immobile"
+
+ return "Blob"
diff --git a/GainStation13/code/modules/research/designs/autolathe.dm b/GainStation13/code/modules/research/designs/autolathe.dm
new file mode 100644
index 00000000..0232b44a
--- /dev/null
+++ b/GainStation13/code/modules/research/designs/autolathe.dm
@@ -0,0 +1,7 @@
+/datum/design/infrared_emitter
+ name = "Fatness Infrared Emitter"
+ id = "fatness_infrared_emitter"
+ build_type = AUTOLATHE
+ materials = list(MAT_METAL = 1000, MAT_GLASS = 500)
+ build_path = /obj/item/assembly/infra/fat
+ category = list("initial", "Misc")
diff --git a/GainStation13/code/obj/items/sensors/weight_infared.dm b/GainStation13/code/obj/items/sensors/weight_infared.dm
new file mode 100644
index 00000000..b5883cfd
--- /dev/null
+++ b/GainStation13/code/obj/items/sensors/weight_infared.dm
@@ -0,0 +1,79 @@
+/obj/item/assembly/infra/fat
+ name = "fatness infrared emitter"
+ desc = "Emits a visible or invisible beam and is triggered when the beam is interrupted. This one checks if the person tripping it is above or below a certain level of fatness."
+
+ var/fatness_to_trigger = 0
+ var/trigger_below = FALSE
+
+/obj/item/assembly/infra/fat/examine(mob/user)
+ . = ..()
+ . += "The infrared trigger is set to trigger when the target is [trigger_below?"above":"below"] being [get_fatness_level_name(fatness_to_trigger)]."
+
+/obj/item/assembly/infra/fat/ui_interact(mob/user)//TODO: change this this to the wire control panel
+ if(!is_secured(user))
+ return
+
+ user.set_machine(src)
+ var/dat = "Fatness Infrared Laser"
+ dat += "
Status: [on ? "On" : "Off"]"
+ dat += "
Visibility: [visible ? "Visible" : "Invisible"]"
+ dat += "
Fatness level to trigger:[get_fatness_level_name(fatness_to_trigger)]"
+ dat += "
Trigger above or below the target fatness level:[trigger_below ? "Below" : "Above"]"
+ dat += "
Refresh"
+ dat += "
Close"
+ user << browse(dat, "window=infra")
+ onclose(user, "infra")
+ return
+
+/obj/item/assembly/infra/fat/Topic(href, href_list)
+ ..()
+ if(href_list["trigger_below"])
+ trigger_below = !(trigger_below)
+ update_icon()
+ refreshBeam()
+ if(href_list["fatness_to_trigger"])
+ var/fatness_type = input(usr,
+ "What level of fatness do you wish to alert above/under at?",
+ src, "None") as null|anything in list(
+ "None", "Fat", "Fatter", "Very Fat", "Obese", "Morbidly Obese", "Extremely Obese", "Barely Mobile", "Immobile", "Blob")
+ if(!fatness_type)
+ return
+
+ var/fatness_amount = 0
+ switch(fatness_type)
+ if("Fat")
+ fatness_amount = FATNESS_LEVEL_FAT
+ if("Fatter")
+ fatness_amount = FATNESS_LEVEL_FATTER
+ if("Very Fat")
+ fatness_amount = FATNESS_LEVEL_VERYFAT
+ if("Obese")
+ fatness_amount = FATNESS_LEVEL_OBESE
+ if("Morbidly Obese")
+ fatness_amount = FATNESS_LEVEL_MORBIDLY_OBESE
+ if("Extremely Obese")
+ fatness_amount = FATNESS_LEVEL_EXTREMELY_OBESE
+ if("Barely Mobile")
+ fatness_amount = FATNESS_LEVEL_BARELYMOBILE
+ if("Immobile")
+ fatness_amount = FATNESS_LEVEL_IMMOBILE
+ if("Blob")
+ fatness_amount = FATNESS_LEVEL_BLOB
+
+ fatness_to_trigger = fatness_amount
+ update_icon()
+ refreshBeam()
+
+/obj/item/assembly/infra/fat/trigger_beam(atom/movable/AM, turf/location)
+ var/mob/living/carbon/crossed_fatty = AM
+ if(!istype(crossed_fatty))
+ return FALSE
+
+ if(trigger_below && (crossed_fatty.fatness >= fatness_to_trigger))
+ return FALSE
+
+ if(!trigger_below && (crossed_fatty.fatness < fatness_to_trigger))
+ return FALSE
+
+ return ..() // I love using inheritence so much.
+
diff --git a/GainStation13/code/obj/structure/scale.dm b/GainStation13/code/obj/structure/scale.dm
index c77f6cd5..87913fd8 100644
--- a/GainStation13/code/obj/structure/scale.dm
+++ b/GainStation13/code/obj/structure/scale.dm
@@ -60,7 +60,7 @@
else
to_chat(fatty, "[src.lastreading]Lbs.")
- visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatness].")
+ visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatty.fatness].")
/obj/structure/scale/Crossed(AM as mob|obj)
if(isturf(loc))
@@ -75,4 +75,4 @@
weighEffect(fatty)
visible_message("[fatty] weighs themselves.")
visible_message("The numbers on the screen settle on: [src.lastreading]Lbs.")
- visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatness].")
+ visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatty.fatness].")
diff --git a/tgstation.dme b/tgstation.dme
index 0bf94521..c782b0e1 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -3119,6 +3119,7 @@
#include "GainStation13\code\modules\reagents\chemistry\recipes\fatdrinks.dm"
#include "GainStation13\code\modules\reagents\chemistry\recipes\ROCKANDSTONEdrinks.dm"
#include "GainStation13\code\modules\reagents\reagent_containers\barrel_tank.dm"
+#include "GainStation13\code\modules\research\designs\autolathe.dm"
#include "GainStation13\code\modules\research\designs\nutri_designs.dm"
#include "GainStation13\code\modules\research\techweb\nutritech_nodes.dm"
#include "GainStation13\code\modules\surgery\organs\augments.dm"
@@ -3127,6 +3128,7 @@
#include "GainStation13\code\obj\items\bluespace_belt.dm"
#include "GainStation13\code\obj\items\holy.dm"
#include "GainStation13\code\obj\items\minor_items.dm"
+#include "GainStation13\code\obj\items\sensors\weight_infared.dm"
#include "GainStation13\code\obj\structure\calorite_doors.dm"
#include "GainStation13\code\obj\structure\candylight.dm"
#include "GainStation13\code\obj\structure\fountain.dm"
From 29fb631394db3da48097f95501014de6aa7f5a54 Mon Sep 17 00:00:00 2001
From: Metis <100518708+sheepishgoat@users.noreply.github.com>
Date: Sun, 26 May 2024 05:01:02 -0400
Subject: [PATCH 3/6] evil :3
---
GainStation13/code/obj/structure/airlock.dm | 37 +++++++++++++++++++++
code/game/machinery/doors/door.dm | 8 +++++
2 files changed, 45 insertions(+)
create mode 100644 GainStation13/code/obj/structure/airlock.dm
diff --git a/GainStation13/code/obj/structure/airlock.dm b/GainStation13/code/obj/structure/airlock.dm
new file mode 100644
index 00000000..7e5417c5
--- /dev/null
+++ b/GainStation13/code/obj/structure/airlock.dm
@@ -0,0 +1,37 @@
+/obj/machinery/door/airlock
+ var/fatness_to_check = 0
+
+ var/check_fatness = FALSE
+ var/check_below = FALSE
+
+/obj/machinery/door/airlock/proc/change_fatness_to_check(mob/user)
+ var/fatness_type = input(usr,
+ "What level of fatness do you wish to alert above/under at?",
+ src, "None") as null|anything in list(
+ "None", "Fat", "Fatter", "Very Fat", "Obese", "Morbidly Obese", "Extremely Obese", "Barely Mobile", "Immobile", "Blob")
+ if(!fatness_type)
+ return FALSE
+
+ var/fatness_amount = 0
+ switch(fatness_type)
+ if("Fat")
+ fatness_amount = FATNESS_LEVEL_FAT
+ if("Fatter")
+ fatness_amount = FATNESS_LEVEL_FATTER
+ if("Very Fat")
+ fatness_amount = FATNESS_LEVEL_VERYFAT
+ if("Obese")
+ fatness_amount = FATNESS_LEVEL_OBESE
+ if("Morbidly Obese")
+ fatness_amount = FATNESS_LEVEL_MORBIDLY_OBESE
+ if("Extremely Obese")
+ fatness_amount = FATNESS_LEVEL_EXTREMELY_OBESE
+ if("Barely Mobile")
+ fatness_amount = FATNESS_LEVEL_BARELYMOBILE
+ if("Immobile")
+ fatness_amount = FATNESS_LEVEL_IMMOBILE
+ if("Blob")
+ fatness_amount = FATNESS_LEVEL_BLOB
+
+ fatness_to_check = fatness_amount
+ return TRUE
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 7bf544c4..9485a1ce 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -175,6 +175,14 @@
return TRUE
if(unrestricted_side(M))
return TRUE
+ //GS13 EDIT
+ var/mob/living/carbon/human/bump_mob = M
+ if(check_fatness && istype(bump_mob))
+ if(check_below && (bump_mob.fatness >= fatness_to_check))
+ return FALSE
+ if(!check_below && (bump_mob.fatness < fatness_to_check))
+ return FALSE
+
return ..()
/obj/machinery/door/proc/unrestricted_side(mob/M) //Allows for specific side of airlocks to be unrestrected (IE, can exit maint freely, but need access to enter)
From 77ef9cfb53ba92b6c7ecb66c63b1cb182adee05d Mon Sep 17 00:00:00 2001
From: Metis <100518708+sheepishgoat@users.noreply.github.com>
Date: Sun, 26 May 2024 18:29:42 -0400
Subject: [PATCH 4/6] more door
---
GainStation13/code/obj/structure/airlock.dm | 6 +++---
code/game/machinery/doors/door.dm | 4 ++--
tgstation.dme | 1 +
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/GainStation13/code/obj/structure/airlock.dm b/GainStation13/code/obj/structure/airlock.dm
index 7e5417c5..54ec3e29 100644
--- a/GainStation13/code/obj/structure/airlock.dm
+++ b/GainStation13/code/obj/structure/airlock.dm
@@ -1,10 +1,10 @@
-/obj/machinery/door/airlock
+/obj/machinery/door
var/fatness_to_check = 0
var/check_fatness = FALSE
- var/check_below = FALSE
+ var/check_fatness_below = FALSE
-/obj/machinery/door/airlock/proc/change_fatness_to_check(mob/user)
+/obj/machinery/door/proc/change_fatness_to_check(mob/user)
var/fatness_type = input(usr,
"What level of fatness do you wish to alert above/under at?",
src, "None") as null|anything in list(
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 9485a1ce..08e8d0aa 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -178,9 +178,9 @@
//GS13 EDIT
var/mob/living/carbon/human/bump_mob = M
if(check_fatness && istype(bump_mob))
- if(check_below && (bump_mob.fatness >= fatness_to_check))
+ if(check_fatness_below && (bump_mob.fatness >= fatness_to_check))
return FALSE
- if(!check_below && (bump_mob.fatness < fatness_to_check))
+ if(!check_fatness_below && (bump_mob.fatness < fatness_to_check))
return FALSE
return ..()
diff --git a/tgstation.dme b/tgstation.dme
index c782b0e1..857ac0ea 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -3129,6 +3129,7 @@
#include "GainStation13\code\obj\items\holy.dm"
#include "GainStation13\code\obj\items\minor_items.dm"
#include "GainStation13\code\obj\items\sensors\weight_infared.dm"
+#include "GainStation13\code\obj\structure\airlock.dm"
#include "GainStation13\code\obj\structure\calorite_doors.dm"
#include "GainStation13\code\obj\structure\candylight.dm"
#include "GainStation13\code\obj\structure\fountain.dm"
From 9744bc614ddf7ad827b3f0576821f5d1629799d0 Mon Sep 17 00:00:00 2001
From: Metis <100518708+sheepishgoat@users.noreply.github.com>
Date: Sun, 26 May 2024 18:52:31 -0400
Subject: [PATCH 5/6] circuit
---
GainStation13/code/obj/items/circuits.dm | 30 +++++++++++++++++++++++
GainStation13/code/obj/structure/scale.dm | 5 +++-
code/__DEFINES/misc.dm | 2 ++
tgstation.dme | 1 +
4 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 GainStation13/code/obj/items/circuits.dm
diff --git a/GainStation13/code/obj/items/circuits.dm b/GainStation13/code/obj/items/circuits.dm
new file mode 100644
index 00000000..19d48918
--- /dev/null
+++ b/GainStation13/code/obj/items/circuits.dm
@@ -0,0 +1,30 @@
+/obj/item/integrated_circuit/input/fat_scanner
+ name = "integrated body fat analyser"
+ desc = "A very small version of the common medical analyser adjusted to scan a target's weight."
+ icon_state = "medscan"
+ complexity = 4
+ inputs = list("target" = IC_PINTYPE_REF)
+ outputs = list(
+ "weight (pounds)" = IC_PINTYPE_NUMBER,
+ "weight (BFI)" = IC_PINTYPE_NUMBER
+ )
+ activators = list("scan" = IC_PINTYPE_PULSE_IN, "on scanned" = IC_PINTYPE_PULSE_OUT)
+ spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
+ power_draw_per_use = 40
+
+/obj/item/integrated_circuit/input/fat_scanner/do_work()
+ var/mob/living/carbon/fatty = get_pin_data_as_type(IC_INPUT, 1, /mob/living)
+ if(!istype(fatty)) //Invalid input
+ return
+ if(!fatty.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
+ return
+
+ var/weight_in_pounds = fatty.calculate_weight_in_pounds()
+ var/weight_in_fatness = fatty.fatness
+
+ set_pin_data(IC_OUTPUT, 1, weight_in_pounds)
+ set_pin_data(IC_OUTPUT, 2, weight_in_fatness)
+
+ push_data()
+ activate_pin(2)
+
diff --git a/GainStation13/code/obj/structure/scale.dm b/GainStation13/code/obj/structure/scale.dm
index 87913fd8..488d9eda 100644
--- a/GainStation13/code/obj/structure/scale.dm
+++ b/GainStation13/code/obj/structure/scale.dm
@@ -71,8 +71,11 @@
weighperson(HM)
/obj/structure/scale/proc/weighperson(mob/living/carbon/human/fatty)
- src.lastreading = round((140 + (fatty.fatness*src.fatnessToWeight))*(fatty.size_multiplier**2)*((fatty.dna.features["taur"] != "None") ? 2.5: 1))
+ src.lastreading = fatty.calculate_weight_in_pounds()
weighEffect(fatty)
visible_message("[fatty] weighs themselves.")
visible_message("The numbers on the screen settle on: [src.lastreading]Lbs.")
visible_message("The numbers on the screen read out: [fatty] has a BFI of [fatty.fatness].")
+
+/mob/living/carbon/proc/calculate_weight_in_pounds()
+ return round((140 + (fatness*FATNESS_TO_WEIGHT_RATIO))*(size_multiplier**2)*((dna.features["taur"] != "None") ? 2.5: 1))
diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index 8f9ad059..d51813ec 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -528,3 +528,5 @@ GLOBAL_LIST_INIT(lighter_reskins, list(ZIPPO_SKIN_PLAIN = "plain", ZIPPO_SKIN_DA
#define FATTENING_TYPE_MAGIC "magic"
#define FATTENING_TYPE_VIRUS "virus"
#define FATTENING_TYPE_WEIGHT_LOSS "weight_loss"
+
+#define FATNESS_TO_WEIGHT_RATIO 0.25
diff --git a/tgstation.dme b/tgstation.dme
index 857ac0ea..68d48fea 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -3126,6 +3126,7 @@
#include "GainStation13\code\modules\vending\gatocola.dm"
#include "GainStation13\code\modules\vending\mealdor.dm"
#include "GainStation13\code\obj\items\bluespace_belt.dm"
+#include "GainStation13\code\obj\items\circuits.dm"
#include "GainStation13\code\obj\items\holy.dm"
#include "GainStation13\code\obj\items\minor_items.dm"
#include "GainStation13\code\obj\items\sensors\weight_infared.dm"
From a5d87de32afb48e4930d9f8b5c8ece692c92f0c9 Mon Sep 17 00:00:00 2001
From: Metis <100518708+sheepishgoat@users.noreply.github.com>
Date: Sun, 26 May 2024 18:56:29 -0400
Subject: [PATCH 6/6] Update circuits.dm
---
GainStation13/code/obj/items/circuits.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/GainStation13/code/obj/items/circuits.dm b/GainStation13/code/obj/items/circuits.dm
index 19d48918..48d17cc5 100644
--- a/GainStation13/code/obj/items/circuits.dm
+++ b/GainStation13/code/obj/items/circuits.dm
@@ -1,5 +1,5 @@
/obj/item/integrated_circuit/input/fat_scanner
- name = "integrated body fat analyser"
+ name = "integrated body fat analyzer"
desc = "A very small version of the common medical analyser adjusted to scan a target's weight."
icon_state = "medscan"
complexity = 4