From b22ada5b3c2dba33dde43554a8f66424831262f6 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Thu, 13 Feb 2025 00:24:02 +0100 Subject: [PATCH] updates belly handling (#17126) --- .../mob/living/silicon/robot/robot_bellies.dm | 2 +- code/modules/vore/eating/belly_import.dm | 2 +- code/modules/vore/eating/belly_obj_vr.dm | 28 +++-------- .../vore/eating/bellymodes_datum_vr.dm | 16 +++---- code/modules/vore/eating/living_bellies.dm | 7 +++ code/modules/vore/eating/vorepanel_vr.dm | 46 +++++-------------- 6 files changed, 34 insertions(+), 67 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/robot_bellies.dm b/code/modules/mob/living/silicon/robot/robot_bellies.dm index 01ca34d8677..51d65064abe 100644 --- a/code/modules/mob/living/silicon/robot/robot_bellies.dm +++ b/code/modules/mob/living/silicon/robot/robot_bellies.dm @@ -16,7 +16,7 @@ if(sprite_datum.has_sleeper_light_indicator) vore_light_states = list("sleeper" = 0) sprite_datum.belly_light_list = list("sleeper") - update_fullness() //Set how full the newly defined bellies are, if they're already full + handle_belly_update() //Set how full the newly defined bellies are, if they're already full /mob/living/silicon/robot/proc/reset_belly_lights(var/b_class) if(sprite_datum.belly_light_list.len && sprite_datum.belly_light_list.Find(b_class)) diff --git a/code/modules/vore/eating/belly_import.dm b/code/modules/vore/eating/belly_import.dm index 9ca2b27e814..002987ba00d 100644 --- a/code/modules/vore/eating/belly_import.dm +++ b/code/modules/vore/eating/belly_import.dm @@ -1175,6 +1175,6 @@ new_belly.items_preserved.Cut() // new_belly.update_internal_overlay() // Signal not implemented! - host.update_fullness() + host.handle_belly_update() host.updateVRPanel() unsaved_changes = TRUE diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index c4c445534e7..997494215a8 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -311,7 +311,7 @@ if(M.ai_holder) M.ai_holder.handle_eaten() - owner.update_fullness() + owner.handle_belly_update() // Intended for simple mobs if(!owner.client && autotransferlocation && autotransferchance > 0) @@ -331,7 +331,7 @@ L.toggle_hud_vis() if((L.stat != DEAD) && L.ai_holder) L.ai_holder.go_wake() - owner.update_fullness() + owner.handle_belly_update() return @@ -443,8 +443,6 @@ //Clean up our own business items_preserved.Cut() - if(!ishuman(owner)) - owner.update_icons() //Determines privacy var/privacy_range = world.view @@ -528,9 +526,6 @@ if(ML.stat) ML.SetSleeping(min(ML.sleeping,20)) - //Clean up our own business - if(!ishuman(owner)) - owner.update_icons() //Determines privacy var/privacy_range = world.view @@ -578,8 +573,6 @@ var/mob/ourmob = prey ourmob.reset_view(owner) owner.updateVRPanel() - if(isanimal(owner)) - owner.update_icon() for(var/mob/living/M in contents) M.updateVRPanel() @@ -639,10 +632,7 @@ if(G) G.forceMove(src) qdel(M) - if(isanimal(owner)) - owner.update_icon() - else - owner.update_fullness() + owner.handle_belly_update() // Handle a mob being absorbed /obj/belly/proc/absorb_living(mob/living/M) @@ -690,10 +680,7 @@ //Update owner owner.updateVRPanel() - if(isanimal(owner)) - owner.update_icon() - else - owner.update_fullness() + owner.handle_belly_update() // Finally, if they're to be sent to a special pudge belly, send them there if(transferlocation_absorb) var/obj/belly/dest_belly @@ -720,10 +707,7 @@ //Update owner owner.updateVRPanel() - if(isanimal(owner)) - owner.update_icon() - else - owner.update_fullness() + owner.handle_belly_update() ///////////////////////////////////////////////////////////////////////// /obj/belly/proc/handle_absorb_langs() @@ -1020,7 +1004,7 @@ owner.updateVRPanel() for(var/mob/living/M in contents) M.updateVRPanel() - owner.update_icon() + owner.handle_belly_update() //Autotransfer callback /obj/belly/proc/check_autotransfer(var/prey, var/autotransferlocation) diff --git a/code/modules/vore/eating/bellymodes_datum_vr.dm b/code/modules/vore/eating/bellymodes_datum_vr.dm index c74403a995a..ac91fb29586 100644 --- a/code/modules/vore/eating/bellymodes_datum_vr.dm +++ b/code/modules/vore/eating/bellymodes_datum_vr.dm @@ -36,7 +36,7 @@ GLOBAL_LIST_INIT(digest_modes, list()) SEND_SOUND(L, sound(get_sfx("fancy_death_prey"))) B.handle_digestion_death(L) if(!L) - B.owner.update_fullness() + B.owner.handle_belly_update() if(!B.fancy_vore) return list("to_update" = TRUE, "soundToPlay" = sound(get_sfx("classic_death_sounds"))) return list("to_update" = TRUE, "soundToPlay" = sound(get_sfx("fancy_death_pred"))) @@ -64,7 +64,7 @@ GLOBAL_LIST_INIT(digest_modes, list()) var/difference = B.owner.size_multiplier / L.size_multiplier if(B.health_impacts_size) - B.owner.update_fullness() + B.owner.handle_belly_update() consider_healthbar(L, old_health, B.owner) @@ -121,7 +121,7 @@ GLOBAL_LIST_INIT(digest_modes, list()) L.resize(L.size_multiplier - 0.01) // Shrink by 1% per tick if(L.size_multiplier <= B.shrink_grow_size) // Adds some feedback so the pred knows their prey has stopped shrinking. to_chat(B.owner, span_vnotice("You feel [L] get as small as you would like within your [lowertext(B.name)].")) - B.owner.update_fullness() + B.owner.handle_belly_update() . = ..() /datum/digest_mode/grow @@ -133,7 +133,7 @@ GLOBAL_LIST_INIT(digest_modes, list()) L.resize(L.size_multiplier + 0.01) // Shrink by 1% per tick if(L.size_multiplier >= B.shrink_grow_size) // Adds some feedback so the pred knows their prey has stopped growing. to_chat(B.owner, span_vnotice("You feel [L] get as big as you would like within your [lowertext(B.name)].")) - B.owner.update_fullness() + B.owner.handle_belly_update() /datum/digest_mode/drain/sizesteal id = DM_SIZE_STEAL @@ -146,7 +146,7 @@ GLOBAL_LIST_INIT(digest_modes, list()) L.resize(L.size_multiplier - 0.01) //Shrink by 1% per tick if(L.size_multiplier <= B.shrink_grow_size) // Adds some feedback so the pred knows their prey has stopped shrinking. to_chat(B.owner, span_vnotice("You feel [L] get as small as you would like within your [lowertext(B.name)].")) - B.owner.update_fullness() + B.owner.handle_belly_update() . = ..() /datum/digest_mode/heal @@ -165,14 +165,14 @@ GLOBAL_LIST_INIT(digest_modes, list()) O.heal_damage(0.5, 0.5, 0, 1) // Less effective healing as able to fix broken limbs B.owner.adjust_nutrition(-5) // More costly for the pred, since metals and stuff if(B.health_impacts_size) - B.owner.update_fullness() + B.owner.handle_belly_update() if(L.health < L.maxHealth) L.adjustToxLoss(-2) L.adjustOxyLoss(-2) L.adjustCloneLoss(-1) B.owner.adjust_nutrition(-1) // Normal cost per old functionality if(B.health_impacts_size) - B.owner.update_fullness() + B.owner.handle_belly_update() if(B.owner.nutrition > 90 && (L.health < L.maxHealth) && !H.isSynthetic()) L.adjustBruteLoss(-2.5) L.adjustFireLoss(-2.5) @@ -181,7 +181,7 @@ GLOBAL_LIST_INIT(digest_modes, list()) L.adjustCloneLoss(-1.25) B.owner.adjust_nutrition(-2) if(B.health_impacts_size) - B.owner.update_fullness() + B.owner.handle_belly_update() if(L.nutrition <= 400) L.adjust_nutrition(1) else if(B.owner.nutrition > 90 && (L.nutrition <= 400)) diff --git a/code/modules/vore/eating/living_bellies.dm b/code/modules/vore/eating/living_bellies.dm index fe352c8f380..b02c991b5ac 100644 --- a/code/modules/vore/eating/living_bellies.dm +++ b/code/modules/vore/eating/living_bellies.dm @@ -34,3 +34,10 @@ /mob/living/proc/vs_animate(var/belly_to_animate) return + +// use this instead of upsate fullness where you need to directly update a belly size +/mob/proc/handle_belly_update() + if(ishuman(src)) + update_fullness() + return + update_icon() diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 05692c4ebf1..801c4a0dac4 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -1779,56 +1779,35 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", return FALSE else host.vore_selected.belly_sprite_to_affect = belly_choice - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_affects_vore_sprites") host.vore_selected.affects_vore_sprites = !host.vore_selected.affects_vore_sprites - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_count_absorbed_prey_for_sprites") host.vore_selected.count_absorbed_prey_for_sprite = !host.vore_selected.count_absorbed_prey_for_sprite - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_absorbed_multiplier") var/absorbed_multiplier_input = tgui_input_number(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", host.vore_selected.absorbed_multiplier, 3, 0.1, round_value=FALSE) if(!isnull(absorbed_multiplier_input)) host.vore_selected.absorbed_multiplier = CLAMP(absorbed_multiplier_input, 0.1, 3) - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_count_items_for_sprites") host.vore_selected.count_items_for_sprite = !host.vore_selected.count_items_for_sprite - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_item_multiplier") var/item_multiplier_input = tgui_input_number(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", host.vore_selected.item_multiplier, 10, 0.1, round_value=FALSE) if(!isnull(item_multiplier_input)) host.vore_selected.item_multiplier = CLAMP(item_multiplier_input, 0.1, 10) - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_health_impacts_size") host.vore_selected.health_impacts_size = !host.vore_selected.health_impacts_size - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_resist_animation") host.vore_selected.resist_triggers_animation = !host.vore_selected.resist_triggers_animation @@ -1837,10 +1816,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", var/size_factor_input = tgui_input_number(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", host.vore_selected.size_factor_for_sprite, 3, 0.1, round_value=FALSE) if(!isnull(size_factor_input)) host.vore_selected.size_factor_for_sprite = CLAMP(size_factor_input, 0.1, 3) - if(isanimal(host)) - host.update_icon() - else - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_vore_sprite_flags") var/list/menu_list = host.vore_selected.vore_sprite_flag_list.Copy() @@ -1855,7 +1831,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", return FALSE else host.vore_selected.undergarment_chosen = undergarment_choice.name - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_undergarment_if_none") var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[host.vore_selected.undergarment_chosen] @@ -1864,13 +1840,13 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", return FALSE else host.vore_selected.undergarment_if_none = selected_underwear - host.update_fullness() + host.handle_belly_update() host.updateVRPanel() if("b_undergarment_color") var/newcolor = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.undergarment_color) if(newcolor) host.vore_selected.undergarment_color = newcolor - host.update_fullness() + host.handle_belly_update() . = TRUE if("b_tail_to_change_to") var/tail_choice = tgui_input_list(user, "Which tail sprite do you want to use when your [lowertext(host.vore_selected.name)] is filled?","Select Sprite", global.tail_styles_list)