-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathmob_actions.dm
44 lines (38 loc) · 1.22 KB
/
mob_actions.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
38
39
40
41
42
43
44
///Hotkeys for performing actions
/datum/keybinding/mob/action_hotkey
var/action_num = 0
category = CATEGORY_CARBON
description = "Hotkey to activate an action of your mob in the corresponding slot"
/datum/keybinding/mob/action_hotkey/can_use(client/user)
return user?.mob?.actions?.len>=action_num && ..()
/datum/keybinding/mob/action_hotkey/down(client/user)
var/mob/M = user.mob
var/datum/action/linked_action = M.actions[action_num]
if (linked_action.owner != M)
return //cheeky
if (linked_action)
linked_action.Trigger()
SEND_SOUND(usr, get_sfx(SFX_TERMINAL_TYPE))
else
to_chat(user, span_warning("You don't have an action to use in that slot"))
return TRUE
/datum/keybinding/mob/action_hotkey/action_1
hotkey_keys = list("Unbound")
name = "action_1"
full_name = "Quick Action 1"
action_num = 1
/datum/keybinding/mob/action_hotkey/action_2
hotkey_keys = list("Unbound")
name = "action_2"
full_name = "Quick Action 2"
action_num = 2
/datum/keybinding/mob/action_hotkey/action_3
hotkey_keys = list("Unbound")
name = "action_3"
full_name = "Quick Action 3"
action_num = 3
/datum/keybinding/mob/action_hotkey/action_4
hotkey_keys = list("Unbound")
name = "action_4"
full_name = "Quick Action 4"
action_num = 4