Advertisement
DanielGalrito

Decays

Nov 2nd, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.46 KB | None | 0 0
  1. function Uran(i, x, y, surround, nt)
  2. local collx = math.random(-1,1)
  3. local colly = math.random(-1,1)
  4. local atemp = tpt.get_property("temp", i)
  5. local chance = math.random(1,1000000)
  6. if tpt.get_property("tmp", i) == 0 then
  7. if chance < 992740 then
  8. tpt.set_property("tmp",238,i)
  9. end
  10. if chance > 992800 then
  11. tpt.set_property("tmp",235,i)
  12. end
  13. if chance > 982750 then
  14. if chance < 992800 then
  15. tpt.set_property("tmp",234,i)
  16. end
  17. end
  18. end
  19.  
  20. if tpt.get_property("tmp", i) == 231 then
  21. if math.random(1,150) == 2 then
  22. if math.random(1,100000) < 99997 then
  23. tpt.set_property("temp",atemp+100,i)
  24. tpt.set_property("type","pa",i)
  25. end
  26. if math.random(1,100000) > 99996 then
  27. tpt.create(x+collx, y+colly, "alph")
  28. tpt.set_property("temp",atemp+100,i)
  29. tpt.set_property("tmp", 227, i)
  30. tpt.set_property("type","thor",i)
  31. end
  32. end
  33. end
  34.  
  35. if tpt.get_property("tmp", i) == 233 then
  36. if math.random(1,25000) == 2 then
  37. tpt.create(x+collx, y+colly, "alph")
  38. tpt.set_property("temp",atemp+100,i)
  39. tpt.set_property("tmp", 230, i)
  40. tpt.set_property("type","thor",i)
  41. end
  42. end
  43.  
  44. if tpt.get_property("tmp", i) == 234 then
  45. if math.random(1,25000) == 2 then
  46. tpt.create(x+collx, y+colly, "alph")
  47. tpt.set_property("temp",atemp+100,i)
  48. tpt.set_property("tmp", 230, i)
  49. tpt.set_property("type","thor",i)
  50. end
  51. end
  52.  
  53. if tpt.get_property("tmp", i) == 235 then
  54. if math.random(1,40000) == 2 then    --max is 65533
  55. tpt.create(x+collx, y+colly, "alph")
  56. tpt.set_property("temp",atemp+100,i)
  57. tpt.set_property("tmp", 231, i)
  58. tpt.set_property("type","thor",i)
  59. end
  60. local chance = math.random(1,3)
  61. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  62. sim.pressure(x/4,y/4,75)
  63. tpt.set_property("temp",math.huge,x,y)
  64. tpt.set_property("tmp", 0, i)
  65. tpt.set_property("tmp2", 0, i)
  66. if chance == 1 then
  67. tpt.set_property("type","neut",i)
  68. tpt.set_property("life", math.random(500,1000), i)
  69. end
  70. if chance == 2 then
  71. tpt.set_property("type","lava",i)
  72. end
  73. if chance == 3 then
  74. tpt.set_property("type","uran",i)
  75. end
  76. end
  77. end
  78.  
  79. if tpt.get_property("tmp", i) == 236 then
  80. if math.random(1,35000) == 2 then
  81. tpt.create(x+collx, y+colly, "alph")
  82. tpt.set_property("temp",atemp+100,i)
  83. tpt.set_property("tmp", 232, i)
  84. tpt.set_property("type","thor",i)
  85. end
  86. end
  87.  
  88. if tpt.get_property("tmp", i) == 238 then
  89. if math.random(1,65000) == 2 then
  90. tpt.create(x+collx, y+colly, "alph")
  91. tpt.set_property("temp",atemp+100,i)
  92. tpt.set_property("tmp", 234, i)
  93. tpt.set_property("type","thor",i)
  94. end
  95. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  96. tpt.delete(x+collx, y+colly)
  97. tpt.set_property("tmp", 239, i)
  98. end
  99. end
  100.  
  101. if tpt.get_property("tmp", i) == 239 then
  102. if math.random(1,100) == 2 then
  103. tpt.create(x+collx, y+colly, "elec")
  104. tpt.set_property("temp",atemp+100,i)
  105. tpt.set_property("type","np",i)
  106. end
  107. end
  108.  
  109. if tpt.get_property("tmp", i) == 240 then
  110. if math.random(1,300) == 2 then
  111. tpt.create(x+collx, y+colly, "elec")
  112. tpt.set_property("temp",atemp+100,i)
  113. tpt.set_property("type","np",i)
  114. end
  115. end
  116. end
  117. tpt.element_func(Uran, tpt.element('uran'))
  118.  
  119.  
  120. decays = 1
  121. ----------------------------------
  122.  
  123. Np = elements.allocate("Np", "NP")
  124. elements.element(Np, elements.element(elements.DEFAULT_PT_BRMT))
  125. elements.property(Np, "Name", "NP")
  126. elements.property(Np, "Description", "Neptunium.")
  127. elements.property(Np, "MenuVisible", 0)
  128. elements.property(Np, "Colour", 0xFE48FE)
  129. elements.property(Np, "Properties", 0x2401)
  130.  
  131.  
  132. local function Np(i,x,y,s,nt)
  133. local collx = math.random(-1,1)
  134. local colly = math.random(-1,1)
  135. local atemp = tpt.get_property("temp", i)
  136. local alife = tpt.get_property("life", i)
  137. local chance = math.random(1,1000000)
  138. if tpt.get_property("tmp", i) == 235 then
  139. if math.random(1,1000) == 2 then
  140. if chance < 27 then
  141. tpt.create(x+collx, y+colly, "alph")
  142. tpt.set_property("temp",atemp+100,i)
  143. tpt.set_property("tmp", 231, i)
  144. tpt.set_property("type","pa",i)
  145. end
  146. if chance > 26 then
  147. tpt.set_property("type","uran",i)
  148. end
  149. end
  150. end
  151. if tpt.get_property("tmp", i) == 236 then
  152. if math.random(1,6000) == 2 then
  153. if chance < 873001 then
  154. tpt.set_property("type","uran",i)
  155. end
  156. if chance > 873000 and chance < 998001 then
  157. tpt.create(x+collx, y+colly, "elec")
  158. tpt.set_property("temp",atemp+100,i)
  159. tpt.set_property("type","plut",i)
  160. end
  161. if chance > 998000 then
  162. tpt.create(x+collx, y+colly, "alph")
  163. tpt.set_property("temp",atemp+100,i)
  164. tpt.set_property("tmp", 232, i)
  165. tpt.set_property("type","pa",i)
  166. end
  167. end
  168. end
  169. if tpt.get_property("tmp", i) == 237 then
  170. if math.random(1,10000) == 2 then
  171. tpt.create(x+collx, y+colly, "alph")
  172. tpt.set_property("temp",atemp+100,i)
  173. tpt.set_property("tmp", 233, i)
  174. tpt.set_property("type","pa",i)
  175. end
  176. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  177. tpt.delete(x+collx, y+colly)
  178. tpt.set_property("tmp", 238, i)
  179. end
  180. end
  181. if tpt.get_property("tmp", i) == 238 then
  182. if math.random(1,500) == 2 then
  183. tpt.create(x+collx, y+colly, "elec")
  184. tpt.set_property("temp",atemp+100,i)
  185. tpt.set_property("type","plut",i)
  186. end
  187. end
  188. if tpt.get_property("tmp", i) == 239 then
  189. if math.random(1,300) == 2 then
  190. tpt.create(x+collx, y+colly, "elec")
  191. tpt.set_property("temp",atemp+100,i)
  192. tpt.set_property("type","plut",i)
  193. end
  194. end
  195.  
  196. if tpt.get_property("tmp", i) == 240 then
  197. if math.random(1,300) == 2 then
  198. tpt.create(x+collx, y+colly, "elec")
  199. tpt.set_property("temp",atemp+100,i)
  200. tpt.set_property("type","plut",i)
  201. end
  202. end
  203. end
  204. tpt.element_func(Np, tpt.element('np'))
  205.  
  206. ----------------------------------
  207.  
  208. Thor = elements.allocate("Thor", "THOR")
  209. elements.element(Thor, elements.element(elements.DEFAULT_PT_PLUT))
  210. elements.property(Thor, "Name", "THOR")
  211. elements.property(Thor, "Description", "Thorium, fissile.")
  212. elements.property(Thor, "Colour", 0x333333)
  213. elements.property(Thor, "MenuSection", 10)
  214. elements.property(Thor, "Properties", 0x6621)
  215.  
  216. local function Thor(i,x,y,s,nt)
  217. local collx = math.random(-1,1)
  218. local colly = math.random(-1,1)
  219. local atemp = tpt.get_property("temp", i)
  220. if tpt.get_property("tmp2", i) == 0 then
  221. if tpt.get_property("tmp", i) == 0 then
  222. tpt.set_property("tmp",200,i)
  223. tpt.set_property("tmp2",10,i)
  224. end
  225. end
  226. if tpt.get_property("tmp", i) == 200 then
  227. if tpt.get_property("tmp2", i) == 0 then
  228. tpt.set_property("type", "stne", i)
  229. end
  230. end
  231. local atmp2 = tpt.get_property("tmp2", i)
  232. local atemp = tpt.get_property("temp", i)
  233. if tpt.get_property("ctype",i) == tpt.element('neut') then
  234. if math.random(1,3) == 1 then
  235. tpt.set_property("tmp2",atmp2-1,i)
  236. tpt.set_property("temp",atemp+1000,i)
  237. tpt.set_property("ctype","none",i)
  238. end
  239. end
  240. if tpt.get_property("type", x+collx, y+colly) == tpt.element('ligh') then
  241. tpt.set_property("type","ligh",i)
  242. end
  243. if tpt.get_property("tmp2", i) > 0 then
  244. tpt.set_property("vx", 0 , i)
  245. tpt.set_property("vy", 0 , i)
  246. end
  247. if tpt.get_property("temp", i) >= 2023 then
  248. tpt.set_property("type","lava",i)
  249. tpt.set_property("ctype","thor",i)
  250. if tpt.get_property("tmp", i) > 200 then
  251. tpt.set_property("tmp2", 0 , i)
  252. end
  253. end
  254.  
  255. if tpt.get_property("tmp", i) == 227 then
  256. if math.random(1,100) == 2 then
  257. tpt.create(x+collx, y+colly, "alph")
  258. tpt.set_property("tmp2", 1 , i)
  259. tpt.set_property("temp",atemp+100,i)
  260. tpt.set_property("tmp", 223 , i)
  261. tpt.set_property("type","radi",i)
  262. end
  263. end
  264.  
  265. if tpt.get_property("tmp", i) == 228 then
  266. if math.random(1,500) == 2 then
  267. tpt.create(x+collx, y+colly, "alph")
  268. tpt.set_property("tmp2", 1 , i)
  269. tpt.set_property("temp",atemp+100,i)
  270. tpt.set_property("tmp", 224 , i)
  271. tpt.set_property("type","radi",i)
  272. end
  273. end
  274.  
  275. if tpt.get_property("tmp", i) == 230 then
  276. if math.random(1,35000) == 2 then
  277. tpt.create(x+collx, y+colly, "alph")
  278. tpt.set_property("tmp2", 1 , i)
  279. tpt.set_property("temp",atemp+100,i)
  280. tpt.set_property("tmp", 226 , i)
  281. tpt.set_property("type","radi",i)
  282. end
  283. end
  284.  
  285. if tpt.get_property("tmp", i) == 231 then
  286. if math.random(1,250) == 2 then
  287. tpt.create(x+collx, y+colly, "elec")
  288. tpt.set_property("temp",atemp+100,i)
  289. tpt.set_property("type","pa",i)
  290. end
  291. end
  292.  
  293. if tpt.get_property("tmp", i) == 232 then
  294. if math.random(1,60000) == 2 then
  295. tpt.create(x+collx, y+colly, "alph")
  296. tpt.set_property("tmp2", 1 , i)
  297. tpt.set_property("temp",atemp+100,i)
  298. tpt.set_property("tmp", 228 , i)
  299. tpt.set_property("type","radi",i)
  300. end
  301. end
  302.  
  303. if tpt.get_property("tmp", i) == 234 then
  304. if math.random(1,500) == 2 then
  305. tpt.create(x+collx, y+colly, "elec")
  306. tpt.set_property("temp",atemp+100,i)
  307. tpt.set_property("type","pa",i)
  308. end
  309. end
  310. end
  311. tpt.element_func(Thor, tpt.element('thor'))
  312.  
  313. local function Lava(i,x,y,s,nt)
  314. if tpt.get_property("ctype",i) == tpt.element('thor') then
  315. if tpt.get_property("temp", i) < 2023 then
  316. tpt.set_property("type","thor",i)
  317. end
  318. end
  319. if tpt.get_property("ctype",i) == tpt.element('lead') then
  320. if tpt.get_property("temp", i) < 600 then
  321. tpt.set_property("type","lead",i)
  322. end
  323. end
  324. end
  325. tpt.element_func(Lava, tpt.element('lava'))
  326.  
  327. local function Sprk(i,x,y,s,nt)
  328. if tpt.get_property("ctype",i) == tpt.element('thor') then
  329. if tpt.get_property("life",i) == 1 then
  330. tpt.set_property("life", 64 ,i)
  331. tpt.set_property("type","thor",i)
  332. end
  333. end
  334. if tpt.get_property("ctype", i) == tpt.element('radn') then
  335. if tpt.get_property("life", i) == 1 then
  336. tpt.set_property("type", "plsm", i)
  337. tpt.set_property("ctype", "radn", i)
  338. tpt.set_property("temp", 3500 ,i)
  339. tpt.set_property("life", math.random(50,200) ,i)
  340. end
  341. end
  342. end
  343. tpt.element_func(Sprk, tpt.element('sprk'))
  344.  
  345. ----------------------------------
  346.  
  347. function Neut(i,x,y,s,n)
  348. local collx = math.random(-1,1)
  349. local colly = math.random(-1,1)
  350. if tpt.get_property("type", x+collx, y+colly) == tpt.element('uran') then
  351. if tpt.get_property("tmp", x+collx, y+colly) == 235 then
  352. if math.random(10,30) == 10 then
  353. tpt.create(x+collx, y+colly, 'neut')
  354. end
  355. end
  356. end
  357.  
  358. if tpt.get_property("type", x+collx, y+colly) == tpt.element('thor') then
  359. if tpt.get_property("tmp", x+collx, y+colly) == 200 then
  360. if math.random(1,100) == 1 then
  361. tpt.set_property("ctype","neut",x+collx,y+colly)
  362. tpt.create(x+collx, y+colly, "neut")
  363. tpt.create(x+collx, y+colly, "neut")
  364. end
  365. end
  366. end
  367. end
  368. tpt.element_func(Neut, tpt.element('neut'))
  369.  
  370.  
  371. local Alph = elements.allocate("Alph", "ALPH")
  372.  elements.element(Alph, elements.element(elements.DEFAULT_PT_ELEC))
  373.  elements.property(Alph, "Name", "ALPH")
  374.  elements.property(Alph, "Colour", 0xFFDD00)
  375.  elements.property(Alph, "Description", "Alpha particle.")
  376.  elements.property(Alph, "Weight", -1)
  377.  elements.property(Alph, "HeatConduct", 251)
  378.  elements.property(Alph, "Temperature", 295.15)
  379.  elements.property(Alph, "Properties" , 0x14410)
  380.  elements.property(Alph, "AirLoss", 1)
  381.  elements.property(Alph, "Loss", 1)
  382.  elements.property(Alph, "Collision", -0.99)
  383.  
  384. local function Alph(i, x, y, surround, nt)
  385.       if tpt.get_property("tmp2", i) == 0 then
  386.       local a = (math.random(360)-1) * 0.01745329;
  387.       tpt.set_property("life",680,i)
  388.       tpt.set_property("vx",2*math.cos(a),i)
  389.       tpt.set_property("vy",2*math.sin(a),i)
  390.       tpt.set_property("tmp2", 1, i)
  391.    end
  392.  
  393. local collx = math.random(-1,1)
  394. local colly = math.random(-1,1)
  395. if tpt.get_property("type", x+collx, y+colly) == tpt.element('elec') then
  396. tpt.delete(x+collx, y+colly)
  397. tpt.set_property("type", "plsm", i)
  398. tpt.set_property("ctype", "nble", i)
  399. tpt.set_property("life", 1000, i)
  400. end
  401. end
  402. tpt.element_func(Alph, tpt.element('alph'))
  403.  
  404.  
  405.  
  406. Pa = elements.allocate("Pa", "PA")
  407. elements.element(Pa, elements.element(elements.DEFAULT_PT_BRMT))
  408. elements.property(Pa, "Name", "PA")
  409. elements.property(Pa, "Description", "Protactinium.")
  410. elements.property(Pa, "MenuVisible", 0)
  411. elements.property(Pa, "Colour", 0xE0B12D)
  412. elements.property(Pa, "Properties", 0x2401)
  413.  
  414. local function Pa(i,x,y,s,nt)
  415. local collx = math.random(-1,1)
  416. local colly = math.random(-1,1)
  417. local atemp = tpt.get_property("temp", i)
  418. if tpt.get_property("tmp", i) == 231 then
  419. if math.random(1,40000) == 2 then
  420. tpt.create(x+collx, y+colly, "alph")
  421. tpt.set_property("tmp", 227, i)
  422. tpt.set_property("type","ac",i)
  423. end
  424. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  425. if math.random(1,5) == 1 then
  426. tpt.set_property("tmp", 232, i)
  427. end
  428. end
  429. end
  430.  
  431. if tpt.get_property("tmp", i) == 233 then
  432. if math.random(1,400) == 2 then
  433. tpt.create(x+collx, y+colly, "elec")
  434. tpt.set_property("temp",atemp+100,i)
  435. tpt.set_property("type","uran",i)
  436. end
  437. end
  438.  
  439. if tpt.get_property("tmp", i) == 234 then
  440. if math.random(1,50) == 2 then
  441. tpt.create(x+collx, y+colly, "elec")
  442. tpt.set_property("temp",atemp+100,i)
  443. tpt.set_property("type","uran",i)
  444. end
  445. end
  446. end
  447. tpt.element_func(Pa, tpt.element('pa'))
  448.  
  449.  
  450.  
  451. Ac = elements.allocate("Ac", "Ac")
  452. elements.element(Ac, elements.element(elements.DEFAULT_PT_BRMT))
  453. elements.property(Ac, "Name", "AC")
  454. elements.property(Ac, "Description", "Actinium.")
  455. elements.property(Ac, "MenuVisible", 0)
  456. elements.property(Ac, "Colour", 0xE73A4A)
  457. elements.property(Ac, "Properties", 0x2401)
  458.  
  459. local function Ac(i,x,y,s,nt)
  460. local collx = math.random(-1,1)
  461. local colly = math.random(-1,1)
  462. local atemp = tpt.get_property("temp", i)
  463. local chance = math.random(1,10000)
  464. if tpt.get_property("tmp", i) == 227 then
  465. if math.random(1,500) == 2 then
  466. if chance < 9863 then
  467. tpt.create(x+collx, y+colly, "elec")
  468. tpt.set_property("temp",atemp+100,i)
  469. tpt.set_property("type","thor",i)
  470. end
  471. if chance > 9862 then
  472. tpt.create(x+collx, y+colly, "alph")
  473. tpt.set_property("temp",atemp+100,i)
  474. tpt.set_property("tmp", 223, i)
  475. tpt.set_property("type","fran",i)
  476. end
  477. end
  478. end
  479. if tpt.get_property("tmp", i) == 228 then
  480. if math.random(1,50) == 2 then
  481. tpt.create(x+collx, y+colly, "elec")
  482. tpt.set_property("temp",atemp+100,i)
  483. tpt.set_property("type","thor",i)
  484. end
  485. end
  486. end
  487. tpt.element_func(Ac, tpt.element('ac'))
  488.  
  489.  
  490.  
  491. Po = elements.allocate("Po", "PO")
  492. elements.element(Po, elements.element(elements.DEFAULT_PT_BRMT))
  493. elements.property(Po, "Name", "PO")
  494. elements.property(Po, "Description", "Polonium.")
  495. elements.property(Po, "MenuVisible", 0)
  496. elements.property(Po, "Colour", 0x2E398D)
  497. elements.property(Po, "Properties", 0x2401)
  498.  
  499. local function Po(i,x,y,s,nt)
  500. local collx = math.random(-1,1)
  501. local colly = math.random(-1,1)
  502. local atemp = tpt.get_property("temp", i)
  503. local chance = math.random(1,10000)
  504. if tpt.get_property("tmp", i) == 210 then
  505. if math.random(1,5) == 2 then
  506. tpt.create(x+collx, y+colly, "alph")
  507. tpt.set_property("temp",atemp+100,i)
  508. tpt.set_property("tmp", 206, i)
  509. tpt.set_property("type","lead",i)
  510. end
  511. end
  512.  
  513. if tpt.get_property("tmp", i) == 211 then
  514. if math.random(1,3) == 2 then
  515. tpt.create(x+collx, y+colly, "alph")
  516. tpt.set_property("temp",atemp+100,i)
  517. tpt.set_property("tmp", 207, i)
  518. tpt.set_property("type","lead",i)
  519. end
  520. end
  521.  
  522. if tpt.get_property("tmp", i) == 212 then
  523. if math.random(1,3) == 2 then
  524. tpt.create(x+collx, y+colly, "alph")
  525. tpt.set_property("temp",atemp+100,i)
  526. tpt.set_property("tmp", 208, i)
  527. tpt.set_property("type","lead",i)
  528. end
  529. end
  530.  
  531. if tpt.get_property("tmp", i) == 214 then
  532. if math.random(1,5) == 2 then
  533. tpt.create(x+collx, y+colly, "alph")
  534. tpt.set_property("temp",atemp+100,i)
  535. tpt.set_property("tmp", 210, i)
  536. tpt.set_property("type","lead",i)
  537. end
  538. end
  539.  
  540. if tpt.get_property("tmp", i) == 215 then
  541. if math.random(1,3) == 2 then
  542. if chance > 23 then
  543. tpt.create(x+collx, y+colly, "alph")
  544. tpt.set_property("temp",atemp+100,i)
  545. tpt.set_property("tmp", 211, i)
  546. tpt.set_property("type","lead",i)
  547. end
  548. if chance < 24 then
  549. tpt.create(x+collx, y+colly, "elec")
  550. tpt.set_property("temp",atemp+100,i)
  551. tpt.set_property("type","at",i)
  552. end
  553. end
  554. end
  555.  
  556. if tpt.get_property("tmp", i) == 216 then
  557. if math.random(1,3) == 2 then
  558. tpt.create(x+collx, y+colly, "alph")
  559. tpt.set_property("temp",atemp+100,i)
  560. tpt.set_property("tmp", 212, i)
  561. tpt.set_property("type","lead",i)
  562. end
  563. end
  564.  
  565. if tpt.get_property("tmp", i) == 218 then
  566. if math.random(1,20) == 2 then
  567. if chance < 9999 then
  568. tpt.create(x+collx, y+colly, "alph")
  569. tpt.set_property("temp",atemp+100,i)
  570. tpt.set_property("tmp", 214, i)
  571. tpt.set_property("type","lead",i)
  572. end
  573. if chance > 9998 then
  574. tpt.create(x+collx, y+colly, "elec")
  575. tpt.set_property("temp",atemp+100,i)
  576. tpt.set_property("type","at",i)
  577. end
  578. end
  579. end
  580.  
  581. end
  582. tpt.element_func(Po, tpt.element('po'))
  583.  
  584. At = elements.allocate("At", "AT")
  585. elements.element(At, elements.element(elements.DEFAULT_PT_BRMT))
  586. elements.property(At, "Name", "AT")
  587. elements.property(At, "Description", "Astatine.")
  588. elements.property(At, "MenuVisible", 0)
  589. elements.property(At, "Colour", 0xA38E27)
  590. elements.property(At, "Properties", 0x2401)
  591.  
  592. local function At(i,x,y,s,nt)
  593. local collx = math.random(-1,1)
  594. local colly = math.random(-1,1)
  595. local atemp = tpt.get_property("temp", i)
  596. local chance = math.random(1,10000)
  597. if tpt.get_property("tmp", i) == 215 then
  598. if math.random(1,5) == 2 then
  599. tpt.create(x+collx, y+colly, "alph")
  600. tpt.set_property("temp",atemp+100,i)
  601. tpt.set_property("tmp", 211, i)
  602. tpt.set_property("type","bmth",i)
  603. end
  604. end
  605.  
  606. if tpt.get_property("tmp", i) == 219 then
  607. if math.random(1,5) == 2 then
  608. if chance < 9701 then
  609. tpt.create(x+collx, y+colly, "alph")
  610. tpt.set_property("temp",atemp+100,i)
  611. tpt.set_property("tmp", 215, i)
  612. tpt.set_property("type","bmth",i)
  613. end
  614. if chance > 9700 then
  615. tpt.create(x+collx, y+colly, "elec")
  616. tpt.set_property("temp",atemp+100,i)
  617. tpt.set_property("type","radn",i)
  618. end
  619. end
  620. end
  621. end
  622. tpt.element_func(At, tpt.element('at'))
  623.  
  624.  
  625.  
  626. Bmth = elements.allocate("Bmth", "BMTH")
  627. elements.element(Bmth, elements.element(elements.DEFAULT_PT_BRMT))
  628. elements.property(Bmth, "Name", "BMTH")
  629. elements.property(Bmth, "Description", "Bismuth.")
  630. elements.property(Bmth, "Colour", 0xF9F9D6)
  631. elements.property(Bmth, "Properties", 0x2401)
  632.  
  633. local function Bmth(i,x,y,s,nt)
  634. local collx = math.random(-1,1)
  635. local colly = math.random(-1,1)
  636. local atemp = tpt.get_property("temp", i)
  637. local chance = math.random(1,100000)
  638.  
  639. if tpt.get_property("tmp", i) == 209 then
  640. if math.random(1,65533) == 2 then
  641. tpt.create(x+collx, y+colly, "alph")
  642. tpt.set_property("temp",atemp+100,i)
  643. tpt.set_property("tmp", 205, i)
  644. tpt.set_property("type","thal",i)
  645. end
  646. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  647. if math.random(1, 5) == 2 then
  648. tpt.delete(x+collx, y+colly)
  649. tpt.set_property("tmp", 210, i)
  650. if tpt.get_property("type", x+collx, y+colly) == tpt.element('none') then
  651. tpt.create(x+collx, y+colly, "phot")
  652. tpt.set_property("ctype", "4177920",x+collx,y+colly)
  653. tpt.set_property("tmp", 1,x+collx,y+colly)
  654. end
  655. end
  656. end
  657. end
  658.  
  659. if tpt.get_property("tmp", i) == 210 then
  660. if math.random(1, 1000) == 2 then
  661. tpt.create(x+collx, y+colly, "elec")
  662. tpt.set_property("temp",atemp+100,i)
  663. tpt.set_property("type","po",i)
  664. end
  665. end
  666.  
  667. if tpt.get_property("tmp", i) == 211 then
  668. if math.random(1, 15) == 2 then
  669. if chance < 99725 then
  670. tpt.create(x+collx, y+colly, "alph")
  671. tpt.set_property("temp",atemp+100,i)
  672. tpt.set_property("tmp", 207, i)
  673. tpt.set_property("type","thal",i)
  674. end
  675. if chance > 99724 then
  676. tpt.create(x+collx, y+colly, "elec")
  677. tpt.set_property("temp",atemp+100,i)
  678. tpt.set_property("type","po",i)
  679. end
  680. end
  681. end
  682.  
  683. if tpt.get_property("tmp", i) == 212 then
  684. if math.random(1, 20) == 2 then
  685. if chance < 64061 then
  686. tpt.create(x+collx, y+colly, "elec")
  687. tpt.set_property("temp",atemp+100,i)
  688. tpt.set_property("type","po",i)
  689. end
  690. if chance > 64060 then
  691. tpt.create(x+collx, y+colly, "alph")
  692. tpt.set_property("temp",atemp+100,i)
  693. tpt.set_property("tmp", 208, i)
  694. tpt.set_property("type","thal",i)
  695. end
  696. end
  697. end
  698.  
  699. if tpt.get_property("tmp", i) == 214 then
  700. if math.random(1, 200) == 2 then
  701. if chance < 99971 then
  702. tpt.create(x+collx, y+colly, "elec")
  703. tpt.set_property("temp",atemp+100,i)
  704. tpt.set_property("type","po",i)
  705. end
  706. if chance > 99970 and chance < 99992 then
  707. tpt.create(x+collx, y+colly, "alph")
  708. tpt.set_property("temp",atemp+100,i)
  709. tpt.set_property("tmp", 210, i)
  710. tpt.set_property("type","thal",i)
  711. end
  712. if chance > 99991 then
  713. tpt.create(x+collx, y+colly, "elec")
  714. tpt.create(x+collx, y+colly, "alph")
  715. tpt.set_property("temp",atemp+100,i)
  716. tpt.set_property("tmp", 210, i)
  717. tpt.set_property("type","lead",i)
  718. end
  719. end
  720. end
  721.  
  722. if tpt.get_property("tmp", i) == 215 then
  723. if math.random(1, 50) == 2 then
  724. tpt.create(x+collx, y+colly, "elec")
  725. tpt.set_property("temp",atemp+100,i)
  726. tpt.set_property("type","po",i)
  727. end
  728. end
  729. end
  730. tpt.element_func(Bmth, tpt.element('bmth'))
  731.  
  732.  
  733.  
  734. Lead = elements.allocate("Lead", "LEAD")
  735. elements.element(Lead, elements.element(elements.DEFAULT_PT_BRMT))
  736. elements.property(Lead, "Name", "LEAD")
  737. elements.property(Lead, "Description", "Lead.")
  738. elements.property(Lead, "MenuVisible", 0)
  739. elements.property(Lead, "Colour", 0x3E3E3E)
  740. elements.property(Lead, "Properties", 0x2401)
  741.  
  742. local function Lead(i,x,y,s,nt)
  743. local collx = math.random(-1,1)
  744. local colly = math.random(-1,1)
  745. local atemp = tpt.get_property("temp", i)
  746. if tpt.get_property("tmp", i) == 0 then
  747. tpt.set_property("tmp", 206, i)
  748. end
  749. if tpt.get_property("tmp", i) == 209 then
  750. if math.random(1,90) == 2 then
  751. tpt.create(x+collx, y+colly, "elec")
  752. tpt.set_property("temp",atemp+100,i)
  753. tpt.set_property("tmp2", 0, i)
  754. tpt.set_property("type","bmth",i)
  755. end
  756. end
  757.  
  758. if tpt.get_property("tmp", i) == 210 then
  759. if math.random(1,900) == 2 then
  760. tpt.create(x+collx, y+colly, "elec")
  761. tpt.set_property("temp",atemp+100,i)
  762. tpt.set_property("tmp2", 0, i)
  763. tpt.set_property("type","bmth",i)
  764. end
  765. end
  766.  
  767. if tpt.get_property("tmp", i) == 211 then
  768. if math.random(1,25) == 2 then
  769. tpt.create(x+collx, y+colly, "elec")
  770. tpt.set_property("temp",atemp+100,i)
  771. tpt.set_property("tmp2", 0, i)
  772. tpt.set_property("type","bmth",i)
  773. end
  774. end
  775.  
  776. if tpt.get_property("tmp", i) == 212 then
  777. if math.random(1,50) == 2 then
  778. tpt.create(x+collx, y+colly, "elec")
  779. tpt.set_property("temp",atemp+100,i)
  780. tpt.set_property("tmp2", 0, i)
  781. tpt.set_property("type","bmth",i)
  782. end
  783. end
  784.  
  785. if tpt.get_property("tmp", i) == 214 then
  786. if math.random(1,500) == 2 then
  787. tpt.create(x+collx, y+colly, "elec")
  788. tpt.set_property("temp",atemp+100,i)
  789. tpt.set_property("tmp2", 0, i)
  790. tpt.set_property("type","bmth",i)
  791. end
  792. end
  793.  
  794. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  795. if math.random(1, 5) == 2 then
  796. if tpt.get_property("tmp", i) == 208 then
  797. tpt.delete(x+collx, y+colly)
  798. tpt.set_property("tmp", 209, i)
  799. end
  800. if tpt.get_property("tmp", i) == 207 then
  801. tpt.delete(x+collx, y+colly)
  802. tpt.set_property("tmp", 208, i)
  803. end
  804. if tpt.get_property("tmp", i) == 206 then
  805. tpt.delete(x+collx, y+colly)
  806. tpt.set_property("tmp", 207, i)
  807. end
  808. end
  809. end
  810. if tpt.get_property("tmp2", i) == 1 then
  811. tpt.set_property("vx", 0 , i)
  812. tpt.set_property("vy", 0 , i)
  813. end
  814. if tpt.get_property("temp", i) >= 600 then
  815. tpt.set_property("type","lava",i)
  816. tpt.set_property("ctype","lead",i)
  817. end
  818. end
  819. tpt.element_func(Lead, tpt.element('lead'))
  820.  
  821.  
  822.  
  823. Thal = elements.allocate("Thal", "THAL")
  824. elements.element(Thal, elements.element(elements.DEFAULT_PT_BRMT))
  825. elements.property(Thal, "Name", "THAL")
  826. elements.property(Thal, "Description", "Thallium.")
  827. elements.property(Thal, "MenuVisible", 0)
  828. elements.property(Thal, "Colour", 0x86847D)
  829. elements.property(Thal, "Properties", 0x2401)
  830.  
  831. local function Thal(i,x,y,s,nt)
  832. local collx = math.random(-1,1)
  833. local colly = math.random(-1,1)
  834. local atemp = tpt.get_property("temp", i)
  835. if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') then
  836. if math.random(1,5) == 2 then
  837. if tpt.get_property("tmp", i) == 205 then
  838. tpt.delete(x+collx, y+colly)
  839. tpt.set_property("tmp", 206, i)
  840. end
  841. end
  842. end
  843.  
  844. if tpt.get_property("tmp", i) == 206 then
  845. if math.random(1,15) == 2 then
  846. tpt.create(x+collx, y+colly, "elec")
  847. tpt.set_property("temp",atemp+100,i)
  848. tpt.set_property("type","lead",i)
  849. end
  850. end
  851.  
  852. if tpt.get_property("tmp", i) == 207 then
  853. if math.random(1,15) == 2 then
  854. tpt.create(x+collx, y+colly, "elec")
  855. tpt.set_property("temp",atemp+100,i)
  856. tpt.set_property("type","lead",i)
  857. end
  858. end
  859.  
  860. if tpt.get_property("tmp", i) == 208 then
  861. if math.random(1,20) == 2 then
  862. tpt.create(x+collx, y+colly, "elec")
  863. tpt.set_property("temp",atemp+100,i)
  864. tpt.set_property("type","lead",i)
  865. end
  866. end
  867. end
  868. tpt.element_func(Thal, tpt.element('thal'))
  869.  
  870.  
  871.  
  872. local function Plut(i,x,y,s,nt)
  873. local collx = math.random(-1,1)
  874. local colly = math.random(-1,1)
  875. local atemp = tpt.get_property("temp", i)
  876. if tpt.get_property("tmp", i) == 239 then
  877. if math.random(1,12000) == 2 then
  878. tpt.create(x+collx, y+colly, "alph")
  879. tpt.set_property("temp",atemp+100,i)
  880. tpt.set_property("tmp", 235, i)
  881. tpt.set_property("type","uran",i)
  882. end
  883. end
  884. if tpt.get_property("tmp", i) == 240 then
  885. if math.random(1,12000) == 2 then
  886. tpt.create(x+collx, y+colly, "alph")
  887. tpt.set_property("temp",atemp+100,i)
  888. tpt.set_property("tmp", 236, i)
  889. tpt.set_property("type","uran",i)
  890. end
  891. end
  892. if tpt.get_property("tmp2", i) == 1 then
  893. tpt.set_property("vx", 0 , i)
  894. tpt.set_property("vy", 0 , i)
  895. end
  896. end
  897. tpt.element_func(Plut, tpt.element('plut'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement