This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
camera.dm
154 lines (126 loc) · 4.85 KB
/
camera.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/obj/machinery/computer/camera_advanced/abductor
name = "Human Observation Console"
var/team_number = 0
networks = list("ss13", "abductor")
var/datum/action/innate/teleport_in/tele_in_action = new
var/datum/action/innate/teleport_out/tele_out_action = new
var/datum/action/innate/teleport_self/tele_self_action = new
var/datum/action/innate/vest_mode_swap/vest_mode_action = new
var/datum/action/innate/vest_disguise_swap/vest_disguise_action = new
var/datum/action/innate/set_droppoint/set_droppoint_action = new
var/obj/machinery/abductor/console/console
lock_override = TRUE
icon = 'icons/obj/abductor.dmi'
icon_state = "camera"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/machinery/computer/camera_advanced/abductor/CreateEye()
..()
eyeobj.visible_icon = TRUE
eyeobj.icon = 'icons/mob/cameramob.dmi'
eyeobj.icon_state = "abductor_camera"
eyeobj.invisibility = INVISIBILITY_OBSERVER
/obj/machinery/computer/camera_advanced/abductor/GrantActions(mob/living/carbon/user)
..()
if(tele_in_action)
tele_in_action.target = console.pad
tele_in_action.Grant(user)
actions += tele_in_action
if(tele_out_action)
tele_out_action.target = console
tele_out_action.Grant(user)
actions += tele_out_action
if(tele_self_action)
tele_self_action.target = console.pad
tele_self_action.Grant(user)
actions += tele_self_action
if(vest_mode_action)
vest_mode_action.target = console
vest_mode_action.Grant(user)
actions += vest_mode_action
if(vest_disguise_action)
vest_disguise_action.target = console
vest_disguise_action.Grant(user)
actions += vest_disguise_action
if(set_droppoint_action)
set_droppoint_action.target = console
set_droppoint_action.Grant(user)
actions += set_droppoint_action
/obj/machinery/computer/camera_advanced/abductor/proc/IsScientist(mob/living/carbon/human/H)
return HAS_TRAIT(H, TRAIT_ABDUCTOR_SCIENTIST_TRAINING)
/datum/action/innate/teleport_in
///Is the amount of time required between uses
var/abductor_pad_cooldown = 8 SECONDS
///Is used to compare to world.time in order to determine if the action should early return
var/use_delay
name = "Send To"
icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "beam_down"
/datum/action/innate/teleport_in/Activate()
if(!target || !iscarbon(owner))
return
if(world.time < use_delay)
to_chat(owner, "<span class='warning'>You must wait [DisplayTimeText(use_delay - world.time)] to use the [target] again!</span>")
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
var/obj/machinery/abductor/pad/P = target
use_delay = (world.time + abductor_pad_cooldown)
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
P.PadToLoc(remote_eye.loc)
/datum/action/innate/teleport_out
name = "Retrieve"
icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "beam_up"
/datum/action/innate/teleport_out/Activate()
if(!target || !iscarbon(owner))
return
var/obj/machinery/abductor/console/console = target
console.TeleporterRetrieve()
/datum/action/innate/teleport_self
///Is the amount of time required between uses
var/teleport_self_cooldown = 9 SECONDS
var/use_delay
name = "Send Self"
icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "beam_down"
/datum/action/innate/teleport_self/Activate()
if(!target || !iscarbon(owner))
return
if(world.time < use_delay)
to_chat(owner, "<span class='warning'>You can only teleport to one place at a time!</span>")
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
var/obj/machinery/abductor/pad/P = target
use_delay = (world.time + teleport_self_cooldown)
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
P.MobToLoc(remote_eye.loc,C)
/datum/action/innate/vest_mode_swap
name = "Switch Vest Mode"
icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "vest_mode"
/datum/action/innate/vest_mode_swap/Activate()
if(!target || !iscarbon(owner))
return
var/obj/machinery/abductor/console/console = target
console.FlipVest()
/datum/action/innate/vest_disguise_swap
name = "Switch Vest Disguise"
icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "vest_disguise"
/datum/action/innate/vest_disguise_swap/Activate()
if(!target || !iscarbon(owner))
return
var/obj/machinery/abductor/console/console = target
console.SelectDisguise(remote=1)
/datum/action/innate/set_droppoint
name = "Set Experiment Release Point"
icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "set_drop"
/datum/action/innate/set_droppoint/Activate()
if(!target || !iscarbon(owner))
return
var/mob/living/carbon/human/C = owner
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
var/obj/machinery/abductor/console/console = target
console.SetDroppoint(remote_eye.loc,owner)