ok
This commit is contained in:
@@ -90,6 +90,12 @@
|
||||
return
|
||||
duration = world.time + original_duration
|
||||
|
||||
/**
|
||||
* Multiplied to clickdelays
|
||||
*/
|
||||
/datum/status_effect/proc/action_cooldown_mod()
|
||||
return 1
|
||||
|
||||
////////////////
|
||||
// ALERT HOOK //
|
||||
////////////////
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
return 1
|
||||
|
||||
/datum/status_effect/wound/bone/nextmove_modifier()
|
||||
/datum/status_effect/wound/bone/action_cooldown_mod()
|
||||
var/mob/living/carbon/C = owner
|
||||
|
||||
if(C.get_active_hand() == linked_limb)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* The difference between the above and this is this is set immediately before even the pre-attack begins to ensure clickdelay is respected.
|
||||
* Then, it is flushed or discarded using [FlushLastAttack()] or [DiscardLastAttack()] respectively.
|
||||
*/
|
||||
|
||||
|
||||
var/last_action_immediate = 0
|
||||
/// Generic clickdelay variable. Next world.time we should be able to do something that respects generic clickdelay. This should be set using [DelayNextAction()] This should only be checked using [CheckActionCooldown()].
|
||||
var/next_action = 0
|
||||
@@ -31,11 +31,11 @@
|
||||
/// Simple modification variable added to amount on adjust and on checking time since last action using [CheckActionCooldown()].
|
||||
/// This should only be manually modified via addition.
|
||||
var/action_cooldown_adjust = 0
|
||||
|
||||
|
||||
// Resisting - While resisting will give generic clickdelay, it is also on its own resist delay system. However, resisting does not check generic movedelay.
|
||||
// Resist cooldown should only be set at the start of a resist chain - whether this is clicking an alert button, pressing or hotkeying the resist button, or moving to resist out of a locker.
|
||||
/*
|
||||
* Special clickdelay variable for resisting. Last time we did a special action like resisting. This should only be set using [MarkResistTime()].
|
||||
* Special clickdelay variable for resisting. Last time we did a special action like resisting. This should only be set using [MarkResistTime()].
|
||||
* Use [CheckResistCooldown()] to check cooldowns, this should only be used for the resist action bar visual.
|
||||
*/
|
||||
var/last_resist = 0
|
||||
@@ -51,7 +51,7 @@
|
||||
* * amount - Amount to delay by
|
||||
* * ignore_mod - ignores next action adjust and mult
|
||||
* * considered_action - Defaults to TRUE - If TRUE, sets last_action to world.time.
|
||||
* * immediate - defaults to TRUE - if TRUE, writes to cached/last_attack_immediate instead of last_attack. This ensures it can't collide with any delay checks in the actual attack.
|
||||
* * immediate - defaults to TRUE - if TRUE, writes to cached/last_attack_immediate instead of last_attack. This ensures it can't collide with any delay checks in the actual attack.
|
||||
*/
|
||||
/mob/proc/DelayNextAction(amount = 0, ignore_mod = FALSE, considered_action = TRUE, immediate = TRUE)
|
||||
if(immediate)
|
||||
@@ -100,8 +100,11 @@
|
||||
* * immediate - Defaults to FALSE. Checks last action using immediate, used on the head end of an attack. This is to prevent colliding attacks in case of sleep. Not that you should sleep() in an attack but.. y'know.
|
||||
*/
|
||||
/mob/proc/CheckActionCooldown(cooldown = 0.5, from_next_action = FALSE, ignore_mod = FALSE, ignore_next_action = FALSE, immediate = FALSE)
|
||||
var/mod = action_cooldown_mod
|
||||
for(var/datum/status_effect/S in status_effects)
|
||||
mod *= S.action_cooldown_mod()
|
||||
return (ignore_next_action || (world.time >= (immediate? next_action_immediate : next_action))) && \
|
||||
(world.time >= ((from_next_action? (immediate? next_action_immediate : next_action) : (immediate? last_action_immediate : last_action)) + max(0, ignore_mod? cooldown : (cooldown * action_cooldown_mod + action_cooldown_adjust))))
|
||||
(world.time >= ((from_next_action? (immediate? next_action_immediate : next_action) : (immediate? last_action_immediate : last_action)) + max(0, ignore_mod? cooldown : (cooldown * mod + action_cooldown_adjust))))
|
||||
|
||||
/**
|
||||
* Flushes last_action and next_action
|
||||
|
||||
Reference in New Issue
Block a user