From faf5d246ed6a10226c9dff33f3c32fe0ac8290b5 Mon Sep 17 00:00:00 2001 From: Heroman Date: Sat, 18 Jun 2022 19:43:45 +1000 Subject: [PATCH 01/11] Allows for toggling of display and editing of messages for Nutrition and Weight --- .../mob/living/carbon/human/examine_vr.dm | 117 +++++------------- code/modules/vore/eating/belly_obj_vr.dm | 5 +- code/modules/vore/eating/living_vr.dm | 35 ++++++ code/modules/vore/eating/vore_vr.dm | 62 ++++++++++ code/modules/vore/eating/vorepanel_vr.dm | 40 +++++- tgui/packages/tgui/interfaces/VorePanel.js | 22 ++++ tgui/public/tgui.bundle.js | 2 +- 7 files changed, 191 insertions(+), 92 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine_vr.dm b/code/modules/mob/living/carbon/human/examine_vr.dm index d2dcd9bfbde..86111429066 100644 --- a/code/modules/mob/living/carbon/human/examine_vr.dm +++ b/code/modules/mob/living/carbon/human/examine_vr.dm @@ -1,122 +1,61 @@ /mob/living/carbon/human/proc/examine_weight() - if(!show_pudge()) //Some clothing or equipment can hide this. + if(!show_pudge() || !weight_message_visible) //Some clothing or equipment can hide this. return "" var/message = "" var/weight_examine = round(weight) - var/t_He = "It" //capitalised for use at the start of each line. - var/t_he = "it" - var/t_his = "its" - var/t_His = "Its" - var/t_is = "is" - var/t_has = "has" - var/t_heavy = "heavy" - switch(identifying_gender) //Gender is their "real" gender. Identifying_gender is their "chosen" gender. - if(MALE) - t_He = "He" - t_he = "he" - t_His = "His" - t_his = "his" - t_heavy = "bulky" - if(FEMALE) - t_He = "She" - t_he = "she" - t_His = "Her" - t_his = "her" - t_heavy = "curvy" - if(PLURAL) - t_He = "They" - t_he = "they" - t_His = "Their" - t_his = "their" - t_is = "are" - t_has = "have" - if(NEUTER) - t_He = "It" - t_he = "it" - t_His = "Its" - t_his = "its" - if(HERM) - t_He = "Shi" - t_he = "shi" - t_His = "Hir" - t_his = "hir" - t_heavy = "curvy" - switch(weight_examine) if(0 to 74) - message = "[t_He] [t_is] terribly lithe and frail!" + message = weight_messages[1] if(75 to 99) - message = "[t_He] [t_has] a very slender frame." + message = weight_messages[2] if(100 to 124) - message = "[t_He] [t_has] a lightweight, athletic build." + message = weight_messages[3] if(125 to 174) - message = "[t_He] [t_has] a healthy, average body." + message = weight_messages[4] if(175 to 224) - message = "[t_He] [t_has] a thick, [t_heavy] physique." + message = weight_messages[5] if(225 to 274) - message = "[t_He] [t_has] a plush, chubby figure." + message = weight_messages[6] if(275 to 325) - message = "[t_He] [t_has] an especially plump body with a round potbelly and large hips." + message = weight_messages[7] if(325 to 374) - message = "[t_He] [t_has] a very fat frame with a bulging potbelly, squishy rolls of pudge, very wide hips, and plump set of jiggling thighs." + message = weight_messages[8] if(375 to 474) - message = "[t_He] [t_is] incredibly obese. [t_His] massive potbelly sags over [t_his] waistline while [t_his] fat ass would probably require two chairs to sit down comfortably!" + message = weight_messages[9] else - message += "[t_He] [t_is] so morbidly obese, you wonder how [t_he] can even stand, let alone waddle around the station. [t_He] can't get any fatter without being immobilized." + message = weight_messages[10] + if(message) + message = "[message]" return message //Credit to Aronai for helping me actually get this working! /mob/living/carbon/human/proc/examine_nutrition() - if(!show_pudge()) //Some clothing or equipment can hide this. + if(!show_pudge() || !nutrition_message_visible) //Some clothing or equipment can hide this. return "" var/message = "" var/nutrition_examine = round(nutrition) - var/t_He = "It" //capitalised for use at the start of each line. - var/t_His = "Its" - var/t_his = "its" - var/t_is = "is" - var/t_has = "has" - switch(identifying_gender) - if(MALE) - t_He = "He" - t_his = "his" - t_His = "His" - if(FEMALE) - t_He = "She" - t_his = "her" - t_His = "Her" - if(PLURAL) - t_He = "They" - t_his = "their" - t_His = "Their" - t_is = "are" - t_has = "have" - if(NEUTER) - t_He = "It" - t_his = "its" - t_His = "Its" - if(HERM) - t_He = "Shi" - t_his = "hir" - t_His = "Hir" switch(nutrition_examine) if(0 to 49) - message = "[t_He] [t_is] starving! You can hear [t_his] stomach snarling from across the room!" + message = nutrition_messages[1] if(50 to 99) - message = "[t_He] [t_is] extremely hungry. A deep growl occasionally rumbles from [t_his] empty stomach." + message = nutrition_messages[2] if(100 to 499) - return message //Well that's pretty normal, really. + message = nutrition_messages[3] if(500 to 999) // Fat. - message = "[t_He] [t_has] a stuffed belly, bloated fat and round from eating too much." + message = nutrition_messages[4] if(1000 to 1399) - message = "[t_He] [t_has] a rotund, thick gut. It bulges from their body obscenely, close to sagging under its own weight." + message = nutrition_messages[5] if(1400 to 1934) // One person fully digested. - message = "[t_He] [t_is] sporting a large, round, sagging stomach. It contains at least their body weight worth of glorping slush." + message = nutrition_messages[6] if(1935 to 3004) // Two people. - message = "[t_He] [t_is] engorged with a huge stomach that sags and wobbles as they move. [t_He] must have consumed at least twice their body weight. It looks incredibly soft." + message = nutrition_messages[7] if(3005 to 4074) // Three people. - message = "[t_His] stomach is firmly packed with digesting slop. [t_He] must have eaten at least a few times worth their body weight! It looks hard for them to stand, and [t_his] gut jiggles when they move." - if(4075 to INFINITY) // Four or more people. - message = "[t_He] [t_is] so absolutely stuffed that you aren't sure how it's possible to move. [t_He] can't seem to swell any bigger. The surface of [t_his] belly looks sorely strained!" + message = nutrition_messages[8] + if(4075 to 5124) // Four people. + message = nutrition_messages[9] + if(5125 to INFINITY) // More. + message = nutrition_messages[10] + if(message) + message = "[message]" return message //For OmniHUD records access for appropriate models diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 6ebda2446b9..b4770851914 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -567,7 +567,7 @@ // replacement strings and linebreaks as delimiters (two \n\n by default). // They also sanitize the messages. /obj/belly/proc/set_messages(raw_text, type, delim = "\n\n") - ASSERT(type == "smo" || type == "smi" || type == "asmo" || type == "asmi" || type == "dmo" || type == "dmp" || type == "amo" || type == "amp" || type == "uamo" || type == "uamp" || type == "em" || type == "ema" || type == "im_digest" || type == "im_hold" || type == "im_holdabsorbed" || type == "im_absorb" || type == "im_heal" || type == "im_drain" || type == "im_steal" || type == "im_egg" || type == "im_shrink" || type == "im_grow" || type == "im_unabsorb") + ASSERT(type == "smo" || type == "smi" || type == "asmo" || type == "asmi" || type == "dmo" || type == "dmp" || type == "amo" || type == "amp" || type == "uamo" || type == "uamp" || type == "im_digest" || type == "im_hold" || type == "im_holdabsorbed" || type == "im_absorb" || type == "im_heal" || type == "im_drain" || type == "im_steal" || type == "im_egg" || type == "im_shrink" || type == "im_grow" || type == "im_unabsorb") var/list/raw_list = splittext(html_encode(raw_text),delim) if(raw_list.len > 10) @@ -581,6 +581,9 @@ else if((type == "im_digest" || type == "im_hold" || type == "im_holdabsorbed" || type == "im_absorb" || type == "im_heal" || type == "im_drain" || type == "im_steal" || type == "im_egg" || type == "im_shrink" || type == "im_grow" || type == "im_unabsorb") && (length(raw_list[i]) > 510 || length(raw_list[i]) < 10)) raw_list.Cut(i,i) log_debug("[owner] tried to set [lowertext(name)] idle message with >501 or <10 char message") + else if((type == "em" || type == "ema") && (length(raw_list[i]) > 260 || length(raw_list[i]) < 10)) + raw_list.Cut(i,i) + log_debug("[owner] tried to set [lowertext(name)] examine message with >260 or <10 char message") else raw_list[i] = readd_quotes(raw_list[i]) //Also fix % sign for var replacement diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index d0acc9614f8..8c5a66444ca 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -50,6 +50,31 @@ 'sound/effects/mob_effects/xenochimera/regen_5.ogg' ) + var/nutrition_message_visible = TRUE + var/list/nutrition_messages = list( + "They are starving! You can hear their stomach snarling from across the room!" = 1, + "They are extremely hungry. A deep growl occasionally rumbles from their empty stomach." = 2, + "", + "They have a stuffed belly, bloated fat and round from eating too much.", + "They have a rotund, thick gut. It bulges from their body obscenely, close to sagging under its own weight.", + "They are sporting a large, round, sagging stomach. It contains at least their body weight worth of glorping slush.", + "They are engorged with a huge stomach that sags and wobbles as they move. They must have consumed at least twice their body weight. It looks incredibly soft.", + "Their stomach is firmly packed with digesting slop. They must have eaten at least a few times worth their body weight! It looks hard for them to stand, and their gut jiggles when they move.", + "They are so absolutely stuffed that you aren't sure how it's possible for them to move. They can't seem to swell any bigger. The surface of their belly looks sorely strained!", + "They are utterly filled to the point where it's hard to even imagine them moving, much less comprehend it when they do. Their gut is swollen to monumental sizes and amount of food they consumed must be insane.") + var/weight_message_visible = TRUE + var/list/weight_messages = list( + "They are terribly lithe and frail!", + "They have a very slender frame.", + "They have a lightweight, athletic build.", + "They have a healthy, average body.", + "They have a thick, curvy physique.", + "They have a plush, chubby figure.", + "They have an especially plump body with a round potbelly and large hips.", + "They have a very fat frame with a bulging potbelly, squishy rolls of pudge, very wide hips, and plump set of jiggling thighs.", + "They are incredibly obese. Their massive potbelly sags over their waistline while their fat ass would probably require two chairs to sit down comfortably!", + "They are so morbidly obese, you wonder how they can even stand, let alone waddle around the station. They can't get any fatter without being immobilized.") + // // Hook for generic creation of stuff on new creatures // @@ -246,6 +271,11 @@ P.slip_vore = src.slip_vore P.stumble_vore = src.stumble_vore + P.nutrition_message_visible = src.nutrition_message_visible + P.nutrition_messages = src.nutrition_messages + P.weight_message_visible = src.weight_message_visible + P.weight_messages = src.weight_messages + var/list/serialized = list() for(var/obj/belly/B as anything in src.vore_organs) serialized += list(B.serialize()) //Can't add a list as an object to another list in Byond. Thanks. @@ -286,6 +316,11 @@ slip_vore = P.slip_vore stumble_vore = P.stumble_vore + nutrition_message_visible = P.nutrition_message_visible + nutrition_messages = P.nutrition_messages + weight_message_visible = P.weight_message_visible + weight_messages = P.weight_messages + if(bellies) release_vore_contents(silent = TRUE) vore_organs.Cut() diff --git a/code/modules/vore/eating/vore_vr.dm b/code/modules/vore/eating/vore_vr.dm index a1668e04820..b4d4ef8c7b8 100644 --- a/code/modules/vore/eating/vore_vr.dm +++ b/code/modules/vore/eating/vore_vr.dm @@ -70,6 +70,32 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE var/vore_taste = "nothing in particular" var/vore_smell = "nothing in particular" + + var/nutrition_message_visible = TRUE + var/list/nutrition_messages = list( + "They are starving! You can hear their stomach snarling from across the room!" = 1, + "They are extremely hungry. A deep growl occasionally rumbles from their empty stomach." = 2, + "", + "They have a stuffed belly, bloated fat and round from eating too much.", + "They have a rotund, thick gut. It bulges from their body obscenely, close to sagging under its own weight.", + "They are sporting a large, round, sagging stomach. It contains at least their body weight worth of glorping slush.", + "They are engorged with a huge stomach that sags and wobbles as they move. They must have consumed at least twice their body weight. It looks incredibly soft.", + "Their stomach is firmly packed with digesting slop. They must have eaten at least a few times worth their body weight! It looks hard for them to stand, and their gut jiggles when they move.", + "They are so absolutely stuffed that you aren't sure how it's possible for them to move. They can't seem to swell any bigger. The surface of their belly looks sorely strained!", + "They are utterly filled to the point where it's hard to even imagine them moving, much less comprehend it when they do. Their gut is swollen to monumental sizes and amount of food they consumed must be insane.") + var/weight_message_visible = TRUE + var/list/weight_messages = list( + "They are terribly lithe and frail!", + "They have a very slender frame.", + "They have a lightweight, athletic build.", + "They have a healthy, average body.", + "They have a thick, curvy physique.", + "They have a plush, chubby figure.", + "They have an especially plump body with a round potbelly and large hips.", + "They have a very fat frame with a bulging potbelly, squishy rolls of pudge, very wide hips, and plump set of jiggling thighs.", + "They are incredibly obese. Their massive potbelly sags over their waistline while their fat ass would probably require two chairs to sit down comfortably!", + "They are so morbidly obese, you wonder how they can even stand, let alone waddle around the station. They can't get any fatter without being immobilized.") + //Mechanically required var/path var/slot @@ -153,6 +179,10 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE drop_vore = json_from_file["drop_vore"] slip_vore = json_from_file["slip_vore"] stumble_vore = json_from_file["stumble_vore"] + nutrition_message_visible = json_from_file["nutrition_message_visible"] + nutrition_messages = json_from_file["nutrition_messages"] + weight_message_visible = json_from_file["weight_message_visible"] + weight_messages = json_from_file["weight_messages"] //Quick sanitize if(isnull(digestable)) @@ -195,6 +225,34 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE slip_vore = TRUE if(isnull(stumble_vore)) stumble_vore = TRUE + if(isnull(nutrition_message_visible)) + nutrition_message_visible = TRUE + if(isnull(weight_message_visible)) + weight_message_visible = TRUE + if(isnull(nutrition_messages)) + nutrition_messages = list( + "They are starving! You can hear their stomach snarling from across the room!" = 1, + "They are extremely hungry. A deep growl occasionally rumbles from their empty stomach." = 2, + "", + "They have a stuffed belly, bloated fat and round from eating too much.", + "They have a rotund, thick gut. It bulges from their body obscenely, close to sagging under its own weight.", + "They are sporting a large, round, sagging stomach. It contains at least their body weight worth of glorping slush.", + "They are engorged with a huge stomach that sags and wobbles as they move. They must have consumed at least twice their body weight. It looks incredibly soft.", + "Their stomach is firmly packed with digesting slop. They must have eaten at least a few times worth their body weight! It looks hard for them to stand, and their gut jiggles when they move.", + "They are so absolutely stuffed that you aren't sure how it's possible for them to move. They can't seem to swell any bigger. The surface of their belly looks sorely strained!", + "They are utterly filled to the point where it's hard to even imagine them moving, much less comprehend it when they do. Their gut is swollen to monumental sizes and amount of food they consumed must be insane.") + if(isnull(weight_messages)) + weight_messages = list( + "They are terribly lithe and frail!", + "They have a very slender frame.", + "They have a lightweight, athletic build.", + "They have a healthy, average body.", + "They have a thick, curvy physique.", + "They have a plush, chubby figure.", + "They have an especially plump body with a round potbelly and large hips.", + "They have a very fat frame with a bulging potbelly, squishy rolls of pudge, very wide hips, and plump set of jiggling thighs.", + "They are incredibly obese. Their massive potbelly sags over their waistline while their fat ass would probably require two chairs to sit down comfortably!", + "They are so morbidly obese, you wonder how they can even stand, let alone waddle around the station. They can't get any fatter without being immobilized.") return TRUE @@ -227,6 +285,10 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE "drop_vore" = drop_vore, "slip_vore" = slip_vore, "stumble_vore" = stumble_vore, + "nutrition_message_visible" = nutrition_message_visible, + "nutrition_messages" = nutrition_messages, + "weight_message_visible" = weight_message_visible, + "weight_messages" = weight_messages, ) //List to JSON diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 471d2fca036..c1160b7431b 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -181,6 +181,8 @@ "shrink_grow_size" = selected.shrink_grow_size, "emote_time" = selected.emote_time, "emote_active" = selected.emote_active, + "nutrition_ex" = host.nutrition_message_visible, + "weight_ex" = host.weight_message_visible, "belly_fullscreen" = selected.belly_fullscreen, ) @@ -253,6 +255,10 @@ "drop_vore" = host.drop_vore, "slip_vore" = host.slip_vore, "stumble_vore" = host.stumble_vore, + "nutrition_message_visible" = host.nutrition_message_visible, + "nutrition_messages" = host.nutrition_messages, + "weight_message_visible" = host.weight_message_visible, + "weight_messages" = host.weight_messages ) return data @@ -748,7 +754,7 @@ host.vore_selected.absorbed_desc = new_desc . = TRUE if("b_msgs") - tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message (500 for idle messages), max 10 messages per topic.","Really, don't.") // Should remain tgui_alert() (blocking) + tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message (250 for examines, 500 for idle messages), max 10 messages per topic.","Really, don't.") // Should remain tgui_alert() (blocking) var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name. '%count' will be replaced with the number of anything in your belly. '%countprey' will be replaced with the number of living prey in your belly." switch(params["msgtype"]) if("dmp") @@ -811,6 +817,32 @@ if(new_message) host.vore_selected.set_messages(new_message,"ema") + if("en") + var/list/indices = list(1,2,3,4,5,6,7,8,9,10) + var/index = tgui_input_list(user,"Select a message to edit:","Select Message", indices) + if(index && index <= 10) + var/alert = tgui_alert(user, "What do you wish to do with this message?","Selection",list("Edit","Clear","Cancel")) + switch(alert) + if("Clear") + host.nutrition_messages[index] = "" + if("Edit") + var/new_message = input(user, "Input a message", "Input", host.nutrition_messages[index]) as message + if(new_message) + host.nutrition_messages[index] = new_message + + if("ew") + var/list/indices = list(1,2,3,4,5,6,7,8,9,10) + var/index = tgui_input_list(user,"Select a message to edit:","Select Message", indices) + if(index && index <= 10) + var/alert = tgui_alert(user, "What do you wish to do with this message?","Selection",list("Edit","Clear","Cancel")) + switch(alert) + if("Clear") + host.weight_messages[index] = "" + if("Edit") + var/new_message = input(user, "Input a message", "Input", host.weight_messages[index]) as message + if(new_message) + host.weight_messages[index] = new_message + if("im_digest") var/new_message = input(user,"These are sent to prey every minute when you are on Digest mode. Write them in 2nd person ('%pred's %belly squishes down on you.')."+help,"Idle Message (Digest)",host.vore_selected.get_messages("im_digest")) as message if(new_message) @@ -1078,6 +1110,12 @@ if("b_save_digest_mode") host.vore_selected.save_digest_mode = !host.vore_selected.save_digest_mode . = TRUE + if("toggle_nutrition_ex") + host.nutrition_message_visible = !host.nutrition_message_visible + . = TRUE + if("toggle_weight_ex") + host.weight_message_visible = !host.weight_message_visible + . = TRUE if("b_del") var/alert = tgui_alert(usr, "Are you sure you want to delete your [lowertext(host.vore_selected.name)]?","Confirmation",list("Cancel","Delete")) if(!(alert == "Delete")) diff --git a/tgui/packages/tgui/interfaces/VorePanel.js b/tgui/packages/tgui/interfaces/VorePanel.js index cf7ea9dcdcb..ef0ccb73063 100644 --- a/tgui/packages/tgui/interfaces/VorePanel.js +++ b/tgui/packages/tgui/interfaces/VorePanel.js @@ -309,6 +309,12 @@ const VoreSelectedBellyDescriptions = (props, context) => { content={verb} /> +