From 1af619dfbde87672302811d6db5ae9c7ebdaa033 Mon Sep 17 00:00:00 2001 From: Razgriz Date: Sun, 22 Nov 2020 14:17:31 -0700 Subject: [PATCH] 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. --- .../subtypes/metroid/metConsumption.dm | 2 ++ .../subtypes/metroid/metJuvenile.dm | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_mob/subtypes/metroid/metConsumption.dm b/code/modules/mob/living/simple_mob/subtypes/metroid/metConsumption.dm index b5c430d610..e4e43e223d 100644 --- a/code/modules/mob/living/simple_mob/subtypes/metroid/metConsumption.dm +++ b/code/modules/mob/living/simple_mob/subtypes/metroid/metConsumption.dm @@ -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) diff --git a/code/modules/mob/living/simple_mob/subtypes/metroid/metJuvenile.dm b/code/modules/mob/living/simple_mob/subtypes/metroid/metJuvenile.dm index 0c2d166b0d..da111e7817 100644 --- a/code/modules/mob/living/simple_mob/subtypes/metroid/metJuvenile.dm +++ b/code/modules/mob/living/simple_mob/subtypes/metroid/metJuvenile.dm @@ -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 + ..() \ No newline at end of file