Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloaked lurker devouring now shows a message to target again #4937

Merged
merged 5 commits into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions code/modules/mob/mob_grab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@

if(!ishuman(user)) //only humans can reinforce a grab.
if (isxeno(user))
var/mob/living/carbon/xenomorph/X = user
X.pull_power(grabbed_thing)
var/mob/living/carbon/xenomorph/xeno = user
xeno.pull_power(grabbed_thing)
return


Expand Down Expand Up @@ -102,21 +102,21 @@
if(M == grabbed_thing)
attack_self(user)
else if(M == user && user.pulling && isxeno(user))
var/mob/living/carbon/xenomorph/X = user
var/mob/living/carbon/pulled = X.pulling
var/mob/living/carbon/xenomorph/xeno = user
var/mob/living/carbon/pulled = xeno.pulling
if(!istype(pulled))
return
if(isxeno(pulled) || issynth(pulled))
to_chat(X, SPAN_WARNING("That wouldn't taste very good."))
to_chat(xeno, SPAN_WARNING("That wouldn't taste very good."))
return 0
if(pulled.buckled)
to_chat(X, SPAN_WARNING("[pulled] is buckled to something."))
to_chat(xeno, SPAN_WARNING("[pulled] is buckled to something."))
return 0
if(pulled.stat == DEAD && !pulled.chestburst)
to_chat(X, SPAN_WARNING("Ew, [pulled] is already starting to rot."))
to_chat(xeno, SPAN_WARNING("Ew, [pulled] is already starting to rot."))
return 0
if(X.stomach_contents.len) //Only one thing in the stomach at a time, please
to_chat(X, SPAN_WARNING("You already have something in your belly, there's no way that will fit."))
if(xeno.stomach_contents.len) //Only one thing in the stomach at a time, please
to_chat(xeno, SPAN_WARNING("You already have something in your belly, there's no way that will fit."))
return 0
/* Saving this in case we want to allow devouring of dead bodies UNLESS their client is still online somewhere
if(pulled.client) //The client is still inside the body
Expand All @@ -126,30 +126,32 @@
to_chat(src, "You start to devour [pulled] but realize \he is already dead.")
return */
if(user.action_busy)
to_chat(X, SPAN_WARNING("You are already busy with something."))
to_chat(xeno, SPAN_WARNING("You are already busy with something."))
return
X.visible_message(SPAN_DANGER("[X] starts to devour [pulled]!"), \
xeno.visible_message(SPAN_DANGER("[xeno] starts to devour [pulled]!"), \
SPAN_DANGER("You start to devour [pulled]!"), null, 5)
if(do_after(X, 50, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE))
if(isxeno(pulled.loc) && !X.stomach_contents.len)
to_chat(X, SPAN_WARNING("Someone already ate \the [pulled]."))
if(HAS_TRAIT(xeno, TRAIT_CLOAKED)) //cloaked don't show the visible message, so we gotta work around
to_chat(pulled, FONT_SIZE_HUGE(SPAN_DANGER("[xeno] is trying to devour you!")))
if(do_after(xeno, 50, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE))
if(isxeno(pulled.loc) && !xeno.stomach_contents.len)
to_chat(xeno, SPAN_WARNING("Someone already ate \the [pulled]."))
return 0
if(X.pulling == pulled && !pulled.buckled && (pulled.stat != DEAD || pulled.chestburst) && !X.stomach_contents.len) //make sure you've still got them in your claws, and alive
if(SEND_SIGNAL(pulled, COMSIG_MOB_DEVOURED, X) & COMPONENT_CANCEL_DEVOUR)
if(xeno.pulling == pulled && !pulled.buckled && (pulled.stat != DEAD || pulled.chestburst) && !xeno.stomach_contents.len) //make sure you've still got them in your claws, and alive
if(SEND_SIGNAL(pulled, COMSIG_MOB_DEVOURED, xeno) & COMPONENT_CANCEL_DEVOUR)
return FALSE

X.visible_message(SPAN_WARNING("[X] devours [pulled]!"), \
xeno.visible_message(SPAN_WARNING("[xeno] devours [pulled]!"), \
SPAN_WARNING("You devour [pulled]!"), null, 5)

if(ishuman(pulled))
var/mob/living/carbon/human/pulled_human = pulled
pulled_human.disable_lights()

//Then, we place the mob where it ought to be
X.stomach_contents.Add(pulled)
X.devour_timer = world.time + 500 + rand(0,200) // 50-70 seconds
pulled.forceMove(X)
xeno.stomach_contents.Add(pulled)
xeno.devour_timer = world.time + 500 + rand(0,200) // 50-70 seconds
pulled.forceMove(xeno)
return TRUE
if(!(pulled in X.stomach_contents))
to_chat(X, SPAN_WARNING("You stop devouring \the [pulled]. \He probably tasted gross anyways."))
if(!(pulled in xeno.stomach_contents))
to_chat(xeno, SPAN_WARNING("You stop devouring \the [pulled]. \He probably tasted gross anyways."))
return 0