From a0b3a41a22b0d475313a7798ae96eba9d3cc11ab Mon Sep 17 00:00:00 2001 From: AmShegars <88627712+AmShegars@users.noreply.github.com> Date: Sat, 9 Dec 2023 19:11:22 +0500 Subject: [PATCH] Fix: add exosuit punch miss condition case (#687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://cdn.discordapp.com/attachments/907288887024553984/1182984005637910588/2023-12-09_14-55-00.mp4?ex=6586aeb5&is=657439b5&hm=540a8c5fdcff195d5ed1c03c14db2bb885656d01aeea2b8df1dbe09436b9b5a8& Теперь мех точно не даст леща, если цель ушла с места атаки. --------- Co-authored-by: SuhEugene <32931701+SuhEugene@users.noreply.github.com> --- code/modules/mechs/mech_interaction.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/mechs/mech_interaction.dm b/code/modules/mechs/mech_interaction.dm index 6ca92b791e..c02941ad1d 100644 --- a/code/modules/mechs/mech_interaction.dm +++ b/code/modules/mechs/mech_interaction.dm @@ -194,7 +194,14 @@ setClickCooldown(arms ? arms.action_delay : 7) src.visible_message(SPAN_DANGER(" [src] steps back, preparing for a punch!"), blind_message = SPAN_DANGER("You hear the loud hissing of hydraulics!")) playsound(src.loc, mech_step_sound, 60, 1) - if(do_after(src, 1.2 SECONDS, get_turf(src),DO_SHOW_PROGRESS|DO_FAIL_FEEDBACK|DO_USER_CAN_TURN|DO_TARGET_CAN_TURN| DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && user) + var/target_prev_loc = A.loc + if(do_after(src, 1.2 SECONDS, get_turf(src), DO_DEFAULT|DO_USER_UNIQUE_ACT|DO_PUBLIC_PROGRESS) && user) + if(target_prev_loc != A.loc) + src.visible_message(SPAN_DANGER(" [src] misses with his attack!")) + do_attack_effect(target_prev_loc, "smash") + setClickCooldown(arms ? arms.action_delay : 7) + playsound(src.loc, arms_punch_sound, 50, 1) + return if(istype(A, /obj/machinery/door/firedoor) ) var/obj/machinery/door/firedoor/FD = A if(!FD.blocked)