From be040bd0f8a2c5f0f42f4b8a62e04c7720eb23c8 Mon Sep 17 00:00:00 2001 From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:30:48 +0200 Subject: [PATCH] Tentacle works pointblank and not runtimes (#26245) * tentacle no longer runtimes when shooting point blank * Update code/modules/antagonists/changeling/powers/mutations.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> * Update code/modules/antagonists/changeling/powers/mutations.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> * Update code/modules/antagonists/changeling/powers/mutations.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> * Update code/modules/antagonists/changeling/powers/mutations.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> --------- Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> --- .../changeling/powers/mutations.dm | 116 +++++++++--------- code/modules/projectiles/gun.dm | 2 +- 2 files changed, 62 insertions(+), 56 deletions(-) diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 2a67499d0da..23b2063148e 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -293,68 +293,74 @@ /obj/item/projectile/tentacle/on_hit(atom/target, blocked = 0) - qdel(source.gun) //one tentacle only unless you miss - if(blocked >= 100) - return 0 var/mob/living/carbon/human/H = firer + qdel(source.gun) + if(blocked >= 100) + return FALSE if(isitem(target)) var/obj/item/I = target - if(!I.anchored) - to_chat(firer, "You grab [I] with your tentacle.") - add_attack_logs(H, I, "[src] grabs [I] with a tentacle") - I.forceMove(H.loc) - I.attack_hand(H)//The tentacle takes the item back with them and makes them pick it up. No silly throw mode. - . = 1 + if(I.anchored) + return FALSE - else if(isliving(target)) - var/mob/living/L = target - if(!L.anchored && !L.throwing)//avoid double hits - if(iscarbon(L)) - var/mob/living/carbon/C = L - switch(firer.a_intent) - if(INTENT_HELP) - C.visible_message("[L] is pulled to their feet towards [H]!","A tentacle grabs you and pulls you up towards [H]!") - add_attack_logs(H, L, "[H] pulled [L] towards them with a tentacle") - C.throw_at(get_step_towards(H,C), 8, 2) - C.AdjustParalysis(-2 SECONDS) - C.AdjustStunned(-4 SECONDS) - C.AdjustWeakened(-4 SECONDS) - C.AdjustKnockDown(-4 SECONDS) - C.adjustStaminaLoss(-25) - return TRUE + to_chat(H, "You grab [I] with your tentacle.") + add_attack_logs(H, I, "[src] grabs [I] with a tentacle") + I.forceMove(H.loc) + I.attack_hand(H) // The tentacle takes the item back with them and makes them pick it up. No silly throw mode. + return TRUE - if(INTENT_DISARM) - var/obj/item/I = C.get_active_hand() - if(I) - if(C.drop_item()) - C.visible_message("[I] is yanked out of [C]'s hand by [src]!","A tentacle pulls [I] away from you!") - add_attack_logs(H, C, "[H] has grabbed [I] out of [C]'s hand with a tentacle") - on_hit(I) //grab the item as if you had hit it directly with the tentacle - return TRUE - to_chat(firer, "You can't seem to pry [I] out of [C]'s hands!") - add_attack_logs(H, C, "[H] tried to grab [I] out of their hand with a tentacle, but failed") - C.visible_message("[C] is knocked over by [src]!", "A tentacle hits you in the chest and knocks you over!") - add_attack_logs(H, C, "[H] knocked over with a tentacle") - C.KnockDown(2 SECONDS) //Not useless with antidrop. - return TRUE + if(!isliving(target)) + return FALSE - if(INTENT_GRAB) - C.visible_message("[L] is entangled by [H]'s tentacle!", "A tentacle grabs you and wraps around your legs!") - add_attack_logs(H, C, "imobilised with a changeling tentacle") - if(!iscarbon(H)) - return TRUE - var/obj/item/restraints/legcuffs/beartrap/changeling/B = new(H.loc) - B.Crossed(C) - return TRUE + var/mob/living/L = target + if(L.anchored || L.throwing) // avoid double hits + return FALSE - if(INTENT_HARM) - C.visible_message("[L] is thrown towards [H] by a tentacle!","A tentacle grabs you and throws you towards [H]!") - C.throw_at(get_step_towards(H,C), 8, 2, callback=CALLBACK(H, TYPE_PROC_REF(/mob, tentacle_stab), C)) - return TRUE - else - L.visible_message("[L] is pulled by [H]'s tentacle!","A tentacle grabs you and pulls you towards [H]!") - L.throw_at(get_step_towards(H,L), 8, 2) - . = TRUE + if(!iscarbon(L)) + L.visible_message("[L] is pulled by [H]'s tentacle!","A tentacle grabs you and pulls you towards [H]!") + L.throw_at(get_step_towards(H,L), 8, 2) + return TRUE + + var/mob/living/carbon/C = L + switch(H.a_intent) + if(INTENT_HELP) + C.visible_message("[L] is pulled to their feet towards [H]!","A tentacle grabs you and pulls you up towards [H]!") + add_attack_logs(H, L, "[H] pulled [L] towards them with a tentacle") + C.throw_at(get_step_towards(H,C), 8, 2) + C.AdjustParalysis(-2 SECONDS) + C.AdjustStunned(-4 SECONDS) + C.AdjustWeakened(-4 SECONDS) + C.AdjustKnockDown(-4 SECONDS) + C.adjustStaminaLoss(-25) + return TRUE + + if(INTENT_DISARM) + var/obj/item/I = C.get_active_hand() + if(I) + if(C.drop_item()) + C.visible_message("[I] is yanked out of [C]'s hand by [src]!","A tentacle pulls [I] away from you!") + add_attack_logs(H, C, "[H] has grabbed [I] out of [C]'s hand with a tentacle") + on_hit(I) // grab the item as if you had hit it directly with the tentacle + return TRUE + to_chat(H, "You can't seem to pry [I] out of [C]'s hands!") + add_attack_logs(H, C, "[H] tried to grab [I] out of their hand with a tentacle, but failed") + C.visible_message("[C] is knocked over by [src]!", "A tentacle hits you in the chest and knocks you over!") + add_attack_logs(H, C, "[H] knocked over with a tentacle") + C.KnockDown(2 SECONDS) // Not useless with antidrop. + return TRUE + + if(INTENT_GRAB) + C.visible_message("[L] is entangled by [H]'s tentacle!", "A tentacle grabs you and wraps around your legs!") + add_attack_logs(H, C, "imobilised with a changeling tentacle") + if(!iscarbon(H)) + return TRUE + var/obj/item/restraints/legcuffs/beartrap/changeling/B = new(H.loc) + B.Crossed(C) + return TRUE + + if(INTENT_HARM) + C.visible_message("[L] is thrown towards [H] by a tentacle!","A tentacle grabs you and throws you towards [H]!") + C.throw_at(get_step_towards(H,C), 8, 2, callback=CALLBACK(H, TYPE_PROC_REF(/mob, tentacle_stab), C)) + return TRUE /obj/item/projectile/tentacle/Destroy() qdel(chain) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a484e60849b..0b877bd3b45 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -153,7 +153,7 @@ user.visible_message("[user] fires [src] point blank at [target]!", "You fire [src] point blank at [target]!", "You hear \a [fire_sound_text]!") else user.visible_message("[user] fires [src]!", "You fire [src]!", "You hear \a [fire_sound_text]!") - if(chambered.muzzle_flash_effect) + if(chambered?.muzzle_flash_effect) var/obj/effect/temp_visual/target_angled/muzzle_flash/effect = new chambered.muzzle_flash_effect(get_turf(src), target, muzzle_flash_time) effect.alpha = min(255, muzzle_strength * 255) if(chambered.muzzle_flash_color)