From 5170942206f67aa4e2c598c0ead6cd2d28ffab4e Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 2 Sep 2018 05:55:55 +0200 Subject: [PATCH] Fixes tentacles (#39992) * Fixes tentacles, also moves throw callback to fire after the throw is fully completed. * I knew i forgot something here. * Undoes the callback change since it's fixed in another PR. * Bluh --- .../antagonists/changeling/powers/mutations.dm | 13 +++++++++++-- .../mob/living/carbon/human/human_defense.dm | 2 +- code/modules/mob/living/living_defense.dm | 4 ++-- code/modules/mob/living/silicon/silicon_defense.dm | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 091e75b0754..c5cdac3b120 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -238,6 +238,7 @@ fire_sound = 'sound/effects/splat.ogg' force = 0 max_charges = 1 + fire_delay = 1 throwforce = 0 //Just to be on the safe side throw_range = 0 throw_speed = 0 @@ -254,6 +255,11 @@ /obj/item/gun/magic/tentacle/shoot_with_empty_chamber(mob/living/user as mob|obj) to_chat(user, "The [name] is not ready yet.") +/obj/item/gun/magic/tentacle/process_chamber() + . = ..() + if(charges == 0) + qdel(src) + /obj/item/gun/magic/tentacle/suicide_act(mob/user) user.visible_message("[user] coils [src] tightly around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!") return (OXYLOSS) @@ -302,8 +308,12 @@ /obj/item/projectile/tentacle/proc/tentacle_grab(mob/living/carbon/human/H, mob/living/carbon/C) if(H.Adjacent(C)) + if(H.get_active_held_item() && !H.get_inactive_held_item()) + H.swap_hand() + if(H.get_active_held_item()) + return C.grabbedby(H) - C.grippedby(H) //instant aggro grab + C.grippedby(H, instant = TRUE) //instant aggro grab /obj/item/projectile/tentacle/proc/tentacle_stab(mob/living/carbon/human/H, mob/living/carbon/C) if(H.Adjacent(C)) @@ -318,7 +328,6 @@ /obj/item/projectile/tentacle/on_hit(atom/target, blocked = FALSE) var/mob/living/carbon/human/H = firer - H.dropItemToGround(source.gun, TRUE) //Unequip thus delete the tentacle on hit if(blocked >= 100) return 0 if(isitem(target)) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index cb37723c47b..aba8e985836 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -156,7 +156,7 @@ else ..() -/mob/living/carbon/human/grippedby(mob/living/user) +/mob/living/carbon/human/grippedby(mob/living/user, instant = FALSE) if(w_uniform) w_uniform.add_fingerprint(user) ..() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 41fd8b4f835..61b4d6e9b64 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -144,14 +144,14 @@ grippedby(user) //proc to upgrade a simple pull into a more aggressive grab. -/mob/living/proc/grippedby(mob/living/carbon/user) +/mob/living/proc/grippedby(mob/living/carbon/user, instant = FALSE) if(user.grab_state < GRAB_KILL) user.changeNext_move(CLICK_CD_GRABBING) playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) if(user.grab_state) //only the first upgrade is instantaneous var/old_grab_state = user.grab_state - var/grab_upgrade_time = 30 + var/grab_upgrade_time = instant ? 0 : 30 visible_message("[user] starts to tighten [user.p_their()] grip on [src]!", \ "[user] starts to tighten [user.p_their()] grip on you!") switch(user.grab_state) diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 82e4d2455d5..073a2eec2b2 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -1,5 +1,5 @@ -/mob/living/silicon/grippedby(mob/living/user) +/mob/living/silicon/grippedby(mob/living/user, instant = FALSE) return //can't upgrade a simple pull into a more aggressive grab. /mob/living/silicon/get_ear_protection()//no ears