This commit is contained in:
silicons
2020-07-23 08:57:15 -07:00
parent 65898bb7f6
commit 703afec454
7 changed files with 12 additions and 21 deletions

View File

@@ -7,8 +7,6 @@
#define STOP_ATTACK_PROC_CHAIN (1<<0)
/// This attack should discard last_action instead of flushing (storing) it). You should probably know what you're doing if you use this considering this is how clickdelay is enforced.
#define DISCARD_LAST_ACTION (1<<1)
/// Override automatic last_action set. There's usually a safety net in that attempting to attack a mob will set last_action even if the item itself doesn't specifically set it. If this is present, that doesn't happen.
#define MANUALLY_HANDLE_LAST_ACTION (1<<2)
// UnarmedAttack() flags
/// Attack is from a parry counterattack

View File

@@ -111,12 +111,9 @@
if(A in DirectAccess())
if(W)
. = W.melee_attack_chain(src, A, params)
if(ismob(A) && !(. & MANUALLY_HANDLE_LAST_ACTION))
DelayNextAction()
. = !(. & DISCARD_LAST_ACTION)
else
UnarmedAttack(A)
return
. = UnarmedAttack(A)? TRUE : FALSE
//Can't reach anything else in lockers or other weirdness
if(!loc.AllowClick())
@@ -126,11 +123,9 @@
if(CanReach(A,W))
if(W)
. = W.melee_attack_chain(src, A, params)
if(ismob(A) && !(. & MANUALLY_HANDLE_LAST_ACTION))
DelayNextAction()
. = !(. & DISCARD_LAST_ACTION)
else
UnarmedAttack(A, 1)
. = UnarmedAttack(A, 1)? TRUE : FALSE
else
if(W)
W.ranged_attack_chain(src, A, params)

View File

@@ -79,8 +79,6 @@
// 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(ismob(A) && !(. & MANUALLY_HANDLE_LAST_ACTION))
DelayNextAction()
. = !(. & DISCARD_LAST_ACTION)
return
@@ -91,8 +89,6 @@
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
. = W.melee_attack_chain(src, A, params)
if(ismob(A) && !(. & MANUALLY_HANDLE_LAST_ACTION))
DelayNextAction()
. = !(. & DISCARD_LAST_ACTION)
return
else

View File

@@ -37,12 +37,10 @@
if(A in DirectAccess())
if(W)
. = W.rightclick_melee_attack_chain(src, A, params)
if(ismob(A) && !(. & MANUALLY_HANDLE_LAST_ACTION))
DelayNextAction()
. = !(. & DISCARD_LAST_ACTION)
else
if(!AltUnarmedAttack(A))
UnarmedAttack(A)
. = UnarmedAttack(A, 1)? TRUE : FALSE
return
//Can't reach anything else in lockers or other weirdness
@@ -53,12 +51,10 @@
if(CanReach(A,W))
if(W)
. = W.rightclick_melee_attack_chain(src, A, params)
if(ismob(A) && !(. & MANUALLY_HANDLE_LAST_ACTION))
DelayNextAction()
. = !(. & DISCARD_LAST_ACTION)
else
if(!AltUnarmedAttack(A,1))
UnarmedAttack(A,1)
. = UnarmedAttack(A, 1)? TRUE : FALSE
else
if(W)
if(!W.altafterattack(A, src, FALSE, params))

View File

@@ -12,6 +12,10 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
icon = 'icons/obj/items_and_weapons.dmi'
blocks_emissive = EMISSIVE_BLOCK_GENERIC
attack_hand_speed = 0
attack_hand_is_action = FALSE
attack_hand_unwieldlyness = 0
///icon state name for inhand overlays
var/item_state = null
///Icon file for left hand inhand overlays

View File

@@ -701,11 +701,10 @@
to_chat(user, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
user.take_bodypart_damage(10)
/obj/item/melee/transforming/cleaving_saw/melee_attack_chain(mob/user, atom/target, params)
/obj/item/melee/transforming/cleaving_saw/ApplyAttackCooldown(mob/user, atom/target)
. = ..()
if(!active)
user.SetNextAction(CLICK_CD_MELEE * 0.5) //when closed, it attacks very rapidly
. |= MANUALLY_HANDLE_LAST_ACTION
/obj/item/melee/transforming/cleaving_saw/nemesis_effects(mob/living/user, mob/living/target)
var/datum/status_effect/stacking/saw_bleed/B = target.has_status_effect(STATUS_EFFECT_SAWBLEED)

View File

@@ -12,6 +12,9 @@
vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace.
attack_hand_is_action = TRUE
attack_hand_unwieldlyness = CLICK_CD_MELEE
/// What receives our keyboard input. src by default.
var/datum/focus