-
Notifications
You must be signed in to change notification settings - Fork 555
/
robot_parts.dm
225 lines (200 loc) · 6.77 KB
/
robot_parts.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/obj/item/robot_parts
name = "robot parts"
icon = 'icons/obj/items/robot_parts.dmi'
item_state = "buildpipe"
icon_state = "blank"
flags_atom = FPRINT|CONDUCT
flags_equip_slot = SLOT_WAIST
matter = list("metal" = 500, "glass" = 0)
var/list/part = null
/obj/item/robot_parts/arm/l_arm
name = "robot left arm"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "l_arm"
part = list("l_arm","l_hand")
/obj/item/robot_parts/arm/r_arm
name = "robot right arm"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "r_arm"
part = list("r_arm","r_hand")
/obj/item/robot_parts/leg/l_leg
name = "robot left leg"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "l_leg"
part = list("l_leg","l_foot")
/obj/item/robot_parts/leg/r_leg
name = "robot right leg"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "r_leg"
part = list("r_leg","r_foot")
/obj/item/robot_parts/hand/l_hand
name = "robot left hand"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "l_hand"
part = list("l_hand")
/obj/item/robot_parts/hand/r_hand
name = "robot right hand"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "r_hand"
part = list("r_hand")
/obj/item/robot_parts/foot/l_foot
name = "robot left foot"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "l_foot"
part = list("l_foot")
/obj/item/robot_parts/foot/r_foot
name = "robot right foot"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "r_foot"
part = list("r_foot")
/obj/item/robot_parts/chest
name = "robot torso"
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
icon_state = "chest"
var/wires = 0
var/obj/item/cell/cell = null
/obj/item/robot_parts/head
name = "robot head"
desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
icon_state = "head"
var/obj/item/device/flash/flash1 = null
var/obj/item/device/flash/flash2 = null
/// A cameo of a real robotic head with limited gameplay functionality
/obj/item/fake_robot_head
name = "malfunctioning robot head"
desc = "A standard reinforced braincase. Or it would be if it had been made correctly. This one looks deficient."
icon = 'icons/obj/items/robot_parts.dmi'
icon_state = "head"
item_state = "buildpipe"
flags_equip_slot = SLOT_WAIST
matter = list("metal" = 500, "glass" = 0)
/obj/item/robot_parts/robot_suit
name = "robot endoskeleton"
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
icon_state = "robo_suit"
var/obj/item/robot_parts/arm/l_arm/l_arm = null
var/obj/item/robot_parts/arm/r_arm/r_arm = null
var/obj/item/robot_parts/leg/l_leg/l_leg = null
var/obj/item/robot_parts/leg/r_leg/r_leg = null
var/obj/item/robot_parts/chest/chest = null
var/obj/item/robot_parts/head/head = null
var/created_name = ""
/obj/item/robot_parts/robot_suit/New()
..()
src.updateicon()
/obj/item/robot_parts/robot_suit/proc/updateicon()
src.overlays.Cut()
if(src.l_arm)
src.overlays += "l_arm+o"
if(src.r_arm)
src.overlays += "r_arm+o"
if(src.chest)
src.overlays += "chest+o"
if(src.l_leg)
src.overlays += "l_leg+o"
if(src.r_leg)
src.overlays += "r_leg+o"
if(src.head)
src.overlays += "head+o"
/obj/item/robot_parts/robot_suit/proc/check_completion()
if(src.l_arm && src.r_arm)
if(src.l_leg && src.r_leg)
if(src.chest && src.head)
return 1
return 0
/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/robot_parts/leg/l_leg))
if(l_leg) return
if(user.drop_inv_item_to_loc(W, src))
l_leg = W
updateicon()
if(istype(W, /obj/item/robot_parts/leg/r_leg))
if(r_leg) return
if(user.drop_inv_item_to_loc(W, src))
r_leg = W
updateicon()
if(istype(W, /obj/item/robot_parts/arm/l_arm))
if(l_arm) return
if(user.drop_inv_item_to_loc(W, src))
l_arm = W
updateicon()
if(istype(W, /obj/item/robot_parts/arm/r_arm))
if(r_arm) return
if(user.drop_inv_item_to_loc(W, src))
r_arm = W
updateicon()
if(istype(W, /obj/item/robot_parts/chest))
if(chest) return
if(W:wires && W:cell)
if(user.drop_inv_item_to_loc(W, src))
chest = W
updateicon()
else if(!W:wires)
to_chat(user, SPAN_NOTICE(" You need to attach wires to it first!"))
else
to_chat(user, SPAN_NOTICE(" You need to attach a cell to it first!"))
if(istype(W, /obj/item/robot_parts/head))
if(head) return
if(W:flash2 && W:flash1)
if(user.drop_inv_item_to_loc(W, src))
head = W
updateicon()
else
to_chat(user, SPAN_NOTICE(" You need to attach a flash to it first!"))
return
/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/cell))
if(src.cell)
to_chat(user, SPAN_NOTICE(" You have already inserted a cell!"))
return
else
if(user.drop_inv_item_to_loc(W, src))
cell = W
to_chat(user, SPAN_NOTICE(" You insert the cell!"))
if(istype(W, /obj/item/stack/cable_coil))
if(src.wires)
to_chat(user, SPAN_NOTICE(" You have already inserted wire!"))
return
else
var/obj/item/stack/cable_coil/coil = W
coil.use(1)
src.wires = 1
to_chat(user, SPAN_NOTICE(" You insert the wire!"))
return
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/device/flash))
if(istype(user,/mob/living/silicon/robot))
to_chat(user, SPAN_DANGER("How do you propose to do that?"))
return
else if(src.flash1 && src.flash2)
to_chat(user, SPAN_NOTICE(" You have already inserted the eyes!"))
return
else if(src.flash1)
if(user.drop_inv_item_to_loc(W, src))
flash2 = W
to_chat(user, SPAN_NOTICE(" You insert the flash into the eye socket!"))
else
user.drop_inv_item_to_loc(W, src)
flash1 = W
to_chat(user, SPAN_NOTICE(" You insert the flash into the eye socket!"))
else if(istype(W, /obj/item/stock_parts/manipulator))
to_chat(user, SPAN_NOTICE(" You install some manipulators and modify the head, creating a functional spider-bot!"))
new /mob/living/simple_animal/spiderbot(get_turf(loc))
user.temp_drop_inv_item(W)
qdel(W)
qdel(src)
return
return
/obj/item/fake_robot_head/attackby(obj/item/W, mob/user)
. = ..()
if(istype(W, /obj/item/device/flash))
to_chat(user, SPAN_DANGER("That thing looks way too busted to do anything with it..."))
// I lied
else if(istype(W, /obj/item/stock_parts/manipulator))
to_chat(user, SPAN_NOTICE("You jury rig the head with some manipulators, creating a mostly functional spider-bot!"))
new /mob/living/simple_animal/spiderbot(get_turf(loc))
qdel(W)
qdel(src)