Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function velocity(i,v,n) --*1
- local angle = math.random(1,n)*(2*math.pi/n)
- tpt.set_property("vx", v*math.cos(angle), i)
- tpt.set_property("vy", v*math.sin(angle), i)
- tpt.set_property("tmp", -1, i)
- end --*1
- local function velocity_2(i,v,n) --*1
- if tpt.get_property("tmp", i) == 0 then --1
- local angle_2 = math.random(1,n)*(2*math.pi/n)
- tpt.set_property("vx", v*math.cos(angle_2), i)
- tpt.set_property("vy", v*math.sin(angle_2), i)
- tpt.set_property("tmp", -1, i)
- end --1
- end --*1
- local function attract(i,x,y,a) --*1
- sim.gravMap(x/4,y/4,a)
- end --*1
- elements.property(elements.DEFAULT_PT_EXOT, "Update", --*1
- function(i,x,y)
- sim.gravMap(x/4,y/4,-0.005)
- end --1
- ) --*1
- local function glitter(i,colr,colg,colb,r,g,b,a) --*1
- 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)
- end --*1
- local qtfm = elements.allocate("TPT", "RADI")
- elements.element(qtfm, elements.element(elements.DEFAULT_PT_PROT))
- elements.property(qtfm, "Name", "RADI")
- elements.property(qtfm, "Description" , "Background Radiation. Spreads.")
- elements.property(qtfm, "Color", 0x999999)
- elements.property(qtfm, "Diffusion", 0.75)
- elements.property(qtfm, "Properties", elements.TYPE_ENERGY+elements.PROP_LIFE_DEC+elements.PROP_LIFE_KILL_DEC)
- elements.property(qtfm, "Create", --*1
- function(i,x,y) --1
- sim.partProperty(i, "life", 50)
- end --1
- ) --*1
- elements.property(qtfm, "Update", --*2
- function(i,x,y) --1
- velocity_2(i,2,4)
- if math.random(0,7) > 0 then --3
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- if sim.partProperty(i, "life") < 1 then --4
- sim.partKill(i)
- end --4
- end --3
- if math.random(1,20000) == 1 then --5
- sim.partProperty(i, "life", 500)
- sim.partProperty(i, "ctype", 1073741823)
- sim.partProperty(i, "type", elements.DEFAULT_PT_PHOT)
- end --5
- end --1
- ) --*2
- local function funcGraphics(i, colr, colg, colb) --*1
- return 1,ren.PMODE_FLAT+ren.FIRE_ADD,255,128,128,128,64,128,128,128
- end --*1
- elements.property(qtfm, "Graphics", funcGraphics)
- local function radiate(i,x,y,s,t) --*1
- if math.random(0,(s/5)) == 0 then --1
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RADI)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+t)
- end --1
- end --*1
- local nept = elements.allocate("TPT" , "NEPT")
- elements.element(nept, elements.element(elements.DEFAULT_PT_PLUT))
- elements.property(nept, "Name" , "NEPT")
- elements.property(nept, "Description" , "Neptunium, radioactive. Quickly heats up when bombarded with neutrons.")
- elements.property(nept, "Color", 0x557020)
- elements.property(nept, "PhotonReflectWavelengths", 0x002FF200)
- elements.property(nept, "MenuSection", 10)
- local mrcv = elements.allocate("TPT", "MRCV")
- elements.element(mrcv,elem.element(elem.DEFAULT_PT_WTRV))
- elements.property(mrcv, "Name" , "MRCV")
- elements.property(mrcv, "Description" , "Mercury Vapor.")
- elements.property(mrcv, "Color", 0x6D6567)
- elements.property(mrcv, "Temperature", 637.85)
- elements.property(mrcv, "AirDrag", 0.01)
- elements.property(mrcv, "Loss", 0.5)
- elements.property(mrcv, "LowTemperature", 618.32)
- elements.property(mrcv, "LowTemperatureTransition", elements.DEFAULT_PT_MERC)
- elements.property(elements.DEFAULT_PT_MERC, "Update", --*1
- function(i,x,y) --1
- if sim.partProperty(i, "temp") > 628.91 then --2
- if math.random(1,450) == 1 then --3
- sim.partChangeType(i, elements.TPT_PT_MRCV)
- end --3
- end --2
- end --1
- ) --*1
- local anti = elements.allocate("TPT" , "ANTI")
- elements.element(anti, elements.element(elements.DEFAULT_PT_SING))
- elements.property(anti, "Name" , "ANTI")
- elements.property(anti, "Description" , "Anti Singularity, incredibly destructive. Slowly increases in size")
- elements.property(anti, "Color", 0xDBDBDB)
- elements.property(anti, "HotAir", 0.15)
- elements.property(anti, "MenuSection", 16)
- elements.property(elements.TPT_PT_ANTI, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,-0.75)
- if math.random(1,50) == 1 then --2
- sim.partCreate(-1, x+math.random(-1,1),y+math.random(-1,1),elements.TPT_PT_ANTI)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_SING, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,0.75)
- end --1
- ) --*1
- local ash = elements.allocate("TPT", "ASH")
- elements.element(ash, elements.element(elements.DEFAULT_PT_DUST))
- elements.property(ash, "Name" , "ASH")
- elements.property(ash, "Description" , "Ash, light powder. Turns into oil under pressure.")
- elements.property(ash, "Color", 0x393224)
- elements.property(ash, "Gravity", 0.056)
- elements.property(ash, "Advection", 0.2)
- elements.property(ash, "AirDrag", 0.05)
- elements.property(ash, "Flammable", 25.56)
- local lhyg = elements.allocate("TPT", "LHYG")
- elements.element(lhyg, elements.element(elements.DEFAULT_PT_LOXY))
- elements.property(lhyg, "Name" , "LHYG")
- elements.property(lhyg, "Description" , "Liquid Hydrogen, very cold. Incredibly flammable")
- elements.property(lhyg, "Flammable", 5000.65)
- elements.property(lhyg, "Explosive", 1)
- elements.property(lhyg, "Color", 0x3D68CD)
- elements.property(lhyg, "Temperature", 14.15)
- elements.property(lhyg, "MenuSection", 7)
- elements.property(lhyg, "HighTemperature", 18.15)
- elements.property(lhyg, "HighTemperatureTransition", elements.DEFAULT_PT_HYGN)
- elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", 15.24)
- elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", elements.TPT_PT_LHYG)
- local pb = elements.allocate("TPT" , "LEAD")
- elements.element(pb, elements.element(elements.DEFAULT_PT_IRON))
- elements.property(pb, "Name" , "LEAD")
- elements.property(pb, "Description" , "Lead, absorbs neutrons. Conducts electricity.")
- elements.property(pb, "Color", 0x686868)
- elements.property(pb, "Hardness", 0)
- elements.property(pb, "HighTemperature", 601.25)
- elements.property(pb, "Properties", elements.PROP_NEUTABSORB+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_DEADLY)
- local mnpr = elements.allocate("TPT", "MNPR")
- elements.element(mnpr, elements.element(elements.DEFAULT_PT_BOYL))
- elements.property(mnpr, "Name" , "MONO")
- elements.property(mnpr, "Description" , "Monopropellant. Disperses quickly.")
- elements.property(mnpr, "Color", 0xB0B0B0)
- elements.property(mnpr, "Advection", 0.2)
- elements.property(mnpr, "AirDrag", 0.05)
- elements.property(mnpr, "HotAir", 0.01)
- elements.property(mnpr, "MenuSection", 16)
- elements.property(elements.TPT_PT_MNPR, "Update", --*1
- function(i,x,y) --1
- if math.random(1,30) == 1 then --2
- sim.partKill(i)
- end --2
- end --1
- ) --*1
- local mnpl = elements.allocate("TPT", "MNPL")
- elements.element(mnpl, elements.element(elements.DEFAULT_PT_LOXY))
- elements.property(mnpl, "Name" , "MNPL")
- elements.property(mnpl, "Description" , "Liquid Monopropellant. Releases lots of pressure and cools down when boiled")
- elements.property(mnpl, "Flammable", 0)
- elements.property(mnpl, "Color", 0xA0A0A0)
- elements.property(mnpl, "Temperature", 180.15)
- elements.property(mnpl, "MenuSection", 5)
- elements.property(mnpl, "Diffusion", 0.1)
- elements.property(mnpl, "HighTemperature", 200.15)
- elements.property(mnpl, "HighTemperatureTransition", elements.TPT_PT_MNPR)
- elements.property(elements.TPT_PT_MNPL, "Update", --*1
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "type") == elements.TPT_PT_MNPR then --3
- if math.random(1,45) == 1 then --4
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-75)
- sim.pressure(x/4,y/4,10)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(mnpr, "LowTemperature", 190.15)
- elements.property(mnpr, "LowTemperatureTransition", elements.TPT_PT_MNPL)
- local tchn = elements.allocate("TPT" , "TCHN")
- elements.element(tchn, elements.element(elements.DEFAULT_PT_URAN))
- elements.property(tchn, "Name" , "TCHN")
- elements.property(tchn, "Description" , "Technetium, decays over time and leaves heat.")
- elements.property(tchn, "Color", 0x205570)
- elements.property(tchn, "MenuSection", 11)
- elements.property(elements.TPT_PT_TCHN, "Update", --*1
- function(i,x,y) --1
- if math.random(1,11520) == 1 then --2
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,8)
- sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
- radiate(i,x,y,125,100)
- end --2
- end --1
- ) --*1
- elements.property(tchn, "HighTemperatureTransition", elements.TPT_PT_TCHN)
- local psac = elements.allocate("TPT", "PSAC")
- elements.element(psac, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(psac, "Name" , "PSAC")
- elements.property(psac, "Description" , "Positronic acid, reacts violently with matter, weak acid.")
- elements.property(psac, "Color", 0xFF20BB)
- elements.property(psac, "Advection", 0.01)
- elements.property(psac, "Hardness", 0)
- elements.property(psac, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_PSAC, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,100) == 10 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if math.random(1,3) == 1 then --10
- sim.partKill(r)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+3200)
- if math.random(1,13) == 1 then --11
- sim.pressure(x/4,y/4,16)
- sim.partKill(i)
- return
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- radiate(i,x,y,250,200)
- end --1
- ) --*1
- local si = elements.allocate("TPT" , "SILC")
- elements.element(si, elements.element(elements.DEFAULT_PT_IRON))
- elements.property(si, "Name" , "SILC")
- elements.property(si, "Description" , "Silicon, conducts electricity. Lets air pass through")
- elements.property(si, "Color", 0x686E76)
- elements.property(si, "AirLoss", 1)
- elements.property(si, "HighTemperature", 1687.01)
- elements.property(si, "Properties", elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
- local torn = elements.allocate("TPT" , "TORN")
- elements.element(torn, elements.element(elements.DEFAULT_PT_BOYL))
- elements.property(torn, "Name" , "TRNA")
- elements.property(torn, "Description" , "Tornado, self explanatory.")
- elements.property(torn, "Color", 0x8A9098)
- elements.property(torn, "Collision", -1)
- elements.property(torn, "Loss", 0.5)
- elements.property(torn, "AirDrag", 0.05)
- elements.property(torn, "HotAir", -0.001)
- elements.property(torn, "MenuSection", 16)
- local lhlm = elements.allocate("TPT", "LHE")
- elements.element(lhlm, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(lhlm, "Name" , "LHE")
- elements.property(lhlm, "Description" , "Liquid helium, incredibly cold.")
- elements.property(lhlm, "Temperature", 4.01)
- elements.property(lhlm, "Color", 0x5000FF)
- elements.property(lhlm, "MenuSection", 11)
- elements.property(lhlm, "Weight", 30)
- elements.property(elem.TPT_PT_LHE, "Update", --*1
- function(i,x,y,s) --1
- if math.random(1,200) == 1 then --2
- if sim.partProperty(i, "temp") > 4.21 then --3
- if math.random(1,150) > 1 then --4
- sim.partKill(i)
- else
- sim.partProperty(i, "type", elements.TPT_PT_HE)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local he = elements.allocate("TPT", "HE")
- elements.element(he, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(he, "Name" , "HE")
- elements.property(he, "Description", "Helium, floats.")
- elements.property(he, "Color", 0x6111FF)
- elements.property(he, "Diffusion", 1.5)
- elements.property(he, "Gravity", -0.3)
- elements.property(he, "Flammable", 0)
- elements.property(he, "LowTemperature", -1)
- elements.property(he, "LowTemperatureTransition", -1)
- elements.property(he, "MenuSection", 16)
- local n237 = elements.allocate("TPT" , "N237")
- elements.element(n237, elements.element(elements.DEFAULT_PT_POLO))
- elements.property(n237, "Name" , "N237")
- elements.property(n237, "Description" , "Neptunium 237, decays very quickly. Radioactive waste.")
- elements.property(n237, "Color", 0x668131)
- elements.property(n237, "HighTemperature", 3644)
- elements.property(n237, "PhotonReflectWavelengths", 0x002FF200)
- elements.property(n237, "MenuSection", 16)
- elements.property(n237, "Flammable", 1)
- function nept237(i,x,y,s,n)
- if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
- if math.random(1,2) == 1 then --2
- tpt.parts[i].type = elements.DEFAULT_PT_PLUT
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- else if math.random(1,6) == 1 then --3
- tpt.parts[i].type = elements.DEFAULT_PT_HE
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- end --3
- end --2
- end --1
- if sim.pressure(x/4,y/4) > 1 then --3
- if math.random(1,125) == 10 then --4
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.set_property("temp", math.huge, x ,y)
- end --4
- end --3
- if math.random(1,100) == 10 then --5
- sim.pressure(x/4,y/4,0.2)
- end --5
- radiate(i,x,y,125,30)
- end --*1
- tpt.element_func(nept237,elements.TPT_PT_N237)
- function neptunium(i,x,y,s,n)
- if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
- if math.random(1,2) == 1 then --2
- tpt.parts[i].type = elements.DEFAULT_PT_URAN
- else if math.random(1,6) == 1 then --3
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), elements.TPT_PT_N237)
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), elements.TPT_PT_TCHN)
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.parts[i].type = elements.DEFAULT_PT_NBLE
- end --3
- end --2
- end --1
- if sim.pressure(x/4,y/4) > 10 then --3
- if math.random(1,2500) == 10 then --4
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.set_property("temp", tpt.get_property("temp", x, y)+3500, x ,y)
- end --4
- end --3
- if math.random(1,1000) == 10 then --5
- sim.pressure(x/4,y/4,0.1)
- end --5
- radiate(i,x,y,500,15)
- end --*1
- tpt.element_func(neptunium,nept)
- function neutron(i,x,y,s,n) --*2
- if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == nept then --1
- if math.random(0,24) == 24 then --2
- tpt.create(x, y, 'neut')
- tpt.create(x, y, 'neut')
- tpt.set_property("temp", tpt.get_property("temp", x, y)+3500, x ,y)
- sim.pressure(x/4,y/4,6)
- end --2
- end --1
- end --*2
- tpt.element_func(neutron,tpt.el.neut.id)
- local he3 = elements.allocate("TPT", "HE3")
- elements.element(he3, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(he3, "Name" , "HE3")
- elements.property(he3, "Description", "Helium 3, fuses with tritium.")
- elements.property(he3, "Color", 0xD6EE00)
- elements.property(he3, "Diffusion", 1.7)
- elements.property(he3, "Gravity", -1.0)
- elements.property(he3, "Flammable", 0)
- elements.property(he3, "LowTemperature", -1)
- elements.property(he3, "LowTemperatureTransition", -1)
- elements.property(he3, "MenuSection", 16)
- local shake = elements.allocate("TPT", "SHAKE")
- elements.element(shake, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(shake, "Name" , "SHAK")
- elements.property(shake, "Description", "Shakes particles.")
- elements.property(shake, "Color", 0xFFCCCC)
- elements.property(shake, "Weight", 0)
- elements.property(shake, "MenuSection", 13)
- elements.property(elem.TPT_PT_SHAKE, "Update", --*1
- function(i,x,y,s) --1
- for r in sim.neighbors(x,y,1,1) do --2
- velocity(r,6,360)
- end --2
- sim.partKill(i)
- end --1
- ) --*1
- local normal = elements.allocate("TPT", "NORMAL")
- elements.element(normal, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(normal, "Name" , "NORM")
- elements.property(normal, "Description", "Normalizes temperature and pressure in the selected area.")
- elements.property(normal, "Color", 0xCCFFCC)
- elements.property(normal, "Weight", 0)
- elements.property(normal, "MenuSection", 13)
- elements.property(elem.TPT_PT_NORMAL, "Update", --*1
- function(i,x,y,s) --1
- sim.pressure(x/4,y/4,0)
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "temp") > 295.15 then --3
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")-5)
- end --3
- if sim.partProperty(r, "temp") < 295.15 then --4
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")+5)
- end --4
- end --2
- sim.partKill(i)
- end --1
- ) --*1
- local os = elements.allocate("TPT" , "OSMM")
- elements.element(os, elements.element(elements.DEFAULT_PT_BRMT))
- elements.property(os, "Name" , "OSMM")
- elements.property(os, "Description" , "Osmium, heavy metal. Mostly the norwegian kind")
- elements.property(os, "Color", 0x4D5763)
- elements.property(os, "Gravity", 0.5)
- elements.property(os, "AirDrag", 0.08)
- elements.property(os, "Weight", 97)
- elements.property(os, "Meltable", 1)
- elements.property(os, "HighTemperature", 3306)
- elements.property(os, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
- elements.property(elements.TPT_PT_OSMM, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,0.0025)
- end --1
- ) --*1
- local anco = elements.allocate("TPT", "ACOL")
- elements.element(anco, elements.element(elements.DEFAULT_PT_COAL))
- elements.property(anco, "Name" , "ACOL")
- elements.property(anco, "Description" , "Anti-Coal, burns slowly and very... surprisingly cold.")
- elements.property(anco, "MenuSection", 16)
- elements.property(anco, "Color", 0xDDDDDD)
- elements.property(elem.TPT_PT_ACOL, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,9) == 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
- if math.random(1,900) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_PLSM, "HeatConduct", 255)
- elements.property(elements.DEFAULT_PT_GLOW, "HeatConduct", 255)
- elements.property(elements.DEFAULT_PT_IRON, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if sim.pressure(x/4,y/4) > 2.51 then --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --5
- sim.partProperty(i, "tmp", -1)
- end --5
- if sim.partProperty(i, "tmp") == -1 then --6
- if math.random(1,9) == 1 then --7
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
- if math.random(1,25) == 1 then --8
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
- sim.partProperty(i, "tmp", 0)
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- ) --*1
- local bhut = elements.allocate("TPT" , "BHUT")
- elements.element(bhut, elements.element(elements.DEFAULT_PT_BOYL))
- elements.property(bhut, "Name" , "BHUT")
- elements.property(bhut, "HeatConduct", 255)
- elements.property(bhut, "HotAir", 0.001)
- elements.property(bhut, "Color", 0x706050)
- elements.property(bhut, "AirDrag", 0.001)
- elements.property(bhut, "AirLoss", 1)
- elements.property(bhut, "Diffusion", 1.25)
- elements.property(bhut, "Flammable", 2)
- elements.property(bhut, "MenuSection", 5)
- elements.property(bhut, "Description" , "Bhutane, explosive gas")
- elements.property(elem.TPT_PT_BHUT, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,3) > 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,5)
- if math.random(1,6) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elements.TPT_PT_ASH, "Update", --*1
- function(i,x,y,s) --1
- if sim.pressure(x/4,y/4) > 5.9 then --2
- if math.random(1,950) == 1 then --3
- sim.partProperty(i, "type", elements.DEFAULT_PT_OIL)
- else if math.random (1,3000) == 1 then --4
- sim.partProperty(i, "type", elements.TPT_PT_BHUT)
- else if math.random (1,3000) == 1 then --4
- sim.partProperty(i, "type", elements.DEFAULT_PT_SAWD)
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local gr = elements.allocate("TPT" , "GRPH")
- elements.element(gr, elements.element(elements.DEFAULT_PT_COAL))
- elements.property(gr, "Name" , "GRPH")
- elements.property(gr, "Description" , "Graphite, melts at an incredibly high temperature.")
- elements.property(gr, "Color", 0x111113)
- elements.property(gr, "HeatConduct", 7)
- elements.property(gr, "HighTemperature", 4003.15)
- elements.property(gr, "Meltable", 1)
- elements.property(gr, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
- elements.property(gr, "Properties", elements.PROP_CONDUCTS+elements.TYPE_SOLID+elements.PROP_HOT_GLOW+elements.PROP_NEUTPASS)
- elements.property(elements.TPT_PT_GRPH, "Update", --*1
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "life") > 0 then --2
- if math.random(1,65) == 1 then --3
- sim.partProperty(i, "life", 0)
- end --3
- end --2
- if sim.pressure(x/4,y/4) > 11.8 then --4
- if math.random(1,950) == 1 then --5
- sim.partProperty(i, "type", elements.DEFAULT_PT_DMND)
- end --5
- end --4
- end --1
- ) --*1
- local thor = elements.allocate("TPT" , "THOR")
- elements.element(thor, elements.element(elements.DEFAULT_PT_PLUT))
- elements.property(thor, "Name" , "THOR")
- elements.property(thor, "Description" , "Thorium, not radioactive on its own, needs help from another radioactive material to function.")
- elements.property(thor, "Color", 0x404043)
- elements.property(thor, "PhotonReflectWavelengths", 0x8F8F8F8F)
- elements.property(thor, "MenuSection", 10)
- function neutron2(i,x,y,s,n,r) --*2
- if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == thor then --1
- if math.random(1,20) == 1 then --2
- tpt.set_property("temp", tpt.get_property("temp", x, y)+3000, x, y)
- radiate(i,x,y,250,100)
- if math.random(1,20) == 1 then --3
- for r in sim.neighbors(x,y,3,3) do --4
- sim.partProperty(r, "type", elements.DEFAULT_PT_STNE)
- sim.partProperty(i, "type", elements.DEFAULT_PT_PROT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_NEUT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_NEUT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_NEUT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_NEUT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_PROT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_PROT)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_PROT)
- return
- end --4
- end --3
- end --2
- end --1
- end --*2
- tpt.element_func(neutron2,tpt.el.neut.id)
- elements.property(thor, "Update", --*1
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "temp") > 1200 then --2
- if math.random(1,650) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_PHOT)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_PHOT)
- end --3
- end --2
- end --1
- ) --*1
- local para = elements.allocate("TPT" , "PARA")
- elements.element(para, elements.element(elements.DEFAULT_PT_WAX))
- elements.property(para, "Name" , "FZOL")
- elements.property(para, "HeatConduct", 5)
- elements.property(para, "Color", 0x474530)
- elements.property(para, "Flammable", 1)
- elements.property(para, "Description" , "Frozen oil, flammable")
- elements.property(para, "HighTemperature", 277.14)
- elements.property(para, "Temperature", 274.14)
- elements.property(para, "HighTemperatureTransition", elements.DEFAULT_PT_OIL)
- elements.property(elements.DEFAULT_PT_OIL, "LowTemperature", 278.14)
- elements.property(elements.DEFAULT_PT_OIL, "LowTemperatureTransition", elements.TPT_PT_PARA)
- local plwd = elements.allocate("TPT" , "PLWD")
- elements.element(plwd, elements.element(elements.DEFAULT_PT_WOOD))
- elements.property(plwd, "Name" , "PLWD")
- elements.property(plwd, "HeatConduct", 2)
- elements.property(plwd, "Color", 0x808445)
- elements.property(plwd, "Flammable", 1)
- elements.property(plwd, "Description" , "Plywood. Durable material.")
- elements.property(plwd, "AirLoss", 0.2)
- elements.property(plwd, "Hardness", 1)
- local lbl = elements.allocate("TPT" , "LBYL")
- elements.element(lbl, elements.element(elements.DEFAULT_PT_LOXY))
- elements.property(lbl, "Name" , "LBYL")
- elements.property(lbl, "HeatConduct", 25)
- elements.property(lbl, "Color", 0x001F00)
- elements.property(lbl, "Flammable", 5)
- elements.property(lbl, "HotAir", -0.0001)
- elements.property(lbl, "Description" , "Liquid Boyle gas. Explosive.")
- elements.property(lbl, "HighTemperature", 220.14)
- elements.property(lbl, "Temperature", 213.14)
- elements.property(lbl, "HighTemperatureTransition", elements.DEFAULT_PT_BOYL)
- elements.property(lbl, "MenuSection", 16)
- elements.property(elements.DEFAULT_PT_BOYL, "LowTemperature", 219.14)
- elements.property(elements.DEFAULT_PT_BOYL, "HighTemperatureTransition", elements.TPT_PT_LBYL)
- local mgns = elements.allocate("TPT", "CAVE")
- elements.element(mgns, elements.element(elements.DEFAULT_PT_BRMT))
- elements.property(mgns, "Name" , "CAVE")
- elements.property(mgns, "Description" , "Burn life's house down! With the lemons!")
- elements.property(mgns, "Color", 0xA5A515)
- elements.property(mgns, "Weight", 49)
- elements.property(mgns, "Gravity", 0.3)
- elements.property(mgns, "MenuSection", 16)
- elements.property(elem.TPT_PT_CAVE, "Update", --*1
- function(i,x,y,s) --1
- if s > 6 then --2
- if math.random(1,20) == 20 then --3
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
- sim.partChangeType(i, elements.DEFAULT_PT_FIRE)
- sim.pressure(x/4,y/4,16)
- if math.random(1,5) == 5 then --4
- sim.partKill(i)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local tmpsns = elements.allocate("TPT" , "TMPS")
- elements.element(tmpsns, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(tmpsns, "Name" , "TMPS")
- elements.property(tmpsns, "Description" , "Temporary value sensor, creates power when something's tmp is higher than its temperature.")
- elements.property(tmpsns, "Color", 0x22713D)
- elements.property(tmpsns, "MenuSection", 3)
- elements.property(tmpsns, "HeatConduct", 0)
- elements.property(elem.TPT_PT_TMPS, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "tmp") > sim.partProperty(i, "temp")-273.15 then --3
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
- end --3
- end --2
- end --1
- ) --*1
- local erode = elements.allocate("TPT", "ERODE")
- elements.element(erode, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(erode, "Name" , "EROD")
- elements.property(erode, "Description", "Erodes.")
- elements.property(erode, "Color", 0xCCCCCC)
- elements.property(erode, "Weight", 0)
- elements.property(erode, "MenuSection", 13)
- elements.property(elem.TPT_PT_ERODE, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,25) == 10 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if math.random(1,6) == 3 then --5
- sim.partKill(r)
- end --5
- end --4
- end --3
- end --2
- sim.partKill(i)
- end --1
- ) --*1
- local storm = elements.allocate("TPT", "STORM")
- elements.element(storm, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(storm, "Name" , "STRM")
- elements.property(storm, "Description", "Storms.")
- elements.property(storm, "Color", 0x889F9F)
- elements.property(storm, "Weight", 0)
- elements.property(storm, "MenuSection", 11)
- elements.property(elem.TPT_PT_STORM, "Update", --*1
- function(i,x,y,s) --1
- sim.pressure(x/4,y/4,math.random(-112,112))
- if math.random(1,1000) == 1 then --2
- sim.partProperty(i, "type", elements.DEFAULT_PT_WATR)
- else if math.random(1,100) == 1 then --3
- sim.partProperty(i, "type", elements.DEFAULT_PT_FOG)
- else if math.random(1,5000) == 1 then --5
- sim.partProperty(i, "tmp2", 4)
- sim.partProperty(i, "tmp", math.random(0,359))
- sim.partProperty(i, "life", math.random(15,25))
- sim.partProperty(i, "type", elements.DEFAULT_PT_LIGH)
- else if math.random(1,500) == 1 then --4
- sim.partProperty(i, "type", elements.TPT_PT_TORN)
- else
- sim.partKill(i)
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_TORN, "Update", --*1
- function(i,x,y,s) --1
- if math.random(0,10000) == 0 then --2
- sim.partProperty(i, "type", elements.TPT_PT_STORM)
- end --2
- end --1
- ) --*1
- local aliq = elements.allocate("TPT", "ANLIQ")
- elements.element(aliq, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(aliq, "Name" , "ALIQ")
- elements.property(aliq, "Description", "Anti-liquid. Flows upwards.")
- elements.property(aliq, "Color", 0xEFEFFF)
- elements.property(aliq, "Gravity", -0.1)
- elements.property(aliq, "Advection", -0.6)
- elements.property(aliq, "AirDrag", -0.01)
- elements.property(aliq, "HeatConduct", 2)
- elements.property(aliq, "MenuSection", 16)
- elements.property(elem.TPT_PT_ANLIQ, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,2) == 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
- sim.pressure(x/4,y/4,5)
- if math.random(1,50) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local neutr = elements.allocate("TPT" , "NETR")
- elements.element(neutr, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(neutr, "Name" , "NETR")
- elements.property(neutr, "Description" , "Neutronium. Dense, Radioactive solid. Slowly implodes and decays after time. Rarely grows")
- elements.property(neutr, "Color", 0x2515FF)
- elements.property(neutr, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(neutr, "PhotonReflectWavelengths", 0x00000001)
- elements.property(neutr, "MenuSection", 10)
- elements.property(elements.TPT_PT_NETR, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,0.1)
- if math.random(1,(sim.pressure(x/4,y/4)+256)/4) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_NETR)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_NETR)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*20) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_NEUT)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- attract(i,x,y,-10)
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_NEUT, "HighPressure", 1024)
- elements.property(elements.DEFAULT_PT_NEUT, "HighPressureTransition", elements.TPT_PT_NETR)
- local brcryst = elements.allocate("TPT" , "BCRY")
- elements.element(brcryst, elements.element(elements.DEFAULT_PT_PQRT))
- elements.property(brcryst, "Name" , "BCRY")
- elements.property(brcryst, "Description" , "Broken Crystal. Light powder, may shred lungs of organisms.")
- elements.property(brcryst, "Properties", elements.TYPE_PART+elements.PROP_DEADLY)
- elements.property(brcryst, "Color", 0xE9E9EF)
- elements.property(brcryst, "PhotonReflectWavelengths", 0xEFEFEFF6)
- elements.property(brcryst, "MenuSection", 8)
- elements.property(brcryst, "Gravity", 0.056)
- elements.property(brcryst, "Advection", 0.15)
- elements.property(brcryst, "Weight", 2)
- elements.property(brcryst, "AirDrag", 0.05)
- --elements.property(brcryst, "Diffusion", 0.1) eeeh kinda bad but reenable it if you want a more classic experience
- elements.property(brcryst, "HeatConduct", 7)
- elements.property(brcryst, "HighTemperature", 1450)
- local cryst = elements.allocate("TPT" , "CRYT")
- elements.element(cryst, elements.element(elements.DEFAULT_PT_QRTZ))
- elements.property(cryst, "Name" , "CRYS")
- elements.property(cryst, "Description" , "Crystal. Brittle, grows. Durable at high temperatures.")
- elements.property(cryst, "Color", 0xEEEEF3)
- elements.property(cryst, "PhotonReflectWavelengths", 0xF8F8F8FF)
- elements.property(cryst, "MenuSection", 9)
- elements.property(cryst, "HighPressure", 20.14)
- elements.property(cryst, "HighPressureTransition", elements.TPT_PT_BCRY)
- elements.property(cryst, "HighTemperature", 1550)
- elements.property(elements.TPT_PT_CRYT, "Update", --*1
- function(i,x,y) --1
- if sim.partProperty(i, "temp") < 1420 then --2
- if math.random(1,100) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_CRYT)
- if math.random(1,20) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_CRYT)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(brcryst, "HighTemperatureTransition", elements.TPT_PT_CRYT)
- local gasl = elements.allocate("TPT" , "GASL")
- elements.element(gasl, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(gasl, "Name" , "GASL")
- elements.property(gasl, "HeatConduct", 255)
- elements.property(gasl, "Color", 0xF0C020)
- elements.property(gasl, "Flammable", 1)
- elements.property(gasl, "MenuSection", 5)
- elements.property(gasl, "Description" , "Gasoline, highly flammable.")
- elements.property(elem.TPT_PT_GASL, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,3) > 1 then --8
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_FIRE)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+100)
- sim.pressure(x/4,y/4,2)
- if math.random(1,60) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local dmdd = elements.allocate("TPT" , "DMDD")
- elements.element(dmdd, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(dmdd, "Name" , "DMDD")
- elements.property(dmdd, "Description" , "Diamond dust. Yeah.")
- elements.property(dmdd, "Color", 0xC6F6F6)
- elements.property(dmdd, "MenuSection", 8)
- elements.property(dmdd, "Properties", elements.TYPE_PART)
- elements.property(dmdd, "Gravity", 0.112)
- elements.property(dmdd, "Advection", 1)
- elements.property(dmdd, "Weight", 100)
- elements.property(dmdd, "AirDrag", 0.1)
- elements.property(dmdd, "Falldown", 1)
- elements.property(dmdd, "HighTemperature", 9999)
- elements.property(dmdd, "HighTemperatureTransition", elements.DEFAULT_PT_LAVA)
- elements.property(dmdd, "Falldown", 1)
- local logan = elements.allocate("TPT" , "XMEN")
- elements.element(logan, elements.element(elements.DEFAULT_PT_IRON))
- elements.property(logan, "Name" , "ADMT")
- elements.property(logan, "Description" , "Adamantium, incredibly durable material. Virtually indestructible. An alloy of steel and vibranium")
- elements.property(logan, "Color", 0xC8C8D0)
- elements.property(logan, "HighTemperature", 9500.50)
- elements.property(logan, "Weight", 1010)
- elements.property(logan, "Hardness", 0)
- local anih = elements.allocate("TPT" , "ANIH")
- elements.element(anih, elements.element(elements.DEFAULT_PT_DEST))
- elements.property(anih, "Name" , "ANIH")
- elements.property(anih, "Description" , "Annihilation.")
- elements.property(anih, "Color", 0x603090)
- elements.property(anih, "HotAir", 0.001)
- elements.property(anih, "Create", --*1
- function(i,x,y) --1
- sim.partProperty(i, "tmp", math.random(-0.1,0.1))
- end --1
- ) --*1
- elements.property(anih, "MenuSection", 11)
- elements.property(elements.TPT_PT_ANIH, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,sim.partProperty(i, "tmp"))
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,1) == 1 then --3
- for r in sim.neighbors(x,y,2,2) do --4
- if math.random(1,6) == 3 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
- if math.random(1,2) == 1 then --6
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_DMND then --7
- sim.partProperty(r, "type", elements.TPT_PT_DMDD)
- else if sim.partProperty(r, "type") ~= elements.TPT_PT_DMDD then --8
- sim.pressure(x/4,y/4,255)
- if math.random(0,20) == 0 then --9
- sim.partKill(r)
- return 0
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- if math.random(1,8) == 1 then --10
- 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
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.TPT_PT_ANTI)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_SING)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_PROT)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_HYGN)
- sim.partCreate(-1, x+math.random(-10,10),y+math.random(-10,10),elements.DEFAULT_PT_DEST)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10000)
- end --11
- end --10
- end --2
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- return 1,ren.PMODE_FLAT+ren.FIRE_ADD,255,96,48,144,64,96,48,144
- end --*1
- elements.property(anih, "Graphics", funcGraphics)
- local bullet = elements.allocate("TPT" , "BULT")
- elements.element(bullet, elements.element(elements.DEFAULT_PT_BREL))
- elements.property(bullet, "Name" , "BLLT")
- elements.property(bullet, "Description" , "Bullet, travels with minimum decceleration and creates winds.")
- elements.property(bullet, "Color", 0x433141)
- elements.property(bullet, "MenuSection", 16)
- elements.property(bullet, "Flammable", 0)
- elements.property(bullet, "Loss", 0.9)
- elements.property(bullet, "AirDrag", 0.2)
- elements.property(bullet, "Weight", 99)
- elements.property(bullet, "Collision", 1.01)
- elements.property(bullet, "Gravity", 0.002)
- elements.property(elem.TPT_PT_BULT, "Update",
- function(i,x,y,s,nt) --1
- if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) > 50 then --2
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_FIRE)
- end --2
- end --1
- ) --*1
- local anmt = elements.allocate("TPT" , "AMTL")
- elements.element(anmt, elements.element(elements.DEFAULT_PT_METL))
- elements.property(anmt, "Name" , "AMTL")
- elements.property(anmt, "Description" , "Anti-Metal, violently heats surrounding materials when sparked. Melts at cold temperatures.")
- elements.property(anmt, "Color", 0x899469)
- elements.property(anmt, "LowTemperature", 10)
- elements.property(anmt, "LowTemperatureTransition", elements.DEFAULT_PT_LAVA)
- elements.property(anmt, "HighTemperature", 10001)
- elements.property(elem.TPT_PT_AMTL, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,2,2) do --2
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_SPRK then --3
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+500)
- end --3
- end --2
- end --1
- ) --*1
- local agas = elements.allocate("TPT" , "AGAS")
- elements.element(agas, elements.element(elements.DEFAULT_PT_BOYL))
- elements.property(agas, "Name" , "AGAS")
- elements.property(agas, "HeatConduct", 255)
- elements.property(agas, "HotAir", 0.001)
- elements.property(agas, "Color", 0xFDFDB7)
- elements.property(agas, "AirDrag", 0.001)
- elements.property(agas, "AirLoss", 1)
- elements.property(agas, "Diffusion", 1.25)
- elements.property(agas, "MenuSection", 16)
- elements.property(agas, "LowPressure", -5)
- elements.property(agas, "LowPressureTransition", elements.TPT_PT_ANLIQ)
- elements.property(agas, "Description" , "Anti-Gas. Opposite of gas")
- elements.property(elem.TPT_PT_AGAS, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CFLM then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,2) == 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-200)
- sim.pressure(x/4,y/4,10)
- if math.random(1,50) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(aliq, "LowTemperature", 5)
- elements.property(aliq, "LowTemperatureTransition", elements.TPT_PT_AGAS)
- elements.property(elements.DEFAULT_PT_CO2, "Color", 0xBBBBBB)
- elements.property(elements.DEFAULT_PT_METL, "Name" , "STEL")
- elements.property(elements.DEFAULT_PT_METL, "Description" , "Steel, basic metal. Conducts")
- elements.property(elements.DEFAULT_PT_METL, "Color", 0x54545D)
- elements.property(elements.DEFAULT_PT_METL, "HighTemperature", 1643.15)
- local argi = elements.allocate("TPT" , "ARGI")
- elements.element(argi, elements.element(elements.DEFAULT_PT_GOLD))
- elements.property(argi, "Name" , "SLVR")
- elements.property(argi, "Description" , "Silver, resistant to corrosion. Conducts at a faster pulse")
- elements.property(argi, "Color", 0xA0A5B0)
- elements.property(argi, "HighTemperature", 1235.46)
- elements.property(elem.TPT_PT_ARGI, "Update",
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "life") > 0 then --2
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_SPRK, "Color", 0xDCECFF)
- local trit = elements.allocate("TPT" , "TRIT")
- elements.element(trit, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(trit, "Name" , "TRIT")
- elements.property(trit, "Description" , "Tritium, decays into lighter components when struck with neutrons.")
- elements.property(trit, "Color", 0x31363D)
- elements.property(trit, "Gravity", 0.2)
- elements.property(trit, "PhotonReflectWavelengths", 0x00000001)
- elements.property(trit, "MenuSection", 10)
- function tritium(i,x,y,s,n)
- if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
- if math.random(1,2) == 1 then --2
- tpt.parts[i].type = elements.DEFAULT_PT_DEUT
- tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- sim.pressure(x/4,y/4,5)
- else if math.random(1,6) == 1 then --3
- tpt.parts[i].type = elements.DEFAULT_PT_HYGN
- tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- sim.pressure(x/4,y/4,5)
- else if math.random(1,6) == 1 then --4
- tpt.parts[i].type = elements.TPT_PT_HE
- sim.pressure(x/4,y/4,5)
- tpt.set_property("temp", tpt.get_property("temp", x, y)+7000, x ,y)
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'elec')
- end --4
- end --3
- end --2
- end --1
- if sim.pressure(x/4,y/4) > 1 then --3
- if math.random(1,250) == 10 then --4
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.set_property("temp", math.huge, x ,y)
- end --4
- end --3
- if math.random(1,10000) == 10 then --5
- sim.pressure(x/4,y/4,2)
- end --5
- end --*1
- elements.property(elem.TPT_PT_TRIT, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,2) == 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_ACID)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+20)
- if math.random(1,2) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- tritium(i,x,y,s,n)
- end --1
- ) --*1
- local ltrt = elements.allocate("TPT" , "LTRT")
- elements.element(ltrt, elements.element(elements.TPT_PT_LHYG))
- elements.property(ltrt, "Name" , "LTRT")
- elements.property(ltrt, "Description" , "Liquid Tritium, dangerous.")
- elements.property(ltrt, "Color", 0x33363C)
- elements.property(ltrt, "HighTemperatureTransition", elements.TPT_PT_TRIT)
- elements.property(ltrt, "PhotonReflectWavelengths", 0x00000001)
- elements.property(ltrt, "MenuSection", 16)
- elements.property(ltrt, "Flammable", 16)
- elements.property(elem.TPT_PT_LTRT, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_DEUT then --6
- sim.partProperty(i, "tmp", -2)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -2 then --7
- if math.random(1,500) == 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_LHE)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+200)
- if math.random(1,2) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(trit, "LowTemperatureTransition", elements.TPT_PT_LTRT)
- local pkic = elements.allocate("TPT" , "PKIC")
- elements.element(pkic, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(pkic, "Name" , "PKIC")
- elements.property(pkic, "Description" , "Packed Ice.")
- elements.property(pkic, "Color", 0x6F94F4)
- elements.property(pkic, "MenuSection", 9)
- elements.property(pkic, "Temperature", 210.32)
- elements.property(pkic, "HeatConduct", 5)
- elements.property(elem.TPT_PT_PKIC, "Update",
- function(i,x,y,s,nt) --1
- if math.random(1,20) == 1 then --2
- if sim.partProperty(i, "temp") > 220.35 then --3
- sim.partProperty(i, "type", elements.DEFAULT_PT_ICE)
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.DEFAULT_PT_ICE, "Update",
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 1 then --2
- if sim.partProperty(i, "temp") < 220.30 then --3
- sim.partProperty(i, "type", elements.TPT_PT_PKIC)
- end --3
- end --2
- end --1
- ) --*1
- local pala = elements.allocate("TPT" , "PALA")
- elements.element(pala, elements.element(elements.DEFAULT_PT_GOLD))
- elements.property(pala, "Name" , "PALA")
- elements.property(pala, "Description" , "Paladium, desintegrates over time with neutrons.")
- elements.property(pala, "Color", 0xCCC7BD)
- elements.property(pala, "PhotonReflectWavelengths", 0x2FF20000)
- elements.property(pala, "MenuSection", 10)
- elements.property(pala, "HighTemperature", 1828)
- function paladium(i,x,y,s,n)
- if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
- if math.random(1,2) == 1 then --2
- tpt.parts[i].type = elements.TPT_PT_ARGI
- if math.random(1,2) == 1 then --3
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'slvr')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'lead')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
- tpt.set_property("temp", tpt.get_property("temp", x ,y)+5000, x ,y)
- end --3
- end --2
- end --1
- if math.random(1,10000) == 10 then --4
- sim.pressure(x/4,y/4,5)
- end --4
- end --*1
- tpt.element_func(paladium,pala)
- local ltac = elements.allocate("TPT", "LTAC")
- elements.element(ltac, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(ltac, "Name" , "LTAC")
- elements.property(ltac, "Description" , "Lactic acid, helps to decompose organic matter.")
- elements.property(ltac, "Color", 0xD7BCCD)
- elements.property(ltac, "Hardness", 1)
- elements.property(elem.TPT_PT_LTAC, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,100) == 10 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT or sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --5
- if math.random(1,3) == 1 then --6
- sim.partProperty(r, "type", elements.TPT_PT_ASH)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+10)
- if math.random(1,13) == 1 then --7
- sim.pressure(x/4,y/4,0.1)
- sim.partKill(i)
- return
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local bctr = elements.allocate("TPT", "BACT")
- elements.element(bctr, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(bctr, "Name" , "BCTR")
- elements.property(bctr, "Description" , "Bacteria, spreads and sticks.")
- elements.property(bctr, "Color", 0xE0F0A1)
- elements.property(bctr, "Diffusion", 0.3)
- elements.property(bctr, "Weight", 30)
- elements.property(bctr, "MenuSection", 11)
- local bctrb = elements.allocate("TPT", "BCTR")
- elements.element(bctrb, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(bctrb, "Name" , "BCTD")
- elements.property(bctrb, "Description" , "Decomposer bacteria, decomposes plant matter.")
- elements.property(bctrb, "Color", 0xFFE990)
- elements.property(bctrb, "Diffusion", 0.3)
- elements.property(bctrb, "Weight", 30)
- elements.property(bctrb, "MenuSection", 16)
- local bctra = elements.allocate("TPT", "BCTRA")
- elements.element(bctra, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(bctra, "Name" , "ABCT")
- elements.property(bctra, "Description" , "Airbourne bacteria.")
- elements.property(bctra, "Color", 0xC9E9FF)
- elements.property(bctra, "Diffusion", 0.2)
- elements.property(bctra, "Weight", 29)
- elements.property(bctra, "MenuSection", 16)
- elements.property(bctra, "Gravity", -0.025)
- local bctrc = elements.allocate("TPT", "BCTRC")
- elements.element(bctrc, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(bctrc, "Name" , "BCTW")
- elements.property(bctrc, "Description" , "Bacterial wall, solid but still flows")
- elements.property(bctrc, "Color", 0xC9FF90)
- elements.property(bctrc, "Diffusion", 0.1)
- elements.property(bctrc, "Weight", 31)
- elements.property(bctrc, "MenuSection", 16)
- local bctrp = elements.allocate("TPT", "BCTRP")
- elements.element(bctrp, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(bctrp, "Name" , "AQBC")
- elements.property(bctrp, "Description" , "Aquatic Bacteria. Floats and spreads through water slowly.")
- elements.property(bctrp, "Color", 0xFFF0FF)
- elements.property(bctrp, "Diffusion", 0.3)
- elements.property(bctrp, "Weight", 31)
- elements.property(bctrp, "MenuSection", 16)
- elements.property(elem.TPT_PT_BCTRP, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt == 8 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if math.random(1,1000) > 1 then --4
- sim.partProperty(i, "vy", -0.05)
- end --4
- if math.random(1,1000) > 1 then --5
- sim.partProperty(i, "vx", math.random(-0.01,0.01))
- end --5
- if math.random(1,2000) < 4 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- end --6
- if math.random(1,40000) < 2 then --7
- sim.partKill(i)
- end --7
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --8
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTR)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
- end --8
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_BCTRC, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and s > 0 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if math.random(1,1000) > 1 then --4
- sim.partProperty(i, "vy", 0)
- end --4
- if math.random(1,1000) > 1 then --5
- sim.partProperty(i, "vx", 0)
- end --5
- if math.random(1,200000) < 4 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
- sim.partProperty(i, "temp", 338)
- end --6
- if math.random(1,200000) == 1 then --7
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
- end --7
- if math.random(1,200000) == 1 then --8
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
- sim.partProperty(i, "temp", 338)
- end --8
- if math.random(1,4000) < 2 then --9
- sim.partKill(i)
- end --9
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --10
- if math.random(1,40) then --11
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
- sim.partProperty(i, "temp", 338)
- sim.partKill(4)
- end --11
- end --10
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --12
- if math.random(1,20) == 1 then --13
- if math.random(1,50) == 1 then --14
- sim.partProperty(i, "type", elements.TPT_PT_BCTRP)
- end --14
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
- sim.partProperty(i, "temp", 338)
- sim.partKill(i)
- end --13
- end --12
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTRP then --15
- if math.random(1,200) == 1 then --16
- sim.partKill(i)
- end --16
- end --15
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_BCTR, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if math.random(1,10) > 1 then --4
- sim.partProperty(i, "vy", 0)
- end --4
- if math.random(1,10) > 1 then --5
- sim.partProperty(i, "vx", 0)
- end --5
- if math.random(1,600) < 4 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
- sim.partProperty(i, "temp", 338)
- end --6
- if math.random(1,1000) < 2 then --7
- sim.partKill(i)
- end --7
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --8
- if math.random(1,20) < 2 then --9
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_LTAC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_LTAC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
- sim.partProperty(i, "temp", 338)
- sim.partKill(r)
- end --9
- end --8
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT then --10
- if math.random(1,20) < 2 then --11
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
- sim.partKill(r)
- end --11
- end --10
- if sim.partProperty(r, "type") == elements.TPT_PT_ALGAE then --12
- if math.random(1,20) < 2 then --13
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
- sim.partKill(r)
- end --13
- end --12
- if math.random(1,1000) == 1 then --14
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partProperty(i, "temp", 338)
- end --14
- if math.random(1,10000) == 1 then --15
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
- end --15
- if math.random(1,1000) == 1 then --16
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
- end --16
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_BCTRA, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if math.random(1,20) > 1 then --4
- sim.partProperty(i, "vy", -0.01)
- end --4
- if math.random(1,20) > 1 then --5
- sim.partProperty(i, "vx", 0)
- end --5
- if math.random(1,400) < 4 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
- end --6
- if math.random(1,1600) < 2 then --7
- sim.partKill(i)
- end --7
- if sim.partProperty(r, "type") == elements.TPT_PT_ASH then --8
- if math.random(1,20) == 1 then --9
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
- sim.partKill(r)
- end --9
- end --8
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_OXYG then --10
- if math.random(1,20) < 2 then --11
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
- sim.partKill(r)
- end --11
- end --10
- if math.random(1,125) == 1 then --12
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+1),elements.TPT_PT_BCTRC)
- end --12
- if math.random(1,10000) == 1 then --12
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
- end --12
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_BACT, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if math.random(1,20) > 1 then --4
- sim.partProperty(i, "vy", -0.01)
- end --4
- if math.random(1,20) > 1 then --5
- sim.partProperty(i, "vx", 0)
- end --5
- if math.random(1,20) < 2 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
- sim.partKill(i)
- end --6
- end --3
- end --2
- end --1
- ) --*1
- local sdpr = elements.allocate("TPT" , "SPPR")
- elements.element(sdpr, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(sdpr, "Name" , "SPPR")
- elements.property(sdpr, "Description" , "Sandpaper, Gritty.")
- elements.property(sdpr, "Color", 0x6F6245)
- elements.property(sdpr, "HeatConduct", 4)
- elements.property(elem.TPT_PT_SPPR, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "type") > 0 then --3
- 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)
- sim.partProperty(r, "vy", 0)
- sim.partProperty(r, "vx", 0)
- end --3
- end --2
- end --1
- ) --*1
- local jean = elements.allocate("TPT", "DISA")
- elements.element(jean, elements.element(elements.DEFAULT_PT_THDR))
- elements.property(jean, "Name" , "DISA")
- elements.property(jean, "Description" , "\"Cause Havok.\"")
- elements.property(jean, "Weight", -1)
- elements.property(jean, "Loss", -1.01)
- elements.property(jean, "MenuSection", 16)
- elements.property(jean, "Diffusion", 0)
- elements.property(elem.TPT_PT_DISA, "Update", --*1
- function(i,x,y,s) --1
- if s > 6 then --2
- if math.random(1,20) == 20 then --3
- sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.DEFAULT_PT_THDR)
- sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_TORN)
- sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_STRM)
- sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.TPT_PT_CAVE)
- sim.pressure(x/4,y/4,16)
- if math.random(1,5) == 5 then --4
- sim.partKill(i)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local co2s = elements.allocate("TPT", "CSNW")
- elements.element(co2s, elements.element(elements.DEFAULT_PT_SNOW))
- elements.property(co2s, "Name" , "CSNW")
- elements.property(co2s, "Description" , "CO2 Snow.")
- elements.property(co2s, "Color", 0xC2C2C2)
- elements.property(co2s, "Diffusion", 0.1)
- elements.property(co2s, "HighTemperature", 10001)
- elements.property(co2s, "Temperature", 186.65)
- elements.property(co2s, "Weight", 31)
- elements.property(co2s, "MenuSection", 16)
- elements.property(elements.TPT_PT_CSNW, "Update", --*1
- function(i,x,y) --1
- if sim.partProperty(i, "temp") > 194.65 then --2
- if math.random(1,450) == 1 then --3
- sim.partChangeType(i, elements.DEFAULT_PT_CO2)
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_DRIC, "HighPressure", 1.2)
- elements.property(elements.DEFAULT_PT_DRIC, "HighPressureTransition", elements.TPT_PT_CSNW)
- elements.property(elements.DEFAULT_PT_COAL, "Update", --*1
- function(i,x,y,s,nt) --1
- if sim.pressure(x/4,y/4) < -9.5 then --2
- if math.random(1,950) == 1 then --3
- sim.partProperty(i, "type", elements.TPT_PT_GRPH)
- sim.partCreate(-1, x+math.random(-9,9), y+math.random(-9,9), elements.DEFAULT_PT_SMKE)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.TPT_PT_ASH)
- end --3
- end --2
- end --1
- ) --*1
- local ground = elements.allocate("TPT" , "GRND")
- elements.element(ground, elements.element(elements.DEFAULT_PT_STNE))
- elements.property(ground, "Name" , "GRND")
- elements.property(ground, "Description" , "Ground.")
- elements.property(ground, "Color", 0xA2A29A)
- elements.property(ground, "HighTemperature", 10001)
- elements.property(ground, "MenuSection", 16)
- elements.property(ground, "Flammable", 0)
- elements.property(elem.TPT_PT_GRND, "Update",
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 1 then --2
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_SAND)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_STNE)
- sim.partCreate(-1, x+math.random(-2,2), y+math.random(-2,2), elements.DEFAULT_PT_DUST)
- end --2
- end --1
- ) --*1
- local brwf = elements.allocate("TPT" , "BRWF")
- elements.element(brwf, elements.element(elements.DEFAULT_PT_EQVE))
- elements.property(brwf, "Name" , "BRWF")
- elements.property(brwf, "Description" , "Broken Tungsten.")
- elements.property(brwf, "Color", 0x5E575B)
- elements.property(brwf, "HighTemperature", 3595.0)
- elements.property(brwf, "HighTemperatureTransition", elements.DEFAULT_PT_TUNG)
- elements.property(brwf, "MenuSection", 16)
- elements.property(brwf, "Flammable", 0)
- elements.property(elem.DEFAULT_PT_BRMT, "Update",
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "ctype") == elements.DEFAULT_PT_TUNG then --2
- sim.partProperty(i, "type", elements.TPT_PT_BRWF)
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_CFLM, "Falldown", 2)
- elements.property(elements.DEFAULT_PT_CFLM, "Gravity", 0.1)
- local lo3 = elements.allocate("TPT", "LO3")
- elements.element(lo3, elements.element(elements.DEFAULT_PT_LOXY))
- elements.property(lo3, "Name" , "LO3")
- elements.property(lo3, "Description" , "Liquid Ozone, very cold. Horrifying")
- elements.property(lo3, "Flammable", 5.65)
- elements.property(lo3, "Explosive", 0)
- elements.property(lo3, "Color", 0x4F68AC)
- elements.property(lo3, "Temperature", 145.15)
- elements.property(lo3, "MenuSection", 7)
- local o3 = elements.allocate("TPT", "O3")
- elements.element(o3, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(o3, "Name" , "O3")
- elements.property(o3, "Description" , "Ozone, strong oxidizer.")
- elements.property(o3, "Color", 0x6079BD)
- elements.property(o3, "LowTemperature", 159.1)
- elements.property(o3, "LowTemperatureTransition", elements.TPT_PT_LO3)
- elements.property(elem.TPT_PT_O3, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --3
- sim.partProperty(r, "life", 260)
- sim.partProperty(r, "vy", sim.partProperty(r, "vy")*1.05)
- sim.partProperty(r, "vx", sim.partProperty(r, "vx")*1.05)
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")+100)
- sim.pressure(x/4,y/4,0.1)
- if math.random(1,500) == 1 then --4
- sim.partKill(i)
- end --4
- end --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLSM then --5
- sim.partProperty(r, "life", math.random(260,390))
- sim.partProperty(r, "vy", sim.partProperty(r, "vy")*1.1)
- sim.partProperty(r, "vx", sim.partProperty(r, "vx")*1.1)
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")+200)
- sim.pressure(x/4,y/4,0.1)
- if math.random(1,500) == 1 then --6
- sim.partKill(i)
- end --6
- end --5
- end --2
- end --1
- ) --*1
- elements.property(lo3, "HighTemperature", 161.1)
- elements.property(lo3, "HighTemperatureTransition", elements.TPT_PT_O3)
- elements.property(elements.DEFAULT_PT_PLSM, "Falldown", 2)
- elements.property(elements.DEFAULT_PT_PLSM, "Gravity", 0)
- elements.property(elem.TPT_PT_HE, "Update", --*1
- function(i,x,y,s) --1
- if sim.partProperty(i, "temp") < 4.15 then --2
- if math.random(1,800) == 1 then --3
- sim.partProperty(i, "type", elements.TPT_PT_LHE)
- end --3
- end --2
- if sim.partProperty(i, "temp") > 4000 then --4
- if sim.pressure(x/4,y/4) > 100 then --5
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_PHOT)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_PHOT)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_CO2)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_OXYG)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_NBLE)
- sim.partCreate(-1, x+1, y, elements.TPT_PT_HE3)
- sim.partCreate(-1, x-1, y, elements.TPT_PT_NEUT)
- if math.random(1,25) == 1 then --6
- sim.partCreate(-1, x-1, y, elements.TPT_PT_O3)
- sim.partProperty(i, "tmp2", 4)
- sim.partProperty(i, "tmp", math.random(0,359))
- sim.partProperty(i, "life", math.random(1,4))
- sim.pressure(x/4,y/4,150)
- sim.partProperty(i, "type", elements.DEFAULT_PT_LIGH)
- return
- end --6
- end --5
- end --4
- end --1
- ) --*1
- elements.property(elem.DEFAULT_PT_OXYG, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_LIGH then --3
- sim.partProperty(i, "type", elements.TPT_PT_O3)
- end --3
- end --2
- end --1
- ) --*1
- local magm = elements.allocate("TPT" , "MAGM")
- elements.element(magm, elements.element(elements.DEFAULT_PT_LAVA))
- elements.property(magm, "Name" , "MAGM")
- elements.property(magm, "Description" , "Magma.")
- elements.property(magm, "Color", 0xFA7E3B)
- elements.property(magm, "Weight", 99)
- elements.property(magm, "Temperature", 1950.32)
- elements.property(magm, "HeatConduct", 10)
- elements.property(magm, "HotAir", 0.01)
- elements.property(magm, "Advection", 0.05)
- elements.property(elem.TPT_PT_MAGM, "Update",
- function(i,x,y,s,nt) --1
- if math.random(1,20) == 1 then --2
- sim.partProperty(i, "type", elements.DEFAULT_PT_LAVA)
- end --2
- end --1
- ) --*1
- elements.property(elem.DEFAULT_PT_LAVA, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_LAVA then --4
- if sim.partProperty(r, "ctype") == elements.DEFAULT_PT_METL then --5
- if sim.partProperty(i, "ctype") == elements.DEFAULT_PT_VIBR then --6
- sim.partProperty(r, "type", elements.TPT_PT_XMEN)
- sim.partProperty(i, "type", elements.TPT_PT_XMEN)
- end --6
- end --5
- end --4
- end --3
- end --2
- if math.random(1,2) == 2 then --7
- if sim.partProperty(i, "ctype") == elements.TPT_PT_DMDD then --9
- sim.partProperty(i, "ctype", elements.DEFAULT_PT_DMND)
- end --8
- end --7
- if math.random(1,100) == 1 then --9
- if sim.partProperty(i, "temp") > 1920.30 then --10
- sim.partProperty(i, "type", elements.TPT_PT_MAGM)
- end --10
- end --9
- end --1
- ) --*1
- local h2o2 = elements.allocate("TPT", "H2O2")
- elements.element(h2o2, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(h2o2, "Name" , "H2O2")
- elements.property(h2o2, "Description" , "Hydrogen Peroxide, corrosive, decomposes into oxygen and water, rarely ozone.")
- elements.property(h2o2, "Color", 0x1E41CF)
- elements.property(h2o2, "Hardness", 0)
- elements.property(h2o2, "Weight", 30)
- elements.property(elem.TPT_PT_H2O2, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,100) == 10 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_OXYG then --10
- if sim.partProperty(r, "type") ~= elements.TPT_PT_O3 then --11
- if math.random(1,20) == 1 then --12
- sim.partProperty(r, "type", elements.DEFAULT_PT_O2)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+300)
- if math.random(1,10) == 1 then --13
- sim.pressure(x/4,y/4,2)
- sim.partProperty(r, "type", elements.DEFAULT_PT_WATR)
- if math.random(1,10) == 1 then --14
- sim.partProperty(i, "type", elements.TPT_PT_O3)
- return
- end --14
- end --13
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local cmnt = elements.allocate("TPT" , "CMNT")
- elements.element(cmnt, elements.element(elements.DEFAULT_PT_WATR))
- elements.property(cmnt, "Name" , "CMNT")
- elements.property(cmnt, "Description" , "Cement, hardens over time.")
- elements.property(cmnt, "HighTemperature", 10001)
- elements.property(cmnt, "Weight", 31)
- elements.property(cmnt, "Color", 0x5E5E5E)
- elements.property(elem.TPT_PT_CMNT, "Update",
- function(i,x,y,s,nt) --1
- if math.random(1,12) == 1 then --2
- if math.sqrt(math.pow(sim.partProperty(i, "vx"),2)+math.pow(sim.partProperty(i, "vy"),2)) < 0.1 then --3
- if math.random(1,10) == 1 then --4
- sim.partProperty(i, "type", elements.DEFAULT_PT_BRCK)
- else if math.random(1,100) == 1 then --5
- sim.partProperty(i, "type", elements.DEFAULT_PT_CNCT)
- else if math.random(1,500) == 1 then --6
- sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local cmnp = elements.allocate("TPT", "CMNP")
- elements.element(cmnp, elements.element(elements.DEFAULT_PT_DUST))
- elements.property(cmnp, "Name" , "CMNP")
- elements.property(cmnp, "Description" , "Cement powder, mix with water to get cement.")
- elements.property(cmnp, "Color", 0x7F7F7F)
- elements.property(cmnp, "Flammable", 0)
- elements.property(elem.TPT_PT_CMNP, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,50) == 10 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --5
- sim.partChangeType(r, elements.TPT_PT_CMNT)
- sim.partChangeType(i, elements.TPT_PT_CMNT)
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local bulb = elements.allocate("TPT" , "BULB")
- elements.element(bulb, elements.element(elements.DEFAULT_PT_GLAS))
- elements.property(bulb, "Name" , "BULB")
- elements.property(bulb, "Description" , "Light bulb, emits light permanently.")
- elements.property(bulb, "Color", 0xFFFF80)
- elements.property(bulb, "Hardness", 0)
- elements.property(bulb, "Temperature", 273.15)
- elements.property(bulb, "HighTemperature", 10001)
- elements.property(bulb, "Properties", elements.PROP_NEUTPASS+elements.PROP_RADIOACTIVE+elements.TYPE_SOLID)
- elements.property(elem.TPT_PT_BULB, "Update", --*1
- function(i,x,y) --1
- if math.random(1,10) == 1 then --2
- if sim.pressure(x/4,y/4) < 393.15 then --3
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+5)
- end --3
- if sim.pressure(x/4,y/4) > 2.00 then --4
- sim.pressure(x/4,y/4,5.00)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+500)
- sim.partProperty(i, "type", elements.DEFAULT_PT_BGLA);
- end --4
- end --2
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- return 1,ren.FIRE_ADD,255,colr,colg,colb,128,255,255,128
- end --*1
- elements.property(bulb, "Graphics", funcGraphics)
- local muon = elements.allocate("TPT", "MUON")
- elements.element(muon, elements.element(elements.DEFAULT_PT_PROT))
- elements.property(muon, "Name" , "MUON")
- elements.property(muon, "Description" , "Muons, heavy particles which decay.")
- elements.property(muon, "Color", 0xF8C830)
- elements.property(muon, "MenuSection", 16)
- elements.property(muon, "Diffusion", 0.05)
- elements.property(muon, "Create", --*1
- function(i,x,y) --1
- sim.partProperty(i, "life", 300)
- end --1
- ) --*1
- elements.property(muon, "Update", --*1
- function(i,x,y) --1
- velocity_2(i,2,6)
- if math.random(0,7) > 0 then --2
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- if sim.partProperty(i, "life") < 1 then --3
- if math.random(0,7) == 0 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.pressure(x/4,y/4,10)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+2000)
- sim.partProperty(i, "life", 500)
- sim.partProperty(i, "type", elements.DEFAULT_PT_ELEC)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- return 1,ren.PMODE_FLAT+ren.FIRE_ADD,255,248,200,48,192,248,200,48
- end --*1
- elements.property(muon, "Graphics", funcGraphics)
- local tau = elements.allocate("TPT", "TAU")
- elements.element(tau, elements.element(elements.DEFAULT_PT_PROT))
- elements.property(tau, "Name" , "TAU")
- elements.property(tau, "Description" , "Tauons, very heavy particles which decay quickly.")
- elements.property(tau, "Color", 0xC800E8)
- elements.property(tau, "MenuSection", 16)
- elements.property(tau, "Diffusion", 0.1)
- elements.property(tau, "Create", --*1
- function(i,x,y) --1
- sim.partProperty(i, "life", 120)
- end --1
- ) --*1
- elements.property(tau, "Update", --*1
- function(i,x,y) --1
- velocity_2(i,2,12)
- if sim.partProperty(i, "tmp") == 0 then --2
- if sim.partProperty(i, "life") == 0 then --2
- sim.partProperty(i, "life", 120)
- sim.partProperty(i, "tmp", 1)
- end --2
- end --2*
- if math.random(0,7) > 0 then --3
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- if sim.partProperty(i, "life") < 1 then --4
- if math.random(0,5) == 0 then --5
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.pressure(x/4,y/4,10)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+4000)
- sim.partProperty(i, "life", 500)
- if math.random(0,5) == 0 then --6
- sim.partProperty(i, "type", elements.TPT_PT_MUON)
- else
- sim.partProperty(i, "type", elements.DEFAULT_PT_ELEC)
- end --6
- end --5
- end --4
- end --3
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- return 1,ren.PMODE_FLAT+ren.FIRE_ADD,255,200,16,232,192,200,16,232
- end --*1
- elements.property(tau, "Graphics", funcGraphics)
- local wyst = elements.allocate("TPT" , "WYST")
- elements.element(wyst, elements.element(elements.DEFAULT_PT_WATR))
- elements.property(wyst, "Name" , "WYST")
- elements.property(wyst, "Description" , "Water-Yeast mixture, spreads quickly under heat.")
- elements.property(wyst, "HighTemperature", 10001)
- elements.property(wyst, "Weight", 30.1)
- elements.property(wyst, "Color", 0x9E9280)
- elements.property(elem.TPT_PT_WYST, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --3
- if math.random(1,12) == 1 then --4
- if sim.partProperty(i, "temp") > 309.15 then --5
- if math.random(1,10) == 1 then --6
- sim.partProperty(r, "type", elements.TPT_PT_WYST)
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.DEFAULT_PT_YEST, "Update",
- function(i,x,y,s,nt) --1
- if math.random(1,50) == 10 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --5
- sim.partChangeType(r, elements.TPT_PT_WYST)
- sim.partChangeType(i, elements.TPT_PT_WYST)
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local algae = elements.allocate("TPT", "ALGAE")
- elements.element(algae, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(algae, "Name" , "ALGE")
- elements.property(algae, "Description" , "Algae, spreads in water.")
- elements.property(algae, "Color", 0x407010)
- elements.property(algae, "Diffusion", 0.3)
- elements.property(algae, "Weight", 31)
- elements.property(algae, "MenuSection", 16)
- elements.property(elem.TPT_PT_ALGAE, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt == 8 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
- if math.random(1,1000) > 1 then --4
- sim.partProperty(i, "vy", -0.05)
- end --5
- if math.random(1,1000) > 1 then --5
- sim.partProperty(i, "vx", math.random(-0.01,0.01))
- end --6
- end --4
- if math.random(1,250) < 4 then --7
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- end --7
- if math.random(1,400) < 2 then --8
- sim.partKill(i)
- end --8
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
- if math.random(1,200) == 1 then --10
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
- end --10
- end --9
- end --3
- end --2
- if math.random(1,400) < 2 then --11
- sim.partKill(i)
- end --11
- end --1
- ) --*1
- local balgae = elements.allocate("TPT", "BALGAE")
- elements.element(balgae, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(balgae, "Name" , "BLGE")
- elements.property(balgae, "Description" , "Blue Algae, spreads in water.")
- elements.property(balgae, "Color", 0x107050)
- elements.property(balgae, "Diffusion", 0.3)
- elements.property(balgae, "Weight", 31)
- elements.property(balgae, "MenuSection", 16)
- local galgae = elements.allocate("TPT", "GALGAE")
- elements.element(galgae, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(galgae, "Name" , "GLGE")
- elements.property(galgae, "Description" , "Green Algae, grows in water.")
- elements.property(galgae, "Color", 0x209010)
- elements.property(galgae, "Diffusion", 0.3)
- elements.property(galgae, "Weight", 31)
- elements.property(galgae, "MenuSection", 16)
- elements.property(elem.TPT_PT_GALGAE, "Update", --*1
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,2,1) do --2
- if (nt > 2) and (nt < 6) then --3 --**DRY**
- if math.random(1,1000) < 2 then --4
- sim.partKill(i)
- end --4
- end --3
- if nt == 8 then --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4 --**WET**
- if math.random(1,1000) < 1000 then --5
- sim.partProperty(i, "vy", -0.05)
- if math.random(1,1500) < 4 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- end --6
- end --5
- end --8
- if math.random(1,4000) < 2 then --8
- sim.partKill(i)
- end --8
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
- if math.random(1,200) == 1 then --10
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
- end --10
- end --9
- end --3
- end --2
- if math.random(1,400) < 2 then --11
- sim.partKill(i)
- end --11
- end --1
- ) --*1
- elements.property(elem.TPT_PT_BALGAE, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt == 8 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
- if math.random(1,1000) > 1 then --4
- sim.partProperty(i, "vy", -0.05)
- end --5
- if math.random(1,1000) > 1 then --5
- sim.partProperty(i, "vx", math.random(-0.01,0.01))
- end --6
- end --4
- if math.random(1,62) < 8 then --7
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-4,x+4),math.random(y-2,y+2),elements.TPT_PT_BALGAE)
- if math.random(1,8000) < 4 then --8
- sim.partProperty(i, "type", elements.TPT_PT_H2O2)
- end --8
- end --7
- if math.random(1,100) < 2 then --9
- sim.partKill(i)
- end --9
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --10
- if math.random(1,125) == 1 then --11
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BALGAE)
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_H2O2)
- sim.partCreate(-1, math.random(x-2,x+2),math.random(y-2,y+2),elements.TPT_PT_BALGAE)
- sim.partKill(r)
- end --11
- end --10
- end --3
- end --2
- if math.random(1,400) < 2 then --11
- sim.partKill(i)
- end --11
- end --1
- ) --*1
- local ralgae = elements.allocate("TPT", "RALGAE")
- elements.element(ralgae, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(ralgae, "Name" , "RLGE")
- elements.property(ralgae, "Description" , "Red Algae, grows in water.")
- elements.property(ralgae, "Color", 0x802010)
- elements.property(ralgae, "Diffusion", 0.3)
- elements.property(ralgae, "Weight", 31)
- elements.property(ralgae, "MenuSection", 16)
- elements.property(elem.TPT_PT_RALGAE, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt == 8 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
- if math.random(1,1000) > 1 then --4
- sim.partProperty(i, "vy", -0.25)
- end --5
- if math.random(1,1000) > 1 then --5
- sim.partProperty(i, "vx", math.random(-0.4,0.4))
- end --6
- end --4
- if math.random(1,5000) < 4 then --7
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RALGAE)
- end --7
- if math.random(1,900) < 2 then --8
- sim.partKill(i)
- end --8
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
- if math.random(1,1000) == 1 then --10
- sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_RALGAE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_GAS)
- end --10
- end --9
- end --3
- end --2
- if math.random(1,400) < 2 then --11
- sim.partKill(i)
- end --11
- end --1
- ) --*1
- local gluo = elements.allocate("TPT", "GLUO")
- elements.element(gluo, elements.element(elements.DEFAULT_PT_PROT))
- elements.property(gluo, "Name" , "GLUO")
- elements.property(gluo, "Description" , "Gluons, sticky.")
- elements.property(gluo, "Color", 0xC8C888)
- elements.property(gluo, "MenuSection", 16)
- elements.property(gluo, "Create", --*1
- function(i,x,y,s) --1
- sim.partProperty(i, "life", 400)
- end --1
- ) --*1
- elements.property(gluo, "Update", --*1
- function(i,x,y) --1
- velocity_2(i,2,180)
- if math.random(0,7) > 0 then --3
- if s ~=8 then --4
- for r in sim.neighbors(x,y,1,1) do --5
- sim.partProperty(r, "vx", sim.partProperty(r, "vx")/1.1)
- sim.partProperty(r, "vy", sim.partProperty(r, "vy")/1.1)
- sim.partProperty(i, "vx", sim.partProperty(i, "vx")/1.1)
- sim.partProperty(i, "vy", sim.partProperty(i, "vy")/1.1)
- end --5
- end --4
- if sim.partProperty(i, "life") < 1 then --7
- if math.random(0,5) == 0 then --8
- sim.partKill(i)
- end --8
- end --7
- if sim.partProperty(i, "life") > 0 then --9
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --9
- end --3
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- return 1,ren.PMODE_FLAT+ren.FIRE_ADD,255,200,200,136,192,200,200,136
- end --*1
- elements.property(gluo, "Graphics", funcGraphics)
- local qgp = elements.allocate("TPT" , "QGP")
- elements.element(qgp, elements.element(elements.DEFAULT_PT_WTRV))
- elements.property(qgp, "Name" , "QGP")
- elements.property(qgp, "Description" , "Quark-Gluon Plasma.")
- elements.property(qgp, "Color", 0x06FF18)
- elements.property(qgp, "PhotonReflectWavelengths", 0x00008000)
- elements.property(qgp, "MenuSection", 10)
- elements.property(qgp, "Diffusion", 0.035)
- elements.property(qgp, "Flammable", 0)
- elements.property(qgp, "HeatConduct", 255)
- elements.property(qgp, "Loss", -1.0175)
- elements.property(qgp, "LowTemperature", -256)
- elements.property(qgp, "Create", --*1
- function(i,x,y,s) --1
- sim.partProperty(i, "life", 800)
- end --1
- ) --*1
- elements.property(elements.TPT_PT_QGP, "Update", --*1
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "life") > 0 then --3
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --3
- attract(i,x,y,math.random(-0.1,0.1))
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")*1.025)
- if sim.partProperty(i, "life") < 1 and math.random(0,63) == 0 then --4
- sim.partKill(i)
- end --4
- if math.random(0,25000) == 0 then --5
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_GLUO)
- end --5
- if math.random(0,25000) == 0 then --6
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PROT)
- sim.partKill(i)
- end --6
- if math.random(0,2500) == 0 then --7
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_NEUT)
- sim.partKill(i)
- end --7
- end --1
- ) --*1
- local plig = elements.allocate("TPT" , "PLIG")
- elements.element(plig, elements.element(elements.DEFAULT_PT_WTRV))
- elements.property(plig, "Name" , "PLIG")
- elements.property(plig, "Description" , "Pulverized Lightning")
- elements.property(plig, "Color", 0xE6F0FF)
- elements.property(plig, "PhotonReflectWavelengths", 0x00008000)
- elements.property(plig, "MenuSection", 10)
- elements.property(plig, "Diffusion", 0.035)
- elements.property(plig, "Flammable", 0)
- elements.property(plig, "Falldown", 1)
- elements.property(plig, "Loss", 0.6)
- elements.property(plig, "LowTemperature", -256)
- elements.property(elements.TPT_PT_PLIG, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(0,15) == 0 then --3
- sim.partKill(i)
- end --3
- if math.random(0,499) == 0 then --4
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_ELEC)
- end --4
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- 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
- end --*1
- elements.property(qgp, "Graphics", funcGraphics)
- local function funcGraphics(i, colr, colg, colb) --*1
- return 0,ren.PMODE_GLOW+ren.FIRE_ADD,127,230,240,255,127,230,240,255
- end --*1
- elements.property(plig, "Graphics", funcGraphics)
- elements.property(elements.DEFAULT_PT_NEUT, "HighTemperature", 9999.99)
- elements.property(elements.DEFAULT_PT_NEUT, "HighTemperatureTransition", elements.TPT_PT_QGP)
- elements.property(elements.DEFAULT_PT_NEUT, "LowPressure", -250)
- elements.property(elements.DEFAULT_PT_NEUT, "LowPressureTransition", elements.TPT_PT_QGP)
- elements.property(elements.DEFAULT_PT_PROT, "HighTemperature", 9999.99)
- elements.property(elements.DEFAULT_PT_PROT, "HighTemperatureTransition", elements.TPT_PT_QGP)
- local lno2 = elements.allocate("TPT" , "LNO2")
- elements.element(lno2, elements.element(elements.DEFAULT_PT_LOXY))
- elements.property(lno2, "Name" , "LNO2")
- elements.property(lno2, "Description" , "Liquid Nitrogen Dioxide, explosive.")
- elements.property(lno2, "Color", 0xD58C4A)
- elements.property(lno2, "Gravity", 0.3)
- elements.property(lno2, "Temperature", 290.15)
- elements.property(lno2, "MenuSection", 5)
- elements.property(lno2, "Flammable", 3)
- elements.property(lno2, "HeatConduct", 16)
- local no2 = elements.allocate("TPT" , "NO2")
- elements.element(no2, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(no2, "Name" , "NO2")
- elements.property(no2, "Description" , "Nitrogen Dioxide, reacts with water to form nitric acid.")
- elements.property(no2, "Color", 0xB54C2A)
- elements.property(no2, "Gravity", 0.3)
- elements.property(no2, "Falldown", 2)
- elements.property(no2, "PhotonReflectWavelengths", 0x100000000000)
- elements.property(no2, "MenuSection", 6)
- elements.property(no2, "Flammable", 10)
- elements.property(no2, "LowTemperature", 293.15)
- elements.property(no2, "LowTemperatureTransition", elements.TPT_PT_LNO2)
- elements.property(lno2, "HighTemperature", 294.3)
- elements.property(lno2, "HighTemperatureTransition", elements.TPT_PT_NO2)
- local brau = elements.allocate("TPT" , "BRAU")
- elements.element(brau, elements.element(elements.DEFAULT_PT_EQVE))
- elements.property(brau, "Name" , "BRAU")
- elements.property(brau, "Description" , "Broken Gold.")
- elements.property(brau, "Color", 0xB98C33)
- elements.property(brau, "HighTemperature", 1337.0)
- elements.property(brau, "HighTemperatureTransition", elements.DEFAULT_PT_GOLD)
- elements.property(brau, "MenuSection", 16)
- elements.property(brau, "Flammable", 0)
- elements.property(elements.DEFAULT_PT_GOLD, "HighPressure", 300)
- elements.property(elements.DEFAULT_PT_GOLD, "HighPressureTransition", elements.TPT_PT_BRAU)
- local hno3 = elements.allocate("TPT", "HNO3")
- elements.element(hno3, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(hno3, "Name" , "HNO3")
- elements.property(hno3, "Description" , "Nitric acid, corrosive, releases deadly gasses.")
- elements.property(hno3, "Color", 0x6991B5)
- elements.property(hno3, "Hardness", 0)
- elements.property(hno3, "Flammable", 500)
- elements.property(hno3, "Weight", 30)
- elements.property(elem.TPT_PT_HNO3, "Update", --*1
- function(i,x,y,s,nt) --1
- sim.partProperty(i, "tmp", 2)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,100) == 10 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_GLAS then --10
- if sim.partProperty(r, "type") ~= elements.TPT_PT_BRAU then --11
- if math.random(1,20) == 1 then --12
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_GOLD then --13
- sim.partProperty(r, "type", elements.TPT_PT_NO2)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+300)
- sim.partProperty(i, "tmp", sim.partProperty(i, "tmp")+1)
- end --13
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_GOLD then --14
- sim.pressure(x/4,y/4,2)
- sim.partProperty(r, "type", elements.TPT_PT_BRAU)
- sim.partProperty(i, "tmp", sim.partProperty(i, "tmp")+1)
- if math.random(1,10) == 1 then --15
- sim.partProperty(i, "type", elements.TPT_PT_NO2)
- return
- end --15
- end --14
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local function funcGraphics2(i, colr, colg, colb) --*1
- return 0,ren.PMODE_FLAT,255,colr,colg,colb,255,105+sim.partProperty(i, "tmp")*8-1,145,181
- end --*1
- elements.property(hno3, "Graphics", funcGraphics2)
- elements.property(elem.TPT_PT_NO2, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,2) == 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_HNO3)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+20)
- if math.random(1,2) == 1 then --9
- sim.partKill(i)
- return
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local rad = elements.allocate("TPT", "RADON")
- elements.element(rad, elements.element(elements.DEFAULT_PT_NBLE))
- elements.property(rad, "Name" , "RADN")
- elements.property(rad, "Description" , "Radon, screws up electronics and kills organic matter.")
- elements.property(rad, "Color", 0xD8D8C0)
- elements.property(rad, "MenuSection", 6)
- elements.property(rad, "LowTemperature", -1)
- elements.property(rad, "Gravity", 0.2)
- elements.property(elem.TPT_PT_RADON, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(1,100) == 10 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_YEST then --5
- if math.random(1,2) == 2 then --6
- sim.partKill(r)
- end --6
- end --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT then --7
- if math.random(1,2) == 2 then --8
- sim.partKill(r)
- end --8
- end --7
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --9
- if math.random(1,5) == 5 then --10
- sim.partKill(r)
- end --10
- end --9
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_STKM then --11
- if math.random(1,2) == 2 then --12
- sim.partKill(r)
- end --12
- end --11
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIGH then --13
- if math.random(1,2) == 2 then --14
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTR then --15
- if math.random(1,2) == 2 then --16
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_ALGAE then --17
- if math.random(1,2) == 2 then --18
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_GALGAE then --19
- if math.random(1,2) == 2 then --20
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_BALGAE then --21
- if math.random(1,2) == 2 then --22
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTRC then --23
- if math.random(1,2) == 2 then --24
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTRP then --25
- if math.random(1,2) == 2 then --26
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTRD then --27
- if math.random(1,2) == 3 then --28
- sim.partKill(r)
- end --14
- end --13
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTRA then --29
- if math.random(1,3) == 3 then --30
- sim.partKill(r)
- end --14
- end --13
- end --4
- end --3
- end --2
- if math.random(1,5760) == 1 then --31
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+200)
- sim.pressure(x/4,y/4,2) sim.partProperty(i, "type", elements.DEFAULT_PT_POLO)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_NBLE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_NEUT)
- end --31
- end --1
- ) --*1
- --[[ kinda breaks alot of water mechanics, add it in yourself at your own risk
- local stea = elements.allocate("TPT", "STEAM")
- elements.element(stea, elements.element(elements.DEFAULT_PT_WTRV))
- elements.property(stea, "Name" , "STEA")
- elements.property(stea, "Description" , "Steam.")
- elements.property(stea, "Color", 0xC2C6CA)
- elements.property(stea, "MenuSection", 16)
- elements.property(stea, "HotAir", 0.001)
- elements.property(stea, "AirDrag", 0.015)
- elements.property(stea, "Loss", 0.2)
- elements.property(stea, "LowTemperature", 372.15)
- elements.property(stea, "Diffusion", 0.25)
- elements.property(stea, "LowTemperatureTransition", elements.DEFAULT_PT_WTRV)
- elements.property(elem.TPT_PT_STEAM, "Update", --*1
- function(i,x,y,s,nt) --1
- if s > 2 then --2
- if math.random(0,65535) == 0 then --3
- sim.partProperty(i, "type", elements.DEFAULT_PT_WTRV)
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_WTRV, "HighTemperature", 402.15)
- elements.property(elements.DEFAULT_PT_WTRV, "HighTemperatureTransition", elements.TPT_PT_STEAM)
- elements.property(stea, "Graphics",
- function(i, colr, colg, colb) --1
- return 1,ren.FIRE_BLEND,255,colr,colg,colb,8,128,128,128
- end --1
- ) --*1
- --]]
- local sball = elements.allocate("TPT" , "SBALL")
- elements.element(sball, elements.element(elements.DEFAULT_PT_CNCT))
- elements.property(sball, "Name" , "SBAL")
- elements.property(sball, "Description" , "Super Bouncy Ball from the old Dan-Ball powder game.")
- elements.property(sball, "Color", 0xF73C9E)
- elements.property(sball, "Falldown", 1)
- elements.property(sball, "PhotonReflectWavelengths", 0x20000100)
- elements.property(sball, "Collision", -1)
- elements.property(sball, "Gravity", 0.2)
- elements.property(sball, "Flammable", 2)
- elements.property(sball, "HighTemperature", 10001.00)
- elements.property(sball, "AirDrag", 0.0001)
- elements.property(sball, "Advection", 0.01)
- elements.property(sball, "Loss", 0.99)
- elements.property(sball, "Weight", 60)
- elements.property(sball, "Update", NULL)
- local after = elements.allocate("TPT" , "AFTER")
- elements.element(after, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(after, "Name" , "!!!")
- elements.property(after, "Description" , "Destroyed matter.")
- elements.property(after, "Color", 0xFF0000)
- elements.property(after, "Falldown", 1)
- elements.property(after, "MenuSection", 16)
- elements.property(after, "PhotonReflectWavelengths", 0x20000001)
- elements.property(elem.TPT_PT_AFTER, "Update", --*1
- function(i,x,y) --1
- if sim.partProperty(i, "tmp") == 1 or sim.partProperty(i, "tmp") == 0 then --2
- sim.partProperty(i, "life", 15)
- sim.partProperty(i, "tmp", -1)
- end --2
- if math.random(0,31) == 0 then --2
- if sim.partProperty(i, "life") < 1 then --3
- sim.partKill(i)
- return
- end --3
- end --2
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --1
- ) --*1
- local nuke = elements.allocate("TPT" , "NUKE")
- elements.element(nuke, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(nuke, "Name" , "???")
- elements.property(nuke, "Description" , "Destroys everything.")
- elements.property(nuke, "Color", 0xFF00FF)
- elements.property(nuke, "Falldown", 1)
- elements.property(nuke, "PhotonReflectWavelengths", 0x20000001)
- elements.property(nuke, "HighTemperature", 10001.00)
- elements.property(elem.TPT_PT_NUKE, "Update", --*1
- function(i,x,y,s,nt) --1
- if s >= 0 then --2
- if math.random(0,1) == 1 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.TPT_PT_AFTER then --5
- if math.random(0,1) == 1 then --6
- sim.partProperty(r, "type", elements.TPT_PT_NUKE)
- end --6
- end --5
- end --4
- end --3
- if sim.partProperty(i, "tmp") == 0 then --7
- sim.partProperty(i, "life", 3)
- sim.partProperty(i, "tmp", 1)
- end --7
- if sim.partProperty(i, "life") < 1 then --8
- sim.partProperty(i, "type", elements.TPT_PT_AFTER)
- end --8
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_NUKE)
- end --2
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+646.99)
- sim.pressure(x/4,y/4,0)
- end --1
- ) --*1
- local infc = elements.allocate("TPT" , "INFC")
- elements.element(infc, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(infc, "Name" , "INFC")
- elements.property(infc, "Description" , "Infection.")
- elements.property(infc, "Color", 0x800080)
- elements.property(infc, "Falldown", 1)
- elements.property(infc, "PhotonReflectWavelengths", 0x20000001)
- elements.property(infc, "HighTemperature", 10001.00)
- elements.property(infc, "Diffusion", 0.1)
- elements.property(infc, "Loss", 0.5)
- elements.property(elem.TPT_PT_INFC, "Update", --*1
- function(i,x,y,s,nt) --1
- if s >= 0 then --2
- if math.random(0,15) == 1 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND and sim.partProperty(r, "type") ~= elements.TPT_PT_AFTER then --5
- if sim.partProperty(r, "type") ~= elements.TPT_PT_DMDD and sim.partProperty(r, "type") ~= elements.DEFAULT_PT_NEUT then ---6
- if math.random(0,7) == 0 then --7
- sim.partProperty(r, "type", elements.TPT_PT_INFC)
- else
- sim.partKill(i)
- return
- end --7
- end --6
- end --5
- end --4
- end --3
- if sim.partProperty(i, "tmp") == 0 then --7
- sim.partProperty(i, "life", 3)
- sim.partProperty(i, "tmp", 1)
- end --7
- if sim.partProperty(i, "life") < 1 then --8
- sim.partProperty(i, "type", elements.TPT_PT_AFTER)
- end --8
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_INFC)
- end --2
- if math.random(0,2) > 0 then --9
- sim.partKill(i)
- end --9
- end --1
- ) --*1
- elements.property(infc, "Graphics",
- function(i, colr, colg, colb) --1
- return 1,ren.PMODE_GLOW,255,colr,colg,colb,255,127,0,127
- end --1
- ) --*1
- local clar = elements.allocate("TPT" , "CLEAR")
- elements.element(clar, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(clar, "Name" , "CLAR")
- elements.property(clar, "Description" , "Fully Transparent")
- elements.property(clar, "Color", 0x000000)
- elements.property(clar, "PhotonReflectWavelengths", 0x00000000)
- elements.property(clar, "Graphics",
- function(i, colr, colg, colb) --1
- return 1,ren.PMODE_ADD,0,colr,colg,colb,0,0,0,1280
- end --1
- ) --*1
- local d38 = elements.allocate("TPT" , "D38")
- elements.element(d38, elements.element(elements.DEFAULT_PT_IRON))
- elements.property(d38, "Name" , "D38")
- elements.property(d38, "Description" , "Depleted uranium. Neutron reflector.")
- elements.property(d38, "Color", 0xD0E0C0)
- elements.property(d38, "Hardness", 0)
- elements.property(d38, "HighTemperature", 1405)
- elements.property(elem.TPT_PT_D38, "Update", --*1
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_NEUT then --3
- if math.random(0,7) == 0 then --4
- sim.partCreate(-1, math.random(-1,1)+x, math.random(-1,1)+y, elements.DEFAULT_PT_NEUT)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+50)
- sim.partProperty(r, "life", sim.partProperty(r, "life")+500)
- sim.pressure(x/4,y/4,1)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.DEFAULT_PT_COAL, "HeatConduct", 64)
- elements.property(elem.DEFAULT_PT_WOOD, "Flammable", 3)
- elements.property(elem.DEFAULT_PT_WOOD, "HeatConduct", 196)
- elements.property(elem.DEFAULT_PT_WOOD, "Update", --*1
- function(i,x,y,s,nt) --1
- if s > 2 then --2
- if sim.partProperty(i, "temp") > 550 then --3
- if math.random(0,63) == 0 then --4
- sim.partProperty(i, "life", 110)
- sim.partProperty(i, "type", elements.DEFAULT_PT_COAL)
- end --4
- end --3
- end --2
- if s < 2 then --5
- if sim.partProperty(i, "temp") > 550 then --6
- if math.random(0,1023) == 0 then --7
- sim.partProperty(i, "life", 110)
- sim.partProperty(i, "type", elements.DEFAULT_PT_COAL)
- end --7
- end --6
- end --5
- end --1
- ) --*1
- local vdlq = elements.allocate("TPT", "VDLQ")
- elements.element(vdlq, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(vdlq, "Name" , "VDLQ")
- elements.property(vdlq, "Description" , "Void Liquid. Sludge of death. Consumes.")
- elements.property(vdlq, "Color", 0x080808)
- elements.property(vdlq, "Advection", 0.01)
- elements.property(vdlq, "Weight", 100)
- elements.property(vdlq, "Hardness", 0)
- elements.property(vdlq, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_VDLQ, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,0.05)
- sim.partProperty(i, "life", 96)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,7) == 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
- if math.random(1,3) == 1 then --11
- sim.partKill(r)
- if math.random(0,3) == 0 then --12
- sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+1)*-1.5)
- velocity_2(i,math.random(-0.1,5),math.random(4,6))
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_VDLQ)
- return
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- if s > 6 then --13
- if math.random(0,63) == 0 then --14
- sim.partKill(i)
- return
- end --14
- end --13
- end --1
- ) --*1
- elements.property(vdlq, "Graphics",
- function(i, colr, colg, colb) --1
- if math.random(0,15) == 0 then --2
- return 0,ren.PMODE_SPARK,255,colr,colg,colb,63,255,255,255
- else
- return 0,ren.PMODE_ADD,255,colr,colg,colb,127,8,8,8
- end --2
- end --1
- ) --*1
- local star = elements.allocate("TPT", "STAR")
- elements.element(star, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(star, "Name" , "STAR")
- elements.property(star, "Description" , "Star matter. Ultra Sludge of death. Perpetual nuke.")
- elements.property(star, "Color", 0xFFFFEE)
- elements.property(star, "Advection", 0.05)
- elements.property(star, "Gravity", 0.0)
- elements.property(star, "Weight", 100)
- elements.property(star, "Hardness", 0)
- elements.property(star, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_STAR, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,0.05)
- sim.partProperty(i, "life", 96)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,7) == 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if math.random(0,63) == 1 then --5
- sim.partKill(r)
- if math.random(0,63) == 0 then --6
- sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+1)*1.5)
- velocity_2(i,math.random(2,6),math.random(16,9))
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_HYGN)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_HE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_STAR)
- end --6
- end --5
- end --4
- end --3
- end --2
- if s > 6 then --7
- if math.random(0,63) == 0 then --8
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_THDR)
- sim.partKill(i)
- return
- end --7
- end --8
- end --1
- ) --*1
- elements.property(vdlq, "Graphics",
- function(i, colr, colg, colb) --1
- if math.random(0,15) == 0 then --2
- return 0,ren.PMODE_SPARK,255,colr,colg,colb,63,255,255,238
- else
- return 0,ren.PMODE_ADD,255,colr,colg,colb,250,255,255,238
- end --2
- end --1
- ) --*1
- local alch = elements.allocate("TPT", "ETHA")
- elements.element(alch, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(alch, "Name" , "ALCH")
- elements.property(alch, "Description" , "99% Ethanol, mildly flammable.")
- elements.property(alch, "Color", 0x2870D8)
- elements.property(alch, "Weight", 29)
- elements.property(alch, "Flammable", 1)
- local alcv = elements.allocate("TPT", "ETHV")
- elements.element(alcv, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(alcv, "Name" , "ALCV")
- elements.property(alcv, "Description", "Alcohol Vapor, inhale if you dare, it burns.")
- elements.property(alcv, "Color", 0x2068D0)
- elements.property(alcv, "Diffusion", 1.5)
- elements.property(alcv, "Gravity", -0.3)
- elements.property(alcv, "Flammable", 0)
- elements.property(alcv, "LowTemperature", 351.5)
- elements.property(alcv, "LowTemperatureTransition", elem.TPT_PT_ETHA)
- elements.property(alcv, "MenuSection", 16)
- elements.property(elem.TPT_PT_ETHA, "Update", --*1
- function(i,x,y,s) --1
- if math.random(0,15) == 0 then --2
- if sim.partProperty(i, "temp") > 351.5 then --3
- if math.random(0,25) == 0 then --4
- sim.partProperty(i, "type", elements.TPT_PT_ETHV)
- sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)+0.02)
- return
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local form = elements.allocate("TPT", "ACET")
- elements.element(form, elements.element(elements.DEFAULT_PT_HYGN))
- elements.property(form, "Name" , "ACET")
- elements.property(form, "Description", "Acetaldehyde. Toxic.")
- elements.property(form, "Color", 0xDF972F)
- elements.property(form, "Diffusion", 1.5)
- elements.property(form, "Gravity", 0.01)
- elements.property(form, "Flammable", 0)
- elements.property(form, "MenuSection", 16)
- local lfrm = elements.allocate("TPT", "DISF")
- elements.element(lfrm, elements.element(elements.DEFAULT_PT_SOAP))
- elements.property(lfrm, "Name" , "LAET")
- elements.property(lfrm, "Description", "Liquid Acetaldehyde. Disinfectant")
- elements.property(lfrm, "Color", 0xEFA73F)
- elements.property(lfrm, "Diffusion", 0.1)
- elements.property(lfrm, "Weight", 10)
- elements.property(lfrm, "Flammable", 0)
- elements.property(lfrm, "HighTemperature", 293.15)
- elements.property(lfrm, "HighTemperatureTransition", elements.TPT_PT_ACET)
- elements.property(lfrm, "MenuSection", 16)
- elements.property(form, "LowTemperature", 293.00)
- elements.property(form, "LowTemperatureTransition", elements.TPT_PT_DISF)
- elements.property(elem.TPT_PT_DISF, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,1) == 1 then --3
- for r in sim.neighbors(x,y,3,3) do --4
- 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
- if math.random(0,1) == 0 then --6
- sim.partProperty(r, "type", elements.DEFAULT_PT_OIL)
- sim.partProperty(r, "temp", sim.partProperty(i, "temp")-0.1)
- if math.random(0,255) == 0 then --7
- sim.pressure(x/4,y/4,0.1)
- sim.partProperty(i, "type", elements.TPT_PT_ACET)
- return
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_ACET, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,15) == 1 then --3
- for r in sim.neighbors(x,y,4,4) do --4
- 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
- if math.random(0,1) == 0 then --6
- sim.partProperty(r, "type", elements.DEFAULT_PT_OIL)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-2.5)
- if math.random(0,255) == 0 then --7
- sim.pressure(x/4,y/4,0.01)
- return
- end --7
- end --6
- end --5
- if sim.partProperty(r, "type") == elements.TPT_PT_BCTR then --8
- if math.random(0,0) == 0 then --9
- sim.partKill(r)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-0.1)
- if math.random(0,255) == 0 then --10
- sim.pressure(x/4,y/4,0.01)
- return
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elem.TPT_PT_ETHV, "Update", --*1
- function(i,x,y,s,nt) --1
- if math.random(1,2) == 2 then --2
- if s ~=8 and nt ~=0 and nt - s > 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(i, "tmp") == 0 then --5
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_FIRE then --6
- sim.partProperty(i, "tmp", -1)
- end --6
- end --5
- if sim.partProperty(i, "tmp") == -1 then --7
- if math.random(1,3) > 1 then --8
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)+0.1)
- if math.random(0,5) == 0 then --9
- if math.random(0,5) == 0 then --10
- sim.partProperty(r, "type", elem.TPT_PT_ACET)
- else
- sim.partKill(i)
- return
- end --10
- end --9
- end --8
- end --7
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local ssop = elements.allocate("TPT", "SSOP")
- elements.element(ssop, elements.element(elements.DEFAULT_PT_INSL))
- elements.property(ssop, "Name" , "SSOP")
- elements.property(ssop, "Description" , "Solid hand soap, dissolves in water slowly.")
- elements.property(ssop, "Color", 0xEEECC8)
- elements.property(ssop, "Hardness", 1)
- elements.property(ssop, "MenuSection", 11)
- elements.property(ssop, "HeatConduct", 2)
- elements.property(elem.TPT_PT_SSOP, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,255) == 0 then --3
- for r in sim.neighbors(x,y,2,2) do --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR or sim.partProperty(r, "type") == elements.DEFAULT_PT_VIRS then --5
- sim.partProperty(i, "type", elements.DEFAULT_PT_SOAP)
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_SOAP, "HighPressure", 143.15)
- elements.property(elements.DEFAULT_PT_SOAP, "HighPressureTransition", elements.TPT_PT_SSOP)
- local bpyr = elements.allocate("TPT", "BPYR")
- elements.element(bpyr, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(bpyr, "Name" , "BPYR")
- elements.property(bpyr, "Description" , "Blazing Pyrotheum, embodiment of ignition.")
- elements.property(bpyr, "Color", 0xFFE050)
- elements.property(bpyr, "Weight", 30)
- elements.property(bpyr, "Hardness", 0)
- elements.property(bpyr, "MenuSection", 11)
- elements.property(bpyr, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_BPYR, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,0.005)
- sim.partProperty(i, "life", 10)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,7) == 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
- if math.random(1,3) == 1 then --11
- if math.random(0,5) == 0 then --12
- velocity_2(i,math.random(-0.1,5),math.random(4,6))
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_FIRE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PLSM)
- sim.partProperty(r, "temp", sim.partProperty(i, "temp")+80)
- return
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- if s > 7 then --13
- if math.random(0,255) == 0 then --14
- sim.partKill(i)
- return
- end --14
- end --13
- end --1
- ) --*1
- elements.property(bpyr, "Graphics",
- function(i, colr, colg, colb) --1
- if math.random(0,15) == 0 then --2
- return 0,ren.PMODE_SPARK,255,colr,colg,colb,10,255,120,90
- else
- return 0,ren.PMODE_ADD,255,colr,colg,colb,127,255,240,80
- end --2
- end --1
- ) --*1
- local cryo = elements.allocate("TPT", "CRYO")
- elements.element(cryo, elements.element(elements.DEFAULT_PT_BCOL))
- elements.property(cryo, "Name" , "CRYO")
- elements.property(cryo, "Description" , "Cryotheum.")
- elements.property(cryo, "Color", 0x50E0F0)
- elements.property(cryo, "Weight", 30)
- elements.property(cryo, "Hardness", 0)
- elements.property(cryo, "MenuSection", 11)
- elements.property(elements.TPT_PT_CRYO, "Update", --*1
- function(i,x,y) --1
- if math.random(0,15) == 0 then --2
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_CFLM)
- end --2
- end --1
- ) --*1
- local pyro = elements.allocate("TPT", "PYRO")
- elements.element(pyro, elements.element(elements.DEFAULT_PT_BCOL))
- elements.property(pyro, "Name" , "PYRO")
- elements.property(pyro, "Description" , "Pyrotheum.")
- elements.property(pyro, "Color", 0xF0E050)
- elements.property(pyro, "Weight", 30)
- elements.property(pyro, "Hardness", 0)
- elements.property(pyro, "MenuSection", 11)
- elements.property(elements.TPT_PT_PYRO, "Update", --*1
- function(i,x,y) --1
- if math.random(0,15) == 0 then --2
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_FIRE)
- if math.random(0,127) == 0 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_PLSM)
- end --3
- end --2
- end --1
- ) --*1
- local aero = elements.allocate("TPT", "AERO")
- elements.element(aero, elements.element(elements.DEFAULT_PT_BCOL))
- elements.property(aero, "Name" , "AERO")
- elements.property(aero, "Description" , "Aerotheum.")
- elements.property(aero, "Color", 0xE0E0C0)
- elements.property(aero, "Weight", 20)
- elements.property(aero, "Hardness", 0)
- elements.property(aero, "Gravity", 0.1)
- elements.property(aero, "MenuSection", 11)
- elements.property(elements.TPT_PT_AERO, "Update", --*1
- function(i,x,y) --1
- if math.random(0,47) == 0 then --2
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PLIG)
- end --2
- end --1
- ) --*1
- local petro = elements.allocate("TPT", "PETR")
- elements.element(petro, elements.element(elements.DEFAULT_PT_BCOL))
- elements.property(petro, "Name" , "PETR")
- elements.property(petro, "Description" , "Petrotheum.")
- elements.property(petro, "Color", 0x292420)
- elements.property(petro, "Weight", 40)
- elements.property(petro, "Hardness", 0)
- elements.property(petro, "Gravity", 0.8)
- elements.property(petro, "MenuSection", 11)
- elements.property(elements.TPT_PT_PETR, "Update", --*1
- function(i,x,y) --1
- if math.random(0,47) == 0 then --2
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_SMKE)
- end --2
- end --1
- ) --*1
- local gcry = elements.allocate("TPT", "GCRY")
- elements.element(gcry, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(gcry, "Name" , "GCRY")
- elements.property(gcry, "Description" , "Gelid Cryotheum, embodiment of absolute zero.")
- elements.property(gcry, "Color", 0x50E0FF)
- elements.property(gcry, "Weight", 30)
- elements.property(gcry, "Hardness", 0)
- elements.property(gcry, "MenuSection", 11)
- elements.property(gcry, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_GCRY, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,0.005)
- sim.partProperty(i, "life", 10)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,7) == 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
- if math.random(1,3) == 1 then --11
- if math.random(0,5) == 0 then --12
- velocity_2(i,math.random(-0.1,5),math.random(4,6))
- if math.random(0,1) == 0 then --13
- end --13
- sim.partProperty(r, "temp", sim.partProperty(i, "temp")-100)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CFLM)
- return
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- if s > 7 then --13
- if math.random(0,255) == 0 then --14
- sim.partKill(i)
- return
- end --14
- end --13
- end --1
- ) --*1
- elements.property(gcry, "Graphics",
- function(i, colr, colg, colb) --1
- if math.random(0,15) == 0 then --2
- return 0,ren.PMODE_SPARK,255,colr,colg,colb,40,90,120,255
- else
- return 0,ren.PMODE_ADD,255,colr,colg,colb,127,80,240,255
- end --2
- end --1
- ) --*1
- local zaer = elements.allocate("TPT", "ZAER")
- elements.element(zaer, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(zaer, "Name" , "ZAER")
- elements.property(zaer, "Description" , "Zephyrean Aerotheum, embodiment of energy.")
- elements.property(zaer, "Color", 0xE0E0C0)
- elements.property(zaer, "Weight", 1)
- elements.property(zaer, "Hardness", 0)
- elements.property(zaer, "MenuSection", 11)
- elements.property(zaer, "Gravity", -0.01)
- elements.property(zaer, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_ZAER, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,0.005)
- sim.partProperty(i, "life", 10)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,7) == 0 then --3
- for r in sim.neighbors(x,y,3,3) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
- if math.random(1,3) == 1 then --11
- if math.random(0,5) == 0 then --12
- sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+1)*-1.5)
- velocity_2(i,math.random(-0.1,5),math.random(4,6))
- if math.random(0,1) == 0 then --13
- sim.partProperty(r, "type", elements.TPT_PT_PLIG)
- sim.partProperty(r, "life", 100)
- end --13
- sim.partProperty(r, "temp", sim.partProperty(i, "temp"))
- return
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- if s > 7 then --13
- if math.random(0,255) == 0 then --14
- sim.partKill(i)
- return
- end --14
- end --13
- end --1
- ) --*1
- elements.property(zaer, "Graphics",
- function(i, colr, colg, colb) --1
- if math.random(0,15) == 0 then --2
- return 0,ren.PMODE_SPARK,255,colr,colg,colb,2,224,224,208
- else
- return 0,ren.PMODE_ADD,255,colr,colg,colb,10,224,224,208
- end --2
- end --1
- ) --*1
- local tptr = elements.allocate("TPT", "TPTR")
- elements.element(tptr, elements.element(elements.DEFAULT_PT_GLOW))
- elements.property(tptr, "Name" , "TPTR")
- elements.property(tptr, "Description" , "Tectonic Petrotheum, embodiment of mass.")
- elements.property(tptr, "Color", 0x292420)
- elements.property(tptr, "Weight", 60)
- elements.property(tptr, "Hardness", 0)
- elements.property(tptr, "MenuSection", 11)
- elements.property(tptr, "Gravity", 0.8)
- elements.property(tptr, "Properties", elements.TYPE_LIQUID+elements.PROP_NEUTPENETRATE+elements.PROP_RADIOACTIVE)
- elements.property(elem.TPT_PT_TPTR, "Update", --*1
- function(i,x,y,s,nt) --1
- attract(i,x,y,0.015)
- sim.partProperty(i, "life", 10)
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if math.random(0,7) == 0 then --3
- for r in sim.neighbors(x,y,3,3) do --4
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
- if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
- if sim.partProperty(r, "type") ~= elements.TPT_PT_VDLQ then --10
- if math.random(1,3) == 1 then --11
- if math.random(0,5) == 0 then --12
- velocity_2(i,math.random(-0.1,5),math.random(4,6))
- if math.random(0,1) == 0 then --13
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SMKE)
- elseif math.random(0,1) == 0 then --13
- sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+3))
- end --13
- sim.partProperty(i, "temp", sim.partProperty(r, "temp"))
- return
- end --12
- end --11
- end --10
- end --9
- end --8
- end --7
- end --6
- end --5
- end --4
- end --3
- end --2
- if s > 7 then --13
- if math.random(0,255) == 0 then --14
- sim.partKill(i)
- return
- end --14
- end --13
- end --1
- ) --*1
- elements.property(tptr, "Graphics",
- function(i, colr, colg, colb) --1
- if math.random(0,15) == 0 then --2
- return 0,ren.PMODE_SPARK,255,colr,colg,colb,255,44,36,32
- else
- return 0,ren.PMODE_ADD,255,colr,colg,colb,64,44,36,32
- end --2
- end --1
- ) --*1
- local neur = elements.allocate("TPT", "NEUR")
- elements.element(neur, elements.element(elements.DEFAULT_PT_MERC))
- elements.property(neur, "Name" , "NEUR")
- elements.property(neur, "Description" , "Neurons?")
- elements.property(neur, "Color", 0x706020)
- elements.property(neur, "Weight", 30)
- elements.property(neur, "Hardness", 50)
- elements.property(neur, "MenuSection", 11)
- elements.property(neur, "Diffusion", 0.8)
- elements.property(neur, "Flammable", 1)
- elements.property(neur, "HighTemperature", 443.15)
- elements.property(neur, "HighTemperatureTransition", elements.DEFAULT_PT_WATR)
- elements.property(elements.TPT_PT_NEUR, "Update", --*1
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "life") > 0 then --2
- if math.random(1,65) == 1 then --3
- sim.partProperty(i, "life", 0)
- end --3
- end --2
- if math.random(0,sim.pressure(x/4,y/4)+1*1000) == 1 then --4
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_SPRK)
- end --4
- end --1
- ) --*1
- local gltr = elements.allocate("TPT" , "GLTR")
- elements.element(gltr, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(gltr, "Name" , "GLTR")
- elements.property(gltr, "Description" , "Glitter.")
- elements.property(gltr, "Color", 0x606060)
- elements.property(gltr, "MenuSection", 8)
- elements.property(gltr, "Properties", elements.TYPE_PART)
- elements.property(gltr, "Gravity", 0.112)
- elements.property(gltr, "Advection", 1.25)
- elements.property(gltr, "Weight", 35)
- elements.property(gltr, "AirDrag", 0.1)
- elements.property(gltr, "Falldown", 1)
- elements.property(gltr, "HighTemperature", 854)
- elements.property(gltr, "HighTemperatureTransition", elements.DEFAULT_PT_BGLA)
- elements.property(gltr, "Falldown", 1)
- elements.property(gltr, "Update", --*1
- function(i,x,y) --1
- sim.partProperty(i, "life", 10)
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- 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)
- end --*1
- elements.property(gltr, "Graphics", funcGraphics)
- local astt = elements.allocate("TPT", "ASTT")
- elements.element(astt, elements.element(elements.DEFAULT_PT_URAN))
- elements.property(astt, "Name" , "ASTT")
- elements.property(astt, "Description", "Astatine, highly unstable heavy halogen")
- elements.property(astt, "Color", 0x703830)
- elements.property(astt, "Flammable", 1)
- elements.property(astt, "MenuSection", 10)
- elements.property(astt, "LowTemperature", -1)
- elements.property(elements.TPT_PT_ASTT, "Update", --*1
- function(i,x,y) --1
- if math.random(1,1152) == 1 then --2
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+800)
- sim.pressure(x/4,y/4,2)
- sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RADON)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_NEUT)
- end --2
- end --1
- ) --*1
- local pbp = elements.allocate("TPT" , "LEDP")
- elements.element(pbp, elements.element(elements.DEFAULT_PT_SALT))
- elements.property(pbp, "Name" , "LEDP")
- elements.property(pbp, "Description" , "Lead powder, absorbs neutrons. Conducts electricity. Heavy.")
- elements.property(pbp, "Color", 0x6C6C6C)
- elements.property(pbp, "Hardness", 0)
- elements.property(pbp, "Weight", 96)
- elements.property(pbp, "HighTemperature", 597.25)
- elements.property(pbp, "HighTemperatureTransition", elements.TPT_PT_LEAD)
- elements.property(pbp, "Properties", elements.PROP_NEUTABSORB+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_PART+elements.PROP_DEADLY)
- elements.property(pbp, "Gravity", 0.45)
- elements.property(pbp, "AirDrag", 0.06)
- elements.property(pb, "HighPressure", 60)
- elements.property(pb, "HighPressureTransition", elements.TPT_PT_LEDP)
- local frnc = elements.allocate("TPT" , "FRNC")
- elements.element(frnc, elements.element(elements.DEFAULT_PT_GOLD))
- elements.property(frnc, "Name" , "FRNC")
- elements.property(frnc, "Description" , "Francium, radioactive unstable alkali metal.")
- elements.property(frnc, "Color", 0xCCA78D)
- elements.property(frnc, "PhotonReflectWavelengths", 0x8F700000)
- elements.property(frnc, "MenuSection", 10)
- elements.property(frnc, "Flammable", 3)
- elements.property(frnc, "HighTemperature", 2333.25)
- elements.property(elements.TPT_PT_FRNC, "Update", --*1
- function(i,x,y) --1
- if math.random(1,2304) == 1 then --2
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+800)
- sim.pressure(x/4,y/4,2)
- sim.partProperty(i, "type", elements.TPT_PT_LEAD)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_RADON)
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_NEUT)
- end --2
- if math.random(0,105) == 0 then --3
- for r in sim.neighbors(x,y,1,1) do --4
- 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
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+700)
- sim.partCreate(-1, math.random(x-2,x+2),math.random(y-2,y+2),elements.DEFAULT_PT_PLSM)
- sim.partCreate(-1, math.random(x-2,x+2),math.random(y-2,y+2),elements.DEFAULT_PT_PLSM)
- sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)+4)
- sim.partProperty(r, "life", 200)
- sim.partProperty(r, "type", elements.DEFAULT_PT_PLSM)
- sim.partProperty(i, "life", 200)
- sim.partProperty(i, "type", elements.DEFAULT_PT_PLSM)
- end --5
- end --4
- end --3
- end --1
- ) --*1
- local indi = elements.allocate("TPT" , "INDI")
- elements.element(indi, elements.element(elements.DEFAULT_PT_PSCN))
- elements.property(indi, "Name" , "INDI")
- elements.property(indi, "Description" , "Indium, soft metal. Ejects energy to titanium. Absorbs energy from silicon. Barely transfers heat.")
- elements.property(indi, "Color", 0x9C978D)
- elements.property(indi, "MenuSection", 1)
- elements.property(indi, "HighTemperature", 600.25)
- elements.property(indi, "Loss", 0.2)
- elements.property(indi, "Advection", 0.05)
- elements.property(indi, "HeatConduct", 16)
- elements.property(indi, "Falldown", 2)
- elements.property(elements.TPT_PT_INDI, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt ~=0 and nt - s > 0 then --2
- for r in sim.neighbors(x,y,2,2) do --3
- 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
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")-0.1)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+0.1)
- sim.partProperty(r, "life", 6)
- end --4
- 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
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")+0.1)
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")-0.1)
- sim.partProperty(r, "life", 0)
- end --5
- end --3
- end --2
- end --1
- ) --*1
- local rhod = elements.allocate("TPT" , "RHOD")
- elements.element(rhod, elements.element(elements.DEFAULT_PT_PSCN))
- elements.property(rhod, "Name" , "RHOD")
- elements.property(rhod, "Description" , "Rhodium, resistant to corrosion. Shiny!")
- elements.property(rhod, "Properties", elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID)
- elements.property(rhod, "Color", 0xEEEEEE)
- elements.property(rhod, "MenuSection", 1)
- elements.property(rhod, "HighTemperature", 2237)
- elements.property(rhod, "PhotonReflectWavelengths", 0xFFFFFFFF)
- elements.property(rhod, "HeatConduct", 220)
- elements.property(rhod, "Hardness", 0)
- elements.property(elements.TPT_PT_RHOD, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt ~=0 and s < 8 then --2
- for r in sim.neighbors(x,y,3,3) do --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_PHOT then --4
- sim.partProperty(r, "ctype", 1073741823)
- sim.partProperty(r, "life", sim.partProperty(r, "life")+4)
- end --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_NEUT then --5
- sim.partProperty(r, "ctype", 1073741823)
- sim.partProperty(r, "type", elem.DEFAULT_PT_PHOT)
- sim.partProperty(r, "life", sim.partProperty(r, "life")+4)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local grmn = elements.allocate("TPT" , "GRMN")
- elements.element(grmn, elements.element(elements.DEFAULT_PT_IRON))
- elements.property(grmn, "Name" , "GRMN")
- elements.property(grmn, "Description" , "Germanium, equalizes pressure.")
- elements.property(grmn, "Color", 0x726872)
- elements.property(grmn, "AirLoss", 0.9)
- elements.property(grmn, "HighTemperature", 1211)
- elements.property(grmn, "Properties", elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
- elements.property(elements.TPT_PT_GRMN, "Update", --*1
- function(i,x,y,s,nt) --1
- sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)/3)
- end --1
- ) --*1
- local phos = elements.allocate("TPT" , "PHOS")
- elements.element(phos, elements.element(elements.DEFAULT_PT_PSCN))
- elements.property(phos, "Name" , "PHOS")
- elements.property(phos, "Description" , "Phosphorous, useful for CRT's.")
- elements.property(phos, "Properties", elements.TYPE_SOLID)
- elements.property(phos, "Color", 0xEE4E10)
- elements.property(phos, "MenuSection", 1)
- elements.property(phos, "HighTemperature", 1317)
- elements.property(phos, "Flammable", 5)
- elements.property(phos, "HighPressure", math.huge)
- elements.property(phos, "PhotonReflectWavelengths", 0xFFFFFFFF)
- elements.property(phos, "HeatConduct", 220)
- elements.property(phos, "Hardness", 50)
- elements.property(elements.TPT_PT_PHOS, "Update", --*1
- function(i,x,y,s,nt) --1
- if nt ~=0 and s < 8 then --2
- for r in sim.neighbors(x,y,3,3) do --3
- if sim.partProperty(i, "ctype") == 0 then --4
- sim.partProperty(i, "ctype", 1073741823)
- end --4
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_ELEC then --5
- sim.partProperty(r, "type", elem.DEFAULT_PT_PHOT)
- sim.partProperty(r, "ctype", sim.partProperty(i, "ctype"))
- end --5
- end --3
- end --2
- end --1
- ) --*1
- --[[ tar, buggy for now
- local tar = elements.allocate("TPT", "TAR")
- elements.element(tar, elements.element(elements.DEFAULT_PT_LOXY))
- elements.property(tar, "Name" , "TAR")
- elements.property(tar, "Description" , "Tar, horrible.")
- elements.property(tar, "Flammable", 1)
- elements.property(tar, "Color", 0x201810)
- elements.property(tar, "Temperature", 180.15)
- elements.property(tar, "MenuSection", 5)
- elements.property(tar, "Gravity", 0.03)
- elements.property(tar, "Diffusion", 0.01)
- elements.property(tar, "Loss", 0.3)
- elements.property(tar, "Advection", 0.3)
- elements.property(tar, "HighTemperature", math.huge)
- elements.property(tar, "HighTemperatureTransition", elements.TPT_PT_ASH)
- elements.property(elements.TPT_PT_TAR, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if sim.partProperty(i, "temp") > 400 then --3
- if math.random(1,180) == 1 then --4
- sim.partCreate(-1, math.random(x-2,x+2),math.random(y-2,y+2),elements.DEFAULT_PT_WTRV)
- sim.partChangeType(i, elements.TPT_PT_ASH)
- sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)+0.05)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_SMKE, "Update", --*1
- function(i,x,y,s,nt) --1
- if s ~=0 and nt ~=8 then --2
- for r in sim.neighbors(x,y,2,2) do --3
- if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
- if math.random(0,1) == 0 then --5
- sim.partProperty(r, "type", elem.TPT_PT_TAR)
- sim.partKill(i)
- return 0
- end --5
- end --4
- end --3
- end --2
- end --1
- ) --*1
- --]]
- --[[ going to be added in the next update, keeping for archive reasons similar to STEAM and TAR
- local vsns = elements.allocate("TPT" , "VSNS")
- elements.element(vsns, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(vsns, "Name" , "VSNS")
- elements.property(vsns, "Description" , "Velocity sensor, creates power when something's velocity is higher than its temperature.")
- elements.property(vsns, "Color", 0x3D3125)
- elements.property(vsns, "MenuSection", 3)
- elements.property(vsns, "HeatConduct", 0)
- elements.property(elem.TPT_PT_VSNS, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- 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
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
- end --3
- end --2
- end --1
- ) --*1
- --]]
- local csns = elements.allocate("TPT" , "CSNS")
- elements.element(csns, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(csns, "Name" , "CSNS")
- elements.property(csns, "Description" , "C-Type sensor, creates power when something's c-type is the same as its c-type.")
- elements.property(csns, "Color", 0x25313D)
- elements.property(csns, "MenuSection", 3)
- elements.property(csns, "HeatConduct", 0)
- elements.property(elem.TPT_PT_CSNS, "Update",
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- for r in sim.neighbors(x,y,1,1) do --3
- if sim.partProperty(r, "ctype") == sim.partProperty(i, "ctype") and sim.partProperty(r, "type") ~= sim.partProperty(i, "type") then --4
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
- end --4
- end --3
- end --2
- end --1
- ) --*1
- local prtn = elements.allocate("TPT" , "PRTN")
- elements.element(prtn, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(prtn, "Name" , "PRTN")
- elements.property(prtn, "Description" , "Protonium. Dense, decays into protons.")
- elements.property(prtn, "Color", 0xFF2515)
- elements.property(prtn, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(prtn, "PhotonReflectWavelengths", 0x10000000)
- elements.property(prtn, "MenuSection", 16)
- elements.property(elements.TPT_PT_PRTN, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,-0.1)
- if math.random(1,(sim.pressure(x/4,y/4)+256)/5) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PRTN)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PRTN)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*10) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_PROT)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- attract(i,x,y,10)
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- local degn = elements.allocate("TPT" , "DEGN")
- elements.element(degn, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(degn, "Name" , "DEGN")
- elements.property(degn, "Description" , "Degenerate matter, resulted from going too far with fusion.")
- elements.property(degn, "Color", 0xEEEEFE)
- elements.property(degn, "Properties", elements.TYPE_SOLID+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(degn, "PhotonReflectWavelengths", 0x10000000)
- elements.property(degn, "MenuSection", 10)
- elements.property(elements.TPT_PT_DEGN, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,0.1)
- if math.random(1,(sim.pressure(x/4,y/4)+256)/5) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_DEGN)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PLIG)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*10) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_ELEC)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- attract(i,x,y,-10)
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- elements.property(elem.DEFAULT_PT_IRON, "HighPressure", 1000)
- elements.property(elem.DEFAULT_PT_IRON, "HighPressureTransition", elem.TPT_PT_DEGN)
- elements.property(elem.DEFAULT_PT_BRMT, "HighPressure", 300)
- elements.property(elem.DEFAULT_PT_BRMT, "HighPressureTransition", elem.DEFAULT_PT_IRON)
- local grtn = elements.allocate("TPT" , "GRTN")
- elements.element(grtn, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(grtn, "Name" , "GRTN")
- elements.property(grtn, "Description" , "Gravitonium. Hilariously dense, decays into gravitons.")
- elements.property(grtn, "Color", 0x00FF9E)
- elements.property(grtn, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(grtn, "PhotonReflectWavelengths", 0x10000000)
- elements.property(grtn, "MenuSection", 16)
- elements.property(elements.TPT_PT_GRTN, "Update", --*1
- function(i,x,y) --1
- attract(i,x,y,0.2)
- if math.random(1,(sim.pressure(x/4,y/4)+256)/5) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_GRTN)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_GRTN)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*10) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_GRVT)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- attract(i,x,y,10)
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- local phtn = elements.allocate("TPT" , "PHTN")
- elements.element(phtn, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(phtn, "Name" , "PHTN")
- elements.property(phtn, "Description" , "Solid photons. weightless, decays into photons.")
- elements.property(phtn, "Color", 0xFEFEFE)
- elements.property(phtn, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(phtn, "PhotonReflectWavelengths", 0xFFFFFFFF)
- elements.property(phtn, "MenuSection", 16)
- elements.property(elements.TPT_PT_PHTN, "Update", --*1
- function(i,x,y) --1
- if math.random(1,(sim.pressure(x/4,y/4)+256)/5) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PHTN)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_PHTN)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*10) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.DEFAULT_PT_PHOT)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- local rdtn = elements.allocate("TPT" , "RDTN")
- elements.element(rdtn, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(rdtn, "Name" , "RDTN")
- elements.property(rdtn, "Description" , "Solidified radiation? Weightless, decays into background radiation.")
- elements.property(rdtn, "Color", 0x9E9E9E)
- elements.property(rdtn, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(rdtn, "PhotonReflectWavelengths", 0x99999999)
- elements.property(rdtn, "MenuSection", 16)
- elements.property(elements.TPT_PT_RDTN, "Update", --*1
- function(i,x,y) --1
- if math.random(1,(sim.pressure(x/4,y/4)+256)/5) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RDTN)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RDTN)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*10) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_RADI)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- local tdgm = elements.allocate("TPT" , "TDGM")
- elements.element(tdgm, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(tdgm, "Name" , "TDGM")
- elements.property(tdgm, "Description", "Tauon Degenerate matter. Unstable.")
- elements.property(tdgm, "Color", 0xFC00FC)
- elements.property(tdgm, "Properties", elements.TYPE_SOLID+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.PROP_RADIOACTIVE+elements.PROP_NEUTPASS)
- elements.property(tdgm, "PhotonReflectWavelengths", 0x99999999)
- elements.property(tdgm, "MenuSection", 16)
- elements.property(elements.TPT_PT_TDGM, "Update", --*1
- function(i,x,y) --1
- if math.random(1,(sim.pressure(x/4,y/4)+256)/5) == 1 then --2
- if math.random(1,50) == 1 then --3
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_TDGM)
- if math.random(1,5000) == 1 then --4
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_TDGM)
- end --4
- end --3
- end --2
- if math.random(1,(sim.pressure(x/4,y/4)+256)*3) == 1 then --5
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
- sim.pressure(x/4,y/4,32)
- sim.partCreate(-1, x+math.random(-1,1), y+math.random(-1,1), elements.TPT_PT_TAU)
- sim.pressure(x/4,y/4,-32)
- sim.partProperty(i, "life", 90)
- repeat --6
- if math.random(1,2) == 1 then --7
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --7
- until sim.partProperty(i, "life") < 0 --6
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- elements.property(elements.DEFAULT_PT_FIRE, "HeatConduct", 255)
- elements.property(elements.DEFAULT_PT_CFLM, "HeatConduct", 255)
- local bsec = elements.allocate("TPT" , "BSEC")
- elements.element(bsec, elements.element(elements.DEFAULT_PT_WTRV))
- elements.property(bsec, "Name" , "BSEC")
- elements.property(bsec, "Description" , "Bose-Einstein Condensate.")
- elements.property(bsec, "Color", 0x8E00A0)
- elements.property(bsec, "PhotonReflectWavelengths", 0xF0000001)
- elements.property(bsec, "MenuSection", 10)
- elements.property(bsec, "Diffusion", 0.035)
- elements.property(bsec, "Flammable", 0)
- elements.property(bsec, "Gravity", 0.1)
- elements.property(bsec, "HeatConduct", 255)
- elements.property(bsec, "Loss", -1.0175)
- elements.property(bsec, "LowTemperature", -256)
- elements.property(bsec, "Create", --*1
- function(i,x,y,s) --1
- sim.partProperty(i, "life", 950)
- end --1
- ) --*1
- elements.property(elements.TPT_PT_BSEC, "Update", --*1
- function(i,x,y,s,nt) --1
- if sim.partProperty(i, "life") > 0 then --3
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end --3
- attract(i,x,y,math.random(-0.1,0.1))
- sim.partProperty(i, "temp", sim.partProperty(i, "temp")/1.033)
- if sim.partProperty(i, "life") < 1 and math.random(0,63) == 0 then --4
- sim.partKill(i)
- end --4
- if math.random(0,2500) == 0 then --5
- sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_PHOT)
- sim.partKill(i)
- end --5
- end --1
- ) --*1
- local function funcGraphics(i, colr, colg, colb) --*1
- 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
- end --*1
- elements.property(bsec, "Graphics", funcGraphics)
- local tmp2sns = elements.allocate("TPT" , "TMP2S")
- elements.element(tmp2sns, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(tmp2sns, "Name" , "TMP2")
- elements.property(tmp2sns, "Description" , "Temporary value 2 sensor, creates power when something's tmp2 is higher than its temperature.")
- elements.property(tmp2sns, "Color", 0x3D7122)
- elements.property(tmp2sns, "MenuSection", 3)
- elements.property(tmp2sns, "HeatConduct", 0)
- elements.property(elem.TPT_PT_TMP2S, "Update",
- function(i,x,y,s,nt) --1
- for r in sim.neighbors(x,y,1,1) do --2
- if sim.partProperty(r, "tmp2") > sim.partProperty(i, "temp")-273.15 then --3
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
- end --3
- end --2
- end --1
- ) --*1
- local asns = elements.allocate("TPT" , "ASNS")
- elements.element(asns, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(asns, "Name" , "ASNS")
- elements.property(asns, "Description" , "Ambient heat sensor, creates power when the ambient heat around it is higher than its temperature.")
- elements.property(asns, "Color", 0x3986D3)
- elements.property(asns, "MenuSection", 3)
- elements.property(asns, "AirLoss", 1)
- elements.property(asns, "HeatConduct", 0)
- elements.property(elem.TPT_PT_ASNS, "Update",
- function(i,x,y,s,nt) --1
- if s ~=8 and nt ~=0 and nt - s > 0 then --2
- if sim.ambientHeat(x/4, y/4) > sim.partProperty(i, "temp") then --3
- sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
- sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
- end --3
- end --2
- end --1
- ) --*1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement