-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
mecha_ammo.dm
107 lines (94 loc) · 3.75 KB
/
mecha_ammo.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
/obj/item/mecha_ammo
name = "generic ammo box"
desc = "A box of ammo for an unknown weapon."
w_class = WEIGHT_CLASS_BULKY
icon = 'icons/mecha/mecha_ammo.dmi'
icon_state = "empty"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/rounds = 0
var/direct_load //For weapons where we re-load the weapon itself rather than adding to the ammo storage.
var/load_audio = 'sound/weapons/gun/general/mag_bullet_insert.ogg'
var/ammo_type
/// whether to qdel this mecha_ammo when it becomes empty
var/qdel_on_empty = FALSE
/obj/item/mecha_ammo/update_name()
. = ..()
name = "[rounds ? null : "empty "][initial(name)]"
/obj/item/mecha_ammo/update_desc()
. = ..()
desc = rounds ? initial(desc) : "An exosuit ammuniton box that has since been emptied. It can be safely folded for recycling."
/obj/item/mecha_ammo/update_icon_state()
icon_state = rounds ? initial(icon_state) : "[initial(icon_state)]_e"
return ..()
/obj/item/mecha_ammo/attack_self(mob/user)
..()
if(rounds)
to_chat(user, span_warning("You cannot flatten the ammo box until it's empty!"))
return
to_chat(user, span_notice("You fold [src] flat."))
var/trash = new /obj/item/stack/sheet/iron(user.loc)
qdel(src)
user.put_in_hands(trash)
/obj/item/mecha_ammo/examine(mob/user)
. = ..()
if(rounds)
. += "There [rounds > 1?"are":"is"] [rounds] [ammo_type][rounds > 1?"s":""] left."
else
. += span_notice("Use in-hand to fold it into a sheet of iron.")
/obj/item/mecha_ammo/incendiary
name = "incendiary ammo box"
desc = "A box of incendiary ammunition for use with exosuit weapons."
icon_state = "incendiary"
custom_materials = list(/datum/material/iron=6000)
rounds = 24
ammo_type = MECHA_AMMO_INCENDIARY
/obj/item/mecha_ammo/scattershot
name = "scattershot ammo box"
desc = "A box of scaled-up buckshot, for use in exosuit shotguns."
icon_state = "scattershot"
custom_materials = list(/datum/material/iron=6000)
rounds = 40
ammo_type = MECHA_AMMO_BUCKSHOT
/obj/item/mecha_ammo/lmg
name = "machine gun ammo box"
desc = "A box of linked ammunition, designed for the Ultra AC 2 exosuit weapon."
icon_state = "lmg"
custom_materials = list(/datum/material/iron = 4000)
rounds = 300
ammo_type = MECHA_AMMO_LMG
/// Missile Ammo
/// SRM-8 Missile type - Used by Nuclear Operatives
/obj/item/mecha_ammo/missiles_srm
name = "short range missiles"
desc = "A box of large missiles, ready for loading into an SRM-8 exosuit missile rack."
icon_state = "missile_he"
rounds = 8
direct_load = TRUE
load_audio = 'sound/weapons/gun/general/mag_bullet_insert.ogg'
ammo_type = MECHA_AMMO_MISSILE_SRM
/// PEP-6 Missile type - Used by Robotics
/obj/item/mecha_ammo/missiles_pep
name = "precision explosive missiles"
desc = "A box of large missiles, ready for loading into a PEP-6 exosuit missile rack."
icon_state = "missile_br"
custom_materials = list(/datum/material/iron=8000,/datum/material/gold=500)
rounds = 6
direct_load = TRUE
load_audio = 'sound/weapons/gun/general/mag_bullet_insert.ogg'
ammo_type = MECHA_AMMO_MISSILE_PEP
/obj/item/mecha_ammo/flashbang
name = "launchable flashbangs"
desc = "A box of smooth flashbangs, for use with a large exosuit launcher. Cannot be primed by hand."
icon_state = "flashbang"
custom_materials = list(/datum/material/iron=4000,/datum/material/gold=500)
rounds = 6
ammo_type = MECHA_AMMO_FLASHBANG
/obj/item/mecha_ammo/clusterbang
name = "launchable flashbang clusters"
desc = "A box of clustered flashbangs, for use with a specialized exosuit cluster launcher. Cannot be primed by hand."
icon_state = "clusterbang"
custom_materials = list(/datum/material/iron=6000,/datum/material/gold=1500,/datum/material/uranium=1500)
rounds = 3
direct_load = TRUE
ammo_type = MECHA_AMMO_CLUSTERBANG