Guest User

fuel mod heavy 1.8

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