Advertisement
_kevak

CHEM-MOD v1.2.2B

Nov 12th, 2023
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 178.38 KB | Gaming | 0 0
  1. ---Made by: KevAK---
  2.  
  3. ---CHEMMOD V1.2.2B Made in July, 2017.---
  4.  
  5. ---Please report any bug or error.---
  6.  
  7.  
  8.  
  9. print(" CHEM-MOD V 1.2.2B By Kev AK        ")
  10. print(" Organic and Inorganic Chemistry!  ")
  11. print(" I wish you have fun.              ")
  12. print("-----------------------------------")
  13.  
  14.  
  15. -----GASES-------------------------------------------------------------------------------------------------------------------
  16. local nitrogen = elem.allocate("KEV", "N2")
  17. local nitrogenoxide = elem.allocate("KEV", "N2O")
  18. local ozone = elem.allocate("KEV", "O3")
  19. local ammonia = elem.allocate("KEV", "NH3")
  20. local nitromethane = elem.allocate("KEV", "CH3NO")
  21. local methane = elem.allocate("KEV", "CH4")
  22. local carbonmonoxide = elem.allocate("KEV", "CO")
  23. local hydrazine = elem.allocate("KEV", "N2H4")
  24. local tetracloromethane = elem.allocate("KEV", "R32")
  25. local sulfuroxide = elem.allocate("KEV", "S2O")
  26. local chlorine = elem.allocate("KEV", "CL")
  27. local iodinevapor = elem.allocate("KEV", "IODV")
  28. elem.element(elements.KEV_PT_N2, elem.element(elem.DEFAULT_PT_WTRV))
  29. elem.element(elements.KEV_PT_N2O, elem.element(elem.DEFAULT_PT_WTRV))
  30. elem.element(elements.KEV_PT_O3, elem.element(elem.DEFAULT_PT_WTRV))
  31. elem.element(elements.KEV_PT_NH3, elem.element(elem.DEFAULT_PT_WTRV))
  32. elem.element(elements.KEV_PT_CH3NO, elem.element(elem.DEFAULT_PT_WTRV))
  33. elem.element(elements.KEV_PT_CH4, elem.element(elem.DEFAULT_PT_WTRV))
  34. elem.element(elements.KEV_PT_CO, elem.element(elem.DEFAULT_PT_WTRV))
  35. elem.element(elements.KEV_PT_N2H4, elem.element(elem.DEFAULT_PT_WTRV))
  36. elem.element(elements.KEV_PT_R32, elem.element(elem.DEFAULT_PT_BOYL))
  37. elem.element(elements.KEV_PT_S2O, elem.element(elem.DEFAULT_PT_WTRV))
  38. elem.element(elements.KEV_PT_CL, elem.element(elem.DEFAULT_PT_WTRV))
  39. elem.element(iodinevapor, elem.element(elem.DEFAULT_PT_BOYL))
  40. elem.property(elements.KEV_PT_N2, "Name", "N2")
  41. elem.property(elements.KEV_PT_N2O, "Name", "N2O")
  42. elem.property(elements.KEV_PT_O3, "Name", "O3")
  43. elem.property(elements.KEV_PT_NH3, "Name", "NH3")
  44. elem.property(elements.KEV_PT_CH3NO, "Name", "CH3NO")
  45. elem.property(elements.KEV_PT_CH4, "Name", "CH4")
  46. elem.property(elements.KEV_PT_CO, "Name", "CO")
  47. elem.property(elements.KEV_PT_N2H4, "Name", "N2H4")
  48. elem.property(elements.KEV_PT_R32, "Name", "R-32")
  49. elem.property(elements.KEV_PT_S2O, "Name", "S2O")
  50. elem.property(elements.KEV_PT_CL, "Name", "CL")
  51. elem.property(iodinevapor, "Name", "IODV")
  52. elem.property(elements.KEV_PT_N2, "Description", "Nitrogen. Basic for life.")
  53. elem.property(elements.KEV_PT_N2O, "Description", "Nitrous Oxide. Explosive, try to mix it with WATR.")
  54. elem.property(elements.KEV_PT_O3, "Description", "Ozone. An comburent oxygen isotope.")
  55. elem.property(elements.KEV_PT_NH3, "Description", "Amoniac. Caustic but useful.")
  56. elem.property(elements.KEV_PT_CH3NO, "Description", "Nitromethane. Highly sensitive explosive, hard to be synthetized.")
  57. elem.property(elements.KEV_PT_CH4, "Description", "Methane. Burns easily. Explodes in contact with other gases.")
  58. elem.property(elements.KEV_PT_CO, "Description", "Carbon Monoxide. Flammable and low reactive.")
  59. elem.property(elements.KEV_PT_N2H4, "Description", "Hydrazine. Very reactive combustible, slowly descomposes into HYGN.")
  60. elem.property(elements.KEV_PT_R32, "Description", "Difluoromethane. Freon 32. Refrigerant.")
  61. elem.property(elements.KEV_PT_S2O, "Description", "Sulfur Monoxide. Smells bad but useful.")
  62. elem.property(elements.KEV_PT_CL, "Description", "Chlorine. Corrosive and toxic.")
  63. elem.property(iodinevapor, "Description", "Iodine Vapor. As a tip it´s the best way to make NI3.")
  64. elem.property(elements.KEV_PT_N2, "Color", 0x2DCB99)
  65. elem.property(elements.KEV_PT_N2O, "Color", 0x29CED0)
  66. elem.property(elements.KEV_PT_O3, "Color", 0xAEEEEE)
  67. elem.property(elements.KEV_PT_NH3, "Color", 0xB4EEB4)
  68. elem.property(elements.KEV_PT_CH3NO, "Color", 0xD1D1D1)
  69. elem.property(elements.KEV_PT_CH4, "Color", 0xE6E6FA)
  70. elem.property(elements.KEV_PT_CO, "Color", 0x808080)
  71. elem.property(elements.KEV_PT_N2H4, "Color", 0x8DB6CD)
  72. elem.property(elements.KEV_PT_R32, "Color", 0xFFC125)
  73. elem.property(elements.KEV_PT_S2O, "Color", 0xFA8073)
  74. elem.property(elements.KEV_PT_CL, "Color", 0xA0FA9B)
  75. elem.property(iodinevapor, "Color", 0xC40470)
  76. elem.property(elements.KEV_PT_N2, "Flammable", 0)
  77. elem.property(elements.KEV_PT_N2O, "Flammable", 350)
  78. elem.property(elements.KEV_PT_O3, "Flammable", 0)
  79. elem.property(elements.KEV_PT_NH3, "Flammable", 750)
  80. elem.property(elements.KEV_PT_CH3NO, "Flammable", 790)
  81. elem.property(elements.KEV_PT_CH4, "Flammable", 780)
  82. elem.property(elements.KEV_PT_CO, "Flammable", 125)
  83. elem.property(elements.KEV_PT_N2H4, "Flammable", 1450)
  84. elem.property(elements.KEV_PT_R32, "Flammable", 0)
  85. elem.property(elements.KEV_PT_S2O, "Flammable", 0)
  86. elem.property(elements.KEV_PT_CL, "Flammable", 0)
  87. elem.property(iodinevapor, "Flammable", 0)
  88. elem.property(elements.KEV_PT_N2, "Explosive", 0)
  89. elem.property(elements.KEV_PT_N2O, "Explosive", 300)
  90. elem.property(elements.KEV_PT_O3, "Explosive", 0)
  91. elem.property(elements.KEV_PT_NH3, "Explosive", 750)
  92. elem.property(elements.KEV_PT_CH3NO, "Explosive", 950)
  93. elem.property(elements.KEV_PT_CH4, "Explosive", 900)
  94. elem.property(elements.KEV_PT_CO, "Explosive", 125)
  95. elem.property(elements.KEV_PT_N2H4, "Explosive", 1550)
  96. elem.property(elements.KEV_PT_R32, "Explosive", 0)
  97. elem.property(elements.KEV_PT_S2O, "Explosive", 200)
  98. elem.property(elements.KEV_PT_CL, "Explosive", 0)
  99. elem.property(iodinevapor, "Explosive", 120)
  100. elem.property(elements.KEV_PT_N2, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  101. elem.property(elements.KEV_PT_N2O, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  102. elem.property(elements.KEV_PT_O3, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  103. elem.property(elements.KEV_PT_NH3, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  104. elem.property(elements.KEV_PT_CH3NO, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  105. elem.property(elements.KEV_PT_CH4, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  106. elem.property(elements.KEV_PT_CO, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  107. elem.property(elements.KEV_PT_N2H4, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  108. elem.property(elements.KEV_PT_R32, "Properties", elem.TYPE_GAS+elem.PROP_NOAMBHEAT+elem.PROP_DEADLY+elem.PROP_NEUTPASS)
  109. elem.property(elements.KEV_PT_S2O, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  110. elem.property(elements.KEV_PT_CL, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  111. elem.property(iodinevapor, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
  112. elem.property(elements.KEV_PT_N2O, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  113. elem.property(elements.KEV_PT_O3, "HighTemperatureTransition", elem.DEFAULT_PT_OXYG)
  114. elem.property(elements.KEV_PT_NH3, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  115. elem.property(elements.KEV_PT_CH3NO, "HighTemperatureTransition", elem.DEFAULT_PT_PLSM)
  116. elem.property(elements.KEV_PT_CH4, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  117. elem.property(elements.KEV_PT_CO, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  118. elem.property(elements.KEV_PT_N2H4, "HighTemperatureTransition", elem.DEFAULT_PT_PLSM)
  119. elem.property(elements.KEV_PT_R32, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  120. elem.property(elements.KEV_PT_S2O, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  121. elem.property(iodinevapor, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  122. elem.property(elements.KEV_PT_N2O, "HighTemperature", 800.15)
  123. elem.property(elements.KEV_PT_O3, "HighTemperature", 493.15)
  124. elem.property(elements.KEV_PT_NH3, "HighTemperature", 934.15)
  125. elem.property(elements.KEV_PT_CH3NO, "HighTemperature", 790.15)
  126. elem.property(elements.KEV_PT_CH4, "HighTemperature", 810.15)
  127. elem.property(elements.KEV_PT_CO, "HighTemperature", 1837.15)
  128. elem.property(elements.KEV_PT_N2H4, "HighTemperature", 856.15)
  129. elem.property(elements.KEV_PT_R32, "HighTemperature", 2630.15)
  130. elem.property(elements.KEV_PT_S2O, "HighTemperature", 765.15)
  131. elem.property(iodinevapor, "HighTemperature", 750.15)
  132. elem.property(elements.KEV_PT_R32, "Temperature", 0.15)
  133. elem.property(elements.KEV_PT_N2, "LowTemperature", 180.15)
  134. elem.property(elements.KEV_PT_N2, "LowTemperatureTransition", elem.DEFAULT_PT_LN2)
  135. elem.property(elements.KEV_PT_N2O, "LowTemperature", 180.15)
  136. elem.property(elements.KEV_PT_N2O, "LowTemperatureTransition", elem.DEFAULT_PT_LN2)
  137. elem.property(elements.KEV_PT_N2, "HighPressureTransition", elem.DEFAULT_PT_LN2)
  138. elem.property(elements.KEV_PT_N2O, "HighPressureTransition", elem.DEFAULT_PT_LN2)
  139. elem.property(elements.KEV_PT_O3, "HighPressureTransition", elem.DEFAULT_PT_OXYG)
  140. elem.property(elements.KEV_PT_NH3, "HighPressureTransition", elem.DEFAULT_PT_FIRE)
  141. elem.property(elements.KEV_PT_CH3NO, "HighPressureTransition", elem.DEFAULT_PT_PLSM)
  142. elem.property(elements.KEV_PT_CH4, "HighPressureTransition", elem.DEFAULT_PT_FIRE)
  143. elem.property(elements.KEV_PT_CO, "HighPressureTransition", elem.DEFAULT_PT_FIRE)
  144. elem.property(elements.KEV_PT_N2H4, "HighPressureTransition", elem.DEFAULT_PT_PLSM)
  145. elem.property(elements.KEV_PT_R32, "HighPressureTransition", elem.DEFAULT_PT_FIRE)
  146. elem.property(elements.KEV_PT_S2O, "HighPressureTransition", elem.DEFAULT_PT_FIRE)
  147. elem.property(iodinevapor, "HighPressureTransition", iodine)
  148. elem.property(elements.KEV_PT_N2, "HighPressure", 90)
  149. elem.property(elements.KEV_PT_N2O, "HighPressure", 140)
  150. elem.property(elements.KEV_PT_O3, "HighPressure", 30)
  151. elem.property(elements.KEV_PT_NH3, "HighPressure", 225)
  152. elem.property(elements.KEV_PT_CH3NO, "HighPressure", 125)
  153. elem.property(elements.KEV_PT_CH4, "HighPressure", 78)
  154. elem.property(elements.KEV_PT_CO, "HighPressure", 110)
  155. elem.property(elements.KEV_PT_N2H4, "HighPressure", 90)
  156. elem.property(elements.KEV_PT_R32, "HighPressure", 160)
  157. elem.property(elements.KEV_PT_S2O, "HighPressure", 190)
  158. elem.property(iodinevapor, "HighPressure", 10)
  159. elem.property(elements.KEV_PT_N2, "Weight", 7)
  160. elem.property(elements.KEV_PT_N2O, "Weight", 22)
  161. elem.property(elements.KEV_PT_O3, "Weight", 24)
  162. elem.property(elements.KEV_PT_NH3, "Weight", 10)
  163. elem.property(elements.KEV_PT_CH3NO, "Weight", 20)
  164. elem.property(elements.KEV_PT_CH4, "Weight", 10)
  165. elem.property(elements.KEV_PT_CO, "Weight", 14)
  166. elem.property(elements.KEV_PT_N2H4, "Weight", 18)
  167. elem.property(elements.KEV_PT_R32, "Weight", 48)
  168. elem.property(elements.KEV_PT_S2O, "Weight", 40)
  169. elem.property(elements.KEV_PT_CL, "Weight", 17)
  170. elem.property(iodinevapor, "Weight", 53)
  171. elem.property(elements.KEV_PT_N2, "Diffusion", 1.9)
  172. elem.property(elements.KEV_PT_N2O, "Diffusion", 1.1)
  173. elem.property(elements.KEV_PT_O3, "Diffusion", 0.9)
  174. elem.property(elements.KEV_PT_NH3, "Diffusion", 0.8)
  175. elem.property(elements.KEV_PT_CH3NO, "Diffusion", 0.8)
  176. elem.property(elements.KEV_PT_CH4, "Diffusion", 0.6)
  177. elem.property(elements.KEV_PT_CO, "Diffusion", 0.2)
  178. elem.property(elements.KEV_PT_N2H4, "Diffusion", 0.9)
  179. elem.property(elements.KEV_PT_R32, "Diffusion", 1.2)
  180. elem.property(elements.KEV_PT_S2O, "Diffusion", 0.9)
  181. elem.property(elements.KEV_PT_CL, "Diffusion", 0.7)
  182. elem.property(iodinevapor, "Diffusion", 0.7)
  183. elem.property(elements.KEV_PT_N2, "Advection", 0)
  184. elem.property(elements.KEV_PT_N2O, "Advection", 0.9)
  185. elem.property(elements.KEV_PT_NH3, "Advection", 0.2)
  186. elem.property(elements.KEV_PT_CH4, "Advection",0.1)
  187. elem.property(elements.KEV_PT_CO, "Advection", 0.9)
  188. elem.property(elements.KEV_PT_R32, "Advection", 1.1)
  189. elem.property(elements.KEV_PT_S2O, "Advection", 1)
  190. elem.property(elements.KEV_PT_CL, "Advection", 0.7)
  191. elem.property(iodinevapor, "Advection", 1)
  192. elem.property(elements.KEV_PT_N2, "Gravity", -0.3)
  193. elem.property(elements.KEV_PT_N2O, "Gravity", -0.2)
  194. elem.property(elements.KEV_PT_NH3, "Gravity", 0.02)
  195. elem.property(elements.KEV_PT_CH4, "Gravity", 0.1)
  196. elem.property(elements.KEV_PT_CO, "Gravity", -0.1)
  197. elem.property(elements.KEV_PT_R32, "Gravity", -0.2)
  198. elem.property(elements.KEV_PT_S2O, "Gravity", -0.1)
  199. elem.property(elements.KEV_PT_CL, "Gravity", -0.1)
  200. elem.property(iodinevapor, "Gravity", -0.07)
  201. elem.property(elements.KEV_PT_R32, "HeatConduct", 16)
  202. elem.property(elements.KEV_PT_N2H4, "Hardness", 255)
  203.  
  204. --LIQUIDS--------------------------------------------
  205.  
  206. local hydrogenperoxide = elem.allocate("KEV", "H2O2")
  207. local sulfuricacid = elem.allocate("KEV", "H2SO4")
  208. local nitricacid = elem.allocate("KEV", "HNO3")
  209. local hydrocloric = elem.allocate("KEV", "HCL")
  210. local sodiumhidroxide = elem.allocate("KEV", "NAOH")
  211. local iodine = elem.allocate("KEV", "I")
  212. local toluene = elem.allocate("KEV", "C7H8")
  213. local mud = elem.allocate("KEV", "MUD")
  214. elem.element(elements.KEV_PT_H2O2, elem.element(elem.DEFAULT_PT_WATR))
  215. elem.element(elements.KEV_PT_H2SO4, elem.element(elem.DEFAULT_PT_SOAP))
  216. elem.element(elements.KEV_PT_HCL, elem.element(elem.DEFAULT_PT_SOAP))
  217. elem.element(elements.KEV_PT_HNO3, elem.element(elem.DEFAULT_PT_SOAP))
  218. elem.element(elements.KEV_PT_C7H8, elem.element(elem.DEFAULT_PT_OIL))
  219. elem.element(elements.KEV_PT_NAOH, elem.element(elem.DEFAULT_PT_WATR))
  220. elem.element(iodine, elem.element(elem.DEFAULT_PT_SOAP))
  221. elem.element(elements.KEV_PT_MUD, elem.element(elem.DEFAULT_PT_GEL))
  222. elem.property(elements.KEV_PT_H2O2, "Name", "H2O2")
  223. elem.property(elements.KEV_PT_H2SO4, "Name", "H2SO4")
  224. elem.property(elements.KEV_PT_HCL, "Name", "HCL")
  225. elem.property(elements.KEV_PT_HNO3, "Name", "HNO3")
  226. elem.property(elements.KEV_PT_C7H8, "Name", "C7H8")
  227. elem.property(elements.KEV_PT_NAOH, "Name", "NAOH")
  228. elem.property(iodine, "Name", "I")
  229. elem.property(elements.KEV_PT_MUD, "Name", "MUD")
  230. elem.property(elements.KEV_PT_H2O2, "Description", "Hydrogen Peroxide. Descomposes when touches some metals.")
  231. elem.property(elements.KEV_PT_H2SO4, "Description", "Sulfuric Acid. Strong acid, very reactive and useful.")
  232. elem.property(elements.KEV_PT_HCL, "Description", "Chlorhydric Acid. Strong Acid, disolves almost all metals.")
  233. elem.property(elements.KEV_PT_HNO3, "Description", "Nitric Acid. Soft but useful as an explosives precursor.")
  234. elem.property(elements.KEV_PT_C7H8, "Description", "Toluene. Some explosives precursor.")
  235. elem.property(elements.KEV_PT_NAOH, "Description", "Sodium Hydroxide. Alkali, reacts with acids.")
  236. elem.property(iodine, "Description", "Iodine. Volatile, purifies WATR in only one touch.")
  237. elem.property(elements.KEV_PT_MUD, "Description", "Mud. Get Dirty.")
  238. elem.property(elements.KEV_PT_H2O2, "Color", 0x33A1C9)
  239. elem.property(elements.KEV_PT_H2SO4, "Color", 0xFFE4E1)
  240. elem.property(elements.KEV_PT_HCL, "Color", 0x7FFFD4)
  241. elem.property(elements.KEV_PT_HNO3, "Color", 0xFAFF57)
  242. elem.property(elements.KEV_PT_C7H8, "Color", 0x8F8F8F)
  243. elem.property(elements.KEV_PT_NAOH, "Color", 0xF5FFFA)
  244. elem.property(iodine, "Color", 0x610238)
  245. elem.property(elements.KEV_PT_MUD, "Color", 0x5E2612)
  246. elem.property(elements.KEV_PT_H2O2, "Flammable", 140)
  247. elem.property(elements.KEV_PT_H2SO4, "Flammable", 0)
  248. elem.property(elements.KEV_PT_HCL, "Flammable", 0)
  249. elem.property(elements.KEV_PT_HNO3, "Flammable", 0)
  250. elem.property(elements.KEV_PT_C7H8, "Flammable", 750)
  251. elem.property(elements.KEV_PT_NAOH, "Flammable", 0)
  252. elem.property(iodine, "Flammable", 0)
  253. elem.property(elements.KEV_PT_MUD, "Flammable", 0)
  254. elem.property(elements.KEV_PT_H2O2, "Explosive", 125)
  255. elem.property(elements.KEV_PT_H2SO4, "Explosive", 625)
  256. elem.property(elements.KEV_PT_HCL, "Explosive", 0)
  257. elem.property(elements.KEV_PT_HNO3, "Explosive", 790)
  258. elem.property(elements.KEV_PT_C7H8, "Explosive", 1150)
  259. elem.property(elements.KEV_PT_NAOH, "Explosive", 750)
  260. elem.property(iodine, "Explosive", 60)
  261. elem.property(elements.KEV_PT_MUD, "Explosive", 0)
  262. elem.property(elements.KEV_PT_H2O2, "Properties", elem.TYPE_LIQUID)
  263. elem.property(elements.KEV_PT_H2SO4, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
  264. elem.property(elements.KEV_PT_HCL, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
  265. elem.property(elements.KEV_PT_HNO3, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
  266. elem.property(elements.KEV_PT_C7H8, "Properties", elem.TYPE_LIQUID)
  267. elem.property(elements.KEV_PT_NAOH, "Properties", elem.TYPE_LIQUID+elem.PROP_DEADLY)
  268. elem.property(iodine, "Properties", elem.TYPE_LIQUID)
  269. elem.property(elements.KEV_PT_MUD, "Properties", elem.TYPE_LIQUID)
  270. elem.property(elements.KEV_PT_H2O2, "HighTemperatureTransition", elem.DEFAULT_PT_WTRV)
  271. elem.property(elements.KEV_PT_H2SO4, "HighTemperatureTransition", elem.KEV_PT_S2O)
  272. elem.property(elements.KEV_PT_HNO3, "HighTemperatureTransition", elem.KEV_PT_N2O)
  273. elem.property(elements.KEV_PT_C7H8, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  274. elem.property(elements.KEV_PT_NAOH, "HighTemperatureTransition", elem.DEFAULT_PT_WTRV)
  275. elem.property(iodine, "HighTemperatureTransition", iodinevapor)
  276. elem.property(iodinevapor, "LowTemperature", 253.15)
  277. elem.property(iodinevapor, "LowTemperatureTransition", iodine)
  278. elem.property(elements.KEV_PT_MUD, "HighTemperatureTransition", elem.KEV_PT_DIRT)
  279. elem.property(elements.KEV_PT_H2O2, "HighTemperature", 1832.15)
  280. elem.property(elements.KEV_PT_H2SO4, "HighTemperature", 613.15)
  281. elem.property(elements.KEV_PT_HNO3, "HighTemperature", 673.15)
  282. elem.property(elements.KEV_PT_C7H8, "HighTemperature", 873.15)
  283. elem.property(elements.KEV_PT_NAOH, "HighTemperature", 880.15)
  284. elem.property(iodine, "HighTemperature", 574.15)
  285. elem.property(elements.KEV_PT_MUD, "HighTemperature", 333.15)
  286. elem.property(elements.KEV_PT_H2SO4, "Weight", 48)
  287. elem.property(elements.KEV_PT_H2O2, "Weight", 18)
  288. elem.property(elements.KEV_PT_HCL, "Weight", 18)
  289. elem.property(elements.KEV_PT_HNO3, "Weight", 32)
  290. elem.property(elements.KEV_PT_C7H8, "Weight", 50)
  291. elem.property(elements.KEV_PT_NAOH, "Weight", 20)
  292. elem.property(iodine, "Weight", 58)
  293. elem.property(elements.KEV_PT_MUD, "Weight", 70)
  294. elem.property(elements.KEV_PT_H2O2, "Advection", 0)
  295. elem.property(elements.KEV_PT_H2SO4, "Advection", 0.4)
  296. elem.property(elements.KEV_PT_HCL, "Advection", 0.5)
  297. elem.property(elements.KEV_PT_HNO3, "Advection",0.3)
  298. elem.property(elements.KEV_PT_C7H8, "Advection", 0.9)
  299. elem.property(elements.KEV_PT_NAOH, "Advection", 0.9)
  300. elem.property(iodine, "Advection", 1)
  301. elem.property(elements.KEV_PT_MUD, "Advection", 0.1)
  302.  
  303.  
  304. --EXPLOSIVES--------------------------------------------
  305.  
  306. local nitrogeniodide = elem.allocate("KEV", "NI3")
  307. local blackgunpowder = elem.allocate("KEV", "BGUN")
  308. local nitrogentrichloride = elem.allocate("KEV", "NCL3")
  309. local amoniumnitrate = elem.allocate("KEV", "NH4O3")
  310. local acetilene = elem.allocate("KEV", "C2H2")
  311. local anfo = elem.allocate("KEV", "ANFO")
  312. local sulfur = elem.allocate("KEV", "S")
  313. local potassiumnitrate = elem.allocate("KEV", "KNO3")
  314. local alumina = elem.allocate("KEV", "AL2O3")
  315. elem.element(elements.KEV_PT_KNO3, elem.element(elem.DEFAULT_PT_THRM))
  316. elem.element(elements.KEV_PT_AL2O3, elem.element(elem.DEFAULT_PT_THRM))
  317. elem.element(elements.KEV_PT_NCL3, elem.element(elem.DEFAULT_PT_NITR))
  318. elem.element(elements.KEV_PT_S, elem.element(elem.DEFAULT_PT_GUN))
  319. elem.element(elements.KEV_PT_ANFO, elem.element(elem.DEFAULT_PT_DEST))
  320. elem.element(elements.KEV_PT_NI3, elem.element(elem.DEFAULT_PT_DEST))
  321. elem.element(elements.KEV_PT_BGUN, elem.element(elem.DEFAULT_PT_DEST))
  322. elem.element(elements.KEV_PT_NH4O3, elem.element(elem.DEFAULT_PT_GUN))
  323. elem.element(elements.KEV_PT_C2H2, elem.element(elem.DEFAULT_PT_FIRE))
  324. elem.property(elements.KEV_PT_KNO3, "Name", "KNO3")
  325. elem.property(elements.KEV_PT_AL2O3, "Name", "AL2O3")
  326. elem.property(elements.KEV_PT_NCL3, "Name", "NCL3")
  327. elem.property(elements.KEV_PT_S, "Name", "S")
  328. elem.property(elements.KEV_PT_ANFO, "Name", "ANFO")
  329. elem.property(elements.KEV_PT_NI3, "Name", "NI3")
  330. elem.property(elements.KEV_PT_BGUN, "Name", "BGUN")
  331. elem.property(elements.KEV_PT_NH4O3, "Name", "NH4O3")
  332. elem.property(elements.KEV_PT_C2H2, "Name", "C2H2")
  333. elem.property(elements.KEV_PT_KNO3, "Description", "Potassium Nitrate. Deflagrant Explosive.")
  334. elem.property(elements.KEV_PT_AL2O3, "Description", "Alumina. Explodes only in presense of FIRE and under pressure.")
  335. elem.property(elements.KEV_PT_NCL3, "Description", "Nitrogen Trichloride. Corrosive highly sensitive explosive.")
  336. elem.property(elements.KEV_PT_S, "Description", "Sulfur. Made in the hell.")
  337. elem.property(elements.KEV_PT_ANFO, "Description", "Amonium Nitrate-Fuel Oil. Explodes with a big power.")
  338. elem.property(elements.KEV_PT_NI3, "Description", "Nitrogen Iodide. Highly sensitive explosive. Releases a purple gas cloud.")
  339. elem.property(elements.KEV_PT_BGUN, "Description", "Black Gunpowder. Make it boom!.")
  340. elem.property(elements.KEV_PT_NH4O3, "Description", "Amonium Nitrate. When is mixed with explosives or combustibles slowly release OXYG.")
  341. elem.property(elements.KEV_PT_C2H2, "Description", "Acetilene. Burns hot! Explodes in contact with some metals.")
  342. elem.property(elements.KEV_PT_KNO3, "Color", 0xD1EDE4)
  343. elem.property(elements.KEV_PT_AL2O3, "Color", 0x44677C)
  344. elem.property(elements.KEV_PT_NCL3, "Color", 0xEEC900)
  345. elem.property(elements.KEV_PT_S, "Color", 0xE6FF1D)
  346. elem.property(elements.KEV_PT_NI3, "Color", 0xAF123F)
  347. elem.property(elements.KEV_PT_ANFO, "Color", 0xFFFFF0)
  348. elem.property(elements.KEV_PT_BGUN, "Color", 0x2F4F4F)
  349. elem.property(elements.KEV_PT_NH4O3, "Color", 0x8FBC8F)
  350. elem.property(elements.KEV_PT_C2H2, "Color", 0xE0EEEE)
  351. elem.property(elements.KEV_PT_KNO3, "Flammable", 0)
  352. elem.property(elements.KEV_PT_AL2O3, "Flammable", 0)
  353. elem.property(elements.KEV_PT_NCL3, "Flammable", 1230)
  354. elem.property(elements.KEV_PT_S, "Flammable", 450)
  355. elem.property(elements.KEV_PT_ANFO, "Flammable",9550)
  356. elem.property(elements.KEV_PT_NI3, "Flammable", 0)
  357. elem.property(elements.KEV_PT_BGUN, "Flammable", 1750)
  358. elem.property(elements.KEV_PT_NH4O3, "Flammable", 0)
  359. elem.property(elements.KEV_PT_C2H2, "Flammable", 250)
  360. elem.property(elements.KEV_PT_KNO3, "Explosive", 0)
  361. elem.property(elements.KEV_PT_AL2O3, "Explosive", 1)
  362. elem.property(elements.KEV_PT_NCL3, "Explosive", 125)
  363. elem.property(elements.KEV_PT_S, "Explosive", 0)
  364. elem.property(elements.KEV_PT_ANFO, "Explosive", 7995)
  365. elem.property(elements.KEV_PT_NI3, "Explosive", 0)
  366. elem.property(elements.KEV_PT_BGUN, "Explosive", 175)
  367. elem.property(elements.KEV_PT_NH4O3, "Explosive", 0)
  368. elem.property(elements.KEV_PT_C2H2, "Explosive", 0)
  369. elem.property(elements.KEV_PT_NI3, "HighTemperatureTransition", iodine)
  370. elem.property(elements.KEV_PT_NI3, "HighTemperature", 323.15)
  371. elem.property(elements.KEV_PT_AL2O3, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  372. elem.property(elements.KEV_PT_AL2O3, "HighTemperature", 2345.15)
  373. elem.property(elements.KEV_PT_S, "HighTemperatureTransition", elem.KEV_PT_S2O)
  374. elem.property(elements.KEV_PT_S, "HighTemperature", 883.15)
  375. elem.property(elements.KEV_PT_NI3, "LowPressureTransition", iodinevapor)
  376. elem.property(elements.KEV_PT_NI3, "LowPressure", -75)
  377. elem.property(elements.KEV_PT_KNO3, "Properties", elem.TYPE_PART)
  378. elem.property(elements.KEV_PT_AL2O3, "Properties", elem.TYPE_PART)
  379. elem.property(elements.KEV_PT_NCL3, "Properties", elem.TYPE_LIQUID)
  380. elem.property(elements.KEV_PT_S, "Properties", elem.TYPE_PART)
  381. elem.property(elements.KEV_PT_ANFO, "Properties", elem.TYPE_PART)
  382. elem.property(elements.KEV_PT_NI3, "Properties", elem.TYPE_PART)
  383. elem.property(elements.KEV_PT_BGUN, "Properties", elem.TYPE_PART)
  384. elem.property(elements.KEV_PT_NH4O3, "Properties", elem.TYPE_PART)
  385. elem.property(elements.KEV_PT_C2H2, "Properties", elem.TYPE_GAS)
  386. elem.property(elements.KEV_PT_KNO3, "Weight", 50)
  387. elem.property(elements.KEV_PT_AL2O3, "Weight", 68)
  388. elem.property(elements.KEV_PT_NCL3, "Weight", 58)
  389. elem.property(elements.KEV_PT_S, "Weight", 48)
  390. elem.property(elements.KEV_PT_ANFO, "Weight", 120)
  391. elem.property(elements.KEV_PT_NI3, "Weight", 60)
  392. elem.property(elements.KEV_PT_BGUN, "Weight", 30)
  393. elem.property(elements.KEV_PT_NH4O3, "Weight", 65)
  394. elem.property(elements.KEV_PT_C2H2, "Weight", 14)
  395. elem.property(elements.KEV_PT_KNO3, "Advection", 0.1)
  396. elem.property(elements.KEV_PT_AL2O3, "Advection", 0.4)
  397. elem.property(elements.KEV_PT_NCL3, "Advection", 0.1)
  398. elem.property(elements.KEV_PT_S, "Advection",0.7)
  399. elem.property(elements.KEV_PT_ANFO, "Advection", 0)
  400. elem.property(elements.KEV_PT_NI3, "Advection", 0.1)
  401. elem.property(elements.KEV_PT_BGUN, "Advection", 0.5)
  402. elem.property(elements.KEV_PT_NH4O3, "Advection", 0.4)
  403. elem.property(elements.KEV_PT_C2H2, "Diffusion", 0.9)
  404. elem.property(elements.KEV_PT_C2H2, "Advection", 0.2)
  405. elem.property(elements.KEV_PT_C2H2, "AirDrag", 0.5)
  406. elem.property(elements.KEV_PT_C2H2, "AirLoss", 0.3)
  407. elem.property(elements.KEV_PT_C2H2, "MenuSection", SC_EXPLOSIVE)
  408. elem.property(elements.KEV_PT_I, "Hardness", 255)
  409.  
  410. --POWDERS--------------------------------------------------------------------------------------
  411. local dirt = elem.allocate("KEV", "DIRT")
  412. local seed = elem.allocate("KEV", "SEED")
  413. local cement = elem.allocate("KEV", "CMNT")
  414. local rock = elem.allocate("KEV", "ROCK")
  415. local brokengraphite = elem.allocate("KEV", "BGPH")
  416. local brokencarbono = elem.allocate("KEV", "BCAR")
  417. local calciumcarbide= elem.allocate("KEV", "CAC2")
  418. local siliconoxide = elem.allocate("KEV", "SIO2")
  419. local copperoxide = elem.allocate("KEV", "CUO")
  420. local titanoxide = elem.allocate("KEV", "TIO2")
  421. local coppersulfate = elem.allocate("KEV", "CUSO4")
  422. elem.element(elements.KEV_PT_DIRT, elem.element(elem.DEFAULT_PT_STNE))
  423. elem.element(elements.KEV_PT_SEED, elem.element(elem.DEFAULT_PT_DUST))
  424. elem.element(elements.KEV_PT_CMNT, elem.element(elem.DEFAULT_PT_CNCT))
  425. elem.element(elements.KEV_PT_BGPH, elem.element(elem.DEFAULT_PT_SAND))
  426. elem.element(elements.KEV_PT_BCAR, elem.element(elem.DEFAULT_PT_DUST))
  427. elem.element(elements.KEV_PT_CAC2, elem.element(elem.DEFAULT_PT_STNE))
  428. elem.element(elements.KEV_PT_SIO2, elem.element(elem.DEFAULT_PT_SAND))
  429. elem.element(elements.KEV_PT_CUO, elem.element(elem.DEFAULT_PT_CNCT))
  430. elem.element(elements.KEV_PT_TIO2, elem.element(elem.DEFAULT_PT_BRMT))
  431. elem.element(elements.KEV_PT_CUSO4, elem.element(elem.DEFAULT_PT_BRMT))
  432. elem.element(elements.KEV_PT_ROCK, elem.element(elem.DEFAULT_PT_BRCK))
  433. elem.property(elements.KEV_PT_DIRT, "Name", "DIRT")
  434. elem.property(elements.KEV_PT_SEED, "Name", "SEED")
  435. elem.property(elements.KEV_PT_CMNT, "Name", "CMNT")
  436. elem.property(elements.KEV_PT_BGPH, "Name", "BGPH")
  437. elem.property(elements.KEV_PT_BCAR, "Name", "BCAR")
  438. elem.property(elements.KEV_PT_CAC2, "Name", "CAC2")
  439. elem.property(elements.KEV_PT_SIO2, "Name", "SIO2")
  440. elem.property(elements.KEV_PT_CUO, "Name", "CUO")
  441. elem.property(elements.KEV_PT_TIO2, "Name", "TIO2")
  442. elem.property(elements.KEV_PT_CUSO4, "Name", "CUSO4")
  443. elem.property(elements.KEV_PT_ROCK, "Name", "ROCK")
  444. elem.property(elements.KEV_PT_DIRT, "Description", "Dirt. Mother of life.")
  445. elem.property(elements.KEV_PT_SEED, "Description", "Seed. Make it grow.")
  446. elem.property(elements.KEV_PT_CMNT, "Description", "Portland Cement. Forge and get hard in contact with WATR.")
  447. elem.property(elements.KEV_PT_BGPH, "Description", "Broken Graphite. Absorbs neutrons and photons. Used in nuclear reactors.")
  448. elem.property(elements.KEV_PT_BCAR, "Description", "Broken Carbono. Useful as black.")
  449. elem.property(elements.KEV_PT_CAC2, "Description", "Calcium Carbide. Used to produce C2H2, extracted from LIME.")
  450. elem.property(elements.KEV_PT_SIO2, "Description", "Silice. A SAND, CMNT and GLASS component.")
  451. elem.property(elements.KEV_PT_CUO, "Description", "Copper Oxide. Semiconductor Type P.")
  452. elem.property(elements.KEV_PT_TIO2, "Description", "Titanium Oxide. Heavy, used in batteries.")
  453. elem.property(elements.KEV_PT_CUSO4, "Description", "Copper Sulfate. Purifies WATR and intensifies explosives reactions.")
  454. elem.property(elements.KEV_PT_ROCK, "Description", "Rock. Descomposes into various metal oxides and gases.")
  455. elem.property(elements.KEV_PT_DIRT, "Color", 0x6D4D16)
  456. elem.property(elements.KEV_PT_SEED, "Color", 0xCDAD00)
  457. elem.property(elements.KEV_PT_CMNT, "Color", 0xD9D9D9)
  458. elem.property(elements.KEV_PT_BGPH, "Color", 0x515151)
  459. elem.property(elements.KEV_PT_BCAR, "Color", 0x1E1E1E)
  460. elem.property(elements.KEV_PT_CAC2, "Color", 0x7A8B8B)
  461. elem.property(elements.KEV_PT_SIO2, "Color", 0xEED5B7)
  462. elem.property(elements.KEV_PT_CUO, "Color", 0x8CD3700)
  463. elem.property(elements.KEV_PT_TIO2, "Color", 0xEEE9E9)
  464. elem.property(elements.KEV_PT_CUSO4, "Color", 0x00C78C)
  465. elem.property(elements.KEV_PT_ROCK, "Color", 0xCDB7B5)
  466. elem.property(elements.KEV_PT_DIRT, "Flammable", 0)
  467. elem.property(elements.KEV_PT_SEED, "Flammable", 50)
  468. elem.property(elements.KEV_PT_CMNT, "Flammable", 0)
  469. elem.property(elements.KEV_PT_BGPH, "Flammable", 0)
  470. elem.property(elements.KEV_PT_BCAR, "Flammable", 115)
  471. elem.property(elements.KEV_PT_CAC2, "Flammable", 0)
  472. elem.property(elements.KEV_PT_SIO2, "Flammable", 3)
  473. elem.property(elements.KEV_PT_CUO, "Flammable", 0)
  474. elem.property(elements.KEV_PT_TIO2, "Flammable", 0)
  475. elem.property(elements.KEV_PT_CUSO4, "Flammable", 0)
  476. elem.property(elements.KEV_PT_DIRT, "Explosive", 0)
  477. elem.property(elements.KEV_PT_SEED, "Explosive", 0)
  478. elem.property(elements.KEV_PT_CMNT, "Explosive", 0)
  479. elem.property(elements.KEV_PT_BGPH, "Explosive", 0)
  480. elem.property(elements.KEV_PT_BCAR, "Explosive", 0)
  481. elem.property(elements.KEV_PT_CAC2, "Explosive", 0)
  482. elem.property(elements.KEV_PT_SIO2, "Explosive", 0)
  483. elem.property(elements.KEV_PT_CUO, "Explosive", 0)
  484. elem.property(elements.KEV_PT_TIO2, "Explosive", 0)
  485. elem.property(elements.KEV_PT_CUSO4, "Explosive", 0)
  486. elem.property(elements.KEV_PT_DIRT, "Properties", elem.TYPE_PART)
  487. elem.property(elements.KEV_PT_SEED, "Properties", elem.TYPE_PART)
  488. elem.property(elements.KEV_PT_CMNT, "Properties", elem.TYPE_PART)
  489. elem.property(elements.KEV_PT_BGPH, "Properties", elem.TYPE_PART+elem.PROP_NEUTPENETRATE+elem.PROP_NEUTABSORB+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS)
  490. elem.property(elements.KEV_PT_BCAR, "Properties", elem.TYPE_PART)
  491. elem.property(elements.KEV_PT_CAC2, "Properties", elem.TYPE_PART)
  492. elem.property(elements.KEV_PT_SIO2, "Properties", elem.TYPE_PART)
  493. elem.property(elements.KEV_PT_CUO, "Properties", elem.TYPE_PART)
  494. elem.property(elements.KEV_PT_TIO2, "Properties", elem.TYPE_PART+elem.PROP_NEUTPASS+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  495. elem.property(elements.KEV_PT_CUSO4, "Properties", elem.TYPE_PART+elem.PROP_DEADLY+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  496. elem.property(elements.KEV_PT_ROCK, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_HOT_GLOW)
  497. elem.property(elements.KEV_PT_SEED, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  498. elem.property(elements.DEFAULT_PT_STNE, "HighTemperatureTransition", elem.KEV_PT_ROCK)
  499. elem.property(elements.KEV_PT_CMNT, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  500. elem.property(elements.KEV_PT_BGPH, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  501. elem.property(elements.KEV_PT_BCAR, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  502. elem.property(elements.KEV_PT_CAC2, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  503. elem.property(elements.KEV_PT_SIO2, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  504. elem.property(elements.KEV_PT_CUO, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  505. elem.property(elements.KEV_PT_TIO2, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  506. elem.property(elements.KEV_PT_ROCK, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  507. elem.property(elements.KEV_PT_SEED, "HighTemperature", 383.15)
  508. elem.property(elements.DEFAULT_PT_STNE, "HighTemperature", 1233.15) --STNE molts into ROCK--
  509. elem.property(elements.KEV_PT_CMNT, "HighTemperature", 593.15)
  510. elem.property(elements.KEV_PT_BGPH, "HighTemperature", 934.15)
  511. elem.property(elements.KEV_PT_BCAR, "HighTemperature", 990.15)
  512. elem.property(elements.KEV_PT_CAC2, "HighTemperature", 2133.15)
  513. elem.property(elements.KEV_PT_SIO2, "HighTemperature", 1986.15)
  514. elem.property(elements.KEV_PT_CUO, "HighTemperature", 1599.15)
  515. elem.property(elements.KEV_PT_TIO2, "HighTemperature", 2103.15)
  516. elem.property(elements.KEV_PT_ROCK, "HighTemperature", 4293.15)
  517. elem.property(elements.KEV_PT_DIRT, "HighPressureTransition", elem.DEFAULT_PT_STNE)
  518. elem.property(elements.KEV_PT_SEED, "HighPressureTransition", elem.KEV_PT_DIRT)
  519. elem.property(elements.KEV_PT_ROCK, "HighPressureTransition", elem.DEFAULT_PT_STNE)
  520. elem.property(elements.KEV_PT_DIRT, "HighPressure", 90)
  521. elem.property(elements.KEV_PT_SEED, "HighPressure", 140)
  522. elem.property(elements.KEV_PT_ROCK, "HighPressure", 90)
  523. elem.property(elements.KEV_PT_DIRT, "Weight", 80.98)
  524. elem.property(elements.KEV_PT_SEED, "Weight", 12)
  525. elem.property(elements.KEV_PT_CMNT, "Weight", 80)
  526. elem.property(elements.KEV_PT_BGPH, "Weight", 45)
  527. elem.property(elements.KEV_PT_BCAR, "Weight", 44)
  528. elem.property(elements.KEV_PT_CAC2, "Weight", 64)
  529. elem.property(elements.KEV_PT_SIO2, "Weight", 60)
  530. elem.property(elements.KEV_PT_CUO, "Weight", 65)
  531. elem.property(elements.KEV_PT_TIO2, "Weight", 79.87)
  532. elem.property(elements.KEV_PT_CUSO4, "Weight", 79)
  533. elem.property(elements.KEV_PT_DIRT, "Advection", 0.1)
  534. elem.property(elements.KEV_PT_SEED, "Advection", 0.9)
  535. elem.property(elements.KEV_PT_BGPH, "Advection", 0.2)
  536. elem.property(elements.KEV_PT_CAC2, "Advection",0.1)
  537. elem.property(elements.KEV_PT_SIO2, "Advection", 0.9)
  538. elem.property(elements.KEV_PT_TIO2, "Advection", 1.1)
  539. elem.property(elements.KEV_PT_CUSO4, "Advection", 0.7)
  540.  
  541. --SOLIDS--------------------------------------------------------------------------------------
  542.  
  543. local silver = elem.allocate("KEV", "AG")
  544. local aluminium = elem.allocate("KEV", "AL")
  545. local copper= elem.allocate("KEV", "COPR")
  546. local constructionsteel = elem.allocate("KEV", "STEL")
  547. local graphite = elem.allocate("KEV", "GPHT")
  548. local titaniumcarbide = elem.allocate("KEV", "TIC")
  549. local turbine = elem.allocate("KEV", "TURB")
  550. local fotovoltaicsilicon = elem.allocate("KEV", "SIV")
  551. elem.element(elements.KEV_PT_AG, elem.element(elem.DEFAULT_PT_TTAN))
  552. elem.element(elements.KEV_PT_AL, elem.element(elem.DEFAULT_PT_TTAN))
  553. elem.element(elements.KEV_PT_COPR, elem.element(elem.DEFAULT_PT_PSCN))
  554. elem.element(elements.KEV_PT_STEL, elem.element(elem.DEFAULT_PT_IRON))
  555. elem.element(elements.KEV_PT_GPHT, elem.element(elem.DEFAULT_PT_IRON))
  556. elem.element(elements.KEV_PT_TIC, elem.element(elem.DEFAULT_PT_TTAN))
  557. elem.element(elements.KEV_PT_TURB, elem.element(elem.DEFAULT_PT_TTAN))
  558. elem.element(elements.KEV_PT_SIV, elem.element(elem.DEFAULT_PT_PSCN))
  559. elem.property(elements.KEV_PT_AG, "Name", "AG")
  560. elem.property(elements.KEV_PT_AL, "Name", "AL")
  561. elem.property(elements.KEV_PT_COPR, "Name", "COPR")
  562. elem.property(elements.KEV_PT_STEL, "Name", "STEL")
  563. elem.property(elements.KEV_PT_GPHT, "Name", "GPHT")
  564. elem.property(elements.KEV_PT_TIC, "Name", "TIC")
  565. elem.property(elements.KEV_PT_TURB, "Name", "TURB")
  566. elem.property(elements.KEV_PT_SIV, "Name", "SIV")
  567. elem.property(elements.KEV_PT_AG, "Description", "Silver. Conductive. Turns into IRON when touches PHOT.")
  568. elem.property(elements.KEV_PT_AL, "Description", "Aluminium. Oxide Resistant. Conducts heat very well.")
  569. elem.property(elements.KEV_PT_COPR, "Description", "Copper. Conducts SPRK and heat very well.")
  570. elem.property(elements.KEV_PT_STEL, "Description", "Construction Steel. Strong. Corrodes with the time.")
  571. elem.property(elements.KEV_PT_GPHT, "Description", "Graphite. Absorbs neutrons and photons. Used in nuclear reactors.")
  572. elem.property(elements.KEV_PT_TIC, "Description", "Titanium Carbide. Used to produce C2H2, extracted from LIME.")
  573. elem.property(elements.KEV_PT_TURB, "Description", "Turbine. Products energy when touches a gas under pressure -BETA- (It doesnt works by now).")
  574. elem.property(elements.KEV_PT_SIV, "Description", "Photovoltaic Silicon. Creates SPRK when touches a PHOT.")
  575. elem.property(elements.KEV_PT_AG, "Color", 0xC0C0C0)
  576. elem.property(elements.KEV_PT_AL, "Color", 0xFFFAF0)
  577. elem.property(elements.KEV_PT_COPR, "Color", 0xCD950C)
  578. elem.property(elements.KEV_PT_STEL, "Color", 0xD9E3E3)
  579. elem.property(elements.KEV_PT_GPHT, "Color", 0x838B8B)
  580. elem.property(elements.KEV_PT_TIC, "Color", 0x3C3C3C)
  581. elem.property(elements.KEV_PT_TURB, "Color", 0x00FF00)
  582. elem.property(elements.KEV_PT_SIV, "Color", 0x808A87)
  583. elem.property(elements.KEV_PT_AG, "Flammable", 0)
  584. elem.property(elements.KEV_PT_AL, "Flammable", 0)
  585. elem.property(elements.KEV_PT_COPR, "Flammable", 0)
  586. elem.property(elements.KEV_PT_STEL, "Flammable", 0)
  587. elem.property(elements.KEV_PT_GPHT, "Flammable", 0)
  588. elem.property(elements.KEV_PT_TIC, "Flammable", 0)
  589. elem.property(elements.KEV_PT_TURB, "Flammable", 0)
  590. elem.property(elements.KEV_PT_SIV, "Flammable", 0)
  591. elem.property(elements.KEV_PT_AG, "Explosive", 0)
  592. elem.property(elements.KEV_PT_AL, "Explosive", 0)
  593. elem.property(elements.KEV_PT_COPR, "Explosive", 0)
  594. elem.property(elements.KEV_PT_STEL, "Explosive", 0)
  595. elem.property(elements.KEV_PT_GPHT, "Explosive", 0)
  596. elem.property(elements.KEV_PT_TIC, "Explosive", 0)
  597. elem.property(elements.KEV_PT_TURB, "Explosive", 0)
  598. elem.property(elements.KEV_PT_SIV, "Explosive", 0)
  599. elem.property(elements.KEV_PT_AL, "Properties", elem.TYPE_SOLID+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  600. elem.property(elements.KEV_PT_AG, "Properties", elem.TYPE_SOLID+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  601. elem.property(elements.KEV_PT_COPR, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  602. elem.property(elements.KEV_PT_STEL, "Properties", elem.TYPE_SOLID+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  603. elem.property(elements.KEV_PT_GPHT, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTABSORB+elem.PROP_HOT_GLOW)
  604. elem.property(elements.KEV_PT_TIC, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  605. elem.property(elements.KEV_PT_TURB, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  606. elem.property(elements.KEV_PT_SIV, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_LIFE_DEC+elem.PROP_CONDUCTS+elem.PROP_HOT_GLOW)
  607. elem.property(elements.KEV_PT_AL, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  608. elem.property(elements.KEV_PT_AG, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  609. elem.property(elements.KEV_PT_COPR, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  610. elem.property(elements.KEV_PT_STEL, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  611. elem.property(elements.KEV_PT_GPHT, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  612. elem.property(elements.KEV_PT_TIC, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  613. elem.property(elements.KEV_PT_TURB, "HighTemperatureTransition", elem.DEFAULT_PT_FIRE)
  614. elem.property(elements.KEV_PT_SIV, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  615. elem.property(elements.KEV_PT_AL, "HighTemperature", 1133.15)
  616. elem.property(elements.KEV_PT_AG, "HighTemperature", 1234.93)
  617. elem.property(elements.KEV_PT_COPR, "HighTemperature", 2460.73)
  618. elem.property(elements.KEV_PT_STEL, "HighTemperature", 2373.15)
  619. elem.property(elements.KEV_PT_GPHT, "HighTemperature", 2133.15)
  620. elem.property(elements.KEV_PT_TIC, "HighTemperature", 8745.15)
  621. elem.property(elements.KEV_PT_TURB, "HighTemperature", 1799.15)
  622. elem.property(elements.KEV_PT_SIV, "HighTemperature", 2853.15)
  623. elem.property(elements.KEV_PT_GPHT, "HighPressure", 90)
  624. elem.property(elements.KEV_PT_GPHT, "HighPressureTransition", elements.KEV_PT_BGPH)
  625. elem.property(elements.KEV_PT_AL, "Weight", 180.98)
  626. elem.property(elements.KEV_PT_AG, "Weight", 194.00)
  627. elem.property(elements.KEV_PT_COPR, "Weight", 190)
  628. elem.property(elements.KEV_PT_STEL, "Weight", 185)
  629. elem.property(elements.KEV_PT_GPHT, "Weight", 190)
  630. elem.property(elements.KEV_PT_TIC, "Weight", 190)
  631. elem.property(elements.KEV_PT_TURB, "Weight", 190)
  632. elem.property(elements.KEV_PT_SIV, "Weight", 189)
  633. elem.property(elements.KEV_PT_TURB, "MenuVisible", 0)
  634.  
  635.  
  636.  
  637.  
  638. --------------------------------------------------------FUNCTIONS-PART-----------------------------------------------------------------
  639.  
  640. --NITROGEN--
  641.     local function nUpdate(i, x, y, s, nt)
  642.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  643.      if r~= nil then  --1) Nitrogen react with OXYG to form N2O--
  644.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and sim.pressure(x/4, y/4) >= 25.30 then
  645.                 sim.partProperty(i, "type", elem.KEV_PT_N2O)
  646.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  647.                 end   --2) Nitrogen react with WATR to form HNO3--
  648.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and sim.pressure(x/4, y/4) >= 5.30 then
  649.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  650.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  651.                 end --3) Nitrogen react with DSTW to form HNO3--
  652.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW and sim.pressure(x/4, y/4) >= 5.30 then
  653.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  654.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  655.                 end --4) Nitrogen react with PLNT to make grow VINE--
  656.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLNT then
  657.                 sim.partProperty(i, "type", elem.DEFAULT_PT_VINE)
  658.                 sim.partProperty(r, "type", elem.KEV_PT_SEED)
  659.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wood")
  660.                 end  --5) Nitrogen react with HYGN to form NH3--
  661.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN and sim.pressure(x/4, y/4) >= 15.30 then
  662.                 sim.partProperty(i, "type", elem.KEV_PT_NH3)
  663.                 sim.partProperty(r, "type", elem.KEV_PT_NH3)
  664.                 end
  665.      end
  666.     end
  667.  
  668. --NITROGEN OXIDE--
  669.     local function n2oUpdate(i, x, y, s, nt)
  670.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  671.      if r~= nil then  --1) Increse explosion force--
  672.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  673.             tpt.set_pressure(x/4, y/4,1,6,115)
  674.                 tpt.set_property("type", "plsm", r)
  675.                 tpt.set_property("life", 85, r)
  676.                 tpt.set_property("type", "plsm", i)            
  677.                 end  --2) Nitrogen residue create after explotion--
  678.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  679.                 sim.partProperty(i, "type", nitg)
  680.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  681.                 end  --3) Nitrogen Oxide react with HYGN to form HNO3--
  682.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN and sim.pressure(x/4, y/4) >= 2.30 then
  683.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  684.                 sim.partProperty(r, "type", elem.KEV_PT_HNO3)
  685.                 end  --4) Nitrogen Oxide react with WATR to form HNO3--
  686.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1, 50) == 1 then
  687.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  688.                 sim.partProperty(r, "type", elem.KEV_PT_HNO3)
  689.                 end  --5) Nitrogen Oxide react with DSTW to form HNO3--
  690.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW and math.random(1, 70) == 1 then
  691.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  692.                 sim.partProperty(r, "type", elem.KEV_PT_HNO3)
  693.                 end
  694.      end
  695.     end
  696.  
  697. --OZONE--
  698.     local function o3Update(i, x, y, s, nt)
  699.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  700.      if r~= nil then --1) Ozone rusts IRON into FE2O3--
  701.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON then
  702.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  703.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BRMT)
  704.                 end --2) Ozone rusts TTAN into TIO2--
  705.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN then
  706.                 sim.partProperty(i, "type", elem.KEV_PT_TIO2)
  707.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  708.                 end --3) Ozone rusts STEEL into FE2O3--
  709.              if sim.partProperty(r, "type") == elem.KEV_PT_STEL then
  710.                 sim.partProperty(i, "type", elem.DEFAULT_PT_BRMT)
  711.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  712.                 end --4) Ozone rusts SI into SIO2--
  713.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_NTCT then
  714.                 sim.partProperty(i, "type", elem.KEV_PT_SIO2)
  715.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  716.                 end --5) Ozone rusts TUNG into BREL--
  717.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TUNG then
  718.                 sim.partProperty(i, "type", elem.KEV_PT_BREL)
  719.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  720.                 end --6) Ozone rusts BTRY into BREL--
  721.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BTRY then
  722.                 sim.partProperty(i, "type", elem.DEFAULT_PT_BREL)
  723.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  724.                 end --7) Ozone purifies WATR of SALT--
  725.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW then
  726.                 sim.partProperty(i, "type", elem.DEFAULT_PT_WATR)
  727.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  728.                 end  --8) Ozone turns into OXYG when a PHOT touches it--
  729.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
  730.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  731.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  732.                 end --9) Ozone Inestability--
  733.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG then
  734.                 sim.partProperty(i, "type", elem.DEFAULT_PT_LOXY)
  735.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  736.                 end --10) Ozone Toxicity--
  737.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLNT then
  738.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  739.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WOOD)
  740.                 end --11) Ozone as detonating of sensitive explosives--
  741.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLEX then
  742.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  743.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  744.                 end
  745.              if sim.partProperty(r, "type") == elem.KEV_PT_CH3NO and sim.pressure(x/4, y/4) >= 3.30 then
  746.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  747.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  748.                 end
  749.              if sim.partProperty(r, "type") == elem.KEV_PT_NI3 and sim.pressure(x/4, y/4) >= 2.30 then
  750.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  751.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  752.                 end
  753.      end
  754.     end
  755.  
  756. --AMONIAC--
  757.     local function nh3Update(i, x, y, s, nt)
  758.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  759.      if r~= nil then --1) Amoniac reaction to form HNO3--
  760.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and sim.pressure(x/4, y/4) >= 7.30 then
  761.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  762.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  763.                 end --2) FE2O3 catalyses reaction to form HNO3--
  764.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT then
  765.                 sim.partProperty(i, "type", elem.KEV_PT_HNO3)
  766.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HNO3)
  767.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  768.                 end --3) Fertilizant function--
  769.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLNT then
  770.                 sim.partProperty(i, "type", elem.KEV_PT_WOOD)
  771.                 sim.partProperty(r, "type", elem.DEFAULT_PT_VINE)
  772.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "seed")
  773.                 end
  774.              if sim.partProperty(r, "type") == elem.KEV_PT_DIRT then
  775.                 sim.partProperty(i, "type", elem.KEV_PT_WOOD)
  776.                 sim.partProperty(r, "type", elem.DEFAULT_PT_VINE)
  777.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "seed")
  778.                 end  --4) NH3 reacts with H2O2 to form N2H4--
  779.              if sim.partProperty(r, "type") == elem.KEV_PT_H2O2 and sim.pressure(x/4, y/4) >= 9.10 then
  780.                 sim.partProperty(i, "type", elem.KEV_PT_N2H4)
  781.                 sim.partProperty(r, "type", elem.DEFAULT_PT_N2H4)
  782.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  783.                 end  --5) NH3 reacts with I to form NI3--
  784.              if sim.partProperty(r, "type") == iodine then
  785.                 sim.partProperty(i, "type", elem.KEV_PT_NI3)
  786.                 sim.partProperty(r, "type", elem.KEV_PT_IODV)
  787.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  788.                 end --6) NH3 reacts with CH4 to form CH3NO--
  789.              if sim.partProperty(r, "type") == elem.KEV_PT_CH4 then
  790.                 sim.partProperty(i, "type", elem.KEV_PT_CH3NO)
  791.                 sim.partProperty(r, "type", elem.KEV_PT_CH3NO)
  792.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  793.                 end
  794.      end
  795.     end
  796.  
  797. --NITROMETHANE--
  798.     local function ch3noUpdate(i, x, y, s, nt)
  799.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  800.      if r~= nil then --1) CH3NO reacts wth I or IODV to form NI3--
  801.              if sim.partProperty(r, "type") == elem.KEV_PT_I then
  802.                 sim.partProperty(i, "type", elem.KEV_PT_NI3)
  803.                 sim.partProperty(r, "type", elem.KEV_PT_NI3)
  804.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  805.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  806.                 end  
  807.              if sim.partProperty(r, "type") == elem.KEV_PT_IODV then
  808.                 sim.partProperty(i, "type", elem.KEV_PT_NI3)
  809.                 sim.partProperty(r, "type", elem.KEV_PT_NI3)
  810.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  811.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  812.                 end
  813.      end
  814.     end
  815.  
  816. --METHANE--
  817.     local function ch4Update(i, x, y, s, nt)
  818.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  819.      if r~= nil then  --1) CH4 reacts with OXYG to explode--
  820.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG then
  821.                 sim.partProperty(i, "type", elem.DEFAULT_PT_WTRV)
  822.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  823.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  824.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  825.                 end  --2) CH4 descomposes with WATR into CO2 and HYGN--
  826.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and sim.pressure(x/4, y/4) >= 9.10 then
  827.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CO2)
  828.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  829.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  830.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  831.                 end  --3) CH4 reacts with NITR to make CH3NO--
  832.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_NITR and sim.pressure(x/4, y/4) >= 9.10 then
  833.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CO2)
  834.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  835.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  836.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  837.                 end --5) CH4 reacts with HNO3 to form CH3NO--
  838.              if sim.partProperty(r, "type") == elem.KEV_PT_HNO3 then
  839.                 sim.partProperty(i, "type", elem.KEV_PT_CH3NO)
  840.                 sim.partProperty(r, "type", elem.KEV_PT_CH3NO)
  841.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  842.                 end --6) CH4 reacts with F-18 from RADMOD to form R.32--
  843.              if sim.partProperty(r, "type") == elem.KEV_PT_F18 and sim.pressure(x/4, y/4) <= -2.10 then
  844.                 sim.partProperty(i, "type", elem.KEV_PT_R32)
  845.                 sim.partProperty(r, "type", elem.KEV_PT_R32)
  846.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  847.                 end
  848.      end
  849.     end
  850.  
  851. --CARBON MONOXIDE--
  852.     local function coUpdate(i, x, y, s, nt)
  853.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  854.      if r~= nil then --1) CO reacts with WATR to form BUBW--
  855.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR then
  856.                 sim.partProperty(i, "type", elem.DEFAULT_PT_BUBW)
  857.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  858.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  859.                 end --2) CO reacts with OXYG to form CO2--
  860.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG then
  861.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CO2)
  862.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  863.                 end --3) CO reacts with CH4 to form C3H8 and C3H8L--
  864.              if sim.partProperty(r, "type") == elem.KEV_PT_CH4 then
  865.                 sim.partProperty(i, "type", elem.DEFAULT_PT_GAS)
  866.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OIL)
  867.                 end
  868.      end
  869.     end
  870.  
  871. --HYDRAZINE--
  872.     local function n2h4Update(i, x, y, s, nt)
  873.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  874.      if r~= nil then --1) N2H4 reacts with F to explode--
  875.              if sim.partProperty(r, "type") == elem.KEV_PT_F then
  876.                 sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  877.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  878.                 end
  879.      end
  880.     end
  881.  
  882. --FREON TYPE 32 or DIFLUORMETHANE--
  883.     local function r32Update(i, x, y, s, nt)
  884.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  885.      if r~= nil then --1) R32 reacts with pressure to decrease its temperature--
  886.              if sim.pressure(x/4, y/4) >= 25.10 then
  887.                 tpt.set_property("temp", -math.huge, x, y)
  888.                 end --2) R32 reacts with WATR to form ICE and LOXY--
  889.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR then
  890.                 sim.partProperty(i, "type", elem.DEFAULT_PT_ICE)
  891.                 sim.partProperty(r, "type", elem.DEFAULT_PT_LOXY)
  892.                 end --3) R32 reacts with DSTW to form ICE and LOXY--
  893.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW then
  894.                 sim.partProperty(i, "type", elem.DEFAULT_PT_ICE)
  895.                 sim.partProperty(r, "type", elem.DEFAULT_PT_LOXY)
  896.                 end --4) R32 gets cold with pressure--
  897.              if sim.pressure(x/4, y/4) >= 10.00 then
  898.                 tpt.set_property("temp", 9, x, y)
  899.                 end
  900.      end
  901.     end
  902.  
  903. --SULFUR OXIDE--
  904.     local function s2oUpdate(i, x, y, s, nt)
  905.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  906.      if r~= nil then --1) S2O reacts with DSTW to H2SO4--
  907.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW then
  908.                 sim.partProperty(i, "type", elem.KEV_PT_H2SO4)
  909.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  910.                 end  --2) S2O reacts with WATR to H2SO4--
  911.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1, 45) == 1 then
  912.                 sim.partProperty(i, "type", elem.KEV_PT_H2SO4)
  913.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  914.                 sim.pressure(x/4,y/4,2)
  915.                 end  --3) S2O reacts with HYGN to H2SO4--
  916.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN and sim.pressure(x/4, y/4) >= 5.90 then
  917.                 sim.partProperty(i, "type", elem.KEV_PT_H2SO4)
  918.                 sim.partProperty(r, "type", elem.KEV_PT_H2SO4)
  919.                 end
  920.      end
  921.     end
  922.  
  923. --CHLORINE--
  924.     local function clUpdate(i, x, y, s, nt)
  925.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  926.      if r~= nil then --1) CL reacts with HYGN to HCL--
  927.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN then
  928.                 sim.partProperty(i, "type", elem.KEV_PT_HCL)
  929.                 sim.partProperty(r, "type", elem.KEV_PT_HCL)
  930.                 end --2) CL reacts with HYGN to HCL--
  931.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN then
  932.                 sim.partProperty(i, "type", elem.KEV_PT_HCL)
  933.                 sim.partProperty(r, "type", elem.KEV_PT_HCL)
  934.                 end --3) CL corrodes IRON--
  935.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,250) == 1 then
  936.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  937.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  938.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  939.                 end --4) CL corrodes TTAN--
  940.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,250) == 1 then
  941.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  942.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  943.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  944.                 return 1
  945.                 end --5) CL corrodes SI--
  946.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,250) == 1 then
  947.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  948.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BREL)
  949.                 return 1
  950.                 end --6) CL corrodes SI5FE--
  951.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,250) == 1 then
  952.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  953.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  954.                 return 1
  955.                 end --7) CL corrodes COPR--
  956.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,250) == 1 then
  957.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  958.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  959.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  960.                 return 1
  961.                 end --8) CL corrodes CNCW--
  962.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,250) == 1 then
  963.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  964.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  965.                 return 1
  966.                 end
  967.      end
  968.     end
  969.  
  970. --IODINE VAPOR--
  971.     local function iodvUpdate(i, x, y, s, nt)
  972.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  973.      if r~= nil then --1) IODV purifies WATR--
  974.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR then
  975.                 sim.partProperty(i, "type", elem.DEFAULT_PT_DSTW)
  976.                 sim.partProperty(r, "type", iodine)
  977.                 end
  978.      end
  979.     end
  980.  
  981. --GAS TO PROPANE---
  982. elements.property(elements.DEFAULT_PT_GAS, "Name", "C3H8")
  983. elements.property(elements.DEFAULT_PT_GAS, "Description", "Propane. Diffusses quickly and is flammable. Liquefies into OIL under pressure.")
  984. elements.property(elements.DEFAULT_PT_GAS, "Color", 0xE0EEEE)
  985. elements.property(elements.DEFAULT_PT_GAS, "Flammable", 3870)
  986.  
  987.  
  988. ------------------------------------------------------------------------------------------------LIQUIDS----------------------------------------------------------------------------------
  989. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  990.  
  991. --HYDROGEN PEROXIDE--
  992.     local function h2o2Update(i, x, y, s, nt)
  993.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  994.      if r~= nil then --1) H2O2 descomposes into OXYG and HYGN with FE2O3--
  995.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT then
  996.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  997.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  998.                 sim.pressure(x/4,y/4,5)
  999.                 end  --2) H2O2 could ignite in contact with some metals--
  1000.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,440) == 1 then
  1001.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1002.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  1003.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1004.                 sim.pressure(x/4,y/4,12)
  1005.                 end
  1006.              if sim.partProperty(r, "type") == elem.KEV_PT_AG and math.random(1,460) == 1 then
  1007.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1008.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  1009.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1010.                 sim.pressure(x/4,y/4,5)
  1011.                 end
  1012.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,110) == 1 then
  1013.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1014.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  1015.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1016.                 sim.pressure(x/4,y/4,5)
  1017.                 end
  1018.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,100) == 1 then
  1019.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1020.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  1021.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1022.                 sim.pressure(x/4,y/4,10)
  1023.                 end
  1024.  
  1025.      end
  1026.     end
  1027.  
  1028. --IODHYDRIC ACID--
  1029. elem.property(elements.DEFAULT_PT_ACID, "Description", "Iodhydric Acid. Ultracorrosive.")
  1030. elem.property(elements.DEFAULT_PT_ACID, "Name", "HI3")
  1031. elem.property(elements.DEFAULT_PT_ACID, "Color", 0xCD00CD)
  1032.  
  1033.     local function hi3Update(i, x, y, s, nt)
  1034.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1035.      if r~= nil then --1) HI3 corrodes IRON--
  1036.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,5) == 1 then
  1037.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1038.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1039.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1040.                 end
  1041.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,15) == 1 then
  1042.                 tpt.set_property("temp", 793, x, y)
  1043.                 end --2) HI3 corrodes TTAN--
  1044.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,10) == 1 then
  1045.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1046.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1047.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1048.                 return 1
  1049.                 end
  1050.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,15) == 1 then
  1051.                 tpt.set_property("temp", 793, x, y)
  1052.                 end --3) HI3 corrodes SI--
  1053.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,20) == 1 then
  1054.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1055.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BREL)
  1056.                 return 1
  1057.                 end
  1058.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,15) == 1 then
  1059.                 tpt.set_property("temp", 793, x, y)
  1060.                 end --4) HI3 corrodes SI5FE--
  1061.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,10) == 1 then
  1062.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1063.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1064.                 return 1
  1065.                 end
  1066.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,15) == 1 then
  1067.                 tpt.set_property("temp", 793, x, y)
  1068.                 end --5) HI3 corrodes COPR--
  1069.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,10) == 1 then
  1070.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1071.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1072.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1073.                 return 1
  1074.                 end
  1075.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,15) == 1 then
  1076.                 tpt.set_property("temp", 793, x, y)
  1077.                 end --6) HI3 corrodes CNCW--
  1078.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,50) == 1 then
  1079.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1080.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1081.                 return 1
  1082.                 end
  1083.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,15) == 1 then
  1084.                 tpt.set_property("temp", 793, x, y)
  1085.                 end --7) HCL corrodes ALUM--
  1086.              if sim.partProperty(r, "type") == elem.KEV_PT_ALUM and math.random(1,30) == 1 then
  1087.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1088.                 sim.partProperty(r, "type", elem.KEV_PT_IODV)
  1089.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1090.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1091.                 return 1
  1092.                 end
  1093.              if sim.partProperty(r, "type") == elem.KEV_PT_ALUM and math.random(1,15) == 1 then
  1094.                 tpt.set_property("temp", 793, x, y)
  1095.                 end  --8) HI3 doesnt react with N2--
  1096.              if sim.partProperty(r, "type") == elem.KEV_PT_N2 then
  1097.                 sim.partProperty(i, "type", elem.DEFAULT_PT_ACID)
  1098.                 sim.partProperty(r, "type", elem.KEV_PT_N2)
  1099.                 end
  1100.      end
  1101.     end
  1102.  
  1103. --CHLORHYDRIC ACID--
  1104.     local function hclUpdate(i, x, y, s, nt)
  1105.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1106.      if r~= nil then --1) HCL corrodes IRON--
  1107.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,60) == 1 then
  1108.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1109.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1110.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1111.                 end
  1112.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,15) == 1 then
  1113.                 tpt.set_property("temp", 793, x, y)
  1114.                 end --2) HCL corrodes TTAN--
  1115.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,50) == 1 then
  1116.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1117.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1118.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1119.                 return 1
  1120.                 end
  1121.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,15) == 1 then
  1122.                 tpt.set_property("temp", 793, x, y)
  1123.                 end --3) HCL corrodes SI--
  1124.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,50) == 1 then
  1125.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1126.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BREL)
  1127.                 return 1
  1128.                 end
  1129.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,15) == 1 then
  1130.                 tpt.set_property("temp", 793, x, y)
  1131.                 end --4) HCL corrodes SI5FE--
  1132.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,10) == 1 then
  1133.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1134.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1135.                 return 1
  1136.                 end
  1137.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,15) == 1 then
  1138.                 tpt.set_property("temp", 793, x, y)
  1139.                 end --5) HCL corrodes COPR--
  1140.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,50) == 1 then
  1141.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1142.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1143.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1144.                 return 1
  1145.                 end
  1146.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,15) == 1 then
  1147.                 tpt.set_property("temp", 793, x, y)
  1148.                 end --6) HCL corrodes CNCW--
  1149.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,50) == 1 then
  1150.                 sim.partProperty(i, "type", elem.KEV_PT_CL)
  1151.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1152.                 return 1
  1153.                 end
  1154.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,15) == 1 then
  1155.                 tpt.set_property("temp", 793, x, y)
  1156.                 end --7) HCL corrodes ALUM--
  1157.              if sim.partProperty(r, "type") == elem.KEV_PT_ALUM and math.random(1,110) == 1 then
  1158.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1159.                 sim.partProperty(r, "type", elem.KEV_PT_CL)
  1160.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1161.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1162.                 return 1
  1163.                 end
  1164.              if sim.partProperty(r, "type") == elem.KEV_PT_ALUM and math.random(1,15) == 1 then
  1165.                 tpt.set_property("temp", 793, x, y)
  1166.                 end
  1167.      end
  1168.     end
  1169.  
  1170.  
  1171. --SULFURIC ACID--
  1172.     local function h2so4Update(i, x, y, s, nt)
  1173.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1174.      if r~= nil then --1) H2SO4 corrodes IRON--
  1175.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,45) == 1 then
  1176.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1177.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1178.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1179.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1180.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1181.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1182.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1183.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1184.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1185.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1186.                 end
  1187.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,15) == 1 then
  1188.                 tpt.set_property("temp", 793, x, y)
  1189.                 end  --2) H2SO4 corrodes TTAN--
  1190.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,50) == 1 then
  1191.                 sim.partProperty(i, "type", elem.KEV_PT_S2O)
  1192.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  1193.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1194.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1195.                 return 1
  1196.                 end
  1197.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_TTAN and math.random(1,15) == 1 then
  1198.                 tpt.set_property("temp", 793, x, y)
  1199.                 end --3) H2SO4 corrodes SI--
  1200.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,50) == 1 then
  1201.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1202.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BREL)
  1203.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1204.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1205.                 return 1
  1206.                 end
  1207.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PTCT and math.random(1,15) == 1 then
  1208.                 tpt.set_property("temp", 793, x, y)
  1209.                 end --4) H2SO4 corrodes SI5FE--
  1210.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,20) == 1 then
  1211.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1212.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1213.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1214.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fe2o3")
  1215.                 return 1
  1216.                 end
  1217.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,15) == 1 then
  1218.                 tpt.set_property("temp", 793, x, y)
  1219.                 end --5) H2SO4 corrodes COPR--
  1220.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,25) == 1 then
  1221.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1222.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1223.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1224.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1225.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1226.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cuo")
  1227.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cuo")
  1228.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cuo")
  1229.                 return 1
  1230.                 end
  1231.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_COPR and math.random(1,15) == 1 then
  1232.                 tpt.set_property("temp", 793, x, y)
  1233.                 end --6) H2SO4 corrodes CNCW--
  1234.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,950) == 1 then
  1235.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1236.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1237.                 return 1
  1238.                 end
  1239.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRCK and math.random(1,15) == 1 then
  1240.                 tpt.set_property("temp", 793, x, y)
  1241.                 end --7) H2SO4 corrodes FILT--
  1242.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FILT and math.random(1,150) == 1 then
  1243.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1244.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1245.                 return 1
  1246.                 end --8) H2SO4 corrodes BRMT--
  1247.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT and math.random(1,80) == 1 then
  1248.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1249.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1250.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1251.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1252.                 return 1
  1253.                 end
  1254.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT and math.random(1,15) == 1 then
  1255.                 tpt.set_property("temp", 793, x, y)
  1256.                 end--9) H2SO4 corrodes STNE--
  1257.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_STNE and math.random(1,150) == 1 then
  1258.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1259.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1260.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1261.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1262.                 return 1
  1263.                 end
  1264.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_STNE and math.random(1,15) == 1 then
  1265.                 tpt.set_property("temp", 793, x, y)
  1266.                 end--10) H2SO4 corrodes LIME--
  1267.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_CNCT and math.random(1,120) == 1 then
  1268.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1269.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1270.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1271.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1272.                 return 1
  1273.                 end
  1274.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_CNCT and math.random(1,15) == 1 then
  1275.                 tpt.set_property("temp", 793, x, y)
  1276.                 end --11) H2SO4 corrodes PSCN--
  1277.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PSCN and math.random(1,150) == 1 then
  1278.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1279.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1280.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1281.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1282.                 return 1
  1283.                 end
  1284.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PSCN and math.random(1,15) == 1 then
  1285.                 tpt.set_property("temp", 793, x, y)
  1286.                 end  --12) H2SO4 Corrodes BE--
  1287.              if sim.partProperty(r, "type") == elem.KEV_PT_BE and math.random(1,45) == 1 then
  1288.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1289.                 sim.partProperty(r, "type", elem.KEV_PT_S2O)
  1290.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1291.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1292.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1293.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "brel")
  1294.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "brel")
  1295.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "brel")
  1296.                 return 1
  1297.                 end
  1298.              if sim.partProperty(r, "type") == elem.KEV_PT_BE and math.random(1,15) == 1 then
  1299.                 tpt.set_property("temp", 793, x, y)
  1300.                 end
  1301.      end
  1302.     end
  1303.  
  1304. --NITRIC ACID--
  1305.     local function hno3Update(i, x, y, s, nt)
  1306.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1307.      if r~= nil then --1) HNO3 corrodes IRON--
  1308.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,180) == 1 then
  1309.                 tpt.set_property("temp", 999, x, y)
  1310.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1311.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1312.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1313.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1314.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1315.                 end
  1316.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,45) == 1 then
  1317.                 tpt.set_property("temp", 863, x, y)
  1318.                 end --2) HNO3 corrodes COPR--
  1319.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,215) == 1 then
  1320.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1321.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1322.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1323.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1324.                 end
  1325.              if sim.partProperty(r, "type") == elem.KEV_PT_COPR and math.random(1,45) == 1 then
  1326.                 tpt.set_property("temp", 863, x, y)
  1327.                 end  --3) HNO3 corrodes STEL--
  1328.              if sim.partProperty(r, "type") == elem.KEV_PT_STEL and math.random(1,243) == 1 then
  1329.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1330.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1331.                 tpt.set_property("temp", 999, x, y)
  1332.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1333.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1334.                 end --4) HNO3 disolves WAX--
  1335.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WAX then
  1336.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1337.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1338.                 tpt.set_property("temp", 999, x, y)
  1339.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1340.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1341.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1342.                 end --5) HNO3 disolves WAX--
  1343.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WAX then
  1344.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1345.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1346.                 tpt.set_property("temp", 999, x, y)
  1347.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1348.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1349.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1350.                 end --6) HNO3 disolves GOO--
  1351.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_GOO then
  1352.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1353.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1354.                 tpt.set_property("temp", 999, x, y)
  1355.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1356.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1357.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1358.                 end --7) HNO3 disolves NSCN--
  1359.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_NSCN then
  1360.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1361.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1362.                 tpt.set_property("temp", 999, x, y)
  1363.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1364.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1365.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1366.                 end --8) HNO3 disolves PSCN--
  1367.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PSCN then
  1368.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1369.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1370.                 tpt.set_property("temp", 999, x, y)
  1371.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1372.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1373.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1374.                 end --9) HNO3 disolves WOOD--
  1375.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WOOD then
  1376.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1377.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1378.                 tpt.set_property("temp", 999, x, y)
  1379.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1380.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1381.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1382.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  1383.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  1384.                 end --10) HNO3 disolves PLNT--
  1385.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLNT then
  1386.                 sim.partProperty(i, "type", elem.DEFAULT_PT_WOOD)
  1387.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1388.                 tpt.set_property("temp", 999, x, y)
  1389.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1390.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1391.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1392.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  1393.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  1394.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  1395.                 return 1
  1396.                 end --11) HNO3 mix with SPNG to make IGNC--
  1397.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SPNG then
  1398.                 sim.partProperty(r, "type", elem.DEFAULT_PT_IGNC)
  1399.                 sim.partKill(i)
  1400.                 end --12) HNO3 mix with MWAX to make NITR --
  1401.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_MWAX then
  1402.                 sim.partProperty(i, "type", elem.DEFAULT_PT_NITR)
  1403.                 sim.partProperty(r, "type", elem.DEFAULT_PT_NITR)
  1404.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  1405.                 end --13) HNO3 mix with LIME to make KNO3 --
  1406.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_LIME then
  1407.                 sim.partProperty(i, "type", elem.KEV_PT_KNO3)
  1408.                 sim.partProperty(r, "type", elem.KEV_PT_STNE)
  1409.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  1410.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1411.                 end --14) HNO3 mix with NAOH to make NANO3 --
  1412.              if sim.partProperty(r, "type") == elem.KEV_PT_NAOH then
  1413.                 sim.partProperty(i, "type", elem.KEV_PT_NANO3)
  1414.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WATR)
  1415.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1416.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1417.                 end  --15) HNO3 mix with NH4O3 to make NCL3 --
  1418.              if sim.partProperty(r, "type") == elem.KEV_PT_NH4O3 and sim.pressure(x/4, y/4) >= 20.90  then
  1419.                 sim.partProperty(i, "type", elem.KEV_PT_NCL3)
  1420.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1421.                 tpt.set_property("temp", 999, x, y)
  1422.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1423.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1424.                 end --16) HNO3 mix with NH3 to make NH4O3 --
  1425.              if sim.partProperty(r, "type") == elem.KEV_PT_NH3 then
  1426.                 sim.partProperty(i, "type", elem.KEV_PT_NH4O3)
  1427.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  1428.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1429.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1430.                 end
  1431.      end
  1432.     end
  1433.  
  1434. --TOLUENE--
  1435.     local function c7h8Update(i, x, y, s, nt)
  1436.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1437.      if r~= nil then --1) C7H8 reacts with CH3NO to form TNT--
  1438.              if sim.partProperty(r, "type") == elem.KEV_PT_CH3NO and math.random(1,80) == 1 then
  1439.                 sim.partProperty(i, "type", elem.DEFAULT_PT_TNT)
  1440.                 sim.partProperty(r, "type", elem.DEFAULT_PT_TNT)
  1441.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nitr")
  1442.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nitr")
  1443.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1444.                 return 1
  1445.                 end  --2) C7H8 reacts with NH3 to form TNT--
  1446.              if sim.partProperty(r, "type") == elem.KEV_PT_NH3 and math.random(1,8) == 1 then
  1447.                 sim.partProperty(i, "type", elem.DEFAULT_PT_TNT)
  1448.                 sim.partProperty(r, "type", elem.DEFAULT_PT_TNT)
  1449.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nitr")
  1450.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1451.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1452.                 return 1
  1453.                 end  --3) C7H8 descomposes with PD to form C3H8--
  1454.              if sim.partProperty(r, "type") == elem.KEV_PT_PD and math.random(1,340) == 1 then
  1455.                 sim.partProperty(i, "type", elem.DEFAULT_PT_GAS)
  1456.                 sim.partProperty(r, "type", elem.KEV_PT_PD)
  1457.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1458.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1459.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1460.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1461.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  1462.                 return 1
  1463.                 end   --4) C7H8 descomposes with IRON to form C3H8--
  1464.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,29) >= 1.00 then
  1465.                 sim.partProperty(i, "type", elem.DEFAULT_PT_GAS)
  1466.                 sim.partProperty(r, "type", elem.DEFAULT_PT_IRON)
  1467.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1468.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1469.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1470.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1471.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  1472.                 return 1
  1473.                 end
  1474.      end
  1475.     end
  1476.  
  1477. --SODIUM HYDROXIDE--
  1478.     local function naohUpdate(i, x, y, s, nt)
  1479.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1480.      if r~= nil then  --1) NAOH neutralizes HI to form NAI--
  1481.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_ACID then
  1482.                 sim.partProperty(i, "type", elem.KEV_PT_NAI)
  1483.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WATR)
  1484.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1485.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1486.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1487.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1488.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1489.                 return 1
  1490.                 end  --2) NAOH neutralizes HCL to form NACL--
  1491.              if sim.partProperty(r, "type") == elem.KEV_PT_HCL then
  1492.                 sim.partProperty(i, "type", elem.DEFAULT_PT_SALT)
  1493.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WATR)
  1494.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1495.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1496.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1497.                 tpt.set_pressure(x/4, y/4,2,2,1)
  1498.                 return 1
  1499.                 end  --3) NAOH neutralizes H2SO4 to form <NASO2> replaced by LIME--
  1500.              if sim.partProperty(r, "type") == elem.KEV_PT_H2SO4 then
  1501.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  1502.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1503.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1504.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1505.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1506.                 tpt.set_pressure(x/4, y/4,2,2,1)
  1507.                 return 1
  1508.                 end
  1509.      end
  1510.     end
  1511.  
  1512.  
  1513. --IODINE--
  1514.     local function iodineUpdate(i, x, y, s, nt)
  1515.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1516.      if r~= nil then --1) IOD purifies WATR--
  1517.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR then
  1518.                sim.partProperty(i, "type", iodine)
  1519.                sim.partProperty(r, "type", elem.DEFAULT_PT_DSTW)
  1520.                end
  1521.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW and math.random(1,95) == 1 then
  1522.                sim.partProperty(r, "type", elem.DEFAULT_PT_DSTW)
  1523.                sim.partKill(i)
  1524.                end
  1525.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW then
  1526.                sim.partProperty(i, "type", iodine)
  1527.                sim.partProperty(r, "type", elem.DEFAULT_PT_DSTW)
  1528.                end
  1529.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_BUBW then
  1530.                sim.partProperty(i, "type", iodine)
  1531.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  1532.                end  --2) HI formation
  1533.             if sim.partProperty(r, "type") == elem.KEV_PT_N2H4 then
  1534.                sim.partProperty(i, "type", elem.DEFAULT_PT_ACID)
  1535.                sim.partProperty(r, "type", elem.DEFAULT_PT_ACID)
  1536.                end
  1537.      end
  1538.     end
  1539.  
  1540. --MUD--
  1541.     local function mudUpdate(i, x, y, s, nt)
  1542.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1543.      if r~= nil then  --1) MUD converts into LIME and STONE in contact with FIRE--
  1544.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1545.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  1546.                 sim.partProperty(r, "type", elem.DEFAULT_PT_STNE)
  1547.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1548.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1549.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1550.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "sand")
  1551.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "sand")
  1552.                 return 1
  1553.                 end   --2) MUD converts into CLST and CNCT in contact with FIRE--
  1554.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and sim.pressure(x/4, y/4) >= 30.90 then
  1555.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  1556.                 sim.partProperty(r, "type", elem.DEFAULT_PT_STNE)
  1557.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1558.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1559.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wtrv")
  1560.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "bgla")
  1561.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "bgla")
  1562.                 return 1
  1563.                 end
  1564.      end
  1565.     end
  1566.  
  1567. --OIL TO PROPANE---
  1568. elements.property(elements.DEFAULT_PT_OIL, "Name", "C3H8L")
  1569. elements.property(elements.DEFAULT_PT_OIL, "Description", "Liquid Propane. Flammable. Gassifies into CH3H8 at low pressure.")
  1570. elements.property(elements.DEFAULT_PT_OIL, "Color", 0xCDC5BF)
  1571. elements.property(elements.DEFAULT_PT_OIL, "Flammable", 3870)
  1572.  
  1573. --WATR RENAME---
  1574. elements.property(elements.DEFAULT_PT_WATR, "Name", "H2O")
  1575.  
  1576. ------------------------------------------------------------------------------------------------EXPLOSIVES----------------------------------------------------------------------------------
  1577. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1578.  
  1579. --POTASSIUM NITRATE--
  1580.     local function kno3Update(i, x, y, s, nt)
  1581.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1582.      if r~= nil then --1) Deflagrant explosion parameters--
  1583.              if sim.pressure(x/4, y/4) >= 6.90 then
  1584.             tpt.set_pressure(x/4, y/4,2,2,65)
  1585.                 tpt.set_property("type", "n2o", r)
  1586.                 tpt.set_property("life", 85, r)
  1587.                 tpt.set_property("type", "n2", i)            
  1588.                 end
  1589.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1590.             tpt.set_pressure(x/4, y/4,2,2,65)
  1591.                 tpt.set_property("type", "n2o", r)
  1592.                 tpt.set_property("life", 85, r)
  1593.                 tpt.set_property("type", "n2", i)            
  1594.                 end
  1595.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  1596.             tpt.set_pressure(x/4, y/4,2,2,75)
  1597.                 tpt.set_property("type", "plsm", r)
  1598.                 tpt.set_property("life", 900, r)
  1599.                 tpt.set_property("type", "plsm", i)            
  1600.                 tpt.set_property("life", 1000, r)
  1601.                 tpt.set_property("type", "n2o", i)              
  1602.                 end
  1603.              if sim.partProperty(r, "type") == elem.KEV_PT_N2O then
  1604.                 sim.partProperty(i, "type", elem.KEV_PT_N2O)
  1605.                 sim.partProperty(r, "type", elem.DEFAULT_PT_N2O)
  1606.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1607.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1608.                 end --2) KNO3 mix with S create GUN--
  1609.              if sim.partProperty(r, "type") == elem.KEV_PT_S then
  1610.                 sim.partProperty(i, "type", elem.DEFAULT_PT_GUN)
  1611.                 sim.partProperty(r, "type", elem.DEFAULT_PT_GUN)
  1612.                 end --3) KNO3 fertilizes DIRT--
  1613.              if sim.partProperty(r, "type") == elem.KEV_PT_DIRT then
  1614.                 sim.partProperty(i, "type", elem.DEFAULT_PT_VINE)
  1615.                 sim.partProperty(r, "type", elem.DEFAULT_PT_NEUT)
  1616.                 end --4) KNO3 reacts with HCL to form KCL and WATR--
  1617.              if sim.partProperty(r, "type") == elem.KEV_PT_HCL then
  1618.                 sim.partProperty(i, "type", elem.KEV_PT_KCL)
  1619.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  1620.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1621.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1622.                 tpt.set_pressure(x/4, y/4,5,10,1)
  1623.                 end
  1624.      end
  1625.     end
  1626.  
  1627. --ALUMINIUM OXIDE--
  1628.     local function al2o3Update(i, x, y, s, nt)
  1629.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1630.      if r~= nil then --1) Special explosion parameters--
  1631.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and sim.pressure(x/4, y/4) >= 1.90 then
  1632.                 sim.partProperty(i, "type", elem.KEV_PT_AL)
  1633.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  1634.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1635.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  1636.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  1637.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  1638.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thrm")
  1639.                 tpt.set_pressure(x/4, y/4,-1,1,35)    
  1640.                 end              
  1641.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM and sim.pressure(x/4, y/4) >= 2.90 then
  1642.                 sim.partProperty(i, "type", elem.KEV_PT_AL)
  1643.                 sim.partProperty(r, "type", elem.DEFAULT_PT_EMBR)
  1644.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1645.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1646.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1647.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  1648.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thrm")
  1649.                 tpt.set_pressure(x/4, y/4,-1,1,35)    
  1650.                 end              
  1651.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_EMBR and sim.pressure(x/4, y/4) >= 5.90 then
  1652.                 sim.partProperty(i, "type", elem.KEV_PT_AL)
  1653.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  1654.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1655.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1656.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1657.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  1658.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thrm")
  1659.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "thrm")
  1660.                 tpt.set_pressure(x/4, y/4,-1,1,35)    
  1661.                 end--2) AL2O3 Absorbs OXYG--
  1662.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and sim.pressure(x/4, y/4) >= 10.90 then
  1663.                 sim.partProperty(i, "type", elem.KEV_PT_AL2O3)
  1664.                 sim.partProperty(r, "type", elem.KEV_PT_AL203)    
  1665.                 end  --2) AL2O3 Absorbs OXYG--
  1666.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and sim.pressure(x/4, y/4) >= 10.90 then
  1667.                 sim.partProperty(i, "type", elem.KEV_PT_AL2O3)
  1668.                 sim.partProperty(r, "type", elem.KEV_PT_AL203)    
  1669.                 end  --3) AL2O3 reverts corrotion of TTAN--
  1670.              if sim.partProperty(r, "type") == elem.KEV_PT_TIO2 then
  1671.                 sim.partProperty(i, "type", elem.KEV_PT_AL2O3)
  1672.                 sim.partProperty(r, "type", elem.DEFAULT_PT_TTAN)
  1673.                 tpt.set_pressure(x/4, y/4,1,2,-1.5)  
  1674.                 end  --4) AL2O3 under pressure with SIO2 forms CLST--
  1675.              if sim.partProperty(r, "type") == elem.KEV_PT_SIO2 and sim.pressure(x/4, y/4) >= 12.00 then
  1676.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CLST)
  1677.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CLST)  
  1678.                 end  --5) AL2O3 mixed with FE3O2 forms THRM--
  1679.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT then
  1680.                 sim.partProperty(i, "type", elem.DEFAULT_PT_THRM)
  1681.                 sim.partProperty(r, "type", elem.DEFAULT_PT_THRM)    
  1682.                 end
  1683.      end
  1684.     end
  1685.  
  1686. --NITROGEN TRICHLORIDE--
  1687.     local function ncl3Update(i, x, y, s, nt)
  1688.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1689.      if r~= nil then  --1) NCL3 explosivity and flammability paramethers--
  1690.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1691.                 sim.partProperty(i, "type", elem.KEV_PT_NH3)
  1692.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  1693.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1694.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1695.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1696.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1697.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1698.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1699.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1700.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1701.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1702.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1703.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1704.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1705.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1706.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hcl")
  1707.                 tpt.set_pressure(x/4, y/4,-1,1,155)      
  1708.                 end  
  1709.              if sim.pressure(x/4, y/4) >= 2.90 then
  1710.                 sim.partProperty(i, "type", elem.KEV_PT_NH3)
  1711.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  1712.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1713.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1714.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1715.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1716.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1717.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1718.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1719.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1720.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1721.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1722.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1723.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1724.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1725.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1726.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1727.                 tpt.set_pressure(x/4, y/4,-1,1,155)
  1728.                 end
  1729.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  1730.                 sim.partProperty(i, "type", elem.KEV_PT_NH3)
  1731.                 sim.partProperty(r, "type", elem.KEV_PT_N2O)
  1732.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1733.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1734.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1735.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1736.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1737.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1738.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1739.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1740.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1741.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1742.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1743.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1744.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1745.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1746.                 tpt.set_pressure(x/4, y/4,-1,1,155)
  1747.                 end  --2) NCL3 corrodes IRON--
  1748.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and math.random(1,655) == 1 then
  1749.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1750.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  1751.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1752.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1753.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1754.                 return 1
  1755.                 end  --3) NCL3 corrodes METL--
  1756.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_METL and math.random(1,695) == 1 then
  1757.                 sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  1758.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  1759.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  1760.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1761.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1762.                 return 1
  1763.                 end
  1764.      end
  1765.     end
  1766.  
  1767. --SULFUR--
  1768.     local function sUpdate(i, x, y, s, nt)
  1769.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1770.      if r~= nil then --1) Special explosion parameters--
  1771.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1772.                 sim.partProperty(i, "type", elem.KEV_PT_S2O)
  1773.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  1774.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1775.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1776.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1777.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1778.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1779.                 tpt.set_pressure(x/4, y/4,-1,1,35)    
  1780.                 end
  1781.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  1782.                 sim.partProperty(i, "type", elem.KEV_PT_S2O)
  1783.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  1784.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1785.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1786.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1787.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1788.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1789.                 tpt.set_pressure(x/4, y/4,-1,1,35)    
  1790.                 end  --2) S oxides with OXYG--
  1791.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and math.random(1,15) == 1 then
  1792.                 sim.partProperty(i, "type", elem.KEV_PT_S2O)
  1793.                 sim.partProperty(r, "type", elem.DEFAULT_PT_S2O)
  1794.                 end  --3) S forms H2SO4 in contact with HCL--
  1795.              if sim.partProperty(r, "type") == elem.KEV_PT_HCL and math.random(1,15) == 1 then
  1796.                 sim.partProperty(i, "type", elem.KEV_PT_HCL)
  1797.                 sim.partProperty(r, "type", elem.KEV_PT_H2SO4)
  1798.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  1799.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1800.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1801.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cl")
  1802.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  1803.                 end
  1804.      end
  1805.     end
  1806.  
  1807. --NITROCELLULOSE--
  1808.     ----No functions by now, wait for next version please---
  1809.  
  1810. --ANFO--
  1811.     local function anfoUpdate(i, x, y, s, nt)
  1812.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1813.      if r~= nil then --1) Special explosive and flammability paramethers--
  1814.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1815.                 sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  1816.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  1817.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1818.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1819.                 sim.pressure(x/4,y/4,195)
  1820.                 tpt.set_property("temp", math.huge, x, y)
  1821.                 end
  1822.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  1823.                 sim.partProperty(i, "type", elem.DEFAULT_PT_PLSM)
  1824.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  1825.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1826.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1827.                 tpt.set_pressure(x/4, y/4,5,10,196)
  1828.                 tpt.set_property("temp", math.huge, x, y)
  1829.                 end
  1830.              if sim.pressure(x/4, y/4) >= 3.00 then
  1831.                 sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  1832.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  1833.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1834.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1835.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1836.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1837.                 tpt.set_pressure(x/4, y/4,5,10,196)
  1838.                 end
  1839.      end
  1840.     end
  1841.    
  1842.  
  1843. --NITROGEN IODIDE--
  1844.     local function ni3Update(i, x, y, s, nt)
  1845.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1846.      if r~= nil then --1) Special explosive and flammability paramethers--
  1847.              if sim.partProperty(r, "type") == elem.KEV_PT_I then
  1848.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1849.                 sim.partProperty(r, "type", elem.KEV_PT_IODV)
  1850.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1851.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1852.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1853.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1854.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1855.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1856.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1857.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1858.                 sim.pressure(x/4,y/4,85)
  1859.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1860.                 tpt.set_property("temp", 403, x, y)
  1861.                 end
  1862.              if sim.partProperty(r, "type") == elem.KEV_PT_IODV then
  1863.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1864.                 sim.partProperty(r, "type", elem.KEV_PT_IODV)
  1865.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1866.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1867.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1868.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1869.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1870.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1871.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1872.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1873.                 sim.pressure(x/4,y/4,85)
  1874.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1875.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1876.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1877.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1878.                 end
  1879.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1880.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1881.                 sim.partProperty(r, "type", elem.KEV_PT_IODV)
  1882.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1883.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1884.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1885.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1886.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1887.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1888.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1889.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")  
  1890.                 sim.pressure(x/4,y/4,85)
  1891.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1892.                 tpt.set_property("temp", 403, x, y)
  1893.                 end
  1894.              if sim.pressure(x/4, y/4) >= 2.00 then
  1895.                 sim.partProperty(i, "type", elem.KEV_PT_IODV)
  1896.                 sim.partProperty(r, "type", elem.KEV_PT_IODV)
  1897.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1898.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1899.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1900.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1901.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1902.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1903.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1904.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "iodv")
  1905.                 sim.pressure(x/4,y/4,85)
  1906.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1907.                 tpt.set_property("temp", 403, x, y)
  1908.                 end
  1909.      end
  1910.     end
  1911.  
  1912. --BLACK GUNPOWDER--
  1913.     local function bgunUpdate(i, x, y, s, nt)
  1914.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1915.      if r~= nil then
  1916.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  1917.                 sim.partProperty(i, "type", elem.DEFAULT_PT_EMBR)
  1918.                 sim.partProperty(r, "type", elem.DEFAULT_PT_EMBR)
  1919.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1920.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1921.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1922.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1923.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1924.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1925.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1926.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1927.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1928.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1929.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1930.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1931.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1932.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1933.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1934.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")  
  1935.                 sim.pressure(x/4,y/4,85)
  1936.                 end
  1937.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  1938.                 sim.partProperty(i, "type", elem.DEFAULT_PT_EMBR)
  1939.                 sim.partProperty(r, "type", elem.DEFAULT_PT_EMBR)
  1940.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1941.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1942.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1943.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1944.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1945.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1946.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1947.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1948.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1949.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1950.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1951.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  1952.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  1953.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1954.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  1955.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")  
  1956.                 sim.pressure(x/4,y/4,85)
  1957.                 end
  1958.      end
  1959.     end
  1960.  
  1961. --AMONIUM NITRATE--
  1962.     local function nh4o3Update(i, x, y, s, nt)
  1963.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  1964.      if r~= nil then --1) NH4O2 Comburent properties--
  1965.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN and math.random(1,29) == 1 then
  1966.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1967.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  1968.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1969.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1970.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1971.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1972.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1973.                 end
  1974.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and math.random(1,29) == 1 then
  1975.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1976.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  1977.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1978.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1979.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1980.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1981.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1982.                 end
  1983.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OIL and math.random(1,25) == 1 then
  1984.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1985.                 sim.partProperty(r, "type", elem.KEV_PT_ANFO)
  1986.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1987.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1988.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1989.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  1990.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "anfo")
  1991.                 end
  1992.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_GAS and math.random(1,34) == 1 then
  1993.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  1994.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  1995.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1996.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  1997.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1998.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  1999.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2000.                 end
  2001.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_NITR and math.random(1,30) == 1 then
  2002.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  2003.                 sim.partProperty(r, "type", elem.DEFAULT_PT_NITR)
  2004.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2005.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2006.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2007.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2008.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2009.                 end
  2010.              if sim.partProperty(r, "type") == elem.KEV_PT_NCL3 and math.random(1,34) == 1 then
  2011.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  2012.                 sim.partProperty(r, "type", elem.KEV_PT_NCL3)
  2013.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2014.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2015.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2016.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2017.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2018.                 end
  2019.              if sim.partProperty(r, "type") == elem.KEV_PT_C2H2 and math.random(1,26) == 1 then
  2020.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  2021.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  2022.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2023.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2024.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2025.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2026.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2027.                 end
  2028.              if sim.partProperty(r, "type") == elem.KEV_PT_CH4 and math.random(1,28) == 1 then
  2029.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  2030.                 sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  2031.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2032.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2033.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2034.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2035.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2036.                 end --2) NH4O2 special flammability paramethers--
  2037.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and math.random(1,745) == 1 then
  2038.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  2039.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2040.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2041.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2042.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  2043.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  2044.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  2045.                 end              
  2046.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and sim.pressure(x/4, y/4) >= 2.00 and math.random(1,5) == 1 then
  2047.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OXYG)
  2048.                 sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2049.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2050.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2051.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  2052.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  2053.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2054.                 sim.pressure(x/4,y/4,35)
  2055.                 end
  2056.      end
  2057.     end
  2058.  
  2059. --ACETILENE--
  2060.     local function c2h2Update(i, x, y, s, nt)
  2061.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2062.      if r~= nil then --1) Special explosive and flammability paramethers--
  2063.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  2064.                 tpt.set_property("temp", math.huge, x, y)
  2065.                 sim.partProperty(i, "type", elem.DEFAULT_PT_PLSM)
  2066.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  2067.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2068.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2069.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2070.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2071.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2072.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2073.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  2074.                 tpt.set_property("temp", math.huge, x, y)
  2075.                 sim.pressure(x/4,y/4,15)
  2076.                 end
  2077.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLSM then
  2078.                 tpt.set_property("temp", math.huge, x, y)
  2079.                 sim.partProperty(i, "type", elem.DEFAULT_PT_PLSM)
  2080.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  2081.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2082.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2083.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2084.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2085.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2086.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2087.                 tpt.set_property("temp", math.huge, x, y)
  2088.                 tpt.set_pressure(x/4, y/4,5,10,19)
  2089.                 end
  2090.              if sim.pressure(x/4, y/4) >= 153.00 then
  2091.                 tpt.set_property("temp", math.huge, x, y)
  2092.                 sim.partProperty(i, "type", elem.DEFAULT_PT_PLSM)
  2093.                 sim.partProperty(r, "type", elem.DEFAULT_PT_PLSM)
  2094.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2095.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2096.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2097.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
  2098.                 tpt.set_property("temp", math.huge, x, y)
  2099.                 tpt.set_pressure(x/4, y/4,5,10,19)
  2100.                 end
  2101.      end
  2102.     end
  2103.  
  2104. ------------------------------------------------------------------------------------------------POWDERS----------------------------------------------------------------------------------
  2105. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2106.  
  2107. --DIRT--
  2108.     local function dirtUpdate(i, x, y, s, nt)
  2109.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2110.      if r~= nil then --1) LIME formation--
  2111.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SALT and math.random(1,7250) == 1 then
  2112.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2113.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2114.                 end
  2115.              if sim.partProperty(r, "type") == elem.KEV_PT_CAC2 and math.random(1,9650) == 1 then
  2116.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2117.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2118.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2119.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2120.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2121.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2122.                 end
  2123.              if math.random(1,33650) == 1 then
  2124.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2125.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2126.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2127.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2128.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2129.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2130.                 end --2) FE2O3 formation--
  2131.              if math.random(1,952745) == 1 then
  2132.                 sim.partProperty(i, "type", elem.DEFAULT_PT_BRMT)
  2133.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BRMT)
  2134.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2135.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2136.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2137.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2138.                 end --3) STNE formation--
  2139.              if math.random(1,38745) == 1 then
  2140.                 sim.partProperty(i, "type", elem.DEFAULT_PT_STNE)
  2141.                 sim.partProperty(r, "type", elem.DEFAULT_PT_STNE)
  2142.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2143.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2144.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2145.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2146.                 end  --4) KNO3 formation--            
  2147.              if sim.partProperty(r, "type") == elem.KEV_PT_N2 and math.random(1,7190) == 1 then
  2148.                 sim.partProperty(i, "type", elem.KEV_PT_KNO3)
  2149.                 sim.partProperty(r, "type", elem.KEV_PT_NH3)
  2150.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2151.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2152.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2153.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2154.                 end  --4) DIRT fertility--            
  2155.              if sim.partProperty(r, "type") == elem.KEV_PT_SEED and math.random(1,7) == 1 then
  2156.                 sim.partProperty(i, "type", elem.DEFAULT_PT_VINE)
  2157.                 sim.partProperty(r, "type", elem.DEFAULT_PT_NEUT)
  2158.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2159.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2160.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2161.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2162.                 end
  2163.      end
  2164.     end
  2165.  
  2166. --ROCK FORMATION FROM STNE--
  2167.    local function stonetorockUpdate(i, x, y, s, nt)
  2168.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2169.      if r~= nil then   --1) N2 helps formation--
  2170.              if sim.partProperty(r, "type") == elem.KEV_PT_N2 and math.random(1,7750) == 1 then
  2171.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2172.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2173.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2174.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2175.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2176.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2177.                 end  --2) Pressure helps formation--
  2178.              if sim.pressure(x/4,y/4) >= 36.00 then
  2179.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2180.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2181.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2182.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2183.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2184.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2185.                 end  --3) SLTW helps formation--
  2186.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW and math.random(1,2550) == 1 then
  2187.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2188.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2189.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2190.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2191.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2192.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2193.                 end  --4) WATR helps formation--
  2194.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1,3850) == 1 then
  2195.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2196.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2197.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2198.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2199.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2200.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2201.                 end  --5) SALT helps formation--
  2202.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SALT and math.random(1,100000) == 1 then
  2203.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2204.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2205.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2206.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2207.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2208.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2209.                 end  --6) AL2O3 helps formation--
  2210.              if sim.partProperty(r, "type") == elem.KEV_PT_AL2O3 and math.random(1,100000) == 1 then
  2211.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2212.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2213.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2214.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2215.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2216.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2217.                 end
  2218.      end
  2219.     end
  2220.  
  2221. --LIMESTONE--
  2222.  
  2223. elem.property(elements.DEFAULT_PT_CNCT, "Name", "LIME")
  2224. elem.property(elements.DEFAULT_PT_CNCT, "Description", "Limestone. Raw Material for CMNT. OIL and C3H8 can be extracted from it.")
  2225. elem.property(elements.DEFAULT_PT_CNCT, "HighTemperatureTransition", DEFAULT_PT_LAVA)
  2226. elem.property(elements.DEFAULT_PT_CNCT, "HighTemperature", 1783.15)
  2227. elem.property(elements.DEFAULT_PT_CNCT, "Color", 0xFFFFE0)
  2228. elem.property(elements.DEFAULT_PT_CNCT, "Weight", 96.00)
  2229.  
  2230.    local function limestoneUpdate(i, x, y, s, nt)
  2231.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2232.      if r~= nil then   --1) LIME converts into CAC2 when its burned with BCOL--
  2233.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_LAVA and sim.partProperty(r, "ctype") == elem.KEV_PT_BGPH then
  2234.                 sim.partProperty(i, "type", elem.KEV_PT_CAC2)
  2235.                 sim.partProperty(r, "type", elem.KEV_PT_CAC2)
  2236.                 end  
  2237.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_LAVA and sim.partProperty(i, "ctype") == elem.KEV_PT_BGPH then
  2238.                 sim.partProperty(i, "type", elem.KEV_PT_CAC2)
  2239.                 sim.partProperty(r, "type", elem.KEV_PT_CAC2)
  2240.                 end  --2) BUBW helps formation--
  2241.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BUBW and math.random(1,19550) == 1 then
  2242.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2243.                 sim.partProperty(r, "type", elem.DEFAULT_PT_QRTZ)
  2244.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2245.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2246.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2247.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2248.                 end  --4) CO2 helps formation--
  2249.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_CO2 and math.random(1,13850) == 1 then
  2250.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2251.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2252.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2253.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2254.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2255.                 end  --5) LIME Porosity--
  2256.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OIL and math.random(1,50) == 1 then
  2257.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OIL)
  2258.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2259.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2260.                 end
  2261.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_GAS and math.random(1,50) == 1 then
  2262.                 sim.partProperty(i, "type", elem.DEFAULT_PT_GAS)
  2263.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2264.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2265.                 end
  2266.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_CH4 and math.random(1,50) == 1 then
  2267.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CH4)
  2268.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2269.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2270.                 end
  2271.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_CO2 and math.random(1,50) == 1 then
  2272.                 sim.partProperty(i, "type", elem.DEFAULT_PT_OIL)
  2273.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2274.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2275.                 end
  2276.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1,50) == 1 then
  2277.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2278.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WATR)
  2279.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2280.                 end
  2281.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WTRV and math.random(1,50) == 1 then
  2282.                 sim.partProperty(i, "type", elem.KEV_PT_CMNT)
  2283.                 sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  2284.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2285.                 end
  2286.              if sim.pressure(x/4, y/4) <= -12.00 then
  2287.                 sim.partProperty(i, "type", elem.DEFAULT_PT_GAS)
  2288.                 sim.partProperty(r, "type", elem.DEFAULT_PT_STNE)
  2289.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2290.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2291.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "qrtz")
  2292.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  2293.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "ch4")
  2294.                 end --5) CMNT formation--
  2295.              if sim.partProperty(r, "type") == elem.KEV_PT_SIO2 and math.random(1,50) == 1 then
  2296.                 sim.partProperty(i, "type", elem.KEV_PT_CMNT)
  2297.                 sim.partProperty(r, "type", elem.KEV_PT_CMNT)
  2298.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2299.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2300.                 end
  2301.              if sim.partProperty(r, "type") == elem.KEV_PT_AL2O3 and math.random(1,100) == 1 then
  2302.                 sim.partProperty(i, "type", elem.KEV_PT_CMNT)
  2303.                 sim.partProperty(r, "type", elem.KEV_PT_CMNT)
  2304.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2305.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2306.                 end
  2307.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT and math.random(1,10) == 1 then
  2308.                 sim.partProperty(i, "type", elem.KEV_PT_CMNT)
  2309.                 sim.partProperty(r, "type", elem.KEV_PT_CMNT)
  2310.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2311.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2312.                 end
  2313.      end
  2314.     end
  2315.  
  2316.  
  2317. --ROCK--
  2318.    local function rockUpdate(i, x, y, s, nt)
  2319.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2320.      if r~= nil then --1) LIME formation--
  2321.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SALT and math.random(1,250) == 1 then
  2322.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2323.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2324.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2325.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2326.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2327.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2328.                 end
  2329.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW and math.random(1,50) == 1 then
  2330.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2331.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2332.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2333.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2334.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2335.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2336.                 end
  2337.              if sim.partProperty(r, "type") == elem.KEV_PT_CAC2 and math.random(1,650) == 1 then
  2338.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2339.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2340.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2341.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2342.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2343.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2344.                 end
  2345.              if math.random(1,13650) == 1 then
  2346.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2347.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CNCT)
  2348.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2349.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2350.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2351.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2352.                 end --2) FE2O3 formation--
  2353.              if math.random(1,32745) == 1 then
  2354.                 sim.partProperty(i, "type", elem.DEFAULT_PT_BRMT)
  2355.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BRMT)
  2356.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2357.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2358.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2359.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2360.                 end --3) STNE formation--
  2361.              if math.random(1,21745) == 1 then
  2362.                 sim.partProperty(i, "type", elem.DEFAULT_PT_STNE)
  2363.                 sim.partProperty(r, "type", elem.DEFAULT_PT_STNE)
  2364.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2365.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2366.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  2367.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2")
  2368.                 end --4) ROCK formation--
  2369.              if math.random(1,18945) == 1 then
  2370.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2371.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2372.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2373.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2374.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2375.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2376.                 end  --5) AL2O3 formation--
  2377.              if math.random(1,30590) == 1 then
  2378.                 sim.partProperty(i, "type", elem.KEV_PT_AL2O3)
  2379.                 sim.partProperty(r, "type", elem.KEV_PT_AL2O3)
  2380.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2381.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2382.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2383.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2384.                 end  --6) CLST formation--
  2385.              if math.random(1,97590) == 1 then
  2386.                 sim.partProperty(i, "type", elem.DEFAULT_PT_CLST)
  2387.                 sim.partProperty(r, "type", elem.DEFAULT_PT_CLST)
  2388.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2389.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2390.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2391.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2392.                 end  --10) SIO2 formation--
  2393.              if math.random(1,70250) == 1 then
  2394.                 sim.partProperty(i, "type", elem.KEV_PT_SIO2)
  2395.                 sim.partProperty(r, "type", elem.KEV_PT_SIO2)
  2396.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2397.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2398.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2399.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2400.                 end   --11) CUO formation--
  2401.              if math.random(1,80560) == 1 then
  2402.                 sim.partProperty(i, "type", elem.KEV_PT_CUO)
  2403.                 sim.partProperty(r, "type", elem.KEV_PT_CUO)
  2404.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2405.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2406.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2407.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2408.                 end --12) BREL formation--
  2409.              if math.random(1,85650) == 1 then
  2410.                 sim.partProperty(i, "type", elem.DEFAULT_PT_BREL)
  2411.                 sim.partProperty(r, "type", elem.DEFAULT_PT_BREL)
  2412.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2413.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2414.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2415.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2416.                 end  --13) ROCK reformation--
  2417.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_STNE and math.random(1,10260) == 1 then
  2418.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2419.                 sim.partKill(r)
  2420.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "stne")
  2421.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "stne")
  2422.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2423.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2424.                 end
  2425.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_CNCT and math.random(1,58320) == 1 then
  2426.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2427.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2428.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "stne")
  2429.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "rock")
  2430.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2431.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2432.                 end
  2433.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_BRMT and math.random(1,59400) == 1 then
  2434.                 sim.partProperty(i, "type", elem.KEV_PT_ROCK)
  2435.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2436.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "stne")
  2437.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "rock")
  2438.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2439.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "c3h8")
  2440.                 end  --14) ROCK GAS and WATR porosity--
  2441.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1,3600) == 1 then
  2442.                 sim.partProperty(i, "type", elem.DEFAULT_PT_WATR)
  2443.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2444.                 end
  2445.              if sim.partProperty(r, "type") == elem.KEV_PT_CH4 and math.random(1,2350) == 1 then
  2446.                 sim.partProperty(i, "type", elem.KEV_PT_CH4)
  2447.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2448.                 end
  2449.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_GAS and math.random(1,6880) == 1 then
  2450.                 sim.partProperty(i, "type", elem.KEV_PT_CH4)
  2451.                 sim.partProperty(r, "type", elem.KEV_PT_ROCK)
  2452.                 end
  2453.      end
  2454.     end
  2455.  
  2456. --SEED--
  2457.     --No functions by now, check again in the next actualization.--
  2458.  
  2459. --CEMENT--
  2460.    local function cementUpdate(i, x, y, s, nt)
  2461.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2462.      if r~= nil then --1) CMNT consolides well into CNCW---
  2463.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR then
  2464.             sim.partProperty(i, "type", elem.DEFAULT_PT_BRCK)
  2465.             sim.partProperty(r, "type", elem.DEFAULT_PT_PSTE)
  2466.             tpt.set_property("temp", 363, x, y)
  2467.             end
  2468.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_PSTE then
  2469.             sim.partProperty(i, "type", elem.DEFAULT_PT_BRCK)
  2470.             sim.partProperty(r, "type", elem.KEV_PT_CMNT)
  2471.             end  --2) CMNT consolides bad into CNCW and SALT---
  2472.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW then
  2473.             sim.partProperty(i, "type", elem.DEFAULT_PT_SALT)
  2474.             sim.partProperty(r, "type", elem.DEFAULT_PT_PSTE)
  2475.             tpt.set_property("temp", 393, x, y)
  2476.             end
  2477.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_SALT then
  2478.             sim.partProperty(i, "type", elem.DEFAULT_PT_STNE)
  2479.             sim.partProperty(r, "type", elem.DEFAULT_PT_SALT)
  2480.             end
  2481.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_STNE and math.random(1,60) == 1 then
  2482.             sim.partProperty(i, "type", elem.DEFAULT_PT_CNCT)
  2483.             sim.partProperty(r, "type", elem.DEFAULT_PT_BRMT)
  2484.             end --2) CMNT consolides  bad into CNCW and CO2---
  2485.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_BUBW then
  2486.             sim.partProperty(i, "type", elem.DEFAULT_PT_CO2)
  2487.             sim.partProperty(r, "type", elem.DEFAULT_PT_PSTE)
  2488.             tpt.set_property("temp", 323, x, y)
  2489.             end
  2490.      end
  2491.     end
  2492.  
  2493. --BROKENGRAPHITE--
  2494.     local function bgraphiteUpdate(i, x, y, s, nt)
  2495.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2496.      if r~= nil then --1) BGPH oxides in contc with OXYG--
  2497.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and math.random(1,1620) == 1 then
  2498.             sim.partProperty(i, "type", elem.DEFAULT_PT_CO2)
  2499.             sim.partProperty(r, "type", elem.KEV_PT_BCAR)
  2500.             end      --2) BGPH produces HYGN when touches NEUT--
  2501.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_NEUT and math.random(1,2) == 1 then
  2502.             sim.partProperty(i, "type", elem.KEV_PT_BGPH)
  2503.             sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  2504.             end     --2) BGPH absorbs PHOT--
  2505.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
  2506.             sim.partKill(r)
  2507.             end
  2508.            
  2509.      end
  2510.     end
  2511.  
  2512. --BROKENCARBONO--
  2513.     local function bcarbonoUpdate(i, x, y, s, nt)
  2514.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2515.      if r~= nil then  --2) BCAR converts into C3H8 in presense of HYGN (rare) --
  2516.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN and math.random(1,16590) == 2 then
  2517.                sim.partProperty(r, "type", elem.DEFAULT_PT_GAS)
  2518.                sim.partKill(i)
  2519.                end --3) BCAR ignition--
  2520.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  2521.                sim.partProperty(r, "type", elem.DEFAULT_PT_COAL)
  2522.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2523.                end --4) STEL aleation--
  2524.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_IRON and sim.partProperty(r, "ctype") == elem.DEFAULT_PT_LAVA then
  2525.                sim.partProperty(r, "type", elem.KEV_PT_STEL)
  2526.                sim.partKill(i)
  2527.                end
  2528.      end
  2529.     end
  2530.  
  2531. --CALCIUM CARBIDE--
  2532.     local function cac2Update(i, x, y, s, nt)
  2533.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2534.      if r~= nil then   --1) CAC2 converts into C2H2 with WATR--
  2535.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1,3) == 2 then
  2536.                sim.partProperty(i, "type", elem.KEV_PT_C2H2)
  2537.                sim.partProperty(r, "type", elem.KEV_PT_C2H2)
  2538.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2539.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2540.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  2541.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  2542.                end   --2) CAC2 converts into C2H2 with SLTW--
  2543.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW and math.random(1,9) == 2 then
  2544.                sim.partProperty(i, "type", elem.KEV_PT_C2H2)
  2545.                sim.partProperty(r, "type", elem.KEV_PT_C2H2)
  2546.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2547.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2548.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  2549.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "salt")
  2550.                end  --3) CAC2 fertilizes DIRT with N2--
  2551.             if sim.partProperty(r, "type") == elem.KEV_PT_DIRT and math.random(1,93) == 2 then
  2552.                sim.partProperty(i, "type", elem.DEFAULT_PT_PLNT)
  2553.                sim.partProperty(r, "type", elem.KEV_PT_C2H2)
  2554.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2555.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nh3")
  2556.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "n2o")
  2557.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  2558.                end
  2559.      end
  2560.     end
  2561.  
  2562. --SILICON DIOXIDE--
  2563.     local function sio2Update(i, x, y, s, nt)
  2564.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2565.      if r~= nil then --1) SIO2 in contact with FIRE forms BGLA--
  2566.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and math.random(1,3) == 2 then
  2567.                sim.partProperty(i, "type", elem.DEFAULT_PT_BGLA)
  2568.                sim.partProperty(r, "type", elem.DEFAULT_PT_PQRT)
  2569.                end  --3) SIO2 in contact with DUST forms SAND--
  2570.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_DUST and math.random(1,3) == 2 then
  2571.                sim.partProperty(i, "type", elem.DEFAULT_PT_SAND)
  2572.                sim.partProperty(r, "type", elem.DEFAULT_PT_SAND)
  2573.                end --4) SIO2 in contact with SLTW forms QRTZ--
  2574.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW and math.random(1,300) == 2 then
  2575.                sim.partProperty(i, "type", elem.DEFAULT_PT_QRTZ)
  2576.                sim.partProperty(r, "type", elem.DEFAULT_PT_WATR)
  2577.                end --5) SIO2 in contact with FIRE forms BGLA--
  2578.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and math.random(1,3) == 2 then
  2579.                sim.partProperty(i, "type", elem.DEFAULT_PT_BGLA)
  2580.                sim.partProperty(r, "type", elem.DEFAULT_PT_PQRT)
  2581.                end
  2582.      end
  2583.     end
  2584.  
  2585. --COPPER OXIDE--
  2586.     local function cuoUpdate(i, x, y, s, nt)
  2587.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2588.      if r~= nil then --1) CUO in contact with HYGN forms COPR and WATR--
  2589.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_HYGN and math.random(1,60) == 2 then
  2590.                sim.partProperty(i, "type", elem.KEV_PT_COPR)
  2591.                sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  2592.                end  --2) CUO in contact with H2SO4 forms CUSO4 and WATR--
  2593.             if sim.partProperty(r, "type") == elem.KEV_PT_H2SO4 and math.random(1,160) == 2 then
  2594.                sim.partProperty(i, "type", elem.KEV_PT_CUSO4)
  2595.                sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  2596.                end  --3) CUO in contact with NAOH forms ELEC --
  2597.             if sim.partProperty(r, "type") == elem.KEV_PT_NAOH and math.random(1,6530) == 1 then
  2598.                sim.partProperty(i, "type", elem.KEV_PT_NAOH)
  2599.                sim.partProperty(r, "type", elem.DEFAULT_PT_ELEC)
  2600.                end  --4) CUO in contact with CO forms COPR and WATR--
  2601.             if sim.partProperty(r, "type") == elem.KEV_PT_CO and math.random(1,120) == 2 then
  2602.                sim.partProperty(i, "type", elem.KEV_PT_COPR)
  2603.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2604.                end --5) CUO reacts with FIRE forms EMBR and COPR--
  2605.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  2606.                sim.partProperty(i, "type", elem.KEV_PT_COPR)
  2607.                sim.partProperty(r, "type", elem.DEFAULT_PT_EMBR)
  2608.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2609.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2610.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  2611.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "smke")
  2612.                end
  2613.      end
  2614.     end
  2615.  
  2616. --TITANIUM OXIDE--
  2617.     local function tio2Update(i, x, y, s, nt)
  2618.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2619.      if r~= nil then --1) TIO2 in contact with NAOH gets sparked--
  2620.             if sim.partProperty(r, "type") == elem.KEV_PT_NAOH and math.random(1,4) == 2 then
  2621.                sim.partProperty(i, "type", elem.DEFAULT_PT_SPRK)
  2622.                sim.partProperty(i, "ctype", elem.KEV_PT_TIO2)
  2623.                end
  2624.      end
  2625.     end
  2626.  
  2627. --TITANIUM FORMS OXIDE--
  2628.  
  2629. --TITANIUM TO TITANIUM CARBIDE AND OXIDES--
  2630.     local function titoticUpdate(i, x, y, s, nt)
  2631.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2632.      if r~= nil then
  2633.              if sim.partProperty(r, "type") == elem.KEV_PT_CH4 and math.random(1,240) == 1 then
  2634.                 sim.partProperty(i, "type", elem.KEV_PT_TIC)
  2635.                 sim.partProperty(r, "type", elem.DEFAULT_PT_HYGN)
  2636.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2637.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
  2638.                 end
  2639.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and math.random(1,6790) == 2 then
  2640.                 sim.partProperty(r, "type", elem.KEV_PT_TIO2)
  2641.                 sim.partKill(i)
  2642.                 end  
  2643.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW and math.random(1,3415) == 2 then
  2644.                 sim.partProperty(r, "type", elem.KEV_PT_TIO2)
  2645.                 sim.partKill(i)
  2646.                 end
  2647.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR and math.random(1,4880) == 2 then
  2648.                 sim.partProperty(r, "type", elem.KEV_PT_TIO2)
  2649.                 sim.partKill(i)
  2650.                 end
  2651.              if sim.partProperty(r, "type") == elem.KEV_PT_O3 and math.random(1,790) == 2 then
  2652.                 sim.partProperty(r, "type", elem.KEV_PT_TIO2)
  2653.                 sim.partKill(i)
  2654.                 end
  2655.      end
  2656.     end
  2657.  
  2658. --COPPER SULFATE--
  2659.     local function cuso4Update(i, x, y, s, nt)
  2660.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2661.      if r~= nil then --1) CUSO4 purifies WATR, SLTW and BUBW--
  2662.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_SLTW then
  2663.                sim.partProperty(r, "type", elem.DEFAULT_PT_DSTW)
  2664.                sim.partKill(i)
  2665.                end
  2666.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_BUBW then
  2667.                sim.partProperty(r, "type", elem.DEFAULT_PT_DSTW)
  2668.                sim.partKill(i)
  2669.                end
  2670.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WATR then
  2671.                sim.partProperty(r, "type", elem.DEFAULT_PT_DSTW)
  2672.                sim.partKill(i)
  2673.                end  --2) CUSO4 slowly kills PLNT
  2674.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_PLNT and math.random(1,2) == 2 then
  2675.                sim.partProperty(i, "type", elem.KEV_PT_CO)
  2676.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2677.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  2678.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  2679.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2680.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2681.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wood")
  2682.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wood")
  2683.                end  --3) CUSO4 slowly kills VINE
  2684.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_VINE and math.random(1,2) == 2 then
  2685.                sim.partProperty(i, "type", elem.KEV_PT_CUSO4)
  2686.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2687.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  2688.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  2689.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2690.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2691.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wood")
  2692.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "wood")
  2693.                end  --4) CUSO4 slowly turns WOOD into DIRT
  2694.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WOOD and math.random(1,5) == 2 then
  2695.                sim.partProperty(i, "type", elem.KEV_PT_CUSO4)
  2696.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2697.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  2698.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co")
  2699.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2700.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2701.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "stne")
  2702.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "dirt")
  2703.                end  --5) Special explosive and flammability paramethers--
  2704.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE and math.random(1,50) == 1 then
  2705.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "s2o")
  2706.                 tpt.create(x+math.random(-1,1), y+math.random(-1,1), "cuo")
  2707.                 sim.pressure(x/4,y/4,75)
  2708.                 end
  2709.      end
  2710.     end
  2711.  
  2712.  
  2713. --HEMATITE AN IRON OXIDE--
  2714. elements.property(elements.DEFAULT_PT_BRMT, "Name", "FE2O3")
  2715. elements.property(elements.DEFAULT_PT_BRMT, "Description", "Hematite, an IRON oxide, an adsorbent of WTRV. Absorbs microwaves like PHOT and ELEC.")
  2716. elements.property(elements.DEFAULT_PT_BRMT, "Color", 0x882D17)
  2717. elements.property(elements.DEFAULT_PT_BRMT, "Flammable", 0)
  2718.  
  2719. --SALT RENAME---
  2720. elements.property(elements.DEFAULT_PT_SALT, "Name", "NACL")
  2721.  
  2722.  
  2723.  
  2724. ------------------------------------------------------------------------------------------------SOLIDS----------------------------------------------------------------------------------
  2725. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2726.  
  2727. --ALUMINIUM--  
  2728.     local function alUpdate(i, x, y, s, nt)
  2729.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2730.      if r~= nil then --1) AL reflects ELEC in form of EMBR--
  2731.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_ELEC and math.random(1,2) == 2 then
  2732.                sim.partProperty(i, "type", elem.DEFAULT_PT_EMBR)
  2733.                sim.partProperty(r, "type", elem.KEV_PT_AL)
  2734.                end  --2) AL reflects PHOT in form of EMBR--
  2735.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT and math.random(1,2) == 2 then
  2736.                sim.partProperty(i, "type", elem.DEFAULT_PT_EMBR)
  2737.                sim.partProperty(r, "type", elem.KEV_PT_AL)
  2738.                end --3) AL oxides with WTRV--
  2739.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WTRV and math.random(1,5) == 2 then
  2740.                sim.partProperty(i, "type", elem.KEV_PT_AL2O3)
  2741.                sim.partProperty(r, "type", elem.DEFAULT_PT_WTRV)
  2742.                end --4) AL oxides with O3--
  2743.             if sim.partProperty(r, "type") == elem.KEV_PT_O3 and math.random(1,5) == 2 then
  2744.                sim.partProperty(i, "type", elem.KEV_PT_AL2O3)
  2745.                sim.partProperty(r, "type", elem.KEV_PT_AL2O3)
  2746.                end
  2747.      end
  2748.     end
  2749.  
  2750. --SILVER--  
  2751.     local function agUpdate(i, x, y, s, nt)
  2752.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2753.      if r~= nil then --1) AG reflects ELEC in form of EMBR--
  2754.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_ELEC then
  2755.                sim.partProperty(i, "type", elem.DEFAULT_PT_EMBR)
  2756.                sim.partProperty(r, "type", elem.KEV_PT_AG)
  2757.            tpt.set_property("life", 3000, i)
  2758.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2759.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2760.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "embr")
  2761.                end  --2) AG in presence of PHOT transform in IRON--
  2762.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
  2763.                sim.partProperty(i, "type", elem.DEFAULT_PT_IRON)
  2764.                sim.partProperty(r, "type", elem.DEFAULT_PT_PHOT)
  2765.                end --3) Molten AG forms SIv with molten SI--
  2766.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_LAVA and sim.partProperty(r, "ctype") == elem.DEFAULT_PT_NTCT then
  2767.                sim.partProperty(i, "type", elem.KEV_PT_SIV)
  2768.                sim.partProperty(r, "type", elem.KEV_PT_SIV)
  2769.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2770.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "co2")
  2771.                end --4) AG forms RAZR with pressure--
  2772.             if sim.pressure(x/4, y/4) == 75.00 then
  2773.                sim.partProperty(i, "type", elem.DEFAULT_PT_RAZR)
  2774.                sim.partProperty(r, "type", elem.DEFAULT_PT_RAZR)
  2775.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2776.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2777.                end --5) AG forms RAZR with OXYG--
  2778.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and math.random(1,485) == 1 then
  2779.                sim.partProperty(i, "type", elem.DEFAULT_PT_RAZR)
  2780.                sim.partProperty(r, "type", elem.DEFAULT_PT_RAZR)
  2781.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2782.                tpt.create(x+math.random(-1,1), y+math.random(-1,1), "oxyg")
  2783.                end
  2784.      end
  2785.     end
  2786.  
  2787. --SILICON NITRIDE--  
  2788. --No functions by now, check again in the next update.--
  2789.  
  2790.  
  2791. --TURBINE--
  2792. --In BETA by now, it doesnt have any function. It doesnt do anything.--
  2793.     local function turbineUpdate(i, x, y, s, nt)
  2794.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2795.      if r~= nil then
  2796.             print("No functional by now, please wait :) ")
  2797.        
  2798.      end
  2799.     end
  2800.  
  2801. --GRAPHITE--
  2802.     local function graphiteUpdate(i, x, y, s, nt)
  2803.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2804.      if r~= nil then --1) GPHT oxides in contc with OXYG--
  2805.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and math.random(1,1620) == 1 then
  2806.             sim.partProperty(i, "type", elem.DEFAULT_PT_CO2)
  2807.             sim.partProperty(r, "type", elem.KEV_PT_BCAR)
  2808.             end      --2) GPHT produces HYGN when touches NEUT--
  2809.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_NEUT and math.random(1,2) == 1 then
  2810.             sim.partProperty(i, "type", elem.KEV_PT_GPHT)
  2811.             sim.partProperty(r, "type", elem.DEFAULT_PT_PHOT)
  2812.             end     --2) GPHT absorbs PHOT--
  2813.          if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
  2814.             sim.partKill(r)
  2815.             end
  2816.            
  2817.      end
  2818.     end
  2819.  
  2820. --TITANIUM CARBIDE--
  2821.     local function ticUpdate(i, x, y, s, nt)
  2822.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2823.      if r~= nil then --1) TIC converts OXYG into CO2--
  2824.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG and sim.pressure(x/4, y/4) >= 75.30 then
  2825.                sim.partProperty(i, "type", elem.DEFAULT_PT_TTAN)
  2826.                sim.partProperty(r, "type", elem.DEFAULT_PT_CO2)
  2827.                end  
  2828.      end
  2829.     end
  2830.  
  2831. --PHOTOVOLTAIC SILICON ---
  2832.     local function sivUpdate(i, x, y, s, nt)
  2833.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2834.      if r~= nil then --1) Photovoltaic Properties of SIV            
  2835.              if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
  2836.             tpt.create(x+math.random(-1,1), y+math.random(-1,1), "elec")
  2837.             sim.partProperty(i, "type", elem.KEV_PT_SIV)
  2838.                 sim.partProperty(i, "ctype", elem.DEFAULT_PT_SPRK)
  2839.                 sim.partProperty(i, "tmp", sim.partProperty(i, "tmp")+1)
  2840.                 sim.pressure(x/4,y/4,4)
  2841.                 end
  2842.              if sim.partProperty(r, "type") == elem.KEV_PT_O3 then
  2843.             tpt.create(x+math.random(-1,1), y+math.random(-1,1), "brel")
  2844.                 sim.partProperty(i, "type", elem.KEV_PT_SIO2)
  2845.                 sim.partProperty(r, "type", elem.DEFAULT_PT_NTCT)
  2846.                 end
  2847.              if sim.partProperty(r, "type") == elem.KEV_PT_F18 then
  2848.             tpt.create(x+math.random(-1,1), y+math.random(-1,1), "fire")
  2849.             tpt.create(x+math.random(-1,1), y+math.random(-1,1), "brel")
  2850.                 sim.pressure(x/4,y/4,4)
  2851.                 end
  2852.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_LAVA and sim.partProperty(r, "ctype") == elem.DEFAULT_PT_IRON then
  2853.                sim.partProperty(i, "type", elem.DEFAULT_PT_METL)
  2854.                sim.partProperty(r, "type", elem.DEFAULT_PT_METL)
  2855.                end
  2856.      end
  2857.     end            
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865. --BMTL TO BRAS
  2866. elements.property(elements.DEFAULT_PT_BMTL, "Name", "BRAS")
  2867. elements.property(elements.DEFAULT_PT_BMTL, "Description", "Brass. Breakeable semiconductor.")
  2868. elements.property(elements.DEFAULT_PT_BMTL, "Color", 0xCDAD00)
  2869. elements.property(elements.DEFAULT_PT_BMTL, "Flammable", 0)
  2870. elements.property(elements.DEFAULT_PT_BMTL, "HighPressure", 9.90)
  2871. elements.property(elements.DEFAULT_PT_BMTL, "HighPressureTransition", elem.KEV_PT_CUO)
  2872. elements.property(elements.DEFAULT_PT_BMTL, "MenuSection", SC_ELECTRONICS)
  2873.  
  2874.     local function brassUpdate(i, x, y, s, nt)
  2875.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2876.      if r~= nil then --1) BRASS breaks into CUO under pressure--
  2877.             if sim.pressure(x/4, y/4) >= 9.20 then
  2878.                sim.partProperty(i, "type", elem.KEV_PT_CUO)
  2879.                end
  2880.             if sim.pressure(x/4, y/4) <= 9.20 then
  2881.                sim.partProperty(i, "type", elem.DEFAULT_PT_BMTL)
  2882.                end
  2883.      end
  2884.     end
  2885.  
  2886. --NTCT TO SILICON
  2887. elements.property(elements.DEFAULT_PT_NTCT, "Name", "SI")
  2888. elements.property(elements.DEFAULT_PT_NTCT, "Description", "Silicon. Semiconductor, only conducts when it's over 100 °C.")
  2889. elements.property(elements.DEFAULT_PT_NTCT, "Color", 0x2F4F4F)
  2890. elements.property(elements.DEFAULT_PT_NTCT, "Flammable", 0)
  2891.  
  2892. --PTCT TO GERMANIUM
  2893. elements.property(elements.DEFAULT_PT_PTCT, "Name", "GE")
  2894. elements.property(elements.DEFAULT_PT_PTCT, "Description", "Germanium. Semiconductor, only conducts when it's under 100 °C.")
  2895. elements.property(elements.DEFAULT_PT_PTCT, "Color", 0xEEE9BF)
  2896. elements.property(elements.DEFAULT_PT_PTCT, "Flammable", 0)
  2897.  
  2898. --METL TO ELECTRIC USE STEEL--
  2899. elements.property(elements.DEFAULT_PT_METL, "Name", "SI5FE")
  2900. elements.property(elements.DEFAULT_PT_METL, "Description", "Electric Steel. Conducts SPRK and heat very well.")
  2901. elements.property(elements.DEFAULT_PT_METL, "Color", 0x708090)
  2902. elements.property(elements.DEFAULT_PT_METL, "HighTemperature", 3100)
  2903. elements.property(elements.DEFAULT_PT_METL, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
  2904. elements.property(elements.DEFAULT_PT_METL, "HeatConduct", 0.4)
  2905.  
  2906. --RUBIDIUM WELL NAMED--
  2907. elements.property(elements.DEFAULT_PT_RBDM, "Name", "RB")
  2908. elements.property(elements.DEFAULT_PT_RBDM, "Description", "Rubidium. Explosive when is exposed to humidity. Photosensible when it´s cold, absorbs OXYG.")
  2909. elements.property(elements.DEFAULT_PT_RBDM, "Flammable", 0)
  2910. elements.property(elements.DEFAULT_PT_RBDM, "Explosive", 2400)
  2911.  
  2912.     local function rbextrafeaturesUpdate(i, x, y, s, nt)
  2913.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2914.      if r~= nil then
  2915.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WTRV then
  2916.                sim.partProperty(i, "type", elem.DEFAULT_PT_HYGN)
  2917.                sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2918.                end
  2919.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_WTRV then
  2920.                sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  2921.                sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2922.                end
  2923.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW then
  2924.                sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  2925.                sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2926.                end
  2927.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_DSTW then
  2928.                sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  2929.                sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2930.                end
  2931.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_BUBW then
  2932.                sim.partProperty(i, "type", methane)
  2933.                sim.partProperty(r, "type", elem.DEFAULT_PT_FIRE)
  2934.                end
  2935.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
  2936.                sim.partProperty(i, "type", elem.DEFAULT_PT_ELEC)
  2937.                sim.partProperty(r, "type", elem.DEFAULT_PT_RBDM)
  2938.                end
  2939.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_OXYG then
  2940.                sim.partProperty(i, "type", elem.DEFAULT_PT_ELEC)
  2941.                sim.partProperty(r, "type", elem.DEFAULT_PT_RBDM)
  2942.                end
  2943.             if sim.partProperty(r, "type") == elem.DEFAULT_PT_FIRE then
  2944.                sim.partProperty(i, "type", elem.DEFAULT_PT_FIRE)
  2945.                sim.partProperty(r, "type", elem.DEFAULT_PT_OXYG)
  2946.                tpt.set_pressure(x/4, y/4,5,10,19)
  2947.                end
  2948.      end
  2949.     end
  2950.  
  2951. --TUNGSTEN CARBIDE--
  2952. elem.property(elements.DEFAULT_PT_ETRD, "Name", "W6C")
  2953. elem.property(elements.DEFAULT_PT_ETRD, "Description", "Tungsten Carbide. Used as electrode, hard as DMND.")
  2954.  
  2955. --TUNGSTEN FORMS TUNGSTEN CARBIDE--
  2956.     local function wtow6cpdate(i, x, y, s, nt)
  2957.     r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
  2958.      if r~= nil then --1) TUNG in contact with C2H2 forms W6C--
  2959.             if sim.partProperty(r, "type") == elem.KEV_PT_C2H2 and math.random(1,10) == 2 then
  2960.                sim.partProperty(i, "type", elem.KEV_PT_CO)
  2961.                sim.partProperty(r, "type", elem.DEFAULT_PT_ETRD)
  2962.                end  --2) TUNG in contact with BCAR forms W6C--
  2963.             if sim.partProperty(r, "type") == elem.KEV_PT_BCAR and math.random(1,50) == 2 then
  2964.                sim.partProperty(i, "type", elem.KEV_PT_CO)
  2965.                sim.partProperty(r, "type", elem.DEFAULT_PT_ETRD)
  2966.                end
  2967.      end
  2968.     end
  2969.  
  2970.  
  2971. elem.property(elem.KEV_PT_N2, "Update", nUpdate)
  2972. elem.property(elem.KEV_PT_N2O, "Update", n2oUpdate)
  2973. elem.property(elem.KEV_PT_O3, "Update", o3Update)
  2974. elem.property(elem.KEV_PT_NH3, "Update", nh3Update)
  2975. elem.property(elem.KEV_PT_CH3NO, "Update", ch3noUpdate)
  2976. elem.property(elem.KEV_PT_CH4, "Update", ch4Update)
  2977. elem.property(elem.KEV_PT_CO, "Update", coUpdate)
  2978. elem.property(elem.KEV_PT_N2H4, "Update", n2h4Update)
  2979. elem.property(elem.KEV_PT_R32, "Update", r32Update)
  2980. elem.property(elem.KEV_PT_S2O, "Update", s2oUpdate)
  2981. elem.property(elem.KEV_PT_CL, "Update", clUpdate)
  2982. elem.property(iodinevapor, "Update", iodvUpdate)
  2983. elem.property(elem.KEV_PT_H2O2, "Update", h2o2Update)
  2984. elem.property(elem.DEFAULT_PT_ACID, "Update", hi3Update)
  2985. elem.property(elem.KEV_PT_H2SO4, "Update", h2so4Update)
  2986. elem.property(elem.KEV_PT_HCL, "Update", hclUpdate)
  2987. elem.property(elem.KEV_PT_HNO3, "Update", hno3Update)
  2988. elem.property(elem.KEV_PT_C7H8, "Update", c7h8Update)
  2989. elem.property(elem.KEV_PT_NAOH, "Update", naohUpdate)
  2990. elem.property(iodine, "Update", iodineUpdate)
  2991. elem.property(elem.KEV_PT_MUD, "Update", mudUpdate)
  2992. elem.property(elem.KEV_PT_KNO3, "Update", kno3Update)
  2993. elem.property(elem.KEV_PT_AL2O3, "Update", al2o3Update)
  2994. elem.property(elem.KEV_PT_NCL3, "Update", ncl3Update)
  2995. elem.property(elem.KEV_PT_S, "Update", sUpdate)
  2996. elem.property(elem.KEV_PT_ANFO, "Update", anfoUpdate)
  2997. elem.property(elem.KEV_PT_NI3, "Update", ni3Update)
  2998. elem.property(elem.KEV_PT_BGUN, "Update", bgunUpdate)
  2999. elem.property(elem.KEV_PT_NH4O3, "Update", nh4o3Update)
  3000. elem.property(elem.KEV_PT_C2H2, "Update", c2h2Update)
  3001. elem.property(elem.KEV_PT_DIRT, "Update", dirtUpdate)
  3002. elem.property(elem.DEFAULT_PT_STNE, "Update", stonetorockUpdate)
  3003. elem.property(elem.KEV_PT_ROCK, "Update", rockUpdate)
  3004. elem.property(elem.KEV_PT_CMNT, "Update", cementUpdate)
  3005. elem.property(elem.KEV_PT_BGPH, "Update", bgraphiteUpdate)
  3006. elem.property(elem.KEV_PT_BCAR, "Update", bcarbonoUpdate)
  3007. elem.property(elem.KEV_PT_CAC2, "Update", cac2Update)
  3008. elem.property(elem.DEFAULT_PT_CNCT, "Update", limestoneUpdate)
  3009. elem.property(elem.KEV_PT_SIO2, "Update", sio2Update)
  3010. elem.property(elem.KEV_PT_TIO2, "Update", tio2Update)
  3011. elem.property(elem.KEV_PT_CUO, "Update", cuoUpdate)
  3012. elem.property(elem.KEV_PT_CUSO4, "Update", cuso4Update)
  3013. elem.property(elem.KEV_PT_AL, "Update", alUpdate)
  3014. elem.property(elem.KEV_PT_AG, "Update", agUpdate)
  3015. elem.property(elem.KEV_PT_TURB, "Update", turbineUpdate)
  3016. elem.property(elem.DEFAULT_PT_BMTL, "Update", brassUpdate)
  3017. elem.property(elem.DEFAULT_PT_RBDM, "Update", rbextrafeaturesUpdate)
  3018. elem.property(elem.DEFAULT_PT_TTAN, "Update", titoticUpdate)
  3019. elem.property(elem.KEV_PT_GPHT, "Update", graphiteUpdate)
  3020. elem.property(elem.KEV_PT_TIC, "Update", ticUpdate)
  3021. elem.property(elem.KEV_PT_SIV, "Update", sivUpdate)
  3022. elem.property(elem.DEFAULT_PT_TUNG, "Update", wtow6cUpdate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement