|
28 | 28 | var/static/list/plasmaman_suits
|
29 | 29 | var/static/list/vox_suits
|
30 | 30 | var/apply_multiplier = 1
|
| 31 | + var/phasic_scanning = FALSE |
31 | 32 | idle_power_usage = 50
|
32 | 33 | active_power_usage = 300
|
33 | 34 |
|
|
70 | 71 | /obj/item/weapon/stock_parts/scanning_module,
|
71 | 72 | /obj/item/weapon/stock_parts/micro_laser
|
72 | 73 | )
|
73 |
| - if(world.has_round_started()) |
74 |
| - initialize() |
| 74 | + suit_overlay = new /atom/movable/overlay(src) |
| 75 | + suit_overlay.icon = 'icons/obj/stationobjs.dmi' |
| 76 | + suit_overlay.icon_state = "suitmodifier_overlay" |
| 77 | + suit_overlay.plane = ABOVE_HUMAN_PLANE |
| 78 | + suit_overlay.mouse_opacity = 0 |
| 79 | + vis_contents += suit_overlay |
75 | 80 |
|
76 | 81 | /obj/machinery/suit_modifier/RefreshParts()
|
77 | 82 | var/avg_rate = 0
|
|
86 | 91 | avg_rate += ML.rating
|
87 | 92 | amount++
|
88 | 93 | active_power_usage = 300 / (avg_rate / amount)
|
| 94 | + for(var/obj/item/weapon/stock_parts/scanning_module/SM in component_parts) |
| 95 | + if(SM.rating >= 3) |
| 96 | + phasic_scanning = TRUE |
| 97 | + else |
| 98 | + phasic_scanning = FALSE |
89 | 99 |
|
90 | 100 | /obj/machinery/suit_modifier/initialize()
|
91 |
| - suit_overlay = new |
92 |
| - suit_overlay.icon = 'icons/obj/stationobjs.dmi' |
93 |
| - suit_overlay.plane = ABOVE_HUMAN_PLANE |
94 |
| - vis_contents += suit_overlay |
95 | 101 | if(!plasmaman_suits)
|
96 | 102 | plasmaman_suits = build_plasmaman_suit_list()
|
97 | 103 | if(!vox_suits)
|
|
113 | 119 |
|
114 | 120 | /obj/machinery/suit_modifier/attackby(var/obj/item/I, var/mob/user)
|
115 | 121 | if(istype(I, /obj/item/rig_module) && user.drop_item(I, src))
|
| 122 | + playsound(src, 'sound/machines/click.ogg', 50, 1) |
116 | 123 | say("\The [I] installed.", class = "binaryradio")
|
117 | 124 | modules_to_install.Add(I)
|
118 | 125 | return
|
119 | 126 | if(istype(I, /obj/item/weapon/cell) && !cell && user.drop_item(I, src))
|
| 127 | + playsound(src, 'sound/machines/click.ogg', 50, 1) |
120 | 128 | say("\The [I] installed.", class = "binaryradio")
|
121 | 129 | cell = I
|
122 | 130 | return
|
|
125 | 133 | /obj/machinery/suit_modifier/attack_hand(mob/user)
|
126 | 134 | if(!isliving(user))
|
127 | 135 | return
|
| 136 | + if(!powered()) |
| 137 | + return |
128 | 138 | if(is_locking(/mob/living/carbon/human))
|
129 | 139 | playsound(src, 'sound/machines/buzz-two.ogg', 50, 0)
|
130 | 140 | say("Unit Occupied.", class = "binaryradio")
|
|
164 | 174 | modules_to_install -= removed
|
165 | 175 |
|
166 | 176 | /obj/machinery/suit_modifier/proc/activation_animation()
|
| 177 | + //Close the scanner module |
167 | 178 | flick("suitmodifier_activate", suit_overlay)
|
168 |
| - sleep(12) |
| 179 | + playsound(src, 'sound/machines/click.ogg', 30, 1) |
| 180 | + sleep(11) |
| 181 | + //Lights turn on |
| 182 | + suit_overlay.set_light(1,1,"#00FF00") |
| 183 | + sleep(1) |
| 184 | + suit_overlay.icon_state = "suitmodifier_active" |
169 | 185 |
|
170 |
| -/obj/machinery/suit_modifier/proc/working_animation() |
| 186 | + //If the scanners are good enough, we don't need to scan the suit |
| 187 | + if(phasic_scanning) |
| 188 | + return |
| 189 | + |
| 190 | + //Begin the scanner, scans 4 times |
171 | 191 | flick("suitmodifier_working", suit_overlay)
|
172 |
| - sleep(38) |
| 192 | + sleep(3) |
| 193 | + playsound(src, 'sound/items/healthanalyzer.ogg', 30, 1) |
| 194 | + sleep(9) |
| 195 | + playsound(src, 'sound/items/healthanalyzer.ogg', 30, 1) |
| 196 | + sleep(17) |
| 197 | + playsound(src, 'sound/items/healthanalyzer.ogg', 30, 1) |
| 198 | + sleep(9) |
| 199 | + playsound(src, 'sound/items/healthanalyzer.ogg', 30, 1) |
| 200 | + sleep(9) |
| 201 | + playsound(src, 'sound/machines/click.ogg', 30, 1) |
173 | 202 |
|
| 203 | +/obj/machinery/suit_modifier/proc/working_animation() |
| 204 | + //Close the big doors |
174 | 205 | flick("suitmodifier_close", suit_overlay)
|
175 |
| - sleep(22) |
| 206 | + playsound(src, 'sound/machines/poddoor.ogg', 50, 1) |
| 207 | + sleep(12) |
| 208 | + //Light gets covered up, anim still playing |
| 209 | + suit_overlay.set_light(0,0,"#00FF00") |
| 210 | + sleep(10) |
176 | 211 |
|
| 212 | + //Doors are closed |
177 | 213 | suit_overlay.icon_state = "suitmodifier_closed"
|
178 | 214 | sleep(20)
|
179 | 215 |
|
180 | 216 | /obj/machinery/suit_modifier/proc/finished_animation()
|
181 |
| - suit_overlay.icon_state = null |
182 |
| - playsound(src, 'sound/machines/pressurehiss.ogg', 40, 1) |
| 217 | + //Pssshhh, doors open |
| 218 | + playsound(src, 'sound/machines/poddoor.ogg', 50, 1) |
| 219 | + playsound(src, 'sound/machines/pressurehiss.ogg', 30, 1) |
183 | 220 | new /obj/effect/smoke(get_turf(src))
|
| 221 | + flick("suitmodifier_open", suit_overlay) |
| 222 | + sleep(22) |
| 223 | + |
| 224 | + suit_overlay.icon_state = "suitmodifier_overlay" |
| 225 | + |
| 226 | +/obj/machinery/suit_modifier/proc/cancel_animation() |
| 227 | + //Open the scanner module |
| 228 | + suit_overlay.set_light(0,0,"#00FF00") |
| 229 | + flick("suitmodifier_deactivate", suit_overlay) |
| 230 | + sleep(12) |
| 231 | + playsound(src, 'sound/machines/click.ogg', 30, 1) |
| 232 | + |
| 233 | + suit_overlay.icon_state = "suitmodifier_overlay" |
184 | 234 |
|
185 | 235 | /proc/filter_suit_list(mob/living/carbon/human/guy, list/suit_list)
|
186 | 236 | var/guy_access = guy.GetAccess()
|
|
194 | 244 | /obj/machinery/suit_modifier/proc/process_suit_replace(mob/living/carbon/human/guy, list/suit_list)
|
195 | 245 | if(activated)
|
196 | 246 | return
|
| 247 | + activated = TRUE |
| 248 | + use_power = MACHINE_POWER_USE_ACTIVE |
197 | 249 | lock_atom(guy)
|
| 250 | + activation_animation() |
198 | 251 | var/obj/item/clothing/suit/space/chosen_job = input(guy, "What kind of model do you wish to apply?") as null|anything in filter_suit_list(guy, suit_list)
|
199 | 252 | if(!chosen_job || activated || guy.incapacitated() || guy.loc != loc)
|
| 253 | + cancel_animation() |
200 | 254 | unlock_atom(guy)
|
| 255 | + use_power = MACHINE_POWER_USE_IDLE |
| 256 | + activated = FALSE |
201 | 257 | return
|
| 258 | + working_animation() |
202 | 259 | var/obj/item/clothing/suit/space/chosen_suit = suit_list[chosen_job][SUIT_INDEX]
|
203 | 260 | var/obj/item/clothing/head/helmet/space/chosen_helmet = suit_list[chosen_job][HELMET_INDEX]
|
204 |
| - activated = TRUE |
205 |
| - use_power = MACHINE_POWER_USE_ACTIVE |
206 |
| - activation_animation() |
207 |
| - working_animation() |
208 |
| - var/obj/item/clothing/suit/space/oldsuit = guy.get_item_by_slot(slot_wear_suit) |
209 |
| - if(oldsuit) |
210 |
| - guy.equip_to_slot(new chosen_suit, slot_wear_suit) |
211 |
| - qdel(oldsuit) |
212 |
| - guy.update_inv_wear_suit() |
213 |
| - var/obj/item/clothing/head/helmet/space/oldhelmet = guy.get_item_by_slot(slot_head) |
214 |
| - if(oldhelmet) |
215 |
| - guy.equip_to_slot(new chosen_helmet, slot_head) |
216 |
| - qdel(oldhelmet) |
217 |
| - guy.update_inv_head() |
218 |
| - finished_animation() |
| 261 | + spawn(rand(3,10) / apply_multiplier) |
| 262 | + playsound(src, 'sound/effects/spray3.ogg', 30, 1) |
| 263 | + spawn(rand(20,30) / apply_multiplier) |
| 264 | + playsound(src, 'sound/effects/spray2.ogg', 30, 1) |
| 265 | + spawn(5 SECONDS / apply_multiplier) |
| 266 | + playsound(src, 'sound/effects/spray.ogg', 30, 1) |
| 267 | + if(do_after(guy, src, 8 SECONDS / apply_multiplier, needhand = FALSE)) |
| 268 | + var/obj/item/clothing/suit/space/oldsuit = guy.get_item_by_slot(slot_wear_suit) |
| 269 | + if(oldsuit) |
| 270 | + guy.equip_to_slot(new chosen_suit, slot_wear_suit) |
| 271 | + qdel(oldsuit) |
| 272 | + guy.update_inv_wear_suit() |
| 273 | + var/obj/item/clothing/head/helmet/space/oldhelmet = guy.get_item_by_slot(slot_head) |
| 274 | + if(oldhelmet) |
| 275 | + guy.equip_to_slot(new chosen_helmet, slot_head) |
| 276 | + qdel(oldhelmet) |
| 277 | + guy.update_inv_head() |
219 | 278 | unlock_atom(guy)
|
| 279 | + finished_animation() |
220 | 280 | use_power = MACHINE_POWER_USE_IDLE
|
221 | 281 | activated = FALSE
|
222 | 282 |
|
223 | 283 | /obj/machinery/suit_modifier/proc/process_module_installation(var/mob/living/carbon/human/H)
|
224 | 284 | if(activated)
|
225 | 285 | return
|
226 |
| - lock_atom(H) |
| 286 | + var/obj/item/clothing/suit/space/rig/R = H.is_wearing_item(/obj/item/clothing/suit/space/rig, slot_wear_suit) |
| 287 | + if(!R) |
| 288 | + return |
227 | 289 | activated = TRUE
|
228 | 290 | use_power = MACHINE_POWER_USE_ACTIVE
|
229 |
| - activation_animation() |
230 |
| - var/obj/item/clothing/suit/space/rig/R = H.is_wearing_item(/obj/item/clothing/suit/space/rig, slot_wear_suit) |
| 291 | + R.canremove = FALSE |
| 292 | + lock_atom(H) |
231 | 293 | R.deactivate_suit()
|
| 294 | + activation_animation() |
| 295 | + working_animation() |
232 | 296 | for(var/obj/item/rig_module/RM in modules_to_install)
|
233 | 297 | var/install_result=RM.can_install(R)
|
234 | 298 | if(!install_result[1]) //more versatile check, allows for custom install conditions.
|
235 | 299 | say(install_result[2], class = "binaryradio")
|
236 | 300 | continue
|
| 301 | + playsound(src, 'sound/mecha/hydraulic.ogg', 40, 1) |
| 302 | + spawn(rand(4 SECONDS, 5 SECONDS) / apply_multiplier) |
| 303 | + playsound(src, 'sound/items/Welder.ogg', 50, 1) |
237 | 304 | if(do_after(H, src, 8 SECONDS / apply_multiplier, needhand = FALSE))
|
238 | 305 | say("Installing [RM] into \the [R].", class = "binaryradio")
|
239 | 306 | R.modules.Add(RM)
|
240 | 307 | RM.rig = R
|
241 | 308 | RM.forceMove(R)
|
242 | 309 | modules_to_install.Remove(RM)
|
243 |
| - working_animation() |
244 | 310 | if(cell) //Can't answer the prompt if you're incapacitated.
|
245 | 311 | var/choice = alert(H, "Do you wish to install [cell]?", src, "Yes", "No")
|
246 | 312 | if((choice == "Yes") && H.Adjacent(src) && !H.incapacitated())
|
247 | 313 | say("Installing [cell] into to \the [R].", class = "binaryradio")
|
248 |
| - if(R.cell) |
249 |
| - R.cell.forceMove(get_turf(src)) |
250 |
| - cell.forceMove(R) |
251 |
| - R.cell = cell |
252 |
| - cell = null |
253 |
| - finished_animation() |
254 |
| - unlock_atom(H) |
| 314 | + playsound(src, 'sound/mecha/hydraulic.ogg', 40, 1) |
| 315 | + spawn(rand(4 SECONDS, 5 SECONDS) / apply_multiplier) |
| 316 | + playsound(src, 'sound/misc/click.ogg', 50, 1) |
| 317 | + if(do_after(H, src, 8 SECONDS / apply_multiplier, needhand = FALSE)) |
| 318 | + if(R.cell) |
| 319 | + R.cell.forceMove(get_turf(src)) |
| 320 | + cell.forceMove(R) |
| 321 | + R.cell = cell |
| 322 | + cell = null |
| 323 | + if(!R.current_glue_state) |
| 324 | + R.canremove = TRUE |
255 | 325 | R.initialize_suit()
|
| 326 | + unlock_atom(H) |
| 327 | + finished_animation() |
256 | 328 | use_power = MACHINE_POWER_USE_IDLE
|
257 | 329 | activated = FALSE
|
258 | 330 |
|
259 | 331 | /obj/machinery/suit_modifier/proc/process_module_removal(var/mob/living/carbon/human/H)
|
260 | 332 | if(activated)
|
261 | 333 | return
|
262 |
| - lock_atom(H) |
| 334 | + var/obj/item/clothing/suit/space/rig/R = H.is_wearing_item(/obj/item/clothing/suit/space/rig, slot_wear_suit) |
| 335 | + if(!R) |
| 336 | + return |
| 337 | + // if we have something that's not a rig_module here we have a problem |
| 338 | + if(!R.modules.len) |
| 339 | + return |
263 | 340 | activated = TRUE
|
264 | 341 | use_power = MACHINE_POWER_USE_ACTIVE
|
265 |
| - activation_animation() |
266 |
| - var/obj/item/clothing/suit/space/rig/R = H.is_wearing_item(/obj/item/clothing/suit/space/rig, slot_wear_suit) |
| 342 | + R.canremove = FALSE |
| 343 | + lock_atom(H) |
267 | 344 | R.deactivate_suit()
|
268 |
| - if(R.modules.len) |
269 |
| - // if we have something that's not a rig_module here we have a problem |
270 |
| - var/obj/item/rig_module/RM = input(H, "Choose an upgrade to remove from [R].", R) as null|anything in R.modules |
271 |
| - if(!RM|| !H.Adjacent(src) || H.incapacitated()) |
272 |
| - unlock_atom(H) |
273 |
| - activated = FALSE |
274 |
| - return |
275 |
| - working_animation() |
276 |
| - say("Uninstalling [RM] from \the [R].", class = "binaryradio") |
277 |
| - if(do_after(H, src, 8 SECONDS / apply_multiplier, needhand = FALSE)) |
278 |
| - R.modules.Remove(RM) |
279 |
| - RM.rig = null |
280 |
| - RM.forceMove(get_turf(src)) |
281 |
| - finished_animation() |
282 |
| - unlock_atom(H) |
| 345 | + activation_animation() |
| 346 | + var/obj/item/rig_module/RM = input(H, "Choose an upgrade to remove from [R].", R) as null|anything in R.modules |
| 347 | + if(!RM|| !H.Adjacent(src) || H.incapacitated()) |
| 348 | + cancel_animation() |
| 349 | + if(!R.current_glue_state) |
| 350 | + R.canremove = TRUE |
| 351 | + unlock_atom(H) |
| 352 | + R.initialize_suit() |
| 353 | + use_power = MACHINE_POWER_USE_IDLE |
| 354 | + activated = FALSE |
| 355 | + return |
| 356 | + say("Uninstalling [RM] from \the [R].", class = "binaryradio") |
| 357 | + working_animation() |
| 358 | + playsound(src, 'sound/mecha/hydraulic.ogg', 40, 1) |
| 359 | + spawn(rand(4 SECONDS, 5 SECONDS) / apply_multiplier) |
| 360 | + playsound(src, 'sound/items/Welder.ogg', 60, 1) |
| 361 | + if(do_after(H, src, 8 SECONDS / apply_multiplier, needhand = FALSE)) |
| 362 | + R.modules.Remove(RM) |
| 363 | + RM.rig = null |
| 364 | + RM.forceMove(get_turf(src)) |
| 365 | + if(!R.current_glue_state) |
| 366 | + R.canremove = TRUE |
283 | 367 | R.initialize_suit()
|
| 368 | + unlock_atom(H) |
| 369 | + finished_animation() |
284 | 370 | use_power = MACHINE_POWER_USE_IDLE
|
285 | 371 | activated = FALSE
|
286 | 372 |
|
|
0 commit comments