Advertisement
Guest User

Luces de Eshkation

a guest
Dec 2nd, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1.     dec = {}
  2.     startLights = false
  3.     ids = {0,1,2,4,9}
  4.  
  5.     tfm.exec.newGame()
  6.      
  7.     function eventNewGame()
  8.     startLights = false
  9.     dec = {}
  10.     count = 0
  11.             xml = tfm.get.room.xmlMapInfo.xml
  12.             decorations = xml:match('<D>[^ยด]+/>'):gsub("<D>","")
  13.             for tree in decorations:gmatch('<P[^/]+/>') do
  14.                     if tree:match('T="57"') then
  15.                             count = count+1
  16.                             dec[count] = {
  17.                                     X = tree:match('X="[0-9]+"'):gsub('X="',''):gsub('"',''),
  18.                                     Y = tree:match('Y="[0-9]+"'):gsub('Y="',''):gsub('"','')
  19.                             }
  20.                     end
  21.             end
  22.             startLights = true
  23.     end
  24.      
  25.     function eventLoop()
  26.             if startLights then
  27.                     for counter = #dec,1,-1 do
  28.                             for k = 10,0,-1 do
  29.                                     tfm.exec.displayParticle(ids[math.random(#ids)],dec[counter].X+math.random(-40,40),dec[counter].Y+math.random(-120,30),0,0,0,0)
  30.                                     tfm.exec.displayParticle(11,dec[counter].X-2,dec[counter].Y-183,math.cos(k),math.sin(k),0,0)
  31.                             end
  32.                     end
  33.             end
  34.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement