Advertisement
Guest User

Untitled

a guest
Nov 19th, 2013
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.23 KB | None | 0 0
  1. TEXT1='   <J>Witaj w minigrze Boxing!\n\n<BV>Cel: <N>Pokonaj wszystkie myszy na mapie aby wygrać.\n\n<BV>Komendy:\n<BL>!pomoc\t\t<N>- wyświetla to co teraz czytasz...\n<BL>!info\t\t<N>- wyświetla informacje na temat minigry\n<BL>!mort\t\t<N>- samobójstwo'
  2. TEXT2='   <J>Informacje o Boxing\n\n<BV>Autor: <V>Grejfrutek\n<BV>Twórca: <V>Ouake\n\n<BV>Ilość map: <N>10\n\n<BV>Sterowanie:\n<VP>Spacja\t<N>- latanie\n<VP>B\t\t<N>- atak\n<VP>N\t\t<N>- blok'
  3.  
  4. tfm.exec.disableAutoScore(true)
  5. tfm.exec.disableAutoShaman(true)
  6. tfm.exec.disableAutoNewGame(true)
  7. system.disableChatCommandDisplay("info",true)
  8. system.disableChatCommandDisplay("mort",true)
  9. system.disableChatCommandDisplay("pomoc",true)
  10. Mapy={281492,293487,296033,305753,307930,479091,292672,3107377,3295213,3400319}
  11. tfm.exec.newGame(Mapy[math.random(#Mapy)])
  12.  
  13. function eventNewGame()
  14.   HP,kier,blok,t1,t2,i={},{},{},{},{},0
  15.   ui.removeTextArea(3)
  16.   ui.removeTextArea(10)
  17.   ui.removeTextArea(11)
  18.   for nick in pairs(tfm.get.room.playerList) do
  19.     ui.addTextArea(1,"<B><G>♥♥♥♥♥♥♥♥♥♥",nick,84,30)
  20.     ui.addTextArea(2,"<B><J>Zdrowie:  <VP>♥♥♥♥♥♥♥♥♥♥",nick,20,30,0,0,0)
  21.     tfm.exec.setNameColor(nick,0)
  22.     for v,klaw in pairs({32,66,68,78,81}) do
  23.       tfm.exec.bindKeyboard(nick,klaw,true,true)
  24.     end
  25.     HP[nick],kier[nick],blok[nick],t1[nick],t2[nick],i=10,10,0,0,0,i+1
  26.   end
  27. end
  28.  
  29. function eventKeyboard(nick,klaw)
  30.   if klaw==32 then
  31.     tfm.exec.movePlayer(nick,0,0,true,0,-50,true)
  32.   elseif klaw==66 then
  33.     Zly=nick
  34.     if t2[nick]==0 then
  35. --*Pole ataku:*  ui.addTextArea(666,"",nick,tfm.get.room.playerList[nick].x+kier[nick],tfm.get.room.playerList[nick].y-30,40,60,0xff0000,0xff0000,0.5)
  36.       Atak()
  37.     end
  38.     t2[nick]=1
  39.   elseif klaw==78 then
  40.     blok[nick]=1
  41.     ui.addTextArea(3,"",nick,tfm.get.room.playerList[nick].x-20,tfm.get.room.playerList[nick].y-20,40,40,0xffff00,0xffff00,0.5)
  42.   elseif klaw==68 then kier[nick]=10
  43.   elseif klaw==81 then kier[nick]=-50
  44.   end
  45. end
  46.  
  47. function Atak()
  48.   for nick in pairs(tfm.get.room.playerList) do
  49.     if tfm.get.room.playerList[nick].x>tfm.get.room.playerList[Zly].x+kier[nick] and tfm.get.room.playerList[nick].x<tfm.get.room.playerList[Zly].x+50+kier[nick] and tfm.get.room.playerList[nick].y>tfm.get.room.playerList[Zly].y-35 and tfm.get.room.playerList[nick].y<tfm.get.room.playerList[Zly].y+35 then
  50.       if HP[nick]>0 and blok[nick]==0 then
  51.         Obj=tfm.exec.addShamanObject(1,tfm.get.room.playerList[nick].x+kier[nick],tfm.get.room.playerList[nick].y)
  52.         tfm.exec.removeObject(Obj)
  53.         ui.addTextArea(10,"<B><font color='#ff9b29'>"..Zly.." właśnie Cię uderzył!",nick,tfm.get.room.playerList[nick].x-90,tfm.get.room.playerList[nick].y-80,0,0,0x1c3c41,0x1c3c41,0.7)
  54.         HP[nick],t1[nick],THP=HP[nick]-1,6,"<B><J>Zdrowie:  <VP>"
  55.         for i=1,HP[nick] do
  56.           THP=THP.."♥"
  57.         end
  58.         if HP[nick]==3 then
  59.           tfm.exec.setNameColor(nick,0xff9e9e)
  60.           ui.addTextArea(11,"<B><font color='#ff9e9e'>Masz mało serc!",nick,tfm.get.room.playerList[nick].x-50,tfm.get.room.playerList[nick].y-100,0,0,0x1c3c41,0x1c3c41,0.7)
  61.           t1[nick]=6
  62.         end
  63.         if HP[nick]==0 then
  64.           tfm.exec.killPlayer(nick)
  65.           ui.addTextArea(10,"<B><font color='#ffaa29'>"..Zly.." pokonał Ciebie!",nick,tfm.get.room.playerList[nick].x-70,tfm.get.room.playerList[nick].y-80,0,0,0x1c3c41,0x1c3c41,0.7)
  66.         end
  67.         ui.addTextArea(2,THP,nick,20,30,0,0,0)
  68.       elseif HP[nick]>0 and blok[nick]==1 then
  69.         ui.addTextArea(10,"<B><font color='#a3ffff'>Zdołałeś/aś zablokować atak.",nick,tfm.get.room.playerList[nick].x-95,tfm.get.room.playerList[nick].y-80,0,0,0x1c3c41,0x1c3c41,0.7)
  70.         t1[nick]=6
  71.       end
  72.     end
  73.   end
  74. end
  75.  
  76. function eventChatCommand(nick,komd)
  77.   if komd=="pomoc" then
  78.     ui.addTextArea(101,TEXT1,nick,230,110,340,200,0x1c3c41,0x1c3c41,1)
  79.     ui.addTextArea(102,'<B><R><a href="event:klik1">X</a>',nick,550,110,14,18,nil,nil,0)
  80.   elseif komd=="info" then
  81.     ui.addTextArea(101,TEXT2,nick,230,110,340,200,0x1c3c41,0x1c3c41,1)
  82.     ui.addTextArea(102,'<B><R><a href="event:klik1">X</a>',nick,550,110,14,18,nil,nil,0)
  83.   elseif komd=="mort" then
  84.     tfm.exec.killPlayer(nick)
  85.   end
  86. end
  87.  
  88. function eventTextAreaCallback(id,playerName,odp)
  89.   for nick in pairs(tfm.get.room.playerList) do
  90.     if odp=="klik1" then
  91.       ui.removeTextArea(101,nick)
  92.       ui.removeTextArea(102,nick)
  93.     end
  94.   end
  95. end
  96.  
  97. function eventLoop(v,czas)
  98.   for nick in pairs(tfm.get.room.playerList) do
  99.     if t1[nick]==1 then
  100.       ui.removeTextArea(10,nick)
  101.       ui.removeTextArea(11,nick)
  102.       t1[nick]=t1[nick]-1
  103.     elseif t1[nick]>1 then
  104.       t1[nick]=t1[nick]-1
  105.     end
  106.     if t2[nick]>0 then
  107.       t2[nick]=0
  108.     end
  109.     if blok[nick]==1 then
  110.       ui.removeTextArea(3,nick)
  111.       blok[nick]=0
  112.     end
  113.   end
  114.   if czas<1 then
  115.     tfm.exec.newGame(Mapy[math.random(#Mapy)])
  116.   end
  117. end
  118.  
  119. function eventPlayerDied(nick)
  120.   ui.addTextArea(2,"<B><J>Zdrowie:  ",nick,20,30,0,0,0)
  121.   HP[nick],i=0,i-1
  122.   for nick,player in pairs(tfm.get.room.playerList) do
  123.     if player.isDead==false and i==1 then
  124.       tfm.exec.setPlayerScore(nick,1,true)
  125.     end
  126.   end
  127.   if i==0 then
  128.     tfm.exec.newGame(Mapy[math.random(#Mapy)])
  129.   end
  130. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement