Melee cooldown on actions is defined as 0, not overriden everywhere (#87599)

## About The Pull Request

Actions have null melee cooldown by default. The code checks if so, and
gives the action the same melee cd as the action's cd. This means you
can't take any melee action for that duration.

Since this is dumb as shit, 95% of actions in the game override it. But
some don't, which leads to all sorts of 'janky' feeling combat, most
noticeably being that of venus man eaters, which literally cannot attack
until their tangle action is off cooldown. There's some others like it -
legion skull throws for example.

This simply makes it so that the cooldown is, by default, zero, and can
be overriden to null on types which lets it copy the cooldown, if the
coder so chooses.

As a necessary byproduct this affects... pretty much every action in the
game. I found-and-replaced all usages of melee cd = 0 because that's now
redundant, but it's not so easy to check for every action which doesn't
override the value - this means this will likely have some side-effects
on some abilities that aren't meant to be immediately followed up with a
melee attack, but I couldn't find any.

i cant believe there were 3 gorillion actions overridding melee cd to
zero thats embarrassing.
## Why It's Good For The Game

if every subtype overrides a timer variable to the same value then just
maybe the value should be default.

Fixes ALL action melee jank. Perhaps too well!
## Changelog
🆑
refactor: Actions will no longer by default apply a melee cooldown equal
to action cooldown.
fix: Fixed various abilities causing melee jank, most noticeably venus
man eaters
/🆑

---------

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
This commit is contained in:
carlarctg
2024-11-01 13:07:02 +01:00
committed by GitHub
co-authored by Fikou
parent 625aa301f8
commit dd37b953fe
19 changed files with 2 additions and 28 deletions
@@ -14,7 +14,6 @@
button_icon = 'icons/obj/ore.dmi'
button_icon_state = "bluespace_crystal"
cooldown_time = 3 SECONDS
melee_cooldown_time = 0 SECONDS
///time delay before teleport
var/time_delay = 0.5 SECONDS
@@ -38,7 +37,6 @@
button_icon_state = "ice_cube"
cooldown_time = 2 SECONDS
click_to_activate = FALSE
melee_cooldown_time = 0 SECONDS
///perimeter we will spawn the iced floors on
var/radius = 1
///intervals we will spawn the ice floors in
@@ -5,7 +5,6 @@
button_icon = 'icons/effects/magic.dmi'
button_icon_state = "fireball"
cooldown_time = 3 SECONDS
melee_cooldown_time = 0 SECONDS
fire_range = 4
fire_damage = 10
@@ -26,7 +25,6 @@
button_icon = 'icons/effects/fire.dmi'
button_icon_state = "1"
cooldown_time = 4 SECONDS
melee_cooldown_time = 0 SECONDS
click_to_activate = FALSE
fire_range = 6