Advertisement
MrSalit0s

NEON

Apr 7th, 2013
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. --By MrSalit0s
  2.  
  3. local NEON = elements.allocate("MOD", "NEON")
  4. elements.element(elements.MOD_PT_NEON, elements.element(elements.DEFAULT_PT_NBLE))
  5. elements.property(elements.MOD_PT_NEON, "Name", "NEON")
  6. elements.property(elements.MOD_PT_NEON, "Description", "Neon gas - glows in contact with electricity")
  7. elements.property(elements.MOD_PT_NEON, "Colour", 0x00242424)
  8. elements.property(elements.MOD_PT_NEON, "MenuSection", 6)
  9. elements.property(elements.MOD_PT_NEON, "Loss", 0.1)
  10. elements.property(elements.MOD_PT_NEON, "AirLoss", 1)
  11. elements.property(elements.MOD_PT_NEON, "Advection", 0.4)
  12. elements.property(elements.MOD_PT_NEON, "Diffusion", 0.5)
  13. elements.property(elements.MOD_PT_NEON, "Temperature", 295)
  14. elements.property(elements.MOD_PT_NEON, "Gravity", 0)
  15. elements.property(elements.MOD_PT_NEON, "Flammable", 0)
  16. elements.property(elements.MOD_PT_NEON, "Weight", 0)
  17. elements.property(elements.MOD_PT_NEON, "Properties", 0x4828)
  18.  
  19. local colour={0xFFAA0000,0xFFFF6600,0xFFFFFF00,0xFF00FF00,0xFF00FFFF,0xFF0000FF,0xFF9900CC}
  20. local none=0x00242424
  21.  
  22. local function neon(i,x,y,s,n)
  23.     if tpt.get_property("tmp",i)== 0 then
  24.         tpt.set_property("tmp",1,i)
  25.     end
  26.     if tpt.get_property("tmp2",i)== 1 then
  27.         tpt.set_property("life",180,i)
  28.         tpt.set_property("tmp2",0,i)
  29.     end
  30.     if tpt.parts[i].life<=0 then
  31.         tpt.set_property("dcolour",none,i)
  32.     end
  33. end
  34.  
  35. local function neonsprk(i,x,y,s,n)
  36. local ntmp=tpt.get_property("tmp",i)
  37. local neontype=tpt.get_property("ctype",i)
  38.     if tpt.get_property("ctype",i)==elements.MOD_PT_NEON then
  39.         if tpt.get_property("tmp",i)==ntmp then
  40.             tpt.set_property("dcolour",colour[ntmp],i)
  41.             tpt.set_property("tmp2",1,i)
  42.         end
  43.         if tpt.get_property("tmp",i)==8 then
  44.             tpt.set_property("dcolour",colour[math.random(1,7)],i)
  45.             tpt.set_property("tmp2",1,i)
  46.         end
  47.     end
  48. end
  49.  
  50. local function neongraphics(i, colr, colg, colb)
  51.     return 1,0x00022110,30,30,30,30,30,30,30,30
  52. end
  53.  
  54. tpt.graphics_func(neongraphics,elements.MOD_PT_NEON)       
  55. tpt.element_func(neon,elements.MOD_PT_NEON)
  56. tpt.element_func(neonsprk,elements.DEFAULT_PT_SPRK)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement