From aab577aae7c6ff78a065bd7a55e94cfeb0760c15 Mon Sep 17 00:00:00 2001 From: phil235 Date: Sun, 29 May 2016 17:14:05 +0200 Subject: [PATCH] Make grab upgrade faster. Passive -> Aggressive is instantaneous (unless you count the 1 second click cooldown, same as between two melee attacks). Upgrading to neck grab or kill grab now takes 3 seconds instead of 4. --- code/datums/martial.dm | 3 +- code/modules/mob/living/living_defense.dm | 60 ++++++++++++----------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/code/datums/martial.dm b/code/datums/martial.dm index 226da8d5e57..6ce74720d43 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -323,7 +323,7 @@ add_to_streak("G",D) if(check_streak(A,D)) return 1 - if(A.grab_state > GRAB_AGGRESSIVE) + if(A.grab_state >= GRAB_AGGRESSIVE) D.grabbedby(A, 1) else A.start_pulling(D, 1) @@ -331,6 +331,7 @@ D.drop_r_hand() D.drop_l_hand() D.stop_pulling() + add_logs(A, D, "grabbed", addition="aggressively") A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab return 1 diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index abf05f2962c..22841c06765 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -225,34 +225,38 @@ if(user.grab_state < GRAB_KILL) user.changeNext_move(CLICK_CD_GRABBING) playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - var/old_grab_state = user.grab_state - var/grab_upgrade_time = 40 - visible_message("[user] starts to tighten \his grip on [src]!", \ - "[user] starts to tighten \his grip on you!") - if(do_mob(user, src, grab_upgrade_time)) - if(user.pulling && user.pulling == src && user.grab_state == old_grab_state && user.a_intent == "grab") - user.grab_state++ - switch(user.grab_state) - if(GRAB_AGGRESSIVE) - add_logs(user, src, "grabbed", addition="aggressively") - visible_message("[user] has grabbed [src] aggressively!", \ - "[user] has grabbed [src] aggressively!") - drop_r_hand() - drop_l_hand() - stop_pulling() - if(GRAB_NECK) - visible_message("[user] has grabbed [src] by the neck!",\ - "[user] has grabbed you by the neck!") - update_canmove() //we fall down - if(!buckled && !density) - Move(user.loc) - if(GRAB_KILL) - visible_message("[user] is strangling [src]!", \ - "[user] is strangling you!") - update_canmove() //we fall down - if(!buckled && !density) - Move(user.loc) - return 1 + + if(user.grab_state) //only the first upgrade is instantaneous + var/old_grab_state = user.grab_state + var/grab_upgrade_time = 30 + visible_message("[user] starts to tighten \his grip on [src]!", \ + "[user] starts to tighten \his grip on you!") + if(!do_mob(user, src, grab_upgrade_time)) + return 0 + if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state || user.a_intent != "grab") + return 0 + user.grab_state++ + switch(user.grab_state) + if(GRAB_AGGRESSIVE) + add_logs(user, src, "grabbed", addition="aggressively") + visible_message("[user] has grabbed [src] aggressively!", \ + "[user] has grabbed [src] aggressively!") + drop_r_hand() + drop_l_hand() + stop_pulling() + if(GRAB_NECK) + visible_message("[user] has grabbed [src] by the neck!",\ + "[user] has grabbed you by the neck!") + update_canmove() //we fall down + if(!buckled && !density) + Move(user.loc) + if(GRAB_KILL) + visible_message("[user] is strangling [src]!", \ + "[user] is strangling you!") + update_canmove() //we fall down + if(!buckled && !density) + Move(user.loc) + return 1 /mob/living/attack_slime(mob/living/simple_animal/slime/M)