Advertisement
Guest User

TPT Remade III

a guest
Nov 15th, 2020
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 135.43 KB | None | 0 0
  1. local function velocity(i,v,n) --*1
  2.  local angle = math.random(1,n)*(2*math.pi/n)
  3.  tpt.set_property("vx", v*math.cos(angle), i)
  4.  tpt.set_property("vy", v*math.sin(angle), i)
  5.  tpt.set_property("tmp", -1, i)
  6.  end --*1
  7.  
  8. local function velocity_2(i,v,n) --*1
  9.  if tpt.get_property("tmp", i) == 0 then --1
  10.   local angle_2 = math.random(1,n)*(2*math.pi/n)
  11.   tpt.set_property("vx", v*math.cos(angle_2), i)
  12.   tpt.set_property("vy", v*math.sin(angle_2), i)
  13.   tpt.set_property("tmp", -1, i)
  14.   end --1
  15.  end --*1
  16.  
  17. local function attract(i,x,y,a) --*1
  18.  sim.gravMap(x/4,y/4,a)
  19. end --*1
  20.  
  21.  local function glitter(i,colr,colg,colb,r,g,b,a) --*1
  22.   return 0,ren.PMODE_SPARK,255,colr,colg,colb,255,r+math.random(-a,a),g+math.random(-a,a),b+math.random(-a,a)
  23.   end --*1
  24.  
  25. local qtfm = elements.allocate("TPT", "RADI")
  26.  elements.element(qtfm, elements.element(elements.DEFAULT_PT_PROT))
  27.  elements.property(qtfm, "Name", "RADI")
  28.  elements.property(qtfm, "Description" , "Background Radiation. Spreads.")
  29.  elements.property(qtfm, "Color", 0x888888)
  30.  elements.property(qtfm, "Diffusion", 0.75)
  31.  elements.property(qtfm, "Update", --*1
  32.  function(i,x,y) --1
  33.   sim.partProperty(i, "life", 10)
  34.   if sim.partProperty(i, "tmp") == 0 then --2
  35.    sim.partProperty(i, "tmp", 50)
  36.    end --2
  37.   if math.random(0,7) > 0 then --3
  38.   sim.partProperty(i, "tmp", sim.partProperty(i, "tmp")-1)
  39.    if sim.partProperty(i, "tmp") < 1 then --4
  40.     sim.partKill(i)
  41.     end --4
  42.    end --3
  43.   if math.random(1,20000) == 1 then --5
  44.    sim.partProperty(i, "life", 500)
  45.    sim.partProperty(i, "ctype", 1073741823)
  46.    sim.partProperty(i, "type", elements.DEFAULT_PT_PHOT)
  47.    end --5
  48.   if math.random(1,200000) == 1 then --6
  49.    sim.partProperty(i, "life", 275)
  50.    sim.partProperty(i, "ctype", 1073741823)
  51.    sim.partProperty(i, "type", elements.DEFAULT_PT_PROT)
  52.    end --6
  53.   if math.random(1,200000) == 1 then --7
  54.    sim.partProperty(i, "life", 50)
  55.    sim.partProperty(i, "ctype", 1073741823)
  56.    sim.partProperty(i, "type", elements.DEFAULT_PT_NEUT)
  57.    end --7
  58.   end --1
  59.   ) --*1
  60.  
  61.  local function funcGraphics(i, colr, colg, colb) --*1
  62.   return 1,ren.PMODE_SPARK,255,colr,colg,colb,64,184,200,223
  63.   end --*1
  64.  elements.property(qtfm, "Graphics", funcGraphics)
  65.  
  66. local function radiate(i,x,y,s,t) --*1
  67.  if math.random(0,(s/5)) == 0 then --31
  68.   sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RADI)
  69.   sim.partProperty(i, "temp", sim.partProperty(i, "temp")+t)
  70.   end --1
  71. end --*1
  72.  
  73. local nept = elements.allocate("TPT" , "NEPT")
  74.  elements.element(nept, elements.element(elements.DEFAULT_PT_PLUT))
  75.  elements.property(nept, "Name" , "NEPT")
  76.  elements.property(nept, "Description" , "Neptunium, radioactive. Quickly heats up when bombarded with neutrons.")
  77.  elements.property(nept, "Color", 0x557020)
  78.  elements.property(nept, "PhotonReflectWavelengths", 0x002FF200)
  79.  elements.property(nept, "MenuSection", 10)
  80.  
  81. local vsns = elements.allocate("TPT" , "VSNS")
  82.  elements.element(vsns, elements.element(elements.DEFAULT_PT_DMND))
  83.  elements.property(vsns, "Name" , "VSNS")
  84.  elements.property(vsns, "Description" , "Velocity sensor, creates power when something's velocity is higher than its temperature.")
  85.  elements.property(vsns, "Color", 0x3D3125)
  86.  elements.property(vsns, "MenuSection", 3)
  87.  elements.property(vsns, "HeatConduct", 0)
  88.  elements.property(elem.TPT_PT_VSNS, "Update",
  89.  function(i,x,y,s,nt) --1
  90.   for r in sim.neighbors(x,y,1,1) do --2
  91.    if math.sqrt(math.pow(sim.partProperty(r, "vx"),2)+math.pow(sim.partProperty(r, "vy"),2)) > sim.partProperty(i, "temp")-273.15 then --3
  92.     sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
  93.     sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
  94.     sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
  95.     sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
  96.     sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
  97.     sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
  98.     sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
  99.     sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
  100.     end --3
  101.    end --2
  102.   end --1
  103. ) --*1
  104.  
  105. local mrcv = elements.allocate("TPT", "MRCV")
  106.  elements.element(mrcv,elem.element(elem.DEFAULT_PT_WTRV))
  107.  elements.property(mrcv, "Name" , "MRCV")
  108.  elements.property(mrcv, "Description" , "Mercury Vapor.")
  109.  elements.property(mrcv, "Color", 0x6D6567)
  110.  elements.property(mrcv, "Temperature", 637.85)
  111.  elements.property(mrcv, "AirDrag", 0.01)
  112.  elements.property(mrcv, "Loss", 0.5)
  113.  elements.property(mrcv, "LowTemperature", 618.32)
  114.  elements.property(mrcv, "LowTemperatureTransition", elements.DEFAULT_PT_MERC)
  115.  
  116.  elements.property(elements.DEFAULT_PT_MERC, "Update", --*1
  117.  function(i,x,y) --1
  118.   if sim.partProperty(i, "temp") > 628.91 then --2
  119.    if math.random(1,450) == 1 then --3
  120.     sim.partChangeType(i, elements.TPT_PT_MRCV)
  121.     end --3
  122.    end --2
  123.   end --1
  124.  ) --*1
  125.  
  126. local anti = elements.allocate("TPT" , "ANTI")
  127.  elements.element(anti, elements.element(elements.DEFAULT_PT_SING))
  128.  elements.property(anti, "Name" , "ANTI")
  129.  elements.property(anti, "Description" , "Anti Singularity, incredibly destructive. Slowly increases in size")
  130.  elements.property(anti, "Color", 0xDBDBDB)
  131.  elements.property(anti, "HotAir", 0.15)
  132.  elements.property(anti, "MenuSection", 16)
  133.  elements.property(elements.TPT_PT_ANTI, "Update", --*1
  134.  function(i,x,y) --1
  135.   attract(i,x,y,-0.75)
  136.   if math.random(1,50) == 1 then --2
  137.    sim.partCreate(-1, x+math.random(-1,1),y+math.random(-1,1),elements.TPT_PT_ANTI)
  138.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  139.    end --2
  140.   end --1
  141.  ) --*1
  142.  
  143.  elements.property(elements.DEFAULT_PT_SING, "Update", --*1
  144.  function(i,x,y) --1
  145.   attract(i,x,y,0.75)
  146.   end --1
  147.  ) --*1
  148.  
  149. local ash = elements.allocate("TPT", "ASH")
  150.  elements.element(ash, elements.element(elements.DEFAULT_PT_DUST))
  151.  elements.property(ash, "Name" , "ASH")
  152.  elements.property(ash, "Description" , "Ash, light powder. Turns into oil under pressure.")
  153.  elements.property(ash, "Color", 0x393224)
  154.  elements.property(ash, "Gravity", 0.056)
  155.  elements.property(ash, "Advection", 0.2)
  156.  elements.property(ash, "Weight", 2)
  157.  elements.property(ash, "AirDrag", 0.05)
  158.  elements.property(ash, "Flammable", 25.56)
  159.  
  160. local lhyg = elements.allocate("TPT", "LHYG")
  161.  elements.element(lhyg, elements.element(elements.DEFAULT_PT_LOXY))
  162.  elements.property(lhyg, "Name" , "LHYG")
  163.  elements.property(lhyg, "Description" , "Liquid Hydrogen, very cold. Incredibly flammable")
  164.  elements.property(lhyg, "Flammable", 5000.65)
  165.  elements.property(lhyg, "Explosive", 1)
  166.  elements.property(lhyg, "Color", 0x3D68CD)
  167.  elements.property(lhyg, "Temperature", 14.15)
  168.  elements.property(lhyg, "MenuSection", 7)
  169.  elements.property(lhyg, "HighTemperature", 18.15)
  170.  elements.property(lhyg, "HighTemperatureTransition", elements.DEFAULT_PT_HYGN)
  171.  
  172.  elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", 15.24)
  173.  elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", elements.TPT_PT_LHYG)
  174.  
  175. local pb = elements.allocate("TPT" , "LEAD")
  176.  elements.element(pb, elements.element(elements.DEFAULT_PT_IRON))
  177.  elements.property(pb, "Name" , "LEAD")
  178.  elements.property(pb, "Description" , "Lead, absorbs neutrons. Conducts electricity.")
  179.  elements.property(pb, "Color", 0x686868)
  180.  elements.property(pb, "Hardness", 0)
  181.  elements.property(pb, "HighTemperature", 601.25)
  182.  elements.property(pb, "Properties", elements.PROP_NEUTABSORB+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_DEADLY)
  183.  
  184. local mnpr = elements.allocate("TPT", "MNPR")
  185.  elements.element(mnpr, elements.element(elements.DEFAULT_PT_BOYL))
  186.  elements.property(mnpr, "Name" , "MONO")
  187.  elements.property(mnpr, "Description" , "Monopropellant. Disperses quickly.")
  188.  elements.property(mnpr, "Color", 0xB0B0B0)
  189.  elements.property(mnpr, "Advection", 0.2)
  190.  elements.property(mnpr, "AirDrag", 0.05)
  191.  elements.property(mnpr, "HotAir", 0.01)
  192.  elements.property(mnpr, "MenuSection", 16)
  193.  elements.property(elements.TPT_PT_MNPR, "Update", --*1
  194. function(i,x,y) --1
  195.  if math.random(1,30) == 1 then --2
  196.   sim.partKill(i)
  197.   end --2
  198.  end --1
  199.  ) --*1
  200.  
  201. local mnpl = elements.allocate("TPT", "MNPL")
  202.  elements.element(mnpl, elements.element(elements.DEFAULT_PT_LOXY))
  203.  elements.property(mnpl, "Name" , "MNPL")
  204.  elements.property(mnpl, "Description" , "Liquid Monopropellant. Releases lots of pressure and cools down when boiled")
  205.  elements.property(mnpl, "Flammable", 0)
  206.  elements.property(mnpl, "Color", 0xA0A0A0)
  207.  elements.property(mnpl, "Temperature", 180.15)
  208.  elements.property(mnpl, "MenuSection", 5)
  209.  elements.property(mnpl, "Diffusion", 0.1)
  210.  elements.property(mnpl, "HighTemperature", 200.15)
  211.  elements.property(mnpl, "HighTemperatureTransition", elements.TPT_PT_MNPR)
  212.  elements.property(elements.TPT_PT_MNPL, "Update", --*1
  213.  function(i,x,y,s,nt) --1
  214.   for r in sim.neighbors(x,y,1,1) do --2
  215.    if sim.partProperty(r, "type") == elements.TPT_PT_MNPR then --3
  216.     if math.random(1,45) == 1 then --4
  217.      sim.partProperty(i, "temp", sim.partProperty(i, "temp")-75)
  218.      sim.pressure(x/4,y/4,10)
  219.      end --4
  220.     end --3
  221.    end --2
  222.   end --1
  223.  ) --*1
  224.  
  225.  elements.property(mnpr, "LowTemperature", 190.15)
  226.  elements.property(mnpr, "LowTemperatureTransition", elements.TPT_PT_MNPL)
  227.  
  228. local tchn = elements.allocate("TPT" , "TCHN")
  229.  elements.element(tchn, elements.element(elements.DEFAULT_PT_URAN))
  230.  elements.property(tchn, "Name" , "TCHN")
  231.  elements.property(tchn, "Description" , "Technetium, decays over time and leaves heat.")
  232.  elements.property(tchn, "Color", 0x205570)
  233.  elements.property(tchn, "MenuSection", 11)
  234. elements.property(elements.TPT_PT_TCHN, "Update", --*1
  235.  function(i,x,y) --1
  236.   if math.random(1,11520) == 1 then --2
  237.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  238.    sim.pressure(x/4,y/4,8)
  239.    sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
  240.    radiate(i,x,y,125,100)
  241.    end --2
  242.   end --1
  243.  ) --*1
  244.  elements.property(tchn, "HighTemperatureTransition", elements.TPT_PT_TCHN)
  245.  
  246. local psac = elements.allocate("TPT", "PSAC")
  247.  elements.element(psac, elements.element(elements.DEFAULT_PT_SOAP))
  248.  elements.property(psac, "Name" , "PSAC")
  249.  elements.property(psac, "Description" , "Positronic acid, reacts violently with matter, weak acid.")
  250.  elements.property(psac, "Color", 0xFF20BB)
  251.  elements.property(psac, "Advection", 0.01)
  252.  elements.property(psac, "Hardness", 0)
  253.  elements.property(psac, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  254.  elements.property(elem.TPT_PT_PSAC, "Update", --*1
  255.  function(i,x,y,s,nt) --1
  256.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  257.    if math.random(1,100) == 10 then --3
  258.     for r in sim.neighbors(x,y,1,1) do --4
  259.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  260.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  261.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  262.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  263.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  264.           if math.random(1,3) == 1 then --10
  265.            sim.partKill(r)
  266.            sim.partProperty(i, "temp", sim.partProperty(i, "temp")+3200)
  267.            if math.random(1,13) == 1 then --11
  268.             sim.pressure(x/4,y/4,16)
  269.             sim.partKill(i)
  270.             return
  271.             end --11
  272.            end --10
  273.           end --9
  274.          end --8
  275.         end --7
  276.        end --6
  277.       end --5
  278.      end --4
  279.     end --3
  280.    end --2
  281.   radiate(i,x,y,250,200)
  282.   end --1
  283.   ) --*1
  284.  
  285. local si = elements.allocate("TPT" , "SILC")
  286.  elements.element(si, elements.element(elements.DEFAULT_PT_IRON))
  287.  elements.property(si, "Name" , "SILC")
  288.  elements.property(si, "Description" , "Silicon, conducts electricity. Lets air pass through")
  289.  elements.property(si, "Color", 0x686E76)
  290.  elements.property(si, "AirLoss", 1)
  291.  elements.property(si, "HighTemperature", 1687.01)
  292.  elements.property(si, "Properties", elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
  293.  
  294. local torn = elements.allocate("TPT" , "TORN")
  295.  elements.element(torn, elements.element(elements.DEFAULT_PT_BOYL))
  296.  elements.property(torn, "Name" , "TRNA")
  297.  elements.property(torn, "Description" , "Tornado, self explanatory.")
  298.  elements.property(torn, "Color", 0x8A9098)
  299.  elements.property(torn, "Collision", -1)
  300.  elements.property(torn, "Loss", 0.5)
  301.  elements.property(torn, "AirDrag", 0.05)
  302.  elements.property(torn, "HotAir", -0.001)
  303.  elements.property(torn, "MenuSection", 16)
  304.  
  305. local lhlm = elements.allocate("TPT", "LHE")
  306.  elements.element(lhlm, elements.element(elements.DEFAULT_PT_SOAP))
  307.  elements.property(lhlm, "Name" , "LHE")
  308.  elements.property(lhlm, "Description" , "Liquid helium, incredibly cold.")
  309.  elements.property(lhlm, "Temperature", 4.01)
  310.  elements.property(lhlm, "Color", 0x5000FF)
  311.  elements.property(lhlm, "MenuSection", 11)
  312.  elements.property(lhlm, "Weight", 30)
  313.  elements.property(elem.TPT_PT_LHE, "Update", --*1
  314. function(i,x,y,s) --1
  315.   if math.random(1,200) == 1 then --2
  316.    if sim.partProperty(i, "temp") > 4.21 then --3
  317.     if math.random(1,150) > 1 then --4
  318.      sim.partKill(i)
  319.      else
  320.      sim.partProperty(i, "type", elements.TPT_PT_HE)
  321.      end --4
  322.     end --3
  323.    end --2
  324.   end --1
  325.   ) --*1
  326.  
  327. local he = elements.allocate("TPT", "HE")
  328.  elements.element(he, elements.element(elements.DEFAULT_PT_HYGN))
  329.  elements.property(he, "Name" , "HE")
  330.  elements.property(he, "Description", "Helium, floats.")
  331.  elements.property(he, "Color", 0x6111FF)
  332.  elements.property(he, "Diffusion", 1.5)
  333.  elements.property(he, "Gravity", -0.3)
  334.  elements.property(he, "Flammable", 0)
  335.  elements.property(he, "LowTemperature", -1)
  336.  elements.property(he, "LowTemperatureTransition", -1)
  337.  elements.property(he, "MenuSection", 16)
  338.  
  339. local n237 = elements.allocate("TPT" , "N237")
  340.  elements.element(n237, elements.element(elements.DEFAULT_PT_POLO))
  341.  elements.property(n237, "Name" , "N237")
  342.  elements.property(n237, "Description" , "Neptunium 237, decays very quickly. Radioactive waste.")
  343.  elements.property(n237, "Color", 0x668131)
  344.  elements.property(n237, "HighTemperature", 1644)
  345.  elements.property(n237, "PhotonReflectWavelengths", 0x002FF200)
  346.  elements.property(n237, "MenuSection", 16)
  347.  function nept237(i,x,y,s,n)
  348.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  349.    if math.random(1,2) == 1 then --2
  350.     tpt.parts[i].type = elements.DEFAULT_PT_PLUT
  351.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  352.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  353.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  354.     else if math.random(1,6) == 1 then --3
  355.      tpt.parts[i].type = elements.DEFAULT_PT_HE
  356.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  357.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  358.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  359.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  360.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  361.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  362.      end --3
  363.     end --2
  364.    end --1
  365.   if sim.pressure(x/4,y/4) > 1 then --3
  366.    if math.random(1,125) == 10 then --4
  367.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  368.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  369.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  370.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  371.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  372.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  373.     tpt.set_property("temp", math.huge, x ,y)
  374.     end --4
  375.    end --3
  376.   if math.random(1,100) == 10 then --5
  377.    sim.pressure(x/4,y/4,0.2)
  378.    end --5
  379.   radiate(i,x,y,125,30)
  380.   end --*1
  381.  tpt.element_func(nept237,elements.TPT_PT_N237)
  382.  
  383.  function neptunium(i,x,y,s,n)
  384.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  385.    if math.random(1,2) == 1 then --2
  386.     tpt.parts[i].type = elements.DEFAULT_PT_URAN
  387.     else if math.random(1,6) == 1 then --3
  388.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), elements.TPT_PT_N237)
  389.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), elements.TPT_PT_N237)
  390.      tpt.parts[i].type = elements.DEFAULT_PT_NBLE
  391.      end --3
  392.     end --2
  393.    end --1
  394.   if sim.pressure(x/4,y/4) > 1 then --3
  395.    if math.random(1,250) == 10 then --4
  396.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  397.     tpt.set_property("temp", math.huge, x ,y)
  398.     end --4
  399.    end --3
  400.   if math.random(1,10000) == 10 then --5
  401.    sim.pressure(x/4,y/4,0.1)
  402.    end --5
  403.   radiate(i,x,y,500,15)
  404.   end --*1
  405.  tpt.element_func(neptunium,nept)
  406.   function neutron(i,x,y,s,n) --*2
  407.    if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == nept then --1
  408.     if math.random(1,25) == 10 then --2
  409.      tpt.create(x, y, 'neut')
  410.      tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  411.      sim.pressure(x/4,y/4,8)
  412.      end --2
  413.     end --1
  414.    end --*2
  415.  tpt.element_func(neutron,tpt.el.neut.id)
  416.  
  417. local he3 = elements.allocate("TPT", "HE3")
  418.  elements.element(he3, elements.element(elements.DEFAULT_PT_HYGN))
  419.  elements.property(he3, "Name" , "HE3")
  420.  elements.property(he3, "Description", "Helium 3, fuses with tritium.")
  421.  elements.property(he3, "Color", 0xD6EE00)
  422.  elements.property(he3, "Diffusion", 1.7)
  423.  elements.property(he3, "Gravity", -1.0)
  424.  elements.property(he3, "Flammable", 0)
  425.  elements.property(he3, "LowTemperature", -1)
  426.  elements.property(he3, "LowTemperatureTransition", -1)
  427.  elements.property(he3, "MenuSection", 16)
  428.  
  429. local shake = elements.allocate("TPT", "SHAKE")
  430.  elements.element(shake, elements.element(elements.DEFAULT_PT_DMND))
  431.  elements.property(shake, "Name" , "SHAK")
  432.  elements.property(shake, "Description", "Shakes particles.")
  433.  elements.property(shake, "Color", 0xFFCCCC)
  434.  elements.property(shake, "Weight", 0)
  435.  elements.property(shake, "MenuSection", 13)
  436.  elements.property(elem.TPT_PT_SHAKE, "Update", --*1
  437. function(i,x,y,s) --1
  438.   for r in sim.neighbors(x,y,1,1) do --2
  439.    velocity(r,6,360)
  440.    end --2
  441.   sim.partKill(i)
  442.   end --1
  443.  ) --*1
  444.  
  445. local normal = elements.allocate("TPT", "NORMAL")
  446.  elements.element(normal, elements.element(elements.DEFAULT_PT_DMND))
  447.  elements.property(normal, "Name" , "NORM")
  448.  elements.property(normal, "Description", "Normalizes temperature and pressure in the selected area.")
  449.  elements.property(normal, "Color", 0xCCFFCC)
  450.  elements.property(normal, "Weight", 0)
  451.  elements.property(normal, "MenuSection", 13)
  452.  elements.property(elem.TPT_PT_NORMAL, "Update", --*1
  453. function(i,x,y,s) --1
  454.   sim.pressure(x/4,y/4,0)
  455.   for r in sim.neighbors(x,y,1,1) do --2
  456.    if sim.partProperty(r, "temp") > 295.15 then --3
  457.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")-5)
  458.     end --3
  459.    if sim.partProperty(r, "temp") < 295.15 then --4
  460.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")+5)
  461.     end --4
  462.    end --2
  463.   sim.partKill(i)
  464.   end --1
  465.  ) --*1
  466.  
  467. local os = elements.allocate("TPT" , "OSMM")
  468.  elements.element(os, elements.element(elements.DEFAULT_PT_BRMT))
  469.  elements.property(os, "Name" , "OSMM")
  470.  elements.property(os, "Description" , "Osmium, heavy metal. Mostly the norwegian kind")
  471.  elements.property(os, "Color", 0x4D5763)
  472.  elements.property(os, "Gravity", 0.5)
  473.  elements.property(os, "AirDrag", 0.08)
  474.  elements.property(os, "Weight", 97)
  475.  elements.property(os, "Meltable", 1)
  476.  elements.property(os, "HighTemperature", 3306)
  477.  elements.property(os, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
  478.  elements.property(elements.TPT_PT_OSMM, "Update", --*1
  479.  function(i,x,y) --1
  480.   attract(i,x,y,0.0025)
  481.   end --1
  482.  ) --*1
  483.  
  484. local anco = elements.allocate("TPT", "ACOL")
  485.  elements.element(anco, elements.element(elements.DEFAULT_PT_COAL))
  486.  elements.property(anco, "Name" , "ACOL")
  487.  elements.property(anco, "Description" , "Anti-Coal, burns slowly and very... surprisingly cold.")
  488.  elements.property(anco, "MenuSection", 16)
  489.  elements.property(anco, "Color", 0xDDDDDD)
  490.  elements.property(elem.TPT_PT_ACOL, "Update", --*1
  491.  function(i,x,y,s,nt) --1
  492.   if math.random(1,2) == 2 then --2
  493.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  494.     for r in sim.neighbors(x,y,1,1) do --4
  495.      if sim.partProperty(i, "tmp") == 0 then --5
  496.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
  497.        sim.partProperty(i, "tmp", -1)
  498.        end --6
  499.       end --5
  500.      if sim.partProperty(i, "tmp") == -1 then --7
  501.       if math.random(1,9) == 1 then --8
  502.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  503.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  504.        if math.random(1,900) == 1 then --9
  505.         sim.partKill(i)
  506.         return
  507.         end --9
  508.        end --8
  509.       end --7
  510.      end --4
  511.     end --3
  512.    end --2
  513.   end --1
  514.   ) --*1
  515.  
  516.  elements.property(elements.DEFAULT_PT_PLSM, "HeatConduct", 255)
  517.  elements.property(elements.DEFAULT_PT_GLOW, "HeatConduct", 255)
  518.  
  519.  elements.property(elements.DEFAULT_PT_IRON, "Update", --*1
  520.  function(i,x,y,s,nt) --1
  521.    if s ~=8 and nt ~=0 and nt - s > 0 then --2
  522.     for r in sim.neighbors(x,y,1,1) do --3
  523.      if sim.pressure(x/4,y/4) > 2.51 then --4
  524.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --5
  525.        sim.partProperty(i, "tmp", -1)
  526.        end --5
  527.       if sim.partProperty(i, "tmp") == -1 then --6
  528.        if math.random(1,9) == 1 then --7
  529.         sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
  530.          if math.random(1,25) == 1 then --8
  531.           sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  532.           sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  533.           sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  534.           sim.partProperty(i, "tmp", 0)
  535.           end --8
  536.          end --7
  537.         end --6
  538.        end --5
  539.       end --4
  540.      end --3
  541.     end --2
  542.  ) --*1
  543.  
  544. local bhut = elements.allocate("TPT" , "BHUT")
  545.  elements.element(bhut, elements.element(elements.DEFAULT_PT_BOYL))
  546.  elements.property(bhut, "Name" , "BHUT")
  547.  elements.property(bhut, "HeatConduct", 255)
  548.  elements.property(bhut, "HotAir", 0.001)
  549.  elements.property(bhut, "Color", 0x706050)
  550.  elements.property(bhut, "AirDrag", 0.001)
  551.  elements.property(bhut, "AirLoss", 1)
  552.  elements.property(bhut, "Diffusion", 1.25)
  553.  elements.property(bhut, "MenuSection", 5)
  554.  elements.property(bhut, "Description" , "Bhutane, explosive gas")
  555.  elements.property(elem.TPT_PT_BHUT, "Update", --*1
  556.  function(i,x,y,s,nt) --1
  557.   if math.random(1,2) == 2 then --2
  558.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  559.     for r in sim.neighbors(x,y,1,1) do --4
  560.      if sim.partProperty(i, "tmp") == 0 then --5
  561.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
  562.        sim.partProperty(i, "tmp", -1)
  563.        end --6
  564.       end --5
  565.      if sim.partProperty(i, "tmp") == -1 then --7
  566.       if math.random(1,3) > 1 then --8
  567.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
  568.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  569.        sim.pressure(x/4,y/4,5)
  570.        if math.random(1,6) == 1 then --9
  571.         sim.partKill(i)
  572.         return
  573.         end --9
  574.        end --8
  575.       end --7
  576.      end --4
  577.     end --3
  578.    end --2
  579.   end --1
  580.   ) --*1
  581.  
  582.  elements.property(elements.TPT_PT_ASH, "Update", --*1
  583. function(i,x,y,s) --1
  584.   if sim.pressure(x/4,y/4) > 5.9 then --2
  585.    if math.random(1,950) == 1 then --3
  586.     sim.partProperty(i, "type", elements.DEFAULT_PT_OIL)
  587.     else if math.random (1,3000) == 1 then --4
  588.      sim.partProperty(i, "type", elements.TPT_PT_BHUT)
  589.      else if math.random (1,3000) == 1 then --4
  590.       sim.partProperty(i, "type", elements.DEFAULT_PT_SAWD)
  591.       end --5
  592.      end --4
  593.     end --3
  594.    end --2
  595.   end --1
  596.   ) --*1
  597.  
  598. local gr = elements.allocate("TPT" , "GRPH")
  599.  elements.element(gr, elements.element(elements.DEFAULT_PT_COAL))
  600.  elements.property(gr, "Name" , "GRPH")
  601.  elements.property(gr, "Description" , "Graphite, melts at an incredibly high temperature.")
  602.  elements.property(gr, "Color", 0x111113)
  603.  elements.property(gr, "HeatConduct", 7)
  604.  elements.property(gr, "HighTemperature", 4003.15)
  605.  elements.property(gr, "Meltable", 1)
  606.  elements.property(gr, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
  607.  elements.property(gr, "Properties", elements.PROP_CONDUCTS+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
  608.  elements.property(elements.TPT_PT_GRPH, "Update", --*1
  609.  function(i,x,y,s,nt) --1
  610.    if sim.partProperty(i, "life") > 0 then --2
  611.     if math.random(1,65) == 1 then --3
  612.      sim.partProperty(i, "life", 0)
  613.      end --3
  614.     end --2
  615.    if sim.pressure(x/4,y/4) > 11.8 then --4
  616.     if math.random(1,950) == 1 then --5
  617.      sim.partProperty(i, "type", elements.DEFAULT_PT_DMND)
  618.      end --5
  619.     end --4
  620.    end --1
  621.   ) --*1
  622.  
  623. local thor = elements.allocate("TPT" , "THOR")
  624.  elements.element(thor, elements.element(elements.DEFAULT_PT_PLUT))
  625.  elements.property(thor, "Name" , "THOR")
  626.  elements.property(thor, "Description" , "Thorium, not radioactive on its own, needs help from another radioactive material to function.")
  627.  elements.property(thor, "Color", 0x404043)
  628.  elements.property(thor, "PhotonReflectWavelengths", 0x8FFFFFFF)
  629.  elements.property(thor, "MenuSection", 10)
  630.   function neutron2(i,x,y,s,n) --*2
  631.    if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == thor then --1
  632.     if math.random(1,70) == 1 then --2
  633.      tpt.set_property("temp", tpt.get_property("temp", x, y)+4500, x, y)
  634.      radiate(i,x,y,250,100)
  635.      end --2
  636.     end --1
  637.    end --*2
  638.  tpt.element_func(neutron2,tpt.el.neut.id)
  639.  
  640. local para = elements.allocate("TPT" , "PARA")
  641.  elements.element(para, elements.element(elements.DEFAULT_PT_WAX))
  642.  elements.property(para, "Name" , "FZOL")
  643.  elements.property(para, "HeatConduct", 5)
  644.  elements.property(para, "Color", 0x474530)
  645.  elements.property(para, "Flammable", 1)
  646.  elements.property(para, "Description" , "Frozen oil, flammable")
  647.  elements.property(para, "HighTemperature", 277.14)
  648.  elements.property(para, "Temperature", 274.14)
  649.  elements.property(para, "HighTemperatureTransition", elements.DEFAULT_PT_OIL)
  650.  
  651.  elements.property(elements.DEFAULT_PT_OIL, "LowTemperature", 278.14)
  652.  elements.property(elements.DEFAULT_PT_OIL, "LowTemperatureTransition", elements.TPT_PT_PARA)
  653.  
  654. local plwd = elements.allocate("TPT" , "PLWD")
  655.  elements.element(plwd, elements.element(elements.DEFAULT_PT_WOOD))
  656.  elements.property(plwd, "Name" , "PLWD")
  657.  elements.property(plwd, "HeatConduct", 2)
  658.  elements.property(plwd, "Color", 0x808445)
  659.  elements.property(plwd, "Flammable", 1)
  660.  elements.property(plwd, "Description" , "Plywood. Durable material.")
  661.  elements.property(plwd, "AirLoss", 0.2)
  662.  elements.property(plwd, "Hardness", 1)
  663.  
  664. local lbl = elements.allocate("TPT" , "LBYL")
  665.  elements.element(lbl, elements.element(elements.DEFAULT_PT_LOXY))
  666.  elements.property(lbl, "Name" , "LBYL")
  667.  elements.property(lbl, "HeatConduct", 25)
  668.  elements.property(lbl, "Color", 0x001F00)
  669.  elements.property(lbl, "Flammable", 5)
  670.  elements.property(lbl, "HotAir", -0.0001)
  671.  elements.property(lbl, "Description" , "Liquid Boyle gas. Explosive.")
  672.  elements.property(lbl, "HighTemperature", 220.14)
  673.  elements.property(lbl, "Temperature", 213.14)
  674.  elements.property(lbl, "HighTemperatureTransition", elements.DEFAULT_PT_BOYL)
  675.  elements.property(lbl, "MenuSection", 16)
  676.  
  677.  elements.property(elements.DEFAULT_PT_BOYL, "LowTemperature", 219.14)
  678.  elements.property(elements.DEFAULT_PT_BOYL, "HighTemperatureTransition", elements.TPT_PT_LBYL)
  679.  
  680. local mgns = elements.allocate("TPT", "CAVE")
  681.  elements.element(mgns, elements.element(elements.DEFAULT_PT_BRMT))
  682.  elements.property(mgns, "Name" , "CAVE")
  683.  elements.property(mgns, "Description" , "Burn life's house down! With the lemons!")
  684.  elements.property(mgns, "Color", 0xA5A515)
  685.  elements.property(mgns, "Weight", 49)
  686.  elements.property(mgns, "Gravity", 0.3)
  687.  elements.property(mgns, "MenuSection", 16)
  688.  elements.property(elem.TPT_PT_CAVE, "Update", --*1
  689.  function(i,x,y,s) --1
  690.   if s > 6 then --2
  691.    if math.random(1,20) == 20 then --3
  692.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  693.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  694.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  695.     sim.partChangeType(i, elements.DEFAULT_PT_FIRE)
  696.     sim.pressure(x/4,y/4,16)
  697.     if math.random(1,5) == 5 then --4
  698.      sim.partKill(i)
  699.      end --4
  700.     end --3
  701.    end --2
  702.   end --1
  703.   ) --*1
  704.  
  705. local tmpsns = elements.allocate("TPT" , "TMPS")
  706. elements.element(tmpsns, elements.element(elements.DEFAULT_PT_DMND))
  707. elements.property(tmpsns, "Name" , "TMPS")
  708. elements.property(tmpsns, "Description" , "Temporary value sensor, creates power when something's tmp or tmp2 is higher than its temperature.")
  709. elements.property(tmpsns, "Color", 0x22713D)
  710. elements.property(tmpsns, "MenuSection", 3)
  711. elements.property(tmpsns, "HeatConduct", 0)
  712. elements.property(elem.TPT_PT_TMPS, "Update",
  713.  function(i,x,y,s,nt) --1
  714.   for r in sim.neighbors(x,y,1,1) do --2
  715.    if sim.partProperty(r, "tmp") > sim.partProperty(i, "temp")-273.15 then --3
  716.     sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
  717.     sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
  718.     sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
  719.     sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
  720.     sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
  721.     sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
  722.     sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
  723.     sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
  724.     end --3
  725.    end --2
  726.   end --1
  727. ) --*1
  728.  
  729. local erode = elements.allocate("TPT", "ERODE")
  730.  elements.element(erode, elements.element(elements.DEFAULT_PT_DMND))
  731.  elements.property(erode, "Name" , "EROD")
  732.  elements.property(erode, "Description", "Erodes.")
  733.  elements.property(erode, "Color", 0xCCCCCC)
  734.  elements.property(erode, "Weight", 0)
  735.  elements.property(erode, "MenuSection", 13)
  736.  elements.property(elem.TPT_PT_ERODE, "Update", --*1
  737.  function(i,x,y,s,nt) --1
  738.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  739.    if math.random(1,25) == 10 then --3
  740.     for r in sim.neighbors(x,y,1,1) do --4
  741.      if math.random(1,6) == 3 then --5
  742.       sim.partKill(r)
  743.       end --5
  744.      end --4
  745.     end --3
  746.    end --2
  747.   sim.partKill(i)
  748.   end --1
  749.   ) --*1
  750.  
  751. local storm = elements.allocate("TPT", "STORM")
  752.  elements.element(storm, elements.element(elements.DEFAULT_PT_DMND))
  753.  elements.property(storm, "Name" , "STRM")
  754.  elements.property(storm, "Description", "Storms.")
  755.  elements.property(storm, "Color", 0x889F9F)
  756.  elements.property(storm, "Weight", 0)
  757.  elements.property(storm, "MenuSection", 11)
  758.  elements.property(elem.TPT_PT_STORM, "Update", --*1
  759.  function(i,x,y,s) --1
  760.   sim.pressure(x/4,y/4,math.random(-112,112))
  761.   if math.random(1,1000) == 1 then --2
  762.    sim.partProperty(i, "type", elements.DEFAULT_PT_WATR)
  763.    else if math.random(1,100) == 1 then --3
  764.     sim.partProperty(i, "type", elements.DEFAULT_PT_FOG)
  765.     else if math.random(1,5000) == 1 then --5
  766.      sim.partProperty(i, "tmp2", 4)
  767.      sim.partProperty(i, "tmp", math.random(0,359))
  768.      sim.partProperty(i, "life", math.random(15,25))
  769.      sim.partProperty(i, "type", elements.DEFAULT_PT_LIGH)
  770.      else if math.random(1,500) == 1 then --4
  771.       sim.partProperty(i, "type", elements.TPT_PT_TORN)
  772.       else
  773.       sim.partKill(i)
  774.       end --5
  775.      end --4
  776.     end --3
  777.    end --2
  778.   end --1
  779.  ) --*1
  780.  
  781.  elements.property(elem.TPT_PT_TORN, "Update", --*1
  782.  function(i,x,y,s) --1
  783.   if math.random(0,10000) == 0 then --2
  784.    sim.partProperty(i, "type", elements.TPT_PT_STORM)
  785.    end --2
  786.   end --1
  787.   ) --*1
  788.  
  789. local aliq = elements.allocate("TPT", "ANLIQ")
  790.  elements.element(aliq, elements.element(elements.DEFAULT_PT_GLOW))
  791.  elements.property(aliq, "Name" , "ALIQ")
  792.  elements.property(aliq, "Description", "Anti-liquid. Flows upwards.")
  793.  elements.property(aliq, "Color", 0xEFEFFF)
  794.  elements.property(aliq, "Gravity", -0.1)
  795.  elements.property(aliq, "Advection", -0.6)
  796.  elements.property(aliq, "AirDrag", -0.01)
  797.  elements.property(aliq, "HeatConduct", 2)
  798.  elements.property(aliq, "MenuSection", 16)
  799.  elements.property(elem.TPT_PT_ANLIQ, "Update", --*1
  800.  function(i,x,y,s,nt) --1
  801.   if math.random(1,2) == 2 then --2
  802.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  803.     for r in sim.neighbors(x,y,1,1) do --4
  804.      if sim.partProperty(i, "tmp") == 0 then --5
  805.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
  806.        sim.partProperty(i, "tmp", -1)
  807.        end --6
  808.       end --5
  809.      if sim.partProperty(i, "tmp") == -1 then --7
  810.       if math.random(1,2) == 1 then --8
  811.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  812.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  813.        sim.pressure(x/4,y/4,5)
  814.        if math.random(1,50) == 1 then --9
  815.         sim.partKill(i)
  816.         return
  817.         end --9
  818.        end --8
  819.       end --7
  820.      end --4
  821.     end --3
  822.    end --2
  823.   end --1
  824.   ) --*1
  825.  
  826. local neutr = elements.allocate("TPT" , "NETR")
  827.  elements.element(neutr, elements.element(elements.DEFAULT_PT_DMND))
  828.  elements.property(neutr, "Name" , "NETR")
  829.  elements.property(neutr, "Description" , "Neutronium. Dense, Radioactive solid. Slowly implodes and decays after time. Rarely grows")
  830.  elements.property(neutr, "Color", 0x2515FF)
  831.  elements.property(neutr, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
  832.  elements.property(neutr, "PhotonReflectWavelengths", 0x00000001)
  833.  elements.property(neutr, "MenuSection", 10)
  834. elements.property(elements.TPT_PT_NETR, "Update", --*1
  835.  function(i,x,y) --1
  836.   attract(i,x,y,0.1)
  837.    if math.random(1,(sim.pressure(x/4,y/4)+256)/4) == 1 then --2
  838.     if math.random(1,50) == 1 then --3
  839.      sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_NETR)
  840.      if math.random(1,5000) == 1 then --4
  841.       sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_NETR)
  842.       end --4
  843.      end --3
  844.     end --2
  845.   if math.random(1,(sim.pressure(x/4,y/4)+256)*20) == 1 then --5
  846.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  847.    sim.pressure(x/4,y/4,32)
  848.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_NEUT)
  849.    sim.pressure(x/4,y/4,-32)
  850.    sim.partProperty(i, "life", 90)
  851.    repeat --6
  852.     attract(i,x,y,-10)
  853.     if math.random(1,2) == 1 then --7
  854.      sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  855.      end --7
  856.     until sim.partProperty(i, "life") < 0 --6
  857.    sim.partKill(i)
  858.    end --5
  859.   end --1
  860.  ) --*1
  861.  
  862.  elements.property(elements.DEFAULT_PT_NEUT, "HighPressure", 1024)
  863.  elements.property(elements.DEFAULT_PT_NEUT, "HighPressureTransition", elements.TPT_PT_NETR)
  864.  
  865. local brcryst = elements.allocate("TPT" , "BCRY")
  866.  elements.element(brcryst, elements.element(elements.DEFAULT_PT_PQRT))
  867.  elements.property(brcryst, "Name" , "BCRY")
  868.  elements.property(brcryst, "Description" , "Broken Crystal. Light powder, may shred lungs of organisms.")
  869.  elements.property(brcryst, "Properties", elements.TYPE_PART+elements.PROP_DEADLY)
  870.  elements.property(brcryst, "Color", 0xE9E9EF)
  871.  elements.property(brcryst, "PhotonReflectWavelengths", 0xEFEFEFF6)
  872.  elements.property(brcryst, "MenuSection", 8)
  873.  elements.property(brcryst, "Gravity", 0.056)
  874.  elements.property(brcryst, "Advection", 0.2)
  875.  elements.property(brcryst, "Weight", 2)
  876.  elements.property(brcryst, "AirDrag", 0.05)
  877.  elements.property(brcryst, "Diffusion", 0.1)
  878.  
  879. local cryst = elements.allocate("TPT" , "CRYT")
  880.  elements.element(cryst, elements.element(elements.DEFAULT_PT_QRTZ))
  881.  elements.property(cryst, "Name" , "CRYS")
  882.  elements.property(cryst, "Description" , "Crystal. Durable, grows")
  883.  elements.property(cryst, "Color", 0xEEEEF3)
  884.  elements.property(cryst, "PhotonReflectWavelengths", 0xF8F8F8FF)
  885.  elements.property(cryst, "MenuSection", 9)
  886.  elements.property(cryst, "HighPressure", 20.14)
  887.  elements.property(cryst, "HighPressureTransition", elements.TPT_PT_BCRY)
  888. elements.property(elements.TPT_PT_CRYT, "Update", --*1
  889.  function(i,x,y) --1
  890.   if math.random(1,100) == 1 then --2
  891.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_CRYT)
  892.    if math.random(1,20) == 1 then --3
  893.     sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_CRYT)
  894.     end --3
  895.    end --2
  896.   end --1
  897. ) --*1
  898.  
  899.  
  900.  elements.property(brcryst, "HighTemperatureTransition", elements.TPT_PT_CRYT)
  901.  
  902. local gasl = elements.allocate("TPT" , "GASL")
  903.  elements.element(gasl, elements.element(elements.DEFAULT_PT_GLOW))
  904.  elements.property(gasl, "Name" , "GASL")
  905.  elements.property(gasl, "HeatConduct", 255)
  906.  elements.property(gasl, "Color", 0xF0C020)
  907.  elements.property(gasl, "Flammable", 0)
  908.  elements.property(gasl, "MenuSection", 5)
  909.  elements.property(gasl, "Description" , "Gasoline, highly flammable.")
  910.  elements.property(elem.TPT_PT_GASL, "Update", --*1
  911.  function(i,x,y,s,nt) --1
  912.   if math.random(1,2) == 2 then --2
  913.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  914.     for r in sim.neighbors(x,y,1,1) do --4
  915.      if sim.partProperty(i, "tmp") == 0 then --5
  916.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
  917.        sim.partProperty(i, "tmp", -1)
  918.        end --6
  919.       end --5
  920.      if sim.partProperty(i, "tmp") == -1 then --7
  921.       if math.random(1,3) > 1 then --8
  922.        sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  923.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+100)
  924.        sim.pressure(x/4,y/4,2)
  925.        if math.random(1,60) == 1 then --9
  926.         sim.partKill(i)
  927.         return
  928.         end --9
  929.        end --8
  930.       end --7
  931.      end --4
  932.     end --3
  933.    end --2
  934.   end --1
  935.   ) --*1
  936.  
  937. local dmdd = elements.allocate("TPT" , "DMDD")
  938.  elements.element(dmdd, elements.element(elements.DEFAULT_PT_DMND))
  939.  elements.property(dmdd, "Name" , "DMDD")
  940.  elements.property(dmdd, "Description" , "Diamond dust. Yeah.")
  941.  elements.property(dmdd, "Color", 0xC6F6F6)
  942.  elements.property(dmdd, "MenuSection", 8)
  943.  elements.property(dmdd, "Properties", elements.TYPE_PART)
  944.  elements.property(dmdd, "Gravity", 0.112)
  945.  elements.property(dmdd, "Advection", 1)
  946.  elements.property(dmdd, "Weight", 100)
  947.  elements.property(dmdd, "AirDrag", 0.1)
  948.  elements.property(dmdd, "Falldown", 1)
  949.  elements.property(dmdd, "HighTemperature", 9999)
  950.  elements.property(dmdd, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
  951.  elements.property(dmdd, "Falldown", 1)
  952.  
  953. local anih = elements.allocate("TPT" , "ANIH")
  954.  elements.element(anih, elements.element(elements.DEFAULT_PT_DEST))
  955.  elements.property(anih, "Name" , "ANIH")
  956.  elements.property(anih, "Description" , "Annihilation.")
  957.  elements.property(anih, "Color", 0x603090)
  958.  elements.property(anih, "HotAir", 0.1)
  959.  elements.property(anih, "MenuSection", 11)
  960.  elements.property(elements.TPT_PT_ANIH, "Update", --*1
  961.  function(i,x,y,s,nt) --1
  962.   attract(i,x,y,0.1)
  963.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  964.    if math.random(1,1) == 1 then --3
  965.     for r in sim.neighbors(x,y,2,2) do --4
  966.      if math.random(1,6) == 3 then --5
  967.       sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  968.       if math.random(1,2) == 1 then --6
  969.        if sim.partProperty(r, "type") == elements.DEFAULT_PT_DMND then --7
  970.         sim.partProperty(r, "type", elements.TPT_PT_DMDD)
  971.         else if sim.partProperty(r, "type") ~= elements.TPT_PT_DMDD then --8
  972.          sim.pressure(x/4,y/4,255)
  973.          sim.partKill(r)
  974.          return
  975.          end --8
  976.         end --7
  977.        end --6
  978.       end --5
  979.      end --4
  980.     end --3
  981.    end --2
  982.   if math.random(1,8) == 1 then --9
  983.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
  984.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
  985.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
  986.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_SING)
  987.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
  988.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
  989.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
  990.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
  991.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
  992.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
  993.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_DEST)
  994.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  995.    end --9
  996.   end --1
  997.  ) --*1
  998.  
  999. local logan = elements.allocate("TPT" , "XMEN")
  1000.  elements.element(logan, elements.element(elements.DEFAULT_PT_IRON))
  1001.  elements.property(logan, "Name" , "ADMT")
  1002.  elements.property(logan, "Description" , "Adamantium, incredibly durable material. Almost virtually indestructible. An alloy of steel and vibranium")
  1003.  elements.property(logan, "Color", 0xC8C8D0)
  1004.  elements.property(logan, "HighTemperature", 9500.50)
  1005.  elements.property(logan, "Weight", 1010)
  1006.  elements.property(logan, "Hardness", 0)
  1007.  
  1008.  local function funcGraphics(i, colr, colg, colb) --*1
  1009.   return 1,ren.PMODE_LFLARE,30,colr,colg,colb,255,96,48,144
  1010.   end --*1
  1011.  elements.property(anih, "Graphics", funcGraphics)
  1012.  
  1013. local bullet = elements.allocate("TPT" , "BULT")
  1014.  elements.element(bullet, elements.element(elements.DEFAULT_PT_BREL))
  1015.  elements.property(bullet, "Name" , "BLLT")
  1016.  elements.property(bullet, "Description" , "Bullet, travels with minimum decceleration and creates winds.")
  1017.  elements.property(bullet, "Color", 0x433141)
  1018.  elements.property(bullet, "MenuSection", 16)
  1019.  elements.property(bullet, "Flammable", 0)
  1020.  elements.property(bullet, "Loss", 1)
  1021.  elements.property(bullet, "AirDrag", 0.35)
  1022.  elements.property(bullet, "Weight", 101)
  1023.  elements.property(bullet, "Gravity", 0.002)
  1024.  elements.property(elem.TPT_PT_BULT, "Update",
  1025.  function(i,x,y,s,nt) --1
  1026.   if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) > 50 then --2
  1027.    sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_FIRE)
  1028.    sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_FIRE)
  1029.    sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_FIRE)
  1030.    sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_FIRE)
  1031.    sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_FIRE)
  1032.    sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_FIRE)
  1033.    sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_FIRE)
  1034.    sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_FIRE)
  1035.    end --2
  1036.   end --1
  1037. ) --*1
  1038.  
  1039. local anmt = elements.allocate("TPT" , "AMTL")
  1040.  elements.element(anmt, elements.element(elements.DEFAULT_PT_METL))
  1041.  elements.property(anmt, "Name" , "AMTL")
  1042.  elements.property(anmt, "Description" , "Anti-Metal, violently heats surrounding materials when sparked. Melts at cold temperatures.")
  1043.  elements.property(anmt, "Color", 0x899469)
  1044.  elements.property(anmt, "LowTemperature", 10)
  1045.  elements.property(anmt, "LowTemperatureTransition", elements.DEFAULT_PT_LAVA)
  1046.  elements.property(anmt, "HighTemperature", 10001)
  1047.  elements.property(elem.TPT_PT_AMTL, "Update",
  1048.  function(i,x,y,s,nt) --1
  1049.   for r in sim.neighbors(x,y,2,2) do --2
  1050.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_SPRK then --3
  1051.     sim.partProperty(i, "temp", sim.partProperty(i, "temp")+500)
  1052.     end --3
  1053.    end --2
  1054.   end --1
  1055. ) --*1
  1056.  
  1057. local agas = elements.allocate("TPT" , "AGAS")
  1058.  elements.element(agas, elements.element(elements.DEFAULT_PT_BOYL))
  1059.  elements.property(agas, "Name" , "AGAS")
  1060.  elements.property(agas, "HeatConduct", 255)
  1061.  elements.property(agas, "HotAir", 0.001)
  1062.  elements.property(agas, "Color", 0xFDFDB7)
  1063.  elements.property(agas, "AirDrag", 0.001)
  1064.  elements.property(agas, "AirLoss", 1)
  1065.  elements.property(agas, "Diffusion", 1.25)
  1066.  elements.property(agas, "MenuSection", 16)
  1067.  elements.property(agas, "LowPressure",  -5)
  1068.  elements.property(agas, "LowPressureTransition", elements.TPT_PT_ANLIQ)
  1069.  elements.property(agas, "Description" , "Anti-Gas. Opposite of gas")
  1070.  elements.property(elem.TPT_PT_AGAS, "Update", --*1
  1071.  function(i,x,y,s,nt) --1
  1072.   if math.random(1,2) == 2 then --2
  1073.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1074.     for r in sim.neighbors(x,y,1,1) do --4
  1075.      if sim.partProperty(i, "tmp") == 0 then --5
  1076.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
  1077.        sim.partProperty(i, "tmp", -1)
  1078.        end --6
  1079.       end --5
  1080.      if sim.partProperty(i, "tmp") == -1 then --7
  1081.       if math.random(1,2) == 1 then --8
  1082.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  1083.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  1084.        sim.pressure(x/4,y/4,10)
  1085.        if math.random(1,50) == 1 then --9
  1086.         sim.partKill(i)
  1087.         return
  1088.         end --9
  1089.        end --8
  1090.       end --7
  1091.      end --4
  1092.     end --3
  1093.    end --2
  1094.   end --1
  1095.   ) --*1
  1096.  
  1097.  elements.property(aliq, "LowTemperature",  5)
  1098.  elements.property(aliq, "LowTemperatureTransition", elements.TPT_PT_AGAS)
  1099.  
  1100.  elements.property(elements.DEFAULT_PT_CO2, "Color", 0xBBBBBB)
  1101.  
  1102.  elements.property(elements.DEFAULT_PT_METL, "Name" , "STEL")
  1103.  elements.property(elements.DEFAULT_PT_METL, "Description" , "Steel, basic metal. Conducts")
  1104.  elements.property(elements.DEFAULT_PT_METL, "Color", 0x54545D)
  1105.  elements.property(elements.DEFAULT_PT_METL, "HighTemperature", 1643.15)
  1106.  
  1107. local argi = elements.allocate("TPT" , "ARGI")
  1108.  elements.element(argi, elements.element(elements.DEFAULT_PT_GOLD))
  1109.  elements.property(argi, "Name" , "SLVR")
  1110.  elements.property(argi, "Description" , "Silver, resistant to corrosion. Conducts at a faster pulse")
  1111.  elements.property(argi, "Color", 0xA0A5B0)
  1112.  elements.property(argi, "HighTemperature", 1235.46)
  1113.  elements.property(elem.TPT_PT_ARGI, "Update",
  1114.  function(i,x,y,s,nt) --1
  1115.   if sim.partProperty(i, "life") > 0 then --2
  1116.    sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  1117.    end --2
  1118.   end --1
  1119. ) --*1
  1120.  
  1121.  elements.property(elements.DEFAULT_PT_SPRK, "Color", 0xDCECFF)
  1122.  
  1123. local trit = elements.allocate("TPT" , "TRIT")
  1124.  elements.element(trit, elements.element(elements.DEFAULT_PT_HYGN))
  1125.  elements.property(trit, "Name" , "TRIT")
  1126.  elements.property(trit, "Description" , "Tritium, decays into lighter components when struck with neutrons.")
  1127.  elements.property(trit, "Color", 0x31363D)
  1128.  elements.property(trit, "Gravity", 0.2)
  1129.  elements.property(trit, "PhotonReflectWavelengths", 0x00000001)
  1130.  elements.property(trit, "MenuSection", 10)
  1131.  function tritium(i,x,y,s,n)
  1132.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  1133.    if math.random(1,2) == 1 then --2
  1134.     tpt.parts[i].type = elements.DEFAULT_PT_DEUT
  1135.     tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  1136.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1137.     sim.pressure(x/4,y/4,5)
  1138.     else if math.random(1,6) == 1 then --3
  1139.      tpt.parts[i].type = elements.DEFAULT_PT_HYGN
  1140.      tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  1141.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1142.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1143.      sim.pressure(x/4,y/4,5)
  1144.      else if math.random(1,6) == 1 then --4
  1145.       tpt.parts[i].type = elements.TPT_PT_HE
  1146.       sim.pressure(x/4,y/4,5)
  1147.       tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  1148.       tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'elec')
  1149.       end --4
  1150.      end --3
  1151.     end --2
  1152.    end --1
  1153.   if sim.pressure(x/4,y/4) > 1 then --3
  1154.    if math.random(1,250) == 10 then --4
  1155.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1156.     tpt.set_property("temp", math.huge, x ,y)
  1157.     end --4
  1158.    end --3
  1159.   if math.random(1,10000) == 10 then --5
  1160.    sim.pressure(x/4,y/4,2)
  1161.    end --5
  1162.   end --*1
  1163.  
  1164.  elements.property(elem.TPT_PT_TRIT, "Update", --*1
  1165.  function(i,x,y,s,nt) --1
  1166.   if math.random(1,2) == 2 then --2
  1167.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1168.     for r in sim.neighbors(x,y,1,1) do --4
  1169.      if sim.partProperty(i, "tmp") == 0 then --5
  1170.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --6
  1171.        sim.partProperty(i, "tmp", -1)
  1172.        end --6
  1173.       end --5
  1174.      if sim.partProperty(i, "tmp") == -1 then --7
  1175.       if math.random(1,2) == 1 then --8
  1176.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_ACID)
  1177.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+20)
  1178.        if math.random(1,2) == 1 then --9
  1179.         sim.partKill(i)
  1180.         return
  1181.         end --9
  1182.        end --8
  1183.       end --7
  1184.      end --4
  1185.     end --3
  1186.    end --2
  1187.    tritium(i,x,y,s,n)
  1188.   end --1
  1189.   ) --*1
  1190.  
  1191. local ltrt = elements.allocate("TPT" , "LTRT")
  1192.  elements.element(ltrt, elements.element(elements.TPT_PT_LHYG))
  1193.  elements.property(ltrt, "Name" , "LTRT")
  1194.  elements.property(ltrt, "Description" , "Liquid Tritium, dangerous.")
  1195.  elements.property(ltrt, "Color", 0x33363C)
  1196.  elements.property(ltrt, "HighTemperatureTransition", elements.TPT_PT_TRIT)
  1197.  elements.property(ltrt, "PhotonReflectWavelengths", 0x00000001)
  1198.  elements.property(ltrt, "MenuSection", 16)
  1199.  elements.property(ltrt, "Flammable", 16)
  1200.  elements.property(elem.TPT_PT_LTRT, "Update", --*1
  1201.  function(i,x,y,s,nt) --1
  1202.   if math.random(1,2) == 2 then --2
  1203.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1204.     for r in sim.neighbors(x,y,1,1) do --4
  1205.      if sim.partProperty(i, "tmp") == 0 then --5
  1206.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_DEUT then --6
  1207.        sim.partProperty(i, "tmp", -2)
  1208.        end --6
  1209.       end --5
  1210.      if sim.partProperty(i, "tmp") == -2 then --7
  1211.       if math.random(1,500) == 1 then --8
  1212.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_LHE)
  1213.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+200)
  1214.        if math.random(1,2) == 1 then --9
  1215.         sim.partKill(i)
  1216.         return
  1217.         end --9
  1218.        end --8
  1219.       end --7
  1220.      end --4
  1221.     end --3
  1222.    end --2
  1223.   end --1
  1224.   ) --*1
  1225.  
  1226. elements.property(trit, "LowTemperatureTransition", elements.TPT_PT_LTRT)
  1227.  
  1228. local pkic = elements.allocate("TPT" , "PKIC")
  1229.  elements.element(pkic, elements.element(elements.DEFAULT_PT_DMND))
  1230.  elements.property(pkic, "Name" , "PKIC")
  1231.  elements.property(pkic, "Description" , "Packed Ice.")
  1232.  elements.property(pkic, "Color", 0x6F94F4)
  1233.  elements.property(pkic, "MenuSection", 9)
  1234.  elements.property(pkic, "Temperature", 210.32)
  1235.  elements.property(pkic, "HeatConduct", 5)
  1236.  elements.property(elem.TPT_PT_PKIC, "Update",
  1237.  function(i,x,y,s,nt) --1
  1238.   if math.random(1,20) == 1 then --2
  1239.    if sim.partProperty(i, "temp") > 220.35 then --3
  1240.     sim.partProperty(i, "type", elements.DEFAULT_PT_ICE)
  1241.     end --3
  1242.    end --2
  1243.   end --1
  1244. ) --*1
  1245.  
  1246.  elements.property(elem.DEFAULT_PT_ICE, "Update",
  1247.  function(i,x,y,s,nt) --1
  1248.   if math.random(1,2) == 1 then --2
  1249.    if sim.partProperty(i, "temp") < 220.30 then --3
  1250.     sim.partProperty(i, "type", elements.TPT_PT_PKIC)
  1251.     end --3
  1252.    end --2
  1253.   end --1
  1254. ) --*1
  1255.  
  1256.  
  1257. local pala = elements.allocate("TPT" , "PALA")
  1258.  elements.element(pala, elements.element(elements.DEFAULT_PT_GOLD))
  1259.  elements.property(pala, "Name" , "PALA")
  1260.  elements.property(pala, "Description" , "Paladium, desintegrates over time with neutrons.")
  1261.  elements.property(pala, "Color", 0xCCC7BD)
  1262.  elements.property(pala, "PhotonReflectWavelengths", 0x2FF20000)
  1263.  elements.property(pala, "MenuSection", 10)
  1264.  elements.property(pala, "HighTemperature", 1828)
  1265.  function paladium(i,x,y,s,n)
  1266.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  1267.    if math.random(1,2) == 1 then --2
  1268.     tpt.parts[i].type = elements.TPT_PT_ARGI
  1269.     if math.random(1,2) == 1 then --3
  1270.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1271.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1272.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1273.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1274.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'lead')
  1275.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1276.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1277.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1278.      tpt.set_property("temp", tpt.get_property("temp", x ,y)+5000, x ,y)
  1279.      end --3
  1280.     end --2
  1281.    end --1
  1282.   if math.random(1,10000) == 10 then --4
  1283.    sim.pressure(x/4,y/4,5)
  1284.    end --4
  1285.   end --*1
  1286.  tpt.element_func(paladium,pala)
  1287.  
  1288. local ltac = elements.allocate("TPT", "LTAC")
  1289.  elements.element(ltac, elements.element(elements.DEFAULT_PT_SOAP))
  1290.  elements.property(ltac, "Name" , "LTAC")
  1291.  elements.property(ltac, "Description" , "Lactic acid, helps to decompose organic matter.")
  1292.  elements.property(ltac, "Color", 0xD7BCCD)
  1293.  elements.property(ltac, "Hardness", 1)
  1294.  elements.property(elem.TPT_PT_LTAC, "Update", --*1
  1295.  function(i,x,y,s,nt) --1
  1296.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1297.    if math.random(1,100) == 10 then --3
  1298.     for r in sim.neighbors(x,y,1,1) do --4
  1299.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT or sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --5
  1300.       if math.random(1,3) == 1 then --6
  1301.        sim.partProperty(r, "type", elements.TPT_PT_ASH)
  1302.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10)
  1303.        if math.random(1,13) == 1 then --7
  1304.         sim.pressure(x/4,y/4,0.1)
  1305.         sim.partKill(i)
  1306.         return
  1307.         end --7
  1308.        end --6
  1309.       end --5
  1310.      end --4
  1311.     end --3
  1312.    end --2
  1313.   end --1
  1314.   ) --*1
  1315.  
  1316. local bctr = elements.allocate("TPT", "BACT")
  1317.  elements.element(bctr, elements.element(elements.DEFAULT_PT_SOAP))
  1318.  elements.property(bctr, "Name" , "BCTR")
  1319.  elements.property(bctr, "Description" , "Bacteria, spreads and sticks.")
  1320.  elements.property(bctr, "Color", 0xE0F0A1)
  1321.  elements.property(bctr, "Diffusion", 0.3)
  1322.  elements.property(bctr, "Weight", 30)
  1323.  elements.property(bctr, "MenuSection", 11)
  1324.  
  1325. local bctrb = elements.allocate("TPT", "BCTR")
  1326.  elements.element(bctrb, elements.element(elements.DEFAULT_PT_SOAP))
  1327.  elements.property(bctrb, "Name" , "BCTD")
  1328.  elements.property(bctrb, "Description" , "Decomposer bacteria, decomposes plant matter.")
  1329.  elements.property(bctrb, "Color", 0xFFE990)
  1330.  elements.property(bctrb, "Diffusion", 0.3)
  1331.  elements.property(bctrb, "Weight", 30)
  1332.  elements.property(bctrb, "MenuSection", 16)
  1333.  
  1334. local bctra = elements.allocate("TPT", "BCTRA")
  1335.  elements.element(bctra, elements.element(elements.DEFAULT_PT_SOAP))
  1336.  elements.property(bctra, "Name" , "ABCT")
  1337.  elements.property(bctra, "Description" , "Airbourne bacteria.")
  1338.  elements.property(bctra, "Color", 0xC9E9FF)
  1339.  elements.property(bctra, "Diffusion", 0.2)
  1340.  elements.property(bctra, "Weight", 29)
  1341.  elements.property(bctra, "MenuSection", 16)
  1342.  elements.property(bctra, "Gravity", -0.025)
  1343.  
  1344. local bctrc = elements.allocate("TPT", "BCTRC")
  1345.  elements.element(bctrc, elements.element(elements.DEFAULT_PT_SOAP))
  1346.  elements.property(bctrc, "Name" , "BCTW")
  1347.  elements.property(bctrc, "Description" , "Bacterial wall, solid but still flows")
  1348.  elements.property(bctrc, "Color", 0xC9FF90)
  1349.  elements.property(bctrc, "Diffusion", 0.1)
  1350.  elements.property(bctrc, "Weight", 31)
  1351.  elements.property(bctrc, "MenuSection", 16)
  1352.  
  1353. local bctrp = elements.allocate("TPT", "BCTRP")
  1354.  elements.element(bctrp, elements.element(elements.DEFAULT_PT_SOAP))
  1355.  elements.property(bctrp, "Name" , "AQBC")
  1356.  elements.property(bctrp, "Description" , "Aquatic Bacteria. Floats and spreads through water slowly.")
  1357.  elements.property(bctrp, "Color", 0xFFF0FF)
  1358.  elements.property(bctrp, "Diffusion", 0.3)
  1359.  elements.property(bctrp, "Weight", 31)
  1360.  elements.property(bctrp, "MenuSection", 16)
  1361.  elements.property(elem.TPT_PT_BCTRP, "Update", --*1
  1362.  function(i,x,y,s,nt) --1
  1363.   if nt == 8 then --2
  1364.    for r in sim.neighbors(x,y,1,1) do --3
  1365.     if math.random(1,1000) > 1 then --4
  1366.      sim.partProperty(i, "vy", -0.05)
  1367.      end --4
  1368.     if math.random(1,1000) > 1 then --5
  1369.      sim.partProperty(i, "vx", math.random(-0.01,0.01))
  1370.      end --5
  1371.     if math.random(1,2000) < 4 then --6
  1372.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1373.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1374.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1375.      end --6
  1376.     if math.random(1,40000) < 2 then --7
  1377.      sim.partKill(i)
  1378.      end --7
  1379.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --8
  1380.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  1381.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTR)
  1382.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  1383.      end --8
  1384.     end --3
  1385.    end --2
  1386.   end --1
  1387. ) --*1
  1388.  
  1389.  elements.property(elem.TPT_PT_BCTRC, "Update", --*1
  1390.  function(i,x,y,s,nt) --1
  1391.   if s ~=8 and nt ~=0 and s > 0 then --2
  1392.    for r in sim.neighbors(x,y,1,1) do --3
  1393.     if math.random(1,1000) > 1 then --4
  1394.      sim.partProperty(i, "vy", 0)
  1395.      end --4
  1396.     if math.random(1,1000) > 1 then --5
  1397.      sim.partProperty(i, "vx", 0)
  1398.      end --5
  1399.     if math.random(1,200000) < 4 then --6
  1400.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1401.      sim.partProperty(i, "temp", 338)
  1402.      end --6
  1403.     if math.random(1,200000) == 1 then --7
  1404.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1405.      end --7
  1406.     if math.random(1,200000) == 1 then --8
  1407.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1408.      sim.partProperty(i, "temp", 338)
  1409.      end --8
  1410.     if math.random(1,4000) < 2 then --9
  1411.      sim.partKill(i)
  1412.      end --9
  1413.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --10
  1414.      if math.random(1,40) then --11
  1415.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  1416.       sim.partProperty(i, "temp", 338)
  1417.       sim.partKill(4)
  1418.       end --11
  1419.      end --10
  1420.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --12
  1421.      if math.random(1,20) == 1 then --13
  1422.       if math.random(1,50) == 1 then --14
  1423.        sim.partProperty(i, "type", elements.TPT_PT_BCTRP)
  1424.        end --14
  1425.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  1426.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  1427.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  1428.      sim.partProperty(i, "temp", 338)
  1429.       sim.partKill(i)
  1430.       end --13
  1431.      end --12
  1432.     if sim.partProperty(r, "type") == elements.TPT_PT_BCTRP then --15
  1433.      if math.random(1,200) == 1 then --16
  1434.       sim.partKill(i)
  1435.       end --16
  1436.      end --15
  1437.     end --3
  1438.    end --2
  1439.   end --1
  1440. ) --*1
  1441.  
  1442.  elements.property(elem.TPT_PT_BCTR, "Update", --*1
  1443.  function(i,x,y,s,nt) --1
  1444.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1445.    for r in sim.neighbors(x,y,1,1) do --3
  1446.     if math.random(1,10) > 1 then --4
  1447.      sim.partProperty(i, "vy", 0)
  1448.      end --4
  1449.     if math.random(1,10) > 1 then --5
  1450.      sim.partProperty(i, "vx", 0)
  1451.      end --5
  1452.     if math.random(1,200) < 4 then --6
  1453.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1454.      sim.partProperty(i, "temp", 338)
  1455.      end --6
  1456.     if math.random(1,4000) < 2 then --7
  1457.      sim.partKill(i)
  1458.      end --7
  1459.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --8
  1460.      if math.random(1,20) < 2 then --9
  1461.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1462.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1463.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_LTAC)
  1464.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_LTAC)
  1465.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  1466.      sim.partProperty(i, "temp", 338)
  1467.       sim.partKill(r)
  1468.       end --9
  1469.      end --8
  1470.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT then --10
  1471.      if math.random(1,20) < 2 then --11
  1472.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1473.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1474.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  1475.       sim.partKill(r)
  1476.       end --11
  1477.      end --10
  1478.     if sim.partProperty(r, "type") == elements.TPT_PT_ALGAE then --12
  1479.      if math.random(1,20) < 2 then --13
  1480.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1481.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  1482.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  1483.       sim.partKill(r)
  1484.       end --13
  1485.      end --12
  1486.     if math.random(1,1000) == 1 then --14
  1487.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1488.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1489.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  1490.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1491.      sim.partProperty(i, "temp", 338)
  1492.      end --14
  1493.     if math.random(1,10000) == 1 then --15
  1494.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1495.      end --15
  1496.     if math.random(1,1000) == 1 then --16
  1497.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  1498.      end --16
  1499.     end --3
  1500.    end --2
  1501.   end --1
  1502.   ) --*1
  1503.  
  1504.  elements.property(elem.TPT_PT_BCTRA, "Update", --*1
  1505.  function(i,x,y,s,nt) --1
  1506.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1507.    for r in sim.neighbors(x,y,1,1) do --3
  1508.     if math.random(1,20) > 1 then --4
  1509.      sim.partProperty(i, "vy", -0.01)
  1510.      end --4
  1511.     if math.random(1,20) > 1 then --5
  1512.      sim.partProperty(i, "vx", 0)
  1513.      end --5
  1514.     if math.random(1,400) < 4 then --6
  1515.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1516.      end --6
  1517.     if math.random(1,1600) < 2 then --7
  1518.      sim.partKill(i)
  1519.      end --7
  1520.     if sim.partProperty(r, "type") == elements.TPT_PT_ASH then --8
  1521.      if math.random(1,20) < 2 then --9
  1522.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1523.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1524.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
  1525.       sim.partKill(r)
  1526.       end --9
  1527.      end --8
  1528.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_OXYG then --10
  1529.      if math.random(1,20) < 2 then --11
  1530.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1531.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1532.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
  1533.       sim.partKill(r)
  1534.       end --11
  1535.      end --10
  1536.     if math.random(1,125) == 1 then --12
  1537.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+1),elements.TPT_PT_BCTRC)
  1538.      end --12
  1539.     if math.random(1,10000) == 1 then --12
  1540.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1541.      end --12
  1542.     end --3
  1543.    end --2
  1544.   end --1
  1545.   ) --*1
  1546.  
  1547.  elements.property(elem.TPT_PT_BACT, "Update", --*1
  1548.  function(i,x,y,s,nt) --1
  1549.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1550.    for r in sim.neighbors(x,y,1,1) do --3
  1551.     if math.random(1,20) > 1 then --4
  1552.      sim.partProperty(i, "vy", -0.01)
  1553.      end --4
  1554.     if math.random(1,20) > 1 then --5
  1555.      sim.partProperty(i, "vx", 0)
  1556.      end --5
  1557.     if math.random(1,20) < 2 then --6
  1558.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1559.      sim.partKill(i)
  1560.      end --6
  1561.     end --3
  1562.    end --2
  1563.   end --1
  1564.   ) --*1
  1565.  
  1566. local sdpr = elements.allocate("TPT" , "SPPR")
  1567.  elements.element(sdpr, elements.element(elements.DEFAULT_PT_DMND))
  1568.  elements.property(sdpr, "Name" , "SPPR")
  1569.  elements.property(sdpr, "Description" , "Sandpaper, Gritty.")
  1570.  elements.property(sdpr, "Color", 0x6F6245)
  1571.  elements.property(sdpr, "HeatConduct", 4)
  1572.  elements.property(elem.TPT_PT_SPPR, "Update",
  1573.  function(i,x,y,s,nt) --1
  1574.   for r in sim.neighbors(x,y,1,1) do --2
  1575.    if sim.partProperty(r, "type") > 0 then --3
  1576.     sim.partProperty(i, "temp", sim.partProperty(i, "temp")+math.sqrt(math.pow(sim.partProperty(r, "vx"),2)+math.pow(sim.partProperty(r, "vy"),2))*4)
  1577.     sim.partProperty(r, "vy", 0)
  1578.     sim.partProperty(r, "vx", 0)
  1579.     end --3
  1580.    end --2
  1581.   end --1
  1582. ) --*1
  1583.  
  1584. local jean = elements.allocate("TPT", "DISA")
  1585.  elements.element(jean, elements.element(elements.DEFAULT_PT_THDR))
  1586.  elements.property(jean, "Name" , "DISA")
  1587.  elements.property(jean, "Description" , "\"Cause Havok.\"")
  1588.  elements.property(jean, "Weight", -1)
  1589.  elements.property(jean, "Loss", -1.01)
  1590.  elements.property(jean, "MenuSection", 16)
  1591.  elements.property(jean, "Diffusion", 0)
  1592.  elements.property(elem.TPT_PT_DISA, "Update", --*1
  1593.  function(i,x,y,s) --1
  1594.   if s > 6 then --2
  1595.    if math.random(1,20) == 20 then --3
  1596.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.DEFAULT_PT_THDR)
  1597.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_TORN)
  1598.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_STRM)
  1599.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_CAVE)
  1600.     sim.pressure(x/4,y/4,16)
  1601.     if math.random(1,5) == 5 then --4
  1602.      sim.partKill(i)
  1603.      end --4
  1604.     end --3
  1605.    end --2
  1606.   end --1
  1607.   ) --*1
  1608.  
  1609. local co2s = elements.allocate("TPT", "CSNW")
  1610.  elements.element(co2s, elements.element(elements.DEFAULT_PT_SNOW))
  1611.  elements.property(co2s, "Name" , "CSNW")
  1612.  elements.property(co2s, "Description" , "CO2 Snow.")
  1613.  elements.property(co2s, "Color", 0xC2C2C2)
  1614.  elements.property(co2s, "Diffusion", 0.1)
  1615.  elements.property(co2s, "HighTemperature", 10001)
  1616.  elements.property(co2s, "Temperature", 186.65)
  1617.  elements.property(co2s, "Weight", 31)
  1618.  elements.property(co2s, "MenuSection", 16)
  1619.  elements.property(elements.TPT_PT_CSNW, "Update", --*1
  1620.  function(i,x,y) --1
  1621.   if sim.partProperty(i, "temp") > 194.65 then --2
  1622.    if math.random(1,450) == 1 then --3
  1623.     sim.partChangeType(i, elements.DEFAULT_PT_CO2)
  1624.     end --3
  1625.    end --2
  1626.   end --1
  1627.  ) --*1
  1628.  
  1629.  elements.property(elements.DEFAULT_PT_DRIC, "HighPressure", 1.2)
  1630.  elements.property(elements.DEFAULT_PT_DRIC, "HighPressureTransition", elements.TPT_PT_CSNW)
  1631.  
  1632.  elements.property(elements.DEFAULT_PT_COAL, "Update", --*1
  1633.  function(i,x,y,s,nt) --1
  1634.   if sim.pressure(x/4,y/4) < -9.5 then --2
  1635.    if math.random(1,950) == 1 then --3
  1636.     sim.partProperty(i, "type", elements.TPT_PT_GRPH)
  1637.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.DEFAULT_PT_SMKE)
  1638.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.TPT_PT_ASH)
  1639.     end --3
  1640.    end --2
  1641.   end --1
  1642.   ) --*1
  1643.  
  1644. local ground = elements.allocate("TPT" , "GRND")
  1645.  elements.element(ground, elements.element(elements.DEFAULT_PT_STNE))
  1646.  elements.property(ground, "Name" , "GRND")
  1647.  elements.property(ground, "Description" , "Ground.")
  1648.  elements.property(ground, "Color", 0xA2A29A)
  1649.  elements.property(ground, "HighTemperature", 10001)
  1650.  elements.property(ground, "MenuSection", 16)
  1651.  elements.property(ground, "Flammable", 0)
  1652.  elements.property(elem.TPT_PT_GRND, "Update",
  1653.  function(i,x,y,s,nt) --1
  1654.   if math.random(1,2) == 1 then --2
  1655.   sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_SAND)
  1656.   sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_STNE)
  1657.   sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_DUST)
  1658.   end --2
  1659.  end --1
  1660. ) --*1
  1661.  
  1662. local brwf = elements.allocate("TPT" , "BRWF")
  1663.  elements.element(brwf, elements.element(elements.DEFAULT_PT_EQVE))
  1664.  elements.property(brwf, "Name" , "BRWF")
  1665.  elements.property(brwf, "Description" , "Broken Tungsten.")
  1666.  elements.property(brwf, "Color", 0x5E575B)
  1667.  elements.property(brwf, "HighTemperature", 3595.0)
  1668.  elements.property(brwf, "HighTemperatureTransition", elements.DEFAULT_PT_TUNG)
  1669.  elements.property(brwf, "MenuSection", 16)
  1670.  elements.property(brwf, "Flammable", 0)
  1671.  elements.property(elem.DEFAULT_PT_BRMT, "Update",
  1672.  function(i,x,y,s,nt) --1
  1673.   if sim.partProperty(i, "ctype") == elements.DEFAULT_PT_TUNG then --2
  1674.   sim.partProperty(i, "type", elements.TPT_PT_BRWF)
  1675.   end --2
  1676.  end --1
  1677. ) --*1
  1678.  
  1679.  elements.property(elements.DEFAULT_PT_CFLM, "Falldown", 2)
  1680.  elements.property(elements.DEFAULT_PT_CFLM, "Gravity", 0.1)
  1681.  
  1682. local lo3 = elements.allocate("TPT", "LO3")
  1683.  elements.element(lo3, elements.element(elements.DEFAULT_PT_LOXY))
  1684.  elements.property(lo3, "Name" , "LO3")
  1685.  elements.property(lo3, "Description" , "Liquid Ozone, very cold. Horrifying")
  1686.  elements.property(lo3, "Flammable", 5.65)
  1687.  elements.property(lo3, "Explosive", 0)
  1688.  elements.property(lo3, "Color", 0x4F68AC)
  1689.  elements.property(lo3, "Temperature", 145.15)
  1690.  elements.property(lo3, "MenuSection", 7)
  1691.  
  1692. local o3 = elements.allocate("TPT", "O3")
  1693.  elements.element(o3, elements.element(elements.DEFAULT_PT_HYGN))
  1694.  elements.property(o3, "Name" , "O3")
  1695.  elements.property(o3, "Description" , "Ozone, strong oxidizer.")
  1696.  elements.property(o3, "Color", 0x6079BD)
  1697.  elements.property(o3, "LowTemperature", 159.1)
  1698.  elements.property(o3, "LowTemperatureTransition", elements.TPT_PT_LO3)
  1699.  elements.property(elem.TPT_PT_O3, "Update",
  1700.  function(i,x,y,s,nt) --1
  1701.   for r in sim.neighbors(x,y,1,1) do --2
  1702.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --3
  1703.     sim.partProperty(r, "life", 260)
  1704.     sim.partProperty(r, "vy", sim.partProperty(r, "vy")*1.05)
  1705.     sim.partProperty(r, "vx", sim.partProperty(r, "vx")*1.05)
  1706.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")+100)
  1707.     sim.pressure(x/4,y/4,0.1)
  1708.     if math.random(1,500) == 1 then --4
  1709.      sim.partKill(i)
  1710.      end --4
  1711.     end --3
  1712.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLSM then --5
  1713.     sim.partProperty(r, "life", math.random(260,390))
  1714.     sim.partProperty(r, "vy", sim.partProperty(r, "vy")*1.1)
  1715.     sim.partProperty(r, "vx", sim.partProperty(r, "vx")*1.1)
  1716.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")+200)
  1717.     sim.pressure(x/4,y/4,0.1)
  1718.     if math.random(1,500) == 1 then --6
  1719.      sim.partKill(i)
  1720.      end --6
  1721.     end --5
  1722.    end --2
  1723.   end --1
  1724. ) --*1
  1725.  
  1726.  elements.property(lo3, "HighTemperature", 161.1)
  1727.  elements.property(lo3, "HighTemperatureTransition", elements.TPT_PT_O3)
  1728.  
  1729.  elements.property(elements.DEFAULT_PT_PLSM, "Falldown", 2)
  1730.  elements.property(elements.DEFAULT_PT_PLSM, "Gravity", 0)
  1731.  
  1732.  elements.property(elem.TPT_PT_HE, "Update", --*1
  1733. function(i,x,y,s) --1
  1734.   if sim.partProperty(i, "temp") < 4.15 then --2
  1735.    if math.random(1,800) == 1 then --3
  1736.     sim.partProperty(i, "type", elements.TPT_PT_LHE)
  1737.     end --3
  1738.    end --2
  1739.   if sim.partProperty(i, "temp") > 4000 then --4
  1740.    if sim.pressure(x/4,y/4) > 100 then --5
  1741.     sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_PHOT)
  1742.     sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_PHOT)
  1743.     sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_CO2)
  1744.     sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_OXYG)
  1745.     sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_NBLE)
  1746.     sim.partCreate(-1, x+1, y, elements.TPT_PT_HE3)
  1747.     sim.partCreate(-1, x-1, y, elements.TPT_PT_NEUT)
  1748.     if math.random(1,25) == 1 then --6
  1749.      sim.partCreate(-1, x-1, y, elements.TPT_PT_O3)
  1750.      sim.partProperty(i, "tmp2", 4)
  1751.      sim.partProperty(i, "tmp", math.random(0,359))
  1752.      sim.partProperty(i, "life", math.random(1,4))
  1753.      sim.pressure(x/4,y/4,150)
  1754.      sim.partProperty(i, "type", elements.DEFAULT_PT_LIGH)
  1755.      return
  1756.      end --6
  1757.     end --5
  1758.    end --4
  1759.   end --1
  1760.   ) --*1
  1761.  
  1762.  elements.property(elem.DEFAULT_PT_OXYG, "Update",
  1763.  function(i,x,y,s,nt) --1
  1764.   for r in sim.neighbors(x,y,1,1) do --2
  1765.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_LIGH then --3
  1766.     sim.partProperty(i, "type", elements.TPT_PT_O3)
  1767.     end --3
  1768.    end --2
  1769.   end --1
  1770. ) --*1
  1771.  
  1772. local magm = elements.allocate("TPT" , "MAGM")
  1773.  elements.element(magm, elements.element(elements.DEFAULT_PT_LAVA))
  1774.  elements.property(magm, "Name" , "MAGM")
  1775.  elements.property(magm, "Description" , "Magma.")
  1776.  elements.property(magm, "Color", 0xFA7E3B)
  1777.  elements.property(magm, "Weight", 99)
  1778.  elements.property(magm, "Temperature", 1950.32)
  1779.  elements.property(magm, "HeatConduct", 10)
  1780.  elements.property(magm, "HotAir", 0.01)
  1781.  elements.property(magm, "Advection", 0.05)
  1782.  elements.property(elem.TPT_PT_MAGM, "Update",
  1783.  function(i,x,y,s,nt) --1
  1784.   if math.random(1,20) == 1 then --2
  1785.    sim.partProperty(i, "type", elements.DEFAULT_PT_LAVA)
  1786.    end --2
  1787.   end --1
  1788. ) --*1
  1789.  
  1790.  elements.property(elem.DEFAULT_PT_LAVA, "Update", --*1
  1791.  function(i,x,y,s,nt) --1
  1792.   if math.random(1,2) == 2 then --2
  1793.    for r in sim.neighbors(x,y,1,1) do --3
  1794.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_LAVA then --4
  1795.      if sim.partProperty(r, "ctype") == elements.DEFAULT_PT_METL then --5
  1796.       if sim.partProperty(i, "ctype") == elements.DEFAULT_PT_VIBR then --6
  1797.        sim.partProperty(r, "type", elements.TPT_PT_XMEN)
  1798.        sim.partProperty(i, "type", elements.TPT_PT_XMEN)
  1799.        end --6
  1800.       end --5
  1801.      end --4
  1802.     end --3
  1803.    end --2
  1804.   if math.random(1,2) == 2 then --7
  1805.    if sim.partProperty(i, "ctype") == elements.TPT_PT_DMDD then --9
  1806.     sim.partProperty(i, "ctype", elements.DEFAULT_PT_DMND)
  1807.     end --8
  1808.    end --7
  1809.   if math.random(1,100) == 1 then --9
  1810.    if sim.partProperty(i, "temp") > 1920.30 then --10
  1811.     sim.partProperty(i, "type", elements.TPT_PT_MAGM)
  1812.     end --10
  1813.    end --9
  1814.   end --1
  1815.   ) --*1
  1816.  
  1817. local h2o2 = elements.allocate("TPT", "H2O2")
  1818.  elements.element(h2o2, elements.element(elements.DEFAULT_PT_SOAP))
  1819.  elements.property(h2o2, "Name" , "H2O2")
  1820.  elements.property(h2o2, "Description" , "Hydrogen Peroxide, corrosive, decomposes into oxygen and water, rarely ozone.")
  1821.  elements.property(h2o2, "Color", 0x1E41CF)
  1822.  elements.property(h2o2, "Hardness", 0)
  1823.  elements.property(h2o2, "Weight", 30)
  1824.  elements.property(elem.TPT_PT_H2O2, "Update", --*1
  1825.  function(i,x,y,s,nt) --1
  1826.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1827.    if math.random(1,100) == 10 then --3
  1828.     for r in sim.neighbors(x,y,1,1) do --4
  1829.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  1830.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  1831.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  1832.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  1833.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  1834.           if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_OXYG then --10
  1835.            if sim.partProperty(r, "type") ~= elements.TPT_PT_O3 then --11
  1836.             if math.random(1,20) == 1 then --12
  1837.              sim.partProperty(r, "type", elements.DEFAULT_PT_O2)
  1838.              sim.partProperty(i, "temp", sim.partProperty(i, "temp")+300)
  1839.              if math.random(1,10) == 1 then --13
  1840.               sim.pressure(x/4,y/4,2)
  1841.               sim.partProperty(r, "type", elements.DEFAULT_PT_WATR)
  1842.               if math.random(1,10) == 1 then --14
  1843.                sim.partProperty(i, "type", elements.TPT_PT_O3)
  1844.                return
  1845.                end --14
  1846.               end --13
  1847.              end --12
  1848.             end --11
  1849.            end --10
  1850.           end --9
  1851.          end --8
  1852.         end --7
  1853.        end --6
  1854.       end --5
  1855.      end --4
  1856.     end --3
  1857.    end --2
  1858.   end --1
  1859.   ) --*1
  1860.  
  1861. local cmnt = elements.allocate("TPT" , "CMNT")
  1862.  elements.element(cmnt, elements.element(elements.DEFAULT_PT_WATR))
  1863.  elements.property(cmnt, "Name" , "CMNT")
  1864.  elements.property(cmnt, "Description" , "Cement, hardens over time.")
  1865.  elements.property(cmnt, "HighTemperature", 10001)
  1866.  elements.property(cmnt, "Weight", 31)
  1867.  elements.property(cmnt, "Color", 0x5E5E5E)
  1868.  elements.property(elem.TPT_PT_CMNT, "Update",
  1869.  function(i,x,y,s,nt) --1
  1870.   if math.random(1,12) == 1 then --2
  1871.    if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) < 0.1 then --3
  1872.     if math.random(1,10) == 1 then --4
  1873.      sim.partProperty(i, "type", elements.DEFAULT_PT_BRCK)
  1874.      else if math.random(1,100) == 1 then --5
  1875.       sim.partProperty(i, "type", elements.DEFAULT_PT_CNCT)
  1876.       else if math.random(1,500) == 1 then --6
  1877.       sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
  1878.       end --6
  1879.      end --5
  1880.     end --4
  1881.    end --3
  1882.   end --2
  1883.  end --1
  1884. ) --*1
  1885.  
  1886. local cmnp = elements.allocate("TPT", "CMNP")
  1887.  elements.element(cmnp, elements.element(elements.DEFAULT_PT_DUST))
  1888.  elements.property(cmnp, "Name" , "CMNP")
  1889.  elements.property(cmnp, "Description" , "Cement powder, mix with water to get cement.")
  1890.  elements.property(cmnp, "Color", 0x7F7F7F)
  1891.  elements.property(cmnp, "Flammable", 0)
  1892.  elements.property(elem.TPT_PT_CMNP, "Update", --*1
  1893.  function(i,x,y,s,nt) --1
  1894.   if math.random(1,50) == 10 then --2
  1895.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1896.     for r in sim.neighbors(x,y,1,1) do --4
  1897.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --5
  1898.       sim.partChangeType(r, elements.TPT_PT_CMNT)
  1899.       sim.partChangeType(i, elements.TPT_PT_CMNT)
  1900.       end --5
  1901.      end --4
  1902.     end --3
  1903.    end --2
  1904.   end --1
  1905.   ) --*1
  1906.  
  1907. local bulb = elements.allocate("TPT" , "BULB")
  1908.  elements.element(bulb, elements.element(elements.DEFAULT_PT_GLAS))
  1909.  elements.property(bulb, "Name" , "BULB")
  1910.  elements.property(bulb, "Description" , "Light bulb, emits light permanently.")
  1911.  elements.property(bulb, "Color", 0xFFFF80)
  1912.  elements.property(bulb, "Hardness", 0)
  1913.  elements.property(bulb, "Temperature", 273.15)
  1914.  elements.property(bulb, "HighTemperature", 10001)
  1915.  elements.property(bulb, "Properties", elements.PROP_NEUTPASS+elements.PROP_RADIOACTIVE+elements.TYPE_SOLID)
  1916.  elements.property(elem.TPT_PT_BULB, "Update", --*1
  1917.  function(i,x,y) --1
  1918.   if math.random(1,10) == 1 then --2
  1919.    if sim.pressure(x/4,y/4) < 393.15 then --3
  1920.     sim.partProperty(i, "temp", sim.partProperty(i, "temp")+5)
  1921.     end --3
  1922.    if sim.pressure(x/4,y/4) > 2.00 then --4
  1923.     sim.pressure(x/4,y/4,5.00)
  1924.     sim.partProperty(i, "temp", sim.partProperty(i, "temp")+500)
  1925.     sim.partProperty(i, "type", elements.DEFAULT_PT_BGLA);
  1926.     end --4
  1927.    end --2
  1928.   end --1
  1929.   ) --*1
  1930.  
  1931.  local function funcGraphics(i, colr, colg, colb) --*1
  1932.   return 1,ren.FIRE_ADD,255,colr,colg,colb,128,255,255,128
  1933.   end --*1
  1934.  elements.property(bulb, "Graphics", funcGraphics)
  1935.  
  1936. local tau = elements.allocate("TPT", "TAU")
  1937.  elements.element(tau, elements.element(elements.DEFAULT_PT_PROT))
  1938.  elements.property(tau, "Name" , "TAU")
  1939.  elements.property(tau, "Description" , "Tauons, heavy particles which decay quickly.")
  1940.  elements.property(tau, "Color", 0x880098)
  1941.  elements.property(tau, "MenuSection", 16)
  1942.  elements.property(tau, "Diffusion", 0.1)
  1943.  elements.property(tau, "Update", --*1
  1944.  function(i,x,y,colr,colg,colb) --1
  1945.   velocity_2(i,2,3)
  1946.   for r in sim.neighbors(x,y,1,1) do --2
  1947.    if math.random(1,10000) == 1 then --3
  1948.      sim.partCreate(-1, x-1, y+1, elements.TPT_PT_RADI)
  1949.      sim.partCreate(-1, x+1, y-1, elements.TPT_PT_RADI)
  1950.      sim.partCreate(-1, x-1, y-1, elements.TPT_PT_RADI)
  1951.      sim.partCreate(-1, x+1, y+1, elements.TPT_PT_RADI)
  1952.      sim.partCreate(-1, x-1, y+1, elements.TPT_PT_RADI)
  1953.      sim.partCreate(-1, x, y+1, elements.TPT_PT_RADI)
  1954.      sim.partCreate(-1, x-1, y+1, elements.TPT_PT_RADI)
  1955.      sim.partCreate(-1, x+1, y+1, elements.TPT_PT_RADI)
  1956.      sim.pressure(x/4,y/4,10)
  1957.      sim.partProperty(i, "temp", sim.partProperty(i, "temp")+5000)
  1958.      sim.partProperty(i, "life", 500)
  1959.      sim.partProperty(i, "type", elements.DEFAULT_PT_NEUT)
  1960.     end --3
  1961.    if math.random(1,20000) == 1 then --4
  1962.     sim.pressure(x/4,y/4,10)
  1963.     sim.partProperty(i, "temp", sim.partProperty(i, "temp")+8000)
  1964.     sim.partProperty(i, "life", 500)
  1965.     sim.partProperty(i, "type", elements.DEFAULT_PT_ELEC)
  1966.     end --4
  1967.    end --2
  1968.   end --1
  1969.   ) --*1
  1970.  
  1971.  local function funcGraphics(i, colr, colg, colb) --*1
  1972.   return 1,ren.PMODE_SPARK,255,colr,colg,colb,192,136,16,152
  1973.   end --*1
  1974.  elements.property(tau, "Graphics", funcGraphics)
  1975.  
  1976.  
  1977. local wyst = elements.allocate("TPT" , "WYST")
  1978.  elements.element(wyst, elements.element(elements.DEFAULT_PT_WATR))
  1979.  elements.property(wyst, "Name" , "WYST")
  1980.  elements.property(wyst, "Description" , "Water-Yeast mixture, spreads quickly under heat.")
  1981.  elements.property(wyst, "HighTemperature", 10001)
  1982.  elements.property(wyst, "Weight", 30.1)
  1983.  elements.property(wyst, "Color", 0x9E9280)
  1984.  elements.property(elem.TPT_PT_WYST, "Update",
  1985.  function(i,x,y,s,nt) --1
  1986.   for r in sim.neighbors(x,y,1,1) do --2
  1987.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --3
  1988.     if math.random(1,12) == 1 then --4
  1989.      if sim.partProperty(i, "temp") > 309.15 then --5
  1990.       if math.random(1,10) == 1 then --6
  1991.        sim.partProperty(r, "type", elements.TPT_PT_WYST)
  1992.        end --6
  1993.       end --5
  1994.      end --4
  1995.     end --3
  1996.    end --2
  1997.   end --1
  1998. ) --*1
  1999.  
  2000.  elements.property(elem.DEFAULT_PT_YEST, "Update",
  2001.  function(i,x,y,s,nt) --1
  2002.   if math.random(1,50) == 10 then --2
  2003.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  2004.     for r in sim.neighbors(x,y,1,1) do --4
  2005.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --5
  2006.       sim.partChangeType(r, elements.TPT_PT_WYST)
  2007.       sim.partChangeType(i, elements.TPT_PT_WYST)
  2008.       end --5
  2009.      end --4
  2010.     end --3
  2011.    end --2
  2012.   end --1
  2013.   ) --*1
  2014.  
  2015.  
  2016. local algae = elements.allocate("TPT", "ALGAE")
  2017.  elements.element(algae, elements.element(elements.DEFAULT_PT_SOAP))
  2018.  elements.property(algae, "Name" , "ALGE")
  2019.  elements.property(algae, "Description" , "Algae, spreads in water.")
  2020.  elements.property(algae, "Color", 0x407010)
  2021.  elements.property(algae, "Diffusion", 0.3)
  2022.  elements.property(algae, "Weight", 31)
  2023.  elements.property(algae, "MenuSection", 16)
  2024.  elements.property(elem.TPT_PT_ALGAE, "Update", --*1
  2025.  function(i,x,y,s,nt) --1
  2026.   if nt == 8 then --2
  2027.    for r in sim.neighbors(x,y,1,1) do --3
  2028.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
  2029.      if math.random(1,1000) > 1 then --4
  2030.       sim.partProperty(i, "vy", -0.05)
  2031.       end --5
  2032.      if math.random(1,1000) > 1 then --5
  2033.       sim.partProperty(i, "vx", math.random(-0.01,0.01))
  2034.       end --6
  2035.      end --4
  2036.     if math.random(1,250) < 4 then --7
  2037.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2038.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2039.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2040.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
  2041.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
  2042.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
  2043.      end --7
  2044.     if math.random(1,400) < 2 then --8
  2045.      sim.partKill(i)
  2046.      end --8
  2047.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
  2048.      if math.random(1,200) == 1 then --10
  2049.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
  2050.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
  2051.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
  2052.       end --10
  2053.      end --9
  2054.     end --3
  2055.    end --2
  2056.   if math.random(1,400) < 2 then --11
  2057.    sim.partKill(i)
  2058.    end --11
  2059.   end --1
  2060. ) --*1
  2061.  
  2062.  
  2063. local balgae = elements.allocate("TPT", "BALGAE")
  2064.  elements.element(balgae, elements.element(elements.DEFAULT_PT_SOAP))
  2065.  elements.property(balgae, "Name" , "BLGE")
  2066.  elements.property(balgae, "Description" , "Blue Algae, spreads in water.")
  2067.  elements.property(balgae, "Color", 0x107050)
  2068.  elements.property(balgae, "Diffusion", 0.3)
  2069.  elements.property(balgae, "Weight", 31)
  2070.  elements.property(balgae, "MenuSection", 16)
  2071.  
  2072. local galgae = elements.allocate("TPT", "GALGAE")
  2073.  elements.element(galgae, elements.element(elements.DEFAULT_PT_SOAP))
  2074.  elements.property(galgae, "Name" , "GLGE")
  2075.  elements.property(galgae, "Description" , "Green Algae, grows in water.")
  2076.  elements.property(galgae, "Color", 0x209010)
  2077.  elements.property(galgae, "Diffusion", 0.3)
  2078.  elements.property(galgae, "Weight", 31)
  2079.  elements.property(galgae, "MenuSection", 16)
  2080.  elements.property(elem.TPT_PT_GALGAE, "Update", --*1
  2081.  function(i,x,y,s,nt) --1
  2082.   for r in sim.neighbors(x,y,1,20) do --2
  2083.    if (nt > 2) and (nt < 6) then --3 --**DRY**
  2084.     if math.random(1,500) < 2 then --4
  2085.      sim.partKill(i)
  2086.      end --4
  2087.     if math.random(1,1000) < 1000 then --5
  2088.      sim.partProperty(i, "vy", 0)
  2089.      end --5
  2090.    if math.random(1,100) < 100 then --5
  2091.      sim.partProperty(i, "vx", 0)
  2092.      end --5
  2093.     end --3
  2094.    if nt == 8 then --3
  2095.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4 --**WET**
  2096.      if math.random(1,1000) < 1000 then --5
  2097.       sim.partProperty(i, "vy", 0)
  2098.        if math.random(1,5000) < 4 then --6
  2099.        sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
  2100.        sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2101.        end --6
  2102.       end --5
  2103.      if math.random(1,100) < 100 then --7
  2104.       sim.partProperty(i, "vx", 0)
  2105.       end --7
  2106.      end --8
  2107.     if math.random(1,4000) < 2 then --8
  2108.      sim.partKill(i)
  2109.      end --8
  2110.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
  2111.      if math.random(1,200) == 1 then --10
  2112.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
  2113.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
  2114.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
  2115.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
  2116.       end --10
  2117.      end --9
  2118.     end --3
  2119.    end --2
  2120.   if math.random(1,400) < 2 then --11
  2121.    sim.partKill(i)
  2122.    end --11
  2123.   end --1
  2124. ) --*1
  2125.  
  2126.  elements.property(elem.TPT_PT_BALGAE, "Update", --*1
  2127.  function(i,x,y,s,nt) --1
  2128.   if nt == 8 then --2
  2129.    for r in sim.neighbors(x,y,1,1) do --3
  2130.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
  2131.      if math.random(1,1000) > 1 then --4
  2132.       sim.partProperty(i, "vy", -0.05)
  2133.       end --5
  2134.      if math.random(1,1000) > 1 then --5
  2135.       sim.partProperty(i, "vx", math.random(-0.01,0.01))
  2136.       end --6
  2137.      end --4
  2138.     if math.random(1,62) < 4 then --7
  2139.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2140.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2141.      sim.partCreate(-1, math.random(x-4,x+4),math.random(y-2,y+2),elements.TPT_PT_BALGAE)
  2142.      if math.random(1,8000) < 4 then --8
  2143.       sim.partProperty(i, "type", elements.TPT_PT_H2O2)
  2144.       end --8
  2145.      end --7
  2146.     if math.random(1,100) < 2 then --9
  2147.      sim.partKill(i)
  2148.      end --9
  2149.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --10
  2150.      if math.random(1,200) == 1 then --11
  2151.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
  2152.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
  2153.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
  2154.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_H2O2)
  2155.       sim.partCreate(-1, math.random(x-2,x+2),math.random(y-2,y+2),elements.TPT_PT_GALGAE)
  2156.       end --11
  2157.      end --10
  2158.     end --3
  2159.    end --2
  2160.   if math.random(1,400) < 2 then --11
  2161.    sim.partKill(i)
  2162.    end --11
  2163.   end --1
  2164. ) --*1
  2165.  
  2166. local ralgae = elements.allocate("TPT", "RALGAE")
  2167.  elements.element(ralgae, elements.element(elements.DEFAULT_PT_SOAP))
  2168.  elements.property(ralgae, "Name" , "RLGE")
  2169.  elements.property(ralgae, "Description" , "Red Algae, grows in water.")
  2170.  elements.property(ralgae, "Color", 0x802010)
  2171.  elements.property(ralgae, "Diffusion", 0.3)
  2172.  elements.property(ralgae, "Weight", 31)
  2173.  elements.property(ralgae, "MenuSection", 16)
  2174.  elements.property(elem.TPT_PT_RALGAE, "Update", --*1
  2175.  function(i,x,y,s,nt) --1
  2176.   if nt == 8 then --2
  2177.    for r in sim.neighbors(x,y,1,1) do --3
  2178.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
  2179.      if math.random(1,1000) > 1 then --4
  2180.       sim.partProperty(i, "vy", -0.25)
  2181.       end --5
  2182.      if math.random(1,1000) > 1 then --5
  2183.       sim.partProperty(i, "vx", math.random(-0.4,0.4))
  2184.       end --6
  2185.      end --4
  2186.     if math.random(1,5000) < 4 then --7
  2187.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
  2188.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
  2189.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2190.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2191.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
  2192.      end --7
  2193.     if math.random(1,900) < 2 then --8
  2194.      sim.partKill(i)
  2195.      end --8
  2196.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
  2197.      if math.random(1,4000) == 1 then --10
  2198.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
  2199.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
  2200.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
  2201.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
  2202.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
  2203.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
  2204.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
  2205.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
  2206.       end --10
  2207.      end --9
  2208.     end --3
  2209.    end --2
  2210.   if math.random(1,400) < 2 then --11
  2211.    sim.partKill(i)
  2212.    end --11
  2213.   end --1
  2214. ) --*1
  2215.  
  2216. local qgp = elements.allocate("TPT" , "QGP")
  2217.  elements.element(qgp, elements.element(elements.DEFAULT_PT_WTRV))
  2218.  elements.property(qgp, "Name" , "QGP")
  2219.  elements.property(qgp, "Description" , "Quark-Gluon Plasma,")
  2220.  elements.property(qgp, "Color", 0x06FF18)
  2221.  elements.property(qgp, "PhotonReflectWavelengths", 0x00008000)
  2222.  elements.property(qgp, "MenuSection", 10)
  2223.  elements.property(qgp, "Diffusion", 0.035)
  2224.  elements.property(qgp, "Flammable", 0)
  2225.  elements.property(qgp, "Loss", -1.0175)
  2226.  elements.property(qgp, "LowTemperature", -256)
  2227. elements.property(elements.TPT_PT_QGP, "Update", --*1
  2228.  function(i,x,y,s,nt) --1
  2229.   if sim.partProperty(i, "life") == 0 then --2
  2230.    sim.partProperty(i, "life", 1000)
  2231.    end --2
  2232.   if sim.partProperty(i, "life") > 0 then --3
  2233.    sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  2234.    end --3
  2235.   attract(i,x,y,math.random(-0.1,0.1))
  2236.   sim.partProperty(i, "temp", sim.partProperty(i, "temp")*1.025)
  2237.   if sim.partProperty(i, "life") == 1 and math.random(0,63) == 0 then --4
  2238.    sim.partKill(i)
  2239.    end --4
  2240.   if math.random(0,500) == 0 then --5
  2241.    sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RADI)
  2242.    end --5
  2243.   if math.random(0,50000) == 0 then --6
  2244.    sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PROT)
  2245.    sim.partKill(i)
  2246.    end --6
  2247.   if math.random(0,5000) == 0 then --7
  2248.    sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_NEUT)
  2249.    sim.partKill(i)
  2250.    end --7
  2251.   end --1
  2252. ) --*1
  2253.  
  2254. local plig = elements.allocate("TPT" , "PLIG")
  2255.  elements.element(plig, elements.element(elements.DEFAULT_PT_WTRV))
  2256.  elements.property(plig, "Name" , "PLIG")
  2257.  elements.property(plig, "Description" , "Pulverized Lightning")
  2258.  elements.property(plig, "Color", 0xE6F0FF)
  2259.  elements.property(plig, "PhotonReflectWavelengths", 0x00008000)
  2260.  elements.property(plig, "MenuSection", 10)
  2261.  elements.property(plig, "Diffusion", 0.035)
  2262.  elements.property(plig, "Flammable", 0)
  2263.  elements.property(plig, "Falldown", 1)
  2264.  elements.property(plig, "Loss", 0.6)
  2265.  elements.property(plig, "LowTemperature", -256)
  2266. elements.property(elements.TPT_PT_PLIG, "Update", --*1
  2267.  function(i,x,y,s,nt) --1
  2268.   for r in sim.neighbors(x,y,1,1) do --2
  2269.    if math.random(0,15) == 0 then --3
  2270.     sim.partKill(i)
  2271.     end --3
  2272.    if math.random(0,499) == 0 then --4
  2273.     sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_ELEC)
  2274.     end --4
  2275.    end --2
  2276.   end --1
  2277. ) --*1
  2278.  
  2279.  
  2280.  local function funcGraphics(i, colr, colg, colb) --*1
  2281.   return 0,ren.FIRE_ADD,255,colr,colg,colb,(sim.partProperty(i, "temp")-273.15)/5.84+75,128+96-(sim.partProperty(i, "temp")-273.15)/28.4+1,math.random(1,256),(sim.partProperty(i, "temp")-273.15)/28.4+1+24
  2282.   end --*1
  2283.  elements.property(qgp, "Graphics", funcGraphics)
  2284.  
  2285.  local function funcGraphics(i, colr, colg, colb) --*1
  2286.   return 0,ren.FIRE_ADD,255,colr,colg,colb,127,230,240,255
  2287.   end --*1
  2288.  elements.property(plig, "Graphics", funcGraphics)
  2289.  
  2290.  elements.property(elements.DEFAULT_PT_NEUT, "HighTemperature", 9000)
  2291.  elements.property(elements.DEFAULT_PT_NEUT, "HighTemperatureTransition", elements.TPT_PT_QGP)
  2292.  elements.property(elements.DEFAULT_PT_NEUT, "LowPressure", -200)
  2293.  elements.property(elements.DEFAULT_PT_NEUT, "LowPressureTransition", elements.TPT_PT_QGP)
  2294.  elements.property(elements.DEFAULT_PT_PROT, "HighTemperature", 9999)
  2295.  elements.property(elements.DEFAULT_PT_PROT, "HighTemperatureTransition", elements.TPT_PT_QGP)
  2296.  
  2297. local lno2 = elements.allocate("TPT" , "LNO2")
  2298.  elements.element(lno2, elements.element(elements.DEFAULT_PT_LOXY))
  2299.  elements.property(lno2, "Name" , "LNO2")
  2300.  elements.property(lno2, "Description" , "Liquid Nitrogen Dioxide, explosive.")
  2301.  elements.property(lno2, "Color", 0xD58C4A)
  2302.  elements.property(lno2, "Gravity", 0.3)
  2303.  elements.property(lno2, "Temperature", 290.15)
  2304.  elements.property(lno2, "MenuSection", 5)
  2305.  elements.property(lno2, "Flammable", 3)
  2306.  elements.property(lno2, "HeatConduct", 16)
  2307.  
  2308. local no2 = elements.allocate("TPT" , "NO2")
  2309.  elements.element(no2, elements.element(elements.DEFAULT_PT_HYGN))
  2310.  elements.property(no2, "Name" , "NO2")
  2311.  elements.property(no2, "Description" , "Nitrogen Dioxide, reacts with water to form nitric acid.")
  2312.  elements.property(no2, "Color", 0xB54C2A)
  2313.  elements.property(no2, "Gravity", 0.3)
  2314.  elements.property(no2, "Falldown", 2)
  2315.  elements.property(no2, "PhotonReflectWavelengths", 0x100000000000)
  2316.  elements.property(no2, "MenuSection", 6)
  2317.  elements.property(no2, "Flammable", 10)
  2318.  elements.property(no2, "LowTemperature", 293.15)
  2319.  elements.property(no2, "LowTemperatureTransition", elements.TPT_PT_LNO2)
  2320.  
  2321.  elements.property(lno2, "HighTemperature", 294.3)
  2322.  elements.property(lno2, "HighTemperatureTransition", elements.TPT_PT_NO2)
  2323.  
  2324. local hno3 = elements.allocate("TPT", "HNO3")
  2325.  elements.element(hno3, elements.element(elements.DEFAULT_PT_SOAP))
  2326.  elements.property(hno3, "Name" , "HNO3")
  2327.  elements.property(hno3, "Description" , "Nitric acid, corrosive, releases deadly gasses.")
  2328.  elements.property(hno3, "Color", 0x6991B5)
  2329.  elements.property(hno3, "Hardness", 0)
  2330.  elements.property(hno3, "Flammable", 500)
  2331.  elements.property(hno3, "Weight", 30)
  2332.  elements.property(elem.TPT_PT_HNO3, "Update", --*1
  2333.  function(i,x,y,s,nt) --1
  2334.  sim.partProperty(i, "tmp", 2)
  2335.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2336.    if math.random(1,100) == 10 then --3
  2337.     for r in sim.neighbors(x,y,1,1) do --4
  2338.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  2339.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  2340.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  2341.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  2342.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  2343.           if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_GLAS then --10
  2344.            if sim.partProperty(r, "type") ~= elements.TPT_PT_BRAU then --11
  2345.             if math.random(1,20) == 1 then --12
  2346.              if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_GOLD then --13
  2347.               sim.partProperty(r, "type", elements.TPT_PT_NO2)
  2348.               sim.partProperty(i, "temp", sim.partProperty(i, "temp")+300)
  2349.               sim.partProperty(i, "tmp", sim.partProperty(i, "tmp")+1)
  2350.               end --13
  2351.              if sim.partProperty(r, "type") == elements.DEFAULT_PT_GOLD then --14
  2352.               sim.pressure(x/4,y/4,2)
  2353.               sim.partProperty(r, "type", elements.TPT_PT_BRAU)
  2354.               sim.partProperty(i, "tmp", sim.partProperty(i, "tmp")+1)
  2355.               if math.random(1,10) == 1 then --15
  2356.                sim.partProperty(i, "type", elements.TPT_PT_NO2)
  2357.                return
  2358.                end --15
  2359.               end --14
  2360.              end --12
  2361.             end --11
  2362.            end --10
  2363.           end --9
  2364.          end --8
  2365.         end --7
  2366.        end --6
  2367.       end --5
  2368.      end --4
  2369.     end --3
  2370.    end --2
  2371.   end --1
  2372.   ) --*1
  2373.  
  2374.  local function funcGraphics2(i, colr, colg, colb) --*1
  2375.   return 0,ren.PMODE_FLAT,255,colr,colg,colb,255,105+sim.partProperty(i, "tmp")*8-1,145,181
  2376.   end --*1
  2377.  elements.property(hno3, "Graphics", funcGraphics2)
  2378.  
  2379.  elements.property(elem.TPT_PT_NO2, "Update", --*1
  2380.  function(i,x,y,s,nt) --1
  2381.   if math.random(1,2) == 2 then --2
  2382.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  2383.     for r in sim.neighbors(x,y,1,1) do --4
  2384.      if sim.partProperty(i, "tmp") == 0 then --5
  2385.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --6
  2386.        sim.partProperty(i, "tmp", -1)
  2387.        end --6
  2388.       end --5
  2389.      if sim.partProperty(i, "tmp") == -1 then --7
  2390.       if math.random(1,2) == 1 then --8
  2391.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_HNO3)
  2392.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+20)
  2393.        if math.random(1,2) == 1 then --9
  2394.         sim.partKill(i)
  2395.         return
  2396.         end --9
  2397.        end --8
  2398.       end --7
  2399.      end --4
  2400.     end --3
  2401.    end --2
  2402.   end --1
  2403.   ) --*1
  2404.  
  2405. local brau = elements.allocate("TPT" , "BRAU")
  2406.  elements.element(brau, elements.element(elements.DEFAULT_PT_EQVE))
  2407.  elements.property(brau, "Name" , "BRAU")
  2408.  elements.property(brau, "Description" , "Broken Gold.")
  2409.  elements.property(brau, "Color", 0xB98C33)
  2410.  elements.property(brau, "HighTemperature", 1337.0)
  2411.  elements.property(brau, "HighTemperatureTransition", elements.DEFAULT_PT_GOLD)
  2412.  elements.property(brau, "MenuSection", 16)
  2413.  elements.property(brau, "Flammable", 0)
  2414.  
  2415.  elements.property(elements.DEFAULT_PT_GOLD, "HighPressure", 10)
  2416.  elements.property(elements.DEFAULT_PT_GOLD, "HighPressureTransition", elements.TPT_PT_BRAU)
  2417.  
  2418. local rad = elements.allocate("TPT", "RADON")
  2419.  elements.element(rad, elements.element(elements.DEFAULT_PT_WTRV))
  2420.  elements.property(rad, "Name" , "RADN")
  2421.  elements.property(rad, "Description" , "Radon, screws up electronics and kills organic matter.")
  2422.  elements.property(rad, "Color", 0xD8D8C0)
  2423.  elements.property(rad, "MenuSection", 16)
  2424.  elements.property(rad, "LowTemperature", -1)
  2425.  elements.property(elem.TPT_PT_RADON, "Update", --*1
  2426.  function(i,x,y,s,nt) --1
  2427.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2428.    if math.random(1,100) == 10 then --3
  2429.     for r in sim.neighbors(x,y,1,1) do --4
  2430.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_YEST then --5
  2431.       if math.random(1,2) == 2 then --6
  2432.        sim.partKill(r)
  2433.        end --6
  2434.       end --5
  2435.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT then --7
  2436.       if math.random(1,2) == 2 then --8
  2437.        sim.partKill(r)
  2438.        end --8
  2439.       end --7
  2440.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --9
  2441.       if math.random(1,5) == 5 then --10
  2442.        sim.partKill(r)
  2443.        end --10
  2444.       end --9
  2445.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_STKM then --11
  2446.       if math.random(1,2) == 2 then --12
  2447.        sim.partKill(r)
  2448.        end --12
  2449.       end --11
  2450.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIGH then --13
  2451.       if math.random(1,2) == 2 then --14
  2452.        sim.partKill(r)
  2453.        end --14
  2454.       end --13
  2455.      if sim.partProperty(r, "type") == elements.TPT_PT_BCTR then --15
  2456.       if math.random(1,2) == 2 then --16
  2457.        sim.partKill(r)
  2458.        end --14
  2459.       end --13
  2460.      if sim.partProperty(r, "type") == elements.TPT_PT_ALGAE then --17
  2461.       if math.random(1,2) == 2 then --18
  2462.        sim.partKill(r)
  2463.        end --14
  2464.       end --13
  2465.      if sim.partProperty(r, "type") == elements.TPT_PT_GALGAE then --19
  2466.       if math.random(1,2) == 2 then --20
  2467.        sim.partKill(r)
  2468.        end --14
  2469.       end --13
  2470.      if sim.partProperty(r, "type") == elements.TPT_PT_BALGAE then --21
  2471.       if math.random(1,2) == 2 then --22
  2472.        sim.partKill(r)
  2473.        end --14
  2474.       end --13
  2475.      if sim.partProperty(r, "type") == elements.TPT_PT_BCTRC then --23
  2476.       if math.random(1,2) == 2 then --24
  2477.        sim.partKill(r)
  2478.        end --14
  2479.       end --13
  2480.      if sim.partProperty(r, "type") == elements.TPT_PT_BCTRP then --25
  2481.       if math.random(1,2) == 2 then --26
  2482.        sim.partKill(r)
  2483.        end --14
  2484.       end --13
  2485.      if sim.partProperty(r, "type") == elements.TPT_PT_BCTRD then --27
  2486.       if math.random(1,2) == 3 then --28
  2487.        sim.partKill(r)
  2488.        end --14
  2489.       end --13
  2490.      if sim.partProperty(r, "type") == elements.TPT_PT_BCTRA then --29
  2491.       if math.random(1,3) == 3 then --30
  2492.        sim.partKill(r)
  2493.        end --14
  2494.       end --13
  2495.      end --4
  2496.     end --3
  2497.    end --2
  2498.   radiate(i,x,y,250,25)
  2499.   end --1
  2500.   ) --*1
  2501.  
  2502. --[[ kinda breaks alot of water mechanics, add it in yourself at your own risk
  2503. local stea = elements.allocate("TPT", "STEAM")
  2504.  elements.element(stea, elements.element(elements.DEFAULT_PT_WTRV))
  2505.  elements.property(stea, "Name" , "STEA")
  2506.  elements.property(stea, "Description" , "Steam.")
  2507.  elements.property(stea, "Color", 0xC2C6CA)
  2508.  elements.property(stea, "MenuSection", 16)
  2509.  elements.property(stea, "HotAir", 0.001)
  2510.  elements.property(stea, "AirDrag", 0.015)
  2511.  elements.property(stea, "Loss", 0.2)
  2512.  elements.property(stea, "LowTemperature", 372.15)
  2513.  elements.property(stea, "Diffusion", 0.25)
  2514.  elements.property(stea, "LowTemperatureTransition", elements.DEFAULT_PT_WTRV)
  2515.  elements.property(elem.TPT_PT_STEAM, "Update", --*1
  2516.  function(i,x,y,s,nt) --1
  2517.   if s > 2 then --2
  2518.    if math.random(0,65535) == 0 then --3
  2519.     sim.partProperty(i, "type", elements.DEFAULT_PT_WTRV)
  2520.     end --3
  2521.    end --2
  2522.   end --1
  2523.   ) --*1
  2524.  
  2525.  elements.property(elements.DEFAULT_PT_WTRV, "HighTemperature", 402.15)
  2526.  elements.property(elements.DEFAULT_PT_WTRV, "HighTemperatureTransition", elements.TPT_PT_STEAM)
  2527.  
  2528.  elements.property(stea, "Graphics",
  2529. function(i, colr, colg, colb) --1
  2530.   return 1,ren.FIRE_BLEND,255,colr,colg,colb,8,128,128,128
  2531.   end --1
  2532. ) --*1
  2533.  
  2534. --]]
  2535.  
  2536. local sball = elements.allocate("TPT" , "SBALL")
  2537.  elements.element(sball, elements.element(elements.DEFAULT_PT_CNCT))
  2538.  elements.property(sball, "Name" , "SBAL")
  2539.  elements.property(sball, "Description" , "Super Bouncy Ball from the old Dan-Ball powder game.")
  2540.  elements.property(sball, "Color", 0xF73C9E)
  2541.  elements.property(sball, "Falldown", 1)
  2542.  elements.property(sball, "PhotonReflectWavelengths", 0x20000100)
  2543.  elements.property(sball, "Collision", -1)
  2544.  elements.property(sball, "Gravity", 0.2)
  2545.  elements.property(sball, "Flammable", 2)
  2546.  elements.property(sball, "HighTemperature", 10001.00)
  2547.  elements.property(sball, "AirDrag", 0.0001)
  2548.  elements.property(sball, "Advection", 0.01)
  2549.  elements.property(sball, "Loss", 0.99)
  2550.  elements.property(sball, "Weight", 60)
  2551.  elements.property(sball, "Update", NULL)
  2552.  
  2553. local after = elements.allocate("TPT" , "AFTER")
  2554.  elements.element(after, elements.element(elements.DEFAULT_PT_DMND))
  2555.  elements.property(after, "Name" , "!!!")
  2556.  elements.property(after, "Description" , "Destroyed matter.")
  2557.  elements.property(after, "Color", 0xFF0000)
  2558.  elements.property(after, "Falldown", 1)
  2559.  elements.property(after, "PhotonReflectWavelengths", 0x20000001)
  2560.  elements.property(elem.TPT_PT_AFTER, "Update", --*1
  2561.  function(i,x,y) --1
  2562.   if sim.partProperty(i, "tmp") == 1 or sim.partProperty(i, "tmp") == 0 then --2
  2563.    sim.partProperty(i, "life", 15)
  2564.    sim.partProperty(i, "tmp", -1)
  2565.    end --2
  2566.   if math.random(0,31) == 0 then --2
  2567.    if sim.partProperty(i, "life") < 1 then --3
  2568.     sim.partKill(i)
  2569.     return
  2570.     end --3
  2571.    end --2
  2572.   sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  2573.   end --1
  2574. ) --*1
  2575.  
  2576. local nuke = elements.allocate("TPT" , "NUKE")
  2577.  elements.element(nuke, elements.element(elements.DEFAULT_PT_DMND))
  2578.  elements.property(nuke, "Name" , "???")
  2579.  elements.property(nuke, "Description" , "Destroys everything.")
  2580.  elements.property(nuke, "Color", 0xFF00FF)
  2581.  elements.property(nuke, "Falldown", 1)
  2582.  elements.property(nuke, "PhotonReflectWavelengths", 0x20000001)
  2583.  elements.property(nuke, "HighTemperature", 10001.00)
  2584.  elements.property(elem.TPT_PT_NUKE, "Update", --*1
  2585.  function(i,x,y,s,nt) --1
  2586.   if s >= 0 then --2
  2587.    if math.random(0,1) == 1 then --3
  2588.     for r in sim.neighbors(x,y,1,1) do --4
  2589.      if sim.partProperty(r, "type") ~= elements.TPT_PT_AFTER then --5
  2590.       if math.random(0,1) == 1 then --6
  2591.        sim.partProperty(r, "type", elements.TPT_PT_NUKE)
  2592.        end --6
  2593.       end --5
  2594.      end --4
  2595.     end --3
  2596.   if sim.partProperty(i, "tmp") == 0 then --7
  2597.    sim.partProperty(i, "life", 3)
  2598.    sim.partProperty(i, "tmp", 1)
  2599.    end --7
  2600.    if sim.partProperty(i, "life") < 1 then --8
  2601.     sim.partProperty(i, "type", elements.TPT_PT_AFTER)
  2602.     end --8
  2603.    sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_NUKE)
  2604.    end --2
  2605.   sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  2606.   sim.partProperty(i, "temp", sim.partProperty(i, "temp")+646.99)
  2607.   sim.pressure(x/4,y/4,0)
  2608.   end --1
  2609. ) --*1
  2610.  
  2611. local infc = elements.allocate("TPT" , "INFC")
  2612.  elements.element(infc, elements.element(elements.DEFAULT_PT_DMND))
  2613.  elements.property(infc, "Name" , "INFC")
  2614.  elements.property(infc, "Description" , "Infection.")
  2615.  elements.property(infc, "Color", 0x800080)
  2616.  elements.property(infc, "Falldown", 1)
  2617.  elements.property(infc, "PhotonReflectWavelengths", 0x20000001)
  2618.  elements.property(infc, "HighTemperature", 10001.00)
  2619.  elements.property(infc, "Diffusion", 0.1)
  2620.  elements.property(infc, "Loss", 0.5)
  2621.  elements.property(elem.TPT_PT_INFC, "Update", --*1
  2622.  function(i,x,y,s,nt) --1
  2623.   if s >= 0 then --2
  2624.    if math.random(0,15) == 1 then --3
  2625.     for r in sim.neighbors(x,y,1,1) do --4
  2626.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND and sim.partProperty(r, "type") ~= elements.TPT_PT_AFTER then --5
  2627.       if sim.partProperty(r, "type") ~= elements.TPT_PT_DMDD and sim.partProperty(r, "type") ~= elements.DEFAULT_PT_NEUT then ---6
  2628.        if math.random(0,7) == 0 then --7
  2629.         sim.partProperty(r, "type", elements.TPT_PT_INFC)
  2630.        else
  2631.         sim.partKill(i)
  2632.         return
  2633.         end --7
  2634.        end --6
  2635.       end --5
  2636.      end --4
  2637.     end --3
  2638.   if sim.partProperty(i, "tmp") == 0 then --7
  2639.    sim.partProperty(i, "life", 3)
  2640.    sim.partProperty(i, "tmp", 1)
  2641.    end --7
  2642.    if sim.partProperty(i, "life") < 1 then --8
  2643.     sim.partProperty(i, "type", elements.TPT_PT_AFTER)
  2644.     end --8
  2645.    sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_INFC)
  2646.    end --2
  2647.   if math.random(0,2) > 0 then --9
  2648.    sim.partKill(i)
  2649.    end --9
  2650.   end --1
  2651. ) --*1
  2652.  
  2653.  elements.property(infc, "Graphics",
  2654. function(i, colr, colg, colb) --1
  2655.   return 1,ren.PMODE_GLOW,255,colr,colg,colb,255,127,0,127
  2656.   end --1
  2657. ) --*1
  2658.  
  2659. local clar = elements.allocate("TPT" , "CLEAR")
  2660.  elements.element(clar, elements.element(elements.DEFAULT_PT_DMND))
  2661.  elements.property(clar, "Name" , "CLAR")
  2662.  elements.property(clar, "Description" , "Fully Transparent")
  2663.  elements.property(clar, "Color", 0x000000)
  2664.  elements.property(clar, "PhotonReflectWavelengths", 0x00000000)
  2665.  elements.property(clar, "Graphics",
  2666. function(i, colr, colg, colb) --1
  2667.   return 1,ren.PMODE_ADD,0,colr,colg,colb,0,0,0,1280
  2668.   end --1
  2669. ) --*1
  2670.  
  2671.  
  2672. local d38 = elements.allocate("TPT" , "D38")
  2673.  elements.element(d38, elements.element(elements.DEFAULT_PT_IRON))
  2674.  elements.property(d38, "Name" , "D38")
  2675.  elements.property(d38, "Description" , "Depleted uranium. Neutron reflector.")
  2676.  elements.property(d38, "Color", 0xD0E0C0)
  2677.  elements.property(d38, "Hardness", 0)
  2678.  elements.property(d38, "HighTemperature", 1405)
  2679.  elements.property(elem.TPT_PT_D38, "Update", --*1
  2680.  function(i,x,y,s,nt) --1
  2681.   for r in sim.neighbors(x,y,1,1) do --2
  2682.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_NEUT then --3
  2683.     if math.random(0,7) == 0 then --4
  2684.      sim.partCreate(-1, math.random(-1,1)+x, math.random(-1,1)+y, elements.DEFAULT_PT_NEUT)
  2685.      sim.partProperty(i, "temp", sim.partProperty(i, "temp")+50)
  2686.      sim.partProperty(r, "life", sim.partProperty(r, "life")+500)
  2687.      sim.pressure(x/4,y/4,1)
  2688.      end --4
  2689.     end --3
  2690.    end --2
  2691.   end --1
  2692. ) --*1
  2693.  
  2694.  elements.property(elem.DEFAULT_PT_COAL, "HeatConduct", 64)
  2695.  
  2696.  elements.property(elem.DEFAULT_PT_WOOD, "Flammable", 3)
  2697.  elements.property(elem.DEFAULT_PT_WOOD, "HeatConduct", 196)
  2698.  elements.property(elem.DEFAULT_PT_WOOD, "Update", --*1
  2699.  function(i,x,y,s,nt) --1
  2700.   if s > 2 then --2
  2701.    if sim.partProperty(i, "temp") > 550 then --3
  2702.     if math.random(0,63) == 0 then --4
  2703.      sim.partProperty(i, "life", 110)
  2704.      sim.partProperty(i, "type", elements.DEFAULT_PT_COAL)
  2705.      end --4
  2706.     end --3
  2707.    end --2
  2708.   if s < 2 then --5
  2709.    if sim.partProperty(i, "temp") > 550 then --6
  2710.     if math.random(0,1023) == 0 then --7
  2711.      sim.partProperty(i, "life", 110)
  2712.      sim.partProperty(i, "type", elements.DEFAULT_PT_COAL)
  2713.      end --7
  2714.     end --6
  2715.    end --5
  2716.   end --1
  2717.   ) --*1
  2718.  
  2719. local vdlq = elements.allocate("TPT", "VDLQ")
  2720.  elements.element(vdlq, elements.element(elements.DEFAULT_PT_SOAP))
  2721.  elements.property(vdlq, "Name" , "VDLQ")
  2722.  elements.property(vdlq, "Description" , "Void Liquid. Sludge of death. Consumes.")
  2723.  elements.property(vdlq, "Color", 0x080808)
  2724.  elements.property(vdlq, "Advection", 0.01)
  2725.  elements.property(vdlq, "Weight", 100)
  2726.  elements.property(vdlq, "Hardness", 0)
  2727.  elements.property(vdlq, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  2728.  elements.property(elem.TPT_PT_VDLQ, "Update", --*1
  2729.  function(i,x,y,s,nt) --1
  2730.   attract(i,x,y,0.05)
  2731.   sim.partProperty(i, "life", 96)
  2732.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2733.    if math.random(0,7) == 0 then --3
  2734.     for r in sim.neighbors(x,y,1,1) do --4
  2735.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  2736.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  2737.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  2738.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  2739.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  2740.           if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
  2741.            if math.random(1,3) == 1 then --11
  2742.             sim.partKill(r)
  2743.             if math.random(0,3) == 0 then --12
  2744.              sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+1)*-1.5)
  2745.              velocity_2(i,math.random(-0.1,5),math.random(4,6))
  2746.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
  2747.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
  2748.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
  2749.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
  2750.              return
  2751.              end --12
  2752.             end --11
  2753.            end --10
  2754.           end --9
  2755.          end --8
  2756.         end --7
  2757.        end --6
  2758.       end --5
  2759.      end --4
  2760.     end --3
  2761.    end --2
  2762.   if s > 6 then --13
  2763.    if math.random(0,63) == 0 then --14
  2764.     sim.partKill(i)
  2765.     return
  2766.     end --14
  2767.    end --13
  2768.   end --1
  2769.   ) --*1
  2770.  
  2771.  elements.property(vdlq, "Graphics",
  2772. function(i, colr, colg, colb) --1
  2773.   if math.random(0,15) == 0 then --2
  2774.    return 0,ren.PMODE_SPARK,255,colr,colg,colb,63,255,255,255
  2775.    else
  2776.    return 0,ren.PMODE_ADD,255,colr,colg,colb,127,8,8,8
  2777.    end --2
  2778.   end --1
  2779. ) --*1
  2780.  
  2781. local star = elements.allocate("TPT", "STAR")
  2782.  elements.element(star, elements.element(elements.DEFAULT_PT_SOAP))
  2783.  elements.property(star, "Name" , "STAR")
  2784.  elements.property(star, "Description" , "Star matter. Ultra Sludge of death. Perpetual nuke.")
  2785.  elements.property(star, "Color", 0xFFFFEE)
  2786.  elements.property(star, "Advection", 0.05)
  2787.  elements.property(star, "Gravity", 0.0)
  2788.  elements.property(star, "Weight", 100)
  2789.  elements.property(star, "Hardness", 0)
  2790.  elements.property(star, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  2791.  elements.property(elem.TPT_PT_STAR, "Update", --*1
  2792.  function(i,x,y,s,nt) --1
  2793.   attract(i,x,y,0.05)
  2794.   sim.partProperty(i, "life", 96)
  2795.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2796.    if math.random(0,7) == 0 then --3
  2797.     for r in sim.neighbors(x,y,1,1) do --4
  2798.      if math.random(0,63) == 1 then --5
  2799.       sim.partKill(r)
  2800.       if math.random(0,63) == 0 then --6
  2801.        sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+1)*1.5)
  2802.        velocity_2(i,math.random(2,6),math.random(16,9))
  2803.        sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_HYGN)
  2804.        sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  2805.        sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_HE)
  2806.        sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_STAR)
  2807.        end --6
  2808.       end --5
  2809.      end --4
  2810.     end --3
  2811.    end --2
  2812.   if s > 6 then --7
  2813.    if math.random(0,63) == 0 then --8
  2814.     sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  2815.     sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  2816.     sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  2817.     sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  2818.     sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_THDR)
  2819.     sim.partKill(i)
  2820.     return
  2821.     end --7
  2822.    end --8
  2823.   end --1
  2824.   ) --*1
  2825.  
  2826.  elements.property(vdlq, "Graphics",
  2827. function(i, colr, colg, colb) --1
  2828.   if math.random(0,15) == 0 then --2
  2829.    return 0,ren.PMODE_SPARK,255,colr,colg,colb,63,255,255,238
  2830.    else
  2831.    return 0,ren.PMODE_ADD,255,colr,colg,colb,250,255,255,238
  2832.    end --2
  2833.   end --1
  2834. ) --*1
  2835.  
  2836.  
  2837. local alch = elements.allocate("TPT", "ETHA")
  2838.  elements.element(alch, elements.element(elements.DEFAULT_PT_SOAP))
  2839.  elements.property(alch, "Name" , "ALCH")
  2840.  elements.property(alch, "Description" , "99% Ethanol, mildly flammable.")
  2841.  elements.property(alch, "Color", 0x2870D8)
  2842.  elements.property(alch, "Weight", 29)
  2843.  
  2844. local alcv = elements.allocate("TPT", "ETHV")
  2845.  elements.element(alcv, elements.element(elements.DEFAULT_PT_HYGN))
  2846.  elements.property(alcv, "Name" , "ALCV")
  2847.  elements.property(alcv, "Description", "Alcohol Vapor, inhale if you dare, it burns.")
  2848.  elements.property(alcv, "Color", 0x2068D0)
  2849.  elements.property(alcv, "Diffusion", 1.5)
  2850.  elements.property(alcv, "Gravity", -0.3)
  2851.  elements.property(alcv, "Flammable", 0)
  2852.  elements.property(alcv, "LowTemperature", 351.5)
  2853.  elements.property(alcv, "LowTemperatureTransition", elem.TPT_PT_ETHA)
  2854.  elements.property(alcv, "MenuSection", 16)
  2855.  
  2856.  elements.property(elem.TPT_PT_ETHA, "Update", --*1
  2857. function(i,x,y,s) --1
  2858.   if math.random(0,15) == 0 then --2
  2859.    if sim.partProperty(i, "temp") > 351.5 then --3
  2860.     if math.random(0,1) == 0 then --4
  2861.      sim.partKill(i)
  2862.      else
  2863.      sim.partProperty(i, "type", elements.TPT_PT_ETHV)
  2864.      return
  2865.      end --4
  2866.     end --3
  2867.    end --2
  2868.   end --1
  2869.   ) --*1
  2870.  
  2871. local form = elements.allocate("TPT", "ACET")
  2872.  elements.element(form, elements.element(elements.DEFAULT_PT_HYGN))
  2873.  elements.property(form, "Name" , "ACET")
  2874.  elements.property(form, "Description", "Acetaldehyde. Toxic.")
  2875.  elements.property(form, "Color", 0xDF972F)
  2876.  elements.property(form, "Diffusion", 1.5)
  2877.  elements.property(form, "Gravity", 0.01)
  2878.  elements.property(form, "Flammable", 0)
  2879.  elements.property(form, "MenuSection", 16)
  2880.  
  2881. local lfrm = elements.allocate("TPT", "DISF")
  2882.  elements.element(lfrm, elements.element(elements.DEFAULT_PT_SOAP))
  2883.  elements.property(lfrm, "Name" , "LAET")
  2884.  elements.property(lfrm, "Description", "Liquid Acetaldehyde. Disinfectant")
  2885.  elements.property(lfrm, "Color", 0xEFA73F)
  2886.  elements.property(lfrm, "Diffusion", 0.1)
  2887.  elements.property(lfrm, "Weight", 10)
  2888.  elements.property(lfrm, "Flammable", 0)
  2889.  elements.property(lfrm, "HighTemperature", 293.15)
  2890.  elements.property(lfrm, "HighTemperatureTransition", elements.TPT_PT_ACET)
  2891.  elements.property(lfrm, "MenuSection", 16)
  2892.  
  2893.  elements.property(form, "LowTemperature", 293.00)
  2894.  elements.property(form, "LowTemperatureTransition", elements.TPT_PT_DISF)
  2895.  
  2896.  elements.property(elem.TPT_PT_DISF, "Update", --*1
  2897.  function(i,x,y,s,nt) --1
  2898.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2899.    if math.random(0,1) == 1 then --3
  2900.     for r in sim.neighbors(x,y,3,3) do --4
  2901.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRD or sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRA or sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRP or sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRC then --5
  2902.       if math.random(0,1) == 0 then --6
  2903.        sim.partProperty(r, "type", elements.DEFAULT_PT_OIL)
  2904.        sim.partProperty(r, "temp", sim.partProperty(i, "temp")-0.1)
  2905.        if math.random(0,255) == 0 then --7
  2906.         sim.pressure(x/4,y/4,0.1)
  2907.         sim.partProperty(i, "type", elements.TPT_PT_ACET)
  2908.         return
  2909.         end --7
  2910.        end --6
  2911.       end --5
  2912.      end --4
  2913.     end --3
  2914.    end --2
  2915.   end --1
  2916.   ) --*1
  2917.  
  2918.  elements.property(elem.TPT_PT_ACET, "Update", --*1
  2919.  function(i,x,y,s,nt) --1
  2920.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2921.    if math.random(0,15) == 1 then --3
  2922.     for r in sim.neighbors(x,y,4,4) do --4
  2923.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRD or sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRA or sim.partProperty(r, "type") == elements.DEFAULT_PT_BCTRP then --5
  2924.       if math.random(0,1) == 0 then --6
  2925.        sim.partProperty(r, "type", elements.DEFAULT_PT_OIL)
  2926.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-2.5)
  2927.        if math.random(0,255) == 0 then --7
  2928.         sim.pressure(x/4,y/4,0.01)
  2929.         return
  2930.         end --7
  2931.        end --6
  2932.       end --5
  2933.      if sim.partProperty(r, "type") == elements.TPT_PT_BCTR then --8
  2934.       if math.random(0,0) == 0 then --9
  2935.        sim.partKill(r)
  2936.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-0.1)
  2937.        if math.random(0,255) == 0 then --10
  2938.         sim.pressure(x/4,y/4,0.01)
  2939.         return
  2940.         end --7
  2941.        end --6
  2942.       end --5
  2943.      end --4
  2944.     end --3
  2945.    end --2
  2946.   end --1
  2947.   ) --*1
  2948.  
  2949.  elements.property(elem.TPT_PT_ETHV, "Update", --*1
  2950.  function(i,x,y,s,nt) --1
  2951.   if math.random(1,2) == 2 then --2
  2952.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  2953.     for r in sim.neighbors(x,y,1,1) do --4
  2954.      if sim.partProperty(i, "tmp") == 0 then --5
  2955.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
  2956.        sim.partProperty(i, "tmp", -1)
  2957.        end --6
  2958.       end --5
  2959.      if sim.partProperty(i, "tmp") == -1 then --7
  2960.       if math.random(1,3) > 1 then --8
  2961.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
  2962.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  2963.        sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)+0.1)
  2964.        if math.random(0,5) == 0 then --9
  2965.         if math.random(0,5) == 0 then --10
  2966.          sim.partProperty(r, "type", elem.TPT_PT_ACET)
  2967.         else
  2968.          sim.partKill(i)
  2969.          return
  2970.          end --10
  2971.         end --9
  2972.        end --8
  2973.       end --7
  2974.      end --4
  2975.     end --3
  2976.    end --2
  2977.   end --1
  2978.   ) --*1
  2979.  
  2980. local ssop = elements.allocate("TPT", "SSOP")
  2981.  elements.element(ssop, elements.element(elements.DEFAULT_PT_INSL))
  2982.  elements.property(ssop, "Name" , "SSOP")
  2983.  elements.property(ssop, "Description" , "Solid hand soap, dissolves in water slowly.")
  2984.  elements.property(ssop, "Color", 0xEEECC8)
  2985.  elements.property(ssop, "Hardness", 1)
  2986.  elements.property(ssop, "HeatConduct", 2)
  2987.  elements.property(elem.TPT_PT_SSOP, "Update", --*1
  2988.  function(i,x,y,s,nt) --1
  2989.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  2990.    if math.random(0,255) == 0 then --3
  2991.     for r in sim.neighbors(x,y,2,2) do --4
  2992.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR or sim.partProperty(r, "type") == elements.DEFAULT_PT_VIRS then --5
  2993.       sim.partProperty(i, "type", elements.DEFAULT_PT_SOAP)
  2994.       end --5
  2995.      end --4
  2996.     end --3
  2997.    end --2
  2998.   end --1
  2999.   ) --*1
  3000.  
  3001.  elements.property(elements.DEFAULT_PT_SOAP, "HighTemperature", 383.15)
  3002.  elements.property(elements.DEFAULT_PT_SOAP, "HighTemperatureTransition", elements.TPT_PT_SSOP)
  3003.  
  3004.  
  3005. local bpyr = elements.allocate("TPT", "BPYR")
  3006.  elements.element(bpyr, elements.element(elements.DEFAULT_PT_GLOW))
  3007.  elements.property(bpyr, "Name" , "BPYR")
  3008.  elements.property(bpyr, "Description" , "Blazing Pyrotheum, embodiment of ignition.")
  3009.  elements.property(bpyr, "Color", 0xFFE050)
  3010.  elements.property(bpyr, "Weight", 30)
  3011.  elements.property(bpyr, "Hardness", 0)
  3012.  elements.property(bpyr, "MenuSection", 11)
  3013.  elements.property(bpyr, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  3014.  elements.property(elem.TPT_PT_BPYR, "Update", --*1
  3015.  function(i,x,y,s,nt) --1
  3016.   attract(i,x,y,0.005)
  3017.   sim.partProperty(i, "life", 10)
  3018.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  3019.    if math.random(0,7) == 0 then --3
  3020.     for r in sim.neighbors(x,y,1,1) do --4
  3021.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  3022.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  3023.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  3024.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  3025.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  3026.           if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
  3027.            if math.random(1,3) == 1 then --11
  3028.             if math.random(0,5) == 0 then --12
  3029.              velocity_2(i,math.random(-0.1,5),math.random(4,6))
  3030.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3031.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3032.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3033.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  3034.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3035.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3036.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3037.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  3038.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3039.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3040.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
  3041.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
  3042.              sim.partProperty(r, "temp", sim.partProperty(i, "temp")+80)
  3043.              return
  3044.              end --12
  3045.             end --11
  3046.            end --10
  3047.           end --9
  3048.          end --8
  3049.         end --7
  3050.        end --6
  3051.       end --5
  3052.      end --4
  3053.     end --3
  3054.    end --2
  3055.   if s > 7 then --13
  3056.    if math.random(0,255) == 0 then --14
  3057.     sim.partKill(i)
  3058.     return
  3059.     end --14
  3060.    end --13
  3061.   end --1
  3062.   ) --*1
  3063.  
  3064.  elements.property(bpyr, "Graphics",
  3065. function(i, colr, colg, colb) --1
  3066.   if math.random(0,15) == 0 then --2
  3067.    return 0,ren.PMODE_SPARK,255,colr,colg,colb,10,255,120,90
  3068.    else
  3069.    return 0,ren.PMODE_ADD,255,colr,colg,colb,127,255,240,80
  3070.    end --2
  3071.   end --1
  3072. ) --*1
  3073.  
  3074. local cryo = elements.allocate("TPT", "CRYO")
  3075.  elements.element(cryo, elements.element(elements.DEFAULT_PT_BCOL))
  3076.  elements.property(cryo, "Name" , "CRYO")
  3077.  elements.property(cryo, "Description" , "Cryotheum.")
  3078.  elements.property(cryo, "Color", 0x50E0F0)
  3079.  elements.property(cryo, "Weight", 30)
  3080.  elements.property(cryo, "Hardness", 0)
  3081.  elements.property(cryo, "MenuSection", 11)
  3082.  elements.property(elements.TPT_PT_CRYO, "Update", --*1
  3083.  function(i,x,y) --1
  3084.   if math.random(0,15) == 0 then --2
  3085.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  3086.    end --2
  3087.   end --1
  3088. ) --*1
  3089.  
  3090. local pyro = elements.allocate("TPT", "PYRO")
  3091.  elements.element(pyro, elements.element(elements.DEFAULT_PT_BCOL))
  3092.  elements.property(pyro, "Name" , "PYRO")
  3093.  elements.property(pyro, "Description" , "Pyrotheum.")
  3094.  elements.property(pyro, "Color", 0xF0E050)
  3095.  elements.property(pyro, "Weight", 30)
  3096.  elements.property(pyro, "Hardness", 0)
  3097.  elements.property(pyro, "MenuSection", 11)
  3098.  elements.property(elements.TPT_PT_PYRO, "Update", --*1
  3099.  function(i,x,y) --1
  3100.   if math.random(0,15) == 0 then --2
  3101.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
  3102.    if math.random(0,127) == 0 then --3
  3103.     sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_PLSM)
  3104.     end --3
  3105.    end --2
  3106.   end --1
  3107. ) --*1
  3108.  
  3109. local aero = elements.allocate("TPT", "AERO")
  3110.  elements.element(aero, elements.element(elements.DEFAULT_PT_BCOL))
  3111.  elements.property(aero, "Name" , "AERO")
  3112.  elements.property(aero, "Description" , "Aerotheum.")
  3113.  elements.property(aero, "Color", 0xE0E0C0)
  3114.  elements.property(aero, "Weight", 20)
  3115.  elements.property(aero, "Hardness", 0)
  3116.  elements.property(aero, "Gravity", 0.1)
  3117.  elements.property(aero, "MenuSection", 11)
  3118.  elements.property(elements.TPT_PT_AERO, "Update", --*1
  3119.  function(i,x,y) --1
  3120.   if math.random(0,47) == 0 then --2
  3121.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PLIG)
  3122.    end --2
  3123.   end --1
  3124. ) --*1
  3125.  
  3126. local petro = elements.allocate("TPT", "PETR")
  3127.  elements.element(petro, elements.element(elements.DEFAULT_PT_BCOL))
  3128.  elements.property(petro, "Name" , "PETR")
  3129.  elements.property(petro, "Description" , "Petrotheum.")
  3130.  elements.property(petro, "Color", 0x292420)
  3131.  elements.property(petro, "Weight", 40)
  3132.  elements.property(petro, "Hardness", 0)
  3133.  elements.property(petro, "Gravity", 0.8)
  3134.  elements.property(petro, "MenuSection", 11)
  3135.  elements.property(elements.TPT_PT_PETR, "Update", --*1
  3136.  function(i,x,y) --1
  3137.   if math.random(0,47) == 0 then --2
  3138.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_SMKE)
  3139.    end --2
  3140.   end --1
  3141. ) --*1
  3142.  
  3143. local gcry = elements.allocate("TPT", "GCRY")
  3144.  elements.element(gcry, elements.element(elements.DEFAULT_PT_GLOW))
  3145.  elements.property(gcry, "Name" , "GCRY")
  3146.  elements.property(gcry, "Description" , "Gelid Cryotheum, embodiment of absolute zero.")
  3147.  elements.property(gcry, "Color", 0x50E0FF)
  3148.  elements.property(gcry, "Weight", 30)
  3149.  elements.property(gcry, "Hardness", 0)
  3150.  elements.property(gcry, "MenuSection", 11)
  3151.  elements.property(gcry, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  3152.  elements.property(elem.TPT_PT_GCRY, "Update", --*1
  3153.  function(i,x,y,s,nt) --1
  3154.   attract(i,x,y,0.005)
  3155.   sim.partProperty(i, "life", 10)
  3156.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  3157.    if math.random(0,7) == 0 then --3
  3158.     for r in sim.neighbors(x,y,1,1) do --4
  3159.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  3160.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  3161.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  3162.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  3163.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  3164.           if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
  3165.            if math.random(1,3) == 1 then --11
  3166.             if math.random(0,5) == 0 then --12
  3167.              velocity_2(i,math.random(-0.1,5),math.random(4,6))
  3168.              if math.random(0,1) == 0 then --13
  3169.               end --13
  3170.              sim.partProperty(r, "temp", sim.partProperty(i, "temp")-100)
  3171.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
  3172.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
  3173.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
  3174.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
  3175.              return
  3176.              end --12
  3177.             end --11
  3178.            end --10
  3179.           end --9
  3180.          end --8
  3181.         end --7
  3182.        end --6
  3183.       end --5
  3184.      end --4
  3185.     end --3
  3186.    end --2
  3187.   if s > 7 then --13
  3188.    if math.random(0,255) == 0 then --14
  3189.     sim.partKill(i)
  3190.     return
  3191.     end --14
  3192.    end --13
  3193.   end --1
  3194.   ) --*1
  3195.  
  3196.  elements.property(gcry, "Graphics",
  3197. function(i, colr, colg, colb) --1
  3198.   if math.random(0,15) == 0 then --2
  3199.    return 0,ren.PMODE_SPARK,255,colr,colg,colb,40,90,120,255
  3200.    else
  3201.    return 0,ren.PMODE_ADD,255,colr,colg,colb,127,80,240,255
  3202.    end --2
  3203.   end --1
  3204. ) --*1
  3205.  
  3206. local zaer = elements.allocate("TPT", "ZAER")
  3207.  elements.element(zaer, elements.element(elements.DEFAULT_PT_GLOW))
  3208.  elements.property(zaer, "Name" , "ZAER")
  3209.  elements.property(zaer, "Description" , "Zephyrean Aerotheum, embodiment of energy.")
  3210.  elements.property(zaer, "Color", 0xE0E0C0)
  3211.  elements.property(zaer, "Weight", 1)
  3212.  elements.property(zaer, "Hardness", 0)
  3213.  elements.property(zaer, "MenuSection", 11)
  3214.  elements.property(zaer, "Gravity", -0.01)
  3215.  elements.property(zaer, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  3216.  elements.property(elem.TPT_PT_ZAER, "Update", --*1
  3217.  function(i,x,y,s,nt) --1
  3218.   attract(i,x,y,0.005)
  3219.   sim.partProperty(i, "life", 10)
  3220.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  3221.    if math.random(0,7) == 0 then --3
  3222.     for r in sim.neighbors(x,y,3,3) do --4
  3223.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  3224.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  3225.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  3226.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  3227.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  3228.           if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
  3229.            if math.random(1,3) == 1 then --11
  3230.             if math.random(0,5) == 0 then --12
  3231.              sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+1)*-1.5)
  3232.              velocity_2(i,math.random(-0.1,5),math.random(4,6))
  3233.              if math.random(0,1) == 0 then --13
  3234.               sim.partProperty(r, "type", elements.TPT_PT_PLIG)
  3235.           sim.partProperty(r, "life", 100)
  3236.           end --13
  3237.              sim.partProperty(r, "temp", sim.partProperty(i, "temp"))
  3238.              return
  3239.              end --12
  3240.             end --11
  3241.            end --10
  3242.           end --9
  3243.          end --8
  3244.         end --7
  3245.        end --6
  3246.       end --5
  3247.      end --4
  3248.     end --3
  3249.    end --2
  3250.   if s > 7 then --13
  3251.    if math.random(0,255) == 0 then --14
  3252.     sim.partKill(i)
  3253.     return
  3254.     end --14
  3255.    end --13
  3256.   end --1
  3257.   ) --*1
  3258.  
  3259.  elements.property(zaer, "Graphics",
  3260. function(i, colr, colg, colb) --1
  3261.   if math.random(0,15) == 0 then --2
  3262.    return 0,ren.PMODE_SPARK,255,colr,colg,colb,2,224,224,208
  3263.    else
  3264.    return 0,ren.PMODE_ADD,255,colr,colg,colb,10,224,224,208
  3265.    end --2
  3266.   end --1
  3267. ) --*1
  3268.  
  3269. local tptr = elements.allocate("TPT", "TPTR")
  3270.  elements.element(tptr, elements.element(elements.DEFAULT_PT_GLOW))
  3271.  elements.property(tptr, "Name" , "TPTR")
  3272.  elements.property(tptr, "Description" , "Tectonic Petrotheum, embodiment of mass.")
  3273.  elements.property(tptr, "Color", 0x292420)
  3274.  elements.property(tptr, "Weight", 60)
  3275.  elements.property(tptr, "Hardness", 0)
  3276.  elements.property(tptr, "MenuSection", 11)
  3277.  elements.property(tptr, "Gravity", 0.8)
  3278.  elements.property(tptr, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  3279.  elements.property(elem.TPT_PT_TPTR, "Update", --*1
  3280.  function(i,x,y,s,nt) --1
  3281.   attract(i,x,y,0.015)
  3282.   sim.partProperty(i, "life", 10)
  3283.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  3284.    if math.random(0,7) == 0 then --3
  3285.     for r in sim.neighbors(x,y,3,3) do --4
  3286.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  3287.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  3288.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  3289.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  3290.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  3291.           if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
  3292.            if math.random(1,3) == 1 then --11
  3293.             if math.random(0,5) == 0 then --12
  3294.              velocity_2(i,math.random(-0.1,5),math.random(4,6))
  3295.              if math.random(0,1) == 0 then --13
  3296.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
  3297.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
  3298.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
  3299.              sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
  3300.          elseif math.random(0,1) == 0 then --13
  3301.               sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+3))
  3302.           end --13
  3303.              sim.partProperty(i, "temp", sim.partProperty(r, "temp"))
  3304.              return
  3305.              end --12
  3306.             end --11
  3307.            end --10
  3308.           end --9
  3309.          end --8
  3310.         end --7
  3311.        end --6
  3312.       end --5
  3313.      end --4
  3314.     end --3
  3315.    end --2
  3316.   if s > 7 then --13
  3317.    if math.random(0,255) == 0 then --14
  3318.     sim.partKill(i)
  3319.     return
  3320.     end --14
  3321.    end --13
  3322.   end --1
  3323.   ) --*1
  3324.  
  3325.  elements.property(tptr, "Graphics",
  3326. function(i, colr, colg, colb) --1
  3327.   if math.random(0,15) == 0 then --2
  3328.    return 0,ren.PMODE_SPARK,255,colr,colg,colb,255,44,36,32
  3329.    else
  3330.    return 0,ren.PMODE_ADD,255,colr,colg,colb,64,44,36,32
  3331.    end --2
  3332.   end --1
  3333. ) --*1
  3334.  
  3335. local neur = elements.allocate("TPT", "NEUR")
  3336.  elements.element(neur, elements.element(elements.DEFAULT_PT_MERC))
  3337.  elements.property(neur, "Name" , "NEUR")
  3338.  elements.property(neur, "Description" , "Neurons?")
  3339.  elements.property(neur, "Color", 0x706020)
  3340.  elements.property(neur, "Weight", 30)
  3341.  elements.property(neur, "Hardness", 50)
  3342.  elements.property(neur, "MenuSection", 11)
  3343.  elements.property(neur, "Diffusion", 0.8)
  3344.  elements.property(neur, "Flammable", 5)
  3345.  elements.property(neur, "HighTemperature", 343.15)
  3346.  elements.property(neur, "HighTemperatureTransition", elements.DEFAULT_PT_WATR)
  3347.  elements.property(elements.TPT_PT_NEUR, "Update", --*1
  3348.  function(i,x,y,s,nt) --1
  3349.   if sim.partProperty(i, "life") > 0 then --2
  3350.    if math.random(1,65) == 1 then --3
  3351.     sim.partProperty(i, "life", 0)
  3352.     end --3
  3353.    end --2
  3354.   if math.random(0,sim.pressure(x/4,y/4)+1*1000) == 1 then --4
  3355.    sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SPRK)
  3356.    end --4
  3357.   end --1
  3358.   ) --*1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement