From 44d3a0aa27d328b04c293625fe215faac63d7466 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Fri, 24 Jul 2020 20:37:02 -0700 Subject: [PATCH] fixes --- code/_onclick/click.dm | 16 ++++++++-------- code/_onclick/cyborg.dm | 7 +++++-- code/_onclick/item_attack.dm | 2 +- code/_onclick/other_mobs.dm | 14 ++++++++++---- code/_onclick/right_click.dm | 16 ++++++++++------ code/_onclick/right_other_mobs.dm | 7 ++----- .../mob/living/simple_animal/bot/ed209bot.dm | 4 +++- .../mob/living/simple_animal/hostile/hostile.dm | 6 +++--- 8 files changed, 42 insertions(+), 30 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index ff6a03582c..b76b4704dd 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -108,9 +108,9 @@ return !(. & DISCARD_LAST_ACTION) else . = UnarmedAttack(A) - if(!(. & NO_AUTO_CLICKDELAY_HANDLING)) - DelayNextAction(CLICK_CD_MELEE) - return UnarmedAttack(A)? TRUE : FALSE + if(!(. & NO_AUTO_CLICKDELAY_HANDLING) && ismob(A)) + DelayNextAction(CLICK_CD_MELEE)) + return .? TRUE : FALSE //Can't reach anything else in lockers or other weirdness if(!loc.AllowClick()) @@ -123,12 +123,12 @@ return !(. & DISCARD_LAST_ACTION) else . = UnarmedAttack(A) - if(!(. & NO_AUTO_CLICKDELAY_HANDLING)) - DelayNextAction(CLICK_CD_MELEE) - return UnarmedAttack(A)? TRUE : FALSE + if(!(. & NO_AUTO_CLICKDELAY_HANDLING) && ismob(A)) + DelayNextAction(CLICK_CD_MELEE)) + return .? TRUE : FALSE else if(W) - W.ranged_attack_chain(src, A, params) + return W.ranged_attack_chain(src, A, params) else RangedAttack(A,params) @@ -376,7 +376,7 @@ return /mob/living/LaserEyes(atom/A, params) - DelayNextAction(CLICK_CD_RANGE) + DelayNextAction(CLICK_CD_RANGE, flush = TRUE) var/obj/item/projectile/beam/LE = new /obj/item/projectile/beam( loc ) LE.icon = 'icons/effects/genetics.dmi' diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index ee30788b0d..9c94a19707 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -79,6 +79,8 @@ // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents) if(A == loc || (A in loc) || (A in contents)) . = W.melee_attack_chain(src, A, params) + if(!(. & NO_AUTO_CLICKDELAY_HANDLING) && ismob(A)) + DelayNextAction(CLICK_CD_MELEE)) return !(. & DISCARD_LAST_ACTION) if(!isturf(loc)) @@ -88,10 +90,11 @@ if(isturf(A) || isturf(A.loc)) if(A.Adjacent(src)) // see adjacent.dm . = W.melee_attack_chain(src, A, params) + if(!(. & NO_AUTO_CLICKDELAY_HANDLING) && ismob(A)) + DelayNextAction(CLICK_CD_MELEE)) return !(. & DISCARD_LAST_ACTION) else - W.afterattack(A, src, 0, params) - return + return W.afterattack(A, src, 0, params) //Middle click cycles through selected modules. /mob/living/silicon/robot/MiddleClickOn(atom/A) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index d12f651c95..dd3c850e0a 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -30,7 +30,7 @@ if(!CHECK_MOBILITY(L, MOBILITY_USE)) to_chat(L, "You are unable to raise [src] right now!") return - afterattack(target, user, FALSE, params) + return afterattack(target, user, FALSE, params) // Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. /obj/item/proc/attack_self(mob/user) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index f911756f65..8c79233be5 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -104,13 +104,19 @@ . = ..() if(gloves) var/obj/item/clothing/gloves/G = gloves - if(istype(G) && G.Touch(A,0)) // for magic gloves + . |= G.Touch(A, FALSE) + if(. & INTERRUPT_UNARMED_ATTACK) + return + if(istype(glasses)) + . |= glasses.ranged_attack(src, A, mouseparams) + if(. & INTERRUPT_UNARMED_ATTACK) return - if (istype(glasses) && glasses.ranged_attack(src,A,mouseparams)) - return for(var/datum/mutation/human/HM in dna.mutations) - HM.on_ranged_attack(A, mouseparams) + . |= HM.on_ranged_attack(A, mouseparams) + + if(. & INTERRUPT_UNARMED_ATTACK) + return if(isturf(A) && get_dist(src,A) <= 1) src.Move_Pulled(A) diff --git a/code/_onclick/right_click.dm b/code/_onclick/right_click.dm index e5a3bd8345..33bcd1e0fa 100644 --- a/code/_onclick/right_click.dm +++ b/code/_onclick/right_click.dm @@ -41,9 +41,10 @@ else if(!AltUnarmedAttack(A)) . = UnarmedAttack(A) - if(!(. & NO_AUTO_CLICKDELAY_HANDLING)) - DelayNextAction(CLICK_CD_MELEE) - return UnarmedAttack(A)? TRUE : FALSE + if(!(. & NO_AUTO_CLICKDELAY_HANDLING) && ismob(A)) + DelayNextAction(CLICK_CD_MELEE)) + return .? TRUE : FALSE + return TRUE //Can't reach anything else in lockers or other weirdness if(!loc.AllowClick()) @@ -57,9 +58,10 @@ else if(!AltUnarmedAttack(A,1)) . = UnarmedAttack(A) - if(!(. & NO_AUTO_CLICKDELAY_HANDLING)) - DelayNextAction(CLICK_CD_MELEE) - return UnarmedAttack(A)? TRUE : FALSE + if(!(. & NO_AUTO_CLICKDELAY_HANDLING) && ismob(A)) + DelayNextAction(CLICK_CD_MELEE)) + return .? TRUE : FALSE + return TRUE else if(W) if(!W.altafterattack(A, src, FALSE, params)) @@ -67,6 +69,8 @@ else if(!AltRangedAttack(A,params)) RangedAttack(A,params) + return + return TRUE /mob/proc/AltUnarmedAttack(atom/A, proximity_flag) if(ismob(A)) diff --git a/code/_onclick/right_other_mobs.dm b/code/_onclick/right_other_mobs.dm index f2277511f8..2dc9fddeef 100644 --- a/code/_onclick/right_other_mobs.dm +++ b/code/_onclick/right_other_mobs.dm @@ -3,14 +3,11 @@ to_chat(src, "You look at the state of the universe and sigh.") //lets face it, people rarely ever see this message in its intended condition. return TRUE - if(!A.alt_attack_hand(src)) - A.attack_hand(src) - return TRUE - return TRUE + return A.alt_attack_hand(src) /mob/living/carbon/human/AltRangedAttack(atom/A, params) if(isturf(A) || incapacitated()) // pretty annoying to wave your fist at floors and walls. And useless. - return TRUE + return if(!CheckActionCooldown(CLICK_CD_RANGE)) return DelayNextAction() diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 96af6d2876..91462a6713 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -532,8 +532,10 @@ Auto Patrol[]"}, /mob/living/simple_animal/bot/ed209/RangedAttack(atom/A) if(!on) - return + return ..() shootAt(A) + DelayNextAction() + return TRUE /mob/living/simple_animal/bot/ed209/proc/stun_attack(mob/living/carbon/C) playsound(src, 'sound/weapons/egloves.ogg', 50, TRUE, -1) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 945842d5ed..5ed3cd0cdd 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -523,9 +523,9 @@ mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with mega if(ranged && ranged_cooldown <= world.time) target = A OpenFire(A) - ..() - - + DelayNextAction() + . = ..() + return TRUE ////// AI Status /////// /mob/living/simple_animal/hostile/proc/AICanContinue(var/list/possible_targets)