[MIRROR] Implements functionality for variable weapon attack and secondary weapon attack speeds. [MDB IGNORE] (#19048)

Implements functionality for variable weapon attack and secondary weapon attack speeds. (#72959)

## About The Pull Request
The click cooldown after attacking with a weapon can now be controlled
with a var. A var can also be set for secondary attack cooldown, if
unset it is the same as the weapon's normal attack speed.

The two weapons who already had hardcoded mechanics to achieve this
effect (see: The Stinger, Hyper Frequency Blade) have been converted to
this system.
## Why It's Good For The Game
Future varying of weapon qualities and admin shenanigans.
## Changelog
🆑
code: Greater support for variability in weapon attack speed 
admin: Admins are now able to grief you by hitting you with a toolbox 10
times in one second.
/🆑

Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-01-31 13:54:11 +00:00
committed by GitHub
co-authored by itseasytosee
parent 613ffe18cf
commit 2d468e9c2d
5 changed files with 13 additions and 5 deletions
+4
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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