/
RCD.dm
585 lines (497 loc) · 21.2 KB
/
RCD.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
/// Multiplier applied on construction & deconstruction time when building multiple structures
#define FREQUENT_USE_DEBUFF_MULTIPLIER 3
//RAPID CONSTRUCTION DEVICE
/obj/item/construction/rcd
name = "rapid-construction-device (RCD)"
icon = 'icons/obj/tools.dmi'
icon_state = "rcd"
worn_icon_state = "RCD"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
custom_premium_price = PAYCHECK_COMMAND * 2
max_matter = 160
slot_flags = ITEM_SLOT_BELT
item_flags = NO_MAT_REDEMPTION | NOBLUDGEON
has_ammobar = TRUE
actions_types = list(/datum/action/item_action/rcd_scan)
/// main category of currently selected design[Structures, Airlocks, Airlock Access]
var/root_category
/// category of currently selected design
var/design_category
/// name of currently selected design
var/design_title
/// type of structure being built, used to decide what variables are used to build what structure
var/mode
/// temporary holder of mode, used to restore mode original value after rcd deconstruction act
var/construction_mode
/// The path of the structure the rcd is currently creating
var/atom/movable/rcd_design_path
/// Owner of this rcd. It can either be a construction console, player, or mech.
var/atom/owner
/// used by arcd, can this rcd work from a range
var/ranged = FALSE
/// delay multiplier for all construction types
var/delay_mod = 1
/// variable for R walls to deconstruct them
var/canRturf = FALSE
/// integrated airlock electronics for setting access to a newly built airlocks
var/obj/item/electronics/airlock/airlock_electronics
COOLDOWN_DECLARE(destructive_scan_cooldown)
///number of active rcd effects in use e.g. when building multiple walls at once this value increases
var/current_active_effects = 0
/obj/effect/rcd_hologram
name = "hologram"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/rcd_hologram/Initialize(mapload)
. = ..()
QDEL_IN(src, RCD_HOLOGRAM_FADE_TIME)
/obj/item/construction/rcd/Initialize(mapload)
. = ..()
airlock_electronics = new(src)
airlock_electronics.name = "Access Control"
airlock_electronics.holder = src
root_category = GLOB.rcd_designs[1]
design_category = GLOB.rcd_designs[root_category][1]
var/list/design = GLOB.rcd_designs[root_category][design_category][1]
rcd_design_path = design["[RCD_DESIGN_PATH]"]
design_title = initial(rcd_design_path.name)
mode = design["[RCD_DESIGN_MODE]"]
construction_mode = mode
GLOB.rcd_list += src
/obj/item/construction/rcd/Destroy()
QDEL_NULL(airlock_electronics)
GLOB.rcd_list -= src
. = ..()
/obj/item/construction/rcd/ui_action_click(mob/user, actiontype)
if (!COOLDOWN_FINISHED(src, destructive_scan_cooldown))
to_chat(user, span_warning("[src] lets out a low buzz."))
return
COOLDOWN_START(src, destructive_scan_cooldown, RCD_DESTRUCTIVE_SCAN_COOLDOWN)
rcd_scan(src)
/obj/item/construction/rcd/suicide_act(mob/living/user)
var/turf/T = get_turf(user)
if(!isopenturf(T)) // Oh fuck
user.visible_message(span_suicide("[user] is beating [user.p_them()]self to death with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
mode = RCD_TURF
user.visible_message(span_suicide("[user] sets the RCD to 'Wall' and points it down [user.p_their()] throat! It looks like [user.p_theyre()] trying to commit suicide!"))
if(checkResource(16, user)) // It takes 16 resources to construct a wall
var/success = T.rcd_act(user, src, list("[RCD_DESIGN_MODE]" = RCD_TURF, "[RCD_DESIGN_PATH]" = /turf/open/floor/plating/rcd))
T = get_turf(user)
// If the RCD placed a floor instead of a wall, having a wall without plating under it is cursed
// There isn't an easy programmatical way to check if rcd_act will place a floor or a wall, so just repeat using it for free
if(success && isopenturf(T))
T.rcd_act(user, src, list("[RCD_DESIGN_MODE]" = RCD_TURF, "[RCD_DESIGN_PATH]" = /turf/open/floor/plating/rcd))
useResource(16, user)
activate()
playsound(loc, 'sound/machines/click.ogg', 50, 1)
user.gib(DROP_ALL_REMAINS)
return MANUAL_SUICIDE
user.visible_message(span_suicide("[user] pulls the trigger... But there is not enough ammo!"))
return SHAME
/**
* checks if we can build the structure
* Arguments
*
* * [atom][target]- the target we are trying to build on/deconstruct e.g. turf, wall etc
* * rcd_results- list of params specifically the build type of our structure
* * [mob][user]- the user
*/
/obj/item/construction/rcd/proc/can_place(atom/target, list/rcd_results, mob/user)
var/rcd_mode = rcd_results["[RCD_DESIGN_MODE]"]
var/atom/movable/rcd_structure = rcd_results["[RCD_DESIGN_PATH]"]
/**
*For anything that does not go an a wall we have to make sure that turf is clear for us to put the structure on it
*If we are just trying to destory something then this check is not nessassary
*RCD_WALLFRAME is also returned as the rcd_mode when upgrading apc, airalarm, firealarm using simple circuits upgrade
*/
if(rcd_mode != RCD_WALLFRAME && rcd_mode != RCD_DECONSTRUCT)
var/turf/target_turf = get_turf(target)
//if we are trying to build a window we check for specific edge cases
if(rcd_mode == RCD_WINDOWGRILLE)
var/obj/structure/window/window_type = rcd_structure
var/is_full_tile = initial(window_type.fulltile)
var/list/structures_to_ignore
if(istype(target, /obj/structure/grille))
if(is_full_tile) //if we are trying to build full-tile windows we ignore the grille
structures_to_ignore = list(/obj/structure/grille)
else //when building directional windows we ignore the grill and other directional windows
structures_to_ignore = list(/obj/structure/grille, /obj/structure/window)
else //for directional windows we ignore other directional windows as they can be in diffrent directions on the turf.
structures_to_ignore = list(/obj/structure/window)
//check if we can build our window on the grill
if(target_turf.is_blocked_turf(exclude_mobs = !is_full_tile, source_atom = null, ignore_atoms = structures_to_ignore, type_list = TRUE))
playsound(loc, 'sound/machines/click.ogg', 50, TRUE)
balloon_alert(user, "something is blocking the turf")
return FALSE
/**
* if we are trying to create plating on turf which is not a proper floor then dont check for objects on top of the turf just allow that turf to be converted into plating. e.g. create plating beneath a player or underneath a machine frame/any dense object
* if we are trying to finish a wall girder then let it finish then make sure no one/nothing is stuck in the girder
*/
else if(rcd_mode == RCD_TURF && rcd_structure == /turf/open/floor/plating/rcd && (!istype(target_turf, /turf/open/floor) || istype(target, /obj/structure/girder)))
//if a player builds a wallgirder on top of himself manually with iron sheets he can't finish the wall if he is still on the girder. Exclude the girder itself when checking for other dense objects on the turf
if(istype(target, /obj/structure/girder) && target_turf.is_blocked_turf(exclude_mobs = FALSE, source_atom = null, ignore_atoms = list(target)))
playsound(loc, 'sound/machines/click.ogg', 50, TRUE)
balloon_alert(user, "something is on the girder!")
return FALSE
//check if turf is blocked in for dense structures
else
//structures which are small enough to fit on turfs containing directional windows.
var/static/list/small_structures = list(
/obj/machinery/door,
/obj/structure/frame/computer/rcd,
/obj/structure/floodlight_frame/completed,
/obj/structure/chair,
/obj/structure/table,
/obj/structure/rack,
/obj/structure/bed,
/obj/structure/frame/machine/secured,
/obj/structure/reflector,
)
//edge cases for what we can/can't ignore
var/ignore_mobs = FALSE
var/list/ignored_types
if(rcd_mode == RCD_WINDOWGRILLE || is_path_in_list(rcd_structure, small_structures))
ignored_types = list(/obj/structure/window)
//if we are trying to create grills/windoors we can go ahead and further ignore other windoors on the turf
if(rcd_mode == RCD_WINDOWGRILLE || (rcd_mode == RCD_AIRLOCK && ispath(rcd_structure, /obj/machinery/door/window)))
//only ignore mobs if we are trying to create windoors and not grills. We dont want to drop a grill on top of somebody
ignore_mobs = rcd_mode == RCD_AIRLOCK
ignored_types += /obj/machinery/door/window
//if we are trying to create full airlock doors then we do the regular checks and make sure we have the full space for them. i.e. dont ignore anything dense on the turf
else if(rcd_mode == RCD_AIRLOCK)
ignored_types = list()
//check if the structure can fit on this turf
if(target_turf.is_blocked_turf(exclude_mobs = ignore_mobs, source_atom = null, ignore_atoms = ignored_types, type_list = TRUE))
playsound(loc, 'sound/machines/click.ogg', 50, TRUE)
balloon_alert(user, "something is on the tile!")
return FALSE
return TRUE
/**
* actual proc to create the structure
*
* Arguments
* * [atom][target]- the target we are trying to build on/deconstruct e.g. turf, wall etc
* * [mob][user]- the user building this structure
*/
/obj/item/construction/rcd/proc/rcd_create(atom/target, mob/user)
//does this atom allow for rcd actions?
var/list/rcd_results = target.rcd_vals(user, src)
if(!rcd_results)
return FALSE
rcd_results["[RCD_DESIGN_MODE]"] = mode
rcd_results["[RCD_DESIGN_PATH]"] = rcd_design_path
var/delay = rcd_results["delay"] * delay_mod
if (
!(upgrade & RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN) \
&& !rcd_results[RCD_RESULT_BYPASS_FREQUENT_USE_COOLDOWN] \
&& current_active_effects > 0
)
delay *= FREQUENT_USE_DEBUFF_MULTIPLIER
current_active_effects += 1
var/target_name = target.name //Store this information before it gets mutated by the rcd.
var/target_path = target.type
var/atom/design_path = rcd_results["[RCD_DESIGN_PATH]"]
var/location = AREACOORD(target)
if(_rcd_create_effect(target, user, delay, rcd_results))
log_tool("[key_name(user)] used [src] to [rcd_results["[RCD_DESIGN_MODE]"] != RCD_DECONSTRUCT ? "construct [initial(design_path.name)]([design_path])" : "deconstruct [target_name]([target_path])"] at [location]")
current_active_effects -= 1
/**
* Internal proc which creates the rcd effects & creates the structure
*
* Arguments
* * [atom][target]- the target we are trying to build on/deconstruct e.g. turf, wall etc
* * [mob][user]- the user trying to build the structure
* * delay- the delay with the disk upgrades applied
* * rcd_results- list of params which contains the cost & build mode to create the structure
*/
/obj/item/construction/rcd/proc/_rcd_create_effect(atom/target, mob/user, delay, list/rcd_results)
var/obj/effect/constructing_effect/rcd_effect = new(get_turf(target), delay, rcd_results["[RCD_DESIGN_MODE]"], upgrade)
//resource & structure placement sanity checks before & after delay along with beam effects
if(!checkResource(rcd_results["cost"], user) || !can_place(target, rcd_results, user))
qdel(rcd_effect)
return FALSE
var/beam
if(ranged)
var/atom/beam_source = owner ? owner : user
beam = beam_source.Beam(target, icon_state = "rped_upgrade", time = delay)
if(delay && !do_after(user, delay, target = target)) // no need for do_after with no delay
qdel(rcd_effect)
if(!isnull(beam))
qdel(beam)
return FALSE
if (QDELETED(rcd_effect))
return FALSE
if(!checkResource(rcd_results["cost"], user) || !can_place(target, rcd_results, user))
qdel(rcd_effect)
return FALSE
if(!useResource(rcd_results["cost"], user))
qdel(rcd_effect)
return FALSE
activate()
if(!target.rcd_act(user, src, rcd_results))
qdel(rcd_effect)
return FALSE
playsound(loc, 'sound/machines/click.ogg', 50, TRUE)
rcd_effect.end_animation()
return TRUE
/obj/item/construction/rcd/ui_assets(mob/user)
return list(
get_asset_datum(/datum/asset/spritesheet/rcd),
)
/obj/item/construction/rcd/ui_host(mob/user)
return owner || ..()
/obj/item/construction/rcd/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "RapidConstructionDevice", name)
ui.open()
/obj/item/construction/rcd/ui_static_data(mob/user)
var/list/data = ..()
var/list/electronics_data = airlock_electronics.ui_static_data(user)
for(var/key in electronics_data)
data[key] = electronics_data[key]
data["root_categories"] = list()
for(var/category in GLOB.rcd_designs)
data["root_categories"] += category
data["selected_root"] = root_category
data["categories"] = list()
for(var/sub_category as anything in GLOB.rcd_designs[root_category])
var/list/target_category = GLOB.rcd_designs[root_category][sub_category]
if(!length(target_category))
continue
//skip category if upgrades were not installed for these
if(sub_category == "Machines" && !(upgrade & RCD_UPGRADE_FRAMES))
continue
if(sub_category == "Furniture" && !(upgrade & RCD_UPGRADE_FURNISHING))
continue
var/list/designs = list() //initialize all designs under this category
for(var/list/design as anything in target_category)
var/atom/movable/design_path = design[RCD_DESIGN_PATH]
var/design_name = initial(design_path.name)
designs += list(list("title" = design_name, "icon" = sanitize_css_class_name(design_name)))
data["categories"] += list(list("cat_name" = sub_category, "designs" = designs))
return data
/obj/item/construction/rcd/ui_data(mob/user)
var/list/data = ..()
//main categories
data["selected_category"] = design_category
data["selected_design"] = design_title
//merge airlock_electronics ui data with this
var/list/airlock_data = airlock_electronics.ui_data(user)
for(var/key in airlock_data)
data[key] = airlock_data[key]
return data
/obj/item/construction/rcd/handle_ui_act(action, params, datum/tgui/ui, datum/ui_state/state)
switch(action)
if("root_category")
var/new_root = params["root_category"]
if(GLOB.rcd_designs[new_root] != null) //is a valid category
root_category = new_root
update_static_data_for_all_viewers()
if("design")
//read and validate params from UI
var/category_name = params["category"]
var/index = params["index"]
var/list/root = GLOB.rcd_designs[root_category]
if(root == null) //not a valid root
return TRUE
var/list/category = root[category_name]
if(category == null) //not a valid category
return TRUE
/**
* The advantage of organizing designs into categories is that
* You can ignore an complete category if the design disk upgrade for that category isn't installed.
*/
//You can't select designs from the Machines category if you dont have the frames upgrade installed.
if(category == "Machines" && !(upgrade & RCD_UPGRADE_FRAMES))
return TRUE
//You can't select designs from the Furniture category if you dont have the furnishing upgrade installed.
if(category == "Furniture" && !(upgrade & RCD_UPGRADE_FURNISHING))
return TRUE
//use UI params to set variables
var/list/design = category[index]
if(design == null) //not a valid design
return TRUE
design_category = category_name
mode = design["[RCD_DESIGN_MODE]"]
construction_mode = mode
rcd_design_path = design["[RCD_DESIGN_PATH]"]
design_title = initial(rcd_design_path.name)
else
airlock_electronics.do_action(action, params)
return TRUE
/obj/item/construction/rcd/attack_self(mob/user)
. = ..()
ui_interact(user)
/obj/item/construction/rcd/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
//proximity check for normal rcd & range check for arcd
if((!proximity_flag && !ranged) || (ranged && !range_check(target, user)))
return FALSE
//do the work
mode = construction_mode
rcd_create(target, user)
return . | AFTERATTACK_PROCESSED_ITEM
/obj/item/construction/rcd/afterattack_secondary(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
//proximity check for normal rcd & range check for arcd
if((!proximity_flag && !ranged) || (ranged && !range_check(target, user)))
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
//do the work
mode = RCD_DECONSTRUCT
rcd_create(target, user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/item/construction/rcd/proc/detonate_pulse()
audible_message("<span class='danger'><b>[src] begins to vibrate and \
buzz loudly!</b></span>","<span class='danger'><b>[src] begins \
vibrating violently!</b></span>")
// 5 seconds to get rid of it
addtimer(CALLBACK(src, PROC_REF(detonate_pulse_explode)), 50)
/obj/item/construction/rcd/proc/detonate_pulse_explode()
explosion(src, light_impact_range = 3, flame_range = 1, flash_range = 1)
qdel(src)
/obj/item/construction/rcd/borg
desc = "A device used to rapidly build walls and floors."
banned_upgrades = RCD_UPGRADE_SILO_LINK
/// enery usage
var/energyfactor = 72 KILO JOULES
/obj/item/construction/rcd/borg/get_matter(mob/user)
if(!iscyborg(user))
return 0
var/mob/living/silicon/robot/borgy = user
if(!borgy.cell)
return 0
max_matter = borgy.cell.maxcharge
return borgy.cell.charge
/obj/item/construction/rcd/borg/useResource(amount, mob/user)
if(!iscyborg(user))
return 0
var/mob/living/silicon/robot/borgy = user
if(!borgy.cell)
if(user)
balloon_alert(user, "no cell found!")
return 0
. = borgy.cell.use(amount * energyfactor) //borgs get 1.3x the use of their RCDs
if(!. && user)
balloon_alert(user, "insufficient charge!")
return .
/obj/item/construction/rcd/borg/checkResource(amount, mob/user)
if(!iscyborg(user))
return 0
var/mob/living/silicon/robot/borgy = user
if(!borgy.cell)
if(user)
balloon_alert(user, "no cell found!")
return 0
. = borgy.cell.charge >= (amount * energyfactor)
if(!. && user)
balloon_alert(user, "insufficient charge!")
return .
/obj/item/construction/rcd/borg/syndicate
name = "syndicate RCD"
desc = "A reverse-engineered RCD with black market upgrades that allow this device to deconstruct reinforced walls. Property of Donk Co."
icon_state = "ircd"
inhand_icon_state = "ircd"
energyfactor = 66 KILO JOULES
canRturf = TRUE
/obj/item/construction/rcd/loaded
matter = 160
/obj/item/construction/rcd/loaded/upgraded
upgrade = RCD_ALL_UPGRADES
/obj/item/construction/rcd/ce
name = "professional RCD"
desc = "A higher-end model of the rapid construction device, prefitted with improved cooling and disruption prevention. Provided to the chief engineer."
upgrade = RCD_UPGRADE_ANTI_INTERRUPT | RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN
matter = 160
color = list(
0.3, 0.3, 0.7, 0.0,
1.0, 1.0, 0.2, 0.0,
-0.2, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,
0.0, 0.0, 0.0, 0.0,
)
/obj/item/construction/rcd/combat
name = "industrial RCD"
icon_state = "ircd"
inhand_icon_state = "ircd"
max_matter = 500
matter = 500
canRturf = TRUE
upgrade = RCD_ALL_UPGRADES
/obj/item/construction/rcd/combat/admin
name = "admin RCD"
max_matter = INFINITY
matter = INFINITY
upgrade = RCD_ALL_UPGRADES & ~RCD_UPGRADE_SILO_LINK
// Ranged RCD
/obj/item/construction/rcd/arcd
name = "advanced rapid-construction-device (ARCD)"
desc = "A prototype RCD with ranged capability and infinite capacity."
max_matter = INFINITY
matter = INFINITY
canRturf = TRUE
delay_mod = 0.6
ranged = TRUE
icon_state = "arcd"
inhand_icon_state = "oldrcd"
has_ammobar = FALSE
upgrade = RCD_ALL_UPGRADES & ~RCD_UPGRADE_SILO_LINK
///How much charge is used up for each matter unit.
#define MASS_TO_ENERGY (16 KILO JOULES)
/obj/item/construction/rcd/exosuit
name = "mounted RCD"
desc = "An exosuit-mounted Rapid Construction Device."
max_matter = INFINITY // mass-energy equivalence go brrrrrr
canRturf = TRUE
ranged = TRUE
has_ammobar = FALSE
resistance_flags = FIRE_PROOF | INDESTRUCTIBLE // should NOT be destroyed unless the equipment is destroyed
item_flags = NO_MAT_REDEMPTION | NOBLUDGEON | DROPDEL // already qdeleted in the equipment's Destroy() but you can never be too sure
delay_mod = 0.5
/obj/item/construction/rcd/exosuit/ui_status(mob/user, datum/ui_state/state)
if(ismecha(owner))
return owner.ui_status(user)
return UI_CLOSE
/obj/item/construction/rcd/exosuit/get_matter(mob/user)
if(silo_link)
return ..()
if(!ismecha(owner))
return 0
var/obj/vehicle/sealed/mecha/gundam = owner
return round(gundam.get_charge() / MASS_TO_ENERGY)
/obj/item/construction/rcd/exosuit/useResource(amount, mob/user)
if(silo_link)
return ..()
if(!ismecha(owner))
return 0
var/obj/vehicle/sealed/mecha/gundam = owner
if(!gundam.use_energy(amount * MASS_TO_ENERGY))
gundam.balloon_alert(user, "insufficient charge!")
return FALSE
return TRUE
/obj/item/construction/rcd/exosuit/checkResource(amount, mob/user)
if(silo_link)
return ..()
if(!ismecha(owner))
return 0
var/obj/vehicle/sealed/mecha/gundam = owner
if(!gundam.has_charge(amount * MASS_TO_ENERGY))
gundam.balloon_alert(user, "insufficient charge!")
return FALSE
return TRUE
#undef MASS_TO_ENERGY
#undef FREQUENT_USE_DEBUFF_MULTIPLIER
/obj/item/rcd_ammo
name = "RCD matter cartridge"
desc = "Highly compressed matter for the RCD."
icon = 'icons/obj/tools.dmi'
icon_state = "rcdammo"
w_class = WEIGHT_CLASS_TINY
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
custom_materials = list(/datum/material/iron=SHEET_MATERIAL_AMOUNT *6, /datum/material/glass=SHEET_MATERIAL_AMOUNT*4)
var/ammoamt = 40
/obj/item/rcd_ammo/large
custom_materials = list(/datum/material/iron=SHEET_MATERIAL_AMOUNT*24, /datum/material/glass=SHEET_MATERIAL_AMOUNT*16)
ammoamt = 160