diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm index 411a0fe6..ed730f66 100644 --- a/GainStation13/code/mechanics/fatness.dm +++ b/GainStation13/code/mechanics/fatness.dm @@ -1,6 +1,17 @@ /mob/living/carbon - ///What level of fatness is the parent mob at? + //Due to the changes needed to create the system to hide fatness, here's some notes: + // -If you are making a mob simply gain or lose weight, use adjust_fatness. Try to not touch the variables directly unless you know 'em well + // -fatness is the value a mob is being displayed and calculated as by most things. Changes to fatness are not permanent + // -realfatness is the value a mob is actually at, even if it's being hidden. For permanent changes, use this one + // -overfatnes + //What level of fatness is the parent mob currently at? var/fatness = 0 + //Is something overriding the actual fatness value of a character? + var/fatness_hidden = FALSE + //The actual value a mob is at. Is equal to fatness if fatness_hidden is FALSE. + var/realfatness = 0 + //The value a mob's fatness is being overwritten with if fatness_hidden is TRUE. + var/overfatness = 0 ///At what rate does the parent mob gain weight? 1 = 100% var/weight_gain_rate = 1 //At what rate does the parent mob lose weight? 1 = 100% @@ -26,11 +37,19 @@ else amount_to_change = amount_to_change * weight_loss_rate - fatness += amount_to_change - fatness = max(fatness, MINIMUM_FATNESS_LEVEL) //It would be a little silly if someone got negative fat. + realfatness += amount_to_change + realfatness = max(realfatness, MINIMUM_FATNESS_LEVEL) //It would be a little silly if someone got negative fat. if(client?.prefs?.max_weight) // GS13 - fatness = min(fatness, (client?.prefs?.max_weight - 1)) + realfatness = min(realfatness, (client?.prefs?.max_weight - 1)) + + if(fatness_hidden) //If a character's real fatness is being hidden + if(client?.prefs?.max_weight) //Check their prefs + overfatness = min(overfatness, (client?.prefs?.max_weight - 1)) //And make sure it's not above their preferred max + + fatness = overfatness //Then, make that value their current fatness + else //If it's not being hidden + fatness = realfatness //Make their current fatness their real fatness return TRUE @@ -77,3 +96,16 @@ return FALSE return TRUE + +/mob/living/carbon/proc/fat_hide(hide_amount) //If something wants to hide realfatness, it'll call this method and give it an amount to cover it with + fatness_hidden = TRUE + overfatness = hide_amount + fatness = overfatness //To update a mob's fatness with the new amount to be shown immediately + + return TRUE + +/mob/living/carbon/proc/fat_show() //If something that hides fatness is removed or expires, it'll call this method + fatness_hidden = FALSE + fatness = realfatness //To update a mob's fatness with their real one immediately + + return TRUE diff --git a/GainStation13/code/mechanics/spells.dm b/GainStation13/code/mechanics/spells.dm index 62e21dbc..69e2e6d8 100644 --- a/GainStation13/code/mechanics/spells.dm +++ b/GainStation13/code/mechanics/spells.dm @@ -57,7 +57,7 @@ if(!proximity || !target || target == user) return FALSE - if(weight_to_add > user.fatness || !user.adjust_fatness(-weight_to_add, FATTENING_TYPE_MAGIC)) + if(weight_to_add > user.realfatness || !user.adjust_fatness(-weight_to_add, FATTENING_TYPE_MAGIC)) to_chat(user, "") return FALSE diff --git a/GainStation13/code/obj/items/bluespace_belt.dm b/GainStation13/code/obj/items/bluespace_belt.dm new file mode 100644 index 00000000..ca39ff80 --- /dev/null +++ b/GainStation13/code/obj/items/bluespace_belt.dm @@ -0,0 +1,18 @@ +/obj/item/bluespace_belt + name = "bluespace belt" + desc = "A belt made using bluespace technology. The power of space and time, used to hide the fact you are fat." + icon = 'GainStation13/icons/obj/clothing/bluespace_belt.dmi' + icon_state = "bluespace_belt" + item_state = "bluespace_belt" + slot_flags = ITEM_SLOT_BELT + equip_sound = 'sound/items/equip/toolbelt_equip.ogg' + drop_sound = 'sound/items/handling/toolbelt_drop.ogg' + pickup_sound = 'sound/items/handling/toolbelt_pickup.ogg' + +/obj/item/bluespace_belt/equipped(mob/user, slot) + ..() + var/mob/living/carbon/U = user + if(slot == SLOT_BELT) + U.fat_hide(0) + else + U.fat_show() diff --git a/GainStation13/icons/obj/clothing/bluespace_belt.dmi b/GainStation13/icons/obj/clothing/bluespace_belt.dmi new file mode 100644 index 00000000..19c6fa6b Binary files /dev/null and b/GainStation13/icons/obj/clothing/bluespace_belt.dmi differ diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4d1160cf..9ffb36c1 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2934,6 +2934,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) //GS13 character.fatness = starting_weight + character.realfatness = starting_weight character.weight_gain_rate = wg_rate character.weight_loss_rate = wl_rate diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 46241ca7..179ba7bc 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -620,7 +620,7 @@ /datum/reagent/medicine/lipolicide/on_mob_life(mob/living/carbon/M) if(M.nutrition <= NUTRITION_LEVEL_STARVING) M.adjustToxLoss(1*REM, 0) - if(M.fatness == 0) + if(M.realfatness == 0) M.nutrition = max(M.nutrition - 3, 0) // making the chef more valuable, one meme trap at a time if(HAS_TRAIT(M, TRAIT_LIPOLICIDE_TOLERANCE)) //GS13 edit M.adjust_fatness(-0.5, FATTENING_TYPE_WEIGHT_LOSS) diff --git a/icons/mob/belt.dmi b/icons/mob/belt.dmi index 166b0415..4c30728b 100644 Binary files a/icons/mob/belt.dmi and b/icons/mob/belt.dmi differ diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index af156422..d72bf1f6 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -112,8 +112,8 @@ var/mob/living/carbon/gainer = owner if(iscarbon(gainer) && owner?.client?.prefs?.weight_gain_food) var/mob/living/carbon/prey = M - if(iscarbon(prey) && prey.fatness) - var/fatness_to_add = (prey.fatness * 0.75) + if(iscarbon(prey) && prey.realfatness) + var/fatness_to_add = (prey.realfatness * 0.75) gainer.adjust_fatness(fatness_to_add, FATTENING_TYPE_FOOD) //GS13 edit end diff --git a/tgstation.dme b/tgstation.dme index 68f787ba..da85bd33 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3105,6 +3105,7 @@ #include "GainStation13\code\modules\surgery\organs\augments.dm" #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\minor_items.dm" #include "GainStation13\code\obj\structure\calorite_doors.dm" #include "GainStation13\code\obj\structure\candylight.dm"