Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Gluon = elements.allocate("Gluon", "GLUON")
- elements.element(Gluon, elements.element(elements.DEFAULT_PT_ELEC))
- elements.property(Gluon, "Name", "GLUON")
- elements.property(Gluon, "Colour", 0xFF00AEFF)
- elements.property(Gluon, "Description", "Gluon.")
- elements.property(Gluon, "Weight", -1)
- elements.property(Gluon, "HeatConduct", 251)
- elements.property(Gluon, "Temperature", 295.15)
- elements.property(Gluon, "Properties" , 0x0010)
- elements.property(Gluon, "AirLoss", 1)
- elements.property(Gluon, "Loss", 1)
- elements.property(Gluon, "Collision", -0.99)
- function Gluon(i, x, y, surround, nt)
- if tpt.get_property("tmp2", i) == 0 then
- local a = (math.random(360)-1) * 0.01745329;
- tpt.set_property("life",680,i)
- tpt.set_property("vx",2*math.cos(a),i)
- tpt.set_property("vy",2*math.sin(a),i)
- tpt.set_property("tmp2",1,i)
- end
- local collx = math.random(-1,1)
- local colly = math.random(-1,1)
- if tpt.get_property("temp", i) > 273.15 then
- tpt.set_property("temp",tpt.get_property("temp", i)-1,i)
- tpt.set_property("tmp",tpt.get_property("tmp", i)+1,i)
- end
- if sim.pressure(x/4,y/4) > 0 then
- sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)-1)
- tpt.set_property("tmp",tpt.get_property("tmp", i)+5,i)
- end
- if tpt.get_property("life", i) > 0 then
- if tpt.get_property("life", i) >= 50 then
- tpt.set_property("life",tpt.get_property("life", i)-1,i)
- end
- if tpt.get_property("life", i) < 50 then
- if tpt.get_property("tmp", i) > 0 then
- tpt.set_property("tmp",tpt.get_property("tmp", i)-1,i)
- end
- if tpt.get_property("tmp", i) < 1 then
- tpt.set_property("life",tpt.get_property("life", i)-1,i)
- end
- end
- end
- if tpt.get_property("life", i) == 0 then
- if tpt.get_property("tmp2", i) == 1 then
- tpt.set_property("type","none",i)
- end
- end
- if tpt.get_property("type", x+collx, y+colly) == tpt.element('neut') or tpt.get_property("type", x+collx, y+colly) == tpt.element('phot') or tpt.get_property("type", x+collx, y+colly) == tpt.element('elec') or tpt.get_property("type", x+collx, y+colly) == tpt.element('prot') or tpt.get_property("type", x+collx, y+colly) == tpt.element('grvt') then
- if tpt.get_property("tmp", i) > 0 then
- tpt.set_property("life",tpt.get_property("life", x+collx, y+colly)+100,x+collx,y+colly)
- tpt.set_property("tmp",tpt.get_property("tmp", i)-1,i)
- end
- end
- end
- tpt.element_func(Gluon, tpt.element('gluon'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement