Advertisement
Guest User

1.6a

a guest
Dec 12th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 76.64 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 attract(i,x,y,a) --*1
  9.  sim.gravMap(x/4,y/4,a)
  10. end --*1
  11.  
  12. local nept = elements.allocate("TPT" , "NEPT")
  13.  elements.element(nept, elements.element(elements.DEFAULT_PT_PLUT))
  14.  elements.property(nept, "Name" , "NEPT")
  15.  elements.property(nept, "Description" , "Neptunium, radioactive. Quickly heats up when bombarded with neutrons.")
  16.  elements.property(nept, "Color", 0x557020)
  17.  elements.property(nept, "PhotonReflectWavelengths", 0x002FF200)
  18.  elements.property(nept, "MenuSection", 10)
  19.  
  20. local vsns = elements.allocate("TPT" , "VSNS")
  21.  elements.element(vsns, elements.element(elements.DEFAULT_PT_DMND))
  22.  elements.property(vsns, "Name" , "VSNS")
  23.  elements.property(vsns, "Description" , "Velocity sensor, creates power when something's velocity is higher than its temperature.")
  24.  elements.property(vsns, "Color", 0x3D3125)
  25.  elements.property(vsns, "MenuSection", 3)
  26.  elements.property(vsns, "HeatConduct", 0)
  27.  elements.property(elem.TPT_PT_VSNS, "Update",
  28.  function(i,x,y,s,nt) --1
  29.   for r in sim.neighbors(x,y,1,1) do --2
  30.    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
  31.     sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
  32.     sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
  33.     sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
  34.     sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
  35.     sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
  36.     sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
  37.     sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
  38.     sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
  39.     end --3
  40.    end --2
  41.   end --1
  42. ) --*1
  43.  
  44. local mrcv = elements.allocate("TPT", "MRCV")
  45.  elements.element(mrcv,elem.element(elem.DEFAULT_PT_WTRV))
  46.  elements.property(mrcv, "Name" , "MRCV")
  47.  elements.property(mrcv, "Description" , "Mercury Vapor.")
  48.  elements.property(mrcv, "Color", 0x6D6567)
  49.  elements.property(mrcv, "Temperature", 637.85)
  50.  elements.property(mrcv, "AirDrag", 0.01)
  51.  elements.property(mrcv, "Loss", 0.5)
  52.  elements.property(mrcv, "LowTemperature", 618.32)
  53.  elements.property(mrcv, "LowTemperatureTransition", elements.DEFAULT_PT_MERC)
  54.  
  55.  elements.property(elements.DEFAULT_PT_MERC, "Update", --*1
  56.  function(i,x,y) --1
  57.   if sim.partProperty(i, "temp") > 628.91 then --2
  58.    if math.random(1,450) == 1 then --3
  59.     sim.partChangeType(i, elements.TPT_PT_MRCV)
  60.     end --3
  61.    end --2
  62.   end --1
  63.  ) --*1
  64.  
  65. local anti = elements.allocate("TPT" , "ANTI")
  66.  elements.element(anti, elements.element(elements.DEFAULT_PT_SING))
  67.  elements.property(anti, "Name" , "ANTI")
  68.  elements.property(anti, "Description" , "Anti Singularity, incredibly destructive. Slowly increases in size")
  69.  elements.property(anti, "Color", 0xDBDBDB)
  70.  elements.property(anti, "HotAir", 0.15)
  71.  elements.property(anti, "MenuSection", 16)
  72.  elements.property(elements.TPT_PT_ANTI, "Update", --*1
  73.  function(i,x,y) --1
  74.   attract(i,x,y,-0.75)
  75.   if math.random(1,50) == 1 then --2
  76.    sim.partCreate(-1, x+math.random(-1,1),y+math.random(-1,1),elements.TPT_PT_ANTI)
  77.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  78.    end --2
  79.   end --1
  80.  ) --*1
  81.  
  82.  elements.property(elements.DEFAULT_PT_SING, "Update", --*1
  83.  function(i,x,y) --1
  84.   attract(i,x,y,0.75)
  85.   end --1
  86.  ) --*1
  87.  
  88. local ash = elements.allocate("TPT", "ASH")
  89.  elements.element(ash, elements.element(elements.DEFAULT_PT_DUST))
  90.  elements.property(ash, "Name" , "ASH")
  91.  elements.property(ash, "Description" , "Ash, light powder. Turns into oil under pressure.")
  92.  elements.property(ash, "Color", 0x393224)
  93.  elements.property(ash, "Gravity", 0.056)
  94.  elements.property(ash, "Advection", 0.2)
  95.  elements.property(ash, "Weight", 2)
  96.  elements.property(ash, "AirDrag", 0.05)
  97.  elements.property(ash, "Flammable", 25.56)
  98.  
  99. local lhyg = elements.allocate("TPT", "LHYG")
  100.  elements.element(lhyg, elements.element(elements.DEFAULT_PT_LOXY))
  101.  elements.property(lhyg, "Name" , "LHYG")
  102.  elements.property(lhyg, "Description" , "Liquid Hydrogen, very cold. Incredibly flammable")
  103.  elements.property(lhyg, "Flammable", 5000.65)
  104.  elements.property(lhyg, "Explosive", 1)
  105.  elements.property(lhyg, "Color", 0x3D68CD)
  106.  elements.property(lhyg, "Temperature", 14.15)
  107.  elements.property(lhyg, "MenuSection", 7)
  108.  elements.property(lhyg, "HighTemperature", 18.15)
  109.  elements.property(lhyg, "HighTemperatureTransition", elements.DEFAULT_PT_HYGN)
  110.  
  111.  elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", 15.24)
  112.  elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", elements.TPT_PT_LHYG)
  113.  
  114. local pb = elements.allocate("TPT" , "LEAD")
  115.  elements.element(pb, elements.element(elements.DEFAULT_PT_IRON))
  116.  elements.property(pb, "Name" , "LEAD")
  117.  elements.property(pb, "Description" , "Lead, absorbs neutrons. Conducts electricity.")
  118.  elements.property(pb, "Color", 0x686868)
  119.  elements.property(pb, "Hardness", 0)
  120.  elements.property(pb, "HighTemperature", 601.25)
  121.  elements.property(pb, "Properties", elements.PROP_NEUTABSORB+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_DEADLY)
  122.  
  123. local mnpr = elements.allocate("TPT", "MNPR")
  124.  elements.element(mnpr, elements.element(elements.DEFAULT_PT_BOYL))
  125.  elements.property(mnpr, "Name" , "MONO")
  126.  elements.property(mnpr, "Description" , "Monopropellant. Disperses quickly.")
  127.  elements.property(mnpr, "Color", 0xB0B0B0)
  128.  elements.property(mnpr, "Advection", 0.2)
  129.  elements.property(mnpr, "AirDrag", 0.05)
  130.  elements.property(mnpr, "HotAir", 0.01)
  131.  elements.property(mnpr, "MenuSection", 16)
  132.  elements.property(elements.TPT_PT_MNPR, "Update", --*1
  133. function(i,x,y) --1
  134.  if math.random(1,30) == 1 then --2
  135.   sim.partKill(i)
  136.   end --2
  137.  end --1
  138.  ) --*1
  139.  
  140. local mnpl = elements.allocate("TPT", "MNPL")
  141.  elements.element(mnpl, elements.element(elements.DEFAULT_PT_LOXY))
  142.  elements.property(mnpl, "Name" , "MNPL")
  143.  elements.property(mnpl, "Description" , "Liquid Monopropellant. Releases lots of pressure and heat when boiled")
  144.  elements.property(mnpl, "Flammable", 0)
  145.  elements.property(mnpl, "Color", 0xA0A0A0)
  146.  elements.property(mnpl, "Temperature", 180.15)
  147.  elements.property(mnpl, "MenuSection", 5)
  148.  elements.property(mnpl, "Diffusion", 0.1)
  149.  elements.property(mnpl, "HighTemperature", 200.15)
  150.  elements.property(mnpl, "HighTemperatureTransition", elements.TPT_PT_MNPR)
  151.  elements.property(elements.TPT_PT_MNPL, "Update", --*1
  152.  function(i,x,y,s,nt) --1
  153.   for r in sim.neighbors(x,y,1,1) do --2
  154.    if sim.partProperty(r, "type") == elements.TPT_PT_MNPR then --3
  155.     if math.random(1,45) == 1 then --4
  156.      sim.partProperty(i, "temp", sim.partProperty(i, "temp")+75)
  157.      sim.pressure(x/4,y/4,10)
  158.      end --4
  159.     end --3
  160.    end --2
  161.   end --1
  162.  ) --*1
  163.  
  164.  elements.property(mnpr, "LowTemperature", 190.15)
  165.  elements.property(mnpr, "LowTemperatureTransition", elements.TPT_PT_MNPL)
  166.  
  167. local tchn = elements.allocate("TPT" , "TCHN")
  168.  elements.element(tchn, elements.element(elements.DEFAULT_PT_URAN))
  169.  elements.property(tchn, "Name" , "TCHN")
  170.  elements.property(tchn, "Description" , "Technetium, decays over time and leaves heat.")
  171.  elements.property(tchn, "Color", 0x205570)
  172.  elements.property(tchn, "MenuSection", 11)
  173. elements.property(elements.TPT_PT_TCHN, "Update", --*1
  174.  function(i,x,y) --1
  175.   if math.random(1,11520) == 1 then --2
  176.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  177.    sim.pressure(x/4,y/4,8)
  178.    sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
  179.    end --2
  180.   end --1
  181.  ) --*1
  182.  elements.property(tchn, "HighTemperatureTransition", elements.TPT_PT_TCHN)
  183.  
  184. local psac = elements.allocate("TPT", "PSAC")
  185.  elements.element(psac, elements.element(elements.DEFAULT_PT_SOAP))
  186.  elements.property(psac, "Name" , "PSAC")
  187.  elements.property(psac, "Description" , "Positronic acid, reacts violently with matter, weak acid.")
  188.  elements.property(psac, "Color", 0xFF20BB)
  189.  elements.property(psac, "Advection", 0.01)
  190.  elements.property(psac, "Hardness", 0)
  191.  elements.property(psac, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
  192.  elements.property(elem.TPT_PT_PSAC, "Update", --*1
  193.  function(i,x,y,s,nt) --1
  194.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  195.    if math.random(1,100) == 10 then --3
  196.     for r in sim.neighbors(x,y,1,1) do --4
  197.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  198.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  199.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  200.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  201.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  202.           if math.random(1,3) == 1 then --10
  203.            sim.partKill(r)
  204.            sim.partProperty(i, "temp", sim.partProperty(i, "temp")+3200)
  205.            if math.random(1,13) == 1 then --11
  206.             sim.pressure(x/4,y/4,16)
  207.             sim.partKill(i)
  208.             return
  209.             end --11
  210.            end --10
  211.           end --9
  212.          end --8
  213.         end --7
  214.        end --6
  215.       end --5
  216.      end --4
  217.     end --3
  218.    end --2
  219.   end --1
  220.   ) --*1
  221.  
  222. local si = elements.allocate("TPT" , "SILC")
  223.  elements.element(si, elements.element(elements.DEFAULT_PT_IRON))
  224.  elements.property(si, "Name" , "SILC")
  225.  elements.property(si, "Description" , "Silicon, conducts electricity. Lets air pass through")
  226.  elements.property(si, "Color", 0x686E76)
  227.  elements.property(si, "AirLoss", 1)
  228.  elements.property(si, "HighTemperature", 1687.01)
  229.  elements.property(si, "Properties", elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
  230.  
  231. local torn = elements.allocate("TPT" , "TORN")
  232.  elements.element(torn, elements.element(elements.DEFAULT_PT_BOYL))
  233.  elements.property(torn, "Name" , "TORN")
  234.  elements.property(torn, "Description" , "Tornado, self explanatory.")
  235.  elements.property(torn, "Color", 0x8A9098)
  236.  elements.property(torn, "AirDrag", 0.05)
  237.  elements.property(torn, "AirDrag", 0.05)
  238.  elements.property(torn, "HotAir", -0.001)
  239.  elements.property(torn, "MenuSection", 16)
  240.  
  241. local lhlm = elements.allocate("TPT", "LHE")
  242.  elements.element(lhlm, elements.element(elements.DEFAULT_PT_SOAP))
  243.  elements.property(lhlm, "Name" , "LHE")
  244.  elements.property(lhlm, "Description" , "Liquid helium, incredibly cold.")
  245.  elements.property(lhlm, "Temperature", 4.01)
  246.  elements.property(lhlm, "Color", 0x5000FF)
  247.  elements.property(lhlm, "MenuSection", 11)
  248.  elements.property(elem.TPT_PT_LHE, "Update", --*1
  249. function(i,x,y,s) --1
  250.   if math.random(1,200) == 1 then --2
  251.    if sim.partProperty(i, "temp") > 4.21 then --3
  252.     if math.random(1,100) > 1 then --4
  253.      sim.partKill(i)
  254.      else
  255.      sim.partProperty(i, "type", elements.TPT_PT_HE)
  256.      end --4
  257.     end --3
  258.    end --2
  259.   end --1
  260.   ) --*1
  261.  
  262. local he = elements.allocate("TPT", "HE")
  263.  elements.element(he, elements.element(elements.DEFAULT_PT_HYGN))
  264.  elements.property(he, "Name" , "HE")
  265.  elements.property(he, "Description", "Helium, floats.")
  266.  elements.property(he, "Color", 0x6111FF)
  267.  elements.property(he, "Diffusion", 1.5)
  268.  elements.property(he, "Gravity", -0.3)
  269.  elements.property(he, "Flammable", 0)
  270.  elements.property(he, "LowTemperature", -1)
  271.  elements.property(he, "LowTemperatureTransition", -1)
  272.  elements.property(he, "MenuSection", 16)
  273.  
  274. local n237 = elements.allocate("TPT" , "N237")
  275.  elements.element(n237, elements.element(elements.DEFAULT_PT_POLO))
  276.  elements.property(n237, "Name" , "N237")
  277.  elements.property(n237, "Description" , "Neptunium 237, decays very quickly. Radioactive waste.")
  278.  elements.property(n237, "Color", 0x668131)
  279.  elements.property(n237, "HighTemperature", 1644)
  280.  elements.property(n237, "PhotonReflectWavelengths", 0x002FF200)
  281.  elements.property(n237, "MenuSection", 16)
  282.  function nept237(i,x,y,s,n)
  283.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  284.    if math.random(1,2) == 1 then --2
  285.     tpt.parts[i].type = elements.DEFAULT_PT_PLUT
  286.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  287.     else if math.random(1,6) == 1 then --3
  288.      tpt.parts[i].type = elements.DEFAULT_PT_HE
  289.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  290.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  291.      end --3
  292.     end --2
  293.    end --1
  294.   if sim.pressure(x/4,y/4) > 1 then --3
  295.    if math.random(1,125) == 10 then --4
  296.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  297.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  298.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  299.     tpt.set_property("temp", math.huge, x ,y)
  300.     end --4
  301.    end --3
  302.   if math.random(1,100) == 10 then --5
  303.    sim.pressure(x/4,y/4,0.2)
  304.    end --5
  305.   end --*1
  306.  tpt.element_func(nept237,elements.TPT_PT_N237)
  307.  
  308.  function neptunium(i,x,y,s,n)
  309.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  310.    if math.random(1,2) == 1 then --2
  311.     tpt.parts[i].type = elements.DEFAULT_PT_URAN
  312.     else if math.random(1,6) == 1 then --3
  313.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), elements.TPT_PT_N237)
  314.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), elements.TPT_PT_N237)
  315.      tpt.parts[i].type = elements.DEFAULT_PT_NBLE
  316.      end --3
  317.     end --2
  318.    end --1
  319.   if sim.pressure(x/4,y/4) > 1 then --3
  320.    if math.random(1,250) == 10 then --4
  321.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  322.     tpt.set_property("temp", math.huge, x ,y)
  323.     end --4
  324.    end --3
  325.   if math.random(1,10000) == 10 then --5
  326.    sim.pressure(x/4,y/4,0.1)
  327.    end --5
  328.   end --*1
  329.  tpt.element_func(neptunium,nept)
  330.   function neutron(i,x,y,s,n) --*2
  331.    if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == nept then --1
  332.     if math.random(1,25) == 10 then --2
  333.      tpt.create(x, y, 'neut')
  334.      tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  335.      sim.pressure(x/4,y/4,8)
  336.      end --2
  337.     end --1
  338.    end --*2
  339.  tpt.element_func(neutron,tpt.el.neut.id)
  340.  
  341. local he3 = elements.allocate("TPT", "HE3")
  342.  elements.element(he3, elements.element(elements.DEFAULT_PT_HYGN))
  343.  elements.property(he3, "Name" , "HE3")
  344.  elements.property(he3, "Description", "Helium 3, fuses with tritium.")
  345.  elements.property(he3, "Color", 0xD6EE00)
  346.  elements.property(he3, "Diffusion", 1.7)
  347.  elements.property(he3, "Gravity", -1.0)
  348.  elements.property(he3, "Flammable", 0)
  349.  elements.property(he3, "LowTemperature", -1)
  350.  elements.property(he3, "LowTemperatureTransition", -1)
  351.  elements.property(he3, "MenuSection", 16)
  352.  
  353. local shake = elements.allocate("TPT", "SHAKE")
  354.  elements.element(shake, elements.element(elements.DEFAULT_PT_DMND))
  355.  elements.property(shake, "Name" , "SHAK")
  356.  elements.property(shake, "Description", "Shakes particles.")
  357.  elements.property(shake, "Color", 0xFFCCCC)
  358.  elements.property(shake, "Weight", 0)
  359.  elements.property(shake, "MenuSection", 13)
  360.  elements.property(elem.TPT_PT_SHAKE, "Update", --*1
  361. function(i,x,y,s) --1
  362.   for r in sim.neighbors(x,y,1,1) do --2
  363.    velocity(r,6,360)
  364.    end --2
  365.   sim.partKill(i)
  366.   end --1
  367.  ) --*1
  368.  
  369. local normal = elements.allocate("TPT", "NORMAL")
  370.  elements.element(normal, elements.element(elements.DEFAULT_PT_DMND))
  371.  elements.property(normal, "Name" , "NORM")
  372.  elements.property(normal, "Description", "Normalizes temperature and pressure in the selected area.")
  373.  elements.property(normal, "Color", 0xCCFFCC)
  374.  elements.property(normal, "Weight", 0)
  375.  elements.property(normal, "MenuSection", 13)
  376.  elements.property(elem.TPT_PT_NORMAL, "Update", --*1
  377. function(i,x,y,s) --1
  378.   sim.pressure(x/4,y/4,0)
  379.   for r in sim.neighbors(x,y,1,1) do --2
  380.    if sim.partProperty(r, "temp") > 295.15 then --3
  381.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")-5)
  382.     end --3
  383.    if sim.partProperty(r, "temp") < 295.15 then --4
  384.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")+5)
  385.     end --4
  386.    end --2
  387.   sim.partKill(i)
  388.   end --1
  389.  ) --*1
  390.  
  391. local os = elements.allocate("TPT" , "OSMM")
  392.  elements.element(os, elements.element(elements.DEFAULT_PT_BRMT))
  393.  elements.property(os, "Name" , "OSMM")
  394.  elements.property(os, "Description" , "Osmium, heavy metal. Mostly the norwegian kind")
  395.  elements.property(os, "Color", 0x4D5763)
  396.  elements.property(os, "Gravity", 0.5)
  397.  elements.property(os, "AirDrag", 0.08)
  398.  elements.property(os, "Weight", 97)
  399.  elements.property(os, "Meltable", 1)
  400.  elements.property(os, "HighTemperature", 3306)
  401.  elements.property(os, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
  402.  elements.property(elements.TPT_PT_OSMM, "Update", --*1
  403.  function(i,x,y) --1
  404.   attract(i,x,y,0.0025)
  405.   end --1
  406.  ) --*1
  407.  
  408. local anco = elements.allocate("TPT", "ACOL")
  409.  elements.element(anco, elements.element(elements.DEFAULT_PT_COAL))
  410.  elements.property(anco, "Name" , "ACOL")
  411.  elements.property(anco, "Description" , "Anti-Coal, burns slowly and very... surprisingly cold.")
  412.  elements.property(anco, "MenuSection", 16)
  413.  elements.property(anco, "Color", 0xDDDDDD)
  414.  elements.property(elem.TPT_PT_ACOL, "Update", --*1
  415.  function(i,x,y,s,nt) --1
  416.   if math.random(1,2) == 2 then --2
  417.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  418.     for r in sim.neighbors(x,y,1,1) do --4
  419.      if sim.partProperty(i, "tmp") == 0 then --5
  420.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
  421.        sim.partProperty(i, "tmp", -1)
  422.        end --6
  423.       end --5
  424.      if sim.partProperty(i, "tmp") == -1 then --7
  425.       if math.random(1,9) == 1 then --8
  426.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  427.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  428.        if math.random(1,900) == 1 then --9
  429.         sim.partKill(i)
  430.         return
  431.         end --9
  432.        end --8
  433.       end --7
  434.      end --4
  435.     end --3
  436.    end --2
  437.   end --1
  438.   ) --*1
  439.  
  440.  elements.property(elements.DEFAULT_PT_PLSM, "HeatConduct", 255)
  441.  elements.property(elements.DEFAULT_PT_GLOW, "HeatConduct", 255)
  442.  
  443.  elements.property(elements.DEFAULT_PT_IRON, "Update", --*1
  444.  function(i,x,y,s,nt) --1
  445.    if s ~=8 and nt ~=0 and nt - s > 0 then --2
  446.     for r in sim.neighbors(x,y,1,1) do --3
  447.      if sim.pressure(x/4,y/4) > 2.51 then --4
  448.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --5
  449.        sim.partProperty(i, "tmp", -1)
  450.        end --5
  451.       if sim.partProperty(i, "tmp") == -1 then --6
  452.        if math.random(1,9) == 1 then --7
  453.         sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
  454.          if math.random(1,25) == 1 then --8
  455.           sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  456.           sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  457.           sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  458.           sim.partProperty(i, "tmp", 0)
  459.           end --8
  460.          end --7
  461.         end --6
  462.        end --5
  463.       end --4
  464.      end --3
  465.     end --2
  466.  ) --*1
  467.  
  468. local bhut = elements.allocate("TPT" , "BHUT")
  469.  elements.element(bhut, elements.element(elements.DEFAULT_PT_BOYL))
  470.  elements.property(bhut, "Name" , "BHUT")
  471.  elements.property(bhut, "HeatConduct", 255)
  472.  elements.property(bhut, "HotAir", 0.001)
  473.  elements.property(bhut, "Color", 0x706050)
  474.  elements.property(bhut, "AirDrag", 0.001)
  475.  elements.property(bhut, "AirLoss", 1)
  476.  elements.property(bhut, "Diffusion", 1.25)
  477.  elements.property(bhut, "MenuSection", 5)
  478.  elements.property(bhut, "Description" , "Bhutane, explosive gas")
  479.  elements.property(elem.TPT_PT_BHUT, "Update", --*1
  480.  function(i,x,y,s,nt) --1
  481.   if math.random(1,2) == 2 then --2
  482.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  483.     for r in sim.neighbors(x,y,1,1) do --4
  484.      if sim.partProperty(i, "tmp") == 0 then --5
  485.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
  486.        sim.partProperty(i, "tmp", -1)
  487.        end --6
  488.       end --5
  489.      if sim.partProperty(i, "tmp") == -1 then --7
  490.       if math.random(1,3) > 1 then --8
  491.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
  492.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  493.        sim.pressure(x/4,y/4,5)
  494.        if math.random(1,6) == 1 then --9
  495.         sim.partKill(i)
  496.         return
  497.         end --9
  498.        end --8
  499.       end --7
  500.      end --4
  501.     end --3
  502.    end --2
  503.   end --1
  504.   ) --*1
  505.  
  506.  elements.property(elements.TPT_PT_ASH, "Update", --*1
  507. function(i,x,y,s) --1
  508.   if sim.pressure(x/4,y/4) > 5.9 then --2
  509.    if math.random(1,950) == 1 then --3
  510.     sim.partProperty(i, "type", elements.DEFAULT_PT_OIL)
  511.     else if math.random (1,3000) == 1 then --4
  512.      sim.partProperty(i, "type", elements.TPT_PT_BHUT)
  513.      else if math.random (1,3000) == 1 then --4
  514.       sim.partProperty(i, "type", elements.DEFAULT_PT_SAWD)
  515.       end --5
  516.      end --4
  517.     end --3
  518.    end --2
  519.   end --1
  520.   ) --*1
  521.  
  522. local gr = elements.allocate("TPT" , "GRPH")
  523.  elements.element(gr, elements.element(elements.DEFAULT_PT_COAL))
  524.  elements.property(gr, "Name" , "GRPH")
  525.  elements.property(gr, "Description" , "Graphite, melts at an incredibly high temperature.")
  526.  elements.property(gr, "Color", 0x111113)
  527.  elements.property(gr, "HeatConduct", 7)
  528.  elements.property(gr, "HighTemperature", 4003.15)
  529.  elements.property(gr, "Meltable", 1)
  530.  elements.property(gr, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
  531.  elements.property(gr, "Properties", elements.PROP_CONDUCTS+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
  532.  elements.property(elements.TPT_PT_GRPH, "Update", --*1
  533.  function(i,x,y,s,nt) --1
  534.    if sim.partProperty(i, "life") > 0 then --2
  535.     if math.random(1,65) == 1 then --3
  536.      sim.partProperty(i, "life", 0)
  537.      end --3
  538.     end --2
  539.    if sim.pressure(x/4,y/4) > 11.8 then --4
  540.     if math.random(1,950) == 1 then --5
  541.      sim.partProperty(i, "type", elements.DEFAULT_PT_DMND)
  542.      end --5
  543.     end --4
  544.    end --1
  545.   ) --*1
  546.  
  547. local thor = elements.allocate("TPT" , "THOR")
  548.  elements.element(thor, elements.element(elements.DEFAULT_PT_PLUT))
  549.  elements.property(thor, "Name" , "THOR")
  550.  elements.property(thor, "Description" , "Thorium, not radioactive on its own, needs help from another radioactive material to function.")
  551.  elements.property(thor, "Color", 0x404043)
  552.  elements.property(thor, "PhotonReflectWavelengths", 0x8FFFFFFF)
  553.  elements.property(thor, "MenuSection", 10)
  554.   function neutron2(i,x,y,s,n) --*2
  555.    if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == thor then --1
  556.     if math.random(1,70) == 1 then --2
  557.      tpt.set_property("temp", tpt.get_property("temp", x, y)+4500, x ,y)
  558.      end --2
  559.     end --1
  560.    end --*2
  561.  tpt.element_func(neutron2,tpt.el.neut.id)
  562.  
  563. local para = elements.allocate("TPT" , "PARA")
  564.  elements.element(para, elements.element(elements.DEFAULT_PT_WAX))
  565.  elements.property(para, "Name" , "FZOL")
  566.  elements.property(para, "HeatConduct", 5)
  567.  elements.property(para, "Color", 0x474530)
  568.  elements.property(para, "Flammable", 1)
  569.  elements.property(para, "Description" , "Frozen oil, flammable")
  570.  elements.property(para, "HighTemperature", 277.14)
  571.  elements.property(para, "Temperature", 274.14)
  572.  elements.property(para, "HighTemperatureTransition", elements.DEFAULT_PT_OIL)
  573.  
  574.  elements.property(elements.DEFAULT_PT_OIL, "LowTemperature", 278.14)
  575.  elements.property(elements.DEFAULT_PT_OIL, "LowTemperatureTransition", elements.TPT_PT_PARA)
  576.  
  577. local plwd = elements.allocate("TPT" , "PLWD")
  578.  elements.element(plwd, elements.element(elements.DEFAULT_PT_WOOD))
  579.  elements.property(plwd, "Name" , "PLWD")
  580.  elements.property(plwd, "HeatConduct", 2)
  581.  elements.property(plwd, "Color", 0x808445)
  582.  elements.property(plwd, "Flammable", 1)
  583.  elements.property(plwd, "Description" , "Plywood. Durable material.")
  584.  elements.property(plwd, "AirLoss", 0.2)
  585.  elements.property(plwd, "Hardness", 1)
  586.  
  587. local lbl = elements.allocate("TPT" , "LBYL")
  588.  elements.element(lbl, elements.element(elements.DEFAULT_PT_GLOW))
  589.  elements.property(lbl, "Name" , "LBYL")
  590.  elements.property(lbl, "HeatConduct", 25)
  591.  elements.property(lbl, "Color", 0x001F00)
  592.  elements.property(lbl, "Flammable", 5)
  593.  elements.property(lbl, "HotAir", -0.0001)
  594.  elements.property(lbl, "Description" , "Liquid Boyle gas. Explosive.")
  595.  elements.property(lbl, "HighTemperature", 220.14)
  596.  elements.property(lbl, "Temperature", 213.14)
  597.  elements.property(lbl, "HighTemperatureTransition", elements.DEFAULT_PT_BOYL)
  598.  elements.property(lbl, "MenuSection", 16)
  599.  
  600.  elements.property(elements.DEFAULT_PT_BOYL, "LowTemperature", 219.14)
  601.  elements.property(elements.DEFAULT_PT_BOYL, "HighTemperatureTransition", elements.TPT_PT_LBYL)
  602.  
  603. local mgns = elements.allocate("TPT", "CAVE")
  604.  elements.element(mgns, elements.element(elements.DEFAULT_PT_BRMT))
  605.  elements.property(mgns, "Name" , "CAVE")
  606.  elements.property(mgns, "Description" , "Burn life's house down! With the lemons!")
  607.  elements.property(mgns, "Color", 0xA5A515)
  608.  elements.property(mgns, "Weight", 49)
  609.  elements.property(mgns, "Gravity", 0.3)
  610.  elements.property(mgns, "MenuSection", 16)
  611.  elements.property(elem.TPT_PT_CAVE, "Update", --*1
  612.  function(i,x,y,s) --1
  613.   if s > 6 then --2
  614.    if math.random(1,20) == 20 then --3
  615.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  616.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  617.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  618.     sim.partChangeType(i, elements.DEFAULT_PT_FIRE)
  619.     sim.pressure(x/4,y/4,16)
  620.     if math.random(1,5) == 5 then --4
  621.      sim.partKill(i)
  622.      end --4
  623.     end --3
  624.    end --2
  625.   end --1
  626.   ) --*1
  627.  
  628. local tmpsns = elements.allocate("TPT" , "TMPS")
  629. elements.element(tmpsns, elements.element(elements.DEFAULT_PT_DMND))
  630. elements.property(tmpsns, "Name" , "TMPS")
  631. elements.property(tmpsns, "Description" , "Temporary value sensor, creates power when something's tmp or tmp2 is higher than its temperature.")
  632. elements.property(tmpsns, "Color", 0x22713D)
  633. elements.property(tmpsns, "MenuSection", 3)
  634. elements.property(tmpsns, "HeatConduct", 0)
  635. elements.property(elem.TPT_PT_TMPS, "Update",
  636.  function(i,x,y,s,nt) --1
  637.   for r in sim.neighbors(x,y,1,1) do --2
  638.    if sim.partProperty(r, "tmp") > sim.partProperty(i, "temp")-273.15 then --3
  639.     sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
  640.     sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
  641.     sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
  642.     sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
  643.     sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
  644.     sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
  645.     sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
  646.     sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
  647.     end --3
  648.    end --2
  649.   end --1
  650. ) --*1
  651.  
  652. local erode = elements.allocate("TPT", "ERODE")
  653.  elements.element(erode, elements.element(elements.DEFAULT_PT_DMND))
  654.  elements.property(erode, "Name" , "EROD")
  655.  elements.property(erode, "Description", "Erodes.")
  656.  elements.property(erode, "Color", 0xCCCCCC)
  657.  elements.property(erode, "Weight", 0)
  658.  elements.property(erode, "MenuSection", 13)
  659.  elements.property(elem.TPT_PT_ERODE, "Update", --*1
  660.  function(i,x,y,s,nt) --1
  661.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  662.    if math.random(1,25) == 10 then --3
  663.     for r in sim.neighbors(x,y,1,1) do --4
  664.      if math.random(1,6) == 3 then --5
  665.       sim.partKill(r)
  666.       end --5
  667.      end --4
  668.     end --3
  669.    end --2
  670.   sim.partKill(i)
  671.   end --1
  672.   ) --*1
  673.  
  674. local storm = elements.allocate("TPT", "STORM")
  675.  elements.element(storm, elements.element(elements.DEFAULT_PT_DMND))
  676.  elements.property(storm, "Name" , "STRM")
  677.  elements.property(storm, "Description", "Storms.")
  678.  elements.property(storm, "Color", 0x889F9F)
  679.  elements.property(storm, "Weight", 0)
  680.  elements.property(storm, "MenuSection", 11)
  681.  elements.property(elem.TPT_PT_STORM, "Update", --*1
  682.  function(i,x,y,s) --1
  683.   sim.pressure(x/4,y/4,math.random(-112,112))
  684.   if math.random(1,1000) == 1 then --2
  685.    sim.partProperty(i, "type", elements.DEFAULT_PT_WATR)
  686.    else if math.random(1,100) == 1 then --3
  687.     sim.partProperty(i, "type", elements.DEFAULT_PT_FOG)
  688.     else if math.random(1,50000) == 1 then --4
  689.      sim.partProperty(i, "tmp2", 4)
  690.      sim.partProperty(i, "tmp", math.random(0,359))
  691.      sim.partProperty(i, "life", math.random(15,25))
  692.      sim.partProperty(i, "type", elements.DEFAULT_PT_LIGH)
  693.      else
  694.      sim.partKill(i)
  695.      end --4
  696.     end --3
  697.    end --2
  698.   end --1
  699.  ) --*1
  700.  
  701. local aliq = elements.allocate("TPT", "ANLIQ")
  702.  elements.element(aliq, elements.element(elements.DEFAULT_PT_GLOW))
  703.  elements.property(aliq, "Name" , "ALIQ")
  704.  elements.property(aliq, "Description", "Anti-liquid. Flows upwards.")
  705.  elements.property(aliq, "Color", 0xEFEFFF)
  706.  elements.property(aliq, "Gravity", -0.1)
  707.  elements.property(aliq, "Advection", -0.6)
  708.  elements.property(aliq, "AirDrag", -0.01)
  709.  elements.property(aliq, "HeatConduct", 2)
  710.  elements.property(aliq, "MenuSection", 16)
  711.  elements.property(elem.TPT_PT_ANLIQ, "Update", --*1
  712.  function(i,x,y,s,nt) --1
  713.   if math.random(1,2) == 2 then --2
  714.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  715.     for r in sim.neighbors(x,y,1,1) do --4
  716.      if sim.partProperty(i, "tmp") == 0 then --5
  717.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
  718.        sim.partProperty(i, "tmp", -1)
  719.        end --6
  720.       end --5
  721.      if sim.partProperty(i, "tmp") == -1 then --7
  722.       if math.random(1,2) == 1 then --8
  723.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  724.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  725.        sim.pressure(x/4,y/4,5)
  726.        if math.random(1,50) == 1 then --9
  727.         sim.partKill(i)
  728.         return
  729.         end --9
  730.        end --8
  731.       end --7
  732.      end --4
  733.     end --3
  734.    end --2
  735.   end --1
  736.   ) --*1
  737.  
  738. local neutr = elements.allocate("TPT" , "NETR")
  739.  elements.element(neutr, elements.element(elements.DEFAULT_PT_DMND))
  740.  elements.property(neutr, "Name" , "NETR")
  741.  elements.property(neutr, "Description" , "Neutronium. Dense, Radioactive solid. Slowly implodes and decays after time. Rarely grows")
  742.  elements.property(neutr, "Color", 0x0606FF)
  743.  elements.property(neutr, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
  744.  elements.property(neutr, "PhotonReflectWavelengths", 0x00000001)
  745.  elements.property(neutr, "MenuSection", 10)
  746. elements.property(elements.TPT_PT_NETR, "Update", --*1
  747.  function(i,x,y) --1
  748.   attract(i,x,y,0.1)
  749.    if math.random(1,(sim.pressure(x/4,y/4)+256)/100) == 1 then --2
  750.     if math.random(1,50) == 1 then --3
  751.      sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_NETR)
  752.      if math.random(1,500) == 1 then --4
  753.       sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_NETR)
  754.       end --4
  755.      end --3
  756.     end --2
  757.   if math.random(1,(sim.pressure(x/4,y/4)+256)*100) == 1 then --5
  758.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  759.    sim.pressure(x/4,y/4,32)
  760.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_NEUT)
  761.    sim.pressure(x/4,y/4,-32)
  762.    sim.partProperty(i, "life", 90)
  763.    repeat --6
  764.     attract(i,x,y,-10)
  765.     if math.random(1,2) == 1 then --7
  766.      sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  767.      end --7
  768.     until sim.partProperty(i, "life") < 0 --6
  769.    sim.partKill(i)
  770.    end --5
  771.   end --1
  772.  ) --*1
  773.  
  774. local brcryst = elements.allocate("TPT" , "BCRY")
  775.  elements.element(brcryst, elements.element(elements.DEFAULT_PT_PQRT))
  776.  elements.property(brcryst, "Name" , "BCRY")
  777.  elements.property(brcryst, "Description" , "Broken Crystal. Light powder, may shred lungs of organisms.")
  778.  elements.property(brcryst, "Properties", elements.TYPE_PART+elements.PROP_DEADLY)
  779.  elements.property(brcryst, "Color", 0xE9E9EF)
  780.  elements.property(brcryst, "PhotonReflectWavelengths", 0xEFEFEFF6)
  781.  elements.property(brcryst, "MenuSection", 8)
  782.  elements.property(brcryst, "Gravity", 0.056)
  783.  elements.property(brcryst, "Advection", 0.2)
  784.  elements.property(brcryst, "Weight", 2)
  785.  elements.property(brcryst, "AirDrag", 0.05)
  786.  elements.property(brcryst, "Diffusion", 0.1)
  787.  
  788. local cryst = elements.allocate("TPT" , "CRYT")
  789.  elements.element(cryst, elements.element(elements.DEFAULT_PT_QRTZ))
  790.  elements.property(cryst, "Name" , "CRYS")
  791.  elements.property(cryst, "Description" , "Crystal. Durable, grows")
  792.  elements.property(cryst, "Color", 0xEEEEF3)
  793.  elements.property(cryst, "PhotonReflectWavelengths", 0xF8F8F8FF)
  794.  elements.property(cryst, "MenuSection", 9)
  795.  elements.property(cryst, "HighPressure", 20.14)
  796.  elements.property(cryst, "HighPressureTransition", elements.TPT_PT_BCRY)
  797. elements.property(elements.TPT_PT_CRYT, "Update", --*1
  798.  function(i,x,y) --1
  799.   if math.random(1,100) == 1 then --2
  800.    sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_CRYT)
  801.    if math.random(1,20) == 1 then --3
  802.     sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_CRYT)
  803.     end --3
  804.    end --2
  805.   end --1
  806. ) --*1
  807.  
  808.  
  809.  elements.property(brcryst, "HighTemperatureTransition", elements.TPT_PT_CRYT)
  810.  
  811. local gasl = elements.allocate("TPT" , "GASL")
  812.  elements.element(gasl, elements.element(elements.DEFAULT_PT_GLOW))
  813.  elements.property(gasl, "Name" , "GASL")
  814.  elements.property(gasl, "HeatConduct", 255)
  815.  elements.property(gasl, "Color", 0xF0C020)
  816.  elements.property(gasl, "Flammable", 0)
  817.  elements.property(gasl, "MenuSection", 5)
  818.  elements.property(gasl, "Description" , "Gasoline, highly flammable.")
  819.  elements.property(elem.TPT_PT_GASL, "Update", --*1
  820.  function(i,x,y,s,nt) --1
  821.   if math.random(1,2) == 2 then --2
  822.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  823.     for r in sim.neighbors(x,y,1,1) do --4
  824.      if sim.partProperty(i, "tmp") == 0 then --5
  825.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
  826.        sim.partProperty(i, "tmp", -1)
  827.        end --6
  828.       end --5
  829.      if sim.partProperty(i, "tmp") == -1 then --7
  830.       if math.random(1,3) > 1 then --8
  831.        sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
  832.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+100)
  833.        sim.pressure(x/4,y/4,2)
  834.        if math.random(1,60) == 1 then --9
  835.         sim.partKill(i)
  836.         return
  837.         end --9
  838.        end --8
  839.       end --7
  840.      end --4
  841.     end --3
  842.    end --2
  843.   end --1
  844.   ) --*1
  845.  
  846. local logan = elements.allocate("TPT" , "XMEN")
  847.  elements.element(logan, elements.element(elements.DEFAULT_PT_IRON))
  848.  elements.property(logan, "Name" , "ADMT")
  849.  elements.property(logan, "Description" , "Adamantium, incredibly durable material. Almost virtually indestructible. An alloy of steel and vibranium")
  850.  elements.property(logan, "Color", 0xC8C8D0)
  851.  elements.property(logan, "HighTemperature", 9500.50)
  852.  elements.property(logan, "Weight", 1010)
  853.  elements.property(logan, "Hardness", 0)
  854.  
  855. local dmdd = elements.allocate("TPT" , "DMDD")
  856.  elements.element(dmdd, elements.element(elements.DEFAULT_PT_DMND))
  857.  elements.property(dmdd, "Name" , "DMDD")
  858.  elements.property(dmdd, "Description" , "Diamond dust. Yeah.")
  859.  elements.property(dmdd, "Color", 0xC6F6F6)
  860.  elements.property(dmdd, "MenuSection", 8)
  861.  elements.property(dmdd, "Properties", elements.TYPE_PART)
  862.  elements.property(dmdd, "Gravity", 0.112)
  863.  elements.property(dmdd, "Advection", 1)
  864.  elements.property(dmdd, "Weight", 100)
  865.  elements.property(dmdd, "AirDrag", 0.1)
  866.  elements.property(dmdd, "Falldown", 1)
  867.  elements.property(dmdd, "HighTemperature", 9999)
  868.  elements.property(dmdd, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
  869.  elements.property(dmdd, "Falldown", 1)
  870.  
  871. local anih = elements.allocate("TPT" , "ANIH")
  872.  elements.element(anih, elements.element(elements.DEFAULT_PT_DEST))
  873.  elements.property(anih, "Name" , "ANIH")
  874.  elements.property(anih, "Description" , "Annihilation.")
  875.  elements.property(anih, "Color", 0x603090)
  876.  elements.property(anih, "HotAir", 0.1)
  877.  elements.property(anih, "MenuSection", 11)
  878.  elements.property(elements.TPT_PT_ANIH, "Update", --*1
  879.   function(i,x,y,s,nt) --1
  880.   attract(i,x,y,0.1)
  881.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  882.    if math.random(1,1) == 1 then --3
  883.     for r in sim.neighbors(x,y,2,2) do --4
  884.      if math.random(1,6) == 3 then --5
  885.       sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  886.       if math.random(1,2) == 1 then --6
  887.        if sim.partProperty(r, "type") == elements.DEFAULT_PT_DMND then --7
  888.         sim.partProperty(r, "type", elements.TPT_PT_DMDD)
  889.         else if sim.partProperty(r, "type") ~= elements.TPT_PT_DMDD then --8
  890.          sim.pressure(x/4,y/4,255)
  891.          sim.partKill(r)
  892.          return
  893.          end --8
  894.         end --7
  895.        end --6
  896.       end --5
  897.      end --4
  898.     end --3
  899.    end --2
  900.   if math.random(1,8) == 1 then --9
  901.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
  902.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
  903.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
  904.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_SING)
  905.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
  906.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
  907.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
  908.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
  909.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
  910.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
  911.    sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_DEST)
  912.    sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
  913.    end --9
  914.   end --1
  915.  ) --*1
  916.  
  917.  local function funcGraphics(i, colr, colg, colb) --*1
  918.   return 1,ren.PMODE_LFLARE,30,colr,colg,colb,255,96,48,144
  919.   end --*1
  920.  elements.property(anih, "Graphics", funcGraphics)
  921.  
  922. local bullet = elements.allocate("TPT" , "BULT")
  923.  elements.element(bullet, elements.element(elements.DEFAULT_PT_BREL))
  924.  elements.property(bullet, "Name" , "BLLT")
  925.  elements.property(bullet, "Description" , "Bullet, travels with minimum decceleration and creates winds.")
  926.  elements.property(bullet, "Color", 0x433141)
  927.  elements.property(bullet, "MenuSection", 16)
  928.  elements.property(bullet, "Flammable", 0)
  929.  elements.property(bullet, "Loss", 1)
  930.  elements.property(bullet, "AirDrag", 0.35)
  931.  elements.property(bullet, "Weight", 101)
  932.  elements.property(bullet, "Gravity", 0.002)
  933.  elements.property(elem.TPT_PT_BULT, "Update",
  934.  function(i,x,y,s,nt) --1
  935.   if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) > 50 then --2
  936.    sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_FIRE)
  937.    sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_FIRE)
  938.    sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_FIRE)
  939.    sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_FIRE)
  940.    sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_FIRE)
  941.    sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_FIRE)
  942.    sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_FIRE)
  943.    sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_FIRE)
  944.    end --2
  945.   end --1
  946. ) --*1
  947.  
  948. local anmt = elements.allocate("TPT" , "AMTL")
  949.  elements.element(anmt, elements.element(elements.DEFAULT_PT_METL))
  950.  elements.property(anmt, "Name" , "AMTL")
  951.  elements.property(anmt, "Description" , "Anti-Metal, violently heats surrounding materials when sparked. Melts at cold temperatures.")
  952.  elements.property(anmt, "Color", 0x899469)
  953.  elements.property(anmt, "LowTemperature", 10)
  954.  elements.property(anmt, "LowTemperatureTransition", elements.DEFAULT_PT_LAVA)
  955.  elements.property(anmt, "HighTemperature", 10001)
  956.  elements.property(elem.TPT_PT_AMTL, "Update",
  957.  function(i,x,y,s,nt) --1
  958.   for r in sim.neighbors(x,y,2,2) do --2
  959.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_SPRK then --3
  960.     sim.partProperty(i, "temp", sim.partProperty(i, "temp")+500)
  961.     end --3
  962.    end --2
  963.   end --1
  964. ) --*1
  965.  
  966. local agas = elements.allocate("TPT" , "AGAS")
  967.  elements.element(agas, elements.element(elements.DEFAULT_PT_BOYL))
  968.  elements.property(agas, "Name" , "AGAS")
  969.  elements.property(agas, "HeatConduct", 255)
  970.  elements.property(agas, "HotAir", 0.001)
  971.  elements.property(agas, "Color", 0xFDFDB7)
  972.  elements.property(agas, "AirDrag", 0.001)
  973.  elements.property(agas, "AirLoss", 1)
  974.  elements.property(agas, "Diffusion", 1.25)
  975.  elements.property(agas, "MenuSection", 16)
  976.  elements.property(agas, "LowPressure",  -5)
  977.  elements.property(agas, "LowPressureTransition", elements.TPT_PT_ANLIQ)
  978.  elements.property(agas, "Description" , "Anti-Gas. Opposite of gas")
  979.  elements.property(elem.TPT_PT_AGAS, "Update", --*1
  980.  function(i,x,y,s,nt) --1
  981.   if math.random(1,2) == 2 then --2
  982.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  983.     for r in sim.neighbors(x,y,1,1) do --4
  984.      if sim.partProperty(i, "tmp") == 0 then --5
  985.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
  986.        sim.partProperty(i, "tmp", -1)
  987.        end --6
  988.       end --5
  989.      if sim.partProperty(i, "tmp") == -1 then --7
  990.       if math.random(1,2) == 1 then --8
  991.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
  992.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
  993.        sim.pressure(x/4,y/4,10)
  994.        if math.random(1,50) == 1 then --9
  995.         sim.partKill(i)
  996.         return
  997.         end --9
  998.        end --8
  999.       end --7
  1000.      end --4
  1001.     end --3
  1002.    end --2
  1003.   end --1
  1004.   ) --*1
  1005.  
  1006.  elements.property(aliq, "LowTemperature",  5)
  1007.  elements.property(aliq, "LowTemperatureTransition", elements.TPT_PT_AGAS)
  1008.  
  1009. local qtfm = elements.allocate("TPT", "RADI")
  1010.  elements.element(qtfm, elements.element(elements.DEFAULT_PT_PROT))
  1011.  elements.property(qtfm, "Name" , "RADI")
  1012.  elements.property(qtfm, "Description" , "Radio Waves. Spreads.")
  1013.  elements.property(qtfm, "Color", 0x888888)
  1014.  elements.property(qtfm, "Diffusion", 1)
  1015.  elements.property(qtfm, "Update", --*1
  1016.  function (i,x,y,s,n) --1
  1017.   if math.random(1,8) == 1 then --2
  1018.    sim.partKill(i)
  1019.    end --2
  1020.   end --1
  1021.   ) --*1
  1022.  
  1023.  local function funcGraphics(i, colr, colg, colb) --*1
  1024.   return 1,ren.PMODE_SPARK,255,colr,colg,colb,192,184,200,223
  1025.   end --*1
  1026.  elements.property(qtfm, "Graphics", funcGraphics)
  1027.  
  1028.  elements.property(elements.DEFAULT_PT_CO2, "Color", 0xBBBBBB)
  1029.  
  1030.  elements.property(elements.DEFAULT_PT_METL, "Name" , "STEL")
  1031.  elements.property(elements.DEFAULT_PT_METL, "Description" , "Steel, basic metal. Conducts")
  1032.  elements.property(elements.DEFAULT_PT_METL, "Color", 0x54545D)
  1033.  elements.property(elements.DEFAULT_PT_METL, "HighTemperature", 1643.15)
  1034.  
  1035. local argi = elements.allocate("TPT" , "ARGI")
  1036.  elements.element(argi, elements.element(elements.DEFAULT_PT_GOLD))
  1037.  elements.property(argi, "Name" , "SLVR")
  1038.  elements.property(argi, "Description" , "Silver, resistant to corrosion. Conducts at a faster pulse")
  1039.  elements.property(argi, "Color", 0xA0A5B0)
  1040.  elements.property(argi, "HighTemperature", 1235.46)
  1041.  elements.property(elem.TPT_PT_ARGI, "Update",
  1042.  function(i,x,y,s,nt) --1
  1043.   if sim.partProperty(i, "life") > 0 then --2
  1044.    sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
  1045.    end --2
  1046.   end --1
  1047. ) --*1
  1048.  
  1049.  elements.property(elements.DEFAULT_PT_SPRK, "Color", 0xDCECFF)
  1050.  
  1051. local trit = elements.allocate("TPT" , "TRIT")
  1052.  elements.element(trit, elements.element(elements.DEFAULT_PT_HYGN))
  1053.  elements.property(trit, "Name" , "TRIT")
  1054.  elements.property(trit, "Description" , "Tritium, decays into lighter components when struck with neutrons.")
  1055.  elements.property(trit, "Color", 0x11161D)
  1056.  elements.property(trit, "Gravity", 0.2)
  1057.  elements.property(trit, "PhotonReflectWavelengths", 0x00000001)
  1058.  elements.property(trit, "MenuSection", 10)
  1059.  function tritium(i,x,y,s,n)
  1060.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  1061.    if math.random(1,2) == 1 then --2
  1062.     tpt.parts[i].type = elements.DEFAULT_PT_DEUT
  1063.     tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  1064.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1065.     sim.pressure(x/4,y/4,5)
  1066.     else if math.random(1,6) == 1 then --3
  1067.      tpt.parts[i].type = elements.DEFAULT_PT_HYGN
  1068.      tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  1069.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1070.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1071.      sim.pressure(x/4,y/4,5)
  1072.      else if math.random(1,6) == 1 then --4
  1073.       tpt.parts[i].type = elements.TPT_PT_HE
  1074.       sim.pressure(x/4,y/4,5)
  1075.       tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
  1076.       tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'elec')
  1077.       end --4
  1078.      end --3
  1079.     end --2
  1080.    end --1
  1081.   if sim.pressure(x/4,y/4) > 1 then --3
  1082.    if math.random(1,250) == 10 then --4
  1083.     tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1084.     tpt.set_property("temp", math.huge, x ,y)
  1085.     end --4
  1086.    end --3
  1087.   if math.random(1,10000) == 10 then --5
  1088.    sim.pressure(x/4,y/4,2)
  1089.    end --5
  1090.   end --*1
  1091.  
  1092.  elements.property(elem.TPT_PT_TRIT, "Update", --*1
  1093.  function(i,x,y,s,nt) --1
  1094.   if math.random(1,2) == 2 then --2
  1095.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1096.     for r in sim.neighbors(x,y,1,1) do --4
  1097.      if sim.partProperty(i, "tmp") == 0 then --5
  1098.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --6
  1099.        sim.partProperty(i, "tmp", -1)
  1100.        end --6
  1101.       end --5
  1102.      if sim.partProperty(i, "tmp") == -1 then --7
  1103.       if math.random(1,2) == 1 then --8
  1104.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_ACID)
  1105.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+20)
  1106.        if math.random(1,2) == 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.    tritium(i,x,y,s,n)
  1116.   end --1
  1117.   ) --*1
  1118.  
  1119. local ltrt = elements.allocate("TPT" , "LTRT")
  1120.  elements.element(ltrt, elements.element(elements.TPT_PT_LHYG))
  1121.  elements.property(ltrt, "Name" , "LTRT")
  1122.  elements.property(ltrt, "Description" , "Liquid Tritium, dangerous.")
  1123.  elements.property(ltrt, "Color", 0x13161C)
  1124.  elements.property(ltrt, "HighTemperatureTransition", elements.TPT_PT_TRIT)
  1125.  elements.property(ltrt, "PhotonReflectWavelengths", 0x00000001)
  1126.  elements.property(ltrt, "MenuSection", 16)
  1127.  elements.property(elem.TPT_PT_LTRT, "Update", --*1
  1128.  function(i,x,y,s,nt) --1
  1129.   if math.random(1,2) == 2 then --2
  1130.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1131.     for r in sim.neighbors(x,y,1,1) do --4
  1132.      if sim.partProperty(i, "tmp") == 0 then --5
  1133.       if sim.partProperty(r, "type") == elements.DEFAULT_PT_DEUT then --6
  1134.        sim.partProperty(i, "tmp", -2)
  1135.        end --6
  1136.       end --5
  1137.      if sim.partProperty(i, "tmp") == -2 then --7
  1138.       if math.random(1,500) == 1 then --8
  1139.        sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_LHE)
  1140.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+200)
  1141.        if math.random(1,2) == 1 then --9
  1142.         sim.partKill(i)
  1143.         return
  1144.         end --9
  1145.        end --8
  1146.       end --7
  1147.      end --4
  1148.     end --3
  1149.    end --2
  1150.   end --1
  1151.   ) --*1
  1152.  
  1153. elements.property(trit, "LowTemperatureTransition", elements.TPT_PT_LTRT)
  1154.  
  1155. local pkic = elements.allocate("TPT" , "PKIC")
  1156.  elements.element(pkic, elements.element(elements.DEFAULT_PT_DMND))
  1157.  elements.property(pkic, "Name" , "PKIC")
  1158.  elements.property(pkic, "Description" , "Packed Ice.")
  1159.  elements.property(pkic, "Color", 0x6F94F4)
  1160.  elements.property(pkic, "MenuSection", 9)
  1161.  elements.property(pkic, "Temperature", 210.32)
  1162.  elements.property(pkic, "HeatConduct", 5)
  1163.  elements.property(elem.TPT_PT_PKIC, "Update",
  1164.  function(i,x,y,s,nt) --1
  1165.   if math.random(1,20) == 1 then --2
  1166.    if sim.partProperty(i, "temp") > 220.35 then --3
  1167.     sim.partProperty(i, "type", elements.DEFAULT_PT_ICE)
  1168.     end --3
  1169.    end --2
  1170.   end --1
  1171. ) --*1
  1172.  
  1173.  elements.property(elem.DEFAULT_PT_ICE, "Update",
  1174.  function(i,x,y,s,nt) --1
  1175.   if math.random(1,2) == 1 then --2
  1176.    if sim.partProperty(i, "temp") < 220.30 then --3
  1177.     sim.partProperty(i, "type", elements.TPT_PT_PKIC)
  1178.     end --3
  1179.    end --2
  1180.   end --1
  1181. ) --*1
  1182.  
  1183.  
  1184. local pala = elements.allocate("TPT" , "PALA")
  1185.  elements.element(pala, elements.element(elements.DEFAULT_PT_GOLD))
  1186.  elements.property(pala, "Name" , "PALA")
  1187.  elements.property(pala, "Description" , "Paladium, desintegrates over time with neutrons.")
  1188.  elements.property(pala, "Color", 0xCCC7BD)
  1189.  elements.property(pala, "PhotonReflectWavelengths", 0x2FF20000)
  1190.  elements.property(pala, "MenuSection", 10)
  1191.  elements.property(pala, "HighTemperature", 1828)
  1192.  function paladium(i,x,y,s,n)
  1193.   if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  1194.    if math.random(1,2) == 1 then --2
  1195.     tpt.parts[i].type = elements.TPT_PT_ARGI
  1196.     if math.random(1,2) == 1 then --3
  1197.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1198.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1199.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1200.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
  1201.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'lead')
  1202.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1203.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1204.      tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  1205.      tpt.set_property("temp", tpt.get_property("temp", x ,y)+5000, x ,y)
  1206.      end --3
  1207.     end --2
  1208.    end --1
  1209.   if math.random(1,10000) == 10 then --4
  1210.    sim.pressure(x/4,y/4,5)
  1211.    end --4
  1212.   end --*1
  1213.  tpt.element_func(paladium,pala)
  1214.  
  1215. local algae = elements.allocate("TPT", "ALGAE")
  1216.  elements.element(algae, elements.element(elements.DEFAULT_PT_SOAP))
  1217.  elements.property(algae, "Name" , "ALGE")
  1218.  elements.property(algae, "Description" , "Algae, spreads in water.")
  1219.  elements.property(algae, "Color", 0x407010)
  1220.  elements.property(algae, "Diffusion", 0.3)
  1221.  elements.property(algae, "Weight", 31)
  1222.  elements.property(algae, "MenuSection", 16)
  1223.  elements.property(elem.TPT_PT_ALGAE, "Update", --*1
  1224.  function(i,x,y,s,nt) --1
  1225.   if nt == 8 then --2
  1226.    for r in sim.neighbors(x,y,1,1) do --3
  1227.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
  1228.      if math.random(1,1000) > 1 then --4
  1229.       sim.partProperty(i, "vy", -0.05)
  1230.       end --5
  1231.      if math.random(1,1000) > 1 then --5
  1232.       sim.partProperty(i, "vx", math.random(-0.01,0.01))
  1233.       end --6
  1234.      end --4
  1235.     if math.random(1,250) < 4 then --7
  1236.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  1237.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  1238.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  1239.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  1240.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  1241.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  1242.      end --7
  1243.     if math.random(1,400) < 2 then --8
  1244.      sim.partKill(i)
  1245.      end --8
  1246.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
  1247.      if math.random(1,200) == 1 then --10
  1248.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_ALGAE)
  1249.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
  1250.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
  1251.       end --10
  1252.      end --9
  1253.     end --3
  1254.    end --2
  1255.   if math.random(1,400) < 2 then --11
  1256.    sim.partKill(i)
  1257.    end --11
  1258.   end --1
  1259. ) --*1
  1260.  
  1261. local ltac = elements.allocate("TPT", "LTAC")
  1262.  elements.element(ltac, elements.element(elements.DEFAULT_PT_SOAP))
  1263.  elements.property(ltac, "Name" , "LTAC")
  1264.  elements.property(ltac, "Description" , "Lactic acid, helps to decompose organic matter.")
  1265.  elements.property(ltac, "Color", 0xD7BCCD)
  1266.  elements.property(ltac, "Hardness", 1)
  1267.  elements.property(elem.TPT_PT_LTAC, "Update", --*1
  1268.  function(i,x,y,s,nt) --1
  1269.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1270.    if math.random(1,100) == 10 then --3
  1271.     for r in sim.neighbors(x,y,1,1) do --4
  1272.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT or sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --5
  1273.       if math.random(1,3) == 1 then --6
  1274.        sim.partProperty(r, "type", elements.TPT_PT_ASH)
  1275.        sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10)
  1276.        if math.random(1,13) == 1 then --7
  1277.         sim.pressure(x/4,y/4,0.1)
  1278.         sim.partKill(i)
  1279.         return
  1280.         end --7
  1281.        end --6
  1282.       end --5
  1283.      end --4
  1284.     end --3
  1285.    end --2
  1286.   end --1
  1287.   ) --*1
  1288.  
  1289. local bctr = elements.allocate("TPT", "BACT")
  1290.  elements.element(bctr, elements.element(elements.DEFAULT_PT_SOAP))
  1291.  elements.property(bctr, "Name" , "BCTR")
  1292.  elements.property(bctr, "Description" , "Bacteria, spreads and sticks.")
  1293.  elements.property(bctr, "Color", 0xE0F0A1)
  1294.  elements.property(bctr, "Diffusion", 0.3)
  1295.  elements.property(bctr, "Weight", 30)
  1296.  elements.property(bctr, "MenuSection", 11)
  1297.  
  1298. local bctrb = elements.allocate("TPT", "BCTR")
  1299.  elements.element(bctrb, elements.element(elements.DEFAULT_PT_SOAP))
  1300.  elements.property(bctrb, "Name" , "BCTD")
  1301.  elements.property(bctrb, "Description" , "Decomposer bacteria, decomposes plant matter.")
  1302.  elements.property(bctrb, "Color", 0xFFE990)
  1303.  elements.property(bctrb, "Diffusion", 0.3)
  1304.  elements.property(bctrb, "Weight", 30)
  1305.  elements.property(bctrb, "MenuSection", 16)
  1306.  
  1307. local bctra = elements.allocate("TPT", "BCTRA")
  1308.  elements.element(bctra, elements.element(elements.DEFAULT_PT_SOAP))
  1309.  elements.property(bctra, "Name" , "ABCT")
  1310.  elements.property(bctra, "Description" , "Airbourne bacteria.")
  1311.  elements.property(bctra, "Color", 0xC9E9FF)
  1312.  elements.property(bctra, "Diffusion", 0.2)
  1313.  elements.property(bctra, "Weight", 29)
  1314.  elements.property(bctra, "MenuSection", 16)
  1315.  elements.property(bctra, "Gravity", -0.025)
  1316.  
  1317. local bctrc = elements.allocate("TPT", "BCTRC")
  1318.  elements.element(bctrc, elements.element(elements.DEFAULT_PT_SOAP))
  1319.  elements.property(bctrc, "Name" , "BCTW")
  1320.  elements.property(bctrc, "Description" , "Bacterial wall, solid but still flows")
  1321.  elements.property(bctrc, "Color", 0xC9FF90)
  1322.  elements.property(bctrc, "Diffusion", 0.1)
  1323.  elements.property(bctrc, "Weight", 31)
  1324.  elements.property(bctrc, "MenuSection", 16)
  1325.  
  1326. local bctrp = elements.allocate("TPT", "BCTRP")
  1327.  elements.element(bctrp, elements.element(elements.DEFAULT_PT_SOAP))
  1328.  elements.property(bctrp, "Name" , "AQBC")
  1329.  elements.property(bctrp, "Description" , "Aquatic Bacteria. Floats and spreads through water slowly.")
  1330.  elements.property(bctrp, "Color", 0xFFF0FF)
  1331.  elements.property(bctrp, "Diffusion", 0.3)
  1332.  elements.property(bctrp, "Weight", 31)
  1333.  elements.property(bctrp, "MenuSection", 16)
  1334.  elements.property(elem.TPT_PT_BCTRP, "Update", --*1
  1335.  function(i,x,y,s,nt) --1
  1336.   if nt == 8 then --2
  1337.    for r in sim.neighbors(x,y,1,1) do --3
  1338.     if math.random(1,1000) > 1 then --4
  1339.      sim.partProperty(i, "vy", -0.05)
  1340.      end --4
  1341.     if math.random(1,1000) > 1 then --5
  1342.      sim.partProperty(i, "vx", math.random(-0.01,0.01))
  1343.      end --5
  1344.     if math.random(1,2000) < 4 then --6
  1345.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1346.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1347.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1348.      end --6
  1349.     if math.random(1,40000) < 2 then --7
  1350.      sim.partKill(i)
  1351.      end --7
  1352.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --8
  1353.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  1354.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTR)
  1355.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  1356.      end --8
  1357.     end --3
  1358.    end --2
  1359.   end --1
  1360. ) --*1
  1361.  
  1362.  elements.property(elem.TPT_PT_BCTRC, "Update", --*1
  1363.  function(i,x,y,s,nt) --1
  1364.   if s ~=8 and nt ~=0 and s > 0 then --2
  1365.    for r in sim.neighbors(x,y,1,1) do --3
  1366.     if math.random(1,1000) > 1 then --4
  1367.      sim.partProperty(i, "vy", 0)
  1368.      end --4
  1369.     if math.random(1,1000) > 1 then --5
  1370.      sim.partProperty(i, "vx", 0)
  1371.      end --5
  1372.     if math.random(1,200000) < 4 then --6
  1373.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1374.      sim.partProperty(i, "temp", 338)
  1375.      end --6
  1376.     if math.random(1,200000) == 1 then --7
  1377.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1378.      end --7
  1379.     if math.random(1,200000) == 1 then --8
  1380.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1381.      sim.partProperty(i, "temp", 338)
  1382.      end --8
  1383.     if math.random(1,4000) < 2 then --9
  1384.      sim.partKill(i)
  1385.      end --9
  1386.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --10
  1387.      if math.random(1,40) then --11
  1388.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  1389.       sim.partProperty(i, "temp", 338)
  1390.       sim.partKill(4)
  1391.       end --11
  1392.      end --10
  1393.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --12
  1394.      if math.random(1,20) == 1 then --13
  1395.       if math.random(1,50) == 1 then --14
  1396.        sim.partProperty(i, "type", elements.TPT_PT_BCTRP)
  1397.        end --14
  1398.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  1399.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  1400.       sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  1401.      sim.partProperty(i, "temp", 338)
  1402.       sim.partKill(i)
  1403.       end --13
  1404.      end --12
  1405.     if sim.partProperty(r, "type") == elements.TPT_PT_BCTRP then --15
  1406.      if math.random(1,200) == 1 then --16
  1407.       sim.partKill(i)
  1408.       end --16
  1409.      end --15
  1410.     end --3
  1411.    end --2
  1412.   end --1
  1413. ) --*1
  1414.  
  1415.  elements.property(elem.TPT_PT_BCTR, "Update", --*1
  1416.  function(i,x,y,s,nt) --1
  1417.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1418.    for r in sim.neighbors(x,y,1,1) do --3
  1419.     if math.random(1,10) > 1 then --4
  1420.      sim.partProperty(i, "vy", 0)
  1421.      end --4
  1422.     if math.random(1,10) > 1 then --5
  1423.      sim.partProperty(i, "vx", 0)
  1424.      end --5
  1425.     if math.random(1,200) < 4 then --6
  1426.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1427.      sim.partProperty(i, "temp", 338)
  1428.      end --6
  1429.     if math.random(1,4000) < 2 then --7
  1430.      sim.partKill(i)
  1431.      end --7
  1432.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --8
  1433.      if math.random(1,20) < 2 then --9
  1434.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1435.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1436.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_LTAC)
  1437.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_LTAC)
  1438.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  1439.      sim.partProperty(i, "temp", 338)
  1440.       sim.partKill(r)
  1441.       end --9
  1442.      end --8
  1443.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT then --10
  1444.      if math.random(1,20) < 2 then --11
  1445.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1446.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1447.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  1448.       sim.partKill(r)
  1449.       end --11
  1450.      end --10
  1451.     if sim.partProperty(r, "type") == elements.TPT_PT_ALGAE then --12
  1452.      if math.random(1,20) < 2 then --13
  1453.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  1454.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  1455.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  1456.       sim.partKill(r)
  1457.       end --13
  1458.      end --12
  1459.     if math.random(1,1000) == 1 then --14
  1460.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1461.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1462.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  1463.      sim.partCreate(-1, math.random(x-3,x+3),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1464.      sim.partProperty(i, "temp", 338)
  1465.      end --14
  1466.     if math.random(1,10000) == 1 then --15
  1467.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1468.      end --15
  1469.     if math.random(1,1000) == 1 then --16
  1470.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  1471.      end --16
  1472.     end --3
  1473.    end --2
  1474.   end --1
  1475.   ) --*1
  1476.  
  1477.  elements.property(elem.TPT_PT_BCTRA, "Update", --*1
  1478.  function(i,x,y,s,nt) --1
  1479.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1480.    for r in sim.neighbors(x,y,1,1) do --3
  1481.     if math.random(1,20) > 1 then --4
  1482.      sim.partProperty(i, "vy", -0.01)
  1483.      end --4
  1484.     if math.random(1,20) > 1 then --5
  1485.      sim.partProperty(i, "vx", 0)
  1486.      end --5
  1487.     if math.random(1,400) < 4 then --6
  1488.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1489.      end --6
  1490.     if math.random(1,1600) < 2 then --7
  1491.      sim.partKill(i)
  1492.      end --7
  1493.     if sim.partProperty(r, "type") == elements.TPT_PT_ASH then --8
  1494.      if math.random(1,20) < 2 then --9
  1495.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1496.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1497.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
  1498.       sim.partKill(r)
  1499.       end --9
  1500.      end --8
  1501.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_OXYG then --10
  1502.      if math.random(1,20) < 2 then --11
  1503.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1504.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1505.       sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
  1506.       sim.partKill(r)
  1507.       end --11
  1508.      end --10
  1509.     if math.random(1,125) == 1 then --12
  1510.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+1),elements.TPT_PT_BCTRC)
  1511.      end --12
  1512.     if math.random(1,10000) == 1 then --12
  1513.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  1514.      end --12
  1515.     end --3
  1516.    end --2
  1517.   end --1
  1518.   ) --*1
  1519.  
  1520.  elements.property(elem.TPT_PT_BACT, "Update", --*1
  1521.  function(i,x,y,s,nt) --1
  1522.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1523.    for r in sim.neighbors(x,y,1,1) do --3
  1524.     if math.random(1,20) > 1 then --4
  1525.      sim.partProperty(i, "vy", -0.01)
  1526.      end --4
  1527.     if math.random(1,20) > 1 then --5
  1528.      sim.partProperty(i, "vx", 0)
  1529.      end --5
  1530.     if math.random(1,20) < 2 then --6
  1531.      sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  1532.      sim.partKill(i)
  1533.      end --6
  1534.     end --3
  1535.    end --2
  1536.   end --1
  1537.   ) --*1
  1538.  
  1539. local sdpr = elements.allocate("TPT" , "SPPR")
  1540.  elements.element(sdpr, elements.element(elements.DEFAULT_PT_DMND))
  1541.  elements.property(sdpr, "Name" , "SPPR")
  1542.  elements.property(sdpr, "Description" , "Sandpaper, Gritty.")
  1543.  elements.property(sdpr, "Color", 0x6F6245)
  1544.  elements.property(sdpr, "HeatConduct", 4)
  1545.  elements.property(elem.TPT_PT_SPPR, "Update",
  1546.  function(i,x,y,s,nt) --1
  1547.   for r in sim.neighbors(x,y,1,1) do --2
  1548.    if sim.partProperty(r, "type") > 0 then --3
  1549.     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)
  1550.     sim.partProperty(r, "vy", 0)
  1551.     sim.partProperty(r, "vx", 0)
  1552.     end --3
  1553.    end --2
  1554.   end --1
  1555. ) --*1
  1556.  
  1557. local jean = elements.allocate("TPT", "DISA")
  1558.  elements.element(jean, elements.element(elements.DEFAULT_PT_THDR))
  1559.  elements.property(jean, "Name" , "DISA")
  1560.  elements.property(jean, "Description" , "\"Cause Havok.\"")
  1561.  elements.property(jean, "Weight", -1)
  1562.  elements.property(jean, "Loss", -1.01)
  1563.  elements.property(jean, "MenuSection", 16)
  1564.  elements.property(jean, "Diffusion", 0)
  1565.  elements.property(elem.TPT_PT_DISA, "Update", --*1
  1566.  function(i,x,y,s) --1
  1567.   if s > 6 then --2
  1568.    if math.random(1,20) == 20 then --3
  1569.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.DEFAULT_PT_THDR)
  1570.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_TORN)
  1571.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_STRM)
  1572.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_CAVE)
  1573.     sim.pressure(x/4,y/4,16)
  1574.     if math.random(1,5) == 5 then --4
  1575.      sim.partKill(i)
  1576.      end --4
  1577.     end --3
  1578.    end --2
  1579.   end --1
  1580.   ) --*1
  1581.  
  1582. local co2s = elements.allocate("TPT", "CSNW")
  1583.  elements.element(co2s, elements.element(elements.DEFAULT_PT_SNOW))
  1584.  elements.property(co2s, "Name" , "CSNW")
  1585.  elements.property(co2s, "Description" , "CO2 Snow.")
  1586.  elements.property(co2s, "Color", 0xC2C2C2)
  1587.  elements.property(co2s, "Diffusion", 0.1)
  1588.  elements.property(co2s, "HighTemperature", 10001)
  1589.  elements.property(co2s, "Temperature", 186.65)
  1590.  elements.property(co2s, "Weight", 31)
  1591.  elements.property(co2s, "MenuSection", 16)
  1592.  elements.property(elements.TPT_PT_CSNW, "Update", --*1
  1593.  function(i,x,y) --1
  1594.   if sim.partProperty(i, "temp") > 194.65 then --2
  1595.    if math.random(1,450) == 1 then --3
  1596.     sim.partChangeType(i, elements.DEFAULT_PT_CO2)
  1597.     end --3
  1598.    end --2
  1599.   end --1
  1600.  ) --*1
  1601.  
  1602.  elements.property(elements.DEFAULT_PT_DRIC, "HighPressure", 1.2)
  1603.  elements.property(elements.DEFAULT_PT_DRIC, "HighPressureTransition", elements.TPT_PT_CSNW)
  1604.  
  1605.  elements.property(elements.DEFAULT_PT_COAL, "Update", --*1
  1606.  function(i,x,y,s,nt) --1
  1607.   if sim.pressure(x/4,y/4) < -9.5 then --2
  1608.    if math.random(1,950) == 1 then --3
  1609.     sim.partProperty(i, "type", elements.TPT_PT_GRPH)
  1610.     sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.DEFAULT_PT_SMKE)
  1611.     sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.TPT_PT_ASH)
  1612.     end --3
  1613.    end --2
  1614.   end --1
  1615.   ) --*1
  1616.  
  1617. local ground = elements.allocate("TPT" , "GRND")
  1618.  elements.element(ground, elements.element(elements.DEFAULT_PT_STNE))
  1619.  elements.property(ground, "Name" , "GRND")
  1620.  elements.property(ground, "Description" , "Ground.")
  1621.  elements.property(ground, "Color", 0xA2A29A)
  1622.  elements.property(ground, "HighTemperature", 10001)
  1623.  elements.property(ground, "MenuSection", 16)
  1624.  elements.property(ground, "Flammable", 0)
  1625.  elements.property(elem.TPT_PT_GRND, "Update",
  1626.  function(i,x,y,s,nt) --1
  1627.   if math.random(1,2) == 1 then --2
  1628.   sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_SAND)
  1629.   sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_STNE)
  1630.   sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_DUST)
  1631.   end --2
  1632.  end --1
  1633. ) --*1
  1634.  
  1635. local brwf = elements.allocate("TPT" , "BRWF")
  1636.  elements.element(brwf, elements.element(elements.DEFAULT_PT_EQVE))
  1637.  elements.property(brwf, "Name" , "BRWF")
  1638.  elements.property(brwf, "Description" , "Broken Tungsten.")
  1639.  elements.property(brwf, "Color", 0x5E575B)
  1640.  elements.property(brwf, "HighTemperature", 3595.0)
  1641.  elements.property(brwf, "HighTemperatureTransition", elements.DEFAULT_PT_TUNG)
  1642.  elements.property(brwf, "MenuSection", 16)
  1643.  elements.property(brwf, "Flammable", 0)
  1644.  elements.property(elem.DEFAULT_PT_BRMT, "Update",
  1645.  function(i,x,y,s,nt) --1
  1646.   if sim.partProperty(i, "ctype") == elements.DEFAULT_PT_TUNG then --2
  1647.   sim.partProperty(i, "type", elements.TPT_PT_BRWF)
  1648.   end --2
  1649.  end --1
  1650. ) --*1
  1651.  
  1652.  elements.property(elements.DEFAULT_PT_CFLM, "Falldown", 2)
  1653.  elements.property(elements.DEFAULT_PT_CFLM, "Gravity", 0.1)
  1654.  
  1655. local lo3 = elements.allocate("TPT", "LO3")
  1656.  elements.element(lo3, elements.element(elements.DEFAULT_PT_LOXY))
  1657.  elements.property(lo3, "Name" , "LO3")
  1658.  elements.property(lo3, "Description" , "Liquid Ozone, very cold. Horrifying")
  1659.  elements.property(lo3, "Flammable", 5.65)
  1660.  elements.property(lo3, "Explosive", 0)
  1661.  elements.property(lo3, "Color", 0x4F68AC)
  1662.  elements.property(lo3, "Temperature", 145.15)
  1663.  elements.property(lo3, "MenuSection", 7)
  1664.  
  1665. local o3 = elements.allocate("TPT", "O3")
  1666.  elements.element(o3, elements.element(elements.DEFAULT_PT_HYGN))
  1667.  elements.property(o3, "Name" , "O3")
  1668.  elements.property(o3, "Description" , "Ozone, strong oxidizer.")
  1669.  elements.property(o3, "Color", 0x6079BD)
  1670.  elements.property(o3, "LowTemperature", 159.1)
  1671.  elements.property(o3, "LowTemperatureTransition", elements.TPT_PT_LO3)
  1672.  elements.property(elem.TPT_PT_O3, "Update",
  1673.  function(i,x,y,s,nt) --1
  1674.   for r in sim.neighbors(x,y,1,1) do --2
  1675.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --3
  1676.     sim.partProperty(r, "life", 1000)
  1677.     sim.partProperty(r, "vy", sim.partProperty(r, "vy")*1.05)
  1678.     sim.partProperty(r, "vx", sim.partProperty(r, "vx")*1.05)
  1679.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")+100)
  1680.     sim.pressure(x/4,y/4,0.1)
  1681.     if math.random(1,500) == 1 then --4
  1682.      sim.partKill(i)
  1683.      end --4
  1684.     end --3
  1685.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLSM then --5
  1686.     sim.partProperty(r, "life", math.random(125,500))
  1687.     sim.partProperty(r, "vy", sim.partProperty(r, "vy")*1.1)
  1688.     sim.partProperty(r, "vx", sim.partProperty(r, "vx")*1.1)
  1689.     sim.partProperty(r, "temp", sim.partProperty(r, "temp")+200)
  1690.     sim.pressure(x/4,y/4,0.1)
  1691.     if math.random(1,500) == 1 then --6
  1692.      sim.partKill(i)
  1693.      end --6
  1694.     end --5
  1695.    end --2
  1696.   end --1
  1697. ) --*1
  1698.  
  1699.  elements.property(lo3, "HighTemperature", 161.1)
  1700.  elements.property(lo3, "HighTemperatureTransition", elements.TPT_PT_O3)
  1701.  
  1702.  elements.property(elements.DEFAULT_PT_PLSM, "Falldown", 2)
  1703.  elements.property(elements.DEFAULT_PT_PLSM, "Gravity", 0)
  1704.  
  1705.  elements.property(elem.TPT_PT_HE, "Update", --*1
  1706. function(i,x,y,s) --1
  1707.   if sim.partProperty(i, "temp") < 4.15 then --2
  1708.    if math.random(1,800) == 1 then --3
  1709.     sim.partProperty(i, "type", elements.TPT_PT_LHE)
  1710.     end --3
  1711.    end --2
  1712.   if sim.partProperty(i, "temp") > 4000 then --4
  1713.    if sim.pressure(x/4,y/4) > 100 then --5
  1714.     sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_PHOT)
  1715.     sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_PHOT)
  1716.     sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_CO2)
  1717.     sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_OXYG)
  1718.     sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_NBLE)
  1719.     sim.partCreate(-1, x+1, y, elements.TPT_PT_HE3)
  1720.     sim.partCreate(-1, x-1, y, elements.TPT_PT_NEUT)
  1721.     if math.random(1,25) == 1 then --6
  1722.      sim.partCreate(-1, x-1, y, elements.TPT_PT_O3)
  1723.      sim.partProperty(i, "tmp2", 4)
  1724.      sim.partProperty(i, "tmp", math.random(0,359))
  1725.      sim.partProperty(i, "life", math.random(1,4))
  1726.      sim.pressure(x/4,y/4,150)
  1727.      sim.partProperty(i, "type", elements.DEFAULT_PT_LIGH)
  1728.      return
  1729.      end --6
  1730.     end --5
  1731.    end --4
  1732.   end --1
  1733.   ) --*1
  1734.  
  1735.  elements.property(elem.DEFAULT_PT_OXYG, "Update",
  1736.  function(i,x,y,s,nt) --1
  1737.   for r in sim.neighbors(x,y,1,1) do --2
  1738.    if sim.partProperty(r, "type") == elements.DEFAULT_PT_LIGH then --3
  1739.     sim.partProperty(i, "type", elements.TPT_PT_O3)
  1740.     end --3
  1741.    end --2
  1742.   end --1
  1743. ) --*1
  1744.  
  1745. local magm = elements.allocate("TPT" , "MAGM")
  1746.  elements.element(magm, elements.element(elements.DEFAULT_PT_LAVA))
  1747.  elements.property(magm, "Name" , "MAGM")
  1748.  elements.property(magm, "Description" , "Magma.")
  1749.  elements.property(magm, "Color", 0xFA7E3B)
  1750.  elements.property(magm, "Weight", 99)
  1751.  elements.property(magm, "Temperature", 1950.32)
  1752.  elements.property(magm, "HeatConduct", 10)
  1753.  elements.property(magm, "HotAir", 0.01)
  1754.  elements.property(magm, "Advection", 0.05)
  1755.  elements.property(elem.TPT_PT_MAGM, "Update",
  1756.  function(i,x,y,s,nt) --1
  1757.   if math.random(1,20) == 1 then --2
  1758.    sim.partProperty(i, "type", elements.DEFAULT_PT_LAVA)
  1759.    end --2
  1760.   end --1
  1761. ) --*1
  1762.  
  1763.  elements.property(elem.DEFAULT_PT_LAVA, "Update", --*1
  1764.  function(i,x,y,s,nt) --1
  1765.   if math.random(1,2) == 2 then --2
  1766.    for r in sim.neighbors(x,y,1,1) do --3
  1767.     if sim.partProperty(r, "type") == elements.DEFAULT_PT_LAVA then --4
  1768.      if sim.partProperty(r, "ctype") == elements.DEFAULT_PT_METL then --5
  1769.       if sim.partProperty(i, "ctype") == elements.DEFAULT_PT_VIBR then --6
  1770.        sim.partProperty(r, "type", elements.TPT_PT_XMEN)
  1771.        sim.partProperty(i, "type", elements.TPT_PT_XMEN)
  1772.        end --6
  1773.       end --5
  1774.      end --4
  1775.     end --3
  1776.    end --2
  1777.   if math.random(1,2) == 2 then --7
  1778.    if sim.partProperty(i, "ctype") == elements.TPT_PT_DMDD then --9
  1779.     sim.partProperty(i, "ctype", elements.DEFAULT_PT_DMND)
  1780.     end --8
  1781.    end --7
  1782.   if math.random(1,100) == 1 then --9
  1783.    if sim.partProperty(i, "temp") > 1920.30 then --10
  1784.     sim.partProperty(i, "type", elements.TPT_PT_MAGM)
  1785.     end --10
  1786.    end --9
  1787.   end --1
  1788.   ) --*1
  1789.  
  1790. local h2o2 = elements.allocate("TPT", "H2O2")
  1791.  elements.element(h2o2, elements.element(elements.DEFAULT_PT_SOAP))
  1792.  elements.property(h2o2, "Name" , "H2O2")
  1793.  elements.property(h2o2, "Description" , "Hydrogen Peroxide, corrosive, decomposes into oxygen and water, rarely ozone.")
  1794.  elements.property(h2o2, "Color", 0x1E41CF)
  1795.  elements.property(h2o2, "Hardness", 0)
  1796.  elements.property(h2o2, "Weight", 30)
  1797.  elements.property(elem.TPT_PT_H2O2, "Update", --*1
  1798.  function(i,x,y,s,nt) --1
  1799.   if s ~=8 and nt ~=0 and nt - s > 0 then --2
  1800.    if math.random(1,100) == 10 then --3
  1801.     for r in sim.neighbors(x,y,1,1) do --4
  1802.      if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  1803.       if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  1804.        if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  1805.         if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  1806.          if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  1807.           if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_OXYG then --10
  1808.            if sim.partProperty(r, "type") ~= elements.TPT_PT_O3 then --11
  1809.             if math.random(1,20) == 1 then --12
  1810.              sim.partProperty(r, "type", elements.DEFAULT_PT_O2)
  1811.              sim.partProperty(i, "temp", sim.partProperty(i, "temp")+300)
  1812.              if math.random(1,10) == 1 then --13
  1813.               sim.pressure(x/4,y/4,2)
  1814.               sim.partProperty(r, "type", elements.DEFAULT_PT_WATR)
  1815.               if math.random(1,10) == 1 then --14
  1816.                sim.partProperty(i, "type", elements.TPT_PT_O3)
  1817.                return
  1818.                end --14
  1819.               end --13
  1820.              end --12
  1821.             end --11
  1822.            end --10
  1823.           end --9
  1824.          end --8
  1825.         end --7
  1826.        end --6
  1827.       end --5
  1828.      end --4
  1829.     end --3
  1830.    end --2
  1831.   end --1
  1832.   ) --*1
  1833.  
  1834. local cmnt = elements.allocate("TPT" , "CMNT")
  1835.  elements.element(cmnt, elements.element(elements.DEFAULT_PT_WATR))
  1836.  elements.property(cmnt, "Name" , "CMNT")
  1837.  elements.property(cmnt, "Description" , "Cement, hardens over time.")
  1838.  elements.property(cmnt, "HighTemperature", 10001)
  1839.  elements.property(cmnt, "Weight", 31)
  1840.  elements.property(cmnt, "Color", 0x5E5E5E)
  1841.  elements.property(elem.TPT_PT_CMNT, "Update",
  1842.  function(i,x,y,s,nt) --1
  1843.   if math.random(1,12) == 1 then --2
  1844.    if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) < 0.1 then --3
  1845.     if math.random(1,10) == 1 then --4
  1846.      sim.partProperty(i, "type", elements.DEFAULT_PT_BRCK)
  1847.      else if math.random(1,100) == 1 then --5
  1848.       sim.partProperty(i, "type", elements.DEFAULT_PT_CNCT)
  1849.       else if math.random(1,500) == 1 then --6
  1850.       sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
  1851.       end --6
  1852.      end --5
  1853.     end --4
  1854.    end --3
  1855.   end --2
  1856.  end --1
  1857. ) --*1
  1858.  
  1859. local cmnp = elements.allocate("TPT", "CMNP")
  1860.  elements.element(cmnp, elements.element(elements.DEFAULT_PT_DUST))
  1861.  elements.property(cmnp, "Name" , "CMNP")
  1862.  elements.property(cmnp, "Description" , "Cement powder, mix with water to get cement.")
  1863.  elements.property(cmnp, "Color", 0x7F7F7F)
  1864.  elements.property(cmnp, "Flammable", 0)
  1865.  elements.property(elem.TPT_PT_CMNP, "Update", --*1
  1866.  function(i,x,y,s,nt) --1
  1867.   if math.random(1,50) == 10 then --2
  1868.    if s ~=8 and nt ~=0 and nt - s > 0 then --3
  1869.     for r in sim.neighbors(x,y,1,1) do --4
  1870.      if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --5
  1871.       sim.partChangeType(r, elements.TPT_PT_CMNT)
  1872.       sim.partChangeType(i, elements.TPT_PT_CMNT)
  1873.       end --5
  1874.      end --4
  1875.     end --3
  1876.    end --2
  1877.   end --1
  1878.   ) --*1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement