mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-20 20:54:35 +01:00
[MIRROR] Refactors vore code to allow for instant-vore that does not sleep (#11434)
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e16c9ce7ba
commit
f3dcccbc64
@@ -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))
|
||||
|
||||
@@ -87,6 +87,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")
|
||||
|
||||
@@ -815,24 +815,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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user