It's done, atleast the code is

This commit is contained in:
Fabian
2021-03-05 21:50:29 +01:00
parent 2f1aba4f80
commit 8178b7073a
17 changed files with 1128 additions and 58 deletions
+38
View File
@@ -49,6 +49,11 @@
/// A weak reference to another datum
var/datum/weakref/weak_reference
//ambition start
///Lazy associative list of currently active cooldowns.
var/list/cooldowns
//ambition end
/*
* Lazy associative list of currently active cooldowns.
*
@@ -231,6 +236,39 @@
else
return returned
//ambition start
/**
* Callback called by a timer to end an associative-list-indexed cooldown.
*
* Arguments:
* * source - datum storing the cooldown
* * index - string index storing the cooldown on the cooldowns associative list
*
* This sends a signal reporting the cooldown end.
*/
/proc/end_cooldown(datum/source, index)
if(QDELETED(source))
return
SEND_SIGNAL(source, COMSIG_CD_STOP(index))
TIMER_COOLDOWN_END(source, index)
/**
* Proc used by stoppable timers to end a cooldown before the time has ran out.
*
* Arguments:
* * source - datum storing the cooldown
* * index - string index storing the cooldown on the cooldowns associative list
*
* This sends a signal reporting the cooldown end, passing the time left as an argument.
*/
/proc/reset_cooldown(datum/source, index)
if(QDELETED(source))
return
SEND_SIGNAL(source, COMSIG_CD_RESET(index), S_TIMER_COOLDOWN_TIMELEFT(source, index))
TIMER_COOLDOWN_END(source, index)
//ambition end
/**
* Callback called by a timer to end an associative-list-indexed cooldown.
*
+957 -39
View File
File diff suppressed because it is too large Load Diff