-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
mecha_construction_paths.dm
1475 lines (1388 loc) · 63.4 KB
/
mecha_construction_paths.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
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
////////////////////////////////
///// Construction datums //////
////////////////////////////////
/datum/component/construction/mecha
var/base_icon
// Component typepaths.
// most must be defined unless
// get_steps is overriden.
// Circuit board typepaths.
// circuit_control and circuit_periph must be defined
// unless get_circuit_steps is overriden.
var/circuit_control
var/circuit_periph
var/circuit_weapon
// Armor plating typepaths. both must be defined
// unless relevant step procs are overriden. amounts
// must be defined if using /obj/item/stack/sheet types
var/inner_plating
var/inner_plating_amount
var/outer_plating
var/outer_plating_amount
/datum/component/construction/mecha/spawn_result()
if(!result)
return
// Remove default mech power cell, as we replace it with a new one.
var/obj/mecha/M = new result(drop_location())
QDEL_NULL(M.cell)
QDEL_NULL(M.scanmod)
QDEL_NULL(M.capacitor)
var/obj/item/mecha_parts/chassis/parent_chassis = parent
M.CheckParts(parent_chassis.contents)
SSblackbox.record_feedback("tally", "mechas_created", 1, M.name)
QDEL_NULL(parent)
// Default proc to generate mech steps.
// Override if the mech needs an entirely custom process (See HONK mech)
// Otherwise override specific steps as needed (Ripley, firefighter, Phazon)
/datum/component/construction/mecha/proc/get_steps()
return get_frame_steps() + get_circuit_steps() + (circuit_weapon ? get_circuit_weapon_steps() : list()) + get_stockpart_steps() + get_inner_plating_steps() + get_outer_plating_steps()
/datum/component/construction/mecha/update_parent(step_index)
steps = get_steps()
..()
// By default, each step in mech construction has a single icon_state:
// "[base_icon][index - 1]"
// For example, Ripley's step 1 icon_state is "ripley0".
var/atom/parent_atom = parent
if(!steps[index]["icon_state"] && base_icon)
parent_atom.icon_state = "[base_icon][index - 1]"
/datum/component/construction/unordered/mecha_chassis/custom_action(obj/item/I, mob/living/user, typepath)
. = user.transferItemToLoc(I, parent)
if(.)
var/atom/parent_atom = parent
user.visible_message("[user] has connected [I] to [parent].", span_notice("You connect [I] to [parent]."))
parent_atom.add_overlay(I.icon_state+"+o")
qdel(I)
/datum/component/construction/unordered/mecha_chassis/spawn_result()
var/atom/parent_atom = parent
parent_atom.icon = 'icons/mecha/mech_construction.dmi'
parent_atom.density = TRUE
parent_atom.cut_overlays()
..()
// Default proc for the first steps of mech construction.
/datum/component/construction/mecha/proc/get_frame_steps()
return list(
list(
"key" = TOOL_WRENCH,
"desc" = "The hydraulic systems are disconnected."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_WRENCH,
"desc" = "The hydraulic systems are connected."
),
list(
"key" = /obj/item/stack/cable_coil,
"amount" = 5,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The hydraulic systems are active."
),
list(
"key" = TOOL_WIRECUTTER,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The wiring is added."
)
)
// Default proc for the circuit board steps of a mech.
// Second set of steps by default.
/datum/component/construction/mecha/proc/get_circuit_steps()
return list(
list(
"key" = circuit_control,
"action" = ITEM_DELETE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The wiring is adjusted."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
"desc" = "Central control module is installed."
),
list(
"key" = circuit_periph,
"action" = ITEM_DELETE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Central control module is secured."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
"desc" = "Peripherals control module is installed."
)
)
// Default proc for weapon circuitboard steps
// Used by combat mechs
/datum/component/construction/mecha/proc/get_circuit_weapon_steps()
return list(
list(
"key" = circuit_weapon,
"action" = ITEM_DELETE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Peripherals control module is secured."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
"desc" = "Weapons control module is installed."
)
)
// Default proc for stock part installation
// Third set of steps by default
/datum/component/construction/mecha/proc/get_stockpart_steps()
return list(
list(
"key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Scanner module is installed."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
"desc" = "Scanner module is secured."
),
list(
"key" = /obj/item/stock_parts/capacitor,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Capacitor is installed."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
"desc" = "Capacitor is secured."
),
list(
"key" = /obj/item/stock_parts/cell,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The power cell is installed."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
"desc" = "The power cell is secured."
)
)
// Default proc for inner armor plating
// Fourth set of steps by default
/datum/component/construction/mecha/proc/get_inner_plating_steps()
var/list/first_step
if(ispath(inner_plating, /obj/item/stack/sheet))
first_step = list(
list(
"key" = inner_plating,
"amount" = inner_plating_amount,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The power cell is secured."
)
)
else
first_step = list(
list(
"key" = inner_plating,
"action" = ITEM_DELETE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The power cell is secured."
)
)
return first_step + list(
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "Inner plating is installed."
),
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
"desc" = "Inner Plating is wrenched."
)
)
// Default proc for outer armor plating
// Fifth set of steps by default
/datum/component/construction/mecha/proc/get_outer_plating_steps()
var/list/first_step
if(ispath(outer_plating, /obj/item/stack/sheet))
first_step = list(
list(
"key" = outer_plating,
"amount" = outer_plating_amount,
"back_key" = TOOL_WELDER,
"desc" = "Inner plating is welded."
)
)
else
first_step = list(
list(
"key" = outer_plating,
"action" = ITEM_DELETE,
"back_key" = TOOL_WELDER,
"desc" = "Inner plating is welded."
)
)
return first_step + list(
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "External armor is installed."
),
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
"desc" = "External armor is wrenched."
)
)
/datum/component/construction/unordered/mecha_chassis/ripley
result = /datum/component/construction/mecha/ripley
steps = list(
/obj/item/mecha_parts/part/ripley_torso,
/obj/item/mecha_parts/part/ripley_left_arm,
/obj/item/mecha_parts/part/ripley_right_arm,
/obj/item/mecha_parts/part/ripley_left_leg,
/obj/item/mecha_parts/part/ripley_right_leg
)
/datum/component/construction/mecha/ripley
result = /obj/mecha/working/ripley
base_icon = "ripley"
circuit_control = /obj/item/circuitboard/mecha/ripley/main
circuit_periph = /obj/item/circuitboard/mecha/ripley/peripherals
inner_plating=/obj/item/stack/sheet/metal
inner_plating_amount = 5
outer_plating=/obj/item/stack/rods
outer_plating_amount = 10
/datum/component/construction/mecha/ripley/get_outer_plating_steps()
return list(
list(
"key" = /obj/item/stack/rods,
"amount" = 10,
"back_key" = TOOL_WELDER,
"desc" = "Outer Plating is welded."
),
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WIRECUTTER,
"desc" = "Cockpit wire screen is installed."
),
)
/datum/component/construction/mecha/ripley/custom_action(obj/item/I, mob/living/user, diff)
if(!..())
return FALSE
switch(index)
if(1)
user.visible_message("[user] connects [parent] hydraulic systems", span_notice("You connect [parent] hydraulic systems."))
if(2)
if(diff==FORWARD)
user.visible_message("[user] activates [parent] hydraulic systems.", span_notice("You activate [parent] hydraulic systems."))
else
user.visible_message("[user] disconnects [parent] hydraulic systems", span_notice("You disconnect [parent] hydraulic systems."))
if(3)
if(diff==FORWARD)
user.visible_message("[user] adds the wiring to [parent].", span_notice("You add the wiring to [parent]."))
else
user.visible_message("[user] deactivates [parent] hydraulic systems.", span_notice("You deactivate [parent] hydraulic systems."))
if(4)
if(diff==FORWARD)
user.visible_message("[user] adjusts the wiring of [parent].", span_notice("You adjust the wiring of [parent]."))
else
user.visible_message("[user] removes the wiring from [parent].", span_notice("You remove the wiring from [parent]."))
if(5)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] disconnects the wiring of [parent].", span_notice("You disconnect the wiring of [parent]."))
if(6)
if(diff==FORWARD)
user.visible_message("[user] secures the mainboard.", span_notice("You secure the mainboard."))
else
user.visible_message("[user] removes the central control module from [parent].", span_notice("You remove the central computer mainboard from [parent]."))
if(7)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the mainboard.", span_notice("You unfasten the mainboard."))
if(8)
if(diff==FORWARD)
user.visible_message("[user] secures the peripherals control module.", span_notice("You secure the peripherals control module."))
else
user.visible_message("[user] removes the peripherals control module from [parent].", span_notice("You remove the peripherals control module from [parent]."))
if(9)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the peripherals control module.", span_notice("You unfasten the peripherals control module."))
if(10)
if(diff==FORWARD)
user.visible_message("[user] secures the scanner module.", span_notice("You secure the scanner module."))
else
user.visible_message("[user] removes the scanner module from [parent].", span_notice("You remove the scanner module from [parent]."))
if(11)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] unfastens the scanner module.", span_notice("You unfasten the scanner module."))
if(12)
if(diff==FORWARD)
user.visible_message("[user] secures the capacitor.", span_notice("You secure the capacitor."))
else
user.visible_message("[user] removes the capacitor from [parent].", span_notice("You remove the capacitor from [parent]."))
if(13)
if(diff==FORWARD)
user.visible_message("[user] installs [I].", span_notice("You install [I]."))
else
user.visible_message("[user] unsecures the capacitor from [parent].", span_notice("You unsecure the capacitor from [parent]."))
if(14)
if(diff==FORWARD)
user.visible_message("[user] secures the power cell.", span_notice("You secure the power cell."))
else
user.visible_message("[user] pries the power cell from [parent].", span_notice("You pry the power cell from [parent]."))
if(15)
if(diff==FORWARD)
user.visible_message("[user] installs the internal armor layer to [parent].", span_notice("You install the internal armor layer to [parent]."))
else
user.visible_message("[user] unfastens the power cell.", span_notice("You unfasten the power cell."))
if(16)
if(diff==FORWARD)
user.visible_message("[user] secures the internal armor layer.", span_notice("You secure the internal armor layer."))
else
user.visible_message("[user] pries internal armor layer from [parent].", span_notice("You pry internal armor layer from [parent]."))
if(17)
if(diff==FORWARD)
user.visible_message("[user] welds the internal armor layer to [parent].", span_notice("You weld the internal armor layer to [parent]."))
else
user.visible_message("[user] unfastens the internal armor layer.", span_notice("You unfasten the internal armor layer."))
if(18)
if(diff==FORWARD)
user.visible_message("[user] installs the external reinforced armor layer to [parent].", span_notice("You install the external reinforced armor layer to [parent]."))
else
user.visible_message("[user] cuts the internal armor layer from [parent].", span_notice("You cut the internal armor layer from [parent]."))
if(19)
if(diff==FORWARD)
user.visible_message("[user] secures the external armor layer.", span_notice("You secure the external reinforced armor layer."))
else
user.visible_message("[user] pries external armor layer from [parent].", span_notice("You pry external armor layer from [parent]."))
if(20)
if(diff==FORWARD)
user.visible_message("[user] welds the external armor layer to [parent].", span_notice("You weld the external armor layer to [parent]."))
else
user.visible_message("[user] unfastens the external armor layer.", span_notice("You unfasten the external armor layer."))
return TRUE
/datum/component/construction/unordered/mecha_chassis/gygax
result = /datum/component/construction/mecha/gygax
steps = list(
/obj/item/mecha_parts/part/gygax_torso,
/obj/item/mecha_parts/part/gygax_left_arm,
/obj/item/mecha_parts/part/gygax_right_arm,
/obj/item/mecha_parts/part/gygax_left_leg,
/obj/item/mecha_parts/part/gygax_right_leg,
/obj/item/mecha_parts/part/gygax_head
)
/datum/component/construction/mecha/gygax
result = /obj/mecha/combat/gygax
base_icon = "gygax"
circuit_control = /obj/item/circuitboard/mecha/gygax/main
circuit_periph = /obj/item/circuitboard/mecha/gygax/peripherals
circuit_weapon = /obj/item/circuitboard/mecha/gygax/targeting
inner_plating = /obj/item/stack/sheet/metal
inner_plating_amount = 5
outer_plating=/obj/item/mecha_parts/part/gygax_armor
outer_plating_amount=1
/datum/component/construction/mecha/gygax/action(datum/source, atom/used_atom, mob/user)
return check_step(used_atom,user)
/datum/component/construction/mecha/gygax/custom_action(obj/item/I, mob/living/user, diff)
if(!..())
return FALSE
switch(index)
if(1)
user.visible_message("[user] connects [parent] hydraulic systems", span_notice("You connect [parent] hydraulic systems."))
if(2)
if(diff==FORWARD)
user.visible_message("[user] activates [parent] hydraulic systems.", span_notice("You activate [parent] hydraulic systems."))
else
user.visible_message("[user] disconnects [parent] hydraulic systems", span_notice("You disconnect [parent] hydraulic systems."))
if(3)
if(diff==FORWARD)
user.visible_message("[user] adds the wiring to [parent].", span_notice("You add the wiring to [parent]."))
else
user.visible_message("[user] deactivates [parent] hydraulic systems.", span_notice("You deactivate [parent] hydraulic systems."))
if(4)
if(diff==FORWARD)
user.visible_message("[user] adjusts the wiring of [parent].", span_notice("You adjust the wiring of [parent]."))
else
user.visible_message("[user] removes the wiring from [parent].", span_notice("You remove the wiring from [parent]."))
if(5)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] disconnects the wiring of [parent].", span_notice("You disconnect the wiring of [parent]."))
if(6)
if(diff==FORWARD)
user.visible_message("[user] secures the mainboard.", span_notice("You secure the mainboard."))
else
user.visible_message("[user] removes the central control module from [parent].", span_notice("You remove the central computer mainboard from [parent]."))
if(7)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the mainboard.", span_notice("You unfasten the mainboard."))
if(8)
if(diff==FORWARD)
user.visible_message("[user] secures the peripherals control module.", span_notice("You secure the peripherals control module."))
else
user.visible_message("[user] removes the peripherals control module from [parent].", span_notice("You remove the peripherals control module from [parent]."))
if(9)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the peripherals control module.", span_notice("You unfasten the peripherals control module."))
if(10)
if(diff==FORWARD)
user.visible_message("[user] secures the weapon control module.", span_notice("You secure the weapon control module."))
else
user.visible_message("[user] removes the weapon control module from [parent].", span_notice("You remove the weapon control module from [parent]."))
if(11)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] unfastens the weapon control module.", span_notice("You unfasten the weapon control module."))
if(12)
if(diff==FORWARD)
user.visible_message("[user] secures the scanner module.", span_notice("You secure the scanner module."))
else
user.visible_message("[user] removes the scanner module from [parent].", span_notice("You remove the scanner module from [parent]."))
if(13)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] unfastens the scanner module.", span_notice("You unfasten the scanner module."))
if(14)
if(diff==FORWARD)
user.visible_message("[user] secures the capacitor.", span_notice("You secure the capacitor."))
else
user.visible_message("[user] removes the capacitor from [parent].", span_notice("You remove the capacitor from [parent]."))
if(15)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the capacitor.", span_notice("You unfasten the capacitor."))
if(16)
if(diff==FORWARD)
user.visible_message("[user] secures the power cell.", span_notice("You secure the power cell."))
else
user.visible_message("[user] pries the power cell from [parent].", span_notice("You pry the power cell from [parent]."))
if(17)
if(diff==FORWARD)
user.visible_message("[user] installs the internal armor layer to [parent].", span_notice("You install the internal armor layer to [parent]."))
else
user.visible_message("[user] unfastens the power cell.", span_notice("You unfasten the power cell."))
if(18)
if(diff==FORWARD)
user.visible_message("[user] secures the internal armor layer.", span_notice("You secure the internal armor layer."))
else
user.visible_message("[user] pries internal armor layer from [parent].", span_notice("You pry internal armor layer from [parent]."))
if(19)
if(diff==FORWARD)
user.visible_message("[user] welds the internal armor layer to [parent].", span_notice("You weld the internal armor layer to [parent]."))
else
user.visible_message("[user] unfastens the internal armor layer.", span_notice("You unfasten the internal armor layer."))
if(20)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] cuts the internal armor layer from [parent].", span_notice("You cut the internal armor layer from [parent]."))
if(21)
if(diff==FORWARD)
user.visible_message("[user] secures the Gygax Armor Plates.", span_notice("You secure the Gygax Armor Plates."))
else
user.visible_message("[user] pries the Gygax Armor Plates from [parent].", span_notice("You pry the Gygax Armor Plates from [parent]."))
if(22)
if(diff==FORWARD)
user.visible_message("[user] welds the Gygax Armor Plates to [parent].", span_notice("You weld the Gygax Armor Plates to [parent]."))
else
user.visible_message("[user] unfastens the Gygax Armor Plates.", span_notice("You unfasten the Gygax Armor Plates."))
return TRUE
/datum/component/construction/unordered/mecha_chassis/clarke
result = /datum/component/construction/mecha/clarke
steps = list(
/obj/item/mecha_parts/part/clarke_torso,
/obj/item/mecha_parts/part/clarke_left_arm,
/obj/item/mecha_parts/part/clarke_right_arm,
/obj/item/mecha_parts/part/clarke_head
)
/datum/component/construction/mecha/clarke
result = /obj/mecha/working/clarke
base_icon = "clarke"
circuit_control = /obj/item/circuitboard/mecha/clarke/main
circuit_periph = /obj/item/circuitboard/mecha/clarke/peripherals
inner_plating = /obj/item/stack/sheet/plasteel
inner_plating_amount = 5
outer_plating = /obj/item/stack/sheet/mineral/gold
outer_plating_amount = 5
/datum/component/construction/mecha/clarke/get_frame_steps()
return list(
list(
"key" = /obj/item/stack/conveyor,
"amount" = 4,
"desc" = "The treads are added."
),
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "The hydraulic systems are disconnected."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_WRENCH,
"desc" = "The hydraulic systems are connected."
),
list(
"key" = /obj/item/stack/cable_coil,
"amount" = 5,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The hydraulic systems are active."
),
list(
"key" = TOOL_WIRECUTTER,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The wiring is added."
)
)
/datum/component/construction/mecha/clarke/custom_action(obj/item/I, mob/living/user, diff)
if(!..())
return FALSE
//TODO: better messages.
switch(index)
if(1)
user.visible_message("<span class='notice'>[user] adds the tread systems.</span>", "<span class='notice'>You add the tread systems.</span>")
if(2)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] connects [parent] hydraulic systems.</span>", "<span class='notice'>You connect [parent] hydraulic systems.</span>")
else
user.visible_message("<span class='notice'>[user] removes the tread systems.</span>", "<span class='notice'>You remove the tread systems.</span>")
if(3)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] activates [parent] hydraulic systems.</span>", "<span class='notice'>You activate [parent] hydraulic systems.</span>")
else
user.visible_message("<span class='notice'>[user] disconnects [parent] hydraulic systems.</span>", "<span class='notice'>You disconnect [parent] hydraulic systems.</span>")
if(4)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] adds the wiring to [parent].</span>", "<span class='notice'>You add the wiring to [parent].</span>")
else
user.visible_message("<span class='notice'>[user] deactivates [parent] hydraulic systems.</span>", "<span class='notice'>You deactivate [parent] hydraulic systems.</span>")
if(5)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] adjusts the wiring of [parent].</span>", "<span class='notice'>You adjust the wiring of [parent].</span>")
else
user.visible_message("<span class='notice'>[user] removes the wiring from [parent].</span>", "<span class='notice'>You remove the wiring from [parent].</span>")
if(6)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs [I] into [parent].</span>", "<span class='notice'>You install [I] into [parent].</span>")
else
user.visible_message("<span class='notice'>[user] disconnects the wiring of [parent].</span>", "<span class='notice'>You disconnect the wiring of [parent].</span>")
if(7)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the mainboard.</span>", "<span class='notice'>You secure the mainboard.</span>")
else
user.visible_message("<span class='notice'>[user] removes the central control module from [parent].</span>", "<span class='notice'>You remove the central computer mainboard from [parent].</span>")
if(8)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs [I] into [parent].</span>", "<span class='notice'>You install [I] into [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the mainboard.</span>", "<span class='notice'>You unfasten the mainboard.</span>")
if(9)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the peripherals control module.</span>", "<span class='notice'>You secure the peripherals control module.</span>")
else
user.visible_message("<span class='notice'>[user] removes the peripherals control module from [parent].</span>", "<span class='notice'>You remove the peripherals control module from [parent].</span>")
if(10)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs [I] into [parent].</span>", "<span class='notice'>You install [I] into [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the peripherals control module.</span>", "<span class='notice'>You unfasten the peripherals control module.</span>")
if(11)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the scanner module.</span>", "<span class='notice'>You secure the scanner module.</span>")
else
user.visible_message("<span class='notice'>[user] removes the scanner module from [parent].</span>", "<span class='notice'>You remove the scanner module from [parent].</span>")
if(12)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs [I] to [parent].</span>", "<span class='notice'>You install [I] to [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the scanner module.</span>", "<span class='notice'>You unfasten the scanner module.</span>")
if(13)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the capacitor.</span>", "<span class='notice'>You secure the capacitor.</span>")
else
user.visible_message("<span class='notice'>[user] removes the capacitor from [parent].</span>", "<span class='notice'>You remove the capacitor from [parent].</span>")
if(14)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs [I] into [parent].</span>", "<span class='notice'>You install [I] into [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the capacitor.</span>", "<span class='notice'>You unfasten the capacitor.</span>")
if(15)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the power cell.</span>", "<span class='notice'>You secure the power cell.</span>")
else
user.visible_message("<span class='notice'>[user] pries the power cell from [parent].</span>", "<span class='notice'>You pry the power cell from [parent].</span>")
if(16)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs the internal armor layer to [parent].</span>", "<span class='notice'>You install the internal armor layer to [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the power cell.</span>", "<span class='notice'>You unfasten the power cell.</span>")
if(17)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the internal armor layer.</span>", "<span class='notice'>You secure the internal armor layer.</span>")
else
user.visible_message("<span class='notice'>[user] pries internal armor layer from [parent].</span>", "<span class='notice'>You pry internal armor layer from [parent].</span>")
if(18)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] welds the internal armor layer to [parent].</span>", "<span class='notice'>You weld the internal armor layer to [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the internal armor layer.</span>", "<span class='notice'>You unfasten the internal armor layer.</span>")
if(19)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] installs the external armor layer to [parent].</span>", "<span class='notice'>You install the external reinforced armor layer to [parent].</span>")
else
user.visible_message("<span class='notice'>[user] cuts the internal armor layer from [parent].</span>", "<span class='notice'>You cut the internal armor layer from [parent].</span>")
if(20)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] secures the external armor layer.</span>", "<span class='notice'>You secure the external reinforced armor layer.</span>")
else
user.visible_message("<span class='notice'>[user] pries the external armor layer from [parent].</span>", "<span class='notice'>You pry the external armor layer from [parent].</span>")
if(21)
if(diff==FORWARD)
user.visible_message("<span class='notice'>[user] welds the external armor layer to [parent].</span>", "<span class='notice'>You weld the external armor layer to [parent].</span>")
else
user.visible_message("<span class='notice'>[user] unfastens the external armor layer.</span>", "<span class='notice'>You unfasten the external armor layer.</span>")
return TRUE
/datum/component/construction/unordered/mecha_chassis/honker
result = /datum/component/construction/mecha/honker
steps = list(
/obj/item/mecha_parts/part/honker_torso,
/obj/item/mecha_parts/part/honker_left_arm,
/obj/item/mecha_parts/part/honker_right_arm,
/obj/item/mecha_parts/part/honker_left_leg,
/obj/item/mecha_parts/part/honker_right_leg,
/obj/item/mecha_parts/part/honker_head
)
/datum/component/construction/mecha/honker
result = /obj/mecha/combat/honker
steps = list(
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/circuitboard/mecha/honker/main,
"action" = ITEM_DELETE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/circuitboard/mecha/honker/peripherals,
"action" = ITEM_DELETE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/circuitboard/mecha/honker/targeting,
"action" = ITEM_DELETE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/stock_parts/capacitor,
"action" = ITEM_MOVE_INSIDE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/stock_parts/cell,
"action" = ITEM_MOVE_INSIDE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/clothing/mask/gas/clown_hat,
"action" = ITEM_DELETE
),
list(
"key" = /obj/item/bikehorn
),
list(
"key" = /obj/item/clothing/shoes/clown_shoes,
"action" = ITEM_DELETE
),
list(
"key" = /obj/item/bikehorn
),
)
/datum/component/construction/mecha/honker/get_steps()
return steps
// HONK doesn't have any construction step icons, so we just set an icon once.
/datum/component/construction/mecha/honker/update_parent(step_index)
if(step_index == 1)
var/atom/parent_atom = parent
parent_atom.icon = 'icons/mecha/mech_construct.dmi'
parent_atom.icon_state = "honker_chassis"
..()
/datum/component/construction/mecha/honker/custom_action(obj/item/I, mob/living/user, diff)
if(!..())
return FALSE
if(istype(I, /obj/item/bikehorn))
playsound(parent, 'sound/items/bikehorn.ogg', 50, 1)
user.visible_message("HONK!")
//TODO: better messages.
switch(index)
if(2)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
if(4)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
if(6)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
if(8)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
if(10)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
if(12)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
if(14)
user.visible_message("[user] puts [I] on [parent].", span_notice("You put [I] on [parent]."))
if(16)
user.visible_message("[user] puts [I] on [parent].", span_notice("You put [I] on [parent]."))
return TRUE
/datum/component/construction/unordered/mecha_chassis/durand
result = /datum/component/construction/mecha/durand
steps = list(
/obj/item/mecha_parts/part/durand_torso,
/obj/item/mecha_parts/part/durand_left_arm,
/obj/item/mecha_parts/part/durand_right_arm,
/obj/item/mecha_parts/part/durand_left_leg,
/obj/item/mecha_parts/part/durand_right_leg,
/obj/item/mecha_parts/part/durand_head
)
/datum/component/construction/mecha/durand
result = /obj/mecha/combat/durand
base_icon = "durand"
circuit_control = /obj/item/circuitboard/mecha/durand/main
circuit_periph = /obj/item/circuitboard/mecha/durand/peripherals
circuit_weapon = /obj/item/circuitboard/mecha/durand/targeting
inner_plating = /obj/item/stack/sheet/metal
inner_plating_amount = 5
outer_plating = /obj/item/mecha_parts/part/durand_armor
outer_plating_amount = 1
/datum/component/construction/mecha/durand/custom_action(obj/item/I, mob/living/user, diff)
if(!..())
return FALSE
//TODO: better messages.
switch(index)
if(1)
user.visible_message("[user] connects [parent] hydraulic systems", span_notice("You connect [parent] hydraulic systems."))
if(2)
if(diff==FORWARD)
user.visible_message("[user] activates [parent] hydraulic systems.", span_notice("You activate [parent] hydraulic systems."))
else
user.visible_message("[user] disconnects [parent] hydraulic systems", span_notice("You disconnect [parent] hydraulic systems."))
if(3)
if(diff==FORWARD)
user.visible_message("[user] adds the wiring to [parent].", span_notice("You add the wiring to [parent]."))
else
user.visible_message("[user] deactivates [parent] hydraulic systems.", span_notice("You deactivate [parent] hydraulic systems."))
if(4)
if(diff==FORWARD)
user.visible_message("[user] adjusts the wiring of [parent].", span_notice("You adjust the wiring of [parent]."))
else
user.visible_message("[user] removes the wiring from [parent].", span_notice("You remove the wiring from [parent]."))
if(5)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] disconnects the wiring of [parent].", span_notice("You disconnect the wiring of [parent]."))
if(6)
if(diff==FORWARD)
user.visible_message("[user] secures the mainboard.", span_notice("You secure the mainboard."))
else
user.visible_message("[user] removes the central control module from [parent].", span_notice("You remove the central computer mainboard from [parent]."))
if(7)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the mainboard.", span_notice("You unfasten the mainboard."))
if(8)
if(diff==FORWARD)
user.visible_message("[user] secures the peripherals control module.", span_notice("You secure the peripherals control module."))
else
user.visible_message("[user] removes the peripherals control module from [parent].", span_notice("You remove the peripherals control module from [parent]."))
if(9)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the peripherals control module.", span_notice("You unfasten the peripherals control module."))
if(10)
if(diff==FORWARD)
user.visible_message("[user] secures the weapon control module.", span_notice("You secure the weapon control module."))
else
user.visible_message("[user] removes the weapon control module from [parent].", span_notice("You remove the weapon control module from [parent]."))
if(11)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] unfastens the weapon control module.", span_notice("You unfasten the weapon control module."))
if(12)
if(diff==FORWARD)
user.visible_message("[user] secures the scanner module.", span_notice("You secure the scanner module."))
else
user.visible_message("[user] removes the scanner module from [parent].", span_notice("You remove the scanner module from [parent]."))
if(13)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] unfastens the scanner module.", span_notice("You unfasten the scanner module."))
if(14)
if(diff==FORWARD)
user.visible_message("[user] secures the capacitor.", span_notice("You secure the capacitor."))
else
user.visible_message("[user] removes the capacitor from [parent].", span_notice("You remove the capacitor from [parent]."))
if(15)
if(diff==FORWARD)
user.visible_message("[user] installs [I] into [parent].", span_notice("You install [I] into [parent]."))
else
user.visible_message("[user] unfastens the capacitor.", span_notice("You unfasten the capacitor."))
if(16)
if(diff==FORWARD)
user.visible_message("[user] secures the power cell.", span_notice("You secure the power cell."))
else
user.visible_message("[user] pries the power cell from [parent].", span_notice("You pry the power cell from [parent]."))
if(17)
if(diff==FORWARD)
user.visible_message("[user] installs the internal armor layer to [parent].", span_notice("You install the internal armor layer to [parent]."))
else
user.visible_message("[user] unfastens the power cell.", span_notice("You unfasten the power cell."))
if(18)
if(diff==FORWARD)
user.visible_message("[user] secures the internal armor layer.", span_notice("You secure the internal armor layer."))
else
user.visible_message("[user] pries internal armor layer from [parent].", span_notice("You pry internal armor layer from [parent]."))
if(19)
if(diff==FORWARD)
user.visible_message("[user] welds the internal armor layer to [parent].", span_notice("You weld the internal armor layer to [parent]."))
else
user.visible_message("[user] unfastens the internal armor layer.", span_notice("You unfasten the internal armor layer."))
if(20)
if(diff==FORWARD)
user.visible_message("[user] installs [I] to [parent].", span_notice("You install [I] to [parent]."))
else
user.visible_message("[user] cuts the internal armor layer from [parent].", span_notice("You cut the internal armor layer from [parent]."))
if(21)
if(diff==FORWARD)
user.visible_message("[user] secures the Durand Armor Plates.", span_notice("You secure the Durand Armor Plates."))
else
user.visible_message("[user] pries the Durand Armor Plates from [parent].", span_notice("You pry the the Durand Armor Plates from [parent]."))
if(22)
if(diff==FORWARD)
user.visible_message("[user] welds the Durand Armor Plates to [parent].", span_notice("You weld the Durand Armor Plates to [parent]."))
else
user.visible_message("[user] unfastens the Durand Armor Plates.", span_notice("You unfasten the Durand Armor Plates."))
return TRUE
//PHAZON
/datum/component/construction/unordered/mecha_chassis/phazon
result = /datum/component/construction/mecha/phazon
steps = list(
/obj/item/mecha_parts/part/phazon_torso,
/obj/item/mecha_parts/part/phazon_left_arm,
/obj/item/mecha_parts/part/phazon_right_arm,
/obj/item/mecha_parts/part/phazon_left_leg,
/obj/item/mecha_parts/part/phazon_right_leg,
/obj/item/mecha_parts/part/phazon_head
)
/datum/component/construction/mecha/phazon
result = /obj/mecha/combat/phazon
base_icon = "phazon"
circuit_control = /obj/item/circuitboard/mecha/phazon/main
circuit_periph = /obj/item/circuitboard/mecha/phazon/peripherals
circuit_weapon = /obj/item/circuitboard/mecha/phazon/targeting
inner_plating = /obj/item/stack/sheet/plasteel
inner_plating_amount = 5
outer_plating = /obj/item/mecha_parts/part/phazon_armor
outer_plating_amount = 1
/datum/component/construction/mecha/phazon/get_stockpart_steps()
return list(
list(
"key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Scanner module is installed."
),
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Scanner module is secured."
),
list(
"key" = /obj/item/stock_parts/capacitor,
"back_key" = TOOL_CROWBAR,