Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. owner = "nobody" -- replace with your username
  2.  
  3. interval = 9999999999
  4.  
  5. maps = {3107377,305748,1539148,4543602,390649,495880,1463332,1492805,292678,305753,1545834,3175437,2964900,1812056,852617,799141,1794907,2939549,459284,1519483,1794873,811211,306360,489829,479091,3419948,290546,276534,3220945,1754355,281649,390657,311496,295988,802958,2643833}
  6.  
  7. function main()
  8.     tfm.exec.disableAutoNewGame(true)
  9.     tfm.exec.disableAutoShaman(true)
  10.     tfm.exec.disableAutoTimeLeft(true)
  11.     tfm.exec.newGame(maps[math.random(#maps)])
  12. end
  13.  
  14. function eventNewGame()
  15.     interval = 9999999999
  16.     tfm.exec.setGameTime(300)
  17. end
  18.  
  19. function eventLoop(time, remaining)
  20.     interval = interval - 1
  21.     if time>3000 and interval>6 then
  22.         ui.removeTextArea(4)
  23.         local users = {}
  24.         for name,p in pairs(tfm.get.room.playerList) do
  25.             if not p.isDead then
  26.                 users[#users+1] = name
  27.             end
  28.         end
  29.         spawnCannon(users[math.random(#users)])
  30.     end
  31.     if interval<=5 then
  32.         tfm.exec.setUIMapName("<ROSE>The next map will start in "..interval)
  33.         if interval == 0 then
  34.             tfm.exec.newGame(maps[math.random(#maps)])
  35.         end
  36.     end
  37.     if remaining<=0 then
  38.         ui.addTextArea(4, "<VP><p align='center'><B>CONGRATULATIONS</B>\n\n<CH><i>you beat the CPU!", nil, 290, 22, 180, nil, 0x000001, 0xCA0805, 0.8)
  39.         tfm.exec.newGame(maps[math.random(#maps)])
  40.     end
  41. end
  42.  
  43. function eventPlayerDied(name)
  44.     if playerCount() < 1 then
  45.         interval = 6
  46.     end
  47. end
  48.  
  49. function playerCount()
  50.     local n=0
  51.     for name, player in pairs(tfm.get.room.playerList) do
  52.         if not player.isDead then
  53.             print(name)
  54.             n=n+1
  55.         end
  56.     end
  57.     return n
  58. end
  59.  
  60. function spawnCannon(name)
  61.     local px = tfm.get.room.playerList[name].x
  62.     local py = tfm.get.room.playerList[name].y
  63.     local cnnx = math.random()*800
  64.     local cnny = math.random()*400
  65.     if cnny > py then
  66.         cnny = py-math.random(50)-20
  67.     end
  68.     if math.abs(cnnx-px) > 300 then
  69.         cnnx = px + math.random(-50, 50)
  70.     end
  71.     local ang = math.deg(math.atan2(cnny-py, cnnx-px))
  72.     for i=0, math.random(10) do
  73.         tfm.exec.addShamanObject(17, cnnx, cnny, ang-90)
  74.     end
  75. end
  76.        
  77. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement