-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
gas_types.dm
237 lines (207 loc) · 5.41 KB
/
gas_types.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
GLOBAL_LIST_INIT(hardcoded_gases, list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide, /datum/gas/plasma)) //the main four gases, which were at one time hardcoded
GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide, /datum/gas/pluoxium, /datum/gas/stimulum, /datum/gas/nitryl))) //unable to react amongst themselves
/proc/meta_gas_list()
. = subtypesof(/datum/gas)
for(var/gas_path in .)
var/list/gas_info = new(7)
var/datum/gas/gas = gas_path
gas_info[META_GAS_SPECIFIC_HEAT] = initial(gas.specific_heat)
gas_info[META_GAS_NAME] = initial(gas.name)
gas_info[META_GAS_MOLES_VISIBLE] = initial(gas.moles_visible)
if(initial(gas.moles_visible) != null)
gas_info[META_GAS_OVERLAY] = new /list(TOTAL_VISIBLE_STATES)
for(var/i in 1 to TOTAL_VISIBLE_STATES)
gas_info[META_GAS_OVERLAY][i] = new /obj/effect/overlay/gas(initial(gas.gas_overlay), log(4, (i+0.4*TOTAL_VISIBLE_STATES) / (0.35*TOTAL_VISIBLE_STATES)) * 255)
gas_info[META_GAS_FUSION_POWER] = initial(gas.fusion_power)
gas_info[META_GAS_DANGER] = initial(gas.dangerous)
gas_info[META_GAS_ID] = initial(gas.id)
.[gas_path] = gas_info
/proc/gas_id2path(id)
var/list/meta_gas = GLOB.meta_gas_info
if(id in meta_gas)
return id
for(var/path in meta_gas)
if(meta_gas[path][META_GAS_ID] == id)
return path
return ""
/*||||||||||||||/----------\||||||||||||||*\
||||||||||||||||[GAS DATUMS]||||||||||||||||
||||||||||||||||\__________/||||||||||||||||
||||These should never be instantiated. ||||
||||They exist only to make it easier ||||
||||to add a new gas. They are accessed ||||
||||only by meta_gas_list(). ||||
\*||||||||||||||||||||||||||||||||||||||||*/
/datum/gas
var/id = ""
var/specific_heat = 0
var/name = ""
var/gas_overlay = "" //icon_state in icons/effects/atmospherics.dmi
var/moles_visible = null
var/dangerous = FALSE //currently used by canisters
var/fusion_power = 0 //How much the gas accelerates a fusion reaction
var/rarity = 0 // relative rarity compared to other gases, used when setting up the reactions list.
/datum/gas/oxygen
id = "o2"
specific_heat = 20
name = "Oxygen"
rarity = 900
/datum/gas/nitrogen
id = "n2"
specific_heat = 20
name = "Nitrogen"
rarity = 1000
/datum/gas/carbon_dioxide //what the fuck is this?
id = "co2"
specific_heat = 30
name = "Carbon Dioxide"
rarity = 700
/datum/gas/plasma
id = "plasma"
specific_heat = 200
name = "Plasma"
gas_overlay = "plasma"
moles_visible = MOLES_GAS_VISIBLE
dangerous = TRUE
rarity = 800
/datum/gas/water_vapor
id = "water_vapor"
specific_heat = 40
name = "Water Vapor"
gas_overlay = "water_vapor"
moles_visible = MOLES_GAS_VISIBLE
fusion_power = 8
rarity = 500
/datum/gas/hypernoblium
id = "nob"
specific_heat = 2000
name = "Hyper-noblium"
gas_overlay = "freon"
moles_visible = MOLES_GAS_VISIBLE
dangerous = TRUE
fusion_power = 10
rarity = 50
/datum/gas/nitrous_oxide
id = "n2o"
specific_heat = 40
name = "Nitrous Oxide"
gas_overlay = "nitrous_oxide"
moles_visible = MOLES_GAS_VISIBLE * 2
fusion_power = 10
dangerous = TRUE
rarity = 600
/datum/gas/nitryl
id = "no2"
specific_heat = 20
name = "Nitryl"
gas_overlay = "nitryl"
moles_visible = MOLES_GAS_VISIBLE
dangerous = TRUE
rarity = 100
/datum/gas/tritium
id = "tritium"
specific_heat = 10
name = "Tritium"
gas_overlay = "tritium"
moles_visible = MOLES_GAS_VISIBLE
dangerous = TRUE
fusion_power = 5
rarity = 300
/datum/gas/bz
id = "bz"
specific_heat = 20
name = "BZ"
dangerous = TRUE
fusion_power = 8
rarity = 400
/datum/gas/stimulum
id = "stim"
specific_heat = 5
name = "Stimulum"
fusion_power = 7
rarity = 1
/datum/gas/pluoxium
id = "pluox"
specific_heat = 80
name = "Pluoxium"
fusion_power = -10
rarity = 200
/datum/gas/miasma
id = "miasma"
specific_heat = 20
name = "Miasma"
gas_overlay = "miasma"
moles_visible = MOLES_GAS_VISIBLE * 60
rarity = 250
/datum/gas/freon
id = "freon"
specific_heat = 600
name = "Freon"
gas_overlay = "freon"
moles_visible = MOLES_GAS_VISIBLE *30
fusion_power = -5
rarity = 10
/datum/gas/hydrogen
id = "hydrogen"
specific_heat = 15
name = "Hydrogen"
dangerous = TRUE
fusion_power = 2
rarity = 600
/datum/gas/healium
id = "healium"
specific_heat = 10
name = "Healium"
dangerous = TRUE
gas_overlay = "healium"
moles_visible = MOLES_GAS_VISIBLE
rarity = 300
/datum/gas/proto_nitrate
id = "proto_nitrate"
specific_heat = 30
name = "Proto Nitrate"
dangerous = TRUE
gas_overlay = "proto_nitrate"
moles_visible = MOLES_GAS_VISIBLE
rarity = 200
/datum/gas/zauker
id = "zauker"
specific_heat = 350
name = "Zauker"
dangerous = TRUE
gas_overlay = "zauker"
moles_visible = MOLES_GAS_VISIBLE
rarity = 1
/datum/gas/halon
id = "halon"
specific_heat = 175
name = "Halon"
dangerous = TRUE
gas_overlay = "halon"
moles_visible = MOLES_GAS_VISIBLE
rarity = 300
/datum/gas/helium
id = "helium"
specific_heat = 15
name = "Helium"
dangerous = FALSE
fusion_power = 7
rarity = 50
/datum/gas/antinoblium
id = "antinoblium"
specific_heat = 1
name = "Antinoblium"
dangerous = TRUE
fusion_power = 20
rarity = 1
/obj/effect/overlay/gas
icon = 'icons/effects/atmospherics.dmi'
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
anchored = TRUE // should only appear in vis_contents, but to be safe
layer = FLY_LAYER
appearance_flags = TILE_BOUND
vis_flags = NONE
/obj/effect/overlay/gas/New(state, alph)
. = ..()
icon_state = state
alpha = alph