Advertisement
Guest User

TPT Remade IV

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