View difference between Paste ID: 0P7a4rRL and BSWAR44c
SHOW: | | - or go back to the newest paste.
1
colourRGB = {255,255,255}
2
FuelMod = {["version"] = 1.9}
3
local crack
4
local ol
5
local f
6
if fs.exists("Saves/JWsetting.txt") == true then
7
	f = io.open("Saves/JWsetting.txt", "r")
8
	buttonable = f:read("*n")
9
else
10
	fs.makeDirectory("Saves")
11
	f = io.open("Saves/JWsetting.txt", "w")
12
	f:write("1")
13
	buttonable = 1
14
end
15
f:close()
16
17
--petrol
18
local antifrzz = elements.allocate("JWARD", "AFRZ")
19
local petrolgas = elements.allocate("JWARD", "PTLV")
20
local petrol = elements.allocate("JWARD", "PTRL")
21
elements.element(elements.JWARD_PT_PTRL, elements.element(elements.DEFAULT_PT_GEL))
22
elements.property(elements.JWARD_PT_PTRL, "Name", "PTRL")
23
elements.property(elements.JWARD_PT_PTRL, "Description", "Petrol. Highly flammable liquid.")
24
elements.property(elements.JWARD_PT_PTRL, "Colour", 0x0A4A5C)
25
elements.property(elements.JWARD_PT_PTRL, "MenuSection", SC_LIQUID)
26
elements.property(elements.JWARD_PT_PTRL, "Gravity", 0.6)
27
elements.property(elements.JWARD_PT_PTRL, "Flammable", 0)
28
elements.property(elements.JWARD_PT_PTRL, "Explosive", 0)
29
elements.property(elements.JWARD_PT_PTRL, "Loss", 0.8)
30
elements.property(elements.JWARD_PT_PTRL, "AirLoss", 0.94)
31
elements.property(elements.JWARD_PT_PTRL, "AirDrag", 0.02)
32
elements.property(elements.JWARD_PT_PTRL, "Advection", 0.8)
33
elements.property(elements.JWARD_PT_PTRL, "Weight", 12)
34
elements.property(elements.JWARD_PT_PTRL, "Diffusion", 0)
35
elements.property(elements.JWARD_PT_PTRL, "Meltable", 0)
36
elements.property(elements.JWARD_PT_PTRL, "Hardness", 0)
37
elements.property(elements.JWARD_PT_PTRL, "Falldown", 2)
38
elements.property(elements.JWARD_PT_PTRL, "Properties", TYPE_LIQUID)
39
elements.property(elements.JWARD_PT_PTRL, "State", ST_LIQUID)
40
elements.property(elements.JWARD_PT_PTRL, "Temperature", 295.15)
41
elements.property(elements.JWARD_PT_PTRL, "HeatConduct", 78)
42
elements.property(elements.JWARD_PT_PTRL, "HighTemperature", 333.15)
43
elements.property(elements.JWARD_PT_PTRL, "HighTemperatureTransition", elements.JWARD_PT_PTLV)
44
elements.property(elements.JWARD_PT_PTRL, "LowTemperature", 225.15)
45
elements.property(elements.JWARD_PT_PTRL, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
46
function PTRL(i,x,y,s,n)
47
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
48
	local cal = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
49
	if cal == tpt.element('acel') and reaction == kerosene then
50
		sim.partChangeType(i, tpt.element('JETB'))
51
	end
52
end
53
tpt.element_func(PTRL,petrol)
54
55
elements.element(elements.JWARD_PT_PTLV, elements.element(elements.DEFAULT_PT_HYGN))
56
elements.property(elements.JWARD_PT_PTLV, "Name", "PTLV")
57
elements.property(elements.JWARD_PT_PTLV, "Description", "petrol gas")
58
elements.property(elements.JWARD_PT_PTLV, "Colour", 0x0A4A5C)
59
elements.property(elements.JWARD_PT_PTLV, "MenuVisible", 0)
60
elements.property(elements.JWARD_PT_PTLV, "Gravity", -0.02)
61
elements.property(elements.JWARD_PT_PTLV, "Flammable", 500)
62
elements.property(elements.JWARD_PT_PTLV, "Explosive", 1)
63
elements.property(elements.JWARD_PT_PTLV, "Loss", 0.75)
64
elements.property(elements.JWARD_PT_PTLV, "AirLoss", 0.97)
65
elements.property(elements.JWARD_PT_PTLV, "AirDrag", 0.01)
66
elements.property(elements.JWARD_PT_PTLV, "Advection", 1)
67
elements.property(elements.JWARD_PT_PTLV, "Weight", 0)
68
elements.property(elements.JWARD_PT_PTLV, "Diffusion", 0.7)
69
elements.property(elements.JWARD_PT_PTLV, "Meltable", 0)
70
elements.property(elements.JWARD_PT_PTLV, "Hardness", 0)
71
elements.property(elements.JWARD_PT_PTLV, "Falldown", 0)
72
elements.property(elements.JWARD_PT_PTLV, "Properties", TYPE_GAS)
73
elements.property(elements.JWARD_PT_PTLV, "State", ST_GAS)
74
elements.property(elements.JWARD_PT_PTLV, "Temperature", 343.15)
75
elements.property(elements.JWARD_PT_PTLV, "HeatConduct", 80)
76
elements.property(elements.JWARD_PT_PTLV, "LowTemperature", 333.14)
77
elements.property(elements.JWARD_PT_PTLV, "LowTemperatureTransition", elements.JWARD_PT_PTRL)
78
function PTLV(i,x,y,s,n)
79
end
80
tpt.element_func(PTLV,petrolgas)
81
82
elements.element(elements.JWARD_PT_AFRZ, elements.element(elements.DEFAULT_PT_GEL))
83
elements.property(elements.JWARD_PT_AFRZ, "Name", "AFRZ")
84
elements.property(elements.JWARD_PT_AFRZ, "Description", "antifreeze, keeps your fuel nice and toasty. methnol")
85
elements.property(elements.JWARD_PT_AFRZ, "Colour", 0x0C3F5B)
86
elements.property(elements.JWARD_PT_AFRZ, "MenuSection", SC_LIQUID)
87
elements.property(elements.JWARD_PT_AFRZ, "Gravity", 0.6)
88
elements.property(elements.JWARD_PT_AFRZ, "Flammable", 65)
89
elements.property(elements.JWARD_PT_AFRZ, "Explosive", 0)
90
elements.property(elements.JWARD_PT_AFRZ, "Loss", 0.8)
91
elements.property(elements.JWARD_PT_AFRZ, "AirLoss", 0.94)
92
elements.property(elements.JWARD_PT_AFRZ, "AirDrag", 0.02)
93
elements.property(elements.JWARD_PT_AFRZ, "Advection", 0.8)
94
elements.property(elements.JWARD_PT_AFRZ, "Weight", 12)
95
elements.property(elements.JWARD_PT_AFRZ, "Diffusion", 0)
96
elements.property(elements.JWARD_PT_AFRZ, "Meltable", 0)
97
elements.property(elements.JWARD_PT_AFRZ, "Hardness", 0)
98
elements.property(elements.JWARD_PT_AFRZ, "Falldown", 2)
99
elements.property(elements.JWARD_PT_AFRZ, "State", ST_LIQUID)
100
elements.property(elements.JWARD_PT_AFRZ, "Temperature", 295.15)
101
elements.property(elements.JWARD_PT_AFRZ, "HeatConduct", 78)
102
elements.property(elements.JWARD_PT_AFRZ, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
103
function AFRZ(i,x,y,s,n)
104
	local warm = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
105
	local warm2 = tpt.get_property("temp",x,y)
106
	if warm == tpt.element('sprk') or warm == tpt.element('ligh') then
107
		sim.partChangeType(i, tpt.element('fire'))
108
	end
109
	if warm2 < 276 then
110
		if warm == petrol then
111
			tpt.set_property('temp', 296 ,x, y)
112
		end
113
		if warm == tpt.el.desl.id then
114
			tpt.set_property('temp', 296 ,x, y)
115
		end
116
		if warm == BioDiesel then
117
			tpt.set_property('temp', 296 ,x, y)
118
		end
119
		if warm == jetfuel then
120
			tpt.set_property('temp', 296 ,x, y)
121
		end
122
		if warm == tpt.el.ice.id then
123
			tpt.set_property('temp', 296 ,x, y)
124
		end
125
	end
126
	if warm == tpt.el.wtrv.id and warm2 > 1100 then
127
		if crack == 0 then
128
			sim.partChangeType(i, tpt.element('hygn'))
129
		else
130
			sim.partChangeType(i, tpt.element('co2'))
131
		end
132
	end
133
end
134
tpt.element_func(AFRZ, tpt.element('AFRZ'))
135
136
--diesel & bio diesel
137
local Dieselgas = elements.allocate("JWARD", "DSLV")
138
local potash_lye = elements.allocate("JWARD", "PLYE")
139
local cooking_oil = elements.allocate("JWARD", "COIL")
140
local BioDiesel = elements.allocate("JWARD", "BDSL")
141
142
elements.element(elements.JWARD_PT_DSLV, elements.element(elements.DEFAULT_PT_HYGN))
143
elements.property(elements.JWARD_PT_DSLV, "Name", "DSLV")
144
elements.property(elements.JWARD_PT_DSLV, "Description", "diesel gas")
145
elements.property(elements.JWARD_PT_DSLV, "Colour", 0x440000)
146
elements.property(elements.JWARD_PT_DSLV, "MenuVisible", 0)
147
elements.property(elements.JWARD_PT_DSLV, "Gravity", -0.02)
148
elements.property(elements.JWARD_PT_DSLV, "Flammable", 550)
149
elements.property(elements.JWARD_PT_DSLV, "Explosive", 1)
150
elements.property(elements.JWARD_PT_DSLV, "Loss", 0.75)
151
elements.property(elements.JWARD_PT_DSLV, "AirLoss", 0.97)
152
elements.property(elements.JWARD_PT_DSLV, "AirDrag", 0.01)
153
elements.property(elements.JWARD_PT_DSLV, "Advection", 1)
154
elements.property(elements.JWARD_PT_DSLV, "Weight", 0)
155
elements.property(elements.JWARD_PT_DSLV, "Diffusion", 0.7)
156
elements.property(elements.JWARD_PT_DSLV, "Meltable", 0)
157
elements.property(elements.JWARD_PT_DSLV, "Hardness", 0)
158
elements.property(elements.JWARD_PT_DSLV, "Falldown", 0)
159
elements.property(elements.JWARD_PT_DSLV, "Properties", TYPE_GAS)
160
elements.property(elements.JWARD_PT_DSLV, "State", ST_GAS)
161
elements.property(elements.JWARD_PT_DSLV, "Temperature", 483.15)
162
elements.property(elements.JWARD_PT_DSLV, "HeatConduct", 80)
163
elements.property(elements.JWARD_PT_DSLV, "LowTemperature", 473.15)
164
elements.property(elements.JWARD_PT_DSLV, "LowTemperatureTransition", elements.DEFAULT_PT_DESL)
165
function DSLV(i,x,y,s,n)
166
end
167
tpt.element_func(DSLV,Dieselgas)
168
169
170
elements.element(elements.JWARD_PT_COIL, elements.element(elements.DEFAULT_PT_GEL))
171
elements.property(elements.JWARD_PT_COIL, "Name", "COIL")
172
elements.property(elements.JWARD_PT_COIL, "Description", "Cooking oil, bubbles when heated.")
173
elements.property(elements.JWARD_PT_COIL, "Colour", 0xA57214)
174
elements.property(elements.JWARD_PT_COIL, "MenuSection", 7)
175
elements.property(elements.JWARD_PT_COIL, "Gravity", 0.6)
176
elements.property(elements.JWARD_PT_COIL, "Flammable", 1)
177
elements.property(elements.JWARD_PT_COIL, "Explosive", 0)
178
elements.property(elements.JWARD_PT_COIL, "Loss", 1)
179
elements.property(elements.JWARD_PT_COIL, "AirLoss", 0.91)
180
elements.property(elements.JWARD_PT_COIL, "AirDrag", 0.02)
181
elements.property(elements.JWARD_PT_COIL, "Advection", 0.9)
182
elements.property(elements.JWARD_PT_COIL, "Weight", 10)
183
elements.property(elements.JWARD_PT_COIL, "Meltable", 0)
184
elements.property(elements.JWARD_PT_COIL, "Hardness", 86)
185
elements.property(elements.JWARD_PT_COIL, "Falldown", 2)
186
elements.property(elements.JWARD_PT_COIL, "Properties", TYPE_LIQUID)
187
elements.property(elements.JWARD_PT_COIL, "State", ST_LIQUID)
188
elements.property(elements.JWARD_PT_COIL, "Temperature", 295.15)
189
elements.property(elements.JWARD_PT_COIL, "HeatConduct", 100)
190
function COIL(i,x,y,s,n)
191
	local cx = math.random(-3,3)
192
	local cy = math.random(-5,1)
193
	local reaction = tpt.get_property("temp",x,y)
194
	local bioo = tpt.get_property("type",x + math.random(-2,2), y + math.random(-2,2))
195
	local biooo = tpt.get_property("type",x + cy, y + cx)
196
	if cy == 1 then
197
		if reaction > 363.15 then
198
			tpt.set_property('vy', -1, x, y)
199
		end
200
	else
201
		tpt.set_property('vy', 1, x, y)
202
	end
203
	if biooo == potash_lye and bioo == antifrzz then
204
		if cy == 1 then
205
			sim.partChangeType(i, tpt.element('GLCR'))
206
		else
207
			sim.partChangeType(i, tpt.element('BDSL'))
208
		end
209
	end
210
	if biooo == potash_lye and bioo == tpt.el.watr.id and reaction > 290 and reaction < 330 then
211
		sim.partChangeType(i, tpt.element('SOAP'))
212
		tpt.delete(x + cx,y + cy)
213
	end
214
end
215
tpt.element_func(COIL, tpt.element('COIL'))
216
217
elements.element(elements.JWARD_PT_BDSL, elements.element(elements.DEFAULT_PT_GEL))
218
elements.property(elements.JWARD_PT_BDSL, "Name", "BDSL")
219
elements.property(elements.JWARD_PT_BDSL, "Description", "Bio Diesel. Made from cooking oil.")
220
elements.property(elements.JWARD_PT_BDSL, "Colour", 0x331000)
221
elements.property(elements.JWARD_PT_BDSL, "MenuSection", SC_LIQUID)
222
elements.property(elements.JWARD_PT_BDSL, "Gravity", 0.6)
223
elements.property(elements.JWARD_PT_BDSL, "Flammable", 0)
224
elements.property(elements.JWARD_PT_BDSL, "Explosive", 0)
225
elements.property(elements.JWARD_PT_BDSL, "Loss", 0.8)
226
elements.property(elements.JWARD_PT_BDSL, "AirLoss", 0.94)
227
elements.property(elements.JWARD_PT_BDSL, "AirDrag", 0.02)
228
elements.property(elements.JWARD_PT_BDSL, "Advection", 0.8)
229
elements.property(elements.JWARD_PT_BDSL, "Weight", 12)
230
elements.property(elements.JWARD_PT_BDSL, "Diffusion", 0)
231
elements.property(elements.JWARD_PT_BDSL, "Meltable", 0)
232
elements.property(elements.JWARD_PT_BDSL, "Hardness", 0)
233
elements.property(elements.JWARD_PT_BDSL, "Falldown", 2)
234
elements.property(elements.JWARD_PT_BDSL, "Properties", TYPE_LIQUID)
235
elements.property(elements.JWARD_PT_BDSL, "State", ST_LIQUID)
236
elements.property(elements.JWARD_PT_BDSL, "Temperature", 295.15)
237
elements.property(elements.JWARD_PT_BDSL, "HeatConduct", 99)
238
elements.property(elements.JWARD_PT_BDSL, "HighTemperature", 403.15)
239
elements.property(elements.JWARD_PT_BDSL, "HighTemperatureTransition", elements.JWARD_PT_DSLV)
240
function BDSL(i,x,y,s,n)
241
	local findcoil = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
242
	local otherfind = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
243
	if findcoil == cooking_oil then
244
		tpt.set_property('life', 2 ,x, y)
245
	elseif findcoil == tpt.el.acel.id then
246
		if otherfind == tpt.el.desl.id then
247
			sim.partChangeType(i, tpt.element('desl'))
248
		end
249
	end
250
	if otherfind == tpt.el.sprk.id or otherfind == tpt.el.ligh.id then
251
		sim.partChangeType(i, tpt.element('fire'))
252
	end
253
end
254
tpt.element_func(BDSL, tpt.element('BDSL'))
255
256
function desl(i,x,y,s,n)
257
	if buttonable == 1 and tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1)) == tpt.el.brel.id then
258
		if crack == 0 then
259
			sim.partChangeType(i, petrol)
260
		else
261
			sim.partChangeType(i, tpt.element('PRPN'))
262
		end
263
	end
264
end
265
tpt.element_func(desl,tpt.el.desl.id)
266
267
elements.element(elements.JWARD_PT_PLYE, elements.element(elements.DEFAULT_PT_BCOL))
268
elements.property(elements.JWARD_PT_PLYE, "Name", "PLYE")
269
elements.property(elements.JWARD_PT_PLYE, "Description", "potash lye")
270
elements.property(elements.JWARD_PT_PLYE, "Colour", 0xCCCCCC)
271
elements.property(elements.JWARD_PT_PLYE, "MenuSection", 8)
272
elements.property(elements.JWARD_PT_PLYE, "Gravity", .35)
273
elements.property(elements.JWARD_PT_PLYE, "Flammable", 0)
274
elements.property(elements.JWARD_PT_PLYE, "Explosive", 0)
275
elements.property(elements.JWARD_PT_PLYE, "Loss", 0.15)
276
elements.property(elements.JWARD_PT_PLYE, "AirLoss", 0.96)
277
elements.property(elements.JWARD_PT_PLYE, "AirDrag", 0.03)
278
elements.property(elements.JWARD_PT_PLYE, "Advection", 0.4)
279
elements.property(elements.JWARD_PT_PLYE, "Weight", 60)
280
elements.property(elements.JWARD_PT_PLYE, "Diffusion", 0)
281
elements.property(elements.JWARD_PT_PLYE, "Falldown", 1)
282
elements.property(elements.JWARD_PT_PLYE, "Hardness", 0)
283
elements.property(elements.JWARD_PT_PLYE, "HeatConduct", 62)
284
elements.property(elements.JWARD_PT_PLYE, "Properties", elem.PROP_DEADLY)
285
elements.property(elements.JWARD_PT_PLYE, "HighTemperature", 679.15)
286
elements.property(elements.JWARD_PT_PLYE, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
287
function PLYE(i,x,y,s,n)
288
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
289
	if reaction == tpt.el.acid.id then
290
		sim.partChangeType(i, tpt.element('SLTW'))
291
	end
292
end
293
tpt.element_func(PLYE, tpt.element('PLYE'))
294
295
function ACIDBASE(i,x,y,s,n)
296
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
297
	--add metals
298
	if reaction == potash_lye then
299
		sim.partChangeType(i, tpt.element('SLTW'))
300
	end
301
	if buttonable == 0 then
302
		if reaction == tpt.element('C4') or reaction == tpt.element('NITR') or reaction == tpt.element('GUN') or reaction == tpt.element('RBDM') or reaction == tpt.element('LRBD') then 
303
			sim.partChangeType(i, tpt.element('fire')) 
304
		elseif reaction == tpt.el.wtrv.id then 
305
			sim.partChangeType(i, tpt.element('CAUS')) 
306
		end
307
	else
308
		if reaction == tpt.element('GLCR') then
309
			sim.partChangeType(i, tpt.element('NITR')) 
310
		end
311
	end
312
end
313
tpt.element_func(ACIDBASE, tpt.element('acid'), 1)
314
315
function TTAN(i,x,y,s,n)
316
	if buttonable == 1 then
317
		local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
318
		local randomval = math.random(0,100)
319
		if reaction == tpt.el.acid.id then
320
			if randomval == 1 then
321
				sim.partChangeType(i, tpt.element('SLTW'))
322
			elseif randomval == 0 then
323
				sim.partChangeType(i, tpt.element('hygn'))
324
			end
325
		end
326
	end
327
end
328
tpt.element_func(TTAN, tpt.element('ttan'))
329
330
function IRON(i,x,y,s,n)
331
	if buttonable == 1 then
332
		local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
333
		local randomval = math.random(0,20)
334
		if reaction == tpt.el.acid.id then
335
			if randomval == 1 then
336
				sim.partChangeType(i, tpt.element('SLTW'))
337
			elseif randomval == 0 then
338
				sim.partChangeType(i, tpt.element('hygn'))
339
			end
340
		elseif reaction == tpt.el.gas.id then 
341
			sim.partChangeType(i, tpt.element('metl'))
342
		end
343
	end
344
end
345
tpt.element_func(IRON, tpt.element('iron'))
346
347
function BRMT(i,x,y,s,n)
348
	if buttonable == 1 then
349
		local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
350
		local randomval = math.random(0,10)
351
		if reaction == tpt.el.acid.id then
352
			if randomval == 1 then
353
				sim.partChangeType(i, tpt.element('SLTW'))
354
			elseif randomval == 0 then
355
				sim.partChangeType(i, tpt.element('hygn'))
356
			end
357
		end
358
	end
359
end
360
tpt.element_func(BRMT, tpt.element('brmt'))
361
362
function BMTL(i,x,y,s,n)
363
	if buttonable == 1 then
364
		local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
365
		local randomval = math.random(0,10)
366
		if reaction == tpt.el.acid.id then
367
			if randomval == 1 then
368
				sim.partChangeType(i, tpt.element('SLTW'))
369
			elseif randomval == 0 then
370
				sim.partChangeType(i, tpt.element('hygn'))
371
			end
372
		end
373
	end
374
end
375
tpt.element_func(BMTL, tpt.element('BMTL'))
376
377
function PLUT(i,x,y,s,n)
378
	if buttonable == 1 then
379
		local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
380
		local randomval = math.random(0,20)
381
		if reaction == tpt.el.acid.id then
382
			if randomval == 1 then
383
				sim.partChangeType(i, tpt.element('SLTW'))
384
			elseif randomval == 0 then
385
				sim.partChangeType(i, tpt.element('hygn'))
386
			end
387
		end
388
	end
389
end
390
tpt.element_func(PLUT, tpt.element('plut'))
391
392
function URAN(i,x,y,s,n)
393
	if buttonable == 1 then
394
		local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
395
		local randomval = math.random(0,20)
396
		if reaction == tpt.el.acid.id then
397
			if randomval == 1 then
398
				sim.partChangeType(i, tpt.element('SLTW'))
399
			elseif randomval == 0 then
400
				sim.partChangeType(i, tpt.element('hygn'))
401
			end
402
		end
403
	end
404
end
405
tpt.element_func(URAN, tpt.element('uran'))
406
407
function RBDM(i,x,y,s,n)
408
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
409
	if reaction == tpt.el.acid.id then
410
		sim.partChangeType(i, tpt.element('coal'))
411
	end
412
end
413
tpt.element_func(RBDM, tpt.element('rbdm'))
414
415
function LRBD(i,x,y,s,n)
416
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
417
	if reaction == tpt.el.acid.id then
418
		sim.partChangeType(i, tpt.element('coal'))
419
	end
420
end
421
tpt.element_func(LRBD, tpt.element('lrbd'))
422
423
--o0o NITROGEN o0o--
424
local nitrogen = elements.allocate("JWARD", "N2")
425
local Diazane = elements.allocate("JWARD", "N2H4")
426
local DinitrogenTetroxide = elements.allocate("JWARD", "N2O4")
427
local nitrous = elements.allocate("JWARD", "N2O")
428
local LiquidNitrous = elements.allocate("JWARD", "LN2O")
429
local anfoness = elements.allocate("JWARD", "ANFO")
430
local liquidTNT = elements.allocate("JWARD", "LTNT")
431
432
elements.element(elements.JWARD_PT_LN2O, elements.element(elements.DEFAULT_PT_GEL))
433
elements.property(elements.JWARD_PT_LN2O, "Name", "LN2O")
434
elements.property(elements.JWARD_PT_LN2O, "Description", "Liquid Nitrous Oxide. Burns very quickly and very hot.")
435
elements.property(elements.JWARD_PT_LN2O, "Colour", 0x33C1F5)
436
elements.property(elements.JWARD_PT_LN2O, "MenuSection", 7)
437
elements.property(elements.JWARD_PT_LN2O, "Gravity", 0.8)
438
elements.property(elements.JWARD_PT_LN2O, "Flammable", 6000)
439
elements.property(elements.JWARD_PT_LN2O, "Explosive", 0)
440
elements.property(elements.JWARD_PT_LN2O, "Loss", 0.5)
441
elements.property(elements.JWARD_PT_LN2O, "AirLoss", 0.94)
442
elements.property(elements.JWARD_PT_LN2O, "AirDrag", 0.03)
443
elements.property(elements.JWARD_PT_LN2O, "Advection", 0.7)
444
elements.property(elements.JWARD_PT_LN2O, "Weight", 43)
445
elements.property(elements.JWARD_PT_LN2O, "Diffusion", 0)
446
elements.property(elements.JWARD_PT_LN2O, "Meltable", 0)
447
elements.property(elements.JWARD_PT_LN2O, "Hardness", 0)
448
elements.property(elements.JWARD_PT_LN2O, "Falldown", 2)
449
elements.property(elements.JWARD_PT_LN2O, "Properties", TYPE_LIQUID)
450
elements.property(elements.JWARD_PT_LN2O, "State", ST_LIQUID)
451
elements.property(elements.JWARD_PT_LN2O, "Temperature", 174)
452
elements.property(elements.JWARD_PT_LN2O, "HeatConduct", 58)
453
elements.property(elements.JWARD_PT_LN2O, "HighTemperature", 185)
454
elements.property(elements.JWARD_PT_LN2O, "HighTemperatureTransition", elements.JWARD_PT_N2O)
455
elements.property(elements.JWARD_PT_LN2O, "LowTemperature", 160.15)
456
elements.property(elements.JWARD_PT_LN2O, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
457
458
elements.element(elements.JWARD_PT_N2O, elements.element(elements.DEFAULT_PT_CO2))
459
elements.property(elements.JWARD_PT_N2O, "Name", "N2O")
460
elements.property(elements.JWARD_PT_N2O, "Description", "Nitrous Oxide. Highly flammable RACE CAR oxidizer!!!.")
461
elements.property(elements.JWARD_PT_N2O, "Colour", 0x43DAFF)
462
elements.property(elements.JWARD_PT_N2O, "MenuSection", 6)
463
elements.property(elements.JWARD_PT_N2O, "Gravity", 0)
464
elements.property(elements.JWARD_PT_N2O, "Flammable", 5000)
465
elements.property(elements.JWARD_PT_N2O, "Explosive", 0)
466
elements.property(elements.JWARD_PT_N2O, "Loss", 0.7)
467
elements.property(elements.JWARD_PT_N2O, "AirLoss", 0.91)
468
elements.property(elements.JWARD_PT_N2O, "AirDrag", 0.02)
469
elements.property(elements.JWARD_PT_N2O, "Advection", 0.9)
470
elements.property(elements.JWARD_PT_N2O, "Weight", 0)
471
elements.property(elements.JWARD_PT_N2O, "Diffusion", 1.5)
472
elements.property(elements.JWARD_PT_N2O, "Meltable", 0)
473
elements.property(elements.JWARD_PT_N2O, "Hardness", 0)
474
elements.property(elements.JWARD_PT_N2O, "Falldown", 0)
475
elements.property(elements.JWARD_PT_N2O, "Properties", TYPE_GAS)
476
elements.property(elements.JWARD_PT_N2O, "State", ST_GAS)
477
elements.property(elements.JWARD_PT_N2O, "Temperature", 295.15)
478
elements.property(elements.JWARD_PT_N2O, "HeatConduct", 80)
479
elements.property(elements.JWARD_PT_N2O, "LowTemperature", 185.67)
480
elements.property(elements.JWARD_PT_N2O, "LowTemperatureTransition", elements.JWARD_PT_LN2O)
481
function N2O(i,x,y,s,n)
482
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
483
	if reaction == tpt.el.fire.id or reaction == tpt.el.plsm.id then
484
		if crack == 0 then
485
			sim.partChangeType(i, tpt.element('N2'))
486
			sim.pressure((x/4),(y/4), 100)
487
		else
488
			sim.partChangeType(i, tpt.element('plsm'))
489
			sim.pressure((x/4),(y/4), 100)
490
		end
491
	end
492
end
493
tpt.element_func(N2O,nitrous)
494
495
elements.element(elements.JWARD_PT_N2O4, elements.element(elements.DEFAULT_PT_GEL))
496
elements.property(elements.JWARD_PT_N2O4, "Name", "N2O4")
497
elements.property(elements.JWARD_PT_N2O4, "Description", "Dinitrogen Tetroxide rocket oxidizer")
498
elements.property(elements.JWARD_PT_N2O4, "Colour", 0x30CEC6)
499
elements.property(elements.JWARD_PT_N2O4, "MenuSection", 5)
500
elements.property(elements.JWARD_PT_N2O4, "Gravity", 0.8)
501
elements.property(elements.JWARD_PT_N2O4, "Flammable", 30)
502
elements.property(elements.JWARD_PT_N2O4, "Explosive", 1)
503
elements.property(elements.JWARD_PT_N2O4, "Loss", 0.7)
504
elements.property(elements.JWARD_PT_N2O4, "AirLoss", 0.91)
505
elements.property(elements.JWARD_PT_N2O4, "AirDrag", 0.03)
506
elements.property(elements.JWARD_PT_N2O4, "Advection", 0.6)
507
elements.property(elements.JWARD_PT_N2O4, "Weight", 46)
508
elements.property(elements.JWARD_PT_N2O4, "Diffusion", 1.5)
509
elements.property(elements.JWARD_PT_N2O4, "Meltable", 0)
510
elements.property(elements.JWARD_PT_N2O4, "Hardness", 0)
511
elements.property(elements.JWARD_PT_N2O4, "Falldown", 2)
512
elements.property(elements.JWARD_PT_N2O4, "Properties", TYPE_LIQUID)
513
elements.property(elements.JWARD_PT_N2O4, "State", ST_LIQUID)
514
elements.property(elements.JWARD_PT_N2O4, "Temperature", 295.15)
515
elements.property(elements.JWARD_PT_N2O4, "HeatConduct", 78)
516
elements.property(elements.JWARD_PT_N2O4, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
517
elements.property(elements.JWARD_PT_N2O4, "LowTemperature", 261.9)
518
function N2O4(i,x,y,s,n)
519
	local rocket = tpt.get_property("type",x+math.random(-2,2),y+math.random(-2,2))
520
	if rocket == Diazane or rocket == tpt.element('plsm') or rocket == tpt.element('fire') or rocket == tpt.element('thdr') then
521
		if crack == 1 then
522
			sim.partChangeType(i, tpt.element('plsm'))
523
			sim.pressure((x/4),(y/4), 250)
524
		else
525
			sim.partChangeType(i, tpt.element('n2'))
526
			sim.pressure((x/4),(y/4), 250)
527
		end
528
	end
529
end
530
tpt.element_func(N2O4,DinitrogenTetroxide)
531
532
elements.element(elements.JWARD_PT_LTNT, elements.element(elements.DEFAULT_PT_GEL))
533
elements.property(elements.JWARD_PT_LTNT, "Name", "LTNT")
534
elements.property(elements.JWARD_PT_LTNT, "Description", "liquid TNT")
535
elements.property(elements.JWARD_PT_LTNT, "Colour", 0xBF605A)
536
elements.property(elements.JWARD_PT_LTNT, "MenuSection", 5)
537
elements.property(elements.JWARD_PT_LTNT, "Gravity", 1)
538
elements.property(elements.JWARD_PT_LTNT, "Flammable", 20)
539
elements.property(elements.JWARD_PT_LTNT, "Explosive", 1)
540
elements.property(elements.JWARD_PT_LTNT, "Loss", 0.7)
541
elements.property(elements.JWARD_PT_LTNT, "AirLoss", 0.91)
542
elements.property(elements.JWARD_PT_LTNT, "AirDrag", 0.03)
543
elements.property(elements.JWARD_PT_LTNT, "Advection", 0.8)
544
elements.property(elements.JWARD_PT_LTNT, "Weight", 46)
545
elements.property(elements.JWARD_PT_LTNT, "Diffusion", 0)
546
elements.property(elements.JWARD_PT_LTNT, "Meltable", 0)
547
elements.property(elements.JWARD_PT_LTNT, "Hardness", 0)
548
elements.property(elements.JWARD_PT_LTNT, "Falldown", 2)
549
elements.property(elements.JWARD_PT_LTNT, "Properties", TYPE_LIQUID)
550
elements.property(elements.JWARD_PT_LTNT, "State", ST_LIQUID)
551
elements.property(elements.JWARD_PT_LTNT, "Temperature", 363.25)
552
elements.property(elements.JWARD_PT_LTNT, "HeatConduct", 83)
553-
	local atemp = tpt.get_property("temp",x,y)
553+
554
elements.property(elements.JWARD_PT_LTNT, "LowTemperature", 353.25)
555
function LTNT(i,x,y,s,n)
556
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
557
	local atemp = sim.partProperty(i,'temp')
558
	if reaction == tpt.el.fire.id or reaction == tpt.el.embr.id or reaction == tpt.el.thdr.id or reaction == tpt.el.sprk.id then
559
		sim.partChangeType(i, tpt.element('embr'))
560
		sim.pressure((x/4),(y/4), 255)
561
	end
562
	if atemp > 513.15 then
563
		sim.partChangeType(i, tpt.element('coal'))
564
	end
565
end
566
tpt.element_func(LTNT, tpt.element('LTNT'))
567
568
569
elements.element(elements.JWARD_PT_N2H4, elements.element(elements.DEFAULT_PT_GEL))
570
elements.property(elements.JWARD_PT_N2H4, "Name", "N2H4")
571
elements.property(elements.JWARD_PT_N2H4, "Description", "Hydrazine rocket fuel")
572
elements.property(elements.JWARD_PT_N2H4, "Colour", 0xB6F064)
573
elements.property(elements.JWARD_PT_N2H4, "MenuSection", 5)
574
elements.property(elements.JWARD_PT_N2H4, "Gravity", 1)
575
elements.property(elements.JWARD_PT_N2H4, "Flammable", 1)
576
elements.property(elements.JWARD_PT_N2H4, "Explosive", 1)
577
elements.property(elements.JWARD_PT_N2H4, "Loss", 0.7)
578
elements.property(elements.JWARD_PT_N2H4, "AirLoss", 0.91)
579
elements.property(elements.JWARD_PT_N2H4, "AirDrag", 0.03)
580
elements.property(elements.JWARD_PT_N2H4, "Advection", 0.8)
581
elements.property(elements.JWARD_PT_N2H4, "Weight", 46)
582
elements.property(elements.JWARD_PT_N2H4, "Diffusion", 1.5)
583
elements.property(elements.JWARD_PT_N2H4, "Meltable", 0)
584
elements.property(elements.JWARD_PT_N2H4, "Hardness", 0)
585
elements.property(elements.JWARD_PT_N2H4, "Falldown", 2)
586
elements.property(elements.JWARD_PT_N2H4, "Properties", TYPE_LIQUID)
587
elements.property(elements.JWARD_PT_N2H4, "State", ST_LIQUID)
588
elements.property(elements.JWARD_PT_N2H4, "Temperature", 295.15)
589-
	local clife = tpt.get_property('life', x, y)
589+
590
elements.property(elements.JWARD_PT_N2H4, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
591
elements.property(elements.JWARD_PT_N2H4, "LowTemperature", 275.15)
592
N2H4Update = function(i, x, y, s, n)
593
	local clife = sim.partProperty(i,'life')
594
	if clife > 1 then
595
		for cx = -1, 1, 2 do
596
			for cy = -1, 1, 2 do
597
				if ol == 1 then
598
					tpt.create(x + cx, y + cy, 'fire')
599
				end 
600
				if ol == 0 then
601
					tpt.create(x + cx, y + cy, 'N2')
602
				end
603
				if ol == -1 then
604
					tpt.create(x + cx, y + cy, 'HYGN')
605
		   		end
606
				tpt.set_property('temp', 3000, x, y)
607
			end
608
		end
609
		tpt.set_property('life', clife - 1, x, y)
610
	elseif clife == 1 then
611
		tpt.set_property('type', 0, x, y)
612
	elseif s > 0 then
613
		for cx = -1, 1, 2 do
614
			for cy = -1, 1, 2 do
615
				if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
616
					tpt.set_property('life', 500, x, y)
617
					return true
618
				end
619
			end
620
		end
621
	end
622
end
623
tpt.element_func(N2H4Update, tpt.element('N2H4'))
624
625
elements.element(elements.JWARD_PT_N2, elements.element(elements.DEFAULT_PT_CO2))
626
elements.property(elements.JWARD_PT_N2, "Name", "N2")
627
elements.property(elements.JWARD_PT_N2, "Description", "Nitrogen Gas.")
628
elements.property(elements.JWARD_PT_N2, "Colour", 0x5E52FF)
629
elements.property(elements.JWARD_PT_N2, "MenuSection", SC_GAS)
630
elements.property(elements.JWARD_PT_N2, "Gravity", 0)
631
elements.property(elements.JWARD_PT_N2, "Flammable", 0)
632
elements.property(elements.JWARD_PT_N2, "Explosive", 1)
633
elements.property(elements.JWARD_PT_N2, "Loss", 0.3)
634
elements.property(elements.JWARD_PT_N2, "AirLoss", 0.99)
635
elements.property(elements.JWARD_PT_N2, "AirDrag", 0.01)
636
elements.property(elements.JWARD_PT_N2, "Advection", 2.0)
637
elements.property(elements.JWARD_PT_N2, "Weight", 0)
638
elements.property(elements.JWARD_PT_N2, "Diffusion", 2.75)
639
elements.property(elements.JWARD_PT_N2, "State", ST_GAS)
640
elements.property(elements.JWARD_PT_N2, "Properties", elem.TYPE_GAS)
641
elements.property(elements.JWARD_PT_N2, "LowTemperatureTransition", elements.DEFAULT_PT_LN2)
642
elements.property(elements.JWARD_PT_N2, "LowTemperature", 76)
643
elements.property(elements.JWARD_PT_N2, "HeatConduct", 80)
644
function N2(i,x,y,s,n)
645
	if tpt.get_property("tmp", i) == 0 then
646
		tpt.set_property("tmp", 1, i)
647
    end
648
end
649-
		if tpt.get_property("temp", i) >= 77 then
649+
650
651
function LN2(i,x,y,s,nt)
652
	if tpt.get_property("tmp", i) == 1 then
653
		if sim.partProperty(i,'temp') >= 77 then
654-
		if tpt.get_property("temp", i) >= 77 then
654+
655
		end
656
	end
657
	if tpt.get_property("tmp", i) == 0 then
658
		if sim.partProperty(i,'temp') >= 77 then
659
			tpt.set_property("type","none",i)
660
		end
661
	end
662
end
663
tpt.element_func(LN2, tpt.element('ln2'))
664
665
elements.element(elements.JWARD_PT_ANFO, elements.element(elements.DEFAULT_PT_BCOL))
666
elements.property(elements.JWARD_PT_ANFO, "Name", "ANFO")
667
elements.property(elements.JWARD_PT_ANFO, "Description", "anfo explosive")
668
elements.property(elements.JWARD_PT_ANFO, "Colour", 0xFFCECA)
669
elements.property(elements.JWARD_PT_ANFO, "MenuSection", 5)
670
elements.property(elements.JWARD_PT_ANFO, "Gravity", 0.54)
671
elements.property(elements.JWARD_PT_ANFO, "Flammable", 0)
672
elements.property(elements.JWARD_PT_ANFO, "Explosive", 0)
673
elements.property(elements.JWARD_PT_ANFO, "Loss", 0)
674
elements.property(elements.JWARD_PT_ANFO, "AirLoss", 0.96)
675
elements.property(elements.JWARD_PT_ANFO, "AirDrag", 0.03)
676
elements.property(elements.JWARD_PT_ANFO, "Advection", 0)
677
elements.property(elements.JWARD_PT_ANFO, "Weight", 75)
678
elements.property(elements.JWARD_PT_ANFO, "Diffusion", 0)
679
elements.property(elements.JWARD_PT_ANFO, "Falldown", 1)
680
elements.property(elements.JWARD_PT_ANFO, "Hardness", 0)
681
elements.property(elements.JWARD_PT_ANFO, "HeatConduct", 62)
682
elements.property(elements.JWARD_PT_ANFO, "Properties", elem.TYPE_PART+elem.PROP_DEADLY)
683
elements.property(elements.JWARD_PT_ANFO, "State", ST_SOLID)
684-
	local atemp = tpt.get_property("temp",x,y)
684+
685
	local cx = math.random(-1,1)
686
	local reaction = tpt.get_property("type",x+cx,y+math.random(-1,1))
687
	local atemp = sim.partProperty(i,'temp')
688
	if reaction == tpt.el.acid.id then
689
		if crack == 1 then
690
			sim.partChangeType(i, tpt.element('salt'))
691
		else
692
			sim.partChangeType(i, tpt.element('acid'))
693
		end
694
	end
695
	if reaction == tpt.el.fire.id then
696
		if cx == 1 then
697
			sim.partChangeType(i, tpt.element('hygn'))
698
			sim.pressure((x/4),(y/4), 250)
699
		elseif cx == 0 then
700
			sim.partChangeType(i, tpt.element('oxyg'))
701
			sim.pressure((x/4),(y/4), 250)
702
		elseif cx == -1 then
703
			sim.partChangeType(i, tpt.element('N2O'))
704
		end
705
	end
706
	if atemp > 483.15 then
707
		if crack == 1 then
708
			sim.partChangeType(i, tpt.element('wtrv'))
709
		else
710-
	if reaction == tpt.element('oxyg') then
710+
711-
		if cal == catalyst then
711+
712-
			sim.partChangeType(i, tpt.element('n2o4'))
712+
713
end
714
tpt.element_func(ANFO, tpt.element('ANFO'))
715
716
--extra
717
local solidhydrogen = elements.allocate("JWARD", "SHYG")
718
local liquidhydrogen = elements.allocate("JWARD", "LHYG")
719
local propane = elements.allocate("JWARD", "PRPN")
720
local Glycerol = elements.allocate("JWARD", "GLCR")
721
722
elements.element(elements.JWARD_PT_SHYG, elements.element(elements.DEFAULT_PT_ACEL))
723
elements.property(elements.JWARD_PT_SHYG, "Colour", 0x7395FE)
724-
elements.element(elements.JWARD_PT_SHYG, elements.element(elements.DEFAULT_PT_DMND))
724+
725
elements.property(elements.JWARD_PT_SHYG, "Description", "solid hydrogen")
726
elements.property(elements.JWARD_PT_SHYG, "HeatConduct", 83)
727
elements.property(elements.JWARD_PT_SHYG, "Flammable", 0)
728
elements.property(elements.JWARD_PT_SHYG, "Temperature", 10.15)
729
elements.property(elements.JWARD_PT_SHYG, "MenuSection", 9)
730
function SHYG(i,x,y)
731-
elements.property(elements.JWARD_PT_SHYG, "HighTemperature", 13.15)
731+
	local dis = sim.partProperty(i,'temp')
732-
elements.property(elements.JWARD_PT_SHYG, "HighTemperatureTransition", elements.JWARD_PT_LHYG)
732+
733
		sim.partChangeType(i, tpt.element('HYGN'))
734-
function SHYG(i,x,y,s,n)
734+
735-
	local dis = tpt.get_property('temp', x, y)
735+
736
	end
737
	if sim.pressure((x/4),(y/4)) > 255 then
738
		sim.partChangeType(i, tpt.element('Metl'))
739
		tpt.set_property("ctype",tpt.element('SHYG'),i)
740
	end
741
end
742
tpt.element_func(SHYG,solidhydrogen)
743
744
elements.element(elements.JWARD_PT_LHYG, elements.element(elements.DEFAULT_PT_GEL))
745
elements.property(elements.JWARD_PT_LHYG, "Colour", 0x5070FF)
746
elements.property(elements.JWARD_PT_LHYG, "Name", "LHYG")
747
elements.property(elements.JWARD_PT_LHYG, "Description", "liquid hydrogen")
748
elements.property(elements.JWARD_PT_LHYG, "HeatConduct", 83)
749
elements.property(elements.JWARD_PT_LHYG, "Flammable", 2)
750
elements.property(elements.JWARD_PT_LHYG, "Temperature", 15.15)
751
elements.property(elements.JWARD_PT_LHYG, "HighTemperature", 20.15)
752
elements.property(elements.JWARD_PT_LHYG, "HighTemperatureTransition", elements.DEFAULT_PT_HYGN)
753
elements.property(elements.JWARD_PT_LHYG, "LowTemperature", 13.15)
754
elements.property(elements.JWARD_PT_LHYG, "LowTemperatureTransition", elements.JWARD_PT_SHYG)
755
756
elements.element(elements.JWARD_PT_GLCR, elements.element(elements.DEFAULT_PT_BCOL))
757
elements.property(elements.JWARD_PT_GLCR, "Name", "GLCR")
758
elements.property(elements.JWARD_PT_GLCR, "Description", "Glycerol, mix with acid to make nitr")
759
elements.property(elements.JWARD_PT_GLCR, "Colour", 0xE1E1E1)
760
elements.property(elements.JWARD_PT_GLCR, "MenuSection", 7)
761
elements.property(elements.JWARD_PT_GLCR, "Gravity", 0.94)
762
elements.property(elements.JWARD_PT_GLCR, "Flammable", 0)
763
elements.property(elements.JWARD_PT_GLCR, "Explosive", 0)
764
elements.property(elements.JWARD_PT_GLCR, "Loss", 0)
765
elements.property(elements.JWARD_PT_GLCR, "AirLoss", 0.96)
766
elements.property(elements.JWARD_PT_GLCR, "AirDrag", 0.04)
767
elements.property(elements.JWARD_PT_GLCR, "Advection", 0)
768
elements.property(elements.JWARD_PT_GLCR, "Weight", 75)
769
elements.property(elements.JWARD_PT_GLCR, "Diffusion", 0)
770
elements.property(elements.JWARD_PT_GLCR, "Falldown", 2)
771
elements.property(elements.JWARD_PT_GLCR, "Hardness", 0)
772
elements.property(elements.JWARD_PT_GLCR, "HeatConduct", 72)
773
elements.property(elements.JWARD_PT_GLCR, "Properties", elem.TYPE_LIQUID)
774
elements.property(elements.JWARD_PT_GLCR, "State", ST_LIQUID)
775
function GLCR(i,x,y,s,n)
776
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
777
	local dis = sim.partProperty(i,'temp')
778
	if reaction == tpt.element('fire') and dis > 373.15 then
779
		sim.partChangeType(i, tpt.element('fire'))
780
	end
781-
	local dis = tpt.get_property('temp', x, y)
781+
782
		tpt.set_property('vy', 0, x, y)
783
		tpt.set_property('vx', math.random(-1,1), x, y)
784
	elseif reaction == tpt.element('ACID') then
785
		sim.partChangeType(i, tpt.element('NITR'))
786
	end
787
end
788
tpt.element_func(GLCR,Glycerol)
789
790
elements.element(elements.JWARD_PT_PRPN, elements.element(elements.DEFAULT_PT_HYGN))
791
elements.property(elements.JWARD_PT_PRPN, "Name", "PRPN")
792
elements.property(elements.JWARD_PT_PRPN, "Description", "Propane. Explodes very easily.")
793
elements.property(elements.JWARD_PT_PRPN, "Colour", 0xF4A26A)
794-
elements.element(elements.JWARD_PT_PRPN, elements.element(elements.DEFAULT_PT_CO2))
794+
795
elements.property(elements.JWARD_PT_PRPN, "Gravity", -0.02)
796
elements.property(elements.JWARD_PT_PRPN, "Flammable", 2500)
797
elements.property(elements.JWARD_PT_PRPN, "Explosive", 1)
798
elements.property(elements.JWARD_PT_PRPN, "Loss", 0.75)
799
elements.property(elements.JWARD_PT_PRPN, "AirLoss", 0.97)
800
elements.property(elements.JWARD_PT_PRPN, "AirDrag", 0.01)
801
elements.property(elements.JWARD_PT_PRPN, "Advection", 1)
802
elements.property(elements.JWARD_PT_PRPN, "Weight", 0)
803
elements.property(elements.JWARD_PT_PRPN, "Diffusion", 0.7)
804
elements.property(elements.JWARD_PT_PRPN, "Meltable", 0)
805
elements.property(elements.JWARD_PT_PRPN, "Hardness", 0)
806
elements.property(elements.JWARD_PT_PRPN, "Falldown", 0)
807
elements.property(elements.JWARD_PT_PRPN, "Properties", TYPE_GAS)
808
elements.property(elements.JWARD_PT_PRPN, "State", ST_GAS)
809
elements.property(elements.JWARD_PT_PRPN, "Temperature", 295.15)
810
elements.property(elements.JWARD_PT_PRPN, "HeatConduct", 95)
811
elements.property(elements.JWARD_PT_PRPN, "HighTemperature", 2379.15)
812
elements.property(elements.JWARD_PT_PRPN, "HighTemperatureTransition", tpt.el.fire.id)
813
elements.property(elements.JWARD_PT_PRPN, "LowTemperatureTransition", NT)
814
function PRPN(i,x,y,s,n)
815
	local warm = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
816
	local warm2 = sim.partProperty(i,'temp')
817
	if warm == tpt.el.acid.id or warm == tpt.el.caus.id then
818
		sim.partChangeType(i, tpt.element('ptrl'))
819
		tpt.set_property('temp', (warm2 + 1), x, y)
820
	end
821
	if warm == tpt.el.wtrv.id and warm2 > 1100 then
822
		sim.partChangeType(i, tpt.element('co2'))
823
	end
824
end
825
tpt.element_func(PRPN,propane)
826
827
--kerosene
828
local KEROSENEGAS = elements.allocate("JWARD", "KERV")
829
local KEROSENE = elements.allocate("JWARD", "KERO")
830
elements.element(elements.JWARD_PT_KERO, elements.element(elements.DEFAULT_PT_GEL))
831
elements.property(elements.JWARD_PT_KERO, "Name", "KERO")
832
elements.property(elements.JWARD_PT_KERO, "Description", "KERO BURNS HOT AND QUICK")
833
elements.property(elements.JWARD_PT_KERO, "Colour", 0x01B3D7)
834
elements.property(elements.JWARD_PT_KERO, "MenuSection", 5)
835
elements.property(elements.JWARD_PT_KERO, "Gravity", .04)
836
elements.property(elements.JWARD_PT_KERO, "Flammable", 0)
837
elements.property(elements.JWARD_PT_KERO, "Explosive", 0)
838
elements.property(elements.JWARD_PT_KERO, "Loss", 1)
839
elements.property(elements.JWARD_PT_KERO, "AirLoss", .90)
840
elements.property(elements.JWARD_PT_KERO, "AirDrag", .01)
841
elements.property(elements.JWARD_PT_KERO, "Advection", .80)
842
elements.property(elements.JWARD_PT_KERO, "Weight", 5)
843
elements.property(elements.JWARD_PT_KERO, "State", ST_liquid)
844
elements.property(elements.JWARD_PT_KERO, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
845
elements.property(elements.JWARD_PT_KERO, "HighTemperature", 393.15)
846
elements.property(elements.JWARD_PT_KERO, "HighTemperatureTransition", elements.JWARD_PT_KERV)
847
function KERO(i,x,y,s,n)
848
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
849
	local cal = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
850
	if cal == tpt.element('acel') and reaction == petrol then
851
		sim.partChangeType(i, tpt.element('JETB'))
852
	end
853
end
854
tpt.element_func(KERO,KEROSENE)
855
856
elements.element(elements.JWARD_PT_KERV, elements.element(elements.DEFAULT_PT_HYGN))
857
elements.property(elements.JWARD_PT_KERV, "Name", "KERV")
858
elements.property(elements.JWARD_PT_KERV, "Description", "kerosene gas")
859
elements.property(elements.JWARD_PT_KERV, "Colour", 0x01B3D7)
860
elements.property(elements.JWARD_PT_KERV, "MenuVisible", 0)
861
elements.property(elements.JWARD_PT_KERV, "Gravity", -0.02)
862
elements.property(elements.JWARD_PT_KERV, "Flammable", 4500)
863
elements.property(elements.JWARD_PT_KERV, "Explosive", 1)
864
elements.property(elements.JWARD_PT_KERV, "Loss", 0.75)
865
elements.property(elements.JWARD_PT_KERV, "AirLoss", 0.97)
866
elements.property(elements.JWARD_PT_KERV, "AirDrag", 0.01)
867
elements.property(elements.JWARD_PT_KERV, "Advection", 1)
868
elements.property(elements.JWARD_PT_KERV, "Weight", 0)
869
elements.property(elements.JWARD_PT_KERV, "Diffusion", 0.7)
870
elements.property(elements.JWARD_PT_KERV, "Meltable", 0)
871
elements.property(elements.JWARD_PT_KERV, "Hardness", 0)
872
elements.property(elements.JWARD_PT_KERV, "Falldown", 0)
873
elements.property(elements.JWARD_PT_KERV, "Properties", TYPE_GAS)
874
elements.property(elements.JWARD_PT_KERV, "State", ST_GAS)
875
elements.property(elements.JWARD_PT_KERV, "Temperature", 403.15)
876
elements.property(elements.JWARD_PT_KERV, "HeatConduct", 195)
877
elements.property(elements.JWARD_PT_KERV, "LowTemperature", 393.15)
878
elements.property(elements.JWARD_PT_KERV, "LowTemperatureTransition", elements.JWARD_PT_KERO)
879
function KERV(i,x,y,s,n)
880
end
881
tpt.element_func(KERV,KEROSENEGAS)
882
883
--jetfuel
884
local JETFUEL = elements.allocate("JWARD", "JETB")
885
elements.element(elements.JWARD_PT_JETB, elements.element(elements.DEFAULT_PT_GEL))
886
elements.property(elements.JWARD_PT_JETB, "Name", "JETB")
887
elements.property(elements.JWARD_PT_JETB, "Description", "Jet type b, fuel-blend of Kero and Ptrl for jet engines")
888
elements.property(elements.JWARD_PT_JETB, "Colour", 0x676601)
889
elements.property(elements.JWARD_PT_JETB, "MenuSection", 5)
890
elements.property(elements.JWARD_PT_JETB, "Gravity", .04)
891
elements.property(elements.JWARD_PT_JETB, "Flammable", 5000)
892
elements.property(elements.JWARD_PT_JETB, "Explosive", 1)
893
elements.property(elements.JWARD_PT_JETB, "Loss", 0.8)
894
elements.property(elements.JWARD_PT_JETB, "AirLoss", 0.94)
895
elements.property(elements.JWARD_PT_JETB, "AirDrag", 0.02)
896
elements.property(elements.JWARD_PT_JETB, "Advection", 0.8)
897
elements.property(elements.JWARD_PT_JETB, "HighTemperature", 353.15)
898
elements.property(elements.JWARD_PT_JETB, "Weight", 13)
899
elements.property(elements.JWARD_PT_JETB, "State", ST_liquid)
900
elements.property(elements.JWARD_PT_JETB, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
901
elements.property(elements.JWARD_PT_JETB, "LowTemperature", 225.15)
902
elements.property(elements.JWARD_PT_JETB, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
903
function JETB(i,x,y,s,n)
904
end
905
tpt.element_func(JETB,JETFUEL)
906
907
--tar
908
local TARGAS = elements.allocate("JWARD", "TARV")
909
local TAR = elements.allocate("JWARD", "TAR")
910
elements.element(elements.JWARD_PT_TAR, elements.element(elements.DEFAULT_PT_SOAP))
911
elements.property(elements.JWARD_PT_TAR, "Name", "TAR")
912
elements.property(elements.JWARD_PT_TAR, "Description", "tar hard to burn")
913
elements.property(elements.JWARD_PT_TAR, "Colour", 0x0D0D03)
914
elements.property(elements.JWARD_PT_TAR, "MenuSection", 5)
915
elements.property(elements.JWARD_PT_TAR, "Gravity", .1)
916
elements.property(elements.JWARD_PT_TAR, "Flammable", 1)
917
elements.property(elements.JWARD_PT_TAR, "Explosive", 0)
918
elements.property(elements.JWARD_PT_TAR, "Loss", 1)
919
elements.property(elements.JWARD_PT_TAR, "AirLoss", .5)
920
elements.property(elements.JWARD_PT_TAR, "AirDrag", .01)
921
elements.property(elements.JWARD_PT_TAR, "Advection", .01)
922
elements.property(elements.JWARD_PT_TAR, "Diffusion", 0.01)
923
elements.property(elements.JWARD_PT_TAR, "State", ST_liquid)
924
elements.property(elements.JWARD_PT_TAR, "Weight", 50)
925
elements.property(elements.JWARD_PT_TAR, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
926
elements.property(elements.JWARD_PT_TAR, "HighTemperature", 873.15)
927
elements.property(elements.JWARD_PT_TAR, "HighTemperatureTransition", elements.JWARD_PT_TARV)
928
function TAR(i,x,y,s,n)
929
    local otherfind = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
930
	if buttonable == 1 and otherfind == tpt.el.brel.id then
931
		if ol == 0 then
932
			sim.partChangeType(i, petrol)
933
		elseif ol == 1 then
934
			sim.partChangeType(i, tpt.element('PRPN'))
935
		elseif ol == -1 then
936
			sim.partChangeType(i, tpt.element('CRST'))
937
		end
938
	end
939
end
940
tpt.element_func(TAR,tpt.element('TAR'))
941
942
elements.element(elements.JWARD_PT_TARV, elements.element(elements.DEFAULT_PT_HYGN))
943
elements.property(elements.JWARD_PT_TARV, "Name", "TARV")
944
elements.property(elements.JWARD_PT_TARV, "Description", "tar gas")
945
elements.property(elements.JWARD_PT_TARV, "Colour", 0x4C2D20)
946
elements.property(elements.JWARD_PT_TARV, "MenuVisible", 0)
947
elements.property(elements.JWARD_PT_TARV, "Gravity", -0.02)
948
elements.property(elements.JWARD_PT_TARV, "Flammable", 100)
949
elements.property(elements.JWARD_PT_TARV, "Explosive", 0)
950
elements.property(elements.JWARD_PT_TARV, "Loss", 0.75)
951
elements.property(elements.JWARD_PT_TARV, "AirLoss", 0.97)
952
elements.property(elements.JWARD_PT_TARV, "AirDrag", 0.01)
953
elements.property(elements.JWARD_PT_TARV, "Advection", 1)
954
elements.property(elements.JWARD_PT_TARV, "Weight", 0)
955
elements.property(elements.JWARD_PT_TARV, "Diffusion", 0.7)
956
elements.property(elements.JWARD_PT_TARV, "Meltable", 0)
957
elements.property(elements.JWARD_PT_TARV, "Hardness", 0)
958
elements.property(elements.JWARD_PT_TARV, "Falldown", 0)
959
elements.property(elements.JWARD_PT_TARV, "Properties", TYPE_GAS)
960
elements.property(elements.JWARD_PT_TARV, "State", ST_GAS)
961
elements.property(elements.JWARD_PT_TARV, "Temperature", 403.15)
962
elements.property(elements.JWARD_PT_TARV, "HeatConduct", 195)
963
elements.property(elements.JWARD_PT_TARV, "LowTemperature", 873.15)
964
elements.property(elements.JWARD_PT_TARV, "LowTemperatureTransition", elements.JWARD_PT_TAR)
965
966
--wax
967
local WAXGAS = elements.allocate("JWARD", "WAXV")
968
elements.element(elements.JWARD_PT_WAXV, elements.element(elements.DEFAULT_PT_HYGN))
969
elements.property(elements.JWARD_PT_WAXV, "Name", "WAXV")
970
elements.property(elements.JWARD_PT_WAXV, "Description", "wax gas")
971
elements.property(elements.JWARD_PT_WAXV, "Colour", 0xF0F0BB)
972
elements.property(elements.JWARD_PT_WAXV, "MenuSection", SC_GAS)
973
elements.property(elements.JWARD_PT_WAXV, "Gravity", -0.02)
974
elements.property(elements.JWARD_PT_WAXV, "Flammable", 500)
975
elements.property(elements.JWARD_PT_WAXV, "Explosive", 0)
976
elements.property(elements.JWARD_PT_WAXV, "Loss", 0.75)
977
elements.property(elements.JWARD_PT_WAXV, "AirLoss", 0.97)
978
elements.property(elements.JWARD_PT_WAXV, "AirDrag", 0.01)
979
elements.property(elements.JWARD_PT_WAXV, "Advection", 1)
980
elements.property(elements.JWARD_PT_WAXV, "Weight", 0)
981
elements.property(elements.JWARD_PT_WAXV, "Diffusion", 0.7)
982
elements.property(elements.JWARD_PT_WAXV, "Meltable", 0)
983
elements.property(elements.JWARD_PT_WAXV, "Hardness", 0)
984
elements.property(elements.JWARD_PT_WAXV, "Falldown", 0)
985
elements.property(elements.JWARD_PT_WAXV, "Properties", TYPE_GAS)
986
elements.property(elements.JWARD_PT_WAXV, "State", ST_GAS)
987
elements.property(elements.JWARD_PT_WAXV, "Temperature", 833.15)
988
elements.property(elements.JWARD_PT_WAXV, "HeatConduct", 195)
989
elements.property(elements.JWARD_PT_WAXV, "LowTemperature", 823.15)
990
elements.property(elements.JWARD_PT_WAXV, "LowTemperatureTransition", elements.DEFAULT_PT_WAX)
991
992
--coke
993
local CoalCoke = elements.allocate("JWARD", "COKE")
994
elements.element(elements.JWARD_PT_COKE, elements.element(elements.DEFAULT_PT_BCOL))
995
elements.property(elements.JWARD_PT_COKE, "Name", "COKE")
996
elements.property(elements.JWARD_PT_COKE, "Description", "COAL COKE. Burns for a long time and hot.")
997
elements.property(elements.JWARD_PT_COKE, "Colour", 0xAAAAAA)
998
elements.property(elements.JWARD_PT_COKE, "MenuSection", 5)
999
elements.property(elements.JWARD_PT_COKE, "Gravity", .35)
1000
elements.property(elements.JWARD_PT_COKE, "Flammable", 0)
1001
elements.property(elements.JWARD_PT_COKE, "Explosive", 0)
1002
elements.property(elements.JWARD_PT_COKE, "Loss", 0.15)
1003
elements.property(elements.JWARD_PT_COKE, "AirLoss", 0.96)
1004
elements.property(elements.JWARD_PT_COKE, "AirDrag", 0.03)
1005
elements.property(elements.JWARD_PT_COKE, "Advection", 0.4)
1006
elements.property(elements.JWARD_PT_COKE, "Weight", 78)
1007
elements.property(elements.JWARD_PT_COKE, "Falldown", 1)
1008
COKEUpdate = function(i, x, y, s, n)
1009
	local function ignore(i,x,y)
1010
		local clife = sim.partProperty(i,'life')
1011
			if buttonable == 1 then
1012
				local ry = math.random(-1,1)
1013-
	local clife = tpt.get_property('life', x, y)
1013+
				local reactionc = tpt.get_property("ctype",x+ol,y+ry)
1014
				local reaction = tpt.get_property("type",x+ol,y+ry)
1015-
		if buttonable == 1 then
1015+
				if reaction == tpt.element('lava') and reactionc == tpt.element('iron') then
1016-
			local ry = math.random(-1,1)
1016+
					sim.partChangeType(i, tpt.element('metl'))
1017-
			local reactionc = tpt.get_property("ctype",x+ol,y+ry)
1017+
1018-
			local reaction = tpt.get_property("type",x+ol,y+ry)
1018+
1019-
			if reaction == tpt.element('lava') and reactionc == tpt.element('iron') then
1019+
		if clife > 1 then
1020-
				sim.partChangeType(i, tpt.element('metl'))
1020+
			for cx = -1, 1, 2 do
1021
				for cy = -1, 1, 2 do
1022
					tpt.create(x + cx, y + cy, 'fire')
1023
					tpt.set_property('temp', 1700, x, y)
1024
				end
1025
			end
1026
			tpt.set_property('life', clife - 1, x, y)
1027
		elseif clife == 1 then
1028-
				tpt.create(x + cx, y + cy, 'fire')
1028+
			tpt.set_property('type', 0, x, y)
1029-
				tpt.set_property('temp', 1700, x, y)
1029+
		elseif s > 0 then
1030
			for cx = -1, 1, 2 do
1031
				for cy = -1, 1, 2 do
1032
					if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
1033
						tpt.set_property('life', 500, x, y)
1034
						return true
1035
					end
1036
				end
1037
			end
1038
		end
1039
	end
1040
	pcall(ignore, i, x, y)
1041
end
1042
tpt.element_func(COKEUpdate, tpt.element('coke'))
1043
1044
COALUpdate = function(i, x, y, s, n)
1045
	local dis = sim.partProperty(i,'temp')
1046
	if dis > 1273.15 then
1047
		if buttonable == 1 or buttonablest == 0 then
1048
			sim.partChangeType(i, tpt.element('coke'))
1049-
	local dis = tpt.get_property('temp', x, y)
1049+
1050
			tpt.create(x, y + 1, 'CRTV')
1051
			tpt.create(x, y - 1, 'TARV')
1052
		end
1053
	end
1054
end
1055
tpt.element_func(COALUpdate, tpt.element('coal'))
1056
1057
BCOLUpdate = function(i, x, y, s, n)
1058
	local dis = sim.partProperty(i,'temp')
1059
	if dis > 1273.15 then
1060
		if buttonable == 1 or buttonablest == 0 then
1061
			sim.partChangeType(i, tpt.element('coke'))
1062-
	local dis = tpt.get_property('temp', x, y)
1062+
1063
			tpt.create(x, y + 1, 'CRTV')
1064
			tpt.create(x, y - 1, 'TARV')
1065
		end
1066
	end
1067
end
1068
tpt.element_func(BCOLUpdate, tpt.element('bcol'))
1069
1070
1071
local CreosoteGas = elements.allocate("JWARD", "CRTV")
1072
elements.element(elements.JWARD_PT_CRTV, elements.element(elements.DEFAULT_PT_BOYL))
1073
elements.property(elements.JWARD_PT_CRTV, "Name", "CRTV")
1074
elements.property(elements.JWARD_PT_CRTV, "Description", "creosote gas")
1075
elements.property(elements.JWARD_PT_CRTV, "Colour", 0x585117)
1076
elements.property(elements.JWARD_PT_CRTV, "MenuVisible", 0)
1077
elements.property(elements.JWARD_PT_CRTV, "Gravity", -0.02)
1078
elements.property(elements.JWARD_PT_CRTV, "Explosive", 0)
1079
elements.property(elements.JWARD_PT_CRTV, "Loss", 0.75)
1080
elements.property(elements.JWARD_PT_CRTV, "Flammable", 100)
1081
elements.property(elements.JWARD_PT_CRTV, "AirDrag", 0.01)
1082
elements.property(elements.JWARD_PT_CRTV, "Advection", 1)
1083
elements.property(elements.JWARD_PT_CRTV, "Weight", 0)
1084
elements.property(elements.JWARD_PT_CRTV, "Diffusion", 0.7)
1085
elements.property(elements.JWARD_PT_CRTV, "Hardness", 0)
1086
elements.property(elements.JWARD_PT_CRTV, "Falldown", 0)
1087
elements.property(elements.JWARD_PT_CRTV, "Properties", elem.TYPE_GAS)
1088
elements.property(elements.JWARD_PT_CRTV, "State", ST_GAS)
1089
elements.property(elements.JWARD_PT_CRTV, "Temperature", 883.15)
1090
elements.property(elements.JWARD_PT_CRTV, "HeatConduct", 81)
1091
function CRTV(i,x,y,s,n)
1092
	dis = sim.partProperty(i,'temp')
1093
	if dis < 873.15 then
1094
		sim.partChangeType(i, tpt.element('CRST'))
1095
	end
1096-
	dis = tpt.get_property('temp', x, y)
1096+
1097
tpt.element_func(CRTV,CreosoteGas)
1098
1099
local Creosote = elements.allocate("JWARD", "CRST")
1100
elements.element(elements.JWARD_PT_CRST, elements.element(elements.DEFAULT_PT_SOAP))
1101
elements.property(elements.JWARD_PT_CRST, "Name", "CRST")
1102
elements.property(elements.JWARD_PT_CRST, "Description", "creosote ")
1103
elements.property(elements.JWARD_PT_CRST, "Colour", 0x0F0E04)
1104
elements.property(elements.JWARD_PT_CRST, "MenuSection", SC_LIQUID)
1105
elements.property(elements.JWARD_PT_CRST, "Gravity", .04)
1106
elements.property(elements.JWARD_PT_CRST, "Flammable", 0)
1107
elements.property(elements.JWARD_PT_CRST, "Explosive", 0)
1108
elements.property(elements.JWARD_PT_CRST, "Loss", 1)
1109
elements.property(elements.JWARD_PT_CRST, "AirLoss", .5)
1110
elements.property(elements.JWARD_PT_CRST, "AirDrag", .01)
1111
elements.property(elements.JWARD_PT_CRST, "Advection", .01)
1112
elements.property(elements.JWARD_PT_CRST, "Weight", 35)
1113
elements.property(elements.JWARD_PT_CRST, "State", ST_liquid)
1114
elements.property(elements.JWARD_PT_CRST, "Properties", elem.TYPE_LIQUID)
1115
elements.property(elements.JWARD_PT_CRST, "HighTemperature", 873)
1116
elements.property(elements.JWARD_PT_CRST, "HighTemperatureTransition", elements.JWARD_PT_CRTV)
1117
1118
1119
--crude oil 
1120
function OIL(i,x,y,s,n)
1121
    local otherfind = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
1122
	if buttonable == 1 and otherfind == tpt.el.brel.id then
1123
		if crack == 0 then
1124
			sim.partChangeType(i, petrol)
1125
		else
1126
			sim.partChangeType(i, tpt.element('PRPN'))
1127
		end
1128
	end
1129
end
1130
tpt.element_func(OIL,tpt.element('oil'))
1131
1132
local OILCRUDE = elements.allocate("JWARD", "OILC")
1133
elements.element(elements.JWARD_PT_OILC, elements.element(elements.DEFAULT_PT_GEL))
1134
elements.property(elements.JWARD_PT_OILC, "Name", "OILC")
1135
elements.property(elements.JWARD_PT_OILC, "Description", "Crude oil can be distilled, didn't name it coil for a reason")
1136
elements.property(elements.JWARD_PT_OILC, "Colour", 0x35350D)
1137
elements.property(elements.JWARD_PT_OILC, "MenuSection", 7)
1138
elements.property(elements.JWARD_PT_OILC, "Gravity", .04)
1139
elements.property(elements.JWARD_PT_OILC, "Flammable", 50)
1140
elements.property(elements.JWARD_PT_OILC, "Explosive", 0)
1141
elements.property(elements.JWARD_PT_OILC, "Loss", 1)
1142
elements.property(elements.JWARD_PT_OILC, "AirLoss", .5)
1143
elements.property(elements.JWARD_PT_OILC, "AirDrag", .01)
1144
elements.property(elements.JWARD_PT_OILC, "Advection", .01)
1145
elements.property(elements.JWARD_PT_OILC, "Weight", 5)
1146
elements.property(elements.JWARD_PT_OILC, "State", ST_liquid)
1147
elements.property(elements.JWARD_PT_OILC, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
1148
function OILC(i,x,y,s,n)
1149
	local dis = sim.partProperty(i,'temp')
1150
	if dis > 973.15 then
1151
		tpt.set_property('tmp', math.random(1,9), x, y)
1152
	end
1153-
	local dis = tpt.get_property('temp', x, y)
1153+
	local oillife = sim.partProperty(i,'tmp')
1154
	if oillife == 9 then
1155
		sim.partChangeType(i, tpt.element('crtv'))
1156
		oillife = nil
1157-
	local oillife = tpt.get_property('tmp', x, y)
1157+
1158
		sim.partChangeType(i, tpt.element('gas'))
1159
		oillife = nil
1160
	elseif oillife == 7 then
1161
		sim.partChangeType(i, tpt.element('kerv'))
1162
		oillife = nil
1163
	elseif oillife == 6 then
1164
		sim.partChangeType(i, tpt.element('ptlv'))
1165
		oillife = nil
1166
	elseif oillife == 5 then
1167
		sim.partChangeType(i, tpt.element('dslv'))
1168
		oillife = nil
1169
	elseif oillife == 4 then
1170
		sim.partChangeType(i, tpt.element('waxv'))
1171
		oillife = nil
1172
	elseif oillife == 3 then
1173
		sim.partChangeType(i, tpt.element('coke'))
1174
		oillife = nil
1175
	elseif oillife == 2 then
1176
		sim.partChangeType(i, tpt.element('tarv'))
1177
		oillife = nil
1178
	elseif oillife == 1 then
1179
		sim.partChangeType(i, tpt.element('PRPN'))
1180
		oillife = nil
1181
	end
1182
end
1183
tpt.element_func(OILC,OILCRUDE)
1184
1185
--better states of matter
1186
function BSM(i,x,y,s,n)
1187
	local stctype = sim.partProperty(i,'ctype')
1188
	local sttemp = sim.partProperty(i,'temp')
1189
	if stctype == tpt.element('nble') and sttemp > 1 then
1190
		sim.partChangeType(i, tpt.el.nble.id)
1191-
	local stctype = tpt.get_property('ctype', x, y)
1191+
1192-
	local sttemp = tpt.get_property('temp', x, y)
1192+
1193
		if stctype == tpt.element('desl') then
1194
			sim.partChangeType(i, tpt.el.desl.id)
1195
		elseif stctype == tpt.element('ptrl') then
1196
			sim.partChangeType(i, tpt.element('ptrl'))
1197
		end
1198
	end
1199
end
1200
tpt.element_func(BSM,tpt.el.ice.id)
1201
1202
LAVAUpdate = function(i, x, y, s, n)
1203
	if buttonable == 1 then
1204
		local dis = sim.partProperty(i,'ctype')
1205
		local dis2 = tpt.get_property('type',x+math.random(-1,1),y+math.random(-1,1))
1206
		if dis2 == tpt.element('coke') and dis == tpt.element('iron') then
1207
			sim.partChangeType(i, tpt.el.metl.id)
1208-
		local dis = tpt.get_property('ctype', x, y)
1208+
1209
	end
1210
end
1211
tpt.element_func(LAVAUpdate, tpt.el.lava.id)
1212
1213
function BSMp(i,x,y,s,n)
1214
	local stctype = sim.partProperty(i,'ctype')
1215
	local sttemp = sim.partProperty(i,'temp')
1216
	if stctype == tpt.element('nble') and sttemp > 1 then
1217
		sim.partChangeType(i, tpt.el.nble.id)
1218-
	local stctype = tpt.get_property('ctype', x, y)
1218+
1219-
	local sttemp = tpt.get_property('temp', x, y)
1219+
1220
		sim.partChangeType(i, tpt.el.desl.id)
1221
	end
1222
	if stctype == tpt.element('ptrl') and sttemp > 225.15 then
1223
		sim.partChangeType(i, tpt.element('ptrl'))
1224
	end
1225
end
1226
tpt.element_func(BSMp,tpt.el.snow.id)
1227
1228
function BSMM(i,x,y,s,n)
1229
	local stctype = sim.partProperty(i,'ctype')
1230
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
1231
	local randomval = math.random(0,20)
1232
	if reaction == tpt.el.acid.id then
1233-
	local stctype = tpt.get_property('ctype', x, y)
1233+
1234
			sim.partChangeType(i, tpt.element('SLTW'))
1235
		elseif randomval == 0 then
1236
			sim.partChangeType(i, tpt.element('hygn'))
1237
		end
1238
	end
1239
	if stctype == tpt.element('merc') and tpt.get_property('temp', x, y) > 234 then
1240
		sim.partChangeType(i, tpt.el.merc.id)
1241
		tpt.set_property('tmp', 22, x, y)
1242
	end
1243
	if stctype == tpt.element('SHYG') and sim.pressure((x/4),(y/4)) < 255 then
1244
		sim.partChangeType(i, tpt.element('SHYG'))
1245
	end
1246
end
1247
tpt.element_func(BSMM,tpt.el.metl.id)
1248
1249
function BSMMY(i,x,y,s,n)
1250
	local sttemp = sim.partProperty(i,'temp')
1251
	if buttonablest == 0 and sttemp < 234 then
1252
		sim.partChangeType(i, tpt.el.metl.id)
1253
		tpt.set_property('ctype', tpt.el.merc.id, x, y)
1254-
	local sttemp = tpt.get_property('temp', x, y)
1254+
1255
end
1256
tpt.element_func(BSMMY,tpt.el.merc.id)
1257
1258
function BSMWT(i,x,y,s,n)
1259
	local stctype = sim.partProperty(i,'ctype')
1260
	local sttemp = sim.partProperty(i,'temp')
1261
	local reaction = tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
1262
	local cy = math.random(1,3)
1263-
	local stctype = tpt.get_property('ctype', x, y)
1263+
1264-
	local sttemp = tpt.get_property('temp', x, y)
1264+
1265
	end
1266
	if sttemp > 1100 then
1267
		if reaction == tpt.element('KERV') or reaction == tpt.element('WAXV') or reaction == tpt.element('DSLV') or reaction == tpt.element('PTLV') then
1268
			if cy == 1 then
1269
				sim.partChangeType(i, tpt.element('HYGN'))
1270
			else
1271
				sim.partChangeType(i, tpt.element('CO2'))
1272
			end
1273
		end
1274
		if reaction == tpt.element('PRPN') or reaction == tpt.element('AFRZ') then
1275
			sim.partChangeType(i, tpt.element('HYGN'))
1276
		end
1277
	end
1278
end
1279
tpt.element_func(BSMWT,tpt.el.wtrv.id)
1280
1281
function BSMDWT(i,x,y,s,n)
1282
	local stctype = sim.partProperty(i,'ctype')
1283
	if stctype == tpt.element('deut') then
1284
		sim.partChangeType(i, tpt.el.deut.id)
1285
	end
1286-
	local stctype = tpt.get_property('ctype', x, y)
1286+
1287
tpt.element_func(BSMDWT,tpt.el.dstw.id)
1288
1289
function BSMDT(i,x,y,s,n)
1290
	local function ignore(i,x,y)
1291
		local sttemp = sim.partProperty(i,'temp')
1292
		if buttonablest == 0 and sttemp > 376 then
1293
			sim.partChangeType(i, tpt.el.wtrv.id)
1294
			tpt.set_property('ctype', tpt.el.deut.id, x, y)
1295-
		local sttemp = tpt.get_property('temp', x, y)
1295+
1296
	end
1297
	pcall(ignore, i, x, y)
1298
end
1299
tpt.element_func(BSMDT,tpt.el.deut.id)
1300
1301
function BSMP(i,x,y,s,n)
1302
	local sttemp = sim.partProperty(i,'temp')
1303
	local BSMchance
1304
	if buttonablest == 0 and sttemp < 260 then
1305
		BSMchance = math.random(1,3)
1306-
	local sttemp = tpt.get_property('temp', x, y)
1306+
1307
		BSMchance = 0
1308
	end
1309
	if BSMchance == 1 then
1310
		sim.partChangeType(i, tpt.el.clst.id)
1311
	elseif BSMchance == 2 then
1312
		sim.partChangeType(i, tpt.el.ice.id)
1313
		tpt.set_property('ctype', tpt.el.pste.id, x, y)
1314
	elseif BSMchance == 3 then
1315
		sim.partChangeType(i, tpt.el.ice.id)
1316
		tpt.set_property('ctype', tpt.el.watr.id, x, y)
1317
	end
1318
end
1319
tpt.element_func(BSMP,tpt.el.pste.id)
1320
1321
--button
1322
--http://powdertoy.co.uk/Wiki/W/Lua.html
1323
topress = 0
1324
local thx = 0
1325
1326
function tick()
1327
	crack = math.random(0,1)
1328
	ol = math.random(-1,1)
1329
	if nil == HL2Mod then
1330
		--thanks message
1331
		if thx == 1 then
1332
			tpt.message_box("thanks "..tpt.get_name().." for your purchase, ","construction or theft of one or more of jward's mods")
1333
			thx = 0
1334
		end	
1335
		--check for other mods so JW icon can move to alt spot
1336
		if tpt.version.jacob1s_mod or elem.DEFAULT_PT_IRNX == 181 or nil ~= TPTMP then	
1337
			--JW button hide if HUD is off
1338
			if  tpt.hud() == 1 then
1339
				--JW button hide to see info about powder effect
1340
				if  tpt.mousex >= 613 and tpt.mousey >= 1 and tpt.mousex <= 627 and tpt.mousey <= 14 then
1341
				else
1342
					--JW button in alt spot
1343
					tpt.drawrect(597, 1, 14, 14, 204, 204, 204)
1344
					tpt.fillrect(597, 1, 14, 14, 0, 0, 0, 255)
1345
					tpt.drawtext(598, 5, "JW", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1346
					--green line to tell if antisave breaking is on in alt spot
1347
					if buttonable == 0 then
1348
						tpt.drawline(598, 13, 610, 13, 0, 255, 0)
1349
					else
1350
						tpt.drawline(598, 13, 610, 13, 255, 0, 0)
1351
					end
1352
					topress = 1
1353
					--JW icon in alt spot highlight on hover
1354
					if tpt.mousex >= 597 and tpt.mousey >= 1 and tpt.mousex <= 611 and tpt.mousey <= 14 then
1355
						tpt.drawrect(597, 1, 14, 14, 255, 255, 255)
1356
					else
1357
						--dull when lua script manager is open
1358
						if MANAGER ~= nil then
1359
							if MANAGER.hidden == true then
1360
								tpt.fillrect(597, 1, 14, 14, 0, 0, 0, 0)
1361
							else
1362
								tpt.fillrect(597, 1, 14, 14, 0, 0, 0, 90)
1363
								tpt.drawrect(597, 1, 14, 14, 90, 90, 90)
1364
							end 
1365
						end
1366
					end
1367
				end
1368
			end
1369
		else
1370
			--JW icon in normal spot
1371
			tpt.drawrect(613, 113, 14, 14, 204, 204, 204)
1372
			tpt.fillrect(613, 113, 14, 14, 0, 0, 0, 255)
1373
			tpt.drawtext(614, 117, "JW", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1374
			--green line to tell if antisave breaking is on in normal spot
1375
			if buttonable == 0 then
1376
				tpt.drawline(614, 125, 626, 125, 0, 255, 0)
1377
			else
1378
				tpt.drawline(614, 125, 626, 125, 255, 0, 0)
1379
			end
1380
			topress = 2
1381
			--highlight when hover in normal spot
1382
			if tpt.mousex >= 613 and tpt.mousey >= 113 and tpt.mousex <= 627 and tpt.mousey <= 124 then
1383
				tpt.drawrect(613, 113, 14, 14, 255, 255, 255)
1384
				tpt.drawtext(500, 117, "JWARD's Mod options", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1385
			else
1386
				--dull when lua script manager is open
1387
				if MANAGER ~= nil then
1388
					if MANAGER.hidden == true then
1389
						tpt.fillrect(613, 113, 14, 14, 0, 0, 0, 0)
1390
					else
1391
						tpt.fillrect(613, 113, 14, 14, 0, 0, 0, 90)
1392
						tpt.drawrect(613, 113, 14, 14, 90, 90, 90)
1393
					end
1394
				end
1395
			end
1396
		end
1397
		if toopress == 1 then
1398
			--invert shade when JW button is pressed, alt spot
1399
			if topress == 1 then
1400
				tpt.fillrect(596, 0, 16, 16, 255, 255, 255, 255)
1401
				tpt.drawtext(598, 5, "JW", 0, 0, 0, 255)
1402
			end
1403
			--invert shade when JW button is pressed, normal spot
1404
			if topress == 2 then
1405
				tpt.fillrect(612, 112, 16, 16, 255, 255, 255, 255)
1406
				tpt.drawtext(614, 117, "JW", 0, 0, 0, 255)
1407
			end
1408
			--elements menu 
1409
			if items == 1 then
1410
				tpt.fillrect(150, 174, 16, 15, 255, 255, 255, 255)
1411
				tpt.drawline(153, 176, 158, 181, 0, 0, 0)
1412
				tpt.drawline(163, 176, 158, 181, 0, 0, 0)
1413
				tpt.drawline(153, 181, 158, 186, 0, 0, 0)
1414
				tpt.drawline(163, 181, 158, 186, 0, 0, 0)
1415
				tpt.drawrect(0, 205, 600, 175, 255, 255, 255)
1416
				tpt.fillrect(0, 205, 600, 175, 0, 0, 0, 255)
1417
				tpt.drawtext(25, 210, "JWARD's Mods' elements", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1418
				tpt.drawtext(6, 229, "Fuel mod:", 255, 255, 255, 255)
1419
				--close button in elements menu 
1420
				tpt.drawrect(5, 208, 14, 14, 204, 204, 204)
1421
				tpt.drawline(17, 215, 12, 210, 255, 255, 255)
1422
				tpt.drawline(7, 215, 12, 210, 255, 255, 255)
1423
				tpt.drawline(17, 220, 12, 215, 255, 255, 255)
1424
				tpt.drawline(7, 220, 12, 215, 255, 255, 255)
1425
				if  tpt.mousex >= 5 and tpt.mousey >= 208 and tpt.mousex <= 19 and tpt.mousey <= 222 and items == 1 then
1426
					tpt.drawrect(5, 208, 14, 14, 255, 255, 255)
1427
				end
1428
				--anfo
1429
				tpt.fillrect(50, 225, 28, 15, 255, 206, 202, 255)
1430
				tpt.drawtext(52, 229, "ANFO", 0, 0, 0, 255)
1431
				if  tpt.mousex >= 50 and tpt.mousey >= 225 and tpt.mousex <= 78 and tpt.mousey <= 240 and items == 1 then
1432
					tpt.drawrect(49, 224, 30, 17, 255, 0, 0)
1433
				end
1434-
				tpt.drawtext(51, 229, "ANFO", 0, 0, 0, 255)
1434+
1435
					tpt.drawrect(49, 224, 30, 17, 255, 0, 0)
1436
				end
1437
				--PRPN
1438
				tpt.fillrect(83, 225, 28, 15, 244, 162, 106, 255)
1439
				tpt.drawtext(85, 229, "PRPN", 0, 0, 0, 255)
1440
				if  tpt.mousex >= 83 and tpt.mousey >= 225 and tpt.mousex <= 111 and tpt.mousey <= 240 and items == 1 then
1441
					tpt.drawrect(82, 224, 30, 17, 255, 0, 0)
1442
				end
1443
				if redrect == 2 then
1444
					tpt.drawrect(82, 224, 30, 17, 255, 0, 0)
1445
				end
1446
				--COKE
1447
				tpt.fillrect(116, 225, 28, 15, 170, 170, 170, 255)
1448
				tpt.drawtext(118, 229, "COKE", 0, 0, 0, 255)
1449
				if  tpt.mousex >= 116 and tpt.mousey >= 225 and tpt.mousex <= 144 and tpt.mousey <= 240 and items == 1 then
1450
					tpt.drawrect(115, 224, 30, 17, 255, 0, 0)
1451
				end
1452
				if redrect == 3 then
1453
					tpt.drawrect(115, 224, 30, 17, 255, 0, 0)
1454
				end
1455
				--OILC
1456
				tpt.fillrect(149, 225, 28, 15, 53, 53, 13, 255)
1457
				tpt.drawtext(153, 229, "OILC", 255, 255, 255, 255)
1458
				if  tpt.mousex >= 149 and tpt.mousey >= 225 and tpt.mousex <= 177 and tpt.mousey <= 240 and items == 1 then
1459
					tpt.drawrect(148, 224, 30, 17, 255, 0, 0)
1460
				end
1461
				if redrect == 4 then
1462
					tpt.drawrect(148, 224, 30, 17, 255, 0, 0)
1463
				end
1464
				--plye
1465
				tpt.fillrect(182, 225, 28, 15, 204, 204, 204, 255)
1466
				tpt.drawtext(186, 229, "PLYE", 0, 0, 0, 255)
1467
				if  tpt.mousex >= 182 and tpt.mousey >= 225 and tpt.mousex <= 210 and tpt.mousey <= 240 and items == 1 then
1468
					tpt.drawrect(181, 224, 30, 17, 255, 0, 0)
1469
				end
1470
				if redrect == 5 then
1471
					tpt.drawrect(181, 224, 30, 17, 255, 0, 0)
1472
				end
1473
				--JETB	
1474
				tpt.fillrect(215, 225, 28, 15, 103, 102, 1, 255)
1475
				tpt.drawtext(217, 229, "JETB", 255, 255, 255, 255)
1476
				if  tpt.mousex >= 215 and tpt.mousey >= 225 and tpt.mousex <= 243 and tpt.mousey <= 240 and items == 1 then
1477
					tpt.drawrect(214, 224, 30, 17, 255, 0, 0)
1478
				end
1479
				if redrect == 6 then
1480
					tpt.drawrect(214, 224, 30, 17, 255, 0, 0)
1481
				end
1482
				--kerosene
1483
				tpt.fillrect(248, 225, 28, 15, 1, 179, 255, 255)
1484
				tpt.drawtext(250, 229, "KERO", 0, 0, 0, 255)
1485
				if  tpt.mousex >= 248 and tpt.mousey >= 225 and tpt.mousex <= 276 and tpt.mousey <= 240 and items == 1 then
1486
					tpt.drawrect(247, 224, 30, 17, 255, 0, 0)
1487
				end
1488
				if redrect == 7 then
1489
					tpt.drawrect(247, 224, 30, 17, 255, 0, 0)
1490
				end
1491
				--N2H4	
1492
				tpt.fillrect(281, 225, 28, 15, 182, 240, 100, 255)
1493
				tpt.drawtext(283, 229, "N2H4", 0, 0, 0, 255)
1494
				if  tpt.mousex >= 281 and tpt.mousey >= 225 and tpt.mousex <= 309 and tpt.mousey <= 240 and items == 1 then
1495
					tpt.drawrect(280, 224, 30, 17, 255, 0, 0)
1496
				end
1497
				if redrect == 8 then
1498
					tpt.drawrect(280, 224, 30, 17, 255, 0, 0)
1499
				end
1500
				--N2O4
1501
				tpt.fillrect(314, 225, 28, 15, 48, 206, 198, 255)
1502
				tpt.drawtext(316, 229, "N2O4", 0, 0, 0, 255)
1503
				if  tpt.mousex >= 314 and tpt.mousey >= 225 and tpt.mousex <= 342 and tpt.mousey <= 240 and items == 1 then
1504
					tpt.drawrect(313, 224, 30, 17, 255, 0, 0)
1505
				end
1506
				if redrect == 9 then
1507
					tpt.drawrect(313, 224, 30, 17, 255, 0, 0)
1508
				end	
1509
				--TAR
1510
				tpt.fillrect(347, 225, 28, 15, 13, 13, 3, 255)	
1511
				tpt.drawtext(352, 229, "TAR", 255, 255, 255, 255)
1512
				if  tpt.mousex >= 347 and tpt.mousey >= 225 and tpt.mousex <= 375 and tpt.mousey <= 240 and items == 1 then
1513
					tpt.drawrect(346, 224, 30, 17, 255, 0, 0)
1514
				end
1515
				if redrect == 10 then
1516
					tpt.drawrect(346, 224, 30, 17, 255, 0, 0)
1517
				end
1518
				--AFRZ
1519
				tpt.fillrect(380, 225, 28, 15, 12, 63, 91, 255)
1520
				tpt.drawtext(382, 229, "AFRZ", 255, 255, 255, 255)
1521
				if  tpt.mousex >= 380 and tpt.mousey >= 225 and tpt.mousex <= 408 and tpt.mousey <= 240 and items == 1 then
1522
					tpt.drawrect(379, 224, 30, 17, 255, 0, 0)
1523
				end
1524
				if redrect == 11 then
1525
					tpt.drawrect(379, 224, 30, 17, 255, 0, 0)
1526
				end
1527
				--N2O
1528
				tpt.fillrect(413, 225, 28, 15, 67, 218, 255, 255)
1529
				tpt.drawtext(418, 229, "N2O", 0, 0, 0, 255)
1530
				if  tpt.mousex >= 413 and tpt.mousey >= 225 and tpt.mousex <= 441 and tpt.mousey <= 240 and items == 1 then
1531
					tpt.drawrect(412, 224, 30, 17, 255, 0, 0)
1532
				end
1533
				if redrect == 12 then
1534
					tpt.drawrect(412, 224, 30, 17, 255, 0, 0)
1535
				end
1536
				--N2	
1537
				tpt.fillrect(446, 225, 28, 15, 94, 82, 255, 255)
1538
				tpt.drawtext(454, 229, "N2", 0, 0, 0, 255)
1539
				if  tpt.mousex >= 446 and tpt.mousey >= 225 and tpt.mousex <= 474 and tpt.mousey <= 240 and items == 1 then
1540
					tpt.drawrect(445, 224, 30, 17, 255, 0, 0)
1541
				end
1542
				if redrect == 13 then
1543
					tpt.drawrect(445, 224, 30, 17, 255, 0, 0)
1544
				end
1545
				--PTRL	
1546
				tpt.fillrect(479, 225, 28, 15, 10, 74, 92, 255)
1547
				tpt.drawtext(482, 229, "PTRL", 255, 255, 255, 255)
1548
				if  tpt.mousex >= 479 and tpt.mousey >= 225 and tpt.mousex <= 507 and tpt.mousey <= 240 and items == 1 then
1549
					tpt.drawrect(478, 224, 30, 17, 255, 0, 0)
1550
				end
1551
				if redrect == 14 then
1552
					tpt.drawrect(478, 224, 30, 17, 255, 0, 0)
1553
				end
1554
				--COIL
1555
				tpt.fillrect(512, 225, 28, 15, 165, 114, 20, 255)
1556
				tpt.drawtext(515, 229, "COIL", 0, 0, 0, 255)
1557
				if  tpt.mousex >= 512 and tpt.mousey >= 225 and tpt.mousex <= 540 and tpt.mousey <= 240 and items == 1 then
1558
					tpt.drawrect(511, 224, 30, 17, 255, 0, 0)
1559
				end
1560
				if redrect == 15 then
1561
					tpt.drawrect(511, 224, 30, 17, 255, 0, 0)
1562
				end
1563
				--GLCR
1564
				tpt.fillrect(545, 225, 28, 15, 225, 225, 225, 255)
1565
				tpt.drawtext(548, 229, "GLCR", 0, 0, 0, 255)
1566
				if  tpt.mousex >= 545 and tpt.mousey >= 225 and tpt.mousex <= 573 and tpt.mousey <= 240 and items == 1 then
1567
					tpt.drawrect(544, 224, 30, 17, 255, 0, 0)
1568
				end
1569
				if redrect == 16 then
1570
					tpt.drawrect(544, 224, 30, 17, 255, 0, 0)
1571
				end
1572
				--BDSL
1573
				tpt.fillrect(6, 245, 28, 15, 51, 16, 0, 255)
1574
				tpt.drawtext(8, 249, "BDSL", 255, 255, 255, 255)
1575
				if  tpt.mousex >= 6 and tpt.mousey >= 245 and tpt.mousex <= 34 and tpt.mousey <= 260 and items == 1 then
1576
					tpt.drawrect(5, 244, 30, 17, 255, 0, 0)
1577
				end
1578
				if redrect == 17 then
1579
					tpt.drawrect(5, 244, 30, 17, 255, 0, 0)
1580
				end
1581
				--LN2O
1582
				tpt.fillrect(39, 245, 28, 15, 51, 193, 245, 255)
1583
				tpt.drawtext(41, 249, "LN2O", 0, 0, 0, 255)
1584
				if  tpt.mousex >= 39 and tpt.mousey >= 245 and tpt.mousex <= 67 and tpt.mousey <= 260 and items == 1 then
1585
					tpt.drawrect(38, 244, 30, 17, 255, 0, 0)
1586
				end
1587
				if redrect == 18 then
1588
					tpt.drawrect(38, 244, 30, 17, 255, 0, 0)
1589
				end
1590
				--CRST
1591
				tpt.fillrect(72, 245, 28, 15, 15, 14, 4, 255)
1592
				tpt.drawtext(74, 249, "CRST", 255, 255, 255, 255)
1593
				if  tpt.mousex >= 72 and tpt.mousey >= 245 and tpt.mousex <= 100 and tpt.mousey <= 260 and items == 1 then
1594
					tpt.drawrect(71, 244, 30, 17, 255, 0, 0)
1595
				end
1596
				if redrect == 19 then
1597
					tpt.drawrect(71, 244, 30, 17, 255, 0, 0)
1598
				end
1599
			end
1600
			--mod options menu
1601
			tpt.drawrect(0, 0, 200, 200, 255, 255, 255)
1602
			tpt.fillrect(0, 0, 200, 200, 0, 0, 0, 255)
1603
			tpt.drawtext(10, 5, "JWARD's Mod options "..FuelMod.version, colourRGB[1], colourRGB[2], colourRGB[3], 255)
1604
			--close
1605
			tpt.drawrect(10, 174, 60, 16, 204, 204, 204)
1606
			tpt.drawtext(25, 178, "Close", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1607
			if  tpt.mousex >= 10 and tpt.mousey >= 174 and tpt.mousex <= 70 and tpt.mousey <= 190 then
1608
				tpt.drawrect(10, 174, 60, 16, 255, 255, 255)
1609
			end
1610
			--antisave breaking
1611
			if buttonable == 1 then
1612
				tpt.drawrect(10, 150, 15, 15, 204, 204, 204)
1613
				tpt.drawrect(35, 150, 15, 15, 255, 255, 255)
1614
			else
1615
				tpt.drawrect(35, 150, 15, 15, 204, 204, 204)
1616
				tpt.drawrect(10, 150, 15, 15, 255, 255, 255)
1617
			end
1618
			tpt.drawtext(13, 154, "on", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1619
			tpt.drawtext(37, 154, "off", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1620
			tpt.drawtext(10, 140, "antisave breaking", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1621
			if  tpt.mousex >= 10 and tpt.mousey >= 150 and tpt.mousex <= 25 and tpt.mousey <= 165 then
1622
				tpt.drawrect(10, 150, 15, 15, 255, 255, 255)
1623
			end
1624
			if  tpt.mousex >= 35 and tpt.mousey >= 150 and tpt.mousex <= 50 and tpt.mousey <= 165 then
1625
				tpt.drawrect(35, 150, 15, 15, 255, 255, 255)
1626
			end
1627
			--THanKs
1628
			tpt.drawrect(80, 174, 60, 16, 204, 204, 204)
1629
			tpt.drawtext(88, 178, ">THanKs<", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1630
			if  tpt.mousex >= 80 and tpt.mousey >= 174 and tpt.mousex <= 140 and tpt.mousey <= 190 then
1631
				tpt.drawrect(80, 174, 60, 16, 255, 255, 255)
1632
			end
1633
			--better states of matter
1634
			tpt.drawtext(13, 127, "on", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1635
			tpt.drawtext(37, 127, "off", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1636
			if buttonablest == 1 then
1637
				tpt.drawrect(10, 123, 15, 15, 204, 204, 204)
1638
				tpt.drawrect(35, 123, 15, 15, 255, 255, 255)
1639
			else
1640
				tpt.drawrect(35, 123, 15, 15, 204, 204, 204)
1641
				tpt.drawrect(10, 123, 15, 15, 255, 255, 255)
1642
			end
1643
			tpt.drawtext(10, 114, "better states of matter", colourRGB[1], colourRGB[2], colourRGB[3], 255)
1644
			if  tpt.mousex >= 10 and tpt.mousey >= 123 and tpt.mousex <= 25 and tpt.mousey <= 138 then
1645
				tpt.drawrect(10, 123, 15, 15, 255, 255, 255)
1646
			end
1647
			if  tpt.mousex >= 35 and tpt.mousey >= 123 and tpt.mousex <= 50 and tpt.mousey <= 138 then
1648
				tpt.drawrect(35, 123, 15, 15, 255, 255, 255)
1649
			end
1650
			--elements
1651
			tpt.drawrect(150, 174, 16, 15, 204, 204, 204)
1652
			tpt.drawline(153, 176, 158, 181, 255, 255, 255)
1653
			tpt.drawline(163, 176, 158, 181, 255, 255, 255)
1654
			tpt.drawline(153, 181, 158, 186, 255, 255, 255)
1655
			tpt.drawline(163, 181, 158, 186, 255, 255, 255)
1656
			if  tpt.mousex >= 150 and tpt.mousey >= 174 and tpt.mousex <= 166 and tpt.mousey <= 189 then
1657
				tpt.drawrect(150, 174, 16, 15, 255, 255, 255)
1658
			end
1659
		end
1660
	end
1661
end
1662
function pressthingy()
1663
	if HL2Mod == nil then
1664
		if topress == 1 then
1665
			 if tpt.mousex >= 597 and tpt.mousey >= 1 and tpt.mousex <= 611 and tpt.mousey <= 14 and tpt.hud() == 1 then
1666
				 open = 1
1667
				 windowclick = 1
1668
			 end
1669
		 end
1670
		 if topress == 2 then
1671
			 if tpt.mousex >= 613 and tpt.mousey >= 113 and tpt.mousex <= 627 and tpt.mousey <= 124 then
1672
				open = 1
1673
				windowclick = 1
1674
			 end
1675
		 end
1676
		 if  tpt.mousex >= 0 and tpt.mousey >= 0 and tpt.mousex <= 200 and tpt.mousey <= 200 and windowclick == 1 then
1677
			open = 1
1678
		 end
1679
		 if open == 1 then
1680
			 if  tpt.mousex >= 10 and tpt.mousey >= 174 and tpt.mousex <= 70 and tpt.mousey <= 190 then
1681
				open = 0
1682
				toopress = 0
1683
				windowclick = 0
1684
			 end
1685
			 if  tpt.mousex >= 80 and tpt.mousey >= 174 and tpt.mousex <= 140 and tpt.mousey <= 190 then
1686
				thx = 1
1687
			 end
1688
			 if  tpt.mousex >= 150 and tpt.mousey >= 174 and tpt.mousex <= 166 and tpt.mousey <= 189 then
1689
				items = 1
1690
			 end
1691
			 if  tpt.mousex >= 5 and tpt.mousey >= 208 and tpt.mousex <= 19 and tpt.mousey <= 222 and items == 1 then
1692
				items = 0
1693
			 end
1694
			 if  tpt.mousex >= 50 and tpt.mousey >= 225 and tpt.mousex <= 78 and tpt.mousey <= 240 and items == 1 then
1695
				tpt.selectedl="JWARD_PT_ANFO"
1696
				redrect = 1
1697
			 end
1698
			 if  tpt.mousex >= 83 and tpt.mousey >= 225 and tpt.mousex <= 111 and tpt.mousey <= 240 and items == 1 then
1699
				tpt.selectedl="JWARD_PT_PRPN"
1700
				redrect = 2
1701
			 end
1702
			 if  tpt.mousex >= 116 and tpt.mousey >= 225 and tpt.mousex <= 144 and tpt.mousey <= 240 and items == 1 then
1703
				tpt.selectedl="JWARD_PT_COKE"
1704
				redrect = 3
1705
			 end
1706
			 if  tpt.mousex >= 149 and tpt.mousey >= 225 and tpt.mousex <= 177 and tpt.mousey <= 240 and items == 1 then
1707
				tpt.selectedl="JWARD_PT_OILC"
1708
				redrect = 4
1709
			 end
1710
			 if  tpt.mousex >= 182 and tpt.mousey >= 225 and tpt.mousex <= 210 and tpt.mousey <= 240 and items == 1 then
1711
				tpt.selectedl="JWARD_PT_PLYE"
1712
				redrect = 5
1713
			 end
1714
			 if  tpt.mousex >= 215 and tpt.mousey >= 225 and tpt.mousex <= 243 and tpt.mousey <= 240 and items == 1 then
1715
				tpt.selectedl="JWARD_PT_JETB"
1716
				redrect = 6
1717
			 end
1718
			 if  tpt.mousex >= 248 and tpt.mousey >= 225 and tpt.mousex <= 276 and tpt.mousey <= 240 and items == 1 then
1719
				tpt.selectedl="JWARD_PT_KERO"
1720
				redrect = 7
1721
			 end
1722
			 if  tpt.mousex >= 281 and tpt.mousey >= 225 and tpt.mousex <= 309 and tpt.mousey <= 240 and items == 1 then
1723
				tpt.selectedl="JWARD_PT_N2H4"
1724
				redrect = 8
1725
			 end
1726
			 if  tpt.mousex >= 314 and tpt.mousey >= 225 and tpt.mousex <= 342 and tpt.mousey <= 240 and items == 1 then
1727
				tpt.selectedl="JWARD_PT_N2O4"
1728
				redrect = 9
1729
			 end
1730
			 if  tpt.mousex >= 347 and tpt.mousey >= 225 and tpt.mousex <= 375 and tpt.mousey <= 240 and items == 1 then
1731
				tpt.selectedl="JWARD_PT_TAR"
1732
				redrect = 10
1733
			 end
1734
			 if  tpt.mousex >= 380 and tpt.mousey >= 225 and tpt.mousex <= 408 and tpt.mousey <= 240 and items == 1 then
1735
				tpt.selectedl="JWARD_PT_AFRZ"
1736
				redrect = 11
1737
			 end
1738
			 if  tpt.mousex >= 413 and tpt.mousey >= 225 and tpt.mousex <= 441 and tpt.mousey <= 240 and items == 1 then
1739
				tpt.selectedl="JWARD_PT_N2O"
1740
				redrect = 12
1741
			 end
1742
			 if  tpt.mousex >= 446 and tpt.mousey >= 225 and tpt.mousex <= 474 and tpt.mousey <= 240 and items == 1 then
1743
				tpt.selectedl="JWARD_PT_N2"
1744
				redrect = 13
1745
			 end
1746
			 if  tpt.mousex >= 479 and tpt.mousey >= 225 and tpt.mousex <= 507 and tpt.mousey <= 240 and items == 1 then
1747
				tpt.selectedl="JWARD_PT_PTRL"
1748
				redrect = 14
1749
			 end
1750
			 if  tpt.mousex >= 512 and tpt.mousey >= 225 and tpt.mousex <= 540 and tpt.mousey <= 240 and items == 1 then
1751
				tpt.selectedl="JWARD_PT_COIL"
1752
				redrect = 15
1753
			 end
1754
			 if  tpt.mousex >= 545 and tpt.mousey >= 225 and tpt.mousex <= 573 and tpt.mousey <= 240 and items == 1 then
1755
				tpt.selectedl="JWARD_PT_GLCR"
1756
				redrect = 16
1757
			 end
1758
			 if  tpt.mousex >= 6 and tpt.mousey >= 245 and tpt.mousex <= 34 and tpt.mousey <= 260 and items == 1 then
1759
				tpt.selectedl="JWARD_PT_BDSL"
1760
				redrect = 17
1761
			 end
1762
			 if  tpt.mousex >= 39 and tpt.mousey >= 245 and tpt.mousex <= 67 and tpt.mousey <= 260 and items == 1 then
1763
				tpt.selectedl="JWARD_PT_LN2O"
1764
				redrect = 18
1765
			 end
1766
			 if  tpt.mousex >= 72 and tpt.mousey >= 245 and tpt.mousex <= 100 and tpt.mousey <= 260 and items == 1 then
1767
				tpt.selectedl="JWARD_PT_CRST"
1768
				redrect = 19
1769
			end
1770
			if  tpt.mousex >= 35 and tpt.mousey >= 123 and tpt.mousex <= 50 and tpt.mousey <= 138 then
1771
				buttonablest = 1
1772
			end
1773
			if  tpt.mousex >= 10 and tpt.mousey >= 123 and tpt.mousex <= 25 and tpt.mousey <= 138 then
1774
				buttonablest = 0
1775
			end
1776
			if  tpt.mousex >= 10 and tpt.mousey >= 150 and tpt.mousex <= 25 and tpt.mousey <= 165 then
1777
				buttonable = 0
1778
				f = io.open("Saves/JWsetting.txt", "w")
1779
				f:write("0")
1780
				f:close()
1781
			end
1782
			if  tpt.mousex >= 35 and tpt.mousey >= 150 and tpt.mousex <= 50 and tpt.mousey <= 165 then
1783
				buttonable = 1
1784
				f = io.open("Saves/JWsetting.txt", "w")
1785
				f:write("1")
1786
				f:close()
1787
			 end
1788
			--off
1789
			if buttonable == 0 then
1790
				elements.property(elements.DEFAULT_PT_ACID, "Flammable", 40)
1791
				elements.property(elements.DEFAULT_PT_ACID, "Diffusion", 0)
1792
				elements.property(elements.DEFAULT_PT_ACID, "Gravity", 0.1)
1793
				elements.property(elements.DEFAULT_PT_ACID, "Description", "Dissolves almost everything.")
1794
				elements.property(elements.DEFAULT_PT_LO2, "Flammable", 5000)
1795
				elements.property(elements.DEFAULT_PT_INSL, "Hardness", 10)
1796
				elements.property(elements.DEFAULT_PT_INSL, "Flammable", 7)
1797
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperature", 77)
1798
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperatureTransition", elements.DEFAULT_PT_NONE)
1799
				elements.property(elements.DEFAULT_PT_WATR, "Hardness", 20)
1800
				elements.property(elements.DEFAULT_PT_WATR, "Weight", 30)
1801
				elements.property(elements.DEFAULT_PT_DSTW, "Hardness", 20)
1802
				elements.property(elements.DEFAULT_PT_DSTW, "Weight", 30)
1803
				elements.property(elements.DEFAULT_PT_SLTW, "Hardness", 20)
1804
				elements.property(elements.DEFAULT_PT_SLTW, "Weight", 35)
1805
				elements.property(elements.DEFAULT_PT_BUBW, "Hardness", 20)
1806
				elements.property(elements.DEFAULT_PT_BUBW, "Weight", 30)
1807
				elements.property(elements.DEFAULT_PT_GAS, "HighPressureTransition", elements.DEFAULT_PT_OIL)
1808
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperature", 0)
1809
				elements.property(elements.DEFAULT_PT_GAS, "HotAir", 0.001)
1810
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperatureTransition", DEFAULT_PT_GAS)
1811
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperatureTransition", elements.DEFAULT_PT_FIRE)
1812
				elements.property(elements.DEFAULT_PT_GAS, "Temperature", 273.15)
1813
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperature", 573)
1814
				elements.property(elements.DEFAULT_PT_GAS, "HighPressure", 6)
1815
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperature", 333)
1816
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperatureTransition", elements.DEFAULT_PT_GAS)
1817
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperature", NT)
1818
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperatureTransition", ITL)
1819
				elements.property(elements.DEFAULT_PT_DESL, "Weight", 15)
1820
				elements.property(elements.DEFAULT_PT_DESL, "HighPressure", 2)
1821
				elements.property(elements.DEFAULT_PT_NITR, "Hardness", 3)
1822
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", NT)
1823
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", ITL)
1824
				elements.property(elements.DEFAULT_PT_MWAX, "HighTemperatureTransition", elements.DEFAULT_PT_FIRE)
1825
			end
1826
			--on
1827
			if buttonable == 1 then
1828
				elements.property(elements.DEFAULT_PT_ACID, "Flammable", 0)
1829
				elements.property(elements.DEFAULT_PT_LO2, "Flammable", 0)
1830
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperature", 76)
1831
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperatureTransition", elements.JWARD_PT_N2)
1832
				elements.property(elements.DEFAULT_PT_WATR, "Hardness", 0.25)
1833
				elements.property(elements.DEFAULT_PT_WATR, "Weight", 32)
1834
				elements.property(elements.DEFAULT_PT_DSTW, "Hardness", 0)
1835
				elements.property(elements.DEFAULT_PT_DSTW, "Weight", 32)
1836
				elements.property(elements.DEFAULT_PT_SLTW, "Hardness", 0)
1837
				elements.property(elements.DEFAULT_PT_SLTW, "Weight", 32)
1838
				elements.property(elements.DEFAULT_PT_BUBW, "Hardness", 0)
1839
				elements.property(elements.DEFAULT_PT_BUBW, "Weight", 32)
1840
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperatureTransition", NT)
1841
				elements.property(elements.DEFAULT_PT_DESL, "HighTemperatureTransition", elements.JWARD_PT_DSLV)
1842
				elements.property(elements.DEFAULT_PT_DESL, "HighTemperature", 473.15)
1843
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperature", 255.15)
1844
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
1845
				elements.property(elements.DEFAULT_PT_DESL, "Weight", 12)
1846
				elements.property(elements.DEFAULT_PT_DESL, "HighPressure", 256)
1847
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", 20.15)
1848
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", elements.JWARD_PT_LHYG)
1849
				elements.property(elements.DEFAULT_PT_TNT, "HighTemperatureTransition", elements.JWARD_PT_LTNT)
1850
				elements.property(elements.DEFAULT_PT_TNT, "HighTemperature", 353.25)
1851
				elements.property(elements.DEFAULT_PT_DMND, "MenuSection", 9)
1852
				elements.property(elements.DEFAULT_PT_MORT, "MenuVisible", 1)
1853
				elements.property(elements.DEFAULT_PT_MORT, "MenuSection", 8)
1854
				elements.property(elements.DEFAULT_PT_INSL, "Hardness", 0)
1855
				elements.property(elements.DEFAULT_PT_NITR, "Hardness", 0)
1856
				elements.property(elements.DEFAULT_PT_INSL, "Flammable", 0)
1857
				elements.property(elements.DEFAULT_PT_ACID, "Weight", 32)
1858
				elements.property(elements.DEFAULT_PT_ACID, "Diffusion", 1.2)
1859
				elements.property(elements.DEFAULT_PT_ACID, "Description", "Bubbling caustic liquid.")
1860
				elements.property(elements.DEFAULT_PT_ACID, "Gravity", 0.62)
1861
				elements.property(elements.DEFAULT_PT_GAS, "HighPressureTransition", 256)
1862
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperature", 573.15)
1863
				elements.property(elements.DEFAULT_PT_GAS, "HotAir", 0)
1864
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperatureTransition", elements.DEFAULT_PT_OIL)
1865
				elements.property(elements.DEFAULT_PT_GAS, "Temperature", 583.15)
1866
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperature", 10000)
1867
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperature", 573.15)
1868
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperatureTransition", elements.DEFAULT_PT_GAS)
1869
				elements.property(elements.DEFAULT_PT_MWAX, "HighTemperatureTransition", elements.JWARD_PT_WAXV)
1870
				elements.property(elements.DEFAULT_PT_MWAX, "HighTemperature", 643.15)
1871
				elements.property(elements.DEFAULT_PT_WAX, "HeatConduct", 25)
1872
			end
1873
			--on
1874
			if buttonablest == 0 then
1875
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperature", 76)
1876
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperatureTransition", elements.JWARD_PT_N2)
1877
				elements.property(elements.DEFAULT_PT_GAS, "HighPressureTransition", 256)
1878
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperature", 573.15)
1879
				elements.property(elements.DEFAULT_PT_GAS, "HotAir", 0)
1880
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperatureTransition", elements.DEFAULT_PT_OIL)
1881
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperatureTransition", NT)
1882
				elements.property(elements.DEFAULT_PT_GAS, "Temperature", 583.15)
1883
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperature", 10000)
1884
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperature", 573.15)
1885
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperatureTransition", elements.DEFAULT_PT_GAS)
1886
				elements.property(elements.DEFAULT_PT_DESL, "HighTemperatureTransition", elements.JWARD_PT_DSLV)
1887
				elements.property(elements.DEFAULT_PT_DESL, "HighTemperature", 473.15)
1888
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperature", 255.15)
1889
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
1890
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", 20.15)
1891
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", elements.JWARD_PT_LHYG)
1892
				elements.property(elements.DEFAULT_PT_NBLE, "LowTemperature", 1)
1893
				elements.property(elements.DEFAULT_PT_NBLE, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
1894
				elements.property(elements.DEFAULT_PT_COAL, "HighPressure", 122)
1895
				elements.property(elements.DEFAULT_PT_COAL, "HighPressureTransition", elements.DEFAULT_PT_DMND)
1896
				elements.property(elements.DEFAULT_PT_BCOL, "HighPressure", 122)
1897
				elements.property(elements.DEFAULT_PT_BCOL, "HighPressureTransition", elements.DEFAULT_PT_DMND)
1898
				elements.property(elements.JWARD_PT_COKE, "HighPressure", 122)
1899
				elements.property(elements.JWARD_PT_COKE, "HighPressureTransition", elements.DEFAULT_PT_DMND)
1900
				elements.property(elements.JWARD_PT_COKE, "HighTemperature", 4373.15)
1901
				elements.property(elements.JWARD_PT_COKE, "HighTemperatureTransition", elements.DEFAULT_PT_CO2)
1902
				elements.property(elements.DEFAULT_PT_URAN, "HighTemperature", 1405)
1903
				elements.property(elements.DEFAULT_PT_URAN, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
1904
				elements.property(elements.DEFAULT_PT_PLUT, "HighTemperature", 912)
1905
				elements.property(elements.DEFAULT_PT_PLUT, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
1906
				elements.property(elements.DEFAULT_PT_DEUT, "LowTemperature", 276)
1907
				elements.property(elements.DEFAULT_PT_DEUT, "LowTemperatureTransition", elements.DEFAULT_PT_ICE)
1908
				elements.property(elements.DEFAULT_PT_TNT, "HighTemperatureTransition", elements.JWARD_PT_LTNT)
1909
				elements.property(elements.DEFAULT_PT_TNT, "HighTemperature", 353.25)
1910
			end
1911
			--off
1912
			if buttonablest == 1 then
1913
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperature", 77)
1914
				elements.property(elements.DEFAULT_PT_LN2, "HighTemperatureTransition", elements.DEFAULT_PT_NONE)
1915
				elements.property(elements.DEFAULT_PT_GAS, "HighPressureTransition", elements.DEFAULT_PT_OIL)
1916
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperature", 0)
1917
				elements.property(elements.DEFAULT_PT_GAS, "HotAir", 0.001)
1918
				elements.property(elements.DEFAULT_PT_GAS, "LowTemperatureTransition", DEFAULT_PT_GAS)
1919
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperatureTransition", elements.DEFAULT_PT_FIRE)
1920
				elements.property(elements.DEFAULT_PT_GAS, "Temperature", 273.15)
1921
				elements.property(elements.DEFAULT_PT_GAS, "HighTemperature", 573)
1922
				elements.property(elements.DEFAULT_PT_GAS, "HighPressure", 6)
1923
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperature", 333)
1924
				elements.property(elements.DEFAULT_PT_OIL, "HighTemperatureTransition", elements.DEFAULT_PT_GAS)
1925
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperature", NT)
1926
				elements.property(elements.DEFAULT_PT_DESL, "LowTemperatureTransition", ITL)
1927
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", NT)
1928
				elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", ITL)
1929
				elements.property(elements.DEFAULT_PT_NBLE, "LowTemperature", NT)
1930
				elements.property(elements.DEFAULT_PT_NBLE, "LowTemperatureTransition", ITL)
1931
				elements.property(elements.DEFAULT_PT_COAL, "HighPressure", 256)
1932
				elements.property(elements.DEFAULT_PT_COAL, "HighPressureTransition", elements.DEFAULT_PT_COAL)
1933
				elements.property(elements.DEFAULT_PT_BCOL, "HighPressure", 256)
1934
				elements.property(elements.DEFAULT_PT_BCOL, "HighPressureTransition", elements.DEFAULT_PT_BCOL)
1935
				elements.property(elements.JWARD_PT_COKE, "HighPressure", 256)
1936
				elements.property(elements.JWARD_PT_COKE, "HighPressureTransition", elements.JWARD_PT_COKE)
1937
				elements.property(elements.JWARD_PT_COKE, "HighTemperature", 10000)
1938
				elements.property(elements.JWARD_PT_COKE, "HighTemperatureTransition", elements.JWARD_PT_COKE)
1939
				elements.property(elements.DEFAULT_PT_URAN, "HighTemperature", NT)
1940
				elements.property(elements.DEFAULT_PT_URAN, "HighTemperatureTransition", NT)
1941
				elements.property(elements.DEFAULT_PT_PLUT, "HighTemperature", NT)
1942
				elements.property(elements.DEFAULT_PT_PLUT, "HighTemperatureTransition", NT)
1943
				elements.property(elements.DEFAULT_PT_DEUT, "LowTemperature", NT)
1944
				elements.property(elements.DEFAULT_PT_DEUT, "LowTemperatureTransition", NT)
1945
			end
1946
			tpt.set_pause(1)
1947
			toopress = 1
1948
			return false
1949
		else
1950
			toopress = 0
1951
			return true
1952
		end
1953
	end
1954
end
1955
1956
tpt.register_mouseclick(pressthingy)
1957
tpt.register_mouseclick(tick)
1958
tpt.register_step(tick)