diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 75c5187528a..9791b05b158 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -86,6 +86,7 @@ #define CLICK_CD_THROW 8 #define CLICK_CD_RANGE 4 #define CLICK_CD_RAPID 2 +#define CLICK_CD_HYPER_RAPID 1 #define CLICK_CD_CLICK_ABILITY 6 #define CLICK_CD_BREAKOUT 100 #define CLICK_CD_HANDCUFFED 10 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index be5c39ba9e9..d0db123981c 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -158,7 +158,7 @@ /mob/living/attackby(obj/item/attacking_item, mob/living/user, params) if(..()) return TRUE - user.changeNext_move(CLICK_CD_MELEE) + user.changeNext_move(attacking_item.attack_speed) return attacking_item.attack(src, user, params) /mob/living/attackby_secondary(obj/item/weapon, mob/living/user, params) @@ -166,7 +166,10 @@ // Normal attackby updates click cooldown, so we have to make up for it if (result != SECONDARY_ATTACK_CALL_NORMAL) - user.changeNext_move(CLICK_CD_MELEE) + if(weapon.secondary_attack_speed) + user.changeNext_move(weapon.secondary_attack_speed) + else + user.changeNext_move(weapon.attack_speed) return result @@ -229,7 +232,7 @@ return if(item_flags & NOBLUDGEON) return - user.changeNext_move(CLICK_CD_MELEE) + user.changeNext_move(attack_speed) user.do_attack_animation(attacked_atom) attacked_atom.attacked_by(src, user) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index b745b5f53cd..8443ebd0058 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -131,6 +131,10 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e var/armour_penetration = 0 ///Whether or not our object is easily hindered by the presence of armor var/weak_against_armour = FALSE + /// The click cooldown given after attacking. Lower numbers means faster attacks + var/attack_speed = CLICK_CD_MELEE + /// The click cooldown on secondary attacks. Lower numbers mean faster attacks. Will use attack_speed if undefined. + var/secondary_attack_speed ///In deciseconds, how long an item takes to equip; counts only for normal clothing slots, not pockets etc. var/equip_delay_self = 0 ///In deciseconds, how long an item takes to put on another person diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index c73eb2c6b84..51ecb2f4070 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -162,6 +162,7 @@ w_class = WEIGHT_CLASS_BULKY sharpness = SHARP_EDGED throwforce = 10 + attack_speed = CLICK_CD_RAPID block_chance = 20 armour_penetration = 65 attack_verb_continuous = list("slashes", "stings", "prickles", "pokes") @@ -172,7 +173,6 @@ . = ..() if(!proximity) return - user.changeNext_move(CLICK_CD_RAPID) if(iscarbon(target)) var/mob/living/carbon/carbon_target = target carbon_target.reagents.add_reagent(/datum/reagent/toxin, 4) diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 7f55ea29de4..c3ee34603ef 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -980,6 +980,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 bare_wound_bonus = 50 throwforce = 25 throw_speed = 4 + attack_speed = CLICK_CD_HYPER_RAPID embedding = list("embed_chance" = 100) block_chance = 25 sharpness = SHARP_EDGED @@ -1044,7 +1045,6 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 update_icon(UPDATE_ICON_STATE) /obj/item/highfrequencyblade/proc/slash(atom/target, mob/living/user, params) - user.changeNext_move(0.1 SECONDS) user.do_attack_animation(target, "nothing") var/list/modifiers = params2list(params) var/damage_mod = 1