diff --git a/GainStation13/code/mechanics/helplessness.dm b/GainStation13/code/mechanics/helplessness.dm
index 317e674744..9e647b0722 100644
--- a/GainStation13/code/mechanics/helplessness.dm
+++ b/GainStation13/code/mechanics/helplessness.dm
@@ -16,6 +16,17 @@
if(!mod_check(I) && HAS_TRAIT(H, TRAIT_NO_MISC) && (slot == ITEM_SLOT_FEET || slot ==ITEM_SLOT_GLOVES || slot == ITEM_SLOT_OCLOTHING))
to_chat(H, "You are too fat to wear [I].")
return FALSE
+
+ if(HAS_TRAIT(H, TRAIT_NO_BELT) && slot == ITEM_SLOT_BELT)
+ if(istype(I, /obj/item/bluespace_belt/primitive) && H?.client?.prefs.helplessness_belts*2 > H.fatness)
+ return ..()
+
+ if(istype(I, /obj/item/bluespace_belt) && !istype(I, /obj/item/bluespace_belt/primitive))
+ return ..()
+
+ to_chat(H, "You are too fat to wear [I].")
+ return FALSE
+
return ..()
diff --git a/GainStation13/code/modules/client/preferences/preferences.dm b/GainStation13/code/modules/client/preferences/preferences.dm
index 3ad11a65e4..d8ce7cf670 100644
--- a/GainStation13/code/modules/client/preferences/preferences.dm
+++ b/GainStation13/code/modules/client/preferences/preferences.dm
@@ -56,6 +56,8 @@
var/helplessness_clothing_jumpsuit = FALSE
///What fatness level prevents the user from wearing non-jumpsuit clothing
var/helplessness_clothing_misc = FALSE
+ // What fatness level prevents the user from wearing belts. Also affects the max weight the PBS Belt can hide
+ var/helplessness_belts = FALSE
///What fatness level prevents the user from wearing anything on their back
var/helplessness_clothing_back = FALSE
///What fatness level prevents the user from being buckled to anything?
diff --git a/GainStation13/code/modules/events/bluespace_belt_failure.dm b/GainStation13/code/modules/events/bluespace_belt_failure.dm
new file mode 100644
index 0000000000..b7c3af50c2
--- /dev/null
+++ b/GainStation13/code/modules/events/bluespace_belt_failure.dm
@@ -0,0 +1,37 @@
+/datum/round_event_control/bluespace_belt_failure
+ name = "Bluespace Belt Failure"
+ description = "Causes Primitive Bluespace Belts to fail in a way identical to an EMP"
+ category = EVENT_CATEGORY_ANOMALIES
+ typepath = /datum/round_event/bluespace_belt_failure
+
+ weight = 15 // should be infinite >:)
+
+ max_occurrences = 8
+
+ alert_observers = FALSE
+
+/datum/round_event/bluespace_belt_failure
+ var/length = 0
+
+/datum/round_event/bluespace_belt_failure/setup()
+ length = rand(25, 50)
+ end_when = length
+ start_when = rand(1, 5)
+ announce_when = rand(0, 4)
+
+/datum/round_event/bluespace_belt_failure/start()
+ for(var/mob/living/carbon/human/C in shuffle(GLOB.alive_mob_list))
+ if(!C.client)
+ continue
+ if(C.stat == DEAD)
+ continue
+ // if (HAS_TRAIT(C,TRAIT_EXEMPT_HEALTH_EVENTS))
+ // continue
+ if(!C.belt || !istype(C.belt, /obj/item/bluespace_belt/primitive))
+ continue
+ if(!is_station_level(C.z))
+ continue
+ C.belt.emp_act(length)
+
+/datum/round_event/bluespace_belt_failure/announce(fake)
+ priority_announce("Bluespace Fluctuations have been detected near the station. Certain Bluespace based equipment may stop working correctly for a short period of time.", "Bluespace Fluctuations Alert")
diff --git a/GainStation13/code/modules/loadout/backpack.dm b/GainStation13/code/modules/loadout/backpack.dm
index 3631b0c6e2..515f3f614f 100644
--- a/GainStation13/code/modules/loadout/backpack.dm
+++ b/GainStation13/code/modules/loadout/backpack.dm
@@ -1,5 +1,14 @@
-/datum/gear/backpack/bluespace_belt
- name = "Bluespace Belt"
- category = LOADOUT_SUBCATEGORY_BACKPACK_GENERAL
- path = /obj/item/bluespace_belt
+// /datum/gear/backpack/bluespace_belt
+// name = "Bluespace Belt"
+// category = LOADOUT_CATEGORY_BACKPACK
+// subcategory = LOADOUT_SUBCATEGORY_BACKPACK_GENERAL
+// path = /obj/item/bluespace_belt
+// cost = 5
+
+/datum/gear/backpack/bluespace_belt_primitive
+ name = "Primitive Bluespace Belt"
+ // category = LOADOUT_SUBCATEGORY_BACKPACK_GENERAL
+ path = /obj/item/bluespace_belt/primitive
cost = 5
+ category = LOADOUT_CATEGORY_BACKPACK
+ subcategory = LOADOUT_SUBCATEGORY_BACKPACK_GENERAL
\ No newline at end of file
diff --git a/GainStation13/code/modules/mob/living/species.dm b/GainStation13/code/modules/mob/living/species.dm
index 3c812443e8..b71ba4816c 100644
--- a/GainStation13/code/modules/mob/living/species.dm
+++ b/GainStation13/code/modules/mob/living/species.dm
@@ -203,6 +203,32 @@
REMOVE_TRAIT(fatty, TRAIT_NO_MISC, HELPLESSNESS_TRAIT)
+ if(preferences.helplessness_belts)
+ if(!HAS_TRAIT_FROM(fatty, TRAIT_NO_BELT, HELPLESSNESS_TRAIT))
+ if(fatty.fatness >= preferences.helplessness_belts)
+ ADD_TRAIT(fatty, TRAIT_NO_BELT, HELPLESSNESS_TRAIT)
+
+ // if(istype(fatty.belt, /obj/item/bluespace_belt))
+ var/obj/item/bluespace_belt/primitive/PBS_belt = fatty.belt
+ if(istype(PBS_belt) && fatty.fatness > preferences.helplessness_belts)
+ // to_chat(fatty, "[PBS_belt] can no longer contain your weight!")
+ fatty.visible_message("[PBS_belt] fails as it's unable to contain [fatty]'s bulk!", "[PBS_belt] fails as it's unable to contain your bulk!")
+ fatty.dropItemToGround(PBS_belt)
+
+ var/obj/item/storage/belt/belt = fatty.belt
+ if(istype(belt))
+ // to_chat(fatty, "[belt] can no longer contain your weight!")
+ fatty.visible_message("With a loud ripping sound, [fatty]'s [belt] snaps open!", "With a loud ripping sound, your [belt] snaps open!")
+ fatty.dropItemToGround(belt)
+
+ else if(fatty.fatness < preferences.helplessness_belts)
+ to_chat(fatty, "You feel thin enough to put on belts now. ")
+ REMOVE_TRAIT(fatty, TRAIT_NO_BELT, HELPLESSNESS_TRAIT)
+
+ else
+ if(HAS_TRAIT_FROM(fatty, TRAIT_NO_BELT, HELPLESSNESS_TRAIT))
+ REMOVE_TRAIT(fatty, TRAIT_NO_BELT, HELPLESSNESS_TRAIT)
+
if(preferences.helplessness_clothing_back)
if(!HAS_TRAIT_FROM(fatty, TRAIT_NO_BACKPACK, HELPLESSNESS_TRAIT))
if(fatty.fatness >= preferences.helplessness_clothing_back)
diff --git a/GainStation13/code/modules/research/designs/nutri_designs.dm b/GainStation13/code/modules/research/designs/nutri_designs.dm
index 89ac62e498..90aa4d546e 100644
--- a/GainStation13/code/modules/research/designs/nutri_designs.dm
+++ b/GainStation13/code/modules/research/designs/nutri_designs.dm
@@ -112,6 +112,17 @@
category = list("Misc", "Medical Designs")
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL | DEPARTMENTAL_FLAG_SCIENCE
+/datum/design/primitive_bluespace_belt
+ name = "Primitive Bluespace Belt"
+ desc = "A primitive belt made using bluespace technology. The power of space and time, used to hide the fact you are fat. This one requires cells to continue operating, and may suffer from random failures."
+ id = "primitive_bluespace_belt"
+ build_type = PROTOLATHE
+ construction_time = 100
+ materials = list(/datum/material/iron = 4000, /datum/material/silver = 2000, )
+ build_path = /obj/item/bluespace_belt/primitive
+ category = list("Misc", "Medical Designs")
+ departmental_flags = DEPARTMENTAL_FLAG_MEDICAL | DEPARTMENTAL_FLAG_SCIENCE
+
/datum/design/cookie_synthesizer
name = "Cookie Synthesizer"
desc = "A self-charging miraculous device that's able to produce cookies."
diff --git a/GainStation13/code/modules/research/techweb/nutritech_nodes.dm b/GainStation13/code/modules/research/techweb/nutritech_nodes.dm
index 486ff6ffb8..5e5deb6e8d 100644
--- a/GainStation13/code/modules/research/techweb/nutritech_nodes.dm
+++ b/GainStation13/code/modules/research/techweb/nutritech_nodes.dm
@@ -5,7 +5,7 @@
display_name = "Nutri-Tech Tools"
description = "Ending world hunger was never made easier!"
prereq_ids = list("biotech", "adv_engi")
- design_ids = list("calorite_collar", "ci-nutrimentturbo", "bluespace_belt", "adipoelectric_transformer", "cookie_synthesizer", "borg_upgrade_cookiesynthesizer", "borg_upgrade_feedingtube", "ci-fatmobility","bluespace_collar_receiver","bluespace_collar_transmitter")
+ design_ids = list("calorite_collar", "ci-nutrimentturbo", "bluespace_belt", "primitive_bluespace_belt", "adipoelectric_transformer", "cookie_synthesizer", "borg_upgrade_cookiesynthesizer", "borg_upgrade_feedingtube", "ci-fatmobility","bluespace_collar_receiver","bluespace_collar_transmitter")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
boost_item_paths = list(/obj/item/gun/energy/fatoray, /obj/item/gun/energy/fatoray/cannon, /obj/item/trash/fatoray_scrap1, /obj/item/trash/fatoray_scrap2)
hidden = TRUE
diff --git a/GainStation13/code/obj/items/bluespace_belt.dm b/GainStation13/code/obj/items/bluespace_belt.dm
index f550e783e3..3054efd022 100644
--- a/GainStation13/code/obj/items/bluespace_belt.dm
+++ b/GainStation13/code/obj/items/bluespace_belt.dm
@@ -8,16 +8,19 @@
equip_sound = 'GainStation13/sound/items/equip/toolbelt_equip.ogg'
drop_sound = 'GainStation13/sound/items/handling/toolbelt_drop.ogg'
pickup_sound = 'GainStation13/sound/items/handling/toolbelt_pickup.ogg'
+ var/equipped = FALSE // is it in the belt slot?
/obj/item/bluespace_belt/equipped(mob/user, slot)
..()
if(!iscarbon(user))
return
var/mob/living/carbon/U = user
- if(slot ==ITEM_SLOT_BELT)
+ if(slot == ITEM_SLOT_BELT)
+ equipped = TRUE
to_chat(U, "You put the belt around your waist and your mass begins to shrink...")
U.hider_add(src)
- else
+ else if(equipped)
+ equipped = FALSE
to_chat(user, "The belt is opened, letting your mass flow out!")
U.hider_remove(src)
@@ -26,9 +29,204 @@
if(!iscarbon(user))
return
var/mob/living/carbon/U = user
- to_chat(U, "The belt is opened, letting your mass flow out!")
+ if (equipped)
+ to_chat(U, "The belt is opened, letting your mass flow out!")
U.hider_remove(src)
/obj/item/bluespace_belt/proc/fat_hide(var/mob/living/carbon/user)
return -(user.fatness_real - 1)
+/obj/item/bluespace_belt/primitive
+ name = "primitive bluespace belt"
+ desc = "A primitive belt made using bluespace technology. The power of space and time, used to hide the fact you are fat. This one requires cells to continue operating, and may suffer from random failures."
+ icon = 'GainStation13/icons/obj/clothing/bluespace_belt.dmi'
+ icon_state = "primitive_belt"
+ item_state = "primitive_belt"
+
+ var/cell_type = /obj/item/stock_parts/cell/high
+ var/obj/item/stock_parts/cell/cell
+ var/maximum_power_drain = 50
+ var/fatness_to_power_coefficient = 136 // FATNESS_LEVEL_BLOB*2 BFI divided by this equals 50, our maximum power drain
+ var/mob/living/carbon/user // the fatass who's weight we must track for power drain calcs
+ var/overloaded = FALSE // is it EMP'ed?
+
+/obj/item/bluespace_belt/primitive/examine(mob/user)
+ . = ..()
+ if(cell && cell.charge)
+ . += "It seems to have [DisplayEnergy(cell.charge)] of power remaining."
+ else
+ . += "It seems to be out of power."
+
+/obj/item/bluespace_belt/primitive/Initialize(mapload)
+ . = ..()
+ if(!cell && cell_type)
+ cell = new cell_type
+
+/obj/item/bluespace_belt/primitive/emp_act(severity)
+ . = ..()
+
+ if(cell && !(. & EMP_PROTECT_CONTENTS))
+ cell.emp_act(severity)
+
+ overloaded = TRUE
+ to_chat(loc, "\The [src] overloads!")
+ deactivate()
+ addtimer(CALLBACK(src, PROC_REF(emp_act_end)), severity*10, TIMER_UNIQUE | TIMER_NO_HASH_WAIT | TIMER_OVERRIDE)
+
+/obj/item/bluespace_belt/primitive/proc/emp_act_end()
+ overloaded = FALSE
+ activate()
+
+/obj/item/bluespace_belt/primitive/proc/activate()
+ if (overloaded)
+ deactivate()
+ return
+
+ if(!cell)
+ deactivate()
+ return
+
+ if(!cell.charge)
+ deactivate()
+ return
+
+ if(!isnull(user) && equipped)
+ user.hider_add(src)
+
+ icon_state = "primitive_belt"
+ START_PROCESSING(SSprocessing, src)
+
+/obj/item/bluespace_belt/primitive/proc/deactivate()
+ if(!isnull(user))
+ user.hider_remove(src)
+
+ STOP_PROCESSING(SSprocessing, src)
+ icon_state = "primitive_belt_off"
+
+/obj/item/bluespace_belt/primitive/fat_hide(var/mob/living/carbon/user)
+ var/weight_to_hide = 0
+ if(preferences.helplessness_belts)
+ var/belts_pref = user?.client?.prefs.helplessness_belts
+ weight_to_hide = min(belts_pref, user.fatness_real - 1)
+ else
+ weight_to_hide = min(FATNESS_LEVEL_BLOB*2, user.fatness_real - 1)
+ return -(weight_to_hide)
+
+
+/obj/item/bluespace_belt/primitive/equipped(mob/U, slot)
+ ..()
+ if(!iscarbon(U))
+ user = null
+ return
+
+ user = U
+ if(slot == ITEM_SLOT_BELT && !cell)
+ equipped = TRUE
+ to_chat(user, "You put the belt around your waist, but it seems that the battery is missing!")
+ deactivate()
+ else if(slot == ITEM_SLOT_BELT && !cell.charge)
+ equipped = TRUE
+ to_chat(user, "You put the belt around your waist, but it seems that the battery is dead!")
+ deactivate()
+ else if(slot == ITEM_SLOT_BELT && cell.charge)
+ equipped = TRUE
+ to_chat(user, "You put the belt around your waist and your mass begins to shrink...")
+ activate()
+ else
+ if(equipped)
+ equipped = FALSE
+ to_chat(user, "The belt is opened, letting your mass flow out!")
+ user.hider_remove(src)
+ // user = null
+
+/obj/item/bluespace_belt/primitive/attackby(obj/item/W, mob/person)
+ if (istype(W, /obj/item/stock_parts/cell))
+ if(!person.transferItemToLoc(W, src))
+ return
+ if (!cell)
+ to_chat(person, "You put the cell into the belt")
+ else
+ to_chat(person, "You swiftly replace the cell in the belt")
+ person.put_in_hands(cell)
+ cell = W
+
+ // if (cell.charge)
+ // icon_state = "primitive_belt"
+ // else
+ // icon_state = "primitive_belt_off"
+
+ // START_PROCESSING(SSprocessing, src)
+
+ // if(cell.charge)
+ // if(equipped)
+ // to_chat(person, "Your mass begins to shrink as the belt is powered again...")
+ // user = person
+ // activate()
+
+
+
+ if (equipped && cell.charge)
+ to_chat(person, "Your mass begins to shrink as the belt is powered again...")
+ user = person
+
+ // // user.hider_add(src)
+ activate()
+
+
+
+/obj/item/bluespace_belt/primitive/attack_self(mob/person)
+ if (!cell)
+ return
+
+ // if(!isnull(user))
+ // user.hider_remove(src)
+
+ to_chat(person, "You take the cell out of the belt, letting your mass flow out!")
+ person.put_in_hands(cell)
+ cell = null
+ deactivate()
+ // user = null
+
+/obj/item/bluespace_belt/primitive/AltClick(mob/person)
+ . = ..()
+
+ if (!cell)
+ return
+
+ // if(!isnull(user))
+ // user.hider_remove(src)
+
+ to_chat(person, "You take the cell out of the belt, letting your mass flow out!")
+ // icon_state = "primitive_belt_off"
+ // user = null
+ person.put_in_hands(cell)
+ cell = null
+ // STOP_PROCESSING(SSprocessing, src)
+ deactivate()
+
+
+/obj/item/bluespace_belt/primitive/dropped(mob/person)
+ ..()
+ user = null
+
+/obj/item/bluespace_belt/primitive/process()
+ if(isnull(user))
+ return
+
+ if (!cell)
+ return
+
+ if (!cell.charge)
+ // icon_state = "primitive_belt_off"
+ // user.hider_remove(src)
+ to_chat(user, "The belt beeps as it's battery runs out, and your mass starts flowing out!")
+ // user = null
+ // STOP_PROCESSING(SSprocessing, src)
+ deactivate()
+ return
+
+
+ var/power_drain = clamp(user.fatness_real / fatness_to_power_coefficient, 0, maximum_power_drain)
+ power_drain = min(power_drain, cell.charge)
+ cell.use(power_drain)
+ cell.update_icon()
\ No newline at end of file
diff --git a/GainStation13/icons/obj/clothing/bluespace_belt.dmi b/GainStation13/icons/obj/clothing/bluespace_belt.dmi
index 19c6fa6bdb..761e586a9d 100644
Binary files a/GainStation13/icons/obj/clothing/bluespace_belt.dmi and b/GainStation13/icons/obj/clothing/bluespace_belt.dmi differ
diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index 7c55fe07fb..4beec681c7 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -254,6 +254,7 @@
#define TRAIT_NO_MOVE "no_move"
#define TRAIT_NO_JUMPSUIT "no_jumpsuit"
#define TRAIT_NO_MISC "no_misc"
+#define TRAIT_NO_BELT "no_belt"
#define TRAIT_NO_BACKPACK "no_backpack"
#define TRAIT_NO_BUCKLE "no_buckle"
#define TRAIT_DOCILE "docile"
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 0d343e2359..9308e8ab23 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -343,6 +343,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
helplessness_clothing_back = 0
if(isnull(helplessness_clothing_jumpsuit))
helplessness_clothing_jumpsuit = 0
+ if(isnull(helplessness_belts))
+ helplessness_belts = 0
if(isnull(helplessness_hidden_face))
helplessness_hidden_face = 0
if(isnull(helplessness_mute))
@@ -1469,6 +1471,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "Immobile Arms:[helplessness_immobile_arms == FALSE ? "Disabled" : helplessness_immobile_arms]
"
dat += "Clothing Jumpsuit:[helplessness_clothing_jumpsuit == FALSE ? "Disabled" : helplessness_clothing_jumpsuit]
"
dat += "Clothing, Suit, Boots, and Gloves:[helplessness_clothing_misc == FALSE ? "Disabled" : helplessness_clothing_misc]
"
+ dat += "Belts:[helplessness_belts == FALSE ? "Disabled" : helplessness_belts]
"
dat += "Clothing Back:[helplessness_clothing_back == FALSE ? "Disabled" : helplessness_clothing_back]
"
dat += "No Buckle:[helplessness_no_buckle == FALSE ? "Disabled" : helplessness_no_buckle]
"
dat += ""
@@ -3599,6 +3602,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
helplessness_clothing_jumpsuit = chose_weight("Choose the level of fatness that you would like to be made unable to wear jumpsuits at. None will disable this alltogether", user)
if("helplessness_clothing_misc")
helplessness_clothing_misc = chose_weight("Choose the level of fatness that you would like to be made unable to wear other non-jumpsuit clothing at. None will disable this alltogether", user)
+ if("helplessness_belts")
+ helplessness_belts = chose_weight("Choose the level of fatness that you would like to be made unable to wear belts at. This also affects how much weight the Primitive Bluespace Belt can hide. None will disable this alltogether", user)
if("helplessness_clothing_back")
helplessness_clothing_back = chose_weight("Choose the level of fatness that you would like to be made unable to wear anything on your back at. None will disable this alltogether", user)
if("helplessness_no_buckle")
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index 5951ea8487..400638ebef 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -959,6 +959,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["helplessness_immobile_arms"] >> helplessness_immobile_arms
S["helplessness_clothing_jumpsuit"] >> helplessness_clothing_jumpsuit
S["helplessness_clothing_misc"] >> helplessness_clothing_misc
+ S["helplessness_belts"] >> helplessness_belts
S["helplessness_clothing_back"] >> helplessness_clothing_back
S["helplessness_no_buckle"] >> helplessness_no_buckle
S["stuckage"] >> stuckage
@@ -1260,6 +1261,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["helplessness_immobile_arms"], helplessness_immobile_arms)
WRITE_FILE(S["helplessness_clothing_jumpsuit"], helplessness_clothing_jumpsuit)
WRITE_FILE(S["helplessness_clothing_misc"], helplessness_clothing_misc)
+ WRITE_FILE(S["helplessness_belts"], helplessness_belts)
WRITE_FILE(S["helplessness_clothing_back"], helplessness_clothing_back)
WRITE_FILE(S["helplessness_no_buckle"], helplessness_no_buckle)
WRITE_FILE(S["stuckage"], stuckage)
diff --git a/tgstation.dme b/tgstation.dme
index 84603e1d44..b929a40851 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -4042,6 +4042,7 @@
#include "GainStation13\code\modules\client\loadout\uniform.dm"
#include "GainStation13\code\modules\client\preferences\preferences.dm"
#include "GainStation13\code\modules\clothing\under\jobs\modular_items.dm"
+#include "GainStation13\code\modules\events\bluespace_belt_failure.dm"
#include "GainStation13\code\modules\events\vent_clog.dm\vent_clog.dm"
#include "GainStation13\code\modules\food_and_drinks\bigbottle.dm"
#include "GainStation13\code\modules\food_and_drinks\drinks.dm"