Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ntgn = elem.allocate("BIGDIG", "NTGN")
- local amon = elem.allocate("BIGDIG", "AMON")
- local amhd = elem.allocate("BIGDIG", "AMHD")
- local nhcl = elem.allocate("BIGDIG", "NHCL")
- elem.element(ntgn, elem.element(elem.DEFAULT_PT_BOYL))
- elem.property(ntgn, "Name", "NTGN")
- elem.property(ntgn, "Description", "Nitrogen gas. Mostly inert, but in higher temperatures can make more complex elements. Vanishes after some time.")
- elem.property(ntgn, "Color", 0x80DFFF)
- elem.property(ntgn, "Diffusion", 5)
- elem.property(ntgn, "LowTemperature", 273.15 - 195.8)
- elem.property(ntgn, "LowTemperatureTransition", tpt.el.ln2.id)
- elem.property(tpt.el.ln2.id, "HighTemperature", 273.15 - 195.8)
- elem.property(tpt.el.ln2.id, "HighTemperatureTransition", ntgn)
- local function nitrogen(i, x, y, s, nt)
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype == tpt.el.hygn.id and sim.partProperty(i, "temp") >= 273.15 + 89.50 then
- sim.partChangeType(r, amon)
- sim.partKill(i)
- return 1
- elseif rtype == tpt.el.ln2.id then
- sim.partChangeType(i, tpt.el.ln2.id)
- end
- end
- if math.random(1, 100) == 100 then
- sim.partKill(i)
- return 1
- end
- end
- elem.property(ntgn, "Update", nitrogen)
- elem.element(amon, elem.element(tpt.el.hygn.id))
- elem.property(amon, "Name", "AMON")
- elem.property(amon, "Description", "Ammonia gas, helps plants grow. When solved in water makes a strong base.")
- elem.property(amon, "Color", 0x9fdf9f)
- elem.property(amon, "Diffusion", 0.75)
- elem.property(amon, "Gravity", 0.0001)
- elem.property(amon, "Flammable", 100)
- elem.property(amon, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
- local function ammonia(i, x, y, s, nt)
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if (rtype == elem.DEFAULT_PT_WATR or rtype == elem.DEFAULT_PT_DSTW) and math.random(1, 10) == 10 then
- sim.partChangeType(r, amhd)
- sim.partKill(i)
- return 1
- elseif rtype == elem.DEFAULT_PT_PLNT and math.random(1, 10) == 10 then
- sim.partChangeType(r, elem.DEFAULT_PT_VINE)
- sim.partKill(i)
- return 1
- elseif rtype == elem.DEFAULT_PT_WOOD and math.random(1, 10) == 10 then
- sim.partChangeType(i, elem.DEFAULT_PT_VINE)
- end
- end
- if math.random(1, 1000) == 1000 then
- sim.partKill(i)
- return 1
- end
- end
- elem.property(amon, "Update", ammonia)
- elem.element(amhd, elem.element(elem.DEFAULT_PT_WATR))
- elem.property(amhd, "Name", "AMHD")
- elem.property(amhd, "Description", "Ammonium hydrate, solution of ammonium in water.")
- elem.property(amhd, "Color", 0xd9f2d9)
- elem.property(amhd, "HighTemperature", ITH)
- elem.property(amhd, "HighTemperatureTransition", NT)
- elem.property(amhd, "Weight", 31)
- local function ammoniumhydrate(i, x, y, s, nt)
- local rx = math.random(x-1, x+1)
- local ry = math.random(y-1, y+1)
- local r = sim.partID(rx, ry)
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype == elem.DEFAULT_PT_ACID then
- sim.partChangeType(i, nhcl)
- sim.partChangeType(r, elem.DEFAULT_PT_WATR)
- end
- else
- if math.random(1, 1000) == 1000 then
- sim.partCreate(-1, rx, ry, amon)
- if math.random(1, 20) == 20 then
- sim.partChangeType(i, elem.DEFAULT_PT_WATR)
- return 1
- end
- end
- end
- if sim.partProperty(i, "temp") > 373.15 then
- if math.random(0, 1) == 1 then
- sim.partChangeType(i, elem.DEFAULT_PT_WTRV)
- else
- sim.partChangeType(i, amon)
- end
- end
- end
- elem.property(amhd, "Update", ammoniumhydrate)
- elem.element(nhcl, elem.element(elem.DEFAULT_PT_SALT))
- elem.property(nhcl, "Name", "NHCL")
- elem.property(nhcl, "Description", "Ammonium chloride, cools down much in contact with water.")
- elem.property(nhcl, "Color", 0xe6ffff)
- elem.property(nhcl, "Meltable", 1)
- elem.property(nhcl, "HighTemperature", 273.15 + 520)
- elem.property(nhcl, "HighTemperatureTransition", elem.DEFAULT_PT_LAVA)
- local function ammoniumchloride(i, x, y, s, nt)
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype == elem.DEFAULT_PT_WATR or rtype == elem.DEFAULT_PT_DSTW or rtype == elem.DEFAULT_PT_SLTW or rtype == elem.DEFAULT_PT_ICE or rtype == elem.DEFAULT_PT_SNOW then
- if sim.partProperty(r, "temp") > 241.15 then
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")-2)
- end
- end
- end
- end
- elem.property(nhcl, "Update", ammoniumchloride)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement