Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- time = 0
- chrononext = 0
- invoque = 0
- affichemsg = 1
- game = 1
- deadcham = 0
- i = 0
- joueurs = {}
- shaman = {}
- maps = {"44", "48", "49", "50", "51", "52" ,"53", "138", "139", "140", "141", "142", "143", "509145", "2934471", "3665891", "3567033", "3045173", "3384021", "1965497", "2934619", "2952467", "1054567", "1259630", "1470691", "875351", "1437600", "1591172", "1547778", "1547778", "1451150", "1467185", "1444469", "1500085", "1015595", "1439296", "1437755"} -- etc...
- tfm.exec.newGame(maps[math.random(#maps)])
- function eventNewPlayer(playerName)
- ui.addPopup(1,0,"<p align='center'><font color='#BABD2F' size='15'><b>Bienvenue, vous jouez au module « Fight » !</b></font></p><br><p align='justify'><font size='9.5'><b>Le but est simple ! Deux souris sont définies comme les chamans, un compte à rebours commence alors avec une durée de </font><font color='#33CCCC'>« 13 secondes »</font><font size='9.5'> en tant que préparation. Quand le compte à rebours arrive à </font><font color='#33CCCC'>« 0 »</font><font size='9.5'> et que le message </font><font color='#33CCCC'>« FIGHHHHHHHHHHHHT ! »</font><font size='9.5'> apparaît, les deux chamans doivent tenter de s'entre-tuer, mais attention, si un chaman essaye d'invoquer un objet pendant le compte à rebours, il sera éliminé pour ce tour et l'autre chaman gagnera la partie !</b></font></p><br><font color='#FF9900' size='9.5'><b>Pour avoir la liste des commandes tapez : </b></font><b><font size='9.5'>!commandes</font></b><br><br></br><font size='9' color='#C2C2DA'><b>Module codé par Keltah, avec l'aide technique de Varucristal.</b></font></b></font></p>",playerName,150,75,500);
- end
- function eventLoop(temps1,temps2)
- time = time+(1/2)
- nt = 13-time
- if temps2 < 1 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- if nt > 5 and nt <= 12.5 and affichemsg == 1 then
- ui.updateTextArea(0, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Chamanes, vous devez attendre </font><font color='#FF9900' face='Arial' size='12.5'>".. nt .." secondes </font><font color='#babd2f' face='Arial' size='12.5'>avant d'invoquer un objet !</b></font></p>", NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- tfm.exec.addShamanObject(0 , 115, 35, -90, 0, 0, false)
- tfm.exec.addShamanObject(0 , 685, 35, 90, 0, 0, false)
- elseif nt <= 5 and nt > 0 and affichemsg == 1 then
- ui.updateTextArea(0, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Chamanes, vous devez attendre </b></font><p align='center'><font color='#33CCCC' face='Arial' size='12.5'><b>".. nt .." secondes </b></font><p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>avant d'invoquer un objet !</b></font></p>", NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- elseif nt == 0 and affichemsg == 1 then
- ui.updateTextArea(0, "<p align='center'><font color='#FF9900' face='Arial' size='12.5'><b>FIGHHHHHHHHHHHHT !</b></font></p>", NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- elseif nt == -3 and affichemsg == 1 then
- ui.removeTextArea(0, NIL)
- affichemsg = 0
- end
- if statuscham == 0 then
- ui.removeTextArea(0, NIL)
- end
- if statuscham == 0 and chrononext <= time then
- --ui.updateTextArea(1, chrononext, NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- end
- end
- function eventSummoningStart(playerName, objT, x, y, angle)
- if time < 13 and statuscham == 1 and game == 1 then
- tfm.exec.killPlayer(playerName)
- if playerName == shaman[1] then
- ui.addTextArea(1, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Mince ! Le chaman </font><font color='#FF9900' face='Arial' size='12.5'>".. playerName .."</font><font color='#babd2f' face='Arial' size='12.5'> a voulu invoquer un objet pendant le temps de préparation, il est éliminé !<br> </font><font color='#FF9900' face='Arial' size='12.5'>".. shaman[2] .."</font><font color='#babd2f' face='Arial' size='12.5'> a donc gagné. Va vite sauver tes souris, tu as </font><font color='#FF9900' face='Arial' size='12.5'>1 minute</font><font color='#babd2f' face='Arial' size='12.5'> !</b></font></p>", NIL, 100, 25, 600, 35, 0x1C3C41, 0x1C3C41, 1.2)
- deadchamUn = playerName
- affichemsg = 0
- invoque = 1
- tfm.exec.setGameTime(60)
- elseif playerName == shaman[2] and game == 1 then
- ui.addTextArea(1, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Mince ! Le chaman </font><font color='#FF9900' face='Arial' size='12.5'>".. playerName .."</font><font color='#babd2f' face='Arial' size='12.5'> a voulu invoquer un objet pendant le temps de préparation, il est éliminé !<br> </font><font color='#FF9900' face='Arial' size='12.5'>".. shaman[1] .."</font><font color='#babd2f' face='Arial' size='12.5'> a donc gagné. Va vite sauver tes souris, tu as </font><font color='#FF9900' face='Arial' size='12.5'>1 minute</font><font color='#babd2f' face='Arial' size='12.5'> !</b></font></p>", NIL, 100, 25, 600, 35, 0x1C3C41, 0x1C3C41, 1.2)
- deadchamUn = playerName
- affichemsg = 0
- invoque = 1
- tfm.exec.setGameTime(60)
- end
- end
- end
- function eventPlayerDied(playerName)
- if tfm.get.room.playerList[playerName].isShaman then
- deadcham = deadcham+1
- statuscham = 0
- chrono = time+(1/2)
- chrononext = 5-chrono
- if game == 0 then
- tfm.exec.setGameTime(20)
- end
- if deadcham == 1 and invoque == 0 and game == 1 then
- if playerName == shaman[1] then
- ui.addTextArea(1, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Le chaman </font><font color='#FF9900' face='Arial' size='12.5'>".. playerName .."</font><font color='#babd2f' face='Arial' size='12.5'> est mort ! </font><font color='#FF9900' face='Arial' size='12.5'>".. shaman[2] .."</font><font color='#babd2f' face='Arial' size='12.5'> a gagné. Va vite sauver tes souris, tu as </font><font color='#FF9900' face='Arial' size='12.5'>1 minute</font><font color='#babd2f' face='Arial' size='12.5'> !</b></font></p>", NIL, 125, 25, 550, 20, 0x1C3C41, 0x1C3C41, 1.2)
- deadchamUn = playerName
- affichemsg = 0
- tfm.exec.setGameTime(60)
- elseif playerName == shaman[2] then
- ui.addTextArea(1, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Le chaman </font><font color='#FF9900' face='Arial' size='12.5'>".. playerName .."</font><font color='#babd2f' face='Arial' size='12.5'> est mort ! </font><font color='#FF9900' face='Arial' size='12.5'>".. shaman[1] .."</font><font color='#babd2f' face='Arial' size='12.5'> a gagné. Va vite sauver tes souris, tu as </font><font color='#FF9900' face='Arial' size='12.5'>1 minute</font><font color='#babd2f' face='Arial' size='12.5'> !</b></font></p>", NIL, 125, 25, 550, 20, 0x1C3C41, 0x1C3C41, 1.2)
- deadchamUn = playerName
- affichemsg = 0
- tfm.exec.setGameTime(60)
- end
- elseif deadcham == 2 and game == 1 then
- ui.addTextArea(1, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Oups les chamanes <font color='#FF9900' face='Arial' size='12.5'>".. deadchamUn .."</font><font color='#babd2f' face='Arial' size='12.5'> et </font><font color='#FF9900' face='Arial' size='12.5'>"..playerName .."</font><font color='#babd2f' face='Arial' size='12.5'> sont mort ! Une autre partie va être lancée.</b></font></p>", NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- tfm.exec.setGameTime(10)
- affichemsg = 0
- end
- end
- end
- function eventNewGame()
- ui.removeTextArea(1, NIL)
- joueurs = {}
- shaman = {}
- time = 0
- affichemsg = 1
- statuscham = 1
- chrononext = 0
- deadcham = 0
- invoque = 0
- game = 1
- i = 0
- for name in pairs(tfm.get.room.playerList) do
- i = i+1
- table.insert(joueurs, name)
- if tfm.get.room.playerList[joueurs[i]].isShaman then
- tfm.exec.setPlayerScore(name , 0, false)
- table.insert(shaman, name)
- else
- tfm.exec.setPlayerScore(name , 1, true)
- end
- end
- if i >= 2 and affichemsg == 1 then
- ui.addTextArea(0, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b>Chamanes, vous devez attendre </font><font color='#FF9900' face='Arial' size='12.5'>13 secondes </font><font color='#FF9900' face='Arial' size='12.5'> avant d'invoquer un objet !</b></font></p>", NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- tfm.exec.addShamanObject(0 , 110, 35, -90, 0, 0, false)
- tfm.exec.addShamanObject(0 , 690, 35, 90, 0, 0, false)
- else
- ui.addTextArea(0, "<p align='center'><font color='#babd2f' face='Arial' size='12.5'><b></font><font color='#FF9900' face='Arial' size='12.5'>Partie annulée</font><font color='#babd2f' face='Arial' size='12.5'>, il n'y a pas assez de souris ! Vous devez être deux souris au minimum.</b></font></p>", NIL, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
- tfm.exec.addShamanObject(0 , 115, 35, -90, 0, 0, false)
- tfm.exec.addShamanObject(0 , 685, 35, 90, 0, 0, false)
- affichemsg = 2
- game = 0
- end
- end
- for name, player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventChatCommand(playerName,message)
- if message:sub(0,9) == "commandes" then
- ui.addPopup(2, 0, "<p align='center'><font color='#FF9900' size='10'><b>Voici la liste des commandes :</b></font></p><br><font size='10' color='#babd2f'><b>!regles</b></font><b><font size='10'> : Affiche les règles.</font></b></font><br><font size='10' color='#babd2f'><b>!partie</b></font><b><font size='10'> : Relance une partie.</font></b>", playerName, 0, 100, 200)
- elseif message:sub(0,6) == "partie" then
- tfm.exec.newGame(maps[math.random(#maps)])
- elseif message:sub(0,6) == "regles" then
- ui.addPopup(2,0,"<p align='center'><font color='#BABD2F' size='15'><b>Règles du module « Fight » :</b></font></p><br><p align='justify'><font size='9.5'><b>- Ne pas sauver de souris tant qu'un des deux chamans ne soit pas mort.<br>- Ne pas boucher le trou d'un chaman tant qu'un des deux chamans ne soit pas mort.<br>- Ne pas tuer les souris tant qu'un des deux chamans ne soit pas mort.</b></font></p>",playerName,150,75,500);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement