From 2234665ecdc974a5f91dc2f04137363f16c14da6 Mon Sep 17 00:00:00 2001 From: Heroman Date: Thu, 11 Mar 2021 18:46:19 +1000 Subject: [PATCH 1/5] Adds configuration to idle emotes --- code/modules/vore/eating/belly_obj_vr.dm | 15 ++++++++------- code/modules/vore/eating/bellymodes_vr.dm | 4 ++-- code/modules/vore/eating/vorepanel_vr.dm | 12 ++++++++++++ tgui/packages/tgui/interfaces/VorePanel.js | 14 ++++++++++++++ tgui/packages/tgui/public/tgui.bundle.js | 2 +- 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 6448ca90d1..7f7f33e0e4 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -18,7 +18,6 @@ var/vore_verb = "ingest" // Verb for eating with this in messages var/human_prey_swallow_time = 100 // Time in deciseconds to swallow /mob/living/carbon/human var/nonhuman_prey_swallow_time = 30 // Time in deciseconds to swallow anything else - var/emote_time = 60 SECONDS // How long between stomach emotes at prey var/nutrition_percent = 100 // Nutritional percentage per tick in digestion mode var/digest_brute = 0.5 // Brute damage per tick in digestion mode var/digest_burn = 0.5 // Burn damage per tick in digestion mode @@ -41,6 +40,10 @@ var/obj/item/weapon/storage/vore_egg/ownegg // Is this belly creating an egg? var/egg_type = "Egg" // Default egg type and path. var/egg_path = /obj/item/weapon/storage/vore_egg + var/list/emote_lists = list() // Idle emotes that happen on their own, depending on the bellymode. Contains lists of strings indexed by bellymode + var/emote_time = 60 // How long between stomach emotes at prey (in seconds) + var/emote_active = TRUE // Are we even giving emotes out at all or not? + var/next_emote = 0 // When we're supposed to print our next emote, as a world.time //I don't think we've ever altered these lists. making them static until someone actually overrides them somewhere. //Actual full digest modes @@ -56,7 +59,6 @@ var/tmp/mob/living/owner // The mob whose belly this is. var/tmp/digest_mode = DM_HOLD // Current mode the belly is set to from digest_modes (+transform_modes if human) var/tmp/list/items_preserved = list() // Stuff that wont digest so we shouldn't process it again. - var/tmp/next_emote = 0 // When we're supposed to print our next emote, as a world.time var/tmp/recent_sound = FALSE // Prevent audio spam // Don't forget to watch your commas at the end of each line if you change these. @@ -113,11 +115,6 @@ var/contamination_flavor = "Generic" // Determines descriptions of contaminated items var/contamination_color = "green" // Color of contamination overlay - //Mostly for being overridden on precreated bellies on mobs. Could be VV'd into - //a carbon's belly if someone really wanted. No UI for carbons to adjust this. - //List has indexes that are the digestion mode strings, and keys that are lists of strings. - var/tmp/list/emote_lists = list() - // Lets you do a fullscreen overlay. Set to an icon_state string. var/belly_fullscreen = "" var/disable_hud = FALSE @@ -152,6 +149,8 @@ "digest_messages_prey", "examine_messages", "emote_lists", + "emote_time", + "emote_active", "mode_flags", "item_digest_mode", "contaminates", @@ -784,6 +783,8 @@ dupe.belly_fullscreen = belly_fullscreen dupe.disable_hud = disable_hud dupe.egg_type = egg_type + dupe.emote_time = emote_time + dupe.emote_active = emote_active //// Object-holding variables //struggle_messages_outside - strings diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index fde1947431..428871edf9 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -55,8 +55,8 @@ ///////////////////// Early Non-Mode Handling ///////////////////// var/list/EL = emote_lists[digest_mode] - if(LAZYLEN(EL) && touchable_mobs && next_emote <= world.time) - next_emote = world.time + emote_time + if(LAZYLEN(EL) && touchable_mobs && next_emote <= world.time && emote_active) + next_emote = world.time + (emote_time SECONDS) for(var/mob/living/M in contents) if(digest_mode == DM_DIGEST && !M.digestable) continue // don't give digesty messages to indigestible people diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 2a09884e6b..2d5e4d36e9 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -156,6 +156,8 @@ "digest_burn" = selected.digest_burn, "bulge_size" = selected.bulge_size, "shrink_grow_size" = selected.shrink_grow_size, + "emote_time" = selected.emote_time, + "emote_active" = selected.emote_active, "belly_fullscreen" = selected.belly_fullscreen, "possible_fullscreens" = icon_states('icons/mob/screen_full_vore.dmi'), ) @@ -834,6 +836,16 @@ var/new_new_damage = CLAMP(new_damage, 0, 6) host.vore_selected.digest_brute = new_new_damage . = TRUE + if("b_emoteactive") + host.vore_selected.emote_active = !host.vore_selected.emote_active + . = TRUE + if("b_emotetime") + var/new_time = input(user, "Choose the period it takes for idle belly emotes to be shown to prey. Measured in seconds, Minimum 1 minute, Maximum 10 minutes.", "Set Belly Emote Delay.", host.vore_selected.digest_brute) + if(new_time == null) + return FALSE + var/new_new_time = CLAMP(new_time, 60, 600) + host.vore_selected.emote_time = new_new_time + . = TRUE if("b_escapable") if(host.vore_selected.escapable == 0) //Possibly escapable and special interactions. host.vore_selected.escapable = 1 diff --git a/tgui/packages/tgui/interfaces/VorePanel.js b/tgui/packages/tgui/interfaces/VorePanel.js index 05a0f3f69e..60cd967d75 100644 --- a/tgui/packages/tgui/interfaces/VorePanel.js +++ b/tgui/packages/tgui/interfaces/VorePanel.js @@ -167,6 +167,8 @@ const VoreSelectedBelly = (props, context) => { digest_burn, bulge_size, shrink_grow_size, + emote_time, + emote_active, addons, contaminates, contaminate_flavor, @@ -394,6 +396,18 @@ const VoreSelectedBelly = (props, context) => { onClick={() => act("set_attribute", { attribute: "b_grow_shrink" })} content={shrink_grow_size * 100 + "%"} /> + +