Merge pull request #136 from Phantastic-Swan/bluespace_belts_changes

Bluespace belts Overhaul
This commit is contained in:
evilew
2025-05-01 14:05:09 +02:00
committed by GitHub
13 changed files with 311 additions and 8 deletions
@@ -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, "<span class='warning'>You are too fat to wear [I].</span>")
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, "<span class='warning'>You are too fat to wear [I].</span>")
return FALSE
return ..()
@@ -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?
@@ -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")
+13 -4
View File
@@ -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
@@ -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, "<span class='warning'>[PBS_belt] can no longer contain your weight!</span>")
fatty.visible_message("<span class='warning'>[PBS_belt] fails as it's unable to contain [fatty]'s bulk!</span>", "<span class='warning'>[PBS_belt] fails as it's unable to contain your bulk!</span>")
fatty.dropItemToGround(PBS_belt)
var/obj/item/storage/belt/belt = fatty.belt
if(istype(belt))
// to_chat(fatty, "<span class='warning'>[belt] can no longer contain your weight!</span>")
fatty.visible_message("<span class='warning'>With a loud ripping sound, [fatty]'s [belt] snaps open!</span>", "<span class='warning'>With a loud ripping sound, your [belt] snaps open!</span>")
fatty.dropItemToGround(belt)
else if(fatty.fatness < preferences.helplessness_belts)
to_chat(fatty, "<span class='notice'>You feel thin enough to put on belts now. </span>")
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)
@@ -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."
@@ -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
+201 -3
View File
@@ -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, "<span class='notice'>You put the belt around your waist and your mass begins to shrink...</span>")
U.hider_add(src)
else
else if(equipped)
equipped = FALSE
to_chat(user, "<span class='notice'>The belt is opened, letting your mass flow out!</span>")
U.hider_remove(src)
@@ -26,9 +29,204 @@
if(!iscarbon(user))
return
var/mob/living/carbon/U = user
to_chat(U, "<span class='warning'>The belt is opened, letting your mass flow out!</span>")
if (equipped)
to_chat(U, "<span class='warning'>The belt is opened, letting your mass flow out!</span>")
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)
. += "<span class='notice'>It seems to have [DisplayEnergy(cell.charge)] of power remaining.</span>"
else
. += "<span class='notice'>It seems to be out of power.</span>"
/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, "<span class='warning'>\The [src] overloads!</span>")
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, "<span class='notice'>You put the belt around your waist, but it seems that the battery is missing!</span>")
deactivate()
else if(slot == ITEM_SLOT_BELT && !cell.charge)
equipped = TRUE
to_chat(user, "<span class='notice'>You put the belt around your waist, but it seems that the battery is dead!</span>")
deactivate()
else if(slot == ITEM_SLOT_BELT && cell.charge)
equipped = TRUE
to_chat(user, "<span class='notice'>You put the belt around your waist and your mass begins to shrink...</span>")
activate()
else
if(equipped)
equipped = FALSE
to_chat(user, "<span class='notice'>The belt is opened, letting your mass flow out!</span>")
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, "<span class='notice'>You put the cell into the belt</span>")
else
to_chat(person, "<span class='notice'>You swiftly replace the cell in the belt</span>")
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, "<span class='notice'>Your mass begins to shrink as the belt is powered again...</span>")
// user = person
// activate()
if (equipped && cell.charge)
to_chat(person, "<span class='notice'>Your mass begins to shrink as the belt is powered again...</span>")
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, "<span class='notice'>You take the cell out of the belt, letting your mass flow out!</span>")
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, "<span class='notice'>You take the cell out of the belt, letting your mass flow out!</span>")
// 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, "<span class='notice'>The belt beeps as it's battery runs out, and your mass starts flowing out!</span>")
// 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()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 1.3 KiB

+1
View File
@@ -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"
+5
View File
@@ -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 += "<b>Immobile Arms:</b><a href='?_src_=prefs;preference=helplessness_immobile_arms'>[helplessness_immobile_arms == FALSE ? "Disabled" : helplessness_immobile_arms]</a><BR>"
dat += "<b>Clothing Jumpsuit:</b><a href='?_src_=prefs;preference=helplessness_clothing_jumpsuit'>[helplessness_clothing_jumpsuit == FALSE ? "Disabled" : helplessness_clothing_jumpsuit]</a><BR>"
dat += "<b>Clothing, Suit, Boots, and Gloves:</b><a href='?_src_=prefs;preference=helplessness_clothing_misc'>[helplessness_clothing_misc == FALSE ? "Disabled" : helplessness_clothing_misc]</a><BR>"
dat += "<b>Belts:</b><a href='?_src_=prefs;preference=helplessness_belts'>[helplessness_belts == FALSE ? "Disabled" : helplessness_belts]</a><BR>"
dat += "<b>Clothing Back:</b><a href='?_src_=prefs;preference=helplessness_clothing_back'>[helplessness_clothing_back == FALSE ? "Disabled" : helplessness_clothing_back]</a><BR>"
dat += "<b>No Buckle:</b><a href='?_src_=prefs;preference=helplessness_no_buckle'>[helplessness_no_buckle == FALSE ? "Disabled" : helplessness_no_buckle]</a><BR>"
dat += "</td>"
@@ -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")
@@ -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)
+1
View File
@@ -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"