Advertisement
MassacreLand

Element: RICE

Feb 2nd, 2012
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. tpt.el.wind.name='RICE'
  2. tpt.el.wind.description='Rainbow Ice? Beautiful yet cold. Just like your ex.'
  3. tpt.el.wind.color=0x84BFD5
  4. tpt.el.wind.menusection=4
  5. tpt.el.wind.menu=1
  6. tpt.el.wind.enabled=1
  7. tpt.el.wind.weight=-1
  8. types={'rbwg','neut'}
  9. math.randomseed(os.time())
  10. function rice(i,x,y,s,n)
  11. for n=1,2 do
  12. tpt.parts[i].x=tpt.get_property('x',i)+math.random(-6,6)
  13. tpt.parts[i].y=tpt.get_property('y',i)+math.random(-6,6)
  14. for x2=-7,7 do
  15. for y2=-math.sqrt((49)-(x2^2)),math.sqrt((49)-(x2^2)) do
  16. tpt.create(x+x2,y+y2,types[math.random(1,2)])
  17. tpt.set_property('life',4,x+x2,y+y2)
  18. tpt.set_property('temp',-50000+273.15,x+x2,y+y2)
  19. if tpt.get_property('type',x+x2,y+y2)~=0 and tpt.get_property('type',x+x2,y+y2)~=tpt.el.neut.id and tpt.get_property('type',x+x2,y+y2)~=tpt.el.rbwg.id and tpt.get_property('type',x+x2,y+y2)~=tpt.el.wind.id then
  20. tpt.create(x+x2,y+y2,'ice')
  21. tpt.set_property('life',30,x+x2,y+y2)
  22. end
  23. end
  24. end
  25. end
  26. end
  27.      
  28. tpt.element_func(rice,tpt.el.wind.id)
  29.  
  30. tpt.el.boyl.name="RBWG"
  31. tpt.el.boyl.description="Super Awesome Rainbow Gas"
  32. tpt.el.boyl.menusection=4
  33. tpt.el.boyl.color=0xCCFCFF
  34.  
  35. math.randomseed(os.time())
  36. function rbow_update(i, x, y, s, n)
  37.     cindex=math.random(0,255)
  38.     tpt.set_property("dcolour",math.floor(math.sin(cindex*3.14159/127.5)*128+128)+math.floor(math.sin(cindex*3.14159/127.5+2.0944)*128+128)*0x100+math.floor(math.sin(cindex*3.14159/127.5+4.1888)*128+128)*0x10000+0xff000000,i)
  39. end
  40. tpt.element_func(rbow_update, tpt.el.boyl.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement