[MIRROR] Intent based struggles (#12242)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-01-12 23:51:59 +01:00
committed by GitHub
co-authored by Kashargul
parent a7ce5cc712
commit 97e8bcf6e1
54 changed files with 721 additions and 453 deletions
+4 -2
View File
@@ -844,9 +844,11 @@
if(isnum(belly_data["escapable"]))
var/new_escapable = belly_data["escapable"]
if(new_escapable == 0)
new_belly.escapable = FALSE
new_belly.escapable = B_ESCAPABLE_NONE
if(new_escapable == 1)
new_belly.escapable = TRUE
new_belly.escapable = B_ESCAPABLE_DEFAULT
if(new_escapable == 2)
new_belly.escapable = B_ESCAPABLE_INTENT
if(isnum(belly_data["escapechance"]))
var/new_escapechance = belly_data["escapechance"]
@@ -30,7 +30,7 @@
var/digest_tox = 0 // Toxins damage per tick in digestion mode
var/digest_clone = 0 // Clone damage per tick in digestion mode
var/immutable = FALSE // Prevents this belly from being deleted
var/escapable = FALSE // Belly can be resisted out of at any time
var/escapable = B_ESCAPABLE_NONE // Belly can be resisted out of at any time
var/escapetime = 10 SECONDS // Deciseconds, how long to escape this belly
var/selectchance = 0 // % Chance of stomach switching to selective mode if prey struggles
var/digestchance = 0 // % Chance of stomach beginning to digest if prey struggles
+136 -119
View File
@@ -1,18 +1,18 @@
//Handle a mob struggling
// Called from /mob/living/carbon/relaymove()
/obj/belly/proc/relay_resist(mob/living/R, obj/item/C)
if (!(R in contents))
if(!C)
/obj/belly/proc/relay_resist(mob/living/living_prey, obj/item/prey_item)
if (!(living_prey in contents))
if(!prey_item)
return // User is not in this belly
R.setClickCooldown(50)
living_prey.setClickCooldown(50)
if(owner.stat) //If owner is stat (dead, KO) we can actually escape
resist_default_escape(R, C)
resist_default_escape(living_prey, prey_item)
return
if(displayed_message_flags & MS_FLAG_STRUGGLE_OUTSIDE)
resist_struggle_outside(R)
resist_struggle_outside(living_prey)
if((vore_sprite_flags & DM_FLAG_VORESPRITE_BELLY) && (owner.vore_capacity_ex[belly_sprite_to_affect] >= 1) && !private_struggle && resist_triggers_animation && affects_vore_sprites)
owner.vs_animate(belly_sprite_to_affect)
@@ -20,60 +20,77 @@
if(!private_struggle)
resist_play_sound()
if(prob(belchchance))//Unsure if this should go in escapable or not, leaving it here for now.
if((prob(belchchance) && escapable != B_ESCAPABLE_INTENT) || (living_prey.a_intent == I_HELP && escapable == B_ESCAPABLE_INTENT))
owner.emote("belch")
if(escapable) //If the stomach has escapable enabled.
if(resist_check_escapechance(R, C))
return
if(resist_check_transferchance(R, C))
return
if(resist_check_secondary_transferchance(R,C))
return
if(resist_check_absorbchance(R))
return
if(resist_check_digestchance(R))
return
if(resist_check_selectchance(R))
return
var/struggle_user_message = span_valert(belly_format_string(struggle_messages_inside, R))
to_chat(R, struggle_user_message)
to_chat(owner, span_vwarning("Your prey appears to be unable to make any progress in escaping your [lowertext(name)]."))
if(!escapable) //If the stomach has escapable enabled.
var/struggle_user_message = span_valert(belly_format_string(struggle_messages_inside, living_prey))
to_chat(living_prey, struggle_user_message)
return
var/struggle_user_message = span_valert(belly_format_string(struggle_messages_inside, R))
to_chat(R, struggle_user_message)
if(escapable == B_ESCAPABLE_INTENT && living_prey.a_intent != I_HELP)
switch(living_prey.a_intent)
if(I_HURT)
if(resist_check_escapechance(living_prey, prey_item))
return
if(I_DISARM)
if(resist_check_transferchance(living_prey, prey_item))
return
if(resist_check_secondary_transferchance(living_prey,prey_item))
return
if(I_GRAB)
if(resist_check_absorbchance(living_prey))
return
if(resist_check_digestchance(living_prey))
return
if(resist_check_selectchance(living_prey))
return
else
if(resist_check_escapechance(living_prey, prey_item))
return
if(resist_check_transferchance(living_prey, prey_item))
return
if(resist_check_secondary_transferchance(living_prey,prey_item))
return
if(resist_check_absorbchance(living_prey))
return
if(resist_check_digestchance(living_prey))
return
if(resist_check_selectchance(living_prey))
return
/obj/belly/proc/resist_default_escape(mob/living/R, obj/item/C)
var/escape_attempt_owner_message = span_vwarning(belly_format_string(escape_attempt_messages_owner, R))
var/escape_attempt_prey_message = span_vwarning(belly_format_string(escape_attempt_messages_prey, R))
var/escape_fail_owner_message = span_vwarning(belly_format_string(escape_fail_messages_owner, R))
var/escape_fail_prey_message = span_vnotice(belly_format_string(escape_fail_messages_prey, R))
var/struggle_user_message = span_valert(belly_format_string(struggle_messages_inside, living_prey))
to_chat(living_prey, struggle_user_message)
to_chat(owner, span_vwarning("Your prey appears to be unable to make any progress in escaping your [lowertext(name)]."))
/obj/belly/proc/resist_default_escape(mob/living/living_prey, obj/item/prey_item)
var/escape_attempt_owner_message = span_vwarning(belly_format_string(escape_attempt_messages_owner, living_prey))
var/escape_attempt_prey_message = span_vwarning(belly_format_string(escape_attempt_messages_prey, living_prey))
var/escape_fail_owner_message = span_vwarning(belly_format_string(escape_fail_messages_owner, living_prey))
var/escape_fail_prey_message = span_vnotice(belly_format_string(escape_fail_messages_prey, living_prey))
escape_attempt_prey_message = span_vwarning("[escape_attempt_prey_message] (will take around [escapetime/10] seconds.)")
to_chat(R, escape_attempt_prey_message)
to_chat(living_prey, escape_attempt_prey_message)
to_chat(owner, escape_attempt_owner_message)
if(do_after(R, escapetime, owner, target = src, timed_action_flags = IGNORE_INCAPACITATED))
if(do_after(living_prey, escapetime, owner, target = src, timed_action_flags = IGNORE_INCAPACITATED))
if((owner.stat || escapable)) //Can still escape?
if(C)
release_specific_contents(C)
if(prey_item)
release_specific_contents(prey_item)
return
if(R.loc == src)
release_specific_contents(R)
if(living_prey.loc == src)
release_specific_contents(living_prey)
return
if(R.loc != src) //Aren't even in the belly. Quietly fail.
if(living_prey.loc != src) //Aren't even in the belly. Quietly fail.
return
//Belly became inescapable or mob revived
to_chat(R, escape_fail_prey_message)
to_chat(living_prey, escape_fail_prey_message)
to_chat(owner, escape_fail_owner_message)
/obj/belly/proc/resist_struggle_outside(mob/living/R)
var/struggle_outer_message = span_valert(belly_format_string(struggle_messages_outside, R))
/obj/belly/proc/resist_struggle_outside(mob/living/living_prey)
var/struggle_outer_message = span_valert(belly_format_string(struggle_messages_outside, living_prey))
if(private_struggle)
to_chat(owner, struggle_outer_message)
return
@@ -93,59 +110,59 @@
var/sound/struggle_rustle = sound(get_sfx("rustle"))
playsound(src, struggle_rustle, vary = 1, vol = 75, falloff = VORE_SOUND_FALLOFF, frequency = noise_freq, preference = /datum/preference/toggle/digestion_noises, volume_channel = VOLUME_CHANNEL_VORE)
/obj/belly/proc/resist_check_escapechance(mob/living/R, obj/item/C)
/obj/belly/proc/resist_check_escapechance(mob/living/living_prey, obj/item/prey_item)
if(!prob(escapechance)) //Let's have it check to see if the prey escapes first.
return FALSE
var/escape_attempt_owner_message = span_vwarning(belly_format_string(escape_attempt_messages_owner, R))
var/escape_attempt_prey_message = span_vwarning(belly_format_string(escape_attempt_messages_prey, R))
var/escape_fail_owner_message = span_vwarning(belly_format_string(escape_fail_messages_owner, R))
var/escape_fail_prey_message = span_vnotice(belly_format_string(escape_fail_messages_prey, R))
to_chat(R, escape_attempt_prey_message)
var/escape_attempt_owner_message = span_vwarning(belly_format_string(escape_attempt_messages_owner, living_prey))
var/escape_attempt_prey_message = span_vwarning(belly_format_string(escape_attempt_messages_prey, living_prey))
var/escape_fail_owner_message = span_vwarning(belly_format_string(escape_fail_messages_owner, living_prey))
var/escape_fail_prey_message = span_vnotice(belly_format_string(escape_fail_messages_prey, living_prey))
to_chat(living_prey, escape_attempt_prey_message)
to_chat(owner, escape_attempt_owner_message)
if(do_after(R, escapetime, target = src))
if(escapable && C)
var/escape_item_owner_message = span_vwarning(belly_format_string(escape_item_messages_owner, R, item = C))
var/escape_item_prey_message = span_vwarning(belly_format_string(escape_item_messages_prey, R, item = C))
var/escape_item_outside_message = span_vwarning(belly_format_string(escape_item_messages_outside, R, item = C))
if(do_after(living_prey, escapetime, target = src))
if(escapable && prey_item)
var/escape_item_owner_message = span_vwarning(belly_format_string(escape_item_messages_owner, living_prey, item = prey_item))
var/escape_item_prey_message = span_vwarning(belly_format_string(escape_item_messages_prey, living_prey, item = prey_item))
var/escape_item_outside_message = span_vwarning(belly_format_string(escape_item_messages_outside, living_prey, item = prey_item))
release_specific_contents(C)
to_chat(R, escape_item_prey_message)
release_specific_contents(prey_item)
to_chat(living_prey, escape_item_prey_message)
to_chat(owner, escape_item_owner_message)
if(!private_struggle)
for(var/mob/M in hearers(4, owner))
M.show_message(escape_item_outside_message, 2)
return TRUE
if(escapable && (R.loc == src) && !R.absorbed) //Does the owner still have escapable enabled?
var/escape_owner_message = span_vwarning(belly_format_string(escape_messages_owner, R))
var/escape_prey_message = span_vwarning(belly_format_string(escape_messages_prey, R))
var/escape_outside_message = span_vwarning(belly_format_string(escape_messages_outside, R))
if(escapable && (living_prey.loc == src) && !living_prey.absorbed) //Does the owner still have escapable enabled?
var/escape_owner_message = span_vwarning(belly_format_string(escape_messages_owner, living_prey))
var/escape_prey_message = span_vwarning(belly_format_string(escape_messages_prey, living_prey))
var/escape_outside_message = span_vwarning(belly_format_string(escape_messages_outside, living_prey))
release_specific_contents(R)
to_chat(R, escape_prey_message)
release_specific_contents(living_prey)
to_chat(living_prey, escape_prey_message)
to_chat(owner, escape_owner_message)
if(!private_struggle)
for(var/mob/M in hearers(4, owner))
M.show_message(escape_outside_message, 2)
return TRUE
if(!(R.loc == src)) //Aren't even in the belly. Quietly fail.
if(!(living_prey.loc == src)) //Aren't even in the belly. Quietly fail.
return TRUE
//Belly became inescapable.
to_chat(R, escape_fail_prey_message)
to_chat(living_prey, escape_fail_prey_message)
to_chat(owner, escape_fail_owner_message)
return TRUE
/obj/belly/proc/resist_check_transferchance(mob/living/R, obj/item/C)
/obj/belly/proc/resist_check_transferchance(mob/living/living_prey, obj/item/prey_item)
if(!prob(transferchance) || !transferlocation) //Next, let's have it see if they end up getting into an even bigger mess then when they started.
return FALSE
var/obj/belly/dest_belly
for(var/obj/belly/B as anything in owner.vore_organs)
if(B.name == transferlocation)
dest_belly = B
for(var/obj/belly/current_belly as anything in owner.vore_organs)
if(current_belly.name == transferlocation)
dest_belly = current_belly
break
if(!dest_belly)
@@ -154,26 +171,26 @@
transferlocation = null
return TRUE
var/primary_transfer_owner_message = span_vwarning(belly_format_string(primary_transfer_messages_owner, R, dest = transferlocation))
var/primary_transfer_prey_message = span_vwarning(belly_format_string(primary_transfer_messages_prey, R, dest = transferlocation))
var/primary_transfer_owner_message = span_vwarning(belly_format_string(primary_transfer_messages_owner, living_prey, dest = transferlocation))
var/primary_transfer_prey_message = span_vwarning(belly_format_string(primary_transfer_messages_prey, living_prey, dest = transferlocation))
to_chat(R, primary_transfer_prey_message)
to_chat(living_prey, primary_transfer_prey_message)
to_chat(owner, primary_transfer_owner_message)
if(C)
transfer_contents(C, dest_belly)
if(prey_item)
transfer_contents(prey_item, dest_belly)
return TRUE
transfer_contents(R, dest_belly)
transfer_contents(living_prey, dest_belly)
return TRUE
/obj/belly/proc/resist_check_secondary_transferchance(mob/living/R, obj/item/C)
/obj/belly/proc/resist_check_secondary_transferchance(mob/living/living_prey, obj/item/prey_item)
if(!prob(transferchance_secondary) || !transferlocation_secondary) //After the first potential mess getting into, run the secondary one which might be even bigger of a mess.
return FALSE
var/obj/belly/dest_belly
for(var/obj/belly/B as anything in owner.vore_organs)
if(B.name == transferlocation_secondary)
dest_belly = B
for(var/obj/belly/current_belly as anything in owner.vore_organs)
if(current_belly.name == transferlocation_secondary)
dest_belly = current_belly
break
if(!dest_belly)
@@ -182,74 +199,74 @@
transferlocation_secondary = null
return TRUE
var/secondary_transfer_owner_message = span_vwarning(belly_format_string(secondary_transfer_messages_owner, R, dest = transferlocation_secondary))
var/secondary_transfer_prey_message = span_vwarning(belly_format_string(secondary_transfer_messages_prey, R, dest = transferlocation_secondary))
var/secondary_transfer_owner_message = span_vwarning(belly_format_string(secondary_transfer_messages_owner, living_prey, dest = transferlocation_secondary))
var/secondary_transfer_prey_message = span_vwarning(belly_format_string(secondary_transfer_messages_prey, living_prey, dest = transferlocation_secondary))
to_chat(R, secondary_transfer_prey_message)
to_chat(living_prey, secondary_transfer_prey_message)
to_chat(owner, secondary_transfer_owner_message)
if(C)
transfer_contents(C, dest_belly)
if(prey_item)
transfer_contents(prey_item, dest_belly)
return TRUE
transfer_contents(R, dest_belly)
transfer_contents(living_prey, dest_belly)
return TRUE
/obj/belly/proc/resist_check_absorbchance(mob/living/R)
/obj/belly/proc/resist_check_absorbchance(mob/living/living_prey)
if(!prob(absorbchance) || digest_mode == DM_ABSORB) //After that, let's have it run the absorb chance.
return FALSE
var/absorb_chance_owner_message = span_vwarning(belly_format_string(absorb_chance_messages_owner, R))
var/absorb_chance_prey_message = span_vwarning(belly_format_string(absorb_chance_messages_prey, R))
var/absorb_chance_owner_message = span_vwarning(belly_format_string(absorb_chance_messages_owner, living_prey))
var/absorb_chance_prey_message = span_vwarning(belly_format_string(absorb_chance_messages_prey, living_prey))
to_chat(R, absorb_chance_prey_message)
to_chat(living_prey, absorb_chance_prey_message)
to_chat(owner, absorb_chance_owner_message)
digest_mode = DM_ABSORB
return TRUE
/obj/belly/proc/resist_check_digestchance(mob/living/R)
/obj/belly/proc/resist_check_digestchance(mob/living/living_prey)
if(!prob(digestchance) || digest_mode == DM_DIGEST) //Then, let's see if it should run the digest chance.
return FALSE
var/digest_chance_owner_message = span_vwarning(belly_format_string(digest_chance_messages_owner, R))
var/digest_chance_prey_message = span_vwarning(belly_format_string(digest_chance_messages_prey, R))
var/digest_chance_owner_message = span_vwarning(belly_format_string(digest_chance_messages_owner, living_prey))
var/digest_chance_prey_message = span_vwarning(belly_format_string(digest_chance_messages_prey, living_prey))
to_chat(R, digest_chance_prey_message)
to_chat(living_prey, digest_chance_prey_message)
to_chat(owner, digest_chance_owner_message)
digest_mode = DM_DIGEST
return TRUE
/obj/belly/proc/resist_check_selectchance(mob/living/R)
/obj/belly/proc/resist_check_selectchance(mob/living/living_prey)
if(!prob(selectchance) || digest_mode == DM_SELECT) //Finally, let's see if it should run the selective mode chance.
return FALSE
var/select_chance_owner_message = span_vwarning(belly_format_string(select_chance_messages_owner, R))
var/select_chance_prey_message = span_vwarning(belly_format_string(select_chance_messages_prey, R))
var/select_chance_owner_message = span_vwarning(belly_format_string(select_chance_messages_owner, living_prey))
var/select_chance_prey_message = span_vwarning(belly_format_string(select_chance_messages_prey, living_prey))
to_chat(R, select_chance_prey_message)
to_chat(living_prey, select_chance_prey_message)
to_chat(owner, select_chance_owner_message)
digest_mode = DM_SELECT
return TRUE
// Absorbed resist handling
/obj/belly/proc/relay_absorbed_resist(mob/living/R)
if (!(R in contents) || !R.absorbed)
/obj/belly/proc/relay_absorbed_resist(mob/living/living_prey)
if (!(living_prey in contents) || !living_prey.absorbed)
return // User is not in this belly or isn't actually absorbed
R.setClickCooldown(50)
living_prey.setClickCooldown(50)
if(displayed_message_flags & MS_FLAG_STRUGGLE_ABSORBED_OUTSIDE)
absorbed_resist_struggle_outside(R)
absorbed_resist_struggle_outside(living_prey)
if(!private_struggle)
resist_play_sound()
//absorb resists
if(escapable || owner.stat) //If the stomach has escapable enabled or the owner is dead/unconscious
if(absorbed_resist_check_escapechance(R))
if(absorbed_resist_check_escapechance(living_prey))
return
var/struggle_user_message = span_valert(belly_format_string(absorbed_struggle_messages_inside, R, use_absorbed_count = TRUE))
to_chat(R, struggle_user_message)
var/struggle_user_message = span_valert(belly_format_string(absorbed_struggle_messages_inside, living_prey, use_absorbed_count = TRUE))
to_chat(living_prey, struggle_user_message)
/obj/belly/proc/absorbed_resist_struggle_outside(mob/living/R)
var/struggle_outer_message = span_valert(belly_format_string(absorbed_struggle_messages_outside, R, use_absorbed_count = TRUE))
/obj/belly/proc/absorbed_resist_struggle_outside(mob/living/living_prey)
var/struggle_outer_message = span_valert(belly_format_string(absorbed_struggle_messages_outside, living_prey, use_absorbed_count = TRUE))
if(private_struggle)
to_chat(owner, struggle_outer_message)
return
@@ -257,35 +274,35 @@
for(var/mob/M in hearers(4, owner))
M.show_message(struggle_outer_message, 2) // hearable
/obj/belly/proc/absorbed_resist_check_escapechance(mob/living/R)
/obj/belly/proc/absorbed_resist_check_escapechance(mob/living/living_prey)
if(!(prob(escapechance_absorbed) || owner.stat)) //Let's have it check to see if the prey's escape attempt starts.
return FALSE
var/escape_attempt_absorbed_owner_message = span_vwarning(belly_format_string(escape_attempt_absorbed_messages_owner, R))
var/escape_attempt_absorbed_prey_message = span_vwarning(belly_format_string(escape_attempt_absorbed_messages_prey, R))
var/escape_attempt_absorbed_owner_message = span_vwarning(belly_format_string(escape_attempt_absorbed_messages_owner, living_prey))
var/escape_attempt_absorbed_prey_message = span_vwarning(belly_format_string(escape_attempt_absorbed_messages_prey, living_prey))
to_chat(R, escape_attempt_absorbed_prey_message)
to_chat(living_prey, escape_attempt_absorbed_prey_message)
to_chat(owner, escape_attempt_absorbed_owner_message)
if(do_after(R, escapetime, target = src))
if((escapable || owner.stat) && (R.loc == src) && prob(escapechance_absorbed)) //Does the escape attempt succeed?
var/escape_absorbed_owner_message = span_vwarning(belly_format_string(escape_absorbed_messages_owner, R))
var/escape_absorbed_prey_message = span_vwarning(belly_format_string(escape_absorbed_messages_prey, R))
var/escape_absorbed_outside_message = span_vwarning(belly_format_string(escape_absorbed_messages_outside, R))
if(do_after(living_prey, escapetime, target = src))
if((escapable || owner.stat) && (living_prey.loc == src) && prob(escapechance_absorbed)) //Does the escape attempt succeed?
var/escape_absorbed_owner_message = span_vwarning(belly_format_string(escape_absorbed_messages_owner, living_prey))
var/escape_absorbed_prey_message = span_vwarning(belly_format_string(escape_absorbed_messages_prey, living_prey))
var/escape_absorbed_outside_message = span_vwarning(belly_format_string(escape_absorbed_messages_outside, living_prey))
release_specific_contents(R)
to_chat(R, escape_absorbed_prey_message)
release_specific_contents(living_prey)
to_chat(living_prey, escape_absorbed_prey_message)
to_chat(owner, escape_absorbed_owner_message)
if(!private_struggle)
for(var/mob/M in hearers(4, owner))
M.show_message(escape_absorbed_outside_message, 2)
return TRUE
if(!(R.loc == src)) //Aren't even in the belly. Quietly fail.
if(!(living_prey.loc == src)) //Aren't even in the belly. Quietly fail.
return TRUE
//Belly became inescapable or you failed your roll.
var/escape_fail_absorbed_owner_message = span_vwarning(belly_format_string(escape_fail_absorbed_messages_owner, R))
var/escape_fail_absorbed_prey_message = span_vnotice(belly_format_string(escape_fail_absorbed_messages_prey, R))
var/escape_fail_absorbed_owner_message = span_vwarning(belly_format_string(escape_fail_absorbed_messages_owner, living_prey))
var/escape_fail_absorbed_prey_message = span_vnotice(belly_format_string(escape_fail_absorbed_messages_prey, living_prey))
to_chat(R, escape_fail_absorbed_prey_message)
to_chat(living_prey, escape_fail_absorbed_prey_message)
to_chat(owner, escape_fail_absorbed_owner_message)
return TRUE
+101 -101
View File
@@ -1,27 +1,27 @@
// SEND_SIGNAL(COMSIG_BELLY_UPDATE_VORE_FX) is sometimes used when calling vore_fx() to send belly visuals
// to certain non-belly atoms. Not called here as vore_fx() is usually only called if a mob is in the belly.
// Don't forget it if you need to rework vore_fx().
/obj/belly/proc/vore_fx(mob/living/L, var/severity = 0)
if(!istype(L))
/obj/belly/proc/vore_fx(mob/living/living_prey, var/severity = 0)
if(!istype(living_prey))
return
if(!L.client)
if(!living_prey.client)
return
if(L.previewing_belly && L.previewing_belly != src)
if(living_prey.previewing_belly && living_prey.previewing_belly != src)
return
if(L.previewing_belly == src && L.vore_selected != src)
L.previewing_belly = null
if(living_prey.previewing_belly == src && living_prey.vore_selected != src)
living_prey.previewing_belly = null
return
if(!L.show_vore_fx)
L.clear_fullscreen("belly")
L.previewing_belly = null
if(!living_prey.show_vore_fx)
living_prey.clear_fullscreen("belly")
living_prey.previewing_belly = null
return
if(!belly_fullscreen)
L.clear_fullscreen("belly")
check_hud_disable(L)
living_prey.clear_fullscreen("belly")
check_hud_disable(living_prey)
return
if(colorization_enabled)
var/atom/movable/screen/fullscreen/F = L.overlay_fullscreen("belly", /atom/movable/screen/fullscreen/belly, severity) // preserving save data
var/atom/movable/screen/fullscreen/fullscreen_overlay = living_prey.overlay_fullscreen("belly", /atom/movable/screen/fullscreen/belly, severity) // preserving save data
var/datum/belly_overlays/lookup_belly_path = text2path("/datum/belly_overlays/[lowertext(belly_fullscreen)]")
if(!lookup_belly_path)
var/used_fullscreen = belly_fullscreen
@@ -29,30 +29,30 @@
belly_fullscreen = null
log_runtime("Icon datum was not defined for [used_fullscreen]")
var/alpha = min(belly_fullscreen_alpha, L.max_voreoverlay_alpha)
F.icon = initial(lookup_belly_path.belly_icon)
F.cut_overlays()
var/image/I = image(F.icon, belly_fullscreen) //Would be cool if I could just include color and alpha in the image define so we don't have to copy paste
I.color = belly_fullscreen_color
I.alpha = alpha
F.add_overlay(I)
I = image(F.icon, belly_fullscreen+"-2")
I.color = belly_fullscreen_color2
I.alpha = alpha
F.add_overlay(I)
I = image(F.icon, belly_fullscreen+"-3")
I.color = belly_fullscreen_color3
I.alpha = alpha
F.add_overlay(I)
I = image(F.icon, belly_fullscreen+"-4")
I.color = belly_fullscreen_color4
I.alpha = alpha
F.add_overlay(I)
var/alpha = min(belly_fullscreen_alpha, living_prey.max_voreoverlay_alpha)
fullscreen_overlay.icon = initial(lookup_belly_path.belly_icon)
fullscreen_overlay.cut_overlays()
var/image/overlay_image = image(fullscreen_overlay.icon, belly_fullscreen) //Would be cool if overlay_image could just include color and alpha in the image define so we don't have to copy paste
overlay_image.color = belly_fullscreen_color
overlay_image.alpha = alpha
fullscreen_overlay.add_overlay(overlay_image)
overlay_image = image(fullscreen_overlay.icon, belly_fullscreen+"-2")
overlay_image.color = belly_fullscreen_color2
overlay_image.alpha = alpha
fullscreen_overlay.add_overlay(overlay_image)
overlay_image = image(fullscreen_overlay.icon, belly_fullscreen+"-3")
overlay_image.color = belly_fullscreen_color3
overlay_image.alpha = alpha
fullscreen_overlay.add_overlay(overlay_image)
overlay_image = image(fullscreen_overlay.icon, belly_fullscreen+"-4")
overlay_image.color = belly_fullscreen_color4
overlay_image.alpha = alpha
fullscreen_overlay.add_overlay(overlay_image)
var/extra_mush = 0
var/extra_mush_color = mush_color
if(L.liquidbelly_visuals && ishuman(owner) && metabolism_overlay && metabolism_mush_ratio > 0)
var/mob/living/carbon/human/H = owner
var/datum/reagents/metabolism/ingested = H.ingested
if(living_prey.liquidbelly_visuals && ishuman(owner) && metabolism_overlay && metabolism_mush_ratio > 0)
var/mob/living/carbon/human/human_owner = owner
var/datum/reagents/metabolism/ingested = human_owner.ingested
if(ingested && ingested.total_volume > 0)
if(custom_ingested_color)
extra_mush_color = custom_ingested_color
@@ -60,36 +60,36 @@
extra_mush_color = ingested.get_color()
extra_mush = ingested.total_volume * metabolism_mush_ratio
if(!mush_overlay)
I = get_mush_overlay(extra_mush_color, min(custom_ingested_alpha, L.max_voreoverlay_alpha), max_ingested, ingested.total_volume)
F.add_overlay(I)
if(show_liquids && L.liquidbelly_visuals && mush_overlay && (owner.nutrition > 0 || max_mush == 0 || min_mush > 0 || (LAZYLEN(contents) * item_mush_val) > 0))
I = get_mush_overlay(mush_color, min(mush_alpha, L.max_voreoverlay_alpha), max_mush, owner.nutrition + LAZYLEN(contents) * item_mush_val + extra_mush)
var/stored_y = I.pixel_y
F.add_overlay(I)
overlay_image = get_mush_overlay(extra_mush_color, min(custom_ingested_alpha, living_prey.max_voreoverlay_alpha), max_ingested, ingested.total_volume)
fullscreen_overlay.add_overlay(overlay_image)
if(show_liquids && living_prey.liquidbelly_visuals && mush_overlay && (owner.nutrition > 0 || max_mush == 0 || min_mush > 0 || (LAZYLEN(contents) * item_mush_val) > 0))
overlay_image = get_mush_overlay(mush_color, min(mush_alpha, living_prey.max_voreoverlay_alpha), max_mush, owner.nutrition + LAZYLEN(contents) * item_mush_val + extra_mush)
var/stored_y = overlay_image.pixel_y
fullscreen_overlay.add_overlay(overlay_image)
if(metabolism_overlay && metabolism_mush_ratio > 0 && extra_mush > 0)
var/total_mush_content = owner.nutrition + LAZYLEN(contents) * item_mush_val + extra_mush
I = get_mush_extra_overlay(extra_mush_color, min(mush_alpha, (extra_mush / max(total_mush_content, 1)) * mush_alpha), stored_y)
F.add_overlay(I)
if(show_liquids && L.liquidbelly_visuals && liquid_overlay && reagents.total_volume)
I = get_liquid_overlay()
I.alpha = min(I.alpha, L.max_voreoverlay_alpha)
F.add_overlay(I)
F.update_for_view(L.client.view)
overlay_image = get_mush_extra_overlay(extra_mush_color, min(mush_alpha, (extra_mush / max(total_mush_content, 1)) * mush_alpha), stored_y)
fullscreen_overlay.add_overlay(overlay_image)
if(show_liquids && living_prey.liquidbelly_visuals && liquid_overlay && reagents.total_volume)
overlay_image = get_liquid_overlay()
overlay_image.alpha = min(overlay_image.alpha, living_prey.max_voreoverlay_alpha)
fullscreen_overlay.add_overlay(overlay_image)
fullscreen_overlay.update_for_view(living_prey.client.view)
return
var/atom/movable/screen/fullscreen/F = L.overlay_fullscreen("belly", /atom/movable/screen/fullscreen/belly/fixed, severity) //preserving save data
F.icon = 'icons/mob/vore_fullscreens/ui_lists/screen_full_vore.dmi'
F.cut_overlays()
F.add_overlay(image(F.icon, belly_fullscreen))
F.add_overlay(image(F.icon, belly_fullscreen+"-2"))
F.add_overlay(image(F.icon, belly_fullscreen+"-3"))
F.add_overlay(image(F.icon, belly_fullscreen+"-4"))
var/image/I
var/atom/movable/screen/fullscreen/fullscreen_overlay = living_prey.overlay_fullscreen("belly", /atom/movable/screen/fullscreen/belly/fixed, severity) //preserving save data
fullscreen_overlay.icon = 'icons/mob/vore_fullscreens/ui_lists/screen_full_vore.dmi'
fullscreen_overlay.cut_overlays()
fullscreen_overlay.add_overlay(image(fullscreen_overlay.icon, belly_fullscreen))
fullscreen_overlay.add_overlay(image(fullscreen_overlay.icon, belly_fullscreen+"-2"))
fullscreen_overlay.add_overlay(image(fullscreen_overlay.icon, belly_fullscreen+"-3"))
fullscreen_overlay.add_overlay(image(fullscreen_overlay.icon, belly_fullscreen+"-4"))
var/image/overlay_image
var/extra_mush = 0
var/extra_mush_color = mush_color
if(L.liquidbelly_visuals && ishuman(owner) && metabolism_overlay && metabolism_mush_ratio > 0)
var/mob/living/carbon/human/H = owner
var/datum/reagents/metabolism/ingested = H.ingested
if(living_prey.liquidbelly_visuals && ishuman(owner) && metabolism_overlay && metabolism_mush_ratio > 0)
var/mob/living/carbon/human/human_owner = owner
var/datum/reagents/metabolism/ingested = human_owner.ingested
if(ingested && ingested.total_volume > 0)
if(custom_ingested_color)
extra_mush_color = custom_ingested_color
@@ -97,22 +97,22 @@
extra_mush_color = ingested.get_color()
extra_mush = ingested.total_volume * metabolism_mush_ratio
if(!mush_overlay)
I = get_mush_overlay(extra_mush_color, custom_ingested_alpha, max_ingested, ingested.total_volume)
F.add_overlay(I)
if(show_liquids && L.liquidbelly_visuals && mush_overlay && (owner.nutrition > 0 || max_mush == 0 || min_mush > 0 || (LAZYLEN(contents) * item_mush_val) > 0))
I = get_mush_overlay(mush_color, mush_alpha, max_mush, owner.nutrition + LAZYLEN(contents) * item_mush_val + extra_mush)
I.alpha = mush_alpha
var/stored_y = I.pixel_y
F.add_overlay(I)
overlay_image = get_mush_overlay(extra_mush_color, custom_ingested_alpha, max_ingested, ingested.total_volume)
fullscreen_overlay.add_overlay(overlay_image)
if(show_liquids && living_prey.liquidbelly_visuals && mush_overlay && (owner.nutrition > 0 || max_mush == 0 || min_mush > 0 || (LAZYLEN(contents) * item_mush_val) > 0))
overlay_image = get_mush_overlay(mush_color, mush_alpha, max_mush, owner.nutrition + LAZYLEN(contents) * item_mush_val + extra_mush)
overlay_image.alpha = mush_alpha
var/stored_y = overlay_image.pixel_y
fullscreen_overlay.add_overlay(overlay_image)
if(metabolism_overlay && metabolism_mush_ratio > 0 && extra_mush > 0)
var/total_mush_content = owner.nutrition + LAZYLEN(contents) * item_mush_val + extra_mush
I = get_mush_extra_overlay(extra_mush_color, min(mush_alpha, (extra_mush / max(total_mush_content, 1)) * mush_alpha), stored_y)
F.add_overlay(I)
if(show_liquids && L.liquidbelly_visuals && liquid_overlay && reagents.total_volume)
I = get_liquid_overlay()
F.add_overlay(I)
F.update_for_view(L.client.view)
check_hud_disable(L)
overlay_image = get_mush_extra_overlay(extra_mush_color, min(mush_alpha, (extra_mush / max(total_mush_content, 1)) * mush_alpha), stored_y)
fullscreen_overlay.add_overlay(overlay_image)
if(show_liquids && living_prey.liquidbelly_visuals && liquid_overlay && reagents.total_volume)
overlay_image = get_liquid_overlay()
fullscreen_overlay.add_overlay(overlay_image)
fullscreen_overlay.update_for_view(living_prey.client.view)
check_hud_disable(living_prey)
/obj/belly/proc/check_hud_disable(var/mob/living/living_prey)
if(disable_hud && living_prey != owner)
@@ -121,45 +121,45 @@
living_prey.toggle_hud_vis(TRUE)
/obj/belly/proc/get_mush_overlay(color, alpha, limit, content)
var/image/I = image('icons/mob/vore_fullscreens/bubbles.dmi', "mush")
I.color = color
I.pixel_y = -450 + (450 / max(limit, 1) * max(min(limit, content), 1))
if(I.pixel_y < -450 + (450 / 100 * min_mush))
I.pixel_y = -450 + (450 / 100 * min_mush)
I.alpha = alpha
return I
var/image/overlay_image = image('icons/mob/vore_fullscreens/bubbles.dmi', "mush")
overlay_image.color = color
overlay_image.pixel_y = -450 + (450 / max(limit, 1) * max(min(limit, content), 1))
if(overlay_image.pixel_y < -450 + (450 / 100 * min_mush))
overlay_image.pixel_y = -450 + (450 / 100 * min_mush)
overlay_image.alpha = alpha
return overlay_image
/obj/belly/proc/get_mush_extra_overlay(color, alpha, stored_y)
var/image/I = image('icons/mob/vore_fullscreens/bubbles.dmi', "mush")
I.color = color
I.pixel_y = stored_y
I.alpha = alpha
return I
var/image/overlay_image = image('icons/mob/vore_fullscreens/bubbles.dmi', "mush")
overlay_image.color = color
overlay_image.pixel_y = stored_y
overlay_image.alpha = alpha
return overlay_image
/obj/belly/proc/get_liquid_overlay()
var/image/I
var/image/overlay_image
if(digest_mode == DM_HOLD && item_digest_mode == IM_HOLD)
I = image('icons/mob/vore_fullscreens/bubbles.dmi', "calm")
overlay_image = image('icons/mob/vore_fullscreens/bubbles.dmi', "calm")
else
I = image('icons/mob/vore_fullscreens/bubbles.dmi', "bubbles")
overlay_image = image('icons/mob/vore_fullscreens/bubbles.dmi', "bubbles")
if(custom_reagentcolor)
I.color = custom_reagentcolor
overlay_image.color = custom_reagentcolor
else
I.color = reagentcolor
overlay_image.color = reagentcolor
if(custom_reagentalpha)
I.alpha = custom_reagentalpha
overlay_image.alpha = custom_reagentalpha
else
I.alpha = max(150, min(custom_max_volume, 255)) - (255 - belly_fullscreen_alpha)
I.pixel_y = -450 + min((450 / custom_max_volume * reagents.total_volume), 450 / 100 * max_liquid_level)
return I
overlay_image.alpha = max(150, min(custom_max_volume, 255)) - (255 - belly_fullscreen_alpha)
overlay_image.pixel_y = -450 + min((450 / custom_max_volume * reagents.total_volume), 450 / 100 * max_liquid_level)
return overlay_image
/obj/belly/proc/vore_preview(mob/living/L)
if(!istype(L) || !L.client)
L.previewing_belly = null
/obj/belly/proc/vore_preview(mob/living/living_prey)
if(!istype(living_prey) || !living_prey.client)
living_prey.previewing_belly = null
return
L.previewing_belly = src
vore_fx(L)
living_prey.previewing_belly = src
vore_fx(living_prey)
/obj/belly/proc/clear_preview(mob/living/L)
L.previewing_belly = null
L.clear_fullscreen("belly")
/obj/belly/proc/clear_preview(mob/living/living_prey)
living_prey.previewing_belly = null
living_prey.clear_fullscreen("belly")
@@ -614,15 +614,17 @@
host.vore_selected.emote_time = CLAMP(new_time, 60, 600)
. = TRUE
if("b_escapable")
if(host.vore_selected.escapable == 0) //Possibly escapable and special interactions.
host.vore_selected.escapable = 1
to_chat(user,span_warning("Prey now have special interactions with your [lowertext(host.vore_selected.name)] depending on your settings."))
else if(host.vore_selected.escapable == 1) //Never escapable.
host.vore_selected.escapable = 0
to_chat(user,span_warning("Prey will not be able to have special interactions with your [lowertext(host.vore_selected.name)]."))
else
tgui_alert_async(user, "Something went wrong. Your stomach will now not have special interactions. Press the button enable them again and tell a dev.","Error") //If they somehow have a varable that's not 0 or 1
host.vore_selected.escapable = 0
var/new_mode = text2num(params["val"])
switch(new_mode)
if(B_ESCAPABLE_NONE) //Never escapable.
host.vore_selected.escapable = B_ESCAPABLE_NONE
to_chat(user,span_warning("Prey will not be able to have special interactions with your [lowertext(host.vore_selected.name)]."))
if(B_ESCAPABLE_DEFAULT) //Possibly escapable and special interactions.
host.vore_selected.escapable = B_ESCAPABLE_DEFAULT
to_chat(user,span_warning("Prey now have special interactions with your [lowertext(host.vore_selected.name)] depending on your settings."))
if(B_ESCAPABLE_INTENT) //Possibly escapable and special intent based interactions.
host.vore_selected.escapable = B_ESCAPABLE_INTENT
to_chat(user,span_warning("Prey now have special interactions with your [lowertext(host.vore_selected.name)] depending on your settings and their intent."))
. = TRUE
if("b_escapechance")
var/escape_chance_input = text2num(params["val"])
@@ -93,21 +93,28 @@
inside["contents"] = inside_contents
return inside
/datum/vore_look/proc/get_prey_abilities(mob/owner)
var/atom/hostloc = owner.loc
// Allow VorePanel to show pred belly details even while indirectly inside
if(isliving(owner))
var/mob/living/H = owner
hostloc = H.surrounding_belly()
if(!isbelly(hostloc))
return list()
/datum/vore_look/proc/get_prey_abilities(mob/owner, obj/belly/inside_belly)
if(!istype(inside_belly))
return null
var/obj/belly/inside_belly = hostloc
var/list/abilities = list()
if(inside_belly.mode_flags & DM_FLAG_ABSORBEDVORE)
UNTYPED_LIST_ADD(abilities, list("name" = "devour_as_absorbed", "available" = owner.absorbed))
return abilities
/datum/vore_look/proc/get_intent_data(mob/owner, obj/belly/inside_belly)
if(!isbelly(inside_belly))
return null
return list(
"active" = inside_belly.escapable == B_ESCAPABLE_INTENT,
"current_intent" = owner.a_intent,
"help" = !!inside_belly.belchchance,
"disarm" = (inside_belly.transferchance && inside_belly.transferlocation) || (inside_belly.transferchance_secondary && inside_belly.transferlocation_secondary),
"grab" = (inside_belly.absorbchance && inside_belly.digest_mode != DM_ABSORB) || (inside_belly.digestchance && inside_belly.digest_mode != DM_DIGEST) || (inside_belly.selectchance && inside_belly.digest_mode != DM_SELECT),
"harm" = !!inside_belly.escapechance
)
/datum/vore_look/proc/get_host_mobtype(mob/owner)
var/list/host_mobtype = list("is_cyborg" = FALSE, "is_vore_simple_mob" = FALSE)
if(isrobot(owner))
+9 -2
View File
@@ -142,6 +142,7 @@
data["show_pictures"] = null
data["icon_overflow"] = null
data["prey_abilities"] = null
data["intent_data"] = null
data["our_bellies"] = null
data["selected"] = null
data["soulcatcher"] = null
@@ -168,7 +169,13 @@
// Content Data
data["show_pictures"] = show_pictures
data["icon_overflow"] = icon_overflow
data["prey_abilities"] = get_prey_abilities(host)
var/atom/hostloc = host.loc
// Allow VorePanel to show pred belly details even while indirectly inside
if(isliving(host))
var/mob/living/human_host = host
hostloc = human_host.surrounding_belly()
data["prey_abilities"] = get_prey_abilities(host, hostloc)
data["intent_data"] = get_intent_data(host, hostloc)
if(SOULCATCHER_TAB)
// Soulcatcher and abilities
@@ -907,7 +914,7 @@
return
entries[index] = hex
preset_colors = entries.Join(";")
return FALSE
return TRUE
/datum/vore_look/proc/pick_from_inside(mob/user, params)
var/atom/movable/target = locate(params["pick"])