Fix struggling of metroid removal, sound addition

Added a missing code block to allow people to remove the metroid from their heads or to help others. 

Also added the attach sound.
This commit is contained in:
Razgriz
2020-11-22 14:17:31 -07:00
committed by GitHub
parent c88a691f8b
commit 1af619dfbd
2 changed files with 22 additions and 1 deletions
@@ -60,6 +60,7 @@
victim = L
update_icon()
set_AI_busy(TRUE) // Don't want the AI to interfere with eatting.
playsound(src, 'sound/metroid/metroidattach.ogg', 50, 1)
victim.visible_message(
span("danger", "\The [src] latches onto \the [victim]!"),
span("critical", "\The [src] latches onto you!")
@@ -76,6 +77,7 @@
)
victim = null
update_icon()
spawn(30)
set_AI_busy(FALSE) // Resume normal operations.
/mob/living/simple_mob/metroid/juvenile/proc/can_consume(mob/living/L)
@@ -18,7 +18,6 @@
stop_consumption() // Unbuckle us from our victim.
return ..()
/mob/living/simple_mob/metroid/juvenile/handle_special()
if(stat != DEAD)
if(victim)
@@ -151,3 +150,23 @@
if(istype(L) && a_intent == I_HURT)
// Feed off of their flesh, if able.
consume(L, 5)
//Code to remove metroid from someone
/mob/living/simple_mob/metroid/juvenile/attack_hand(mob/living/L)
if(victim) // Are we eating someone?
var/fail_odds = 30
if(victim == L) // Harder to get the metroid off if it's you that is being eatten.
fail_odds = 60
if(prob(fail_odds))
visible_message(span("warning", "\The [L] attempts to wrestle \the [name] off!"))
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
else
visible_message(span("warning", "\The [L] manages to wrestle \the [name] off!"))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
stop_consumption()
step_away(src, L)
else
..()