-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathnuclearbomb.dm
714 lines (631 loc) · 23.2 KB
/
nuclearbomb.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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
/obj/machinery/nuclearbomb
name = "nuclear fission explosive"
desc = "A stolen Nanotrasen branded nuclear bomb. You probably shouldn't stick around to see if this is armed."
icon = 'icons/obj/machines/nuke.dmi'
icon_state = "nuclearbomb_base"
base_icon_state = "nuclearbomb"
anchored = FALSE
density = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/timer_set = 90
var/default_timer_set = 90
var/minimum_timer_set = 90
var/maximum_timer_set = 3600
var/numeric_input = ""
var/ui_mode = NUKEUI_AWAIT_DISK
var/timing = FALSE
var/exploding = FALSE
var/exploded = FALSE
var/detonation_timer = null
var/r_code = "ADMIN"
var/yes_code = FALSE
var/safety = TRUE
var/obj/item/disk/nuclear/auth = null
use_power = NO_POWER_USE
var/previous_level = ""
var/obj/item/nuke_core/core = null
var/deconstruction_state = NUKESTATE_INTACT
var/proper_bomb = TRUE //Please
var/obj/effect/countdown/nuclearbomb/countdown
/obj/machinery/nuclearbomb/Initialize(mapload)
. = ..()
countdown = new(src)
GLOB.nuke_list += src
core = new /obj/item/nuke_core(src)
STOP_PROCESSING(SSobj, core)
update_appearance(UPDATE_ICON)
GLOB.poi_list |= src
previous_level = SSsecurity_level.get_current_level_as_text()
/obj/machinery/nuclearbomb/Destroy()
safety = FALSE
if(!exploding)
// If we're not exploding, set the alert level back to normal
set_safety()
GLOB.poi_list -= src
GLOB.nuke_list -= src
QDEL_NULL(countdown)
QDEL_NULL(core)
. = ..()
/obj/machinery/nuclearbomb/examine(mob/user)
. = ..()
if(exploding)
to_chat(user, "It is in the process of exploding. Perhaps reviewing your affairs is in order.")
if(timing)
to_chat(user, "There are [get_time_left()] seconds until detonation.")
/obj/machinery/nuclearbomb/selfdestruct
name = "station self-destruct terminal"
desc = "For when it all gets too much to bear. Do not taunt."
icon = 'icons/obj/machines/nuke_terminal.dmi'
anchored = TRUE //stops it being moved
/obj/machinery/nuclearbomb/selfdestruct/examine(mob/user)
. = ..()
. += span_boldnotice("Self-destruct sequence requires the disk to remain inside until detonation. Ejection will cancel detonation.")
/obj/machinery/nuclearbomb/syndicate
//ui_style = "syndicate" // actually the nuke op bomb is a stole nt bomb
/obj/machinery/nuclearbomb/syndicate/get_cinematic_type(off_station)
switch(off_station)
if(0)
var/datum/team/nuclear/NM = locate() in GLOB.antagonist_teams
if(istype(NM) && !NM.syndies_escaped())
return CINEMATIC_ANNIHILATION
else
return CINEMATIC_NUKE_WIN
if(1)
return CINEMATIC_NUKE_MISS
if(2)
return CINEMATIC_NUKE_FAR
return CINEMATIC_NUKE_FAR
/obj/machinery/nuclearbomb/proc/disk_check(obj/item/disk/nuclear/D)
if(D.fake)
say("Authentication failure; disk not recognised.")
return FALSE
else
return TRUE
/obj/machinery/nuclearbomb/attackby(obj/item/I, mob/user, params)
if (istype(I, /obj/item/disk/nuclear))
if(!disk_check(I))
return
if(!user.transferItemToLoc(I, src))
return
auth = I
update_ui_mode()
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
add_fingerprint(user)
return
switch(deconstruction_state)
if(NUKESTATE_INTACT)
if(istype(I, /obj/item/screwdriver/nuke))
to_chat(user, span_notice("You start removing [src]'s front panel's screws..."))
if(I.use_tool(src, user, 60, volume=100))
deconstruction_state = NUKESTATE_UNSCREWED
to_chat(user, span_notice("You remove the screws from [src]'s front panel."))
update_appearance(UPDATE_ICON)
return
if(NUKESTATE_PANEL_REMOVED)
if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=1))
return
to_chat(user, span_notice("You start cutting [src]'s inner plate..."))
if(I.use_tool(src, user, 80, volume=100, amount=1))
to_chat(user, span_notice("You cut [src]'s inner plate."))
deconstruction_state = NUKESTATE_WELDED
update_appearance(UPDATE_ICON)
return
if(NUKESTATE_CORE_EXPOSED)
if(istype(I, /obj/item/nuke_core_container))
var/obj/item/nuke_core_container/core_box = I
to_chat(user, span_notice("You start loading the plutonium core into [core_box]..."))
if(do_after(user, 5 SECONDS, src))
if(core_box.load(core, user))
to_chat(user, span_notice("You load the plutonium core into [core_box]."))
deconstruction_state = NUKESTATE_CORE_REMOVED
update_appearance(UPDATE_ICON)
core = null
else
to_chat(user, span_warning("You fail to load the plutonium core into [core_box]. [core_box] has already been used!"))
return
if(istype(I, /obj/item/stack/sheet/metal))
if(!I.tool_start_check(user, amount=20))
return
to_chat(user, span_notice("You begin repairing [src]'s inner metal plate..."))
if(I.use_tool(src, user, 100, amount=20))
to_chat(user, span_notice("You repair [src]'s inner metal plate. The radiation is contained."))
deconstruction_state = NUKESTATE_PANEL_REMOVED
STOP_PROCESSING(SSobj, core)
update_appearance(UPDATE_ICON)
return
. = ..()
/obj/machinery/nuclearbomb/crowbar_act(mob/user, obj/item/tool)
. = FALSE
switch(deconstruction_state)
if(NUKESTATE_UNSCREWED)
to_chat(user, span_notice("You start removing [src]'s front panel..."))
if(tool.use_tool(src, user, 30, volume=100))
to_chat(user, span_notice("You remove [src]'s front panel."))
deconstruction_state = NUKESTATE_PANEL_REMOVED
update_appearance(UPDATE_ICON)
return TRUE
if(NUKESTATE_WELDED)
to_chat(user, span_notice("You start prying off [src]'s inner plate..."))
if(tool.use_tool(src, user, 30, volume=100))
to_chat(user, span_notice("You pry off [src]'s inner plate. You can see the core's green glow!"))
deconstruction_state = NUKESTATE_CORE_EXPOSED
update_appearance(UPDATE_ICON)
START_PROCESSING(SSobj, core)
return TRUE
/obj/machinery/nuclearbomb/proc/get_nuke_state()
if(exploding)
return NUKE_ON_EXPLODING
if(timing)
return NUKE_ON_TIMING
if(safety)
return NUKE_OFF_LOCKED
else
return NUKE_OFF_UNLOCKED
/obj/machinery/nuclearbomb/update_icon_state()
if(deconstruction_state != NUKESTATE_INTACT)
icon_state = "[base_icon_state]_base"
return ..()
switch(get_nuke_state())
if(NUKE_OFF_LOCKED, NUKE_OFF_UNLOCKED)
icon_state = "[base_icon_state]_base"
if(NUKE_ON_TIMING)
icon_state = "[base_icon_state]_timing"
if(NUKE_ON_EXPLODING)
icon_state = "[base_icon_state]_exploding"
return ..()
/obj/machinery/nuclearbomb/update_overlays()
. = ..()
switch(deconstruction_state)
if(NUKESTATE_UNSCREWED)
. += "panel-unscrewed"
if(NUKESTATE_PANEL_REMOVED)
. += "panel-removed"
if(NUKESTATE_WELDED)
. += "plate-welded"
if(NUKESTATE_CORE_EXPOSED)
. += "plate-removed"
if(NUKESTATE_CORE_REMOVED)
. += "core-removed"
switch(get_nuke_state())
if(NUKE_OFF_UNLOCKED)
. += "lights-safety"
if(NUKE_ON_TIMING)
. += "lights-timing"
if(NUKE_ON_EXPLODING)
. += "lights-exploding"
/obj/machinery/nuclearbomb/process()
if(timing && !exploding)
if(detonation_timer < world.time)
explode()
else
var/volume = (get_time_left() <= 20 ? 30 : 5)
playsound(loc, 'sound/items/timer.ogg', volume, 0)
/obj/machinery/nuclearbomb/proc/update_ui_mode()
if(exploded)
ui_mode = NUKEUI_EXPLODED
return
if(!auth)
ui_mode = NUKEUI_AWAIT_DISK
return
if(timing)
ui_mode = NUKEUI_TIMING
return
if(!safety)
ui_mode = NUKEUI_AWAIT_ARM
return
if(!yes_code)
ui_mode = NUKEUI_AWAIT_CODE
return
ui_mode = NUKEUI_AWAIT_TIMER
/obj/machinery/nuclearbomb/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "NuclearBomb", name)
ui.open()
/obj/machinery/nuclearbomb/ui_data(mob/user)
var/list/data = list()
data["disk_present"] = auth
var/hidden_code = (ui_mode == NUKEUI_AWAIT_CODE && numeric_input != "ERROR")
var/current_code = ""
if(hidden_code)
while(length(current_code) < length(numeric_input))
current_code = "[current_code]*"
else
current_code = numeric_input
while(length(current_code) < 5)
current_code = "[current_code]-"
var/first_status
var/second_status
switch(ui_mode)
if(NUKEUI_AWAIT_DISK)
first_status = "DEVICE LOCKED"
if(timing)
second_status = "TIME: [get_time_left()]"
else
second_status = "AWAIT DISK"
if(NUKEUI_AWAIT_CODE)
first_status = "INPUT CODE"
second_status = "CODE: [current_code]"
if(NUKEUI_AWAIT_TIMER)
first_status = "INPUT TIME"
second_status = "TIME: [current_code]"
if(NUKEUI_AWAIT_ARM)
first_status = "DEVICE READY"
second_status = "TIME: [get_time_left()]"
if(NUKEUI_TIMING)
first_status = "DEVICE ARMED"
second_status = "TIME: [get_time_left()]"
if(NUKEUI_EXPLODED)
first_status = "DEVICE DEPLOYED"
second_status = "THANK YOU"
data["status1"] = first_status
data["status2"] = second_status
data["anchored"] = anchored
return data
/obj/machinery/nuclearbomb/ui_act(action, params)
if(..())
return
playsound(src, "terminal_type", 20, FALSE)
switch(action)
if("eject_disk")
if(auth && auth.loc == src)
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
auth.forceMove(get_turf(src))
auth = null
. = TRUE
else
var/obj/item/I = usr.is_holding_item_of_type(/obj/item/disk/nuclear)
if(I && disk_check(I) && usr.transferItemToLoc(I, src))
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
auth = I
. = TRUE
if(istype(src, /obj/machinery/nuclearbomb/selfdestruct) && timing)
set_active() // Disarm if ejected, selfdestruct requires disk the entire way for balance reasons
update_ui_mode()
if("keypad")
if(auth)
var/digit = params["digit"]
switch(digit)
if("C")
if(auth && ui_mode == NUKEUI_AWAIT_ARM)
set_safety()
yes_code = FALSE
playsound(src, 'sound/machines/nuke/confirm_beep.ogg', 50, FALSE)
update_ui_mode()
else
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
numeric_input = ""
. = TRUE
if("E")
switch(ui_mode)
if(NUKEUI_AWAIT_CODE)
if(numeric_input == r_code)
numeric_input = ""
yes_code = TRUE
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
. = TRUE
else
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
numeric_input = "ERROR"
if(NUKEUI_AWAIT_TIMER)
var/number_value = text2num(numeric_input)
if(number_value)
timer_set = clamp(number_value, minimum_timer_set, maximum_timer_set)
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
set_safety()
. = TRUE
else
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
update_ui_mode()
if("0","1","2","3","4","5","6","7","8","9")
if(numeric_input != "ERROR")
numeric_input += digit
if(length(numeric_input) > 5)
numeric_input = "ERROR"
else
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
. = TRUE
else
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
if("arm")
if(auth && yes_code && !safety && !exploded)
playsound(src, 'sound/machines/nuke/confirm_beep.ogg', 50, FALSE)
set_active()
update_ui_mode()
else
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
if("anchor")
if(auth && yes_code)
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
set_anchor()
else
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
/obj/machinery/nuclearbomb/proc/set_anchor()
if(isinspace() && !anchored)
to_chat(usr, span_warning("There is nothing to anchor to!"))
else
anchored = !anchored
/obj/machinery/nuclearbomb/proc/set_safety()
safety = !safety
if(safety)
if(timing)
SSsecurity_level.set_level(previous_level)
for(var/obj/item/pinpointer/nuke/syndicate/S in GLOB.pinpointer_list)
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
timing = FALSE
detonation_timer = null
countdown.stop()
update_appearance(UPDATE_ICON)
/obj/machinery/nuclearbomb/proc/set_active()
if(safety)
to_chat(usr, span_danger("The safety is still on."))
return
timing = !timing
if(timing)
previous_level = SSsecurity_level.get_current_level_as_text()
detonation_timer = world.time + (timer_set * 10)
for(var/obj/item/pinpointer/nuke/syndicate/S in GLOB.pinpointer_list)
S.switch_mode_to(TRACK_INFILTRATOR)
countdown.start()
SSsecurity_level.set_level(SEC_LEVEL_DELTA)
else
detonation_timer = null
SSsecurity_level.set_level(previous_level)
for(var/obj/item/pinpointer/nuke/syndicate/S in GLOB.pinpointer_list)
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
countdown.stop()
update_appearance(UPDATE_ICON)
/obj/machinery/nuclearbomb/proc/get_time_left()
if(timing)
. = round(max(0, detonation_timer - world.time) / 10, 1)
else
. = timer_set
/obj/machinery/nuclearbomb/blob_act(obj/structure/blob/B)
if(exploding)
return
qdel(src)
/obj/machinery/nuclearbomb/tesla_act(source, power, zap_range, tesla_flags, list/shocked_targets)
. = ..()
if(tesla_flags & TESLA_MACHINE_EXPLOSIVE)
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
#define NUKERANGE 127
/obj/machinery/nuclearbomb/proc/explode()
if(safety)
timing = FALSE
return
exploding = TRUE
yes_code = FALSE
safety = TRUE
update_appearance(UPDATE_ICON)
sound_to_playing_players('sound/machines/alarm.ogg')
if(SSticker)
SSticker.roundend_check_paused = TRUE
addtimer(CALLBACK(src, PROC_REF(actually_explode)), 100)
/obj/machinery/nuclearbomb/proc/actually_explode()
if(!core)
Cinematic(CINEMATIC_NUKE_NO_CORE,world)
SSticker.roundend_check_paused = FALSE
return
GLOB.enter_allowed = FALSE
var/off_station = 0
var/turf/bomb_location = get_turf(src)
var/area/A = get_area(bomb_location)
if(istype(A, /area/centcom/fabric_of_reality))
var/area/centcom/fabric_of_reality/fabric = A
new /obj/singularity(fabric.origin, 2000) // Stage five singulo back on the station, as a gift
else if(bomb_location && is_station_level(bomb_location.z))
if(istype(A, /area/space) || istype(A, /area/shuttle/syndicate))
off_station = NUKE_NEAR_MISS
if((bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)))
off_station = NUKE_NEAR_MISS
else if(bomb_location.onSyndieBase())
off_station = NUKE_SYNDICATE_BASE
else
off_station = NUKE_MISS_STATION
if(off_station < 2)
SSshuttle.registerHostileEnvironment(src)
SSshuttle.lockdown = TRUE
var/is_self_destruct = istype(src, /obj/machinery/nuclearbomb/selfdestruct)
//Cinematic
SSgamemode.OnNukeExplosion(off_station, is_self_destruct)
really_actually_explode(off_station)
SSticker.roundend_check_paused = FALSE
/obj/machinery/nuclearbomb/proc/really_actually_explode(off_station)
Cinematic(get_cinematic_type(off_station),world,CALLBACK(SSticker,/datum/controller/subsystem/ticker/proc/station_explosion_detonation,src))
var/area/A = get_area(src)
if(istype(A, /area/centcom/fabric_of_reality))
var/area/centcom/fabric_of_reality/fabric = A
var/turf/T = fabric.origin
INVOKE_ASYNC(GLOBAL_PROC, PROC_REF(KillEveryoneOnZLevel), T.z)
else
INVOKE_ASYNC(GLOBAL_PROC, PROC_REF(KillEveryoneOnZLevel), z)
/obj/machinery/nuclearbomb/proc/get_cinematic_type(off_station)
if(off_station < 2)
return CINEMATIC_SELFDESTRUCT
else
return CINEMATIC_SELFDESTRUCT_MISS
/obj/machinery/nuclearbomb/beer
name = "Nanotrasen-brand nuclear fission explosive"
desc = "One of the more successful achievements of the Nanotrasen Corporate Warfare Division, their nuclear fission explosives are renowned for being cheap to produce and devastatingly effective. Signs explain that though this particular device has been decommissioned, every Nanotrasen station is equipped with an equivalent one, just in case. All Captains carefully guard the disk needed to detonate them - at least, the sign says they do. There seems to be a tap on the back."
proper_bomb = FALSE
var/obj/structure/reagent_dispensers/beerkeg/keg
/obj/machinery/nuclearbomb/beer/Initialize(mapload)
. = ..()
keg = new(src)
QDEL_NULL(core)
/obj/machinery/nuclearbomb/beer/examine(mob/user)
. = ..()
if(keg.reagents.total_volume)
to_chat(user, span_notice("It has [keg.reagents.total_volume] unit\s left."))
else
to_chat(user, span_danger("It's empty."))
/obj/machinery/nuclearbomb/beer/attackby(obj/item/W, mob/user, params)
if(W.is_refillable())
W.afterattack(keg, user, TRUE) // redirect refillable containers to the keg, allowing them to be filled
return TRUE // pretend we handled the attack, too.
if(istype(W, /obj/item/nuke_core_container))
to_chat(user, span_notice("[src] has had its plutonium core removed as a part of being decommissioned."))
return TRUE
return ..()
/obj/machinery/nuclearbomb/beer/actually_explode()
//Unblock roundend, we're not actually exploding.
SSticker.roundend_check_paused = FALSE
var/turf/bomb_location = get_turf(src)
if(!bomb_location)
disarm()
return
if(is_station_level(bomb_location.z))
var/datum/round_event_control/E = locate(/datum/round_event_control/scrubber_overflow/beer) in SSgamemode.control
if(E)
E.runEvent()
addtimer(CALLBACK(src, PROC_REF(really_actually_explode)), 110)
else
visible_message(span_notice("[src] fizzes ominously."))
addtimer(CALLBACK(src, PROC_REF(fizzbuzz)), 110)
/obj/machinery/nuclearbomb/beer/proc/disarm()
detonation_timer = null
exploding = FALSE
exploded = TRUE
SSsecurity_level.set_level(previous_level)
for(var/obj/item/pinpointer/nuke/syndicate/S in GLOB.pinpointer_list)
S.switch_mode_to(initial(S.mode))
S.alert = FALSE
countdown.stop()
update_appearance(UPDATE_ICON)
/obj/machinery/nuclearbomb/beer/proc/fizzbuzz()
var/datum/reagents/R = new/datum/reagents(1000)
R.my_atom = src
R.add_reagent(/datum/reagent/consumable/ethanol/beer, 100)
var/datum/effect_system/fluid_spread/foam/foam = new
foam.set_up(200, location = get_turf(src), carry = R)
foam.start()
disarm()
/obj/machinery/nuclearbomb/beer/really_actually_explode()
disarm()
/**
* Kills any mob on the z-level, assuming they're not in a freezer
*
* Arguments:
* * z - the z-level to kill people on
*/
/proc/KillEveryoneOnZLevel(z)
if(!z)
return
for(var/mob/living/M in GLOB.mob_list)
var/turf/t = get_turf(M)
if(M.stat != DEAD && t.z == z && !istype(M.loc, /obj/structure/closet/secure_closet/freezer))
M.gib()
/*
This is here to make the tiles around the station mininuke change when it's armed.
*/
/obj/machinery/nuclearbomb/selfdestruct/set_anchor()
return
/obj/machinery/nuclearbomb/selfdestruct/set_active()
..()
if(timing)
SSmapping.add_nuke_threat(src)
else
SSmapping.remove_nuke_threat(src)
/obj/machinery/nuclearbomb/selfdestruct/set_safety()
..()
if(timing)
SSmapping.add_nuke_threat(src)
else
SSmapping.remove_nuke_threat(src)
//==========DAT FUKKEN DISK===============
/obj/item/disk
icon = 'icons/obj/module.dmi'
w_class = WEIGHT_CLASS_TINY
item_state = "card-id"
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
icon_state = "datadisk0"
drop_sound = 'sound/items/handling/disk_drop.ogg'
pickup_sound = 'sound/items/handling/disk_pickup.ogg'
/obj/item/disk/nuclear
name = "nuclear authentication disk"
desc = "Better keep this safe."
icon_state = "nucleardisk"
persistence_replacement = /obj/item/disk/nuclear/fake
max_integrity = 250
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 30, BIO = 0, RAD = 0, FIRE = 100, ACID = 100)
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/fake = FALSE
var/turf/lastlocation
var/last_disk_move
/obj/item/disk/nuclear/Initialize(mapload)
. = ..()
if(!fake)
GLOB.poi_list |= src
last_disk_move = world.time
START_PROCESSING(SSobj, src)
AddComponent(/datum/component/stationloving, !fake)
/obj/item/disk/nuclear/process()
if(fake)
STOP_PROCESSING(SSobj, src)
CRASH("A fake nuke disk tried to call process(). Who the fuck and how the fuck")
var/turf/newturf = get_turf(src)
if(newturf && lastlocation == newturf)
if(last_disk_move < world.time - 5000 && prob((world.time - 5000 - last_disk_move)*0.0001))
var/datum/round_event_control/operative/loneop = locate(/datum/round_event_control/operative) in SSgamemode.control
if(istype(loneop) && (loneop.occurrences < loneop.max_occurrences) && SSticker.totalPlayers >= 25)
loneop.weight += 1
if(loneop.weight % 5 == 0 && SSticker.totalPlayers > 1)
message_admins("[src] is stationary in [ADMIN_VERBOSEJMP(newturf)]. The weight of Lone Operative is now [loneop.weight].")
log_game("[src] is stationary for too long in [loc_name(newturf)], and has increased the weight of the Lone Operative event to [loneop.weight].")
else
lastlocation = newturf
last_disk_move = world.time
var/datum/round_event_control/operative/loneop = locate(/datum/round_event_control/operative) in SSgamemode.control
if(istype(loneop) && loneop.occurrences < loneop.max_occurrences && prob(loneop.weight))
loneop.weight = max(loneop.weight - 1, 0)
if(loneop.weight % 5 == 0 && SSticker.totalPlayers > 1)
message_admins("[src] is on the move (currently in [ADMIN_VERBOSEJMP(newturf)]). The weight of Lone Operative is now [loneop.weight].")
log_game("[src] being on the move has reduced the weight of the Lone Operative event to [loneop.weight].")
/obj/item/disk/nuclear/examine(mob/user)
. = ..()
if(!fake)
return
if(isobserver(user) || HAS_TRAIT(user.mind, TRAIT_DISK_VERIFIER))
. += span_warning("The serial numbers on [src] are incorrect.")
/obj/item/disk/nuclear/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/claymore/highlander) && !fake)
var/obj/item/claymore/highlander/H = I
if(H.nuke_disk)
to_chat(user, span_notice("Wait... what?"))
qdel(H.nuke_disk)
H.nuke_disk = null
return
user.visible_message(span_warning("[user] captures [src]!"), span_userdanger("You've got the disk! Defend it with your life!"))
forceMove(H)
H.nuke_disk = src
return TRUE
return ..()
/obj/item/disk/nuclear/Destroy(force=FALSE)
// respawning is handled in /obj/Destroy()
if(force)
GLOB.poi_list -= src
. = ..()
/obj/item/disk/nuclear/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is going delta! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(src, 'sound/machines/alarm.ogg', 50, -1, 1)
for(var/i in 1 to 100)
addtimer(CALLBACK(user, /atom/proc/add_atom_colour, (i % 2)? "#00FF00" : "#FF0000", ADMIN_COLOUR_PRIORITY), i)
addtimer(CALLBACK(src, PROC_REF(manual_suicide), user), 101)
return MANUAL_SUICIDE
/obj/item/disk/nuclear/proc/manual_suicide(mob/living/user)
user.remove_atom_colour(ADMIN_COLOUR_PRIORITY)
user.visible_message(span_suicide("[user] was destroyed by the nuclear blast!"))
user.adjustOxyLoss(200)
user.death(0)
SSachievements.unlock_achievement(/datum/achievement/honorarynukie, user.client)
/obj/item/disk/nuclear/fake
fake = TRUE
/obj/item/disk/nuclear/fake/obvious
name = "cheap plastic imitation of the nuclear authentication disk"
desc = "How anyone could mistake this for the real thing is beyond you."