SHOW:
|
|
- or go back to the newest paste.
1 | -- Caesium | |
2 | caes = elements.allocate("RAD", "CAES") --properties | |
3 | elements.element(caes, elements.element(elements.DEFAULT_PT_COAL)) | |
4 | elements.property(caes, "Name", "CAES") | |
5 | elements.property(caes, "Description", "Caesium. Highly reactive and will violently explode in water.") | |
6 | elements.property(caes, "Colour", 0xD8D8D8) | |
7 | elements.property(caes, "MenuSection", 10) | |
8 | elements.property(caes, "Gravity", 0) | |
9 | elements.property(caes, "Properties", elements.ST_SOLID + elements.TYPE_SOLID + elements.PROP_DEADLY) | |
10 | elements.property(caes, "Flammable", 0) | |
11 | elements.property(caes, "Explosive", 0) | |
12 | function propc(i,x,y,s,n) | |
13 | local ctemp = tpt.get_property("temp", i) -- melt into Liquid Caesium | |
14 | if ctemp > 301.59 then | |
15 | tpt.set_property("type", "lcas", i) | |
16 | end | |
17 | if math.random(1, 7500) == 1 then -- decay | |
18 | local ran = math.random(-20,20) | |
19 | local ran2 = math.random(-20,0) | |
20 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
21 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
22 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
23 | tpt.set_property("vx", math.random(-25,25), i) | |
24 | tpt.set_property("vy", math.random(-25,25), i) | |
25 | tpt.set_property("life", 10000, i) | |
26 | if math.abs(ran) + math.abs(ran2) > 10 then | |
27 | local ran3 = math.random(1,4) | |
28 | if ran3 == 1 then | |
29 | tpt.set_property("type", "elec", i) | |
30 | end | |
31 | if ran3 == 2 then | |
32 | tpt.set_property("type", "phot", i) | |
33 | end | |
34 | if ran3 == 3 then | |
35 | tpt.set_property("type", "prot", i) | |
36 | end | |
37 | if ran3 == 4 then | |
38 | tpt.set_property("type", "neut", i) | |
39 | end | |
40 | end | |
41 | end | |
42 | ||
43 | - | local colx = math.random(-1,1) |
43 | + | local colx = math.random(-1,1) -- react with water |
44 | local coly = math.random(-1,1) | |
45 | local coltype = tpt.get_property("type", x+colx, y+coly) | |
46 | local temp = tpt.get_property("temp", i) | |
47 | if coltype == elements.DEFAULT_PT_WATR then | |
48 | if math.random(0,1) == 1 then | |
49 | local ran = x+math.random(-1,1) | |
50 | local ran2 = y+math.random(-1,1) | |
51 | tpt.create(ran, ran2, "mort") | |
52 | tpt.set_property("vx", math.random(-25,25) , ran) | |
53 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
54 | end | |
55 | tpt.set_pressure(x,y,10,10,100) | |
56 | tpt.set_property("life", 10000, i) | |
57 | tpt.set_property("vx", math.random(-25,25), i) | |
58 | tpt.set_property("vy", math.random(-25,25), i) | |
59 | tpt.set_property("temp", temp + 1000 ,i) | |
60 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
61 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
62 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
63 | tpt.set_property("type", "hygn", coltype) | |
64 | local rand = math.random(1,4) | |
65 | if rand == 1 then | |
66 | tpt.set_property("type", "elec", i) | |
67 | end | |
68 | if rand == 2 then | |
69 | tpt.set_property("type", "phot", i) | |
70 | end | |
71 | if rand == 3 then | |
72 | tpt.set_property("type", "prot", i) | |
73 | end | |
74 | if rand == 4 then | |
75 | tpt.set_property("type", "neut", i) | |
76 | end | |
77 | end | |
78 | if coltype == elements.DEFAULT_PT_DSTW then | |
79 | if math.random(0,1) == 1 then | |
80 | local ran = x+math.random(-1,1) | |
81 | local ran2 = y+math.random(-1,1) | |
82 | tpt.create(ran, ran2, "mort") | |
83 | tpt.set_property("vx", math.random(-25,25) , ran) | |
84 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
85 | end | |
86 | tpt.set_pressure(x,y,10,10,100) | |
87 | tpt.set_property("life", 10000, i) | |
88 | tpt.set_property("vx", math.random(-25,25), i) | |
89 | tpt.set_property("vy", math.random(-25,25), i) | |
90 | local rand = math.random(1,4) | |
91 | if rand == 1 then | |
92 | tpt.set_property("type", "elec", i) | |
93 | end | |
94 | if rand == 2 then | |
95 | tpt.set_property("type", "phot", i) | |
96 | end | |
97 | if rand == 3 then | |
98 | tpt.set_property("type", "prot", i) | |
99 | end | |
100 | if rand == 4 then | |
101 | tpt.set_property("type", "neut", i) | |
102 | end | |
103 | tpt.set_property("temp", temp + 1000 ,i) | |
104 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
105 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
106 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
107 | tpt.set_property("type", "hygn", coltype) | |
108 | end | |
109 | if coltype == elements.DEFAULT_PT_SLTW then | |
110 | if math.random(0,1) == 1 then | |
111 | local ran = x+math.random(-1,1) | |
112 | local ran2 = y+math.random(-1,1) | |
113 | tpt.create(ran, ran2, "mort") | |
114 | tpt.set_property("vx", math.random(-25,25) , ran) | |
115 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
116 | end | |
117 | tpt.set_pressure(x,y,10,10,100) | |
118 | tpt.set_property("life", 10000, i) | |
119 | tpt.set_property("vx", math.random(-25,25), i) | |
120 | tpt.set_property("vy", math.random(-25,25), i) | |
121 | local rand = math.random(1,4) | |
122 | if rand == 1 then | |
123 | tpt.set_property("type", "elec", i) | |
124 | end | |
125 | if rand == 2 then | |
126 | tpt.set_property("type", "phot", i) | |
127 | end | |
128 | if rand == 3 then | |
129 | tpt.set_property("type", "prot", i) | |
130 | end | |
131 | if rand == 4 then | |
132 | tpt.set_property("type", "neut", i) | |
133 | end | |
134 | tpt.set_property("temp", temp + 1000 ,i) | |
135 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
136 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
137 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
138 | tpt.set_property("type", "hygn", coltype) | |
139 | end | |
140 | end | |
141 | tpt.element_func(propc, tpt.element("caes")) | |
142 | elements.property(caes, "HighTemperature", 1938) | |
143 | -- Liquid Caesium | |
144 | Lcas = elements.allocate("RAD", "LCAS") -- properties | |
145 | elements.element(Lcas, elements.element(elements.DEFAULT_PT_EXOT)) | |
146 | elements.property(Lcas, "Name", "LCAS") | |
147 | elements.property(Lcas, "Description", "Liquid Caesium. Highly reactive and will violently explode in water.") | |
148 | elements.property(Lcas, "Colour", 0xD9D9D9) | |
149 | elements.property(Lcas, "MenuSection", 10) | |
150 | elements.property(Lcas, "Gravity", 1) | |
151 | elements.property(Lcas, "Weight", 10) | |
152 | elements.property(Lcas, "Flammable", 0) | |
153 | elements.property(Lcas, "Explosive", 0) | |
154 | elements.property(caes, "Properties", elements.ST_LIQUID + elements.TYPE_LIQUID + elements.PROP_DEADLY) | |
155 | function proplcas(i,x,y,s,n) | |
156 | local ctemp = tpt.get_property("temp", i) -- decay | |
157 | if math.random(1, 7500) == 1 then | |
158 | local ran = math.random(-20,20) | |
159 | local ran2 = math.random(-20,0) | |
160 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
161 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
162 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
163 | tpt.set_property("life", 10000, i) | |
164 | tpt.set_property("vx", math.random(-25,25), i) | |
165 | tpt.set_property("vy", math.random(-25,25), i) | |
166 | if math.abs(ran) + math.abs(ran2) > 10 then | |
167 | local ran3 = math.random(1,4) | |
168 | if ran3 == 1 then | |
169 | tpt.set_property("type", "elec", i) | |
170 | end | |
171 | if ran3 == 2 then | |
172 | tpt.set_property("type", "phot", i) | |
173 | end | |
174 | if ran3 == 3 then | |
175 | tpt.set_property("type", "prot", i) | |
176 | end | |
177 | if ran3 == 4 then | |
178 | tpt.set_property("type", "neut", i) | |
179 | end | |
180 | end | |
181 | end | |
182 | local colx = math.random(-1,1) -- react w/ water | |
183 | local coly = math.random(-1,1) | |
184 | local coltype = tpt.get_property("type", x+colx, y+coly) | |
185 | local temp = tpt.get_property("temp", i) | |
186 | if coltype == elements.DEFAULT_PT_WATR then | |
187 | if math.random(0,1) == 1 then | |
188 | local ran = x+math.random(-1,1) | |
189 | local ran2 = y+math.random(-1,1) | |
190 | tpt.create(ran, ran2, "mort") | |
191 | tpt.set_property("vx", math.random(-25,25) , ran) | |
192 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
193 | end | |
194 | tpt.set_pressure(x,y,10,10,100) | |
195 | tpt.set_property("life", 10000, i) | |
196 | tpt.set_property("vx", math.random(-25,25), i) | |
197 | tpt.set_property("vy", math.random(-25,25), i) | |
198 | local rand = math.random(1,4) | |
199 | if rand == 1 then | |
200 | tpt.set_property("type", "elec", i) | |
201 | end | |
202 | if rand == 2 then | |
203 | tpt.set_property("type", "phot", i) | |
204 | end | |
205 | if rand == 3 then | |
206 | tpt.set_property("type", "prot", i) | |
207 | end | |
208 | if rand == 4 then | |
209 | tpt.set_property("type", "neut", i) | |
210 | end | |
211 | tpt.set_property("temp", temp + 1000 ,i) | |
212 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
213 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
214 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
215 | tpt.set_property("type", "hygn", coltype) | |
216 | end | |
217 | if coltype == elements.DEFAULT_PT_DSTW then | |
218 | if math.random(0,1) == 1 then | |
219 | local ran = x+math.random(-1,1) | |
220 | local ran2 = y+math.random(-1,1) | |
221 | tpt.create(ran, ran2, "mort") | |
222 | tpt.set_property("vx", math.random(-25,25) , ran) | |
223 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
224 | end | |
225 | tpt.set_pressure(x,y,10,10,100) | |
226 | tpt.set_property("life", 10000, i) | |
227 | tpt.set_property("vx", math.random(-25,25), i) | |
228 | tpt.set_property("vy", math.random(-25,25), i) | |
229 | local rand = math.random(1,4) | |
230 | if rand == 1 then | |
231 | tpt.set_property("type", "elec", i) | |
232 | end | |
233 | if rand == 2 then | |
234 | tpt.set_property("type", "phot", i) | |
235 | end | |
236 | if rand == 3 then | |
237 | tpt.set_property("type", "prot", i) | |
238 | end | |
239 | if rand == 4 then | |
240 | tpt.set_property("type", "neut", i) | |
241 | end | |
242 | tpt.set_property("temp", temp + 1000 ,i) | |
243 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
244 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
245 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
246 | tpt.set_property("type", "hygn", coltype) | |
247 | end | |
248 | if coltype == elements.DEFAULT_PT_SLTW then | |
249 | if math.random(0,1) == 1 then | |
250 | local ran = x+math.random(-1,1) | |
251 | local ran2 = y+math.random(-1,1) | |
252 | tpt.create(ran, ran2, "mort") | |
253 | tpt.set_property("vx", math.random(-25,25) , ran) | |
254 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
255 | end | |
256 | tpt.set_pressure(x,y,10,10,100) | |
257 | tpt.set_property("life", 10000, i) | |
258 | tpt.set_property("vx", math.random(-25,25), i) | |
259 | tpt.set_property("vy", math.random(-25,25), i) | |
260 | local rand = math.random(1,4) | |
261 | if rand == 1 then | |
262 | tpt.set_property("type", "elec", i) | |
263 | end | |
264 | if rand == 2 then | |
265 | tpt.set_property("type", "phot", i) | |
266 | end | |
267 | if rand == 3 then | |
268 | tpt.set_property("type", "prot", i) | |
269 | end | |
270 | if rand == 4 then | |
271 | tpt.set_property("type", "neut", i) | |
272 | end | |
273 | tpt.set_property("temp", temp + 1000 ,i) | |
274 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
275 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
276 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
277 | tpt.set_property("type", "hygn", coltype) | |
278 | end | |
279 | end | |
280 | elements.property(Lcas, "LowTemperature", 200) -- turn into Solid Caesium | |
281 | tpt.element_func(proplcas, tpt.element("lcas")) | |
282 | elements.property(Lcas, "LowTemperatureTransition", caes) | |
283 | -- Palladium | |
284 | -- notes: Asorbs hydrogen, acid resistant, melts at 1833.15, solidifies at about 1700 | |
285 | Pald = elements.allocate("STB", "PALD") --properties | |
286 | elements.element(Pald, elements.element(elements.DEFAULT_PT_GLAS)) | |
287 | elements.property(Pald, "Name", "PALD") | |
288 | elements.property(Pald, "Description", "Palladium. Adsorbs Hydrogen and doesn't corrode.") | |
289 | elements.property(Pald, "Colour", 0xFFABBBBF) | |
290 | elements.property(Pald, "MenuSection", 9) | |
291 | elements.property(Pald, "Gravity", 0) | |
292 | elements.property(Pald, "Properties", elements.ST_SOLID + elements.TYPE_SOLID + elements.PROP_CONDUCTS) | |
293 | elements.property(Pald, "Flammable", 0) | |
294 | elements.property(Pald, "Explosive", 0) | |
295 | elements.property(Pald, "HighTemperature", 1833.15) | |
296 | function propp(i,x,y,s,nt) | |
297 | local life = tpt.get_property("life", i) | |
298 | if life >= 1 then | |
299 | tpt.set_property("life", 0 , i) | |
300 | end | |
301 | -- adsorbs hydrogen | |
302 | local collx = math.random(-1,1) | |
303 | local colly = math.random(-1,1) | |
304 | hygn = tpt.get_property("type", x+collx, y+colly) | |
305 | if hygn == elements.DEFAULT_PT_HYGN then | |
306 | tpt.delete(x+collx, y+colly) | |
307 | end | |
308 | end | |
309 | tpt.element_func(propp, tpt.element("pald")) | |
310 | -- Radium | |
311 | -- notes: Emits light and decays, soft and a white to black colour. Radium corrodes in water. Dangerous to humans. Melts at 973.15 boils at 1413.15. | |
312 | Radi = elements.allocate("RAD", "RADI") --properties | |
313 | elements.element(Radi, elements.element(elements.DEFAULT_PT_TTAN)) | |
314 | elements.property(Radi, "Name", "RADI") | |
315 | elements.property(Radi, "Description", "Radium. Emits light and slowly corrodes in water.") | |
316 | elements.property(Radi, "Colour", 0xFFFFFFFF) | |
317 | elements.property(Radi, "MenuSection", 10) | |
318 | elements.property(Radi, "Gravity", 0) | |
319 | elements.property(Radi, "Properties", elements.ST_SOLID + elements.TYPE_SOLID + elements.PROP_DEADLY) | |
320 | elements.property(Radi, "Flammable", 0) | |
321 | elements.property(Radi, "Explosive", 0) | |
322 | elements.property(Radi, "HighTemperature", 1413.15) | |
323 | function propr(i,x,y,s,n) | |
324 | local ratemp = tpt.get_property("temp",i) | |
325 | if ratemp > 973.15 then | |
326 | tpt.set_property("type","lrad",i) | |
327 | end | |
328 | if math.random(0,100) == 1 then -- create photons and decay | |
329 | local mathx = math.random(-1,1) | |
330 | local mathy = math.random(-1,1) | |
331 | tpt.create(x+mathx, y+mathy, "PHOT") | |
332 | tpt.set_property("life",680,mathx,mathy) | |
333 | if(math.random(0,7500) == 1) then | |
334 | tpt.set_property("life", 10000, i) | |
335 | tpt.set_property("vx", math.random(-25,25), i) | |
336 | tpt.set_property("vy", math.random(-25,25), i) | |
337 | tpt.set_property("type", "neut", i) | |
338 | end | |
339 | end | |
340 | local nx = math.random(-1,1) -- react w/ water | |
341 | local nx2 = math.random(-1,1) | |
342 | watr = tpt.get_property("type", x+nx, y+nx2) | |
343 | if watr == elements.DEFAULT_PT_WATR then | |
344 | if math.random(0,7500) == 1 then | |
345 | tpt.set_property("type","exot",i) | |
346 | end | |
347 | end | |
348 | if watr == elements.DEFAULT_PT_DSTW then | |
349 | if math.random(0,7500) == 1 then | |
350 | tpt.set_property("type","exot",i) | |
351 | end | |
352 | end | |
353 | if watr == elements.DEFAULT_PT_SLTW then | |
354 | if math.random(0,7500) == 1 then | |
355 | tpt.set_property("type","exot",i) | |
356 | end | |
357 | end | |
358 | end | |
359 | tpt.element_func(propr, tpt.element("radi")) | |
360 | -- Liquid Radium | |
361 | -- notes: | |
362 | Lrad = elements.allocate("RAD", "Lrad") --properties | |
363 | elements.element(Lrad, elements.element(elements.DEFAULT_PT_MERC)) | |
364 | elements.property(Lrad, "Name", "LRAD") | |
365 | elements.property(Lrad, "Description", "Liquid Radium. Emits light and slowly corrodes in water.") | |
366 | elements.property(Lrad, "Colour", 0xFFFFFFFF) | |
367 | elements.property(Lrad, "MenuSection", 10) | |
368 | elements.property(Lrad, "Gravity", 1) | |
369 | elements.property(Lrad, "Properties", elements.ST_LIQUID + elements.TYPE_LIQUID + elements.PROP_DEADLY) | |
370 | elements.property(Lrad, "Flammable", 0) | |
371 | elements.property(Lrad, "Explosive", 0) | |
372 | elements.property(Lrad, "HighTemperature", 1413.15) | |
373 | elements.property(Lrad, "LowTemperature", 1300) | |
374 | elements.property(Lrad, "LowTemperatureTransition", Radi) | |
375 | function proplr(i,x,y,s,n) | |
376 | local lrtemp = tpt.get_property("temp",i) | |
377 | tpt.set_property("temp", lrtemp + 973.15, i) | |
378 | if math.random(0,100) == 1 then -- decay and create photons | |
379 | local mathx = math.random(-1,1) | |
380 | local mathy = math.random(-1,1) | |
381 | tpt.create(x+mathx, y+mathy, "PHOT") | |
382 | tpt.set_property("life",680,x+mathx, y+mathy) | |
383 | - | if tempm > 1380.15 then |
383 | + | |
384 | tpt.set_property("life", 10000, i) | |
385 | tpt.set_property("vx", math.random(-25,25), i) | |
386 | tpt.set_property("vy", math.random(-25,25), i) | |
387 | tpt.set_property("type", "neut", i) | |
388 | end | |
389 | end | |
390 | local nx = math.random(-1,1) -- react w/ water | |
391 | - | tpt.set_property("type", "FIRE", i) |
391 | + | |
392 | watr = tpt.get_property("type", x+nx, y+nx2) | |
393 | if watr == elements.DEFAULT_PT_WATR then | |
394 | if math.random(0,7500) == 1 then | |
395 | tpt.set_property("type","exot",i) | |
396 | end | |
397 | end | |
398 | if watr == elements.DEFAULT_PT_DSTW then | |
399 | if math.random(0,7500) == 1 then | |
400 | tpt.set_property("type","exot",i) | |
401 | end | |
402 | end | |
403 | if watr == elements.DEFAULT_PT_SLTW then | |
404 | if math.random(0,7500) == 1 then | |
405 | tpt.set_property("type","exot",i) | |
406 | end | |
407 | end | |
408 | end | |
409 | tpt.element_func(proplr, tpt.element("lrad")) | |
410 | -- Magnesium | |
411 | -- notes: Burns with fire or plasma, flame is very hot. Melts (or burns) at 923.15. Boils at 1380.15. Burns with white flame. Creates hydrogen with acid. | |
412 | Magn = elements.allocate("STB", "MAGN") --properties | |
413 | elements.element(Magn, elements.element(elements.DEFAULT_PT_GLAS)) | |
414 | elements.property(Magn, "Name", "MAGN") | |
415 | elements.property(Magn, "Description", "Magnesium. Burns with an intense flame.") | |
416 | elements.property(Magn, "Colour", 0x586165) | |
417 | elements.property(Magn, "MenuSection", 9) | |
418 | elements.property(Magn, "Gravity", 0) | |
419 | elements.property(Magn, "Properties", elements.ST_SOLID + elements.TYPE_SOLID) | |
420 | elements.property(Magn, "Flammable", 0) | |
421 | elements.property(Magn, "Explosive", 0) | |
422 | elements.property(Magn, "HighTemperature", 100000) | |
423 | function propmag(i,x,y,s,n) | |
424 | local tempm = tpt.get_property("temp", i) -- burn with temperature. | |
425 | if tempm > 1380.15 and math.random(0,10) == 1 then | |
426 | tpt.set_property("life", 500, i) | |
427 | tpt.set_property("temp", 6500, i) | |
428 | local magran = math.random(1,3) | |
429 | if magran == 1 then | |
430 | tpt.set_property("type", "PLSM", i) | |
431 | end | |
432 | if magran == 2 then | |
433 | if math.random(0,10) == 1 then | |
434 | tpt.set_property("vx", math.random(-5,5), i) | |
435 | tpt.set_property("vy", math.random(-5,5), i) | |
436 | tpt.set_property("life", 250, i) | |
437 | tpt.set_property("type", "MORT", i) | |
438 | else | |
439 | tpt.set_property("type", "PLSM", i) | |
440 | end | |
441 | end | |
442 | if magran == 3 then | |
443 | tpt.set_property("life", 1000, i) | |
444 | tpt.set_property("type", "PLSM", i) | |
445 | end | |
446 | end | |
447 | local magx = math.random(-1,1) | |
448 | local magy = math.random(-1,1) | |
449 | local acid = tpt.get_property("type", x+magx, y+magy) -- react with acid | |
450 | if acid == elements.DEFAULT_PT_ACID then | |
451 | tpt.set_property("type", "HYGN", i) | |
452 | tpt.set_property("type", "HYGN", acid) | |
453 | end | |
454 | end | |
455 | tpt.element_func(propmag, tpt.element("magn")) | |
456 | -- Francium | |
457 | -- notes: Violently explodes in water. | |
458 | Fran = elements.allocate("RAD", "Fran") --properties | |
459 | elements.element(Fran, elements.element(elements.DEFAULT_PT_BCOL)) | |
460 | elements.property(Fran, "Name", "FRAN") | |
461 | elements.property(Fran, "Description", "Francium. Highly unstable and will decay within seconds. Do not place in water.") | |
462 | elements.property(Fran, "Colour", 0xC0C0C0) | |
463 | elements.property(Fran, "MenuSection", 10) | |
464 | elements.property(Fran, "Weight", 100) | |
465 | elements.property(Fran, "Gravity", 1) | |
466 | elements.property(Fran, "Properties", elements.ST_SOLID + elements.TYPE_SOLID + elements.PROP_DEADLY) | |
467 | elements.property(Fran, "Flammable", 0) | |
468 | elements.property(Fran, "Explosive", 0) | |
469 | elements.property(Fran, "HighTemperature", 100000) | |
470 | function propfr(i,x,y,s,n) | |
471 | if math.random(0,25) == 1 then | |
472 | local frdecay = math.random(1,7) -- decay | |
473 | local frtemp = tpt.get_property("temp", i) | |
474 | tpt.set_property("life", math.random(500,1000),i) | |
475 | tpt.set_property("vx", math.random(-25,25), i) | |
476 | tpt.set_property("vy", math.random(-25,25), i) | |
477 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
478 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
479 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
480 | if frdecay == 1 then | |
481 | tpt.set_property("temp", frtemp + 50000 , i) | |
482 | tpt.set_property("type", "PHOT", i) | |
483 | end | |
484 | if frdecay == 2 then | |
485 | tpt.set_property("type", "PHOT", i) | |
486 | end | |
487 | if frdecay == 3 then | |
488 | tpt.set_property("type", "PROT", i) | |
489 | end | |
490 | if frdecay == 4 then | |
491 | tpt.set_property("type", "NEUT", i) | |
492 | end | |
493 | if frdecay == 5 then | |
494 | tpt.set_property("type", "NEUT", i) | |
495 | end | |
496 | if frdecay == 5 then | |
497 | tpt.set_property("type", "NBLE", i) | |
498 | end | |
499 | if frdecay == 5 then | |
500 | tpt.set_property("type", "PROT", i) | |
501 | end | |
502 | end | |
503 | local col = math.random(-1,1) -- react with water | |
504 | local col2 = math.random(-1,1) | |
505 | colltype = tpt.get_property("type", x+col, y+col2) | |
506 | if colltype == elements.DEFAULT_PT_WATR then | |
507 | if math.random(0,1) == 1 then | |
508 | local ran = x+math.random(-1,1) | |
509 | local ran2 = y+math.random(-1,1) | |
510 | tpt.create(ran, ran2, "mort") | |
511 | tpt.set_property("vx", math.random(-25,25) , ran) | |
512 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
513 | end | |
514 | local frdecay = math.random(1,7) | |
515 | local frtemp = tpt.get_property("temp", i) | |
516 | tpt.set_property("type", "PHOT", colltype) | |
517 | tpt.set_property("life", math.random(500,1000),i) | |
518 | tpt.set_property("vx", math.random(-25,25), i) | |
519 | tpt.set_property("vy", math.random(-25,25), i) | |
520 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
521 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
522 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
523 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thdr") | |
524 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "caes") | |
525 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "magn") | |
526 | tpt.set_pressure(x,y,1,1,200) | |
527 | if frdecay == 1 then | |
528 | tpt.set_property("temp", frtemp + 50000 , i) | |
529 | tpt.set_property("type", "PHOT", i) | |
530 | end | |
531 | if frdecay == 2 then | |
532 | tpt.set_property("type", "PHOT", i) | |
533 | end | |
534 | if frdecay == 3 then | |
535 | tpt.set_property("type", "PROT", i) | |
536 | end | |
537 | if frdecay == 4 then | |
538 | tpt.set_property("type", "NEUT", i) | |
539 | end | |
540 | if frdecay == 5 then | |
541 | tpt.set_property("type", "NEUT", i) | |
542 | end | |
543 | if frdecay == 5 then | |
544 | tpt.set_property("type", "NBLE", i) | |
545 | end | |
546 | if frdecay == 5 then | |
547 | tpt.set_property("type", "PROT", i) | |
548 | end | |
549 | end | |
550 | if colltype == elements.DEFAULT_PT_DSTW then | |
551 | if math.random(0,1) == 1 then | |
552 | local ran = x+math.random(-1,1) | |
553 | local ran2 = y+math.random(-1,1) | |
554 | tpt.create(ran, ran2, "mort") | |
555 | tpt.set_property("vx", math.random(-25,25) , ran) | |
556 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
557 | end | |
558 | local frdecay = math.random(1,7) | |
559 | local frtemp = tpt.get_property("temp", i) | |
560 | tpt.set_property("life", math.random(500,1000),i) | |
561 | tpt.set_property("vx", math.random(-25,25), i) | |
562 | tpt.set_property("vy", math.random(-25,25), i) | |
563 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
564 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
565 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
566 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thdr") | |
567 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "caes") | |
568 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "magn") | |
569 | tpt.set_pressure(x,y,10,10,200) | |
570 | if frdecay == 1 then | |
571 | tpt.set_property("temp", frtemp + 50000 , i) | |
572 | tpt.set_property("type", "PHOT", i) | |
573 | end | |
574 | if frdecay == 2 then | |
575 | tpt.set_property("type", "PHOT", i) | |
576 | end | |
577 | if frdecay == 3 then | |
578 | tpt.set_property("type", "PROT", i) | |
579 | end | |
580 | if frdecay == 4 then | |
581 | tpt.set_property("type", "NEUT", i) | |
582 | end | |
583 | if frdecay == 5 then | |
584 | tpt.set_property("type", "NEUT", i) | |
585 | end | |
586 | if frdecay == 5 then | |
587 | tpt.set_property("type", "NBLE", i) | |
588 | end | |
589 | if frdecay == 5 then | |
590 | tpt.set_property("type", "PROT", i) | |
591 | end | |
592 | end | |
593 | if colltype == elements.DEFAULT_PT_SLTW then | |
594 | if math.random(0,1) == 1 then | |
595 | local ran = x+math.random(-1,1) | |
596 | local ran2 = y+math.random(-1,1) | |
597 | tpt.create(ran, ran2, "mort") | |
598 | tpt.set_property("vx", math.random(-25,25) , ran) | |
599 | tpt.set_property("vy", math.random(-25,25) , ran2) | |
600 | end | |
601 | local frdecay = math.random(1,7) | |
602 | local frtemp = tpt.get_property("temp", i) | |
603 | tpt.set_property("life", math.random(500,1000),i) | |
604 | tpt.set_property("vx", math.random(-25,25), i) | |
605 | tpt.set_property("vy", math.random(-25,25), i) | |
606 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble") | |
607 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn") | |
608 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm") | |
609 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thdr") | |
610 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "caes") | |
611 | tpt.create(x+math.random(-1,1), y+math.random(-1,1), "magn") | |
612 | tpt.set_pressure(x,y,10,10,200) | |
613 | if frdecay == 1 then | |
614 | tpt.set_property("temp", frtemp + 50000 , i) | |
615 | tpt.set_property("type", "PHOT", i) | |
616 | end | |
617 | if frdecay == 2 then | |
618 | tpt.set_property("type", "PHOT", i) | |
619 | end | |
620 | if frdecay == 3 then | |
621 | tpt.set_property("type", "PROT", i) | |
622 | end | |
623 | if frdecay == 4 then | |
624 | tpt.set_property("type", "NEUT", i) | |
625 | end | |
626 | if frdecay == 5 then | |
627 | tpt.set_property("type", "NEUT", i) | |
628 | end | |
629 | if frdecay == 5 then | |
630 | tpt.set_property("type", "NBLE", i) | |
631 | end | |
632 | if frdecay == 5 then | |
633 | tpt.set_property("type", "PROT", i) | |
634 | end | |
635 | end | |
636 | end | |
637 | tpt.element_func(propfr, tpt.element("Fran")) |