This commit is contained in:
silicons
2020-07-23 09:32:28 -07:00
parent 703afec454
commit 99eb77c052
7 changed files with 19 additions and 20 deletions
+4 -4
View File
@@ -111,9 +111,9 @@
if(A in DirectAccess())
if(W)
. = W.melee_attack_chain(src, A, params)
. = !(. & DISCARD_LAST_ACTION)
return = !(. & DISCARD_LAST_ACTION)
else
. = UnarmedAttack(A)? TRUE : FALSE
return UnarmedAttack(A)? TRUE : FALSE
//Can't reach anything else in lockers or other weirdness
if(!loc.AllowClick())
@@ -123,9 +123,9 @@
if(CanReach(A,W))
if(W)
. = W.melee_attack_chain(src, A, params)
. = !(. & DISCARD_LAST_ACTION)
return !(. & DISCARD_LAST_ACTION)
else
. = UnarmedAttack(A, 1)? TRUE : FALSE
return UnarmedAttack(A, 1)? TRUE : FALSE
else
if(W)
W.ranged_attack_chain(src, A, params)
+2 -4
View File
@@ -79,8 +79,7 @@
// 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)
. = !(. & DISCARD_LAST_ACTION)
return
return !(. & DISCARD_LAST_ACTION)
if(!isturf(loc))
return
@@ -89,8 +88,7 @@
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
. = W.melee_attack_chain(src, A, params)
. = !(. & DISCARD_LAST_ACTION)
return
return !(. & DISCARD_LAST_ACTION)
else
W.afterattack(A, src, 0, params)
return
+3 -2
View File
@@ -14,7 +14,7 @@
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines
if(proximity && istype(G) && G.Touch(A,1))
if(proximity && istype(G) && (. = G.Touch(A,1)))
return
var/override = 0
@@ -26,7 +26,7 @@
return
SEND_SIGNAL(src, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, A)
A.attack_hand(src, intent, flags)
return A.attack_hand(src, intent, flags)
/atom/proc/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
if(!(interaction_flags_atom & INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND))
@@ -39,6 +39,7 @@
on_attack_hand(user, act_intent, unarmed_attack_flags)
if(attack_hand_unwieldlyness)
user.DelayNextAction(attack_hand_unwieldlyness, considered_action = attack_hand_is_action)
return attack_hand_is_action
/atom/proc/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
if(interaction_flags_atom & INTERACT_ATOM_ATTACK_HAND)
+6 -7
View File
@@ -36,12 +36,11 @@
//User itself, current loc, and user inventory
if(A in DirectAccess())
if(W)
. = W.rightclick_melee_attack_chain(src, A, params)
. = !(. & DISCARD_LAST_ACTION)
. = W.melee_attack_chain(src, A, params)
return !(. & DISCARD_LAST_ACTION)
else
if(!AltUnarmedAttack(A))
. = UnarmedAttack(A, 1)? TRUE : FALSE
return
return UnarmedAttack(A, 1)? TRUE : FALSE
//Can't reach anything else in lockers or other weirdness
if(!loc.AllowClick())
@@ -50,11 +49,11 @@
//Standard reach turf to turf or reaching inside storage
if(CanReach(A,W))
if(W)
. = W.rightclick_melee_attack_chain(src, A, params)
. = !(. & DISCARD_LAST_ACTION)
. = W.melee_attack_chain(src, A, params)
return !(. & DISCARD_LAST_ACTION)
else
if(!AltUnarmedAttack(A,1))
. = UnarmedAttack(A, 1)? TRUE : FALSE
return UnarmedAttack(A, 1)? TRUE : FALSE
else
if(W)
if(!W.altafterattack(A, src, FALSE, params))
+2 -2
View File
@@ -144,7 +144,7 @@
var/attack_hand_speed = CLICK_CD_MELEE
/// Amount of time to hard stagger (no clicking at all) the mob post attack_hand(). Lower = better
var/attack_hand_unwieldlyness = 0
/// Should we set last action for attack hand?
/// Should we set last action for attack hand? This implies that attack_hands to this atom should flush to clickdelay buffers instead of discarding.
var/attack_hand_is_action = FALSE
/obj/item
@@ -170,7 +170,7 @@
* Called after a successful attack to set a mob's clickdelay.
*/
/obj/item/proc/ApplyAttackCooldown(mob/user, atom/target)
user.DelayNextAction(attack_unwieldlyness, clickdelay_mod_bypass, FALSE)
user.DelayNextAction(attack_unwieldlyness, clickdelay_mod_bypass)
/**
* Get estimated time that a user has to not attack for to use us
+1 -1
View File
@@ -676,7 +676,7 @@
..(pressure_difference, direction, pressure_resistance_prob_delta)
/mob/living/can_resist()
return !(CheckResistCooldown() || !CHECK_MOBILITY(src, MOBILITY_RESIST))
return !CheckResistCooldown() && CHECK_MOBILITY(src, MOBILITY_RESIST)
/// Resist verb for attempting to get out of whatever is restraining your motion. Gives you resist clickdelay if do_resist() returns true.
/mob/living/verb/resist()
+1
View File
@@ -14,6 +14,7 @@
attack_hand_is_action = TRUE
attack_hand_unwieldlyness = CLICK_CD_MELEE
attack_hand_speed = 0
/// What receives our keyboard input. src by default.
var/datum/focus