math.randomseed(os.time())
function magn_update(i, x, y, s, n)
nexta = tpt.get_property("type", x+math.random(-1, 1), y+math.random(-1, 1))
nextb = tpt.get_property("temp", i)
if ((nexta == tpt.el.plsm.id or nexta == tpt.el.fire.id or nexta == tpt.el.lava.id) and nextb >= 800) or nextb >= 3000 then
tpt.parts[i].type = tpt.el.plsm.id
tpt.parts[i].life = 150
tpt.parts[i].temp = 3370
end
end
tpt.element_func(magn_update, tpt.el.bmtl.id)
function magpowder_disolve(i, x, y, s, n)
next = tpt.get_property("type", x+math.random(-1, 1), y+math.random(-1, 1))
if next == tpt.el.watr.id or next == tpt.el.dstw.id or next == tpt.el.sltw.id then
randnum = math.random(1, 10)
if randnum == 10 then
tpt.parts[i].type = 0
end
end
end
tpt.element_func(magpowder_disolve, tpt.el.brmt.id)
function water_split(i, x, y, s, n)
if tpt.get_property("type", x+math.random(-1, 1), y+math.random(-1, 1)) == tpt.el.brmt.id then
randnum = math.random(0, 1)
if randnum == 0 then
tpt.parts[i].type = tpt.el.hygn.id
else
tpt.parts[i].type = tpt.el.soap.id
end
end
if tpt.get_property("temp", i) >= 1800 then
randnum = math.random(0, 1)
if randnum == 0 then
tpt.parts[i].type = tpt.el.hygn.id
else
tpt.parts[i].type = tpt.el.oxyg.id
end
end
end
tpt.element_func(water_split, tpt.el.watr.id)
tpt.element_func(water_split, tpt.el.dstw.id)
tpt.element_func(water_split, tpt.el.sltw.id)
tpt.element_func(water_split, tpt.el.wtrv.id)
function CO2_split(i, x, y, s, n)
if tpt.get_property("temp", i) >= 1800 then
randnum = math.random(0, 1)
if randnum == 0 then
tpt.parts[i].type = tpt.el.bcol.id
else
tpt.parts[i].type = tpt.el.oxyg.id
end
end
end
tpt.element_func(CO2_split, tpt.el.co2.id)
function acid_base_neutralize(i, x, y, s, n)
for xpos =-1,1 do
for ypos = -1,1 do
elemtype=tpt.get_property("type",x+xpos,y+ypos)
if elemtype == tpt.el.soap.id then
tpt.set_property("type","sltw",i)
tpt.set_property("type","sltw",x+xpos,y+ypos)
elseif elemtype == tpt.el.bmtl.id or elemtype == tpt.el.brmt.id then
tpt.set_property("type","salt",i)
tpt.set_property("type","hygn",x+xpos,y+ypos)
end
end
end
end
tpt.element_func(acid_base_neutralize, tpt.el.acid.id)
tpt.eltransition.bmtl.tempHighValue=3000
tpt.eltransition.bmtl.tempHighType=tpt.el.bmtl.id
tpt.el.bmtl.menusection=3
tpt.el.bmtl.color=0xdddddd
tpt.el.bmtl.description="Magnesium. A flammable metal, it burns very hot but also requires significant heat to ignite."
tpt.el.bmtl.name="MGSM"
tpt.eltransition.brmt.tempHighValue=3000
tpt.eltransition.brmt.tempHighType=tpt.el.plsm.id
tpt.el.brmt.flammable=9999
tpt.el.brmt.menusection=3
tpt.el.brmt.color=0xbbbbbb
tpt.el.brmt.description="Magnesium Powder. It's much easier to ignite than MGSM and also burns hotter."
tpt.el.brmt.name="MGMP"
tpt.el.soap.color=0x00ff00
tpt.el.soap.description="Base. Neutralizes ACID to create SLTW."
tpt.el.soap.name="BASE"
Magnesium has a reaction with DRIC...
Look here: https://youtu.be/bNOol7Nh07Y?t=1m55s
Edit: Plus, the code isn't working. (The element showed up in the menu "Powders" and it dissappeared in 0.01 second or lower.)
Whats your problem? i just didn't see the date