-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy path_toggle.dm
37 lines (29 loc) · 1006 Bytes
/
_toggle.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
///basically just a copy of how part of /datum/action/innate works, but as a spell typepath
/datum/action/cooldown/spell/toggle
/// Whether we're active or not
var/active = FALSE
/datum/action/cooldown/spell/toggle/New()
. = ..()
START_PROCESSING(SSfastprocess, src)
/datum/action/cooldown/spell/toggle/Destroy()
STOP_PROCESSING(SSfastprocess, src)
return ..()
/datum/action/cooldown/spell/toggle/Remove(mob/living/remove_from)
if(active)
Disable()
return ..()
/datum/action/cooldown/spell/toggle/process()
build_all_button_icons(ALL) //so as to be consistent with situational requirements, keep the button updated
/datum/action/cooldown/spell/toggle/cast(atom/cast_on)
active = !active
if(active)
Enable()
else
Disable()
return ..()
/datum/action/cooldown/spell/toggle/is_action_active(atom/movable/screen/movable/action_button/current_button)
return active
/datum/action/cooldown/spell/toggle/proc/Enable()
return
/datum/action/cooldown/spell/toggle/proc/Disable()
return