mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
proper smooth movement
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
item_flags = NEEDS_PERMIT
|
||||
attack_verb = list("struck", "hit", "bashed")
|
||||
attack_speed = CLICK_CD_RANGE
|
||||
var/ranged_attack_speed = CLICK_CD_RANGE
|
||||
var/melee_attack_speed = CLICK_CD_MELEE
|
||||
|
||||
var/fire_sound = "gunshot"
|
||||
var/suppressed = null //whether or not a message is displayed when fired
|
||||
@@ -173,12 +175,25 @@
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
|
||||
/obj/item/gun/attack(mob/living/M, mob/user)
|
||||
. = ..()
|
||||
if(!(. & DISCARD_LAST_ACTION))
|
||||
user.DelayNextAction(melee_attack_speed)
|
||||
|
||||
/obj/item/gun/attack_obj(obj/O, mob/user)
|
||||
. = ..()
|
||||
if(!(. & DISCARD_LAST_ACTION))
|
||||
user.DelayNextAction(melee_attack_speed)
|
||||
|
||||
/obj/item/gun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
. = ..()
|
||||
if(!CheckAttackCooldown(user, target))
|
||||
if(!CheckAttackCooldown(user, target, TRUE))
|
||||
return
|
||||
process_afterattack(target, user, flag, params)
|
||||
|
||||
/obj/item/gun/CheckAttackCooldown(mob/user, atom/target, shooting = FALSE)
|
||||
return user.CheckActionCooldown(shooting? ranged_attack_speed : attack_speed, clickdelay_from_next_action, clickdelay_mod_bypass, clickdelay_ignores_next_action)
|
||||
|
||||
/obj/item/gun/proc/process_afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(!target)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user