From e38ee2a93575c5cb0da2cb1093296cda76554ae8 Mon Sep 17 00:00:00 2001 From: TheGreatKitsune Date: Fri, 14 Apr 2023 19:13:59 -0500 Subject: [PATCH] Add Undergarment TF mode to vore sprites. --- code/__defines/belly_modes_ch.dm | 3 +- code/modules/vore/eating/belly_obj_ch.dm | 6 +++- code/modules/vore/eating/belly_obj_vr.dm | 6 ++++ code/modules/vore/eating/living_ch.dm | 10 ++++++- code/modules/vore/eating/vorepanel_vr.dm | 26 ++++++++++++++++ .../modules/mob/living/carbon/human/human.dm | 21 +++++++++++-- .../modules/vore/eating/exportpanel_ch.dm | 3 ++ tgui/packages/tgui/interfaces/VorePanel.js | 30 +++++++++++++++++-- tgui/public/tgui.bundle.js | 2 +- 9 files changed, 99 insertions(+), 8 deletions(-) diff --git a/code/__defines/belly_modes_ch.dm b/code/__defines/belly_modes_ch.dm index e1bb06b753..defda89677 100644 --- a/code/__defines/belly_modes_ch.dm +++ b/code/__defines/belly_modes_ch.dm @@ -11,4 +11,5 @@ //Vore Sprite Flags #define DM_FLAG_VORESPRITE_BELLY 0x1 #define DM_FLAG_VORESPRITE_TAIL 0x2 -#define DM_FLAG_VORESPRITE_MARKING 0x4 \ No newline at end of file +#define DM_FLAG_VORESPRITE_MARKING 0x4 +#define DM_FLAG_VORESPRITE_ARTICLE 0x8 diff --git a/code/modules/vore/eating/belly_obj_ch.dm b/code/modules/vore/eating/belly_obj_ch.dm index 602c159208..83491cb00c 100644 --- a/code/modules/vore/eating/belly_obj_ch.dm +++ b/code/modules/vore/eating/belly_obj_ch.dm @@ -77,7 +77,8 @@ var/tmp/static/list/vore_sprite_flag_list= list( "Normal belly sprite" = DM_FLAG_VORESPRITE_BELLY, //"Tail adjustment" = DM_FLAG_VORESPRITE_TAIL, - //"Marking addition" = DM_FLAG_VORESPRITE_MARKING + //"Marking addition" = DM_FLAG_VORESPRITE_MARKING, + "Undergarment addition" = DM_FLAG_VORESPRITE_ARTICLE, ) var/affects_vore_sprites = FALSE @@ -91,6 +92,9 @@ var/resist_triggers_animation = TRUE var/size_factor_for_sprite = 1 var/belly_sprite_to_affect = "stomach" + var/undergarment_chosen = "Underwear, bottom" + var/undergarment_if_none + var/undergarment_color = COLOR_GRAY var/datum/sprite_accessory/tail/tail_to_change_to = FALSE var/tail_colouration = FALSE var/tail_extra_overlay = FALSE diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 96f2262c2f..8a933973cd 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -275,6 +275,9 @@ "resist_triggers_animation", "size_factor_for_sprite", "belly_sprite_to_affect", + "undergarment_chosen", + "undergarment_if_none", + "undergarment_color", "autotransferchance", "autotransferwait", "autotransferlocation", @@ -1425,6 +1428,9 @@ dupe.resist_triggers_animation = resist_triggers_animation dupe.size_factor_for_sprite = size_factor_for_sprite dupe.belly_sprite_to_affect = belly_sprite_to_affect + dupe.undergarment_chosen = undergarment_chosen + dupe.undergarment_if_none = undergarment_if_none + dupe.undergarment_color = undergarment_color dupe.autotransferchance = autotransferchance dupe.autotransferwait = autotransferwait dupe.autotransferlocation = autotransferlocation diff --git a/code/modules/vore/eating/living_ch.dm b/code/modules/vore/eating/living_ch.dm index 7504eb6e00..5608c6d811 100644 --- a/code/modules/vore/eating/living_ch.dm +++ b/code/modules/vore/eating/living_ch.dm @@ -30,7 +30,14 @@ for(var/belly_class in vore_icon_bellies) new_fullness[belly_class] = 0 for(var/obj/belly/B as anything in vore_organs) - new_fullness[B.belly_sprite_to_affect] += B.GetFullnessFromBelly() + if(DM_FLAG_VORESPRITE_BELLY & B.vore_sprite_flags) + new_fullness[B.belly_sprite_to_affect] += B.GetFullnessFromBelly() + if(istype(src, /mob/living/carbon/human) && DM_FLAG_VORESPRITE_ARTICLE & B.vore_sprite_flags) + if(!new_fullness[B.undergarment_chosen]) + new_fullness[B.undergarment_chosen] = 1 + new_fullness[B.undergarment_chosen] += B.GetFullnessFromBelly() + new_fullness[B.undergarment_chosen + "-ifnone"] = B.undergarment_if_none + new_fullness[B.undergarment_chosen + "-color"] = B.undergarment_color for(var/belly_class in vore_icon_bellies) new_fullness[belly_class] /= size_multiplier //Divided by pred's size so a macro mob won't get macro belly from a regular prey. new_fullness[belly_class] = round(new_fullness[belly_class], 1) // Because intervals of 0.25 are going to make sprite artists cry. @@ -39,6 +46,7 @@ if(vore_fullness < 0) vore_fullness = 0 vore_fullness = min(vore_capacity, vore_fullness) + return new_fullness /mob/living/proc/check_vorefootstep(var/m_intent, var/turf/T) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 90bb48cef3..f2aca416c9 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -218,6 +218,9 @@ "resist_animation" = selected.resist_triggers_animation, "voresprite_size_factor" = selected.size_factor_for_sprite, "belly_sprite_to_affect" = selected.belly_sprite_to_affect, + "undergarment_chosen" = selected.undergarment_chosen, + "undergarment_if_none" = selected.undergarment_if_none || "None", + "undergarment_color" = selected.undergarment_color, "belly_sprite_option_shown" = LAZYLEN(host.vore_icon_bellies) > 1 ? TRUE : FALSE, "tail_option_shown" = istype(host, /mob/living/carbon/human), "tail_to_change_to" = selected.tail_to_change_to, @@ -1805,6 +1808,29 @@ host.vore_selected.size_factor_for_sprite = CLAMP(size_factor_input, 0.1, 3) host.update_fullness() . = TRUE + if("b_undergarment_choice") //CHOMP Addition + var/datum/category_group/underwear/undergarment_choice = tgui_input_list(usr, "Which undergarment do you want to enable when your [lowertext(host.vore_selected.name)] is filled?","Select Undergarment Class", global_underwear.categories) + if(!undergarment_choice) //They cancelled, no changes + return FALSE + else + host.vore_selected.undergarment_chosen = undergarment_choice.name + host.update_fullness() + . = TRUE + if("b_undergarment_if_none") //CHOMP Addition + var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[host.vore_selected.undergarment_chosen] + var/datum/category_item/underwear/selected_underwear = tgui_input_list(usr, "If no undergarment is equipped, which undergarment style do you want to use?","Select Underwear Style",UWC.items,host.vore_selected.undergarment_if_none) + if(!selected_underwear) //They cancelled, no changes + return FALSE + else + host.vore_selected.undergarment_if_none = selected_underwear + host.update_fullness() + host.updateVRPanel() + if("b_undergarment_color") //CHOMP Addition + var/newcolor = input(usr, "Choose a color.", "", host.vore_selected.undergarment_color) as color|null + if(newcolor) + host.vore_selected.undergarment_color = newcolor + host.update_fullness() + . = TRUE if("b_tail_to_change_to") //CHOMP Addition var/tail_choice = tgui_input_list(usr, "Which tail sprite do you want to use when your [lowertext(host.vore_selected.name)] is filled?","Select Sprite", global.tail_styles_list) if(!tail_choice) //They cancelled, no changes diff --git a/modular_chomp/code/modules/mob/living/carbon/human/human.dm b/modular_chomp/code/modules/mob/living/carbon/human/human.dm index 20603a0aed..0fcc0acc7f 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/human.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/human.dm @@ -3,7 +3,24 @@ var/previous_taur_fullness = vore_fullness_ex["taur belly"] //update_vore_tail_sprite() //update_vore_belly_sprite() - . = ..() + var/list/new_fullness = ..() + . = new_fullness + for(var/datum/category_group/underwear/undergarment_class in global_underwear.categories) + if(new_fullness[undergarment_class.name] == 0) + continue + new_fullness[undergarment_class.name] = -1 * round(-1 * new_fullness[undergarment_class.name]) // Doing a ceiling the only way BYOND knows how I guess + new_fullness[undergarment_class.name] = (min(2, new_fullness[undergarment_class.name]) - 2) * -1 //Complicated stuff to get it correctly aligned with the expected TRUE/FALSE + var/datum/category_item/underwear/UWI = all_underwear[undergarment_class.name] + if(!UWI || UWI.name == "None") + //Welllll okay then. If the former then something went wrong, if None was selected then... + if(istype(undergarment_class.items_by_name[new_fullness[undergarment_class.name + "-ifnone"]], /datum/category_item/underwear)) + UWI = undergarment_class.items_by_name[new_fullness[undergarment_class.name + "-ifnone"]] + all_underwear[undergarment_class.name] = UWI + if(UWI && UWI.has_color && new_fullness[undergarment_class.name + "-color"]) + all_underwear_metadata[undergarment_class.name]["[gear_tweak_free_color_choice]"] = new_fullness[undergarment_class.name + "-color"] + if(UWI && UWI.name != "None" && hide_underwear[undergarment_class.name] != new_fullness[undergarment_class.name]) + hide_underwear[undergarment_class.name] = new_fullness[undergarment_class.name] + update_underwear(1) if(vore_fullness_ex["stomach"] != previous_stomach_fullness) update_vore_belly_sprite() if(vore_fullness_ex["taur belly"] != previous_taur_fullness) @@ -29,4 +46,4 @@ set category = "IC" set desc = "Toggle glasses worn icon visibility." hide_glasses = !hide_glasses - update_inv_glasses() \ No newline at end of file + update_inv_glasses() diff --git a/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm b/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm index e11ee38bb9..79c3ad75b0 100644 --- a/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm +++ b/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm @@ -192,6 +192,9 @@ belly_data["resist_triggers_animation"] = B.resist_triggers_animation belly_data["size_factor_for_sprite"] = B.size_factor_for_sprite belly_data["belly_sprite_to_affect"] = B.belly_sprite_to_affect + belly_data["undergarment_chosen"] = B.undergarment_chosen + belly_data["undergarment_if_none"] = B.undergarment_if_none + belly_data["undergarment_color"] = B.undergarment_color // Visuals (Belly Fullscreens Preview and Coloring) belly_data["belly_fullscreen_color"] = B.belly_fullscreen_color diff --git a/tgui/packages/tgui/interfaces/VorePanel.js b/tgui/packages/tgui/interfaces/VorePanel.js index c8a4055e84..5b7583570a 100644 --- a/tgui/packages/tgui/interfaces/VorePanel.js +++ b/tgui/packages/tgui/interfaces/VorePanel.js @@ -815,6 +815,9 @@ const VoreSelectedBellyVisuals = (props, context) => { voresprite_size_factor, belly_sprite_option_shown, belly_sprite_to_affect, + undergarment_chosen, + undergarment_if_none, + undergarment_color, tail_option_shown, tail_to_change_to, tail_colouration, @@ -837,7 +840,6 @@ const VoreSelectedBellyVisuals = (props, context) => { {affects_voresprite ? ( - {/* Once other options are added in: {(vore_sprite_flags.length && vore_sprite_flags.join(', ')) || 'None'}