Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Caesium
- caes = elements.allocate("RAD", "CAES") --properties
- elements.element(caes, elements.element(elements.DEFAULT_PT_COAL))
- elements.property(caes, "Name", "CAES")
- elements.property(caes, "Description", "Caesium. Highly reactive and will violently explode in water.")
- elements.property(caes, "Colour", 0xD8D8D8)
- elements.property(caes, "MenuSection", 10)
- elements.property(caes, "Gravity", 0)
- elements.property(caes, "Properties", elements.ST_SOLID + elements.TYPE_SOLID + elements.PROP_DEADLY)
- elements.property(caes, "Flammable", 0)
- elements.property(caes, "Explosive", 0)
- function propc(i,x,y,s,n)
- local ctemp = tpt.get_property("temp", i) -- melt into Liquid Caesium
- if ctemp > 301.59 then
- tpt.set_property("type", "lcas", i)
- end
- if math.random(1, 7500) == 1 then -- decay
- local ran = math.random(-20,20)
- local ran2 = math.random(-20,0)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- tpt.set_property("life", 10000, i)
- if math.abs(ran) + math.abs(ran2) > 10 then
- local ran3 = math.random(1,4)
- if ran3 == 1 then
- tpt.set_property("type", "elec", i)
- end
- if ran3 == 2 then
- tpt.set_property("type", "phot", i)
- end
- if ran3 == 3 then
- tpt.set_property("type", "prot", i)
- end
- if ran3 == 4 then
- tpt.set_property("type", "neut", i)
- end
- end
- end
- local colx = math.random(-1,1)
- local coly = math.random(-1,1)
- local coltype = tpt.get_property("type", x+colx, y+coly)
- local temp = tpt.get_property("temp", i)
- if coltype == elements.DEFAULT_PT_WATR then
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- tpt.set_property("temp", temp + 1000 ,i)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("type", "hygn", coltype)
- local rand = math.random(1,4)
- if rand == 1 then
- tpt.set_property("type", "elec", i)
- end
- if rand == 2 then
- tpt.set_property("type", "phot", i)
- end
- if rand == 3 then
- tpt.set_property("type", "prot", i)
- end
- if rand == 4 then
- tpt.set_property("type", "neut", i)
- end
- end
- if coltype == elements.DEFAULT_PT_DSTW then
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- local rand = math.random(1,4)
- if rand == 1 then
- tpt.set_property("type", "elec", i)
- end
- if rand == 2 then
- tpt.set_property("type", "phot", i)
- end
- if rand == 3 then
- tpt.set_property("type", "prot", i)
- end
- if rand == 4 then
- tpt.set_property("type", "neut", i)
- end
- tpt.set_property("temp", temp + 1000 ,i)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("type", "hygn", coltype)
- end
- if coltype == elements.DEFAULT_PT_SLTW then
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- local rand = math.random(1,4)
- if rand == 1 then
- tpt.set_property("type", "elec", i)
- end
- if rand == 2 then
- tpt.set_property("type", "phot", i)
- end
- if rand == 3 then
- tpt.set_property("type", "prot", i)
- end
- if rand == 4 then
- tpt.set_property("type", "neut", i)
- end
- tpt.set_property("temp", temp + 1000 ,i)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("type", "hygn", coltype)
- end
- end
- tpt.element_func(propc, tpt.element("caes"))
- elements.property(caes, "HighTemperature", 1938)
- -- Liquid Caesium
- Lcas = elements.allocate("RAD", "LCAS") -- properties
- elements.element(Lcas, elements.element(elements.DEFAULT_PT_EXOT))
- elements.property(Lcas, "Name", "LCAS")
- elements.property(Lcas, "Description", "Liquid Caesium. Highly reactive and will violently explode in water.")
- elements.property(Lcas, "Colour", 0xD9D9D9)
- elements.property(Lcas, "MenuSection", 10)
- elements.property(Lcas, "Gravity", 1)
- elements.property(Lcas, "Weight", 10)
- elements.property(Lcas, "Flammable", 0)
- elements.property(Lcas, "Explosive", 0)
- elements.property(caes, "Properties", elements.ST_LIQUID + elements.TYPE_LIQUID + elements.PROP_DEADLY)
- function proplcas(i,x,y,s,n)
- local ctemp = tpt.get_property("temp", i) -- decay
- if math.random(1, 7500) == 1 then
- local ran = math.random(-20,20)
- local ran2 = math.random(-20,0)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- if math.abs(ran) + math.abs(ran2) > 10 then
- local ran3 = math.random(1,4)
- if ran3 == 1 then
- tpt.set_property("type", "elec", i)
- end
- if ran3 == 2 then
- tpt.set_property("type", "phot", i)
- end
- if ran3 == 3 then
- tpt.set_property("type", "prot", i)
- end
- if ran3 == 4 then
- tpt.set_property("type", "neut", i)
- end
- end
- end
- local colx = math.random(-1,1) -- react w/ water
- local coly = math.random(-1,1)
- local coltype = tpt.get_property("type", x+colx, y+coly)
- local temp = tpt.get_property("temp", i)
- if coltype == elements.DEFAULT_PT_WATR then
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- local rand = math.random(1,4)
- if rand == 1 then
- tpt.set_property("type", "elec", i)
- end
- if rand == 2 then
- tpt.set_property("type", "phot", i)
- end
- if rand == 3 then
- tpt.set_property("type", "prot", i)
- end
- if rand == 4 then
- tpt.set_property("type", "neut", i)
- end
- tpt.set_property("temp", temp + 1000 ,i)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("type", "hygn", coltype)
- end
- if coltype == elements.DEFAULT_PT_DSTW then
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- local rand = math.random(1,4)
- if rand == 1 then
- tpt.set_property("type", "elec", i)
- end
- if rand == 2 then
- tpt.set_property("type", "phot", i)
- end
- if rand == 3 then
- tpt.set_property("type", "prot", i)
- end
- if rand == 4 then
- tpt.set_property("type", "neut", i)
- end
- tpt.set_property("temp", temp + 1000 ,i)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("type", "hygn", coltype)
- end
- if coltype == elements.DEFAULT_PT_SLTW then
- tpt.set_property("life", 10000, i)
- tpt.set_property("vx", math.random(-25,25), i)
- tpt.set_property("vy", math.random(-25,25), i)
- local rand = math.random(1,4)
- if rand == 1 then
- tpt.set_property("type", "elec", i)
- end
- if rand == 2 then
- tpt.set_property("type", "phot", i)
- end
- if rand == 3 then
- tpt.set_property("type", "prot", i)
- end
- if rand == 4 then
- tpt.set_property("type", "neut", i)
- end
- tpt.set_property("temp", temp + 1000 ,i)
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "nble")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "hygn")
- tpt.create(x+math.random(-1,1), y+math.random(-1,1), "plsm")
- tpt.set_property("type", "hygn", coltype)
- end
- end
- elements.property(Lcas, "LowTemperature", 200) -- turn into Solid Caesium
- tpt.element_func(proplcas, tpt.element("lcas"))
- elements.property(Lcas, "LowTemperatureTransition", caes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement