// Stats: "Auth" : '["0-Games", "1-Wins", "2-Draws", "3-Losses", "4-Winrate", "5-Goals", "6-Assists", "7-GK", "8-CS", "9-CS%", "10-Role", "11-Nick"]' /* VARIABLES */ /* ROOM */ const roomName = "HOCKEY 3vs3рџЊџ"; // Nombre del host const botName = "FFрџЊџ"; // No tocar const maxPlayers = 16; // Cantidad de jugadores limite const roomPublic = true; // Si es true, el host es publico, si es false, el host es privado const geo = [{"code": "ni", "lat": -34.6, "lon": -58.4}]; // Geo var adminPassword = "aadh"; // Pass de adm const room = HBInit({ roomName: roomName, maxPlayers: maxPlayers, public: roomPublic, playerName: botName, geo: geo[0], noPlayer: true}); const scoreLimitClassic = 3; const scoreLimitBig = 3; const timeLimitClassic = 3; const timeLimitBig = 3; const commands = { // Commands //FFрџЊџ: [PV] Comandos : !me", !games", !wins", !goals", !assists", !cs", !afks", !mutes", !bans"". //FFрџЊџ: [PV] Admin : !mute <duration = 3> #<id>, !unmute all/#<id>, !clearbans <number = all>, !slow <duration>, !endslow "!ayuda": showHelp, "!creditos": mostrarCreditos, "!nv": nv, "!bb": nv,"!bye": nv, "!slow": slow, "!endslow": endSlow, // Stats "!me": showMe, "!cs": showCs, "!games": showGames, "!goals": showGoals, "!assists": showAsists, "!wins": wins, "!afk": afk, "!afks": showAfks, "!afklist": showAfks, "!bans": showBans, "!banlist": showBans, "!mutes": showMutes, "!mutelist": showMutes, "!clearbans": clearBans, // Admin "!removeadmin": removeAdmin, "!setplayer": removeAdmin, "!claim": giveClaim, "!mute": mute, "!unmute": unmute, "top": changePlayer, "auto": changePlayer, "random": changePlayer, "rand": changePlayer, "1": changePlayer, "2": changePlayer, "3": changePlayer, "4": changePlayer, "5": changePlayer, "6": changePlayer, "7": changePlayer, "8": changePlayer, "9": changePlayer } const wordProhibited = ['а°Њ','дЅ№','з •','Д€','вј€','жё»','䬭॑','в¬є','爂','б°ѕ','бњЄ','䉧','б¬Ї','гЌё','бњ–','б�¬','ж…©','г™І','Фђ','зЂ©','а¤ћа Ј','笋','℉','вЁ„','гђ·','зґЄ','жЁ©','аЁ›','аµЅ','г”™','жЂ…','㬆','з™•','вЁґ','зђђ','бё‰','еґЄ','б™»','бё»','вЁ‚','г€ї','爇','䕦','бґµ','зЃѕ','гёЏ','зњ®','б‰Ў','б„ё','ЬЌ','礂','жµ·','е­ё','г°Њ','⬦','С«','вј•','аёў','вЊ‘','бё·','г •','бЌѓ','㤕','гЊ‹','вђў','зњў','з ¬','вµЇз…ѕ','в°Ё','зё‚','г‰°','еЊЉ','г¤Ђ','ह','зЁ«','бќ€','вґѕ','г„«','г¤’','д‰Љ','Ш€а¬ї','г”ћ','её±','ॹ','а љв°Ї','бјЇ','жµё','б”ћ','бЌ­','аЁ®','еЁ®','ЩЃ','㤮','гЂ•','г±і','в¬—','б…·','Рґ','甇','бњЇ','⩿ᤶ','в±Ѓ','ж€ѓ', 'ж¤Џ','зјЃ','вјђ','зЌѕ','вЊ±','аґ®','г€ђ','бµІ','жЎЁ','Ф·','бґ‘','Дї','ᑆ','гЁ¤','а°ґ','в‘ё','甈','вЁ�','СІ','в€Ї','г�ґ','дЃ”','Ш­','аёѕ','ШЊ','аёЊ','з�Є','PAJA CON MEDIAS','DE HERMANITA']; room.setTeamsLock(true); /* STADIUM */ const playerRadius = 15; var ballRadius = 6.25; const triggerDistance = playerRadius + ballRadius + 0.01; var aloneMap = '{"name":"NHL - Oficial","width":1040,"height":550,"bg":{"type":"hockey","width":1000,"height":470,"cornerRadius":200},"vertexes":[{"x":-800,"y":-470,"bCoef":-1.4,"cMask":["ball"]},{"x":800,"y":-470,"bCoef":0.5,"cMask":["red"]},{"x":-800,"y":470,"bCoef":-1.4,"cMask":["ball"]},{"x":800,"y":470,"bCoef":-1.4,"cMask":["ball"]},{"x":-1000,"y":-270,"bCoef":-1.4,"cMask":["ball"]},{"x":-1000,"y":270,"bCoef":-1.4,"cMask":["ball"]},{"x":1000,"y":-270,"bCoef":-1.4,"cMask":["ball"]},{"x":1000,"y":270,"bCoef":-1.4,"cMask":["ball"]},{"x":-757,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":-790,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":-757,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":-790,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":-810,"y":-70,"bCoef":-0.7,"cMask":["ball"]},{"x":-810,"y":70,"bCoef":-0.7,"cMask":["ball"]},{"x":-760,"y":-467,"cMask":[]},{"x":-760,"y":467,"cMask":[]},{"x":757,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":790,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":757,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":790,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":810,"y":70,"bCoef":-0.7,"cMask":["ball"]},{"x":810,"y":-70,"bCoef":-0.7,"cMask":["ball"]},{"x":760,"y":-467,"cMask":[]},{"x":760,"y":467,"cMask":[]},{"x":0,"y":-470,"cMask":[]},{"x":0,"y":470,"cMask":[]},{"x":-230,"y":-470,"cMask":[]},{"x":-230,"y":470,"cMask":[]},{"x":0,"y":-130,"cMask":[]},{"x":0,"y":130,"cMask":[]},{"x":-500,"y":80,"cMask":[]},{"x":-500,"y":340,"cMask":[]},{"x":500,"y":-340,"cMask":[]},{"x":500,"y":-80,"cMask":[]},{"x":500,"y":80,"cMask":[]},{"x":500,"y":340,"cMask":[]},{"x":-500,"y":-340,"cMask":[]},{"x":-500,"y":-80,"cMask":[]},{"x":500,"y":-214,"cMask":[]},{"x":500,"y":-206,"cMask":[]},{"x":500,"y":-212,"cMask":[]},{"x":500,"y":-208,"cMask":[]},{"x":500,"y":-212,"cMask":[]},{"x":500,"y":-208,"cMask":[]},{"x":501,"y":206,"cMask":[]},{"x":501,"y":214,"cMask":[]},{"x":501,"y":208,"cMask":[]},{"x":501,"y":212,"cMask":[]},{"x":501,"y":208,"cMask":[]},{"x":501,"y":212,"cMask":[]},{"x":-499,"y":-214,"cMask":[]},{"x":-499,"y":-206,"cMask":[]},{"x":-499,"y":-212,"cMask":[]},{"x":-499,"y":-208,"cMask":[]},{"x":-499,"y":-212,"cMask":[]},{"x":-499,"y":-208,"cMask":[]},{"x":-497,"y":207,"cMask":[]},{"x":-497,"y":215,"cMask":[]},{"x":-497,"y":209,"cMask":[]},{"x":-497,"y":213,"cMask":[]},{"x":-497,"y":209,"cMask":[]},{"x":-497,"y":213,"cMask":[]},{"x":0,"y":-2,"cMask":[]},{"x":0,"y":6,"cMask":[]},{"x":0,"y":0,"cMask":[]},{"x":0,"y":4,"cMask":[]},{"x":0,"y":0,"cMask":[]},{"x":0,"y":4,"cMask":[]},{"x":-757,"y":-90,"cMask":[]},{"x":-757,"y":110,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":107,"cMask":[]},{"x":-757,"y":-104,"cMask":[]},{"x":-757,"y":104,"cMask":[]},{"x":-757,"y":-101,"cMask":[]},{"x":-757,"y":101,"cMask":[]},{"x":-757,"y":-98,"cMask":[]},{"x":-757,"y":98,"cMask":[]},{"x":-757,"y":-95,"cMask":[]},{"x":-757,"y":95,"cMask":[]},{"x":-757,"y":-92,"cMask":[]},{"x":-757,"y":92,"cMask":[]},{"x":-757,"y":-89,"cMask":[]},{"x":757,"y":101.536516602,"cMask":[]},{"x":757,"y":-100.463423548,"cMask":[]},{"x":757,"y":98.5365174904,"cMask":[]},{"x":757,"y":-97.4634244364,"cMask":[]},{"x":757,"y":95.5365183793,"cMask":[]},{"x":757,"y":-94.4634253253,"cMask":[]},{"x":757,"y":92.5365192682,"cMask":[]},{"x":757,"y":-91.4634262142,"cMask":[]},{"x":757,"y":103,"cMask":[]},{"x":757,"y":-103,"cMask":[]},{"x":757,"y":106,"cMask":[]},{"x":757,"y":-106,"cMask":[]},{"x":757,"y":109,"cMask":[]},{"x":757,"y":-109,"cMask":[]},{"x":800,"y":-470,"bCoef":-1.2,"cMask":["ball"]},{"x":1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":-270,"bCoef":0,"cMask":["red","blue"]},{"x":-800,"y":-470,"bCoef":0.5,"cMask":["blue"]},{"x":-1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-757,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-790,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-757,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-790,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-810,"y":-70,"bCoef":0.7,"cMask":["red","blue"]},{"x":-810,"y":70,"bCoef":0.7,"cMask":["red","blue"]},{"x":757,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":790,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":757,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":790,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":810,"y":70,"bCoef":0.7,"cMask":["red","blue"]},{"x":810,"y":-70,"bCoef":0.7,"cMask":["red","blue"]},{"x":230,"y":-470,"cMask":[]},{"x":230,"y":470,"cMask":[]},{"x":-757,"y":109,"cMask":[]},{"x":-757,"y":-109,"cMask":[]},{"x":-1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"cMask":["ball"]},{"x":800,"y":470,"cMask":["ball"]},{"x":799,"y":-470,"bCoef":0.5,"cMask":["red"]},{"x":-750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":-750,"y":-550,"bCoef":0,"cMask":["red","blue"]},{"x":750,"y":-550,"bCoef":0,"cMask":["red","blue"]},{"x":-750,"y":470,"bCoef":0,"cMask":["ball"]},{"x":-750,"y":550,"bCoef":0,"cMask":["ball"]},{"x":750,"y":470,"bCoef":0,"cMask":["ball"]},{"x":750,"y":550,"bCoef":0,"cMask":["ball"]},{"x":-1001,"y":64,"bCoef":0,"cMask":["red","blue"]},{"x":-1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":-1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":-796,"y":-505,"bCoef":0,"cMask":["wall"]},{"x":-751,"y":-503,"bCoef":0,"cMask":["wall"]},{"x":750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":751,"y":-503,"bCoef":0,"cMask":["red","blue"]},{"x":796,"y":-505,"bCoef":0,"cMask":["wall"]},{"x":751,"y":-503,"bCoef":0,"cMask":["wall"]},{"x":1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":796,"y":-505,"bCoef":0,"cMask":["red","blue"]},{"x":1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":1001,"y":64,"bCoef":0,"cMask":["red","blue"]},{"x":1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":-744,"y":-475,"bCoef":-0.6,"cMask":["ball"]},{"x":743,"y":-474,"bCoef":-0.6,"cMask":["ball"]},{"x":-800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":-1007,"y":267,"bCoef":-0.6,"cMask":["ball"]},{"x":800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":267,"bCoef":-0.6,"cMask":["ball"]},{"x":-1007,"y":68,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":68,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":-266},{"x":1007,"y":-68},{"x":-1006,"y":-271,"bCoef":-0.6,"cMask":["ball"]},{"x":1006,"y":-271,"bCoef":-0.6,"cMask":["ball"]},{"x":-745,"y":478},{"x":745,"y":478},{"x":-15,"y":-485,"cMask":["ball"]},{"x":15,"y":-485,"cMask":["ball"]},{"x":-20,"y":485,"cMask":["ball"]},{"x":20,"y":485,"cMask":["ball"]},{"x":-25,"y":-485,"cMask":["ball"]},{"x":25,"y":-485,"cMask":["ball"]},{"x":-29,"y":483,"cMask":["ball"]},{"x":29,"y":483,"cMask":["ball"]},{"x":-55,"y":-485,"cMask":["ball"]},{"x":55,"y":-485,"cMask":["ball"]},{"x":-57,"y":483,"cMask":["ball"]},{"x":57,"y":483,"cMask":["ball"]},{"x":-55,"y":-525,"cMask":["ball"]},{"x":-25,"y":-525,"cMask":["ball"]},{"x":-15,"y":-525,"cMask":["ball"]},{"x":15,"y":-525,"cMask":["ball"]},{"x":25,"y":-525,"cMask":["ball"]},{"x":15,"y":-505,"cMask":["ball"]},{"x":-15,"y":-505,"cMask":["ball"]},{"x":65,"y":-485,"cMask":["ball"]},{"x":82,"y":-515,"cMask":["ball"]},{"x":65,"y":-500,"cMask":["ball"]},{"x":90,"y":-485,"cMask":["ball"]},{"x":90,"y":-515,"cMask":["ball"]},{"x":90,"y":-500,"cMask":["ball"]},{"x":115,"y":-485,"cMask":["ball"]},{"x":115,"y":-515,"cMask":["ball"]},{"x":115,"y":-500,"cMask":["ball"]},{"x":125,"y":-485,"cMask":["ball"]},{"x":85,"y":-485,"cMask":["ball"]},{"x":110,"y":-485,"cMask":["ball"]},{"x":110,"y":-500,"cMask":["ball"]},{"x":110,"y":-515,"cMask":["ball"]},{"x":85,"y":-500,"cMask":["ball"]},{"x":92,"y":-515,"cMask":["ball"]},{"x":91,"y":-516,"cMask":["ball"]},{"x":90,"y":-500,"cMask":["ball"]},{"x":115,"y":-485,"cMask":["ball"]},{"x":115,"y":-515,"cMask":["ball"]},{"x":115,"y":-500,"cMask":["ball"]},{"x":114,"y":-514,"cMask":["ball"]},{"x":114,"y":-500,"cMask":["ball"]},{"x":135,"y":-515,"cMask":["ball"]},{"x":135,"y":-485,"cMask":["ball"]}],"segments":[{"v0":2,"v1":3,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":4,"v1":5,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":6,"v1":7,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":4,"v1":0,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":2,"v1":5,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":7,"v1":3,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":1,"v1":6,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":8,"v1":9,"bCoef":-0.7,"cMask":["ball"]},{"v0":10,"v1":11,"bCoef":-0.7,"cMask":["ball"]},{"v0":12,"v1":13,"bCoef":-0.7,"cMask":["ball"]},{"v0":9,"v1":13,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":12,"v1":11,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":14,"v1":15,"cMask":[]},{"v0":16,"v1":17,"bCoef":-0.7,"cMask":["ball"]},{"v0":18,"v1":19,"bCoef":-0.7,"cMask":["ball"]},{"v0":20,"v1":21,"bCoef":-0.7,"cMask":["ball"]},{"v0":17,"v1":21,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":20,"v1":19,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":22,"v1":23,"cMask":[]},{"v0":24,"v1":25,"cMask":[]},{"v0":26,"v1":27,"cMask":[],"color":"818181"},{"v0":29,"v1":28,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":28,"v1":29,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":31,"v1":30,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":30,"v1":31,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":33,"v1":32,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":32,"v1":33,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":35,"v1":34,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":34,"v1":35,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":37,"v1":36,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":36,"v1":37,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":39,"v1":38,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":38,"v1":39,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":41,"v1":40,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":40,"v1":41,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":43,"v1":42,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":42,"v1":43,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":45,"v1":44,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":44,"v1":45,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":47,"v1":46,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":46,"v1":47,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":49,"v1":48,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":48,"v1":49,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":51,"v1":50,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":50,"v1":51,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":53,"v1":52,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":52,"v1":53,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":55,"v1":54,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":54,"v1":55,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":57,"v1":56,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":56,"v1":57,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":59,"v1":58,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":58,"v1":59,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":61,"v1":60,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":60,"v1":61,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":63,"v1":62,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":62,"v1":63,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":65,"v1":64,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":64,"v1":65,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":67,"v1":66,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":66,"v1":67,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":97,"v1":98,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":99,"v1":100,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":101,"v1":102,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":104,"v1":103,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":105,"v1":106,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":107,"v1":108,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":111,"v1":110,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":112,"v1":113,"bCoef":0,"cMask":["red","blue"]},{"v0":114,"v1":115,"bCoef":0,"cMask":["red","blue"]},{"v0":116,"v1":117,"bCoef":0,"cMask":["red","blue"]},{"v0":113,"v1":117,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":116,"v1":115,"bCoef":0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":118,"v1":119,"bCoef":0,"cMask":["red","blue"]},{"v0":120,"v1":121,"bCoef":0,"cMask":["red","blue"]},{"v0":122,"v1":123,"bCoef":0,"cMask":["red","blue"]},{"v0":119,"v1":123,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":122,"v1":121,"bCoef":0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":124,"v1":125,"cMask":[],"color":"818181"},{"v0":127,"v1":126,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":128,"v1":129,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":107,"v1":130,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":106,"v1":131,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":0,"v1":99,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":133,"v1":134,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":134,"v1":132,"bCoef":0.5,"cMask":["red"]},{"v0":110,"v1":133,"bCoef":0.5,"cMask":["blue"]},{"v0":141,"v1":142,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":142,"v1":143,"bCoef":0,"cMask":["red","blue"],"color":"818181"},{"v0":143,"v1":144,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":144,"v1":145,"bCoef":0,"cMask":["wall"]},{"v0":145,"v1":133,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":146,"v1":147,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":148,"v1":149,"bCoef":0,"cMask":["wall"]},{"v0":151,"v1":150,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":152,"v1":153,"bCoef":0,"cMask":["red","blue"],"color":"818181"},{"v0":155,"v1":154,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":156,"v1":157,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":158,"v1":159,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":158,"v1":160,"bCoef":-0.6,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"],"color":"818181"},{"v0":162,"v1":161,"bCoef":-0.6,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"],"color":"818181"},{"v0":160,"v1":163,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":162,"v1":164,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":163,"v1":167,"bCoef":-0.6,"vis":false,"cMask":["ball"],"color":"6400"},{"v0":164,"v1":168,"bCoef":-0.6,"vis":false,"cMask":["ball"],"color":"6400"},{"v0":167,"v1":156,"bCoef":-0.6,"curve":97,"curveF":0.8847252645559438,"vis":false,"cMask":["ball"],"color":"EEDD82"},{"v0":157,"v1":168,"bCoef":-0.6,"curve":95,"curveF":0.9163311740174233,"vis":false,"cMask":["ball"],"color":"818181"},{"v0":183,"v1":179,"color":"818181"},{"v0":183,"v1":175,"color":"818181"},{"v0":175,"v1":184,"color":"818181"},{"v0":185,"v1":171,"cMask":["ball"],"color":"818181"},{"v0":186,"v1":172,"cMask":["ball"],"color":"818181"},{"v0":176,"v1":180,"cMask":["ball"],"color":"818181"},{"v0":189,"v1":188,"cMask":["ball"],"color":"818181"},{"v0":187,"v1":176,"cMask":["ball"],"color":"818181"},{"v0":212,"v1":207,"curve":-127.73255306091939,"curveF":-0.4906249999999997,"cMask":["ball"]},{"v0":207,"v1":205,"cMask":["ball"]},{"v0":212,"v1":211,"cMask":["ball"]},{"v0":190,"v1":191,"curve":161.76427449240842,"curveF":0.16049382716049404,"cMask":["ball"]},{"v0":190,"v1":200,"cMask":["ball"]}],"planes":[{"normal":[0,1],"dist":-470,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0,-1],"dist":-472,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0,-1],"dist":-549,"bCoef":-0.6,"cMask":["ball"]},{"normal":[0,1],"dist":-547,"bCoef":-0.6,"cMask":["ball"]},{"normal":[0.9999016213403011,-0.014026676050904224],"dist":-998.098191562,"bCoef":-1.2,"cMask":["ball"]},{"normal":[-1,0],"dist":-1039,"bCoef":-0.6,"cMask":["ball"]},{"normal":[1,0],"dist":-1039,"bCoef":-0.6,"cMask":["ball"]},{"normal":[-1,0],"dist":-1001,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0.7071067811865476,0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[-0.7071067811865476,0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[-0.7071067811865476,-0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[0.7071067811865476,-0.7071067811865476],"dist":-960,"cMask":["ball"]}],"goals":[{"p0":[-767,95],"p1":[-767,-95],"team":"red"},{"p0":[767,97],"p1":[767,-97],"team":"blue"}],"discs":[{"radius":6.5,"bCoef":-0.5,"invMass":1.5,"damping":0.996,"color":"0","cGroup":["ball","kick","score"]},{"pos":[-760,-97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[-760,97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[760,97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[760,-97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[-760,-97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[-760,97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[760,97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[760,-97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]}],"playerPhysics":{"bCoef":1,"damping":0.982,"acceleration":0.079,"kickingDamping":0.974,"kickStrength":3.5},"ballPhysics":"disc0","spawnDistance":170}' var classicMap = '{"name":"NHL - Oficial","width":1040,"height":550,"bg":{"type":"hockey","width":1000,"height":470,"cornerRadius":200},"vertexes":[{"x":-800,"y":-470,"bCoef":-1.4,"cMask":["ball"]},{"x":800,"y":-470,"bCoef":0.5,"cMask":["red"]},{"x":-800,"y":470,"bCoef":-1.4,"cMask":["ball"]},{"x":800,"y":470,"bCoef":-1.4,"cMask":["ball"]},{"x":-1000,"y":-270,"bCoef":-1.4,"cMask":["ball"]},{"x":-1000,"y":270,"bCoef":-1.4,"cMask":["ball"]},{"x":1000,"y":-270,"bCoef":-1.4,"cMask":["ball"]},{"x":1000,"y":270,"bCoef":-1.4,"cMask":["ball"]},{"x":-757,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":-790,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":-757,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":-790,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":-810,"y":-70,"bCoef":-0.7,"cMask":["ball"]},{"x":-810,"y":70,"bCoef":-0.7,"cMask":["ball"]},{"x":-760,"y":-467,"cMask":[]},{"x":-760,"y":467,"cMask":[]},{"x":757,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":790,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":757,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":790,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":810,"y":70,"bCoef":-0.7,"cMask":["ball"]},{"x":810,"y":-70,"bCoef":-0.7,"cMask":["ball"]},{"x":760,"y":-467,"cMask":[]},{"x":760,"y":467,"cMask":[]},{"x":0,"y":-470,"cMask":[]},{"x":0,"y":470,"cMask":[]},{"x":-230,"y":-470,"cMask":[]},{"x":-230,"y":470,"cMask":[]},{"x":0,"y":-130,"cMask":[]},{"x":0,"y":130,"cMask":[]},{"x":-500,"y":80,"cMask":[]},{"x":-500,"y":340,"cMask":[]},{"x":500,"y":-340,"cMask":[]},{"x":500,"y":-80,"cMask":[]},{"x":500,"y":80,"cMask":[]},{"x":500,"y":340,"cMask":[]},{"x":-500,"y":-340,"cMask":[]},{"x":-500,"y":-80,"cMask":[]},{"x":500,"y":-214,"cMask":[]},{"x":500,"y":-206,"cMask":[]},{"x":500,"y":-212,"cMask":[]},{"x":500,"y":-208,"cMask":[]},{"x":500,"y":-212,"cMask":[]},{"x":500,"y":-208,"cMask":[]},{"x":501,"y":206,"cMask":[]},{"x":501,"y":214,"cMask":[]},{"x":501,"y":208,"cMask":[]},{"x":501,"y":212,"cMask":[]},{"x":501,"y":208,"cMask":[]},{"x":501,"y":212,"cMask":[]},{"x":-499,"y":-214,"cMask":[]},{"x":-499,"y":-206,"cMask":[]},{"x":-499,"y":-212,"cMask":[]},{"x":-499,"y":-208,"cMask":[]},{"x":-499,"y":-212,"cMask":[]},{"x":-499,"y":-208,"cMask":[]},{"x":-497,"y":207,"cMask":[]},{"x":-497,"y":215,"cMask":[]},{"x":-497,"y":209,"cMask":[]},{"x":-497,"y":213,"cMask":[]},{"x":-497,"y":209,"cMask":[]},{"x":-497,"y":213,"cMask":[]},{"x":0,"y":-2,"cMask":[]},{"x":0,"y":6,"cMask":[]},{"x":0,"y":0,"cMask":[]},{"x":0,"y":4,"cMask":[]},{"x":0,"y":0,"cMask":[]},{"x":0,"y":4,"cMask":[]},{"x":-757,"y":-90,"cMask":[]},{"x":-757,"y":110,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":107,"cMask":[]},{"x":-757,"y":-104,"cMask":[]},{"x":-757,"y":104,"cMask":[]},{"x":-757,"y":-101,"cMask":[]},{"x":-757,"y":101,"cMask":[]},{"x":-757,"y":-98,"cMask":[]},{"x":-757,"y":98,"cMask":[]},{"x":-757,"y":-95,"cMask":[]},{"x":-757,"y":95,"cMask":[]},{"x":-757,"y":-92,"cMask":[]},{"x":-757,"y":92,"cMask":[]},{"x":-757,"y":-89,"cMask":[]},{"x":757,"y":101.536516602,"cMask":[]},{"x":757,"y":-100.463423548,"cMask":[]},{"x":757,"y":98.5365174904,"cMask":[]},{"x":757,"y":-97.4634244364,"cMask":[]},{"x":757,"y":95.5365183793,"cMask":[]},{"x":757,"y":-94.4634253253,"cMask":[]},{"x":757,"y":92.5365192682,"cMask":[]},{"x":757,"y":-91.4634262142,"cMask":[]},{"x":757,"y":103,"cMask":[]},{"x":757,"y":-103,"cMask":[]},{"x":757,"y":106,"cMask":[]},{"x":757,"y":-106,"cMask":[]},{"x":757,"y":109,"cMask":[]},{"x":757,"y":-109,"cMask":[]},{"x":800,"y":-470,"bCoef":-1.2,"cMask":["ball"]},{"x":1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":-270,"bCoef":0,"cMask":["red","blue"]},{"x":-800,"y":-470,"bCoef":0.5,"cMask":["blue"]},{"x":-1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-757,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-790,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-757,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-790,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-810,"y":-70,"bCoef":0.7,"cMask":["red","blue"]},{"x":-810,"y":70,"bCoef":0.7,"cMask":["red","blue"]},{"x":757,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":790,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":757,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":790,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":810,"y":70,"bCoef":0.7,"cMask":["red","blue"]},{"x":810,"y":-70,"bCoef":0.7,"cMask":["red","blue"]},{"x":230,"y":-470,"cMask":[]},{"x":230,"y":470,"cMask":[]},{"x":-757,"y":109,"cMask":[]},{"x":-757,"y":-109,"cMask":[]},{"x":-1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"cMask":["ball"]},{"x":800,"y":470,"cMask":["ball"]},{"x":799,"y":-470,"bCoef":0.5,"cMask":["red"]},{"x":-750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":-750,"y":-550,"bCoef":0,"cMask":["red","blue"]},{"x":750,"y":-550,"bCoef":0,"cMask":["red","blue"]},{"x":-750,"y":470,"bCoef":0,"cMask":["ball"]},{"x":-750,"y":550,"bCoef":0,"cMask":["ball"]},{"x":750,"y":470,"bCoef":0,"cMask":["ball"]},{"x":750,"y":550,"bCoef":0,"cMask":["ball"]},{"x":-1001,"y":64,"bCoef":0,"cMask":["red","blue"]},{"x":-1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":-1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":-796,"y":-505,"bCoef":0,"cMask":["wall"]},{"x":-751,"y":-503,"bCoef":0,"cMask":["wall"]},{"x":750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":751,"y":-503,"bCoef":0,"cMask":["red","blue"]},{"x":796,"y":-505,"bCoef":0,"cMask":["wall"]},{"x":751,"y":-503,"bCoef":0,"cMask":["wall"]},{"x":1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":796,"y":-505,"bCoef":0,"cMask":["red","blue"]},{"x":1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":1001,"y":64,"bCoef":0,"cMask":["red","blue"]},{"x":1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":-744,"y":-475,"bCoef":-0.6,"cMask":["ball"]},{"x":743,"y":-474,"bCoef":-0.6,"cMask":["ball"]},{"x":-800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":-1007,"y":267,"bCoef":-0.6,"cMask":["ball"]},{"x":800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":267,"bCoef":-0.6,"cMask":["ball"]},{"x":-1007,"y":68,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":68,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":-266},{"x":1007,"y":-68},{"x":-1006,"y":-271,"bCoef":-0.6,"cMask":["ball"]},{"x":1006,"y":-271,"bCoef":-0.6,"cMask":["ball"]},{"x":-745,"y":478},{"x":745,"y":478},{"x":-15,"y":-485,"cMask":["ball"]},{"x":15,"y":-485,"cMask":["ball"]},{"x":-20,"y":485,"cMask":["ball"]},{"x":20,"y":485,"cMask":["ball"]},{"x":-25,"y":-485,"cMask":["ball"]},{"x":25,"y":-485,"cMask":["ball"]},{"x":-29,"y":483,"cMask":["ball"]},{"x":29,"y":483,"cMask":["ball"]},{"x":-55,"y":-485,"cMask":["ball"]},{"x":55,"y":-485,"cMask":["ball"]},{"x":-57,"y":483,"cMask":["ball"]},{"x":57,"y":483,"cMask":["ball"]},{"x":-55,"y":-525,"cMask":["ball"]},{"x":-25,"y":-525,"cMask":["ball"]},{"x":-15,"y":-525,"cMask":["ball"]},{"x":15,"y":-525,"cMask":["ball"]},{"x":25,"y":-525,"cMask":["ball"]},{"x":15,"y":-505,"cMask":["ball"]},{"x":-15,"y":-505,"cMask":["ball"]},{"x":65,"y":-485,"cMask":["ball"]},{"x":82,"y":-515,"cMask":["ball"]},{"x":65,"y":-500,"cMask":["ball"]},{"x":90,"y":-485,"cMask":["ball"]},{"x":90,"y":-515,"cMask":["ball"]},{"x":90,"y":-500,"cMask":["ball"]},{"x":115,"y":-485,"cMask":["ball"]},{"x":115,"y":-515,"cMask":["ball"]},{"x":115,"y":-500,"cMask":["ball"]},{"x":125,"y":-485,"cMask":["ball"]},{"x":85,"y":-485,"cMask":["ball"]},{"x":110,"y":-485,"cMask":["ball"]},{"x":110,"y":-500,"cMask":["ball"]},{"x":110,"y":-515,"cMask":["ball"]},{"x":85,"y":-500,"cMask":["ball"]},{"x":92,"y":-515,"cMask":["ball"]},{"x":91,"y":-516,"cMask":["ball"]},{"x":90,"y":-500,"cMask":["ball"]},{"x":115,"y":-485,"cMask":["ball"]},{"x":115,"y":-515,"cMask":["ball"]},{"x":115,"y":-500,"cMask":["ball"]},{"x":114,"y":-514,"cMask":["ball"]},{"x":114,"y":-500,"cMask":["ball"]},{"x":135,"y":-515,"cMask":["ball"]},{"x":135,"y":-485,"cMask":["ball"]}],"segments":[{"v0":2,"v1":3,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":4,"v1":5,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":6,"v1":7,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":4,"v1":0,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":2,"v1":5,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":7,"v1":3,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":1,"v1":6,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":8,"v1":9,"bCoef":-0.7,"cMask":["ball"]},{"v0":10,"v1":11,"bCoef":-0.7,"cMask":["ball"]},{"v0":12,"v1":13,"bCoef":-0.7,"cMask":["ball"]},{"v0":9,"v1":13,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":12,"v1":11,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":14,"v1":15,"cMask":[]},{"v0":16,"v1":17,"bCoef":-0.7,"cMask":["ball"]},{"v0":18,"v1":19,"bCoef":-0.7,"cMask":["ball"]},{"v0":20,"v1":21,"bCoef":-0.7,"cMask":["ball"]},{"v0":17,"v1":21,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":20,"v1":19,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":22,"v1":23,"cMask":[]},{"v0":24,"v1":25,"cMask":[]},{"v0":26,"v1":27,"cMask":[],"color":"818181"},{"v0":29,"v1":28,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":28,"v1":29,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":31,"v1":30,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":30,"v1":31,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":33,"v1":32,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":32,"v1":33,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":35,"v1":34,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":34,"v1":35,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":37,"v1":36,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":36,"v1":37,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":39,"v1":38,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":38,"v1":39,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":41,"v1":40,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":40,"v1":41,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":43,"v1":42,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":42,"v1":43,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":45,"v1":44,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":44,"v1":45,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":47,"v1":46,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":46,"v1":47,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":49,"v1":48,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":48,"v1":49,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":51,"v1":50,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":50,"v1":51,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":53,"v1":52,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":52,"v1":53,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":55,"v1":54,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":54,"v1":55,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":57,"v1":56,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":56,"v1":57,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":59,"v1":58,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":58,"v1":59,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":61,"v1":60,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":60,"v1":61,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":63,"v1":62,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":62,"v1":63,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":65,"v1":64,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":64,"v1":65,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":67,"v1":66,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":66,"v1":67,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":97,"v1":98,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":99,"v1":100,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":101,"v1":102,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":104,"v1":103,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":105,"v1":106,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":107,"v1":108,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":111,"v1":110,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":112,"v1":113,"bCoef":0,"cMask":["red","blue"]},{"v0":114,"v1":115,"bCoef":0,"cMask":["red","blue"]},{"v0":116,"v1":117,"bCoef":0,"cMask":["red","blue"]},{"v0":113,"v1":117,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":116,"v1":115,"bCoef":0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":118,"v1":119,"bCoef":0,"cMask":["red","blue"]},{"v0":120,"v1":121,"bCoef":0,"cMask":["red","blue"]},{"v0":122,"v1":123,"bCoef":0,"cMask":["red","blue"]},{"v0":119,"v1":123,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":122,"v1":121,"bCoef":0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":124,"v1":125,"cMask":[],"color":"818181"},{"v0":127,"v1":126,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":128,"v1":129,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":107,"v1":130,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":106,"v1":131,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":0,"v1":99,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":133,"v1":134,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":134,"v1":132,"bCoef":0.5,"cMask":["red"]},{"v0":110,"v1":133,"bCoef":0.5,"cMask":["blue"]},{"v0":141,"v1":142,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":142,"v1":143,"bCoef":0,"cMask":["red","blue"],"color":"818181"},{"v0":143,"v1":144,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":144,"v1":145,"bCoef":0,"cMask":["wall"]},{"v0":145,"v1":133,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":146,"v1":147,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":148,"v1":149,"bCoef":0,"cMask":["wall"]},{"v0":151,"v1":150,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":152,"v1":153,"bCoef":0,"cMask":["red","blue"],"color":"818181"},{"v0":155,"v1":154,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":156,"v1":157,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":158,"v1":159,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":158,"v1":160,"bCoef":-0.6,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"],"color":"818181"},{"v0":162,"v1":161,"bCoef":-0.6,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"],"color":"818181"},{"v0":160,"v1":163,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":162,"v1":164,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":163,"v1":167,"bCoef":-0.6,"vis":false,"cMask":["ball"],"color":"6400"},{"v0":164,"v1":168,"bCoef":-0.6,"vis":false,"cMask":["ball"],"color":"6400"},{"v0":167,"v1":156,"bCoef":-0.6,"curve":97,"curveF":0.8847252645559438,"vis":false,"cMask":["ball"],"color":"EEDD82"},{"v0":157,"v1":168,"bCoef":-0.6,"curve":95,"curveF":0.9163311740174233,"vis":false,"cMask":["ball"],"color":"818181"},{"v0":183,"v1":179,"color":"818181"},{"v0":183,"v1":175,"color":"818181"},{"v0":175,"v1":184,"color":"818181"},{"v0":185,"v1":171,"cMask":["ball"],"color":"818181"},{"v0":186,"v1":172,"cMask":["ball"],"color":"818181"},{"v0":176,"v1":180,"cMask":["ball"],"color":"818181"},{"v0":189,"v1":188,"cMask":["ball"],"color":"818181"},{"v0":187,"v1":176,"cMask":["ball"],"color":"818181"},{"v0":212,"v1":207,"curve":-127.73255306091939,"curveF":-0.4906249999999997,"cMask":["ball"]},{"v0":207,"v1":205,"cMask":["ball"]},{"v0":212,"v1":211,"cMask":["ball"]},{"v0":190,"v1":191,"curve":161.76427449240842,"curveF":0.16049382716049404,"cMask":["ball"]},{"v0":190,"v1":200,"cMask":["ball"]}],"planes":[{"normal":[0,1],"dist":-470,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0,-1],"dist":-472,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0,-1],"dist":-549,"bCoef":-0.6,"cMask":["ball"]},{"normal":[0,1],"dist":-547,"bCoef":-0.6,"cMask":["ball"]},{"normal":[0.9999016213403011,-0.014026676050904224],"dist":-998.098191562,"bCoef":-1.2,"cMask":["ball"]},{"normal":[-1,0],"dist":-1039,"bCoef":-0.6,"cMask":["ball"]},{"normal":[1,0],"dist":-1039,"bCoef":-0.6,"cMask":["ball"]},{"normal":[-1,0],"dist":-1001,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0.7071067811865476,0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[-0.7071067811865476,0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[-0.7071067811865476,-0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[0.7071067811865476,-0.7071067811865476],"dist":-960,"cMask":["ball"]}],"goals":[{"p0":[-767,95],"p1":[-767,-95],"team":"red"},{"p0":[767,97],"p1":[767,-97],"team":"blue"}],"discs":[{"radius":6.5,"bCoef":-0.5,"invMass":1.5,"damping":0.996,"color":"0","cGroup":["ball","kick","score"]},{"pos":[-760,-97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[-760,97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[760,97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[760,-97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[-760,-97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[-760,97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[760,97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[760,-97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]}],"playerPhysics":{"bCoef":1,"damping":0.982,"acceleration":0.079,"kickingDamping":0.974,"kickStrength":3.5},"ballPhysics":"disc0","spawnDistance":170}'; // Insert your map for 1v1 and 2v2 here. To get minimum file size, here are the instructions : 1. Download the map 2. Go to https://cssminifier.com 3. Paste the result var bigMap = '{"name":"NHL - Oficial","width":1040,"height":550,"bg":{"type":"hockey","width":1000,"height":470,"cornerRadius":200},"vertexes":[{"x":-800,"y":-470,"bCoef":-1.4,"cMask":["ball"]},{"x":800,"y":-470,"bCoef":0.5,"cMask":["red"]},{"x":-800,"y":470,"bCoef":-1.4,"cMask":["ball"]},{"x":800,"y":470,"bCoef":-1.4,"cMask":["ball"]},{"x":-1000,"y":-270,"bCoef":-1.4,"cMask":["ball"]},{"x":-1000,"y":270,"bCoef":-1.4,"cMask":["ball"]},{"x":1000,"y":-270,"bCoef":-1.4,"cMask":["ball"]},{"x":1000,"y":270,"bCoef":-1.4,"cMask":["ball"]},{"x":-757,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":-790,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":-757,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":-790,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":-810,"y":-70,"bCoef":-0.7,"cMask":["ball"]},{"x":-810,"y":70,"bCoef":-0.7,"cMask":["ball"]},{"x":-760,"y":-467,"cMask":[]},{"x":-760,"y":467,"cMask":[]},{"x":757,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":790,"y":-97,"bCoef":-0.7,"cMask":["ball"]},{"x":757,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":790,"y":97,"bCoef":-0.7,"cMask":["ball"]},{"x":810,"y":70,"bCoef":-0.7,"cMask":["ball"]},{"x":810,"y":-70,"bCoef":-0.7,"cMask":["ball"]},{"x":760,"y":-467,"cMask":[]},{"x":760,"y":467,"cMask":[]},{"x":0,"y":-470,"cMask":[]},{"x":0,"y":470,"cMask":[]},{"x":-230,"y":-470,"cMask":[]},{"x":-230,"y":470,"cMask":[]},{"x":0,"y":-130,"cMask":[]},{"x":0,"y":130,"cMask":[]},{"x":-500,"y":80,"cMask":[]},{"x":-500,"y":340,"cMask":[]},{"x":500,"y":-340,"cMask":[]},{"x":500,"y":-80,"cMask":[]},{"x":500,"y":80,"cMask":[]},{"x":500,"y":340,"cMask":[]},{"x":-500,"y":-340,"cMask":[]},{"x":-500,"y":-80,"cMask":[]},{"x":500,"y":-214,"cMask":[]},{"x":500,"y":-206,"cMask":[]},{"x":500,"y":-212,"cMask":[]},{"x":500,"y":-208,"cMask":[]},{"x":500,"y":-212,"cMask":[]},{"x":500,"y":-208,"cMask":[]},{"x":501,"y":206,"cMask":[]},{"x":501,"y":214,"cMask":[]},{"x":501,"y":208,"cMask":[]},{"x":501,"y":212,"cMask":[]},{"x":501,"y":208,"cMask":[]},{"x":501,"y":212,"cMask":[]},{"x":-499,"y":-214,"cMask":[]},{"x":-499,"y":-206,"cMask":[]},{"x":-499,"y":-212,"cMask":[]},{"x":-499,"y":-208,"cMask":[]},{"x":-499,"y":-212,"cMask":[]},{"x":-499,"y":-208,"cMask":[]},{"x":-497,"y":207,"cMask":[]},{"x":-497,"y":215,"cMask":[]},{"x":-497,"y":209,"cMask":[]},{"x":-497,"y":213,"cMask":[]},{"x":-497,"y":209,"cMask":[]},{"x":-497,"y":213,"cMask":[]},{"x":0,"y":-2,"cMask":[]},{"x":0,"y":6,"cMask":[]},{"x":0,"y":0,"cMask":[]},{"x":0,"y":4,"cMask":[]},{"x":0,"y":0,"cMask":[]},{"x":0,"y":4,"cMask":[]},{"x":-757,"y":-90,"cMask":[]},{"x":-757,"y":110,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":-107,"cMask":[]},{"x":-757,"y":107,"cMask":[]},{"x":-757,"y":-104,"cMask":[]},{"x":-757,"y":104,"cMask":[]},{"x":-757,"y":-101,"cMask":[]},{"x":-757,"y":101,"cMask":[]},{"x":-757,"y":-98,"cMask":[]},{"x":-757,"y":98,"cMask":[]},{"x":-757,"y":-95,"cMask":[]},{"x":-757,"y":95,"cMask":[]},{"x":-757,"y":-92,"cMask":[]},{"x":-757,"y":92,"cMask":[]},{"x":-757,"y":-89,"cMask":[]},{"x":757,"y":101.536516602,"cMask":[]},{"x":757,"y":-100.463423548,"cMask":[]},{"x":757,"y":98.5365174904,"cMask":[]},{"x":757,"y":-97.4634244364,"cMask":[]},{"x":757,"y":95.5365183793,"cMask":[]},{"x":757,"y":-94.4634253253,"cMask":[]},{"x":757,"y":92.5365192682,"cMask":[]},{"x":757,"y":-91.4634262142,"cMask":[]},{"x":757,"y":103,"cMask":[]},{"x":757,"y":-103,"cMask":[]},{"x":757,"y":106,"cMask":[]},{"x":757,"y":-106,"cMask":[]},{"x":757,"y":109,"cMask":[]},{"x":757,"y":-109,"cMask":[]},{"x":800,"y":-470,"bCoef":-1.2,"cMask":["ball"]},{"x":1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":-270,"bCoef":0,"cMask":["red","blue"]},{"x":-800,"y":-470,"bCoef":0.5,"cMask":["blue"]},{"x":-1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-757,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-790,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-757,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-790,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":-810,"y":-70,"bCoef":0.7,"cMask":["red","blue"]},{"x":-810,"y":70,"bCoef":0.7,"cMask":["red","blue"]},{"x":757,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":790,"y":-97,"bCoef":0.7,"cMask":["red","blue"]},{"x":757,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":790,"y":97,"bCoef":0.7,"cMask":["red","blue"]},{"x":810,"y":70,"bCoef":0.7,"cMask":["red","blue"]},{"x":810,"y":-70,"bCoef":0.7,"cMask":["red","blue"]},{"x":230,"y":-470,"cMask":[]},{"x":230,"y":470,"cMask":[]},{"x":-757,"y":109,"cMask":[]},{"x":-757,"y":-109,"cMask":[]},{"x":-1000,"y":-270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-1000,"y":270,"bCoef":0.5,"cMask":["red","blue"]},{"x":-800,"y":470,"cMask":["ball"]},{"x":800,"y":470,"cMask":["ball"]},{"x":799,"y":-470,"bCoef":0.5,"cMask":["red"]},{"x":-750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":-750,"y":-550,"bCoef":0,"cMask":["red","blue"]},{"x":750,"y":-550,"bCoef":0,"cMask":["red","blue"]},{"x":-750,"y":470,"bCoef":0,"cMask":["ball"]},{"x":-750,"y":550,"bCoef":0,"cMask":["ball"]},{"x":750,"y":470,"bCoef":0,"cMask":["ball"]},{"x":750,"y":550,"bCoef":0,"cMask":["ball"]},{"x":-1001,"y":64,"bCoef":0,"cMask":["red","blue"]},{"x":-1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":-1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":-796,"y":-505,"bCoef":0,"cMask":["wall"]},{"x":-751,"y":-503,"bCoef":0,"cMask":["wall"]},{"x":750,"y":-470,"bCoef":0,"cMask":["red","blue"]},{"x":751,"y":-503,"bCoef":0,"cMask":["red","blue"]},{"x":796,"y":-505,"bCoef":0,"cMask":["wall"]},{"x":751,"y":-503,"bCoef":0,"cMask":["wall"]},{"x":1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":796,"y":-505,"bCoef":0,"cMask":["red","blue"]},{"x":1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":1040,"y":-273,"bCoef":0,"cMask":["red","blue"]},{"x":1001,"y":64,"bCoef":0,"cMask":["red","blue"]},{"x":1042,"y":61,"bCoef":0,"cMask":["red","blue"]},{"x":-744,"y":-475,"bCoef":-0.6,"cMask":["ball"]},{"x":743,"y":-474,"bCoef":-0.6,"cMask":["ball"]},{"x":-800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":-1007,"y":267,"bCoef":-0.6,"cMask":["ball"]},{"x":800,"y":475,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":267,"bCoef":-0.6,"cMask":["ball"]},{"x":-1007,"y":68,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":68,"bCoef":-0.6,"cMask":["ball"]},{"x":1007,"y":-266},{"x":1007,"y":-68},{"x":-1006,"y":-271,"bCoef":-0.6,"cMask":["ball"]},{"x":1006,"y":-271,"bCoef":-0.6,"cMask":["ball"]},{"x":-745,"y":478},{"x":745,"y":478},{"x":-15,"y":-485,"cMask":["ball"]},{"x":15,"y":-485,"cMask":["ball"]},{"x":-20,"y":485,"cMask":["ball"]},{"x":20,"y":485,"cMask":["ball"]},{"x":-25,"y":-485,"cMask":["ball"]},{"x":25,"y":-485,"cMask":["ball"]},{"x":-29,"y":483,"cMask":["ball"]},{"x":29,"y":483,"cMask":["ball"]},{"x":-55,"y":-485,"cMask":["ball"]},{"x":55,"y":-485,"cMask":["ball"]},{"x":-57,"y":483,"cMask":["ball"]},{"x":57,"y":483,"cMask":["ball"]},{"x":-55,"y":-525,"cMask":["ball"]},{"x":-25,"y":-525,"cMask":["ball"]},{"x":-15,"y":-525,"cMask":["ball"]},{"x":15,"y":-525,"cMask":["ball"]},{"x":25,"y":-525,"cMask":["ball"]},{"x":15,"y":-505,"cMask":["ball"]},{"x":-15,"y":-505,"cMask":["ball"]},{"x":65,"y":-485,"cMask":["ball"]},{"x":82,"y":-515,"cMask":["ball"]},{"x":65,"y":-500,"cMask":["ball"]},{"x":90,"y":-485,"cMask":["ball"]},{"x":90,"y":-515,"cMask":["ball"]},{"x":90,"y":-500,"cMask":["ball"]},{"x":115,"y":-485,"cMask":["ball"]},{"x":115,"y":-515,"cMask":["ball"]},{"x":115,"y":-500,"cMask":["ball"]},{"x":125,"y":-485,"cMask":["ball"]},{"x":85,"y":-485,"cMask":["ball"]},{"x":110,"y":-485,"cMask":["ball"]},{"x":110,"y":-500,"cMask":["ball"]},{"x":110,"y":-515,"cMask":["ball"]},{"x":85,"y":-500,"cMask":["ball"]},{"x":92,"y":-515,"cMask":["ball"]},{"x":91,"y":-516,"cMask":["ball"]},{"x":90,"y":-500,"cMask":["ball"]},{"x":115,"y":-485,"cMask":["ball"]},{"x":115,"y":-515,"cMask":["ball"]},{"x":115,"y":-500,"cMask":["ball"]},{"x":114,"y":-514,"cMask":["ball"]},{"x":114,"y":-500,"cMask":["ball"]},{"x":135,"y":-515,"cMask":["ball"]},{"x":135,"y":-485,"cMask":["ball"]}],"segments":[{"v0":2,"v1":3,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":4,"v1":5,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":6,"v1":7,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":4,"v1":0,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":2,"v1":5,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":7,"v1":3,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":1,"v1":6,"bCoef":-1.2,"curve":89.99999999999999,"curveF":1.0000000000000002,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":8,"v1":9,"bCoef":-0.7,"cMask":["ball"]},{"v0":10,"v1":11,"bCoef":-0.7,"cMask":["ball"]},{"v0":12,"v1":13,"bCoef":-0.7,"cMask":["ball"]},{"v0":9,"v1":13,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":12,"v1":11,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":14,"v1":15,"cMask":[]},{"v0":16,"v1":17,"bCoef":-0.7,"cMask":["ball"]},{"v0":18,"v1":19,"bCoef":-0.7,"cMask":["ball"]},{"v0":20,"v1":21,"bCoef":-0.7,"cMask":["ball"]},{"v0":17,"v1":21,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":20,"v1":19,"bCoef":-0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"]},{"v0":22,"v1":23,"cMask":[]},{"v0":24,"v1":25,"cMask":[]},{"v0":26,"v1":27,"cMask":[],"color":"818181"},{"v0":29,"v1":28,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":28,"v1":29,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":31,"v1":30,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":30,"v1":31,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":33,"v1":32,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":32,"v1":33,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":35,"v1":34,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":34,"v1":35,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":37,"v1":36,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":36,"v1":37,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":39,"v1":38,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":38,"v1":39,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":41,"v1":40,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":40,"v1":41,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":43,"v1":42,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":42,"v1":43,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":45,"v1":44,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":44,"v1":45,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":47,"v1":46,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":46,"v1":47,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":49,"v1":48,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":48,"v1":49,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":51,"v1":50,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":50,"v1":51,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":53,"v1":52,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":52,"v1":53,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":55,"v1":54,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":54,"v1":55,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":57,"v1":56,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":56,"v1":57,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":59,"v1":58,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":58,"v1":59,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":61,"v1":60,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":60,"v1":61,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":63,"v1":62,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":62,"v1":63,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":65,"v1":64,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":64,"v1":65,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":67,"v1":66,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":66,"v1":67,"curve":180,"curveF":6.123233995736766e-17,"cMask":[],"color":"818181"},{"v0":97,"v1":98,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":99,"v1":100,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":101,"v1":102,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":104,"v1":103,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":105,"v1":106,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":107,"v1":108,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":111,"v1":110,"bCoef":0.5,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":112,"v1":113,"bCoef":0,"cMask":["red","blue"]},{"v0":114,"v1":115,"bCoef":0,"cMask":["red","blue"]},{"v0":116,"v1":117,"bCoef":0,"cMask":["red","blue"]},{"v0":113,"v1":117,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":116,"v1":115,"bCoef":0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":118,"v1":119,"bCoef":0,"cMask":["red","blue"]},{"v0":120,"v1":121,"bCoef":0,"cMask":["red","blue"]},{"v0":122,"v1":123,"bCoef":0,"cMask":["red","blue"]},{"v0":119,"v1":123,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":122,"v1":121,"bCoef":0.7,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"]},{"v0":124,"v1":125,"cMask":[],"color":"818181"},{"v0":127,"v1":126,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":128,"v1":129,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":107,"v1":130,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":106,"v1":131,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":0,"v1":99,"bCoef":-1.2,"vis":false,"cMask":["ball"],"color":"FF0000"},{"v0":133,"v1":134,"bCoef":0.5,"cMask":["red","blue"],"color":"818181"},{"v0":134,"v1":132,"bCoef":0.5,"cMask":["red"]},{"v0":110,"v1":133,"bCoef":0.5,"cMask":["blue"]},{"v0":141,"v1":142,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":142,"v1":143,"bCoef":0,"cMask":["red","blue"],"color":"818181"},{"v0":143,"v1":144,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":144,"v1":145,"bCoef":0,"cMask":["wall"]},{"v0":145,"v1":133,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":146,"v1":147,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":148,"v1":149,"bCoef":0,"cMask":["wall"]},{"v0":151,"v1":150,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":152,"v1":153,"bCoef":0,"cMask":["red","blue"],"color":"818181"},{"v0":155,"v1":154,"bCoef":0,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["red","blue"],"color":"818181"},{"v0":156,"v1":157,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":158,"v1":159,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":158,"v1":160,"bCoef":-0.6,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"],"color":"818181"},{"v0":162,"v1":161,"bCoef":-0.6,"curve":89.99999999999999,"curveF":1.0000000000000002,"cMask":["ball"],"color":"818181"},{"v0":160,"v1":163,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":162,"v1":164,"bCoef":-0.6,"cMask":["ball"],"color":"818181"},{"v0":163,"v1":167,"bCoef":-0.6,"vis":false,"cMask":["ball"],"color":"6400"},{"v0":164,"v1":168,"bCoef":-0.6,"vis":false,"cMask":["ball"],"color":"6400"},{"v0":167,"v1":156,"bCoef":-0.6,"curve":97,"curveF":0.8847252645559438,"vis":false,"cMask":["ball"],"color":"EEDD82"},{"v0":157,"v1":168,"bCoef":-0.6,"curve":95,"curveF":0.9163311740174233,"vis":false,"cMask":["ball"],"color":"818181"},{"v0":183,"v1":179,"color":"818181"},{"v0":183,"v1":175,"color":"818181"},{"v0":175,"v1":184,"color":"818181"},{"v0":185,"v1":171,"cMask":["ball"],"color":"818181"},{"v0":186,"v1":172,"cMask":["ball"],"color":"818181"},{"v0":176,"v1":180,"cMask":["ball"],"color":"818181"},{"v0":189,"v1":188,"cMask":["ball"],"color":"818181"},{"v0":187,"v1":176,"cMask":["ball"],"color":"818181"},{"v0":212,"v1":207,"curve":-127.73255306091939,"curveF":-0.4906249999999997,"cMask":["ball"]},{"v0":207,"v1":205,"cMask":["ball"]},{"v0":212,"v1":211,"cMask":["ball"]},{"v0":190,"v1":191,"curve":161.76427449240842,"curveF":0.16049382716049404,"cMask":["ball"]},{"v0":190,"v1":200,"cMask":["ball"]}],"planes":[{"normal":[0,1],"dist":-470,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0,-1],"dist":-472,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0,-1],"dist":-549,"bCoef":-0.6,"cMask":["ball"]},{"normal":[0,1],"dist":-547,"bCoef":-0.6,"cMask":["ball"]},{"normal":[0.9999016213403011,-0.014026676050904224],"dist":-998.098191562,"bCoef":-1.2,"cMask":["ball"]},{"normal":[-1,0],"dist":-1039,"bCoef":-0.6,"cMask":["ball"]},{"normal":[1,0],"dist":-1039,"bCoef":-0.6,"cMask":["ball"]},{"normal":[-1,0],"dist":-1001,"bCoef":-1.2,"cMask":["ball"]},{"normal":[0.7071067811865476,0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[-0.7071067811865476,0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[-0.7071067811865476,-0.7071067811865476],"dist":-960,"cMask":["ball"]},{"normal":[0.7071067811865476,-0.7071067811865476],"dist":-960,"cMask":["ball"]}],"goals":[{"p0":[-767,95],"p1":[-767,-95],"team":"red"},{"p0":[767,97],"p1":[767,-97],"team":"blue"}],"discs":[{"radius":6.5,"bCoef":-0.5,"invMass":1.5,"damping":0.996,"color":"0","cGroup":["ball","kick","score"]},{"pos":[-760,-97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[-760,97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[760,97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[760,-97],"radius":6,"bCoef":-0.7,"invMass":0,"color":"C0C0C0","cMask":["ball"]},{"pos":[-760,-97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[-760,97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[760,97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]},{"pos":[760,-97],"radius":6,"bCoef":0.7,"invMass":0,"color":"C0C0C0","cMask":["red","blue"]}],"playerPhysics":{"bCoef":1,"damping":0.982,"acceleration":0.079,"kickingDamping":0.974,"kickStrength":3.5},"ballPhysics":"disc0","spawnDistance":170}'// Read above /* OPTIONS */ var afkLimit = 12; var drawTimeLimit = Infinity; var maxTeamSize = 3; var slowMode = 0; /* PLAYERS */ const Team = { SPECTATORS: 0, RED: 1, BLUE: 2 }; var extendedP = []; const eP = { ID: 0, AUTH: 1, CONN: 2, AFK: 3, ACT: 4, GK: 5, MUTE: 6 }; const Ss = { GA: 0, WI: 1, DR: 2, LS: 3, WR: 4, GL: 5, AS: 6, GK: 7, CS: 8, CP: 9, RL: 10, NK: 11} var players; var teamR; var teamB; var teamS; /* GAME */ var lastTeamTouched; var lastPlayersTouched; // These allow to get good goal notifications (it should be lastPlayersKicked, waiting on a next update to get better track of shots on target) var countAFK = false; // Created to get better track of activity var activePlay = false; // Created to get better track of the possession var goldenGoal = false; var SMSet = new Set(); // Set created to get slow mode which is useful in chooseMode var banList = []; // Getting track of the bans, so we can unban ppl if we want /* STATS */ var game; var GKList = ["",""]; var Rposs = 0; var Bposs = 0; var point = [{"x": 0, "y": 0}, {"x": 0, "y": 0}]; // created to get ball speed var ballSpeed; var lastWinner = Team.SPECTATORS; var streak = 0; var allBlues = []; // This is to count the players who should be counted for the stats. This includes players who left after the game has started, doesn't include those who came too late or ... var allReds = []; // ... those who came in a very unequal game. /* BALANCE & CHOOSE */ var inChooseMode = false; // This variable enables to distinguish the 2 phases of playing and choosing which should be dealt with very differently var redCaptainChoice = ""; var blueCaptainChoice = ""; var chooseTime = 20; var timeOutCap; /* AUXILIARY */ var checkTimeVariable = false; // This is created so the chat doesn't get spammed when a game is ending via timeLimit var statNumber = 0; // This allows the room to be given stat information every X minutes var endGameVariable = false; // This variable with the one below helps distinguish the cases where games are stopped because they have finished to the ones where games are stopped due to player movements or resetting teams var resettingTeams = false; var capLeft = false; var statInterval = 6; loadMap(aloneMap, 0, 0); /* OBJECTS */ function Goal(time, team, striker, assist) { this.time = time; this.team = team; this.striker = striker; this.assist = assist; } function Game(date, scores, goals) { this.date = date; this.scores = scores; this.goals = goals; } /* FUNCTIONS */ /* AUXILIARY FUNCTIONS */ function getRandomInt(max) { // returns a random number from 0 to max-1 return Math.floor(Math.random() * Math.floor(max)); } function getTime(scores) { // returns the current time of the game return "[" + Math.floor(Math.floor(scores.time/60)/10).toString() + Math.floor(Math.floor(scores.time/60)%10).toString() + ":" + Math.floor(Math.floor(scores.time - (Math.floor(scores.time/60) * 60))/10).toString() + Math.floor(Math.floor(scores.time - (Math.floor(scores.time/60) * 60))%10).toString() + "]" } function pointDistance(p1, p2) { var d1 = p1.x - p2.x; var d2 = p1.y - p2.y; return Math.sqrt(d1 * d1 + d2 * d2); } /* BUTTONS */ function topBtn() { if (teamS.length == 0) { return; } else { if (teamR.length == teamB.length) { if (teamS.length > 1) { room.setPlayerTeam(teamS[0].id, Team.RED); room.setPlayerTeam(teamS[1].id, Team.BLUE); } return; } else if (teamR.length < teamB.length) { room.setPlayerTeam(teamS[0].id, Team.RED); } else { room.setPlayerTeam(teamS[0].id, Team.BLUE); } } } function randomBtn() { if (teamS.length == 0) { return; } else { if (teamR.length == teamB.length) { if (teamS.length > 1) { var r = getRandomInt(teamS.length); room.setPlayerTeam(teamS[r].id, Team.RED); teamS = teamS.filter((spec) => spec.id != teamS[r].id); room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE); } return; } else if (teamR.length < teamB.length) { room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.RED); } else { room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE); } } } function blueToSpecBtn() { resettingTeams = true; setTimeout(() => { resettingTeams = false; }, 100); for (var i = 0; i < teamB.length; i++) { room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS); } } function redToSpecBtn() { resettingTeams = true; setTimeout(() => { resettingTeams = false; }, 100); for (var i = 0; i < teamR.length; i++) { room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS); } } function resetBtn() { resettingTeams = true; setTimeout(() => { resettingTeams = false; }, 100); if (teamR.length <= teamB.length) { for (var i = 0; i < teamR.length; i++) { room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS); room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS); } for (var i = teamR.length; i < teamB.length; i++) { room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS); } } else { for (var i = 0; i < teamB.length; i++) { room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS); room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS); } for (var i = teamB.length; i < teamR.length; i++) { room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS); } } } function blueToRedBtn() { resettingTeams = true; setTimeout(() => { resettingTeams = false; }, 100); for (var i = 0; i < teamB.length; i++) { room.setPlayerTeam(teamB[i].id, Team.RED); } } /* GAME FUNCTIONS */ function checkTime() { const scores = room.getScores(); game.scores = scores; if (Math.abs(scores.time - scores.timeLimit) <= 0.01 && scores.timeLimit != 0) { if (scores.red != scores.blue) { if (checkTimeVariable == false) { checkTimeVariable = true; setTimeout(() => { checkTimeVariable = false; }, 3000); scores.red > scores.blue ? endGame(Team.RED) : endGame(Team.BLUE); setTimeout(() => { room.stopGame(); }, 2000); } return; } goldenGoal = true; room.sendAnnouncement("вљЅ Gol gana !",null); } if (Math.abs(drawTimeLimit * 60 - scores.time - 60) <= 0.01 && players.length > 2) { if (checkTimeVariable == false) { checkTimeVariable = true; setTimeout(() => { checkTimeVariable = false; }, 10); room.sendAnnouncement("вЊ› Quedan 60 segundos para que termine el partido !"); } } if (Math.abs(scores.time - drawTimeLimit * 60) <= 0.01 && players.length > 2) { if (checkTimeVariable == false) { checkTimeVariable = true; setTimeout(() => { checkTimeVariable = false; }, 10); endGame(Team.SPECTATORS); room.stopGame(); goldenGoal = false; } } } function changePlayer(player,message){ message = message.split(" "); if (teamR.length != 0 && teamB.length != 0 && inChooseMode) { if (player.id == teamR[0].id || player.id == teamB[0].id) { // we care if it's one of the captains choosing if (teamR.length <= teamB.length && player.id == teamR[0].id) { // we care if it's red turn && red cap talking if (["top", "auto"].includes(message[0].toLowerCase())) { room.setPlayerTeam(teamS[0].id, Team.RED); redCaptainChoice = "top"; clearTimeout(timeOutCap); room.sendAnnouncement(player.name + " elegiste Top !"); return false; } else if (["random", "rand"].includes(message[0].toLowerCase())) { var r = getRandomInt(teamS.length); room.setPlayerTeam(teamS[r].id, Team.RED); redCaptainChoice = "random"; clearTimeout(timeOutCap); room.sendAnnouncement(player.name + " elegiste Random !"); return false; } else if (["bottom", "bot"].includes(message[0].toLowerCase())) { room.setPlayerTeam(teamS[teamS.length - 1].id, Team.RED); redCaptainChoice = "bottom"; clearTimeout(timeOutCap); room.sendAnnouncement(player.name + " elegiste Bottom !"); return false; } else if (!Number.isNaN(Number.parseInt(message[0]))) { if (Number.parseInt(message[0]) > teamS.length || Number.parseInt(message[0]) < 1) { room.sendAnnouncement("[PV] El nГєmero que elegiste es invГЎlido !", player.id,0xF64444); return false; } else { room.setPlayerTeam(teamS[Number.parseInt(message[0]) - 1].id, Team.RED); room.sendAnnouncement(player.name + " eligiГі a " + teamS[Number.parseInt(message[0]) - 1].name + " !"); return false; } } } if (teamR.length > teamB.length && player.id == teamB[0].id) { // we care if it's red turn && red cap talking if (["top", "auto"].includes(message[0].toLowerCase())) { room.setPlayerTeam(teamS[0].id, Team.BLUE); blueCaptainChoice = "top"; clearTimeout(timeOutCap); room.sendAnnouncement(player.name + " seleccionГі Top !"); return false; } else if (["random", "rand"].includes(message[0].toLowerCase())) { room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE); blueCaptainChoice = "random"; clearTimeout(timeOutCap); room.sendAnnouncement(player.name + " seleccionГі Random !"); return false; } else if (["bottom", "bot"].includes(message[0].toLowerCase())) { room.setPlayerTeam(teamS[teamS.length - 1].id, Team.BLUE); blueCaptainChoice = "bottom"; clearTimeout(timeOutCap); room.sendAnnouncement(player.name + " seleccionГі Bottom !"); return false; } else if (!Number.isNaN(Number.parseInt(message[0]))) { if (Number.parseInt(message[0]) > teamS.length || Number.parseInt(message[0]) < 1) { room.sendAnnouncement("[PV] El nГєmero que elegiste es invГЎlido !", player.id,0xF64444); return false; } else { room.setPlayerTeam(teamS[Number.parseInt(message[0]) - 1].id, Team.BLUE); room.sendAnnouncement(player.name + " eligiГі " + teamS[Number.parseInt(message[0]) - 1].name + " !"); return false; } } } } } return false; } function endGame(winner) { // handles the end of a game : no stopGame function inside players.length >= 2 * maxTeamSize - 1 ? activateChooseMode() : null; const scores = room.getScores(); game.scores = scores; Rposs = Rposs/(Rposs+Bposs); Bposs = 1 - Rposs; lastWinner = winner; endGameVariable = true; if (winner == Team.RED) { streak++; room.sendAnnouncement("🔴 El Red Team ganГі " + scores.red + "-" + scores.blue + " ! Victorias consecutivas : " + streak + " рџЏ†"); } else if (winner == Team.BLUE) { streak = 1; room.sendAnnouncement("рџ”µ El Blue Team ganГі " + scores.blue + "-" + scores.red + " ! Victorias consecutivas : " + streak + " рџЏ†"); } else { streak = 0; room.sendAnnouncement("рџ’¤ LГ­mite de empate, terminado! рџ’¤"); } room.sendAnnouncement("в­ђ PosesiГіn del balГіn : 🔴 " + (Rposs*100).toPrecision(3).toString() + "% : " + (Bposs*100).toPrecision(3).toString() + "% рџ”µ"); scores.red == 0 ? (scores.blue == 0 ? room.sendAnnouncement("рџЏ† " + GKList[0].name + " y " + GKList[1].name + " mantuvieron la valla invicta ! ") : room.sendAnnouncement("рџЏ† " + GKList[1].name + " mantuvo la valla invicta ! ")) : scores.blue == 0 ? room.sendAnnouncement("рџЏ† " + GKList[0].name + " mantuvo la valla invicta ! ") : null; updateStats(); } function quickRestart() { room.stopGame(); setTimeout(() => { room.startGame(); }, 2000); } function resumeGame() { setTimeout(() => { room.startGame(); }, 2000); setTimeout(() => { room.pauseGame(false); }, 1000); } function activateChooseMode() { inChooseMode = true; slowMode = 2; room.sendAnnouncement("[вљ ] Modo lento activado (2 segundos)!"); } function deactivateChooseMode() { inChooseMode = false; clearTimeout(timeOutCap); if (slowMode != 0) { slowMode = 0; room.sendAnnouncement("[вљ ] Modo lento terminado."); } redCaptainChoice = ""; blueCaptainChoice = ""; } function loadMap(map, scoreLim, timeLim) { if (map == aloneMap) { room.setCustomStadium(aloneMap); } else if (map == classicMap) { (classicMap != '') ? room.setCustomStadium(classicMap) : room.setDefaultStadium("Classic"); } else if (map == bigMap) { (bigMap != '.') ? room.setCustomStadium(bigMap) : room.setDefaultStadium("Big"); } else { room.setCustomStadium(map); } room.setScoreLimit(scoreLim); room.setTimeLimit(timeLim); } /* PLAYER CHAT FUNCTIONS */ function nv(player,message){ room.kickPlayer(player.id, "рџ‘‹ Bye !", false); } function clearBans(player,message){ message = message.split(" "); if (player.admin) { if (message.length == 1) { room.clearBans(); room.sendAnnouncement("[вљ ] Bans removidos!"); banList = []; } if (message.length == 2) { if (!Number.isNaN(Number.parseInt(message[1]))) { if (Number.parseInt(message[1]) > 0) { ID = Number.parseInt(message[1]); room.clearBan(ID); if (banList.length != banList.filter((array) => array[1] != ID)) { room.sendAnnouncement(banList.filter((array) => array[1] == ID)[0][0] + " ha sido baneado del host !"); } setTimeout(() => { banList = banList.filter((array) => array[1] != ID); }, 20); } } } } } function showBans(player,message){ message = message.split(" "); if (banList.length == 0) { room.sendAnnouncement("[вљ ] No hay nadie en la lista de baneados!", player.id,0x73EC59); return false; } var cstm = "[PV] Lista de baneados : "; for (var i = 0; i < banList.length; i++) { if (140 - cstm.length < (banList[i][0] + "[" + (banList[i][1]) + "], ").length) { room.sendAnnouncement(cstm, player.id); cstm = "... "; } cstm += banList[i][0] + "[" + (banList[i][1]) + "], "; } cstm = cstm.substring(0, cstm.length - 2); cstm += "."; room.sendAnnouncement(cstm, player.id); return false; } function endSlow(player,message){ message = message.split(" "); if (player.admin) { slowMode != 0 ? room.sendAnnouncement("[вљ ] Modo lento terminado.") : null; slowMode = 0; } return false; } function slow(player,message){ message = message.split(" "); if (player.admin) { if (message.length == 1) { slowMode = 2; room.sendAnnouncement("[вљ ] Modo lento activado (2 segundos)!",null,0x73EC59); } else if (message.length == 2) { try{ if (!Number.isNaN(Number.parseInt(message[1]) && parseInt(message[1]))<60) { if (Number.parseInt(message[1]) > 0) { slowMode = Number.parseInt(message[1]); room.sendAnnouncement(slowMode + " segundos, modo lento activado !",null,0x73EC59); return false; } } } catch{ } slowMode = 2; room.sendAnnouncement("Modo lento activado (2 segundos)!"); } } return false; } function showHelp(player,message){ message = message.split(" "); room.sendAnnouncement("[рџ“„] Comandos Normales: !creditos !me, !games, !wins, !goals, !assists, !cs, !afks, !mutes, !bans.",player.id,0x73EC59); player.admin ? room.sendAnnouncement("[PV] Admin : !mute <duration = 3> #<id>, !unmute all/#<id>, !clearbans <number = all>, !slow <duration>, !endslow", player.id,0x73EC59) : null; return false; } function mostrarCreditos(player,message){ message = message.split(" "); room.sendAnnouncement("[рџ“—] Discord de Futsal League x4: https://discord.gg/BR79Mpzgej", player.id,0x4A3FF5); room.sendAnnouncement("В©в‚‚в‚Ђв‚‚в‚Ѓ- К™бґЏбґ› бґ�КЂбґЏЙўКЂбґЂбґЌбґЂбґ…бґЏ бґ�бґЏКЂ ꜰᴀᴋᴇᴇʀ", player.id,0x4A3FF5); return false; } function afk(player,message){ message = message.split(" "); if (players.length != 1 && player.team != Team.SPECTATORS) { if (player.team == Team.RED && streak > 0 && room.getScores() == null) { room.setPlayerTeam(player.id, Team.SPECTATORS); } else { room.sendAnnouncement("No puedes ser AFK mientras estГЎs en un equipo !", player.id,0xF64444); return false; } } else if (players.length == 1 && !getAFK(player)) { room.setPlayerTeam(player.id, Team.SPECTATORS); } setAFK(player, !getAFK(player)); room.sendAnnouncement(player.name + (getAFK(player) ? " estГЎ afk !" : " no estГЎ mas afk !",null,0xF64444)); getAFK(player) ? updateRoleOnPlayerOut() : updateRoleOnPlayerIn(); return false; } function showAfks(player,message){ message = message.split(" "); var cstm = "[PV] Lista de AFK : "; for (var i = 0; i < extendedP.length; i++) { if (room.getPlayer(extendedP[i][eP.ID]) != null && getAFK(room.getPlayer(extendedP[i][eP.ID]))) { if (140 - cstm.length < (room.getPlayer(extendedP[i][eP.ID]).name + ", ").length) { room.sendAnnouncement(cstm, player.id); cstm = "... "; } cstm += room.getPlayer(extendedP[i][eP.ID]).name + ", "; } } if (cstm == "[PV] Lista de AFK : ") { room.sendAnnouncement("[PV] No hay nadie en la lista de AFK !", player.id,0xF64444); return false; } cstm = cstm.substring(0, cstm.length - 2); cstm += "."; room.sendAnnouncement(cstm, player.id); return false; } function showMe(player,message){ message = message.split(" "); var stats; localStorage.getItem(getAuth(player)) ? stats = JSON.parse(localStorage.getItem(getAuth(player))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00"]; room.sendAnnouncement("[рџ“„] " + player.name + "> PJ: " + stats[Ss.GA] + ", Victorias: " + stats[Ss.WI] + ", Empates: " + stats[Ss.DR] + ", Derrotas: " + stats[Ss.LS] + ", WR: " + stats[Ss.WR] + "%, Goles: " + stats[Ss.GL] + ", Asistencias: " + stats[Ss.AS] + ", GK: " + stats[Ss.GK] + ", CS: " + stats[Ss.CS] + ", CS%: " + stats[Ss.CP] + "%", player.id,0x73EC59); return false; } function showGames(player,message){ message = message.split(" "); var tableau = []; try{ Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.GA])]); } }); } catch{ } if (tableau.length < 5) { room.sendAnnouncement("[PV] AГєn no se han jugado partidos suficientes.", player.id,0xFF0000); return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("[рџ“„] Partidos Jugados> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1], player.id,0x73EC59); return false; } function wins(player,message){ message = message.split(" "); var tableau = []; try{ Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.WI])]); } }); } catch{ } if (tableau.length < 5) { room.sendAnnouncement("[PV] AГєn no se han jugado partidos suficientes.", player.id,0x73EC59); return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("[рџ“„] Victorias> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1], player.id,0x73EC59); return false; } function showGoals(player,message){ message = message.split(" "); var tableau = []; try{ Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.GL])]); } }); } catch{ } if (tableau.length < 5) { room.sendAnnouncement("[рџ“„] AГєn no se han jugado partidos suficientes.", player.id,0x73EC59); return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("[рџ“„] Goles> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1], player.id,0x73EC59); return false; } function showAsists(player,message){ message = message.split(" "); try{ var tableau = []; Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.AS])]); } }); } catch{ } if (tableau.length < 5) { room.sendAnnouncement("[PV] AГєn no se han jugado partidos suficientes.", player.id); return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("[рџ“„] Asistencias> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1], player.id,0x73EC59); return false; } function showCs(player,message){//!cs message = message.split(" "); var tableau = []; try{ Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.CS])]); } }); } catch{ } if (tableau.length < 5) { room.sendAnnouncement("[PV] AГєn no se han jugado partidos suficientes.", player.id); return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("[рџ“„] Vallas Invictas> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1], player.id,0x73EC59); return false; } function giveClaim(player,message){//!claim message = message.split(" "); if (message[1] == adminPassword) { room.setPlayerAdmin(player.id, true); var stats; localStorage.getItem(getAuth(player)) ? stats = JSON.parse(localStorage.getItem(getAuth(player))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00", "player", player.name]; if (stats[Ss.RL] != "master") { stats[Ss.RL] = "master"; room.sendAnnouncement("[рџ“„] "+player.name+" se ha logeado como admin del host!"); localStorage.setItem(getAuth(player), JSON.stringify(stats)); } } return false; } function setAdmin(player,message){//!setadmin | !admin message = message.split(" "); if (localStorage.getItem(getAuth(player)) && JSON.parse(localStorage.getItem(getAuth(player)))[Ss.RL] == "master") { if (message.length >= 2 && message[1][0] == "#") { message[1] = message[1].substring(1, message[1].length); if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null) { var stats; localStorage.getItem(getAuth(room.getPlayer(Number.parseInt(message[1])))) ? stats = JSON.parse(localStorage.getItem(getAuth(room.getPlayer(Number.parseInt(message[1]))))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00", "player", room.getPlayer(Number.parseInt(message[1])).name]; if (stats[Ss.RL] == "player") { stats[Ss.RL] = "admin"; localStorage.setItem(getAuth(room.getPlayer(Number.parseInt(message[1]))), JSON.stringify(stats)); room.setPlayerAdmin(room.getPlayer(Number.parseInt(message[1])).id, true); room.sendAnnouncement(room.getPlayer(Number.parseInt(message[1])).name + " ahora es el administrador del host !"); } } } } return false; } function removeAdmin(player,message){// !setplayer | !removeadmin message = message.split(" "); if (localStorage.getItem(getAuth(player)) && JSON.parse(localStorage.getItem(getAuth(player)))[Ss.RL] == "master") { if (message.length >= 2 && message[1][0] == "#") { message[1] = message[1].substring(1, message[1].length); if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null) { var stats; localStorage.getItem(getAuth(room.getPlayer(Number.parseInt(message[1])))) ? stats = JSON.parse(localStorage.getItem(getAuth(room.getPlayer(Number.parseInt(message[1]))))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00", "player", room.getPlayer(Number.parseInt(message[1])).name]; if (stats[Ss.RL] == "admin") { room.sendAnnouncement(room.getPlayer(Number.parseInt(message[1])).name + " Ya no es administrador del host !"); stats[Ss.RL] = "player"; localStorage.setItem(getAuth(room.getPlayer(Number.parseInt(message[1]))), JSON.stringify(stats)); room.setPlayerAdmin(room.getPlayer(Number.parseInt(message[1])).id, false); } } } } return false; } function showMutes(player,message){//!mutes !mutelist message = message.split(" "); var cstm = "[PV] Lista de muteados : "; for (var i = 0; i < extendedP.length; i++) { if (room.getPlayer(extendedP[i][eP.ID]) != null && getMute(room.getPlayer(extendedP[i][eP.ID]))) { if (140 - cstm.length < (room.getPlayer(extendedP[i][eP.ID]).name + "[" + (extendedP[i][eP.ID]) + "], ").length) { room.sendAnnouncement(cstm, player.id); cstm = "... "; } cstm += room.getPlayer(extendedP[i][eP.ID]).name + "[" + (extendedP[i][eP.ID]) + "], "; } } if (cstm == "[PV] Lista de Muteados : ") { room.sendAnnouncement("[PV] No hay nadie en la lista de muteados !", player.id); return false; } cstm = cstm.substring(0, cstm.length - 2); cstm += "."; room.sendAnnouncement(cstm, player.id); return false; } function mute(player,message){//!mute message = message.split(" "); try{ if (player.admin) { updateTeams(); var timeOut; if (!Number.isNaN(Number.parseInt(message[1])) && message.length > 1) { if (Number.parseInt(message[1]) > 0) { timeOut = Number.parseInt(message[1]) * 60 * 1000; } else { timeOut = 3 * 60 * 1000; } if (message[2].length > 1 && message[2][0] == "#") { message[2] = message[2].substring(1, message[2].length); if (!Number.isNaN(Number.parseInt(message[2])) && room.getPlayer(Number.parseInt(message[2])) != null) { if (room.getPlayer(Number.parseInt(message[2])).admin || getMute(room.getPlayer(Number.parseInt(message[2])))) { return false; } setTimeout(function (player) { setMute(player, false); }, timeOut, room.getPlayer(Number.parseInt(message[2]))); setMute(room.getPlayer(Number.parseInt(message[2])), true); room.sendAnnouncement(room.getPlayer(Number.parseInt(message[2])).name + " ha sido muteado por " + (timeOut / 60000) + " minutos !"); } } } else if (Number.isNaN(Number.parseInt(message[1]))) { if (message[1].length > 1 && message[1][0] == "#") { message[1] = message[1].substring(1, message[1].length); if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null) { if (room.getPlayer(Number.parseInt(message[1])).admin || getMute(room.getPlayer(Number.parseInt(message[1])))) { return false; } setTimeout(function (player) { setMute(player, false); }, 3 * 60 * 1000, room.getPlayer(Number.parseInt(message[1]))); setMute(room.getPlayer(Number.parseInt(message[1])), true); room.sendAnnouncement(room.getPlayer(Number.parseInt(message[1])).name + " Te han muteado por 3 minutos!"); } } } } } catch{ room.sendAnnouncement("Algo ha fallado!",player.id); } return false; } function unmute(player,message){ message = message.split(" "); if (player.admin && message.length >= 2) { if (message[1] == "all") { extendedP.forEach((ePlayer) => { ePlayer[eP.MUTE] = false; }); room.sendAnnouncement("Se ha limpiado la lista de muteados"); } else if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null && getMute(room.getPlayer(Number.parseInt(message[1])))) { setMute(room.getPlayer(Number.parseInt(message[1])), false); room.sendAnnouncement(room.getPlayer(Number.parseInt(message[1])).name + " ha sido desmuteado !"); } else if (Number.isNaN(Number.parseInt(message[1]))) { if (message[1].length > 1 && message[1][0] == "#") { message[1] = message[1].substring(1, message[1].length); if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null && getMute(room.getPlayer(Number.parseInt(message[1])))) { setMute(room.getPlayer(Number.parseInt(message[1])), false); room.sendAnnouncement(room.getPlayer(Number.parseInt(message[1])).name + " ha sido desmuteado!"); } } } } return false; } /* PLAYER FUNCTIONS */ function updateTeams() { // update the players' list and all the teams' list players = room.getPlayerList().filter((player) => player.id != null && !getAFK(player)); teamR = players.filter(p => p.team === Team.RED); teamB = players.filter(p => p.team === Team.BLUE); teamS = players.filter(p => p.team === Team.SPECTATORS); } function handleInactivity() { // handles inactivity : players will be kicked after afkLimit if (countAFK && (teamR.length + teamB.length) > 1) { for (var i = 0; i < teamR.length ; i++) { setActivity(teamR[i], getActivity(teamR[i]) + 1); } for (var i = 0; i < teamB.length ; i++) { setActivity(teamB[i], getActivity(teamB[i]) + 1); } } for (var i = 0; i < extendedP.length ; i++) { if (extendedP[i][eP.ACT] == 60 * (2/3 * afkLimit)) { room.sendAnnouncement("[PV] в›” @" + room.getPlayer(extendedP[i][eP.ID]).name + ", Si no te moves/escribГ­s dentro de " + Math.floor(afkLimit / 3) + " segundos, seras kickeado!", extendedP[i][eP.ID]); } if (extendedP[i][eP.ACT] >= 60 * afkLimit) { extendedP[i][eP.ACT] = 0; if (room.getScores().time <= afkLimit - 0.5) { setTimeout(() => { !inChooseMode ? quickRestart() : room.stopGame(); }, 10); } room.kickPlayer(extendedP[i][eP.ID], "AFK", false); } } } function getAuth(player) { return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.AUTH] : null; } function getAFK(player) { return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.AFK] : null; } function setAFK(player, value) { extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.AFK] = value); } function getActivity(player) { return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.ACT] : null; } function setActivity(player, value) { extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.ACT] = value); } function getGK(player) { return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.GK] : null; } function setGK(player, value) { extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.GK] = value); } function getMute(player) { return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.MUTE] : null; } function setMute(player, value) { extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.MUTE] = value); } /* BALANCE & CHOOSE FUNCTIONS */ function updateRoleOnPlayerIn() { updateTeams(); if (inChooseMode) { if (players.length == 6) { loadMap(bigMap, scoreLimitBig, timeLimitBig); } getSpecList(teamR.length <= teamB.length ? teamR[0] : teamB[0]); } balanceTeams(); } function updateRoleOnPlayerOut() { updateTeams(); if (room.getScores() != null) { var scores = room.getScores(); if (players.length >= 2 * maxTeamSize && scores.time >= (5/6) * game.scores.timeLimit && teamR.length != teamB.length) { if (teamR.length < teamB.length) { if (scores.blue - scores.red == 2) { endGame(Team.BLUE); room.sendAnnouncement("рџ¤– Abandono detectado рџ¤–"); setTimeout(() => { room.stopGame(); }, 100); return; } } else { if (scores.red - scores.blue == 2) { endGame(Team.RED); room.sendAnnouncement("рџ¤– Abandono detectado рџ¤–"); setTimeout(() => { room.stopGame(); }, 100); return; } } } } if (inChooseMode) { if (players.length == 5) { loadMap(classicMap, scoreLimitClassic, timeLimitClassic); } if (teamR.length == 0 || teamB.length == 0) { teamR.length == 0 ? room.setPlayerTeam(teamS[0].id, Team.RED) : room.setPlayerTeam(teamS[0].id, Team.BLUE); return; } if (Math.abs(teamR.length - teamB.length) == teamS.length) { room.sendAnnouncement("[рџ“—] Discord de Futsal League x4: https://discord.gg/BR79Mpzgej",null,0x4A3FF5); deactivateChooseMode(); resumeGame(); var b = teamS.length; if (teamR.length > teamB.length) { for (var i = 0 ; i < b ; i++) { setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.BLUE); }, 5*i); } } else { for (var i = 0 ; i < b ; i++) { setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.RED); }, 5*i); } } return; } if (streak == 0 && room.getScores() == null) { if (Math.abs(teamR.length - teamB.length) == 2) { // if someone left a team has 2 more players than the other one, put the last chosen guy back in his place so it's fair room.sendAnnouncement("[рџ“—] Discord de Futsal League x4: https://discord.gg/BR79Mpzgej",null,0x4A3FF5); teamR.length > teamB.length ? room.setPlayerTeam(teamR[teamR.length - 1].id, Team.SPECTATORS) : room.setPlayerTeam(teamB[teamB.length - 1].id, Team.SPECTATORS); } } if (teamR.length == teamB.length && teamS.length < 2) { deactivateChooseMode(); resumeGame(); return; } capLeft ? choosePlayer() : getSpecList(teamR.length <= teamB.length ? teamR[0] : teamB[0]); } balanceTeams(); } function balanceTeams() { if (!inChooseMode) { if (players.length == 1 && teamR.length == 0) { quickRestart(); loadMap(aloneMap, 0, 0); room.setPlayerTeam(players[0].id, Team.RED); } else if (Math.abs(teamR.length - teamB.length) == teamS.length && teamS.length > 0) { const n = Math.abs(teamR.length - teamB.length); if (players.length == 2) { quickRestart(); loadMap(classicMap, scoreLimitClassic, timeLimitClassic); } if (teamR.length > teamB.length) { for (var i = 0 ; i < n ; i++) { room.setPlayerTeam(teamS[i].id, Team.BLUE); } } else { for (var i = 0 ; i < n ; i++) { room.setPlayerTeam(teamS[i].id, Team.RED); } } } else if (Math.abs(teamR.length - teamB.length) > teamS.length) { const n = Math.abs(teamR.length - teamB.length); if (players.length == 1) { quickRestart(); loadMap(aloneMap, 0, 0); room.setPlayerTeam(players[0].id, Team.RED); return; } else if (players.length == 5) { quickRestart(); loadMap(classicMap, scoreLimitClassic, timeLimitClassic); } if (players.length == maxTeamSize * 2 - 1) { allReds = []; allBlues = []; } if (teamR.length > teamB.length) { for (var i = 0 ; i < n ; i++) { room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS); } } else { for (var i = 0 ; i < n ; i++) { room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS); } } } else if (Math.abs(teamR.length - teamB.length) < teamS.length && teamR.length != teamB.length) { room.pauseGame(true); activateChooseMode(); choosePlayer(); } else if (teamS.length >= 2 && teamR.length == teamB.length && teamR.length < maxTeamSize) { if (teamR.length == 2) { quickRestart(); loadMap(bigMap, scoreLimitBig, timeLimitBig); } topBtn(); } } } function choosePlayer() { clearTimeout(timeOutCap); if (teamR.length <= teamB.length && teamR.length != 0) { room.sendAnnouncement("вљ” Para elegir un jugador, EscribГ­ un numero en orden de la lista de spec o usa 'top', 'random' o 'bottom'.", teamR[0].id); timeOutCap = setTimeout(function (player) { room.sendAnnouncement("вљ” ВЎRapido @" + player.name + "!, solo quedan " + Number.parseInt(chooseTime / 2) + " segundos para elegir !", player.id); timeOutCap = setTimeout(function (player) { room.kickPlayer(player.id, "вљ”ВЎNo elegiste a tiempo!", false); }, chooseTime * 500, teamR[0]); }, chooseTime * 1000, teamR[0]); } else if (teamB.length < teamR.length && teamB.length != 0) { room.sendAnnouncement("вљ” Para elegir un jugador, EscribГ­ un numero en orden de la lista de spec o usa 'top', 'random' o 'bottom'.", teamB[0].id); timeOutCap = setTimeout(function (player) { room.sendAnnouncement("вљ” ВЎRapido @" + player.name + "!, solo quedan " + Number.parseInt(chooseTime / 2) + " segundos para elegir !", player.id); timeOutCap = setTimeout(function (player) { room.kickPlayer(player.id, "вљ”ВЎNo elegiste a tiempo!", false); }, chooseTime * 500, teamB[0]); }, chooseTime * 1000, teamB[0]); } if (teamR.length != 0 && teamB.length != 0) getSpecList(teamR.length <= teamB.length ? teamR[0] : teamB[0]); } function getSpecList(player) { var cstm = "[PV] Jugadores : "; for (var i = 0 ; i < teamS.length ; i++) { if (140 - cstm.length < (teamS[i].name + "[" + (i+1) + "], ").length) { room.sendAnnouncement(cstm, player.id); cstm = "... "; } cstm += teamS[i].name + "[" + (i+1) + "], "; } cstm = cstm.substring(0,cstm.length - 2); cstm += "."; room.sendAnnouncement(cstm, player.id); } /* STATS FUNCTIONS */ function getLastTouchOfTheBall() { const ballPosition = room.getBallPosition(); updateTeams(); for (var i = 0; i < players.length; i++) { if (players[i].position != null) { var distanceToBall = pointDistance(players[i].position, ballPosition); if (distanceToBall < triggerDistance) { !activePlay ? activePlay = true : null; if (lastTeamTouched == players[i].team && lastPlayersTouched[0] != null && lastPlayersTouched[0].id != players[i].id) { lastPlayersTouched[1] = lastPlayersTouched[0]; lastPlayersTouched[0] = players[i]; } lastTeamTouched = players[i].team; } } } } function getStats() { // gives possession, ball speed and GK of each team if (activePlay) { updateTeams(); lastTeamTouched == Team.RED ? Rposs++ : Bposs++; var ballPosition = room.getBallPosition(); point[1] = point[0]; point[0] = ballPosition; ballSpeed = (pointDistance(point[0], point[1]) * 60 * 60 * 60)/15000; var k = [-1, Infinity]; for (var i = 0; i < teamR.length; i++) { if (teamR[i].position.x < k[1]) { k[0] = teamR[i]; k[1] = teamR[i].position.x; } } k[0] != -1 ? setGK(k[0], getGK(k[0]) + 1) : null; k = [-1, -Infinity]; for (var i = 0; i < teamB.length; i++) { if (teamB[i].position.x > k[1]) { k[0] = teamB[i]; k[1] = teamB[i].position.x; } } k[0] != -1 ? setGK(k[0], getGK(k[0]) + 1) : null; findGK(); } } function updateStats() { if (players.length >= 2 * maxTeamSize && (game.scores.time >= (5 / 6) * game.scores.timeLimit || game.scores.red == game.scores.scoreLimit || game.scores.blue == game.scores.scoreLimit) && allReds.length >= maxTeamSize && allBlues.length >= maxTeamSize) { var stats; for (var i = 0; i < allReds.length; i++) { localStorage.getItem(getAuth(allReds[i])) ? stats = JSON.parse(localStorage.getItem(getAuth(allReds[i]))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00", "player", allReds[i].name]; stats[Ss.GA]++; lastWinner == Team.RED ? stats[Ss.WI]++ : lastWinner == Team.BLUE ? stats[Ss.LS]++ : stats[Ss.DR]++; stats[Ss.WR] = (100 * stats[Ss.WI] / stats[Ss.GA]).toPrecision(3); localStorage.setItem(getAuth(allReds[i]), JSON.stringify(stats)); } for (var i = 0; i < allBlues.length; i++) { localStorage.getItem(getAuth(allBlues[i])) ? stats = JSON.parse(localStorage.getItem(getAuth(allBlues[i]))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00", "player", allBlues[i].name]; stats[Ss.GA]++; lastWinner == Team.BLUE ? stats[Ss.WI]++ : lastWinner == Team.RED ? stats[Ss.LS]++ : stats[Ss.DR]++; stats[Ss.WR] = (100 * stats[Ss.WI] / stats[Ss.GA]).toPrecision(3); localStorage.setItem(getAuth(allBlues[i]), JSON.stringify(stats)); } for (var i = 0; i < game.goals.length; i++) { if (game.goals[i].striker != null) { if ((allBlues.concat(allReds)).findIndex((player) => player.id == game.goals[i].striker.id) != -1) { stats = JSON.parse(localStorage.getItem(getAuth(game.goals[i].striker))); stats[Ss.GL]++; localStorage.setItem(getAuth(game.goals[i].striker), JSON.stringify(stats)); } } if (game.goals[i].assist != null) { if ((allBlues.concat(allReds)).findIndex((player) => player.name == game.goals[i].assist.name) != -1) { stats = JSON.parse(localStorage.getItem(getAuth(game.goals[i].assist))); stats[Ss.AS]++; localStorage.setItem(getAuth(game.goals[i].assist), JSON.stringify(stats)); } } } if (allReds.findIndex((player) => player.id == GKList[0].id) != -1) { stats = JSON.parse(localStorage.getItem(getAuth(GKList[0]))); stats[Ss.GK]++; game.scores.blue == 0 ? stats[Ss.CS]++ : null; stats[Ss.CP] = (100 * stats[Ss.CS] / stats[Ss.GK]).toPrecision(3); localStorage.setItem(getAuth(GKList[0]), JSON.stringify(stats)); } if (allBlues.findIndex((player) => player.id == GKList[1].id) != -1) { stats = JSON.parse(localStorage.getItem(getAuth(GKList[1]))); stats[Ss.GK]++; game.scores.red == 0 ? stats[Ss.CS]++ : null; stats[Ss.CP] = (100 * stats[Ss.CS] / stats[Ss.GK]).toPrecision(3); localStorage.setItem(getAuth(GKList[1]), JSON.stringify(stats)); } } } function findGK() { var tab = [[-1,""], [-1,""]]; for (var i = 0; i < extendedP.length ; i++) { if (room.getPlayer(extendedP[i][eP.ID]) != null && room.getPlayer(extendedP[i][eP.ID]).team == Team.RED) { if (tab[0][0] < extendedP[i][eP.GK]) { tab[0][0] = extendedP[i][eP.GK]; tab[0][1] = room.getPlayer(extendedP[i][eP.ID]); } } else if (room.getPlayer(extendedP[i][eP.ID]) != null && room.getPlayer(extendedP[i][eP.ID]).team == Team.BLUE) { if (tab[1][0] < extendedP[i][eP.GK]) { tab[1][0] = extendedP[i][eP.GK]; tab[1][1] = room.getPlayer(extendedP[i][eP.ID]); } } } GKList = [tab[0][1], tab[1][1]]; } setInterval(() => { var tableau = []; try{ if (statNumber % 5 == 0) { Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.GA])]); } }); if (tableau.length < 5) { return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("Partidos Jugados> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1]); } if (statNumber % 5 == 1) { Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.WI])]); } }); if (tableau.length < 5) { return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("Victorias> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1]); } if (statNumber % 5 == 2) { Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.GL])]); } }); if (tableau.length < 5) { return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("Goles> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1]); } if (statNumber % 5 == 3) { Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.AS])]); } }); if (tableau.length < 5) { return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("Asistencias> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1]); } if (statNumber % 5 == 4) { Object.keys(localStorage).forEach(function (key) { if (!["player_name", "view_mode", "geo", "avatar", "player_auth_key"].includes(key)) { tableau.push([(JSON.parse(localStorage.getItem(key))[Ss.NK]), (JSON.parse(localStorage.getItem(key))[Ss.CS])]); } }); if (tableau.length < 5) { return false; } tableau.sort(function (a, b) { return b[1] - a[1]; }); room.sendAnnouncement("CS> #1 " + tableau[0][0] + ": " + tableau[0][1] + " #2 " + tableau[1][0] + ": " + tableau[1][1] + " #3 " + tableau[2][0] + ": " + tableau[2][1] + " #4 " + tableau[3][0] + ": " + tableau[3][1] + " #5 " + tableau[4][0] + ": " + tableau[4][1]); } } catch{ } statNumber++; }, statInterval * 60 * 1000); /* EVENTS */ /* PLAYER MOVEMENT */ room.onPlayerJoin = function(player) { console.log("---------------------------------------------------"); console.log("[рџ“ў]Nick: "+player.name); console.log("[рџ“ў]Conn: "+player.conn); console.log("[рџ“ў]Auth: "+player.auth); extendedP.push([player.id, player.auth, player.conn, false, 0, 0, false]); updateRoleOnPlayerIn(); room.sendAnnouncement("рџ‘‹ Bienvenido " + player.name + " ! UsГЎ el comando '!ayuda' para ver los comandos disponibles.", player.id,0xF8FF00); room.sendAnnouncement("[рџ“—] AsociaciГіn Argentina de Hockey: https://discord.gg/gCbAZAQKct", player.id,0x4A3FF5); if (localStorage.getItem(player.auth) != null) { if (JSON.parse(localStorage.getItem(player.auth))[Ss.RL] != "player") { room.setPlayerAdmin(player.id, true); room.sendAnnouncement((JSON.parse(localStorage.getItem(player.auth))[Ss.RL] == "Admin" ? "Master " : "Admin ") + player.name + " se uniГі a el server !",null,0xFFF992); } } } room.onPlayerTeamChange = function(changedPlayer, byPlayer) { if (getAFK(changedPlayer) && changedPlayer.team != Team.SPECTATORS) { room.setPlayerTeam(changedPlayer.id, Team.SPECTATORS); room.sendAnnouncement(changedPlayer.name + " estГЎ AFK !"); return; } updateTeams(); if (room.getScores() != null) { var scores = room.getScores(); if (changedPlayer.team != Team.SPECTATORS && scores.time <= (3/4) * scores.timeLimit && Math.abs(scores.blue - scores.red) < 2) { (changedPlayer.team == Team.RED) ? allReds.push(changedPlayer) : allBlues.push(changedPlayer); } } if (changedPlayer.team == Team.SPECTATORS) { setActivity(changedPlayer, 0); } if (inChooseMode && resettingTeams == false) { if (Math.abs(teamR.length - teamB.length) == teamS.length) { deactivateChooseMode(); resumeGame(); var b = teamS.length; if (teamR.length > teamB.length) { for (var i = 0 ; i < b ; i++) { setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.BLUE); }, 200*i); } } else { for (var i = 0 ; i < b ; i++) { setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.RED); }, 200*i); } } return; } else if ((teamR.length == maxTeamSize && teamB.length == maxTeamSize) || (teamR.length == teamB.length && teamS.length < 2)) { deactivateChooseMode(); resumeGame(); } else if (teamR.length <= teamB.length && redCaptainChoice != "") { // choice remembered redCaptainChoice == "top" ? room.setPlayerTeam(teamS[0].id, Team.RED) : redCaptainChoice == "random" ? room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.RED) : room.setPlayerTeam(teamS[teamS.length - 1].id, Team.RED); return; } else if (teamB.length < teamR.length && blueCaptainChoice != "") { blueCaptainChoice == "top" ? room.setPlayerTeam(teamS[0].id, Team.BLUE) : blueCaptainChoice == "random" ? room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE) : room.setPlayerTeam(teamS[teamS.length - 1].id, Team.BLUE); return; } else { choosePlayer(); } } } room.onPlayerLeave = function(player) { if (teamR.findIndex((red) => red.id == player.id) == 0 && inChooseMode && teamR.length <= teamB.length) { choosePlayer(); capLeft = true; setTimeout(() => { capLeft = false; }, 10); } if (teamB.findIndex((blue) => blue.id == player.id) == 0 && inChooseMode && teamB.length < teamR.length) { choosePlayer(); capLeft = true; setTimeout(() => { capLeft = false; }, 10); } setActivity(player, 0); updateRoleOnPlayerOut(); } room.onPlayerKicked = function(kickedPlayer, reason, ban, byPlayer) { ban == true ? banList.push([kickedPlayer.name, kickedPlayer.id]) : null; } /* PLAYER ACTIVITY */ room.onPlayerChat = function (player, message) { if (getMute(player)) { room.sendAnnouncement("Usted estГЎ muteado.", player.id); return false; } if (slowMode > 0) { if (!player.admin) { if (!SMSet.has(player.id)) { SMSet.add(player.id); setTimeout((number) => { SMSet.delete(number); }, slowMode * 1000, player.id); } else { return false; } } } player.team != Team.SPECTATORS ? setActivity(player, 0) : null; for(i=0; i<wordProhibited.length; i++){ if(message.includes(wordProhibited[i])){ room.kickPlayer(player.id,"Prohibido tirar el host :/"); return false; } } if(player.admin){ var adminChatColor="0xffb634"; var adminMessage = message; let spacePos = message.search(" "); let command = message.substr(0, spacePos !== -1 ? spacePos : message.length); if (commands.hasOwnProperty(command) == true) return commands[command](player, message); room.sendAnnouncement("[рџ•µ] "+player.name+": "+adminMessage,null,adminChatColor); return false; }else if(player.admin !=true){ let spacePos = message.search(" "); let command = message.substr(0, spacePos !== -1 ? spacePos : message.length); if (commands.hasOwnProperty(command) == true) return commands[command](player, message); var playerChatColor="0xFFFFFF"; var playerMessage = message; room.sendAnnouncement("[👤] "+player.name+": "+playerMessage,null,playerChatColor); return false; } } room.onPlayerActivity = function(player) { setActivity(player, 0); } room.onPlayerBallKick = function(player) { if (lastPlayersTouched[0] == null || player.id != lastPlayersTouched[0].id) { !activePlay ? activePlay = true : null; lastTeamTouched = player.team; lastPlayersTouched[1] = lastPlayersTouched[0]; lastPlayersTouched[0] = player; } } /* GAME MANAGEMENT */ room.onGameStart = function(byPlayer) { game = new Game(Date.now(), room.getScores(), []); countAFK = true; activePlay = false; goldenGoal = false; endGameVariable = false; lastPlayersTouched = [null, null]; Rposs = 0; Bposs = 0; GKList = []; allReds = []; allBlues = []; if (teamR.length == maxTeamSize && teamB.length == maxTeamSize) { for (var i = 0; i < maxTeamSize; i++) { allReds.push(teamR[i]); allBlues.push(teamB[i]); } } for (var i = 0; i < extendedP.length; i++) { extendedP[i][eP.GK] = 0; extendedP[i][eP.ACT] = 0; room.getPlayer(extendedP[i][eP.ID]) == null ? extendedP.splice(i, 1) : null; } deactivateChooseMode(); } room.onGameStop = function(byPlayer) { if (endGameVariable) { updateTeams(); if (inChooseMode) { if (players.length == 2 * maxTeamSize) { inChooseMode = false; resetBtn(); for (var i = 0; i < maxTeamSize; i++) { setTimeout(() => { randomBtn(); }, 400*i); } setTimeout(() => { room.startGame(); }, 2000); } else { if (lastWinner == Team.RED) { blueToSpecBtn(); } else if (lastWinner == Team.BLUE) { redToSpecBtn(); blueToRedBtn(); } else { resetBtn(); } setTimeout(() => { topBtn(); }, 500); } } else { if (players.length == 2) { if (lastWinner == Team.BLUE) { room.setPlayerTeam(teamB[0].id, Team.RED); room.setPlayerTeam(teamR[0].id, Team.BLUE); } setTimeout(() => { room.startGame(); }, 2000); } else if (players.length == 3 || players.length >= 2 * maxTeamSize + 1) { if (lastWinner == Team.RED) { blueToSpecBtn(); } else { redToSpecBtn(); blueToRedBtn(); } setTimeout(() => { topBtn(); }, 200); setTimeout(() => { room.startGame(); }, 2000); } else if (players.length == 4) { resetBtn(); setTimeout(() => { randomBtn(); setTimeout(() => { randomBtn(); }, 500); }, 500); setTimeout(() => { room.startGame(); }, 2000); } else if (players.length == 5 || players.length >= 2 * maxTeamSize + 1) { if (lastWinner == Team.RED) { blueToSpecBtn(); } else { redToSpecBtn(); blueToRedBtn(); } setTimeout(() => { topBtn(); }, 200); activateChooseMode(); } else if (players.length == 6) { resetBtn(); setTimeout(() => { randomBtn(); setTimeout(() => { randomBtn(); setTimeout(() => { randomBtn(); }, 500); }, 500); }, 500); setTimeout(() => { room.startGame(); }, 2000); } } } } room.onGamePause = function(byPlayer) { } room.onGameUnpause = function (byPlayer) { if (teamR.length == 4 && teamB.length == 4 && inChooseMode || (teamR.length == teamB.length && teamS.length < 2 && inChooseMode)) { deactivateChooseMode(); } } room.onTeamGoal = function(team) { activePlay = false; countAFK = false; const scores = room.getScores(); game.scores = scores; if (lastPlayersTouched[0] != null && lastPlayersTouched[0].team == team) { if (lastPlayersTouched[1] != null && lastPlayersTouched[1].team == team) { room.sendAnnouncement("вљЅ " + getTime(scores) + " Gol de " + lastPlayersTouched[0].name + " ! Asistencia de " + lastPlayersTouched[1].name + ". Velocidad de tiro : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "рџ”µ")); game.goals.push(new Goal(scores.time, team, lastPlayersTouched[0], lastPlayersTouched[1])); } else { room.sendAnnouncement("вљЅ " + getTime(scores) + " Gol de " + lastPlayersTouched[0].name + " ! Velocidad de tiro : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "рџ”µ")); game.goals.push(new Goal(scores.time, team, lastPlayersTouched[0], null)); } } else { room.sendAnnouncement("рџ�‚ " + getTime(scores) + " Gol en contra de " + lastPlayersTouched[0].name + " ! Velocidad de tiro : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "рџ”µ")); game.goals.push(new Goal(scores.time, team, null, null)); } if (scores.scoreLimit != 0 && (scores.red == scores.scoreLimit || scores.blue == scores.scoreLimit && scores.blue > 0 || goldenGoal == true)) { endGame(team); goldenGoal = false; setTimeout(() => { room.stopGame(); }, 1000); } } room.onPositionsReset = function() { countAFK = true; lastPlayersTouched = [null, null]; } /* MISCELLANEOUS */ room.onRoomLink = function(url) { } room.onPlayerAdminChange = function (changedPlayer, byPlayer) { if (getMute(changedPlayer)) { room.sendAnnouncement(changedPlayer.name + " ha sido desmuteado."); setMute(changedPlayer, false); } if (byPlayer != null && localStorage.getItem(getAuth(byPlayer)) && JSON.parse(localStorage.getItem(getAuth(byPlayer)))[Ss.RL] == "admin") { room.sendAnnouncement("No tienes permiso para nombrar a un jugador como Administrador !", byPlayer.id); room.setPlayerAdmin(changedPlayer.id, false); } } room.onStadiumChange = function(newStadiumName, byPlayer) { } room.onGameTick = function() { checkTime(); getLastTouchOfTheBall(); getStats(); handleInactivity(); }