From 2f9d0b7e323200e73184a5cfff25fa6b244eb608 Mon Sep 17 00:00:00 2001 From: TheGreatKitsune Date: Wed, 23 Nov 2022 12:27:51 -0600 Subject: [PATCH] New vore sprite options --- code/modules/vore/eating/belly_obj_ch.dm | 33 ++++++++++++++- code/modules/vore/eating/belly_obj_vr.dm | 12 ++++++ code/modules/vore/eating/vorepanel_vr.dm | 38 +++++++++++++++++- .../modules/vore/eating/exportpanel_ch.dm | 6 +++ tgui/packages/tgui/interfaces/VorePanel.js | 40 +++++++++++++++++++ .../tgui/interfaces/VorePanelExport.tsx | 6 +++ tgui/public/tgui.bundle.js | 2 +- 7 files changed, 134 insertions(+), 3 deletions(-) diff --git a/code/modules/vore/eating/belly_obj_ch.dm b/code/modules/vore/eating/belly_obj_ch.dm index 6d021a6429..c6f034702d 100644 --- a/code/modules/vore/eating/belly_obj_ch.dm +++ b/code/modules/vore/eating/belly_obj_ch.dm @@ -82,6 +82,12 @@ var/affects_vore_sprites = FALSE var/count_absorbed_prey_for_sprite = TRUE + var/absorbed_multiplier = 1 + var/count_liquid_for_sprite = FALSE + var/liquid_multiplier = 1 + var/count_items_for_sprite = FALSE + var/item_multiplier = 1 + var/health_impacts_size = TRUE var/resist_triggers_animation = TRUE var/size_factor_for_sprite = 1 var/belly_sprite_to_affect = "stomach" @@ -99,7 +105,32 @@ var/belly_fullness = 0 for(var/mob/living/M in src) if(count_absorbed_prey_for_sprite || !M.absorbed) - belly_fullness += M.size_multiplier + var/fullness_to_add = M.size_multiplier + fullness_to_add *= M.mob_size / 20 + if(M.absorbed) + fullness_to_add *= absorbed_multiplier + if(health_impacts_size) + fullness_to_add *= M.health / M.getMaxHealth() + belly_fullness += fullness_to_add + if(count_liquid_for_sprite) + belly_fullness += (reagents.total_volume / 100) * liquid_multiplier + if(count_items_for_sprite) + for(var/obj/item/I in src) + var/fullness_to_add = 0 + if(I.w_class == ITEMSIZE_TINY) + fullness_to_add = ITEMSIZE_COST_TINY + if(I.w_class == ITEMSIZE_SMALL) + fullness_to_add = ITEMSIZE_COST_SMALL + if(I.w_class == ITEMSIZE_NORMAL) + fullness_to_add = ITEMSIZE_COST_NORMAL + if(I.w_class == ITEMSIZE_LARGE) + fullness_to_add = ITEMSIZE_COST_LARGE + if(I.w_class == ITEMSIZE_HUGE) + fullness_to_add = ITEMSIZE_COST_HUGE + else + fullness_to_add = ITEMSIZE_COST_NO_CONTAINER + fullness_to_add /= 32 + belly_fullness += fullness_to_add * item_multiplier belly_fullness *= size_factor_for_sprite return belly_fullness diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 2a43994781..c9f7e1cba8 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -260,6 +260,12 @@ "vore_sprite_flags", "affects_vore_sprites", "count_absorbed_prey_for_sprite", + "absorbed_multiplier", + "count_liquid_for_sprite", + "liquid_multiplier", + "count_items_for_sprite", + "item_multiplier", + "health_impacts_size", "resist_triggers_animation", "size_factor_for_sprite", "belly_sprite_to_affect", @@ -1304,6 +1310,12 @@ dupe.vore_sprite_flags = vore_sprite_flags dupe.affects_vore_sprites = affects_vore_sprites dupe.count_absorbed_prey_for_sprite = count_absorbed_prey_for_sprite + dupe.absorbed_multiplier = absorbed_multiplier + dupe.count_liquid_for_sprite = count_liquid_for_sprite + dupe.liquid_multiplier = liquid_multiplier + dupe.count_items_for_sprite = count_items_for_sprite + dupe.item_multiplier = item_multiplier + dupe.health_impacts_size = health_impacts_size 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 diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index fb1cf99dde..ce7a438a16 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -203,6 +203,12 @@ //CHOMP add: vore sprite options "affects_voresprite" = selected.affects_vore_sprites, "absorbed_voresprite" = selected.count_absorbed_prey_for_sprite, + "absorbed_multiplier" = selected.absorbed_multiplier, + "liquid_voresprite" = selected.count_liquid_for_sprite, + "liquid_multiplier" = selected.liquid_multiplier, + "item_voresprite" = selected.count_items_for_sprite, + "item_multiplier" = selected.item_multiplier, + "health_voresprite" = selected.health_impacts_size, "resist_animation" = selected.resist_triggers_animation, "voresprite_size_factor" = selected.size_factor_for_sprite, "belly_sprite_to_affect" = selected.belly_sprite_to_affect, @@ -1555,11 +1561,41 @@ host.vore_selected.count_absorbed_prey_for_sprite = !host.vore_selected.count_absorbed_prey_for_sprite host.update_fullness() . = TRUE + if("b_absorbed_multiplier") //CHOMP Addition + var/absorbed_multiplier_input = input(user, "Set the impact absorbed prey's size have on your vore sprite. 1 means no scaling, 0.5 means absorbed prey count half as much, 2 means absorbed prey count double. (Range from 0.1 - 3)", "Absorbed Multiplier") as num|null + if(!isnull(absorbed_multiplier_input)) + host.vore_selected.absorbed_multiplier = CLAMP(absorbed_multiplier_input, 0.1, 3) + host.update_fullness() + . = TRUE + if("b_count_liquid_for_sprites") //CHOMP Addition + host.vore_selected.count_liquid_for_sprite = !host.vore_selected.count_liquid_for_sprite + host.update_fullness() + . = TRUE + if("b_liquid_multiplier") //CHOMP Addition + var/liquid_multiplier_input = input(user, "Set the impact amount of liquid reagents will have on your vore sprite. 1 means a belly with 100 reagents of fluid will count as 1 normal sized prey-thing's worth, 0.5 means liquid counts half as much, 2 means liquid counts double. (Range from 0.1 - 10)", "Liquid Multiplier") as num|null + if(!isnull(liquid_multiplier_input)) + host.vore_selected.liquid_multiplier = CLAMP(liquid_multiplier_input, 0.1, 10) + host.update_fullness() + . = TRUE + if("b_count_items_for_sprites") //CHOMP Addition + host.vore_selected.count_items_for_sprite = !host.vore_selected.count_items_for_sprite + host.update_fullness() + . = TRUE + if("b_item_multiplier") //CHOMP Addition + var/item_multiplier_input = input(user, "Set the impact items will have on your vore sprite. 1 means a belly with 8 normal-sized items will count as 1 normal sized prey-thing's worth, 0.5 means items count half as much, 2 means items count double. (Range from 0.1 - 10)", "Item Multiplier") as num|null + if(!isnull(item_multiplier_input)) + host.vore_selected.item_multiplier = CLAMP(item_multiplier_input, 0.1, 10) + host.update_fullness() + . = TRUE + if("b_health_impacts_size") //CHOMP Addition + host.vore_selected.health_impacts_size = !host.vore_selected.health_impacts_size + host.update_fullness() + . = TRUE if("b_resist_animation") //CHOMP Addition host.vore_selected.resist_triggers_animation = !host.vore_selected.resist_triggers_animation . = TRUE if("b_size_factor_sprites") //CHOMP Addition - var/size_factor_input = input(user, "Set the impact prey's size have on your vore sprite. 1 means no scaling, 0.5 means prey count half as much, 2 means prey count double. (Range from 0.1 - 3)", "Size Factor") as num|null + var/size_factor_input = input(user, "Set the impact all belly content's collective size has on your vore sprite. 1 means no scaling, 0.5 means content counts half as much, 2 means contents count double. (Range from 0.1 - 3)", "Size Factor") as num|null if(!isnull(size_factor_input)) host.vore_selected.size_factor_for_sprite = CLAMP(size_factor_input, 0.1, 3) host.update_fullness() diff --git a/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm b/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm index 6632ea9aec..e11ee38bb9 100644 --- a/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm +++ b/modular_chomp/code/modules/vore/eating/exportpanel_ch.dm @@ -183,6 +183,12 @@ // Visuals belly_data["affects_vore_sprites"] = B.affects_vore_sprites belly_data["count_absorbed_prey_for_sprite"] = B.count_absorbed_prey_for_sprite + belly_data["absorbed_multiplier"] = B.absorbed_multiplier + belly_data["count_liquid_for_sprite"] = B.count_liquid_for_sprite + belly_data["liquid_multiplier"] = B.liquid_multiplier + belly_data["count_items_for_sprite"] = B.count_items_for_sprite + belly_data["item_multiplier"] = B.item_multiplier + belly_data["health_impacts_size"] = B.health_impacts_size 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 diff --git a/tgui/packages/tgui/interfaces/VorePanel.js b/tgui/packages/tgui/interfaces/VorePanel.js index 3e9501d0f3..25ea1a6b3f 100644 --- a/tgui/packages/tgui/interfaces/VorePanel.js +++ b/tgui/packages/tgui/interfaces/VorePanel.js @@ -850,6 +850,12 @@ const VoreSelectedBellyVisuals = (props, context) => { vore_sprite_flags, affects_voresprite, absorbed_voresprite, + absorbed_multiplier, + liquid_voresprite, + liquid_multiplier, + item_voresprite, + item_multiplier, + health_voresprite, resist_animation, voresprite_size_factor, belly_sprite_option_shown, @@ -893,6 +899,40 @@ const VoreSelectedBellyVisuals = (props, context) => { content={absorbed_voresprite ? 'Yes' : 'No'} /> + +