Refactors vore code to allow for instant-vore that does not sleep (#18219)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-08-15 20:54:27 -04:00
committed by GitHub
parent 99e71ef15e
commit a0e66075a6
13 changed files with 237 additions and 131 deletions
@@ -343,7 +343,7 @@
m.drop_from_inventory(S.OurRig)
if(wearer && devour) //We're being worn. Engulf em', if prefs align.. otherwise just drop off.
if(P.can_be_drop_pred && wearer.devourable && wearer.can_be_drop_prey && P.vore_selected)
perform_the_nom(P,wearer,P,P.vore_selected,-1)
begin_instant_nom(P,wearer,P,P.vore_selected)
else
to_chat(P, span_vwarning("You can't assimilate your current host."))
P.forceMove(get_turf(S.OurRig))
@@ -84,6 +84,10 @@
. = ..()
movement_cooldown = 10
/mob/living/simple_mob/vore/alienanimals/dustjumper/begin_instant_nom(mob/living/user, mob/living/prey, mob/living/pred, obj/belly/belly)
. = ..()
movement_cooldown = 10
/datum/ai_holder/simple_mob/melee/evasive/dustjumper
hostile = FALSE
retaliate = TRUE
@@ -152,6 +152,10 @@
return //If it can do normal vore mechanics, it can carry players to the OM,
//and release them there. I think that's probably a bad idea.
/mob/living/simple_mob/vore/overmap/stardog/begin_instant_nom(mob/living/user, mob/living/prey, mob/living/pred, obj/belly/belly)
to_chat(src, span_warning("You can't do that."))
return
/mob/living/simple_mob/vore/overmap/stardog/Initialize(mapload)
. = ..()
child_om_marker.set_light(5, 1, "#ff8df5")
@@ -813,24 +813,38 @@ GLOBAL_VAR_INIT(teppi_count, 0) // How mant teppi DO we have?
/mob/living/simple_mob/vore/alienanimals/teppi/perform_the_nom(mob/living/user, mob/living/prey, mob/living/pred, obj/belly/belly, delay_time)
if(!client)
var/teppi_checks = teppi_checks(user, prey, pred, belly)
if(teppi_checks)
belly = teppi_checks
ai_holder.set_busy(TRUE)
prey.stop_pulling()
..()
if(!client)
ai_holder.set_busy(FALSE)
/mob/living/simple_mob/vore/alienanimals/teppi/begin_instant_nom(mob/living/user, mob/living/prey, mob/living/pred, obj/belly/belly)
if(!client)
var/teppi_checks = teppi_checks(user, prey, pred, belly)
if(teppi_checks)
belly = teppi_checks
ai_holder.set_busy(TRUE)
prey.stop_pulling()
..()
if(!client)
ai_holder.set_busy(FALSE)
///Retrns the belly we'll be using if we are friends.
/mob/living/simple_mob/vore/alienanimals/teppi/proc/teppi_checks(mob/living/user, mob/living/prey, mob/living/pred)
if(!pred)
pred = user
if(client)
return ..()
var/current_affinity = affinity[prey.real_name]
ai_holder.set_busy(TRUE)
prey.stop_pulling()
if(current_affinity >= 50)
belly = friend_zone
..()
ai_holder.set_busy(FALSE)
return
return friend_zone
if(current_affinity <= -50)
vore_selected.digest_mode = DM_DIGEST
else
vore_selected.digest_mode = DM_DRAIN
..()
ai_holder.set_busy(FALSE)
//Instead of copying this everywhere let's just make a proc
/mob/living/simple_mob/vore/alienanimals/teppi/proc/lets_eat(person)
@@ -77,7 +77,7 @@
if(L in eaten_mobs)
return
if(L.devourable && L.allowmobvore && (src.vore_fullness < src.vore_capacity))
perform_the_nom(src,L,src,src.vore_selected,-1)
begin_instant_nom(src,L,src,src.vore_selected)
eaten_mobs += L