Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 125.98 KB | None | 0 0
  1. // 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"]'
  2.  
  3. /* VARIABLES */
  4.  
  5. /* ROOM */
  6.  
  7. const roomName = "⚡ [NL1][FUTSAL 3v3] Pub 1 | AutoBOT ! ⚡";
  8. // emoji mando play 🎮
  9. //emoji espiral 🍥
  10. // emoji de fuego 🔥
  11. // emoji de rayo ⚡
  12. const botName = "🔥 ESP FUTSAL BOT 🔥";
  13. const maxPlayers = 13;
  14. const roomPublic = true;
  15. const geo = [{"code": "ES", "lat": 42.1, "lon": 4.2}];
  16. const password = 'futsalroom!123';
  17.  
  18. const room = HBInit({ roomName: roomName, maxPlayers: maxPlayers, public: roomPublic, playerName: botName, geo: geo[0] });
  19.  
  20. const scoreLimitClassic = 2;
  21. const scoreLimitBig = 2;
  22. const timeLimitClassic = 3;
  23. const timeLimitBig = 3;
  24.  
  25. room.setTeamsLock(true);
  26.  
  27. var adminPassword = 10000 + getRandomInt(90000);
  28. console.log("adminPassword : " + adminPassword);
  29.  
  30. /* STADIUM */
  31.  
  32. const playerRadius = 15;
  33. var ballRadius = 6.25;
  34. const triggerDistance = playerRadius + ballRadius + 0.01;
  35. //MAPA VIEJOS
  36. //var aloneMap = '{"name":"Futsal No Goals GLH","width":420,"height":200,"spawnDistance":180,"bg":{"type":"hockey","width":368,"height":171,"kickOffRadius":65,"cornerRadius":0},"vertexes":[{"x":-368,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-368,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-368,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-368,"y":-171,"trait":"ballArea","bCoef":1,"cMask":["ball"]},{"x":368,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":368,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":368,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":368,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":0,"y":65,"trait":"line"},{"x":0,"y":-65,"trait":"line"},{"bCoef":1,"trait":"ballArea","x":368,"y":171},{"bCoef":1,"trait":"ballArea","x":368,"y":-171},{"bCoef":0,"trait":"line","x":0,"y":171},{"bCoef":0,"trait":"line","x":0,"y":-171},{"x":0,"y":65,"trait":"line"},{"x":0,"y":-65,"trait":"line"},{"x":377,"y":-65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":377,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-377,"y":-65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":-377,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-377,"y":65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":-377,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":377,"y":65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":377,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":0,"y":65,"trait":"line"},{"x":0,"y":-65,"trait":"line"},{"x":-368.53340356886,"y":-62.053454903872,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":-400.05760771891,"y":-62.053454903872,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":-400.05760771891,"y":64.043361696331,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":-368.53340356886,"y":64.043361696331,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":368.09926357786,"y":63.94882446641,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":400,"y":64,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":400,"y":-61.927767991658,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":368.9681846993,"y":-62.144998272018,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":-368,"y":-142.37229643041,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":-90},{"x":-260.90035258157,"y":-50.168480548544,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":-368,"y":-160.81305960678,"bCoef":0.1,"trait":"line","curve":-90},{"x":-358.5379338963,"y":-171,"bCoef":0.1,"trait":"line","curve":-90},{"x":-368,"y":141.33175243687,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":90},{"x":-260.90035258157,"y":49.127936555002,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":-368,"y":159.77251561324,"bCoef":0.1,"trait":"line","curve":90},{"x":-358.5379338963,"y":171,"bCoef":0.1,"trait":"line","curve":90},{"x":368,"y":159.77251561324,"bCoef":0.1,"trait":"line","curve":-90},{"x":358.36266315432,"y":171,"bCoef":0.1,"trait":"line","curve":-90},{"x":368,"y":-160.81305960678,"bCoef":0.1,"trait":"line","curve":90},{"x":358.36266315432,"y":-171,"bCoef":0.1,"trait":"line","curve":90},{"x":368,"y":-142.37229643041,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":90},{"x":260.72508183959,"y":-50.168480548544,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":90},{"x":368,"y":141.33175243687,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":-90},{"x":260.72508183959,"y":49.127936555002,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":-90},{"x":260.72508183959,"y":-50.168480548544,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":260.72508183959,"y":49.127936555002,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":-250.86909422732,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":-160.58776903904,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":-160.58776903904,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":-80.337702205015,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":-80.337702205015,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":160.41249829706,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":160.41249829706,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":80.162431463036,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":80.162431463036,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":-171,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":-371.91294503531,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":-384.61920561736,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":371.73767429333,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":384.44393487538,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":-371.91294503531,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":-384.61920561736,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":371.73767429333,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":384.44393487538,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":171,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":181.05031927829,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":-171,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":171,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":181.05031927829,"bCoef":0.1,"trait":"line"},{"x":369,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":1,"vis":false},{"x":369,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":1,"vis":false},{"x":-370,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":1,"vis":false},{"x":-370,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":1,"vis":false},{"x":371,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":0,"_selected":"segment"},{"x":371,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":0,"_selected":"segment"},{"x":371,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":371,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":0}],"segments":[{"v0":0,"v1":1,"trait":"ballArea"},{"v0":2,"v1":3,"trait":"ballArea"},{"v0":4,"v1":5,"trait":"ballArea"},{"v0":6,"v1":7,"trait":"ballArea"},{"v0":8,"v1":9,"trait":"line","curve":180,"cGroup":["blueKO"]},{"v0":8,"v1":9,"trait":"line","curve":-180,"cGroup":["redKO"]},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":1,"v1":0,"cMask":["ball"],"x":-368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":5,"v1":4,"cMask":["ball"],"x":368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":2,"v1":3,"cMask":["ball"],"x":-368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":6,"v1":7,"cMask":["ball"],"x":368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":0,"v1":10,"y":171},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":3,"v1":11,"y":-171},{"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":12,"v1":13},{"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":9,"v1":8},{"curve":180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":15,"v1":14},{"curve":0,"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":2,"v1":1},{"curve":0,"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":6,"v1":5},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":16,"v1":17,"cMask":["ball"],"x":330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":18,"v1":19,"cMask":["ball"],"x":-330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":20,"v1":21,"cMask":["ball"],"x":-330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":22,"v1":23,"cMask":["ball"],"x":330},{"v0":26,"v1":27,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,-80],"y":-80},{"v0":27,"v1":28,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","x":-590},{"v0":28,"v1":29,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,80],"y":80},{"v0":30,"v1":31,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,-80],"y":-80},{"v0":31,"v1":32,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","x":-590},{"v0":32,"v1":33,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,80],"y":80},{"v0":34,"v1":35,"curve":94.0263701017,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":37,"v1":36,"curve":86.632306418889,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":38,"v1":39,"curve":-94.026370101699,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":35,"v1":39,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":41,"v1":40,"curve":-86.632306418888,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":43,"v1":42,"curve":86.632306418884,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":45,"v1":44,"curve":-86.632306418899,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":46,"v1":47,"curve":-94.026370101699,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":48,"v1":49,"curve":94.026370101699,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":50,"v1":51,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":390},{"v0":53,"v1":52,"curve":-180.00692920292,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":52,"v1":53,"curve":-180.00218240614,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":55,"v1":54,"curve":-179.64823645332,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":54,"v1":55,"curve":-180.35758668147,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":57,"v1":56,"curve":-180.02357323962,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":56,"v1":57,"curve":-180.00924102399,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":59,"v1":58,"curve":-180.06885755885,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":58,"v1":59,"curve":-180.02948353257,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":61,"v1":60,"curve":-179.99869069543,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":60,"v1":61,"curve":-179.99939258776,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":63,"v1":62,"curve":-180.08826047163,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":62,"v1":63,"curve":-179.91186753664,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":65,"v1":64,"curve":-179.99528711105,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":64,"v1":65,"curve":-179.99743836358,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":67,"v1":66,"curve":-179.98626041101,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":66,"v1":67,"curve":-179.99175181595,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":69,"v1":68,"curve":-180.04715562398,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":68,"v1":69,"curve":-179.95294709391,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":71,"v1":70,"curve":-179.95715750564,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":70,"v1":71,"curve":-179.89943871875,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":73,"v1":72,"curve":-179.94773754738,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":72,"v1":73,"curve":-179.98221351296,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":75,"v1":74,"curve":-180.4151727218,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":74,"v1":75,"curve":-179.58764458796,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":77,"v1":76,"curve":-180.00086646359,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":76,"v1":77,"curve":-180.01965986376,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":79,"v1":78,"curve":-180.03532601389,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":78,"v1":79,"curve":-179.99380079,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":81,"v1":80,"curve":-180.0044468452,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":80,"v1":81,"curve":-180.01386779847,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":83,"v1":82,"curve":-180.05158287563,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":82,"v1":83,"curve":-180.01212223878,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":84,"v1":85,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240},{"v0":86,"v1":87,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-120},{"v0":88,"v1":89,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":240},{"v0":90,"v1":91,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":120},{"v0":92,"v1":93,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-381},{"v0":94,"v1":95,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":123},{"v0":96,"v1":97,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":123},{"v0":98,"v1":99,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":-123},{"v0":100,"v1":101,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":-123},{"v0":102,"v1":103,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-381},{"v0":104,"v1":105,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":381},{"v0":106,"v1":107,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":381},{"curve":0,"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":109,"v1":108,"x":369},{"curve":0,"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":111,"v1":110,"x":-370},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":112,"v1":113,"cMask":["ball"],"x":371,"_selected":true},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":114,"v1":115,"cMask":["ball"],"x":371},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":116,"v1":117,"cMask":["ball"],"x":-371},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":118,"v1":119,"cMask":["ball"],"x":-371}],"goals":[{"p0":[-374.25,-62.053454903872],"p1":[-374.25,64.043361696331],"team":"red"},{"p0":[374.25,62],"p1":[374.25,-62],"team":"blue"}],"discs":[{"radius":3.9405255187564,"pos":[-368.53340356886,64.043361696331],"color":"6666CC","trait":"goalPost","y":80},{"radius":3.9405255187564,"pos":[-368.53340356886,-62.053454903872],"color":"6666CC","trait":"goalPost","y":-80,"x":-560},{"radius":3.9405255187564,"pos":[368.9681846993,-62.144998272018],"color":"6666CC","trait":"goalPost","y":80},{"radius":3.9405255187564,"pos":[368.09926357786,63.94882446641],"color":"6666CC","trait":"goalPost","y":-80,"x":-560},{"radius":3,"invMass":0,"pos":[-368,-171],"color":"FFCC00","bCoef":0.1,"trait":"line"},{"radius":3,"invMass":0,"pos":[-368,171],"color":"FFCC00","bCoef":0.1,"trait":"line"},{"radius":3,"invMass":0,"pos":[368,171],"color":"FFCC00","bCoef":0.1,"trait":"line"},{"radius":3,"invMass":0,"pos":[368,-171],"color":"FFCC00","bCoef":0.1,"trait":"line"}],"planes":[{"normal":[0,1],"dist":-171,"trait":"ballArea"},{"normal":[0,-1],"dist":-171,"trait":"ballArea"},{"normal":[0,1],"dist":-200,"bCoef":0.2,"cMask":["all"]},{"normal":[0,-1],"dist":-200,"bCoef":0.2,"cMask":["all"]},{"normal":[1,0],"dist":-420,"bCoef":0.2,"cMask":["all"]},{"normal":[-1,0],"dist":-420,"bCoef":0.2,"cMask":["all"]}],"traits":{"ballArea":{"vis":false,"bCoef":1,"cMask":["ball"]},"goalPost":{"radius":8,"invMass":0,"bCoef":1},"goalNet":{"vis":true,"bCoef":0.1,"cMask":["all"]},"kickOffBarrier":{"vis":false,"bCoef":0.1,"cGroup":["redKO","blueKO"],"cMask":["red","blue"]},"line":{"vis":true,"bCoef":0,"cMask":[""]},"arco":{"radius":2,"cMask":["n\/d"],"color":"cccccc"}},"playerPhysics":{"acceleration":0.11,"kickingAcceleration":0.083,"kickStrength":5,"bCoef":0},"ballPhysics":{"radius":6.25,"color":"FFCC00","bCoef":0.4,"invMass":1.5,"damping":0.99}}'
  37. //var classicMap = '{"name":"Futsal x1 and x2 ; by Bazinga! & GLH","width":420,"height":200,"spawnDistance":180,"bg":{"type":"hockey","width":368,"height":171,"kickOffRadius":65,"cornerRadius":0},"vertexes":[{"x":-368,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-368,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-368,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-368,"y":-171,"trait":"ballArea","bCoef":1,"cMask":["ball"]},{"x":368,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":368,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":368,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":368,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":0,"y":65,"trait":"kickOffBarrier"},{"x":0,"y":-65,"trait":"line"},{"bCoef":1,"trait":"ballArea","x":368,"y":171},{"bCoef":1,"trait":"ballArea","x":368,"y":-171},{"bCoef":0,"trait":"line","x":0,"y":171},{"bCoef":0,"trait":"line","x":0,"y":-171},{"x":0,"y":65,"trait":"kickOffBarrier"},{"x":0,"y":-65,"trait":"kickOffBarrier"},{"x":377,"y":-65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":377,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-377,"y":-65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":-377,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-377,"y":65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":-377,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":377,"y":65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":377,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":0,"y":199,"trait":"kickOffBarrier"},{"x":0,"y":65,"trait":"kickOffBarrier"},{"x":0,"y":-65,"trait":"kickOffBarrier"},{"x":0,"y":-199,"trait":"kickOffBarrier"},{"x":-368.53340356886,"y":-62.053454903872,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":-400.05760771891,"y":-62.053454903872,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":-400.05760771891,"y":64.043361696331,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":-368.53340356886,"y":64.043361696331,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":368.09926357786,"y":63.94882446641,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":400,"y":64,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,-80]},{"x":400,"y":-61.927767991658,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":368.9681846993,"y":-62.144998272018,"cMask":["red","blue","ball"],"trait":"goalNet","curve":0,"color":"F8F8F8","pos":[-700,80]},{"x":-368,"y":-142.37229643041,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":-90},{"x":-260.90035258157,"y":-50.168480548544,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":-368,"y":-160.81305960678,"bCoef":0.1,"trait":"line","curve":-90},{"x":-358.5379338963,"y":-171,"bCoef":0.1,"trait":"line","curve":-90},{"x":-368,"y":141.33175243687,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":90},{"x":-260.90035258157,"y":49.127936555002,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":-368,"y":159.77251561324,"bCoef":0.1,"trait":"line","curve":90},{"x":-358.5379338963,"y":171,"bCoef":0.1,"trait":"line","curve":90},{"x":368,"y":159.77251561324,"bCoef":0.1,"trait":"line","curve":-90},{"x":358.36266315432,"y":171,"bCoef":0.1,"trait":"line","curve":-90},{"x":368,"y":-160.81305960678,"bCoef":0.1,"trait":"line","curve":90},{"x":358.36266315432,"y":-171,"bCoef":0.1,"trait":"line","curve":90},{"x":368,"y":-142.37229643041,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":90},{"x":260.72508183959,"y":-50.168480548544,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":90},{"x":368,"y":141.33175243687,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":-90},{"x":260.72508183959,"y":49.127936555002,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":-90},{"x":260.72508183959,"y":-50.168480548544,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":260.72508183959,"y":49.127936555002,"bCoef":0.1,"trait":"line","color":"F8F8F8","curve":0},{"x":-250.86909422732,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":-250.86909422732,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":250.69382348534,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":-185.66591492467,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-1.2295321189394,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":0.18898812539692,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-2.6480523632758,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":1.6075083697333,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":0.89824824756514,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-1.9387922411076,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":1.9621384308174,"bCoef":0.1,"trait":"line","curve":180},{"x":185.49064418269,"y":-3.0026824243599,"bCoef":0.1,"trait":"line","curve":180},{"x":-160.58776903904,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":-160.58776903904,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":-80.337702205015,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":-80.337702205015,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":160.41249829706,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":160.41249829706,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":80.162431463036,"y":-159.39453936245,"bCoef":0.1,"trait":"line"},{"x":80.162431463036,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":-171,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":-371.91294503531,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":-384.61920561736,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":371.73767429333,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":384.44393487538,"y":-87.759267023458,"bCoef":0.1,"trait":"line"},{"x":-371.91294503531,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":-384.61920561736,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":371.73767429333,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":384.44393487538,"y":86.718723029916,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":171,"bCoef":0.1,"trait":"line"},{"x":-254.88159756902,"y":181.05031927829,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":-171,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":-182.09086327183,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":171,"bCoef":0.1,"trait":"line"},{"x":254.70632682704,"y":181.05031927829,"bCoef":0.1,"trait":"line"},{"x":377,"y":-65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":377,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-377,"y":-65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":-377,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":-377,"y":65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":-377,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":377,"y":65,"trait":"line","cMask":["ball"],"bCoef":1},{"x":377,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":1},{"x":371,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":371,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":371,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":371,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":171,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":-65,"trait":"ballArea","cMask":["ball"],"bCoef":0},{"x":-371,"y":-171,"trait":"ballArea","cMask":["ball"],"bCoef":0}],"segments":[{"v0":0,"v1":1,"trait":"ballArea"},{"v0":2,"v1":3,"trait":"ballArea"},{"v0":4,"v1":5,"trait":"ballArea"},{"v0":6,"v1":7,"trait":"ballArea"},{"v0":8,"v1":9,"trait":"kickOffBarrier","curve":180,"cGroup":["blueKO"]},{"v0":8,"v1":9,"trait":"kickOffBarrier","curve":-180,"cGroup":["redKO"]},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":1,"v1":0,"cMask":["ball"],"x":-368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":5,"v1":4,"cMask":["ball"],"x":368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":2,"v1":3,"cMask":["ball"],"x":-368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":6,"v1":7,"cMask":["ball"],"x":368},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":0,"v1":10,"y":171},{"vis":true,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":3,"v1":11,"y":-171},{"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":12,"v1":13},{"curve":-180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":9,"v1":8},{"curve":180,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":15,"v1":14},{"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":2,"v1":1},{"curve":0,"vis":true,"color":"FFFFFF","bCoef":0,"trait":"line","v0":6,"v1":5},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":16,"v1":17,"cMask":["ball"],"x":330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":18,"v1":19,"cMask":["ball"],"x":-330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":20,"v1":21,"cMask":["ball"],"x":-330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":22,"v1":23,"cMask":["ball"],"x":330},{"v0":24,"v1":25,"trait":"kickOffBarrier"},{"v0":26,"v1":27,"trait":"kickOffBarrier"},{"v0":28,"v1":29,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,-80],"y":-80},{"v0":29,"v1":30,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","x":-590},{"v0":30,"v1":31,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,80],"y":80},{"v0":32,"v1":33,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,-80],"y":-80},{"v0":33,"v1":34,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","x":-590},{"v0":34,"v1":35,"curve":0,"color":"F8F8F8","cMask":["red","blue","ball"],"trait":"goalNet","pos":[-700,80],"y":80},{"v0":36,"v1":37,"curve":94.0263701017,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":39,"v1":38,"curve":86.632306418889,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":40,"v1":41,"curve":-94.026370101699,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":37,"v1":41,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":43,"v1":42,"curve":-86.632306418888,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":45,"v1":44,"curve":86.632306418884,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":47,"v1":46,"curve":-86.632306418899,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":48,"v1":49,"curve":-94.026370101699,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":50,"v1":51,"curve":94.026370101699,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line"},{"v0":52,"v1":53,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":390},{"v0":55,"v1":54,"curve":-180.00692920292,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":54,"v1":55,"curve":-180.00218240614,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":57,"v1":56,"curve":-179.64823645332,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":56,"v1":57,"curve":-180.35758668147,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":59,"v1":58,"curve":-180.02357323962,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":58,"v1":59,"curve":-180.00924102399,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":61,"v1":60,"curve":-180.06885755885,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":60,"v1":61,"curve":-180.02948353257,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-375},{"v0":63,"v1":62,"curve":-179.99869069543,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":62,"v1":63,"curve":-179.99939258776,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":65,"v1":64,"curve":-180.08826047163,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":64,"v1":65,"curve":-179.91186753664,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":67,"v1":66,"curve":-179.99528711105,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":66,"v1":67,"curve":-179.99743836358,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":69,"v1":68,"curve":-179.98626041101,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":68,"v1":69,"curve":-179.99175181595,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":375},{"v0":71,"v1":70,"curve":-180.04715562398,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":70,"v1":71,"curve":-179.95294709391,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":73,"v1":72,"curve":-179.95715750564,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":72,"v1":73,"curve":-179.89943871875,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":75,"v1":74,"curve":-179.94773754738,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":74,"v1":75,"curve":-179.98221351296,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":77,"v1":76,"curve":-180.4151727218,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":76,"v1":77,"curve":-179.58764458796,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-277.5},{"v0":79,"v1":78,"curve":-180.00086646359,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":78,"v1":79,"curve":-180.01965986376,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":81,"v1":80,"curve":-180.03532601389,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":80,"v1":81,"curve":-179.99380079,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":83,"v1":82,"curve":-180.0044468452,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":82,"v1":83,"curve":-180.01386779847,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":85,"v1":84,"curve":-180.05158287563,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":84,"v1":85,"curve":-180.01212223878,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":277.5},{"v0":86,"v1":87,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240},{"v0":88,"v1":89,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-120},{"v0":90,"v1":91,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":240},{"v0":92,"v1":93,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":120},{"v0":94,"v1":95,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-381},{"v0":96,"v1":97,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":123},{"v0":98,"v1":99,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":123},{"v0":100,"v1":101,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":-123},{"v0":102,"v1":103,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-240,"y":-123},{"v0":104,"v1":105,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":-381},{"v0":106,"v1":107,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":381},{"v0":108,"v1":109,"curve":0,"vis":true,"color":"F8F8F8","bCoef":0.1,"trait":"line","x":381},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":110,"v1":111,"cMask":["ball"],"x":330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":112,"v1":113,"cMask":["ball"],"x":-330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":114,"v1":115,"cMask":["ball"],"x":-330},{"vis":false,"color":"FFFFFF","bCoef":1,"trait":"ballArea","v0":116,"v1":117,"cMask":["ball"],"x":330},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":118,"v1":119,"cMask":["ball"],"x":371},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":120,"v1":121,"cMask":["ball"],"x":371},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":122,"v1":123,"cMask":["ball"],"x":-371},{"vis":false,"color":"FFFFFF","bCoef":0,"trait":"ballArea","v0":124,"v1":125,"cMask":["ball"],"x":-371}],"goals":[{"p0":[-374.25,-62.053454903872],"p1":[-374.25,64.043361696331],"team":"red"},{"p0":[374.25,62],"p1":[374.25,-62],"team":"blue"}],"discs":[{"radius":3.9405255187564,"pos":[-368.53340356886,64.043361696331],"color":"6666CC","trait":"goalPost","y":80},{"radius":3.9405255187564,"pos":[-368.53340356886,-62.053454903872],"color":"6666CC","trait":"goalPost","y":-80,"x":-560},{"radius":3.9405255187564,"pos":[368.9681846993,-62.144998272018],"color":"6666CC","trait":"goalPost","y":80},{"radius":3.9405255187564,"pos":[368.09926357786,63.94882446641],"color":"6666CC","trait":"goalPost","y":-80,"x":-560},{"radius":3,"invMass":0,"pos":[-368,-171],"color":"FFCC00","bCoef":0.1,"trait":"line"},{"radius":3,"invMass":0,"pos":[-368,171],"color":"FFCC00","bCoef":0.1,"trait":"line"},{"radius":3,"invMass":0,"pos":[368,171],"color":"FFCC00","bCoef":0.1,"trait":"line"},{"radius":3,"invMass":0,"pos":[368,-171],"color":"FFCC00","bCoef":0.1,"trait":"line"}],"planes":[{"normal":[0,1],"dist":-171,"trait":"ballArea"},{"normal":[0,-1],"dist":-171,"trait":"ballArea"},{"normal":[0,1],"dist":-200,"bCoef":0.2,"cMask":["all"]},{"normal":[0,-1],"dist":-200,"bCoef":0.2,"cMask":["all"]},{"normal":[1,0],"dist":-420,"bCoef":0.2,"cMask":["all"]},{"normal":[-1,0],"dist":-420,"bCoef":0.2,"cMask":["all"]}],"traits":{"ballArea":{"vis":false,"bCoef":1,"cMask":["ball"]},"goalPost":{"radius":8,"invMass":0,"bCoef":1},"goalNet":{"vis":true,"bCoef":0.1,"cMask":["all"]},"kickOffBarrier":{"vis":false,"bCoef":0.1,"cGroup":["redKO","blueKO"],"cMask":["red","blue"]},"line":{"vis":true,"bCoef":0,"cMask":[""]},"arco":{"radius":2,"cMask":["n\/d"],"color":"cccccc"}},"playerPhysics":{"acceleration":0.11,"kickingAcceleration":0.083,"kickStrength":5,"bCoef":0},"ballPhysics":{"radius":6.25,"color":"FFCC00","bCoef":0.4,"invMass":1.5,"damping":0.99}}'; // 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
  38. //var bigMap = '{"name":"FUTSAL FEH 1.2 by KyU","width":630,"height":280,"bg":{"type":"hockey","width":550,"height":240,"kickOffRadius":80},"vertexes":[{"x":-550,"y":240,"cMask":["ball"]},{"x":-550,"y":80,"cMask":["ball"]},{"x":-550,"y":-80,"cMask":["ball"]},{"x":-550,"y":-240,"cMask":["ball"]},{"x":550,"y":240,"cMask":["ball"]},{"x":550,"y":80,"cMask":["ball"]},{"x":550,"y":-80,"cMask":["ball"]},{"x":550,"y":-240,"cMask":["ball"]},{"x":0,"y":270,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":80,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-80,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":80,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":-557,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":-580,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":-580,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":-557,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":557,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":580,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":580,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":557,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":-550,"y":-160,"cGroup":[]},{"x":-550,"y":160,"cGroup":[]},{"x":-550,"y":-80,"cGroup":[]},{"x":-490,"y":-80,"cGroup":[]},{"x":-490,"y":80,"cGroup":[]},{"x":-550,"y":80,"cGroup":[]},{"x":550,"y":-160,"cGroup":[]},{"x":550,"y":160,"cGroup":[]},{"x":550,"y":-80,"cGroup":[]},{"x":490,"y":-80,"cGroup":[]},{"x":490,"y":80,"cGroup":[]},{"x":550,"y":80,"cGroup":[]},{"x":-420,"y":0,"cGroup":[]},{"x":-422,"y":0,"cGroup":[]},{"x":420,"y":0,"cGroup":[]},{"x":422,"y":0,"cGroup":[]},{"x":-1,"y":0,"cGroup":[]},{"x":2,"y":0,"cGroup":[]},{"x":-548,"y":-230,"cGroup":[]},{"x":-540,"y":-238,"cGroup":[]},{"x":548,"y":-230,"cGroup":[]},{"x":540,"y":-238,"cGroup":[]},{"x":-548,"y":230,"cGroup":[]},{"x":-540,"y":238,"cGroup":[]},{"x":548,"y":230,"cGroup":[]},{"x":540,"y":238,"cGroup":[]},{"x":-550,"y":-197,"cGroup":[]},{"x":-409,"y":-54,"cGroup":[]},{"x":550,"y":-174,"cGroup":[]},{"x":551,"y":171,"cGroup":[]},{"x":-550,"y":87,"cMask":["ball"]},{"x":557,"y":80,"cMask":["ball"]},{"x":557,"y":240,"cMask":["ball"]},{"x":557,"y":-240,"cMask":["ball"]},{"x":557,"y":-80,"cMask":["ball"]},{"x":-555,"y":-240,"cMask":["ball"]},{"x":-555,"y":-80,"cMask":["ball"]},{"x":-557,"y":80,"cMask":["ball"]},{"x":-557,"y":240,"cMask":["ball"]},{"x":-409,"y":44,"cGroup":[]},{"x":-550,"y":206,"cGroup":[]},{"x":549,"y":-196,"cGroup":[]},{"x":409,"y":-55,"cGroup":[]},{"x":409,"y":43,"cGroup":[]},{"x":550,"y":201,"cGroup":[]},{"x":557,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":556,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":555,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":554,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":554,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":553,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":554,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":553,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":552,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":551,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":-557,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":-555,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":-553,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":-551,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":558,"y":-89,"bCoef":0.1,"cMask":["ball"]},{"x":557,"y":93,"bCoef":0.1,"cMask":["ball"]},{"x":-551,"y":88,"bCoef":0.1,"cMask":[]},{"x":-553,"y":88,"bCoef":0.1,"cMask":[]},{"x":-555,"y":88,"bCoef":0.1,"cMask":[]},{"x":-557,"y":88,"bCoef":0.1,"cMask":[]},{"x":557,"y":-88,"bCoef":0.1,"cMask":[]},{"x":557,"y":90,"bCoef":0.1,"cMask":[]},{"x":555,"y":-88,"bCoef":0.1,"cMask":[]},{"x":555,"y":90,"bCoef":0.1,"cMask":[]},{"x":550,"y":-80,"bCoef":0.1,"cMask":[]},{"x":550,"y":81,"bCoef":0.1,"cMask":[]},{"x":550,"y":-74,"bCoef":0.1,"cMask":[]},{"x":550,"y":-56,"bCoef":0.1,"cMask":[]},{"x":550,"y":-31,"bCoef":0.1,"cMask":[]},{"x":550,"y":-13,"bCoef":0.1,"cMask":[]},{"x":550,"y":11,"bCoef":0.1,"cMask":[]},{"x":550,"y":29,"bCoef":0.1,"cMask":[]},{"x":550,"y":55,"bCoef":0.1,"cMask":[]},{"x":550,"y":73,"bCoef":0.1,"cMask":[]},{"x":-282,"y":-1,"cGroup":[]},{"x":-284,"y":-1,"cGroup":[]},{"x":-550,"y":240,"cMask":["ball"],"cGroup":["ball"]},{"x":550,"y":240,"cMask":["ball"],"cGroup":["ball"]},{"x":-550,"y":-240,"cMask":["ball"],"cGroup":["ball"]},{"x":551,"y":-240,"cMask":["ball"],"cGroup":["ball"]},{"x":283,"y":0,"cGroup":[]},{"x":285,"y":0,"cGroup":[]},{"x":-550,"y":-86,"cMask":["ball"]},{"x":-550,"y":-239,"cMask":["ball"]},{"x":-550,"y":80,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-80,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-73,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-55,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-30,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-12,"bCoef":0.1,"cMask":[]},{"x":-550,"y":12,"bCoef":0.1,"cMask":[]},{"x":-550,"y":30,"bCoef":0.1,"cMask":[]},{"x":-550,"y":56,"bCoef":0.1,"cMask":[]},{"x":-550,"y":74,"bCoef":0.1,"cMask":[]},{"x":0,"y":240,"bCoef":0,"cMask":[]},{"x":0,"y":80,"bCoef":0,"cMask":[]},{"x":0,"y":-80,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-270,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-80,"bCoef":0,"cMask":[]},{"x":0,"y":-240,"bCoef":0,"cMask":[]},{"x":0,"y":80,"bCoef":0,"cMask":[]},{"x":0,"y":-80,"bCoef":0,"cMask":[]}],"segments":[{"v0":4,"v1":5,"cMask":["ball"],"color":"FFFFFF"},{"v0":6,"v1":7,"cMask":["ball"],"color":"FFFFFF"},{"v0":12,"v1":13,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":13,"v1":14,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":14,"v1":15,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":16,"v1":17,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":17,"v1":18,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":18,"v1":19,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":32,"v1":33,"cGroup":[],"color":"FFFFFF"},{"v0":34,"v1":35,"cGroup":[],"color":"E0EEE0"},{"v0":36,"v1":37,"cGroup":[],"color":"E0EEE0"},{"v0":39,"v1":38,"curve":80.00000000000001,"curveF":1.19175359259421,"cGroup":[],"color":"E0EEE0"},{"v0":40,"v1":41,"curve":80.00000000000001,"curveF":1.19175359259421,"cGroup":[],"color":"E0EEE0"},{"v0":42,"v1":43,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":45,"v1":44,"curve":80.00000000000001,"curveF":1.19175359259421,"cGroup":[],"color":"E0EEE0"},{"v0":9,"v1":10,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"cMask":["red","blue"],"cGroup":["blueKO"],"color":"FFFFFF"},{"v0":10,"v1":9,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"cMask":["red","blue"],"cGroup":["redKO"],"color":"FFFFFF"},{"v0":46,"v1":47,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":50,"v1":0,"cMask":["ball"],"color":"FFFFFF"},{"v0":51,"v1":52,"vis":false,"cMask":["ball"],"color":"CCCCFF"},{"v0":53,"v1":54,"vis":false,"cMask":["ball"],"color":"CCCCFF"},{"v0":55,"v1":56,"vis":false,"cMask":["ball"],"color":"CCCCFF"},{"v0":57,"v1":58,"vis":false,"cMask":["ball"],"color":"FFCCCC"},{"v0":59,"v1":60,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":47,"v1":59,"cGroup":[],"color":"E0EEE0"},{"v0":62,"v1":61,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":64,"v1":63,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":62,"v1":63,"cGroup":[],"color":"E0EEE0"},{"v0":89,"v1":90,"bCoef":0.1,"cMask":[],"color":"FFFFFF"},{"v0":91,"v1":92,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":93,"v1":94,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":95,"v1":96,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":97,"v1":98,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":99,"v1":100,"cGroup":[],"color":"FFFFFF"},{"v0":101,"v1":102,"cMask":["ball"],"cGroup":["ball"],"color":"FFFFFF"},{"v0":103,"v1":104,"cMask":["ball"],"cGroup":["ball"],"color":"FFFFFF"},{"v0":105,"v1":106,"cGroup":[],"color":"E0EEE0"},{"v0":108,"v1":107,"cMask":["ball"],"color":"FFFFFF"},{"v0":110,"v1":109,"bCoef":0.1,"cMask":[],"color":"FFFFFF"},{"v0":111,"v1":112,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":113,"v1":114,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":115,"v1":116,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":117,"v1":118,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":11,"v1":8,"bCoef":0,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"color":"FFFFFF"},{"v0":120,"v1":119,"bCoef":0,"cMask":[],"color":"FFFFFF"},{"v0":122,"v1":121,"bCoef":0,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"color":"FFFFFF"},{"v0":124,"v1":123,"bCoef":0,"cMask":[],"color":"FFFFFF"},{"v0":126,"v1":125,"bCoef":0,"cMask":[],"color":"FFFFFF"}],"planes":[{"normal":[0,1],"dist":-240,"cMask":["ball"],"cGroup":["ball"]},{"normal":[0,-1],"dist":-240,"cMask":["ball"],"cGroup":["ball"]},{"normal":[0,1],"dist":-270,"bCoef":0.1},{"normal":[0,-1],"dist":-270,"bCoef":0.1},{"normal":[1,0],"dist":-600,"bCoef":0.1},{"normal":[-1,0],"dist":-600,"bCoef":0.1}],"goals":[{"p0":[-550,84],"p1":[-550,-76],"team":"red"},{"p0":[550,80],"p1":[550,-80],"team":"blue"}],"discs":[{"radius":6.4,"color":"E7CC03","cGroup":["ball","kick","score"]},{"pos":[-550,80],"radius":5,"invMass":0},{"pos":[-550,-80],"radius":5,"invMass":0},{"pos":[550,80],"radius":5,"invMass":0},{"pos":[550,-80],"radius":5,"invMass":0}],"playerPhysics":{"acceleration":0.11,"kickingAcceleration":0.1,"kickStrength":7},"ballPhysics":"disc0","spawnDistance":350}';
  39. //MAPA NUEVOS
  40. var aloneMap = '{"name":"FUTSAL No Goal by KyU","width":420,"height":200,"bg":{"width":368,"height":171,"kickOffRadius":65,"color":"505050"},"vertexes":[{"x":-368,"y":171,"cMask":["ball"]},{"x":-368,"y":65,"cMask":["ball"]},{"x":-368,"y":-65,"cMask":["ball"]},{"x":-368,"y":-171,"cMask":["ball"]},{"x":368,"y":171,"cMask":["ball"]},{"x":368,"y":65,"cMask":["ball"]},{"x":368,"y":-65,"cMask":["ball"]},{"x":368,"y":-171,"cMask":["ball"]},{"x":0,"y":65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-65,"bCoef":0,"cMask":[]},{"x":-384,"y":-65,"bCoef":0.1,"cMask":["ball"]},{"x":384,"y":-65,"bCoef":0.1,"cMask":["ball"]},{"x":-384,"y":65,"bCoef":0.1,"cMask":["ball"]},{"x":384,"y":65,"bCoef":0.1,"cMask":["ball"]},{"x":368,"y":171,"cMask":["ball"]},{"x":368,"y":-171,"cMask":["ball"]},{"x":0,"y":171,"bCoef":0,"cMask":[]},{"x":0,"y":-171,"bCoef":0,"cMask":[]},{"x":0,"y":65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":377,"y":-65,"cMask":["ball"]},{"x":377,"y":-171,"cMask":["ball"]},{"x":-377,"y":-65,"cMask":["ball"]},{"x":-377,"y":-171,"cMask":["ball"]},{"x":-377,"y":65,"cMask":["ball"]},{"x":-377,"y":171,"cMask":["ball"]},{"x":377,"y":65,"cMask":["ball"]},{"x":377,"y":171,"cMask":["ball"]},{"x":0,"y":199,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-199,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]}],"segments":[{"v0":0,"v1":1,"vis":false,"cMask":["ball"]},{"v0":2,"v1":3,"vis":false,"cMask":["ball"]},{"v0":4,"v1":5,"vis":false,"cMask":["ball"]},{"v0":6,"v1":7,"vis":false,"cMask":["ball"]},{"v0":8,"v1":9,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"vis":false,"cMask":["red","blue"],"cGroup":["blueKO"]},{"v0":9,"v1":8,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"vis":false,"cMask":["red","blue"],"cGroup":["redKO"]},{"v0":10,"v1":2,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":6,"v1":11,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":1,"v1":12,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":13,"v1":5,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":12,"v1":10,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126,"cMask":["ball"]},{"v0":11,"v1":13,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126,"cMask":["ball"]},{"v0":1,"v1":0,"cMask":["ball"]},{"v0":5,"v1":4,"cMask":["ball"]},{"v0":2,"v1":3,"cMask":["ball"]},{"v0":6,"v1":7,"cMask":["ball"]},{"v0":0,"v1":14,"cMask":["ball"]},{"v0":3,"v1":15,"cMask":["ball"]},{"v0":16,"v1":17,"bCoef":0,"cMask":[]},{"v0":8,"v1":9,"bCoef":0,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":19,"v1":18,"bCoef":0,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":2,"v1":1,"bCoef":0,"cMask":[]},{"v0":6,"v1":5,"bCoef":0,"cMask":[]},{"v0":20,"v1":21,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":22,"v1":23,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":24,"v1":25,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":26,"v1":27,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":28,"v1":29,"bCoef":0.1,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"v0":30,"v1":31,"bCoef":0.1,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]}],"planes":[{"normal":[0,1],"dist":-171,"cMask":["ball"]},{"normal":[0,-1],"dist":-171,"cMask":["ball"]},{"normal":[0,1],"dist":-200,"bCoef":0.2},{"normal":[0,-1],"dist":-200,"bCoef":0.2},{"normal":[1,0],"dist":-420,"bCoef":0.2},{"normal":[-1,0],"dist":-420,"bCoef":0.2}],"goals":[],"discs":[{"radius":6.4,"color":"E7CC03","cGroup":["ball","kick","score"]},{"pos":[-368,65],"radius":5,"bCoef":1,"invMass":0,"color":"FF4136"},{"pos":[-368,-65],"radius":5,"bCoef":1,"invMass":0,"color":"FF4136"},{"pos":[368,65],"radius":5,"bCoef":1,"invMass":0,"color":"74D9"},{"pos":[368,-65],"radius":5,"bCoef":1,"invMass":0,"color":"74D9"}],"playerPhysics":{"acceleration":0.11,"kickingAcceleration":0.1,"kickStrength":7},"ballPhysics":"disc0","spawnDistance":180}';
  41. var classicMap ='{"name":"FUTSAL 1v1 2v2 by KyU","width":420,"height":200,"bg":{"width":368,"height":171,"kickOffRadius":65,"color":"505050"},"vertexes":[{"x":-368,"y":171,"cMask":["ball"]},{"x":-368,"y":65,"cMask":["ball"]},{"x":-368,"y":-65,"cMask":["ball"]},{"x":-368,"y":-171,"cMask":["ball"]},{"x":368,"y":171,"cMask":["ball"]},{"x":368,"y":65,"cMask":["ball"]},{"x":368,"y":-65,"cMask":["ball"]},{"x":368,"y":-171,"cMask":["ball"]},{"x":0,"y":65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-65,"bCoef":0,"cMask":[]},{"x":-384,"y":-65,"bCoef":0.1,"cMask":["ball"]},{"x":384,"y":-65,"bCoef":0.1,"cMask":["ball"]},{"x":-384,"y":65,"bCoef":0.1,"cMask":["ball"]},{"x":384,"y":65,"bCoef":0.1,"cMask":["ball"]},{"x":368,"y":171,"cMask":["ball"]},{"x":368,"y":-171,"cMask":["ball"]},{"x":0,"y":171,"bCoef":0,"cMask":[]},{"x":0,"y":-171,"bCoef":0,"cMask":[]},{"x":0,"y":65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":377,"y":-65,"cMask":["ball"]},{"x":377,"y":-171,"cMask":["ball"]},{"x":-377,"y":-65,"cMask":["ball"]},{"x":-377,"y":-171,"cMask":["ball"]},{"x":-377,"y":65,"cMask":["ball"]},{"x":-377,"y":171,"cMask":["ball"]},{"x":377,"y":65,"cMask":["ball"]},{"x":377,"y":171,"cMask":["ball"]},{"x":0,"y":199,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-65,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-199,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]}],"segments":[{"v0":0,"v1":1,"vis":false,"cMask":["ball"]},{"v0":2,"v1":3,"vis":false,"cMask":["ball"]},{"v0":4,"v1":5,"vis":false,"cMask":["ball"]},{"v0":6,"v1":7,"vis":false,"cMask":["ball"]},{"v0":8,"v1":9,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"vis":false,"cMask":["red","blue"],"cGroup":["blueKO"]},{"v0":9,"v1":8,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"vis":false,"cMask":["red","blue"],"cGroup":["redKO"]},{"v0":10,"v1":2,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":6,"v1":11,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":1,"v1":12,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":13,"v1":5,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126},{"v0":12,"v1":10,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126,"cMask":["ball"]},{"v0":11,"v1":13,"bCoef":0.1,"curve":35,"curveF":3.1715948023632126,"cMask":["ball"]},{"v0":1,"v1":0,"cMask":["ball"]},{"v0":5,"v1":4,"cMask":["ball"]},{"v0":2,"v1":3,"cMask":["ball"]},{"v0":6,"v1":7,"cMask":["ball"]},{"v0":0,"v1":14,"cMask":["ball"]},{"v0":3,"v1":15,"cMask":["ball"]},{"v0":16,"v1":17,"bCoef":0,"cMask":[]},{"v0":8,"v1":9,"bCoef":0,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":19,"v1":18,"bCoef":0,"curve":180,"curveF":6.123233995736766e-17,"cMask":[]},{"v0":2,"v1":1,"bCoef":0,"cMask":[]},{"v0":6,"v1":5,"bCoef":0,"cMask":[]},{"v0":20,"v1":21,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":22,"v1":23,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":24,"v1":25,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":26,"v1":27,"vis":false,"cMask":["ball"],"color":"FFFFFF"},{"v0":28,"v1":29,"bCoef":0.1,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"v0":30,"v1":31,"bCoef":0.1,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]}],"planes":[{"normal":[0,1],"dist":-171,"cMask":["ball"]},{"normal":[0,-1],"dist":-171,"cMask":["ball"]},{"normal":[0,1],"dist":-200,"bCoef":0.2},{"normal":[0,-1],"dist":-200,"bCoef":0.2},{"normal":[1,0],"dist":-420,"bCoef":0.2},{"normal":[-1,0],"dist":-420,"bCoef":0.2}],"goals":[{"p0":[-377,-65],"p1":[-377,65],"team":"red"},{"p0":[377,65],"p1":[377,-65],"team":"blue"}],"discs":[{"radius":6.4,"color":"E7CC03","cGroup":["ball","kick","score"]},{"pos":[-368,65],"radius":5,"bCoef":1,"invMass":0,"color":"FF4136"},{"pos":[-368,-65],"radius":5,"bCoef":1,"invMass":0,"color":"FF4136"},{"pos":[368,65],"radius":5,"bCoef":1,"invMass":0,"color":"74D9"},{"pos":[368,-65],"radius":5,"bCoef":1,"invMass":0,"color":"74D9"}],"playerPhysics":{"acceleration":0.11,"kickingAcceleration":0.1,"kickStrength":7},"ballPhysics":"disc0","spawnDistance":180}';
  42. var bigMap = '{"name":"FUTSAL FEH 1.3 by KyU","width":630,"height":280,"bg":{"type":"hockey","kickOffRadius":80},"vertexes":[{"x":-550,"y":240,"cMask":["ball"]},{"x":-550,"y":80,"cMask":["ball"]},{"x":-550,"y":-80,"cMask":["ball"]},{"x":-550,"y":-240,"cMask":["ball"]},{"x":550,"y":240,"cMask":["ball"]},{"x":550,"y":80,"cMask":["ball"]},{"x":550,"y":-80,"cMask":["ball"]},{"x":550,"y":-240,"cMask":["ball"]},{"x":0,"y":270,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":80,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-80,"bCoef":0.1,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":80,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":-557,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":-580,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":-580,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":-557,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":557,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":580,"y":-80,"bCoef":0.1,"cMask":["ball"]},{"x":580,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":557,"y":80,"bCoef":0.1,"cMask":["ball"]},{"x":-550,"y":-160,"cGroup":[]},{"x":-550,"y":160,"cGroup":[]},{"x":-550,"y":-80,"cGroup":[]},{"x":-490,"y":-80,"cGroup":[]},{"x":-490,"y":80,"cGroup":[]},{"x":-550,"y":80,"cGroup":[]},{"x":550,"y":-160,"cGroup":[]},{"x":550,"y":160,"cGroup":[]},{"x":550,"y":-80,"cGroup":[]},{"x":490,"y":-80,"cGroup":[]},{"x":490,"y":80,"cGroup":[]},{"x":550,"y":80,"cGroup":[]},{"x":-420,"y":0,"cGroup":[]},{"x":-422,"y":0,"cGroup":[]},{"x":420,"y":0,"cGroup":[]},{"x":422,"y":0,"cGroup":[]},{"x":-1,"y":0,"cGroup":[]},{"x":2,"y":0,"cGroup":[]},{"x":-548,"y":-230,"cGroup":[]},{"x":-540,"y":-238,"cGroup":[]},{"x":548,"y":-230,"cGroup":[]},{"x":540,"y":-238,"cGroup":[]},{"x":-548,"y":230,"cGroup":[]},{"x":-540,"y":238,"cGroup":[]},{"x":548,"y":230,"cGroup":[]},{"x":540,"y":238,"cGroup":[]},{"x":-550,"y":-197,"cGroup":[]},{"x":-409,"y":-54,"cGroup":[]},{"x":550,"y":-174,"cGroup":[]},{"x":551,"y":171,"cGroup":[]},{"x":-550,"y":87,"cMask":["ball"]},{"x":557,"y":80,"cMask":["ball"]},{"x":557,"y":240,"cMask":["ball"]},{"x":557,"y":-240,"cMask":["ball"]},{"x":557,"y":-80,"cMask":["ball"]},{"x":-555,"y":-240,"cMask":["ball"]},{"x":-555,"y":-80,"cMask":["ball"]},{"x":-557,"y":80,"cMask":["ball"]},{"x":-557,"y":240,"cMask":["ball"]},{"x":-409,"y":44,"cGroup":[]},{"x":-550,"y":206,"cGroup":[]},{"x":549,"y":-196,"cGroup":[]},{"x":409,"y":-55,"cGroup":[]},{"x":409,"y":43,"cGroup":[]},{"x":550,"y":201,"cGroup":[]},{"x":557,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":556,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":555,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":554,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":554,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":553,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":554,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":553,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":552,"y":-90,"bCoef":0.1,"cMask":["ball"]},{"x":551,"y":92,"bCoef":0.1,"cMask":["ball"]},{"x":-557,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":-555,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":-553,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":-551,"y":94,"bCoef":0.1,"cMask":["ball"]},{"x":558,"y":-89,"bCoef":0.1,"cMask":["ball"]},{"x":557,"y":93,"bCoef":0.1,"cMask":["ball"]},{"x":-551,"y":88,"bCoef":0.1,"cMask":[]},{"x":-553,"y":88,"bCoef":0.1,"cMask":[]},{"x":-555,"y":88,"bCoef":0.1,"cMask":[]},{"x":-557,"y":88,"bCoef":0.1,"cMask":[]},{"x":557,"y":-88,"bCoef":0.1,"cMask":[]},{"x":557,"y":90,"bCoef":0.1,"cMask":[]},{"x":555,"y":-88,"bCoef":0.1,"cMask":[]},{"x":555,"y":90,"bCoef":0.1,"cMask":[]},{"x":550,"y":-80,"bCoef":0.1,"cMask":[]},{"x":550,"y":81,"bCoef":0.1,"cMask":[]},{"x":550,"y":-74,"bCoef":0.1,"cMask":[]},{"x":550,"y":-56,"bCoef":0.1,"cMask":[]},{"x":550,"y":-31,"bCoef":0.1,"cMask":[]},{"x":550,"y":-13,"bCoef":0.1,"cMask":[]},{"x":550,"y":11,"bCoef":0.1,"cMask":[]},{"x":550,"y":29,"bCoef":0.1,"cMask":[]},{"x":550,"y":55,"bCoef":0.1,"cMask":[]},{"x":550,"y":73,"bCoef":0.1,"cMask":[]},{"x":-282,"y":-1,"cGroup":[]},{"x":-284,"y":-1,"cGroup":[]},{"x":-550,"y":240,"cMask":["ball"],"cGroup":["ball"]},{"x":550,"y":240,"cMask":["ball"],"cGroup":["ball"]},{"x":-550,"y":-240,"cMask":["ball"],"cGroup":["ball"]},{"x":551,"y":-240,"cMask":["ball"],"cGroup":["ball"]},{"x":283,"y":0,"cGroup":[]},{"x":285,"y":0,"cGroup":[]},{"x":-550,"y":-86,"cMask":["ball"]},{"x":-550,"y":-239,"cMask":["ball"]},{"x":-550,"y":80,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-80,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-73,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-55,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-30,"bCoef":0.1,"cMask":[]},{"x":-550,"y":-12,"bCoef":0.1,"cMask":[]},{"x":-550,"y":12,"bCoef":0.1,"cMask":[]},{"x":-550,"y":30,"bCoef":0.1,"cMask":[]},{"x":-550,"y":56,"bCoef":0.1,"cMask":[]},{"x":-550,"y":74,"bCoef":0.1,"cMask":[]},{"x":0,"y":240,"bCoef":0,"cMask":[]},{"x":0,"y":80,"bCoef":0,"cMask":[]},{"x":0,"y":-80,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-270,"bCoef":0,"cMask":["red","blue"],"cGroup":["redKO","blueKO"]},{"x":0,"y":-80,"bCoef":0,"cMask":[]},{"x":0,"y":-240,"bCoef":0,"cMask":[]},{"x":0,"y":80,"bCoef":0,"cMask":[]},{"x":0,"y":-80,"bCoef":0,"cMask":[]}],"segments":[{"v0":4,"v1":5,"cMask":["ball"],"color":"FFFFFF"},{"v0":6,"v1":7,"cMask":["ball"],"color":"FFFFFF"},{"v0":12,"v1":13,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":13,"v1":14,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":14,"v1":15,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":16,"v1":17,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":17,"v1":18,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":18,"v1":19,"bCoef":0.1,"cMask":["ball"],"color":"FFFFFF"},{"v0":32,"v1":33,"cGroup":[],"color":"FFFFFF"},{"v0":34,"v1":35,"cGroup":[],"color":"E0EEE0"},{"v0":36,"v1":37,"cGroup":[],"color":"E0EEE0"},{"v0":39,"v1":38,"curve":80.00000000000001,"curveF":1.19175359259421,"cGroup":[],"color":"E0EEE0"},{"v0":40,"v1":41,"curve":80.00000000000001,"curveF":1.19175359259421,"cGroup":[],"color":"E0EEE0"},{"v0":42,"v1":43,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":45,"v1":44,"curve":80.00000000000001,"curveF":1.19175359259421,"cGroup":[],"color":"E0EEE0"},{"v0":9,"v1":10,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"cMask":["red","blue"],"cGroup":["blueKO"],"color":"FFFFFF"},{"v0":10,"v1":9,"bCoef":0.1,"curve":180,"curveF":6.123233995736766e-17,"cMask":["red","blue"],"cGroup":["redKO"],"color":"FFFFFF"},{"v0":46,"v1":47,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":50,"v1":0,"cMask":["ball"],"color":"FFFFFF"},{"v0":51,"v1":52,"vis":false,"cMask":["ball"],"color":"CCCCFF"},{"v0":53,"v1":54,"vis":false,"cMask":["ball"],"color":"CCCCFF"},{"v0":55,"v1":56,"vis":false,"cMask":["ball"],"color":"CCCCFF"},{"v0":57,"v1":58,"vis":false,"cMask":["ball"],"color":"FFCCCC"},{"v0":59,"v1":60,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":47,"v1":59,"cGroup":[],"color":"E0EEE0"},{"v0":62,"v1":61,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":64,"v1":63,"curve":89.99999999999999,"curveF":1.0000000000000002,"cGroup":[],"color":"E0EEE0"},{"v0":62,"v1":63,"cGroup":[],"color":"E0EEE0"},{"v0":89,"v1":90,"bCoef":0.1,"cMask":[],"color":"FFFFFF"},{"v0":91,"v1":92,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":93,"v1":94,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":95,"v1":96,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":97,"v1":98,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":99,"v1":100,"cGroup":[],"color":"FFFFFF"},{"v0":101,"v1":102,"cMask":["ball"],"cGroup":["ball"],"color":"FFFFFF"},{"v0":103,"v1":104,"cMask":["ball"],"cGroup":["ball"],"color":"FFFFFF"},{"v0":105,"v1":106,"cGroup":[],"color":"E0EEE0"},{"v0":108,"v1":107,"cMask":["ball"],"color":"FFFFFF"},{"v0":110,"v1":109,"bCoef":0.1,"cMask":[],"color":"FFFFFF"},{"v0":111,"v1":112,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":113,"v1":114,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":115,"v1":116,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":117,"v1":118,"bCoef":0.1,"cMask":[],"color":"CF0000"},{"v0":11,"v1":8,"bCoef":0,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"color":"FFFFFF"},{"v0":120,"v1":119,"bCoef":0,"cMask":[],"color":"FFFFFF"},{"v0":122,"v1":121,"bCoef":0,"vis":false,"cMask":["red","blue"],"cGroup":["redKO","blueKO"],"color":"FFFFFF"},{"v0":124,"v1":123,"bCoef":0,"cMask":[],"color":"FFFFFF"},{"v0":126,"v1":125,"bCoef":0,"cMask":[],"color":"FFFFFF"}],"planes":[{"normal":[0,1],"dist":-240,"cMask":["ball"],"cGroup":["ball"]},{"normal":[0,-1],"dist":-240,"cMask":["ball"],"cGroup":["ball"]},{"normal":[0,1],"dist":-270,"bCoef":0.1},{"normal":[0,-1],"dist":-270,"bCoef":0.1},{"normal":[1,0],"dist":-600,"bCoef":0.1},{"normal":[-1,0],"dist":-600,"bCoef":0.1}],"goals":[{"p0":[-550,84],"p1":[-550,-76],"team":"red"},{"p0":[550,80],"p1":[550,-80],"team":"blue"}],"discs":[{"radius":6.4,"color":"E7CC03","cGroup":["ball","kick","score"]},{"pos":[-550,80],"radius":5,"invMass":0},{"pos":[-550,-80],"radius":5,"invMass":0},{"pos":[550,80],"radius":5,"invMass":0},{"pos":[550,-80],"radius":5,"invMass":0}],"playerPhysics":{"acceleration":0.11,"kickingAcceleration":0.1,"kickStrength":7},"ballPhysics":"disc0","spawnDistance":350}';
  43. /* OPTIONS */
  44.  
  45. var afkLimit = 10;
  46. var drawTimeLimit = Infinity;
  47. var maxTeamSize = 3; // This works for 1 (you might want to adapt things to remove some useless stats in 1v1 like assist or cs), 2, 3 or 4
  48. var slowMode = 0;
  49.  
  50. /* PLAYERS */
  51.  
  52. const Team = { SPECTATORS: 0, RED: 1, BLUE: 2 };
  53. var extendedP = [];
  54. const eP = { ID: 0, AUTH: 1, CONN: 2, AFK: 3, ACT: 4, GK: 5, MUTE: 6 };
  55. 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}
  56. var players;
  57. var teamR;
  58. var teamB;
  59. var teamS;
  60. var bannedPlayers = []; // Añade las id de conn de los usuarios que quieres banear,
  61. //ejemplo: var bannedPlayers = ["32908734", "4585454", "046464646"]
  62.  
  63. /*
  64. 1 - Zape - "3138382E3233392E3135302E3730"
  65. */
  66.  
  67. var playersAllowed = [{name: 'jocko', auth: 'GqkJQKS5ioDQPTcr3pMjjWjUimVHlYUYYQf_lYQrcOM'},
  68. {name: 'Gimenez', auth: 'A6aDCkbi9PYjDCoBYqhM1xVam4MDzpxlR975NtK_Xus'}
  69.  
  70. ]; // [{name: 'test', auth: '123'}, {...}, {...}]
  71.  
  72. /* GAME */
  73.  
  74. var lastTeamTouched;
  75. 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)
  76. var countAFK = false; // Created to get better track of activity
  77. var activePlay = false; // Created to get better track of the possession
  78. var goldenGoal = false;
  79. var SMSet = new Set(); // Set created to get slow mode which is useful in chooseMode
  80. var banList = []; // Getting track of the bans, so we can unban ppl if we want
  81.  
  82. /* STATS */
  83.  
  84. var game;
  85. var GKList = ["",""];
  86. var Rposs = 0;
  87. var Bposs = 0;
  88. var point = [{"x": 0, "y": 0}, {"x": 0, "y": 0}]; // created to get ball speed
  89. var ballSpeed;
  90. var lastWinner = Team.SPECTATORS;
  91. var streak = 0;
  92. 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 ...
  93. var allReds = []; // ... those who came in a very unequal game.
  94.  
  95. /* BALANCE & CHOOSE */
  96.  
  97. var inChooseMode = false; // This variable enables to distinguish the 2 phases of playing and choosing which should be dealt with very differently
  98. var redCaptainChoice = "";
  99. var blueCaptainChoice = "";
  100. var chooseTime = 20;
  101. var timeOutCap;
  102.  
  103. /* AUXILIARY */
  104.  
  105. var checkTimeVariable = false; // This is created so the chat doesn't get spammed when a game is ending via timeLimit
  106. var statNumber = 0; // This allows the room to be given stat information every X minutes
  107. 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
  108. var resettingTeams = false;
  109. var capLeft = false;
  110. var statInterval = 6;
  111. var discordInterval = 5;
  112.  
  113.  
  114. loadMap(aloneMap, 0, 0);
  115.  
  116. /* OBJECTS */
  117.  
  118. function Goal(time, team, striker, assist) {
  119. this.time = time;
  120. this.team = team;
  121. this.striker = striker;
  122. this.assist = assist;
  123. }
  124.  
  125. function Game(date, scores, goals) {
  126. this.date = date;
  127. this.scores = scores;
  128. this.goals = goals;
  129. }
  130.  
  131. /* FUNCTIONS */
  132.  
  133. /* AUXILIARY FUNCTIONS */
  134.  
  135. function getRandomInt(max) { // returns a random number from 0 to max-1
  136. return Math.floor(Math.random() * Math.floor(max));
  137. }
  138.  
  139. function getTime(scores) { // returns the current time of the game
  140. 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() + "]"
  141. }
  142.  
  143. function pointDistance(p1, p2) {
  144. var d1 = p1.x - p2.x;
  145. var d2 = p1.y - p2.y;
  146. return Math.sqrt(d1 * d1 + d2 * d2);
  147. }
  148.  
  149. /* BUTTONS */
  150.  
  151. function topBtn() {
  152. if (teamS.length == 0) {
  153. return;
  154. }
  155. else {
  156. if (teamR.length == teamB.length) {
  157. if (teamS.length > 1) {
  158. room.setPlayerTeam(teamS[0].id, Team.RED);
  159. room.setPlayerTeam(teamS[1].id, Team.BLUE);
  160. }
  161. return;
  162. }
  163. else if (teamR.length < teamB.length) {
  164. room.setPlayerTeam(teamS[0].id, Team.RED);
  165. }
  166. else {
  167. room.setPlayerTeam(teamS[0].id, Team.BLUE);
  168. }
  169. }
  170. }
  171.  
  172. function randomBtn() {
  173. if (teamS.length == 0) {
  174. return;
  175. }
  176. else {
  177. if (teamR.length == teamB.length) {
  178. if (teamS.length > 1) {
  179. var r = getRandomInt(teamS.length);
  180. room.setPlayerTeam(teamS[r].id, Team.RED);
  181. teamS = teamS.filter((spec) => spec.id != teamS[r].id);
  182. room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE);
  183. }
  184. return;
  185. }
  186. else if (teamR.length < teamB.length) {
  187. room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.RED);
  188. }
  189. else {
  190. room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE);
  191. }
  192. }
  193. }
  194.  
  195. function blueToSpecBtn() {
  196. resettingTeams = true;
  197. setTimeout(() => { resettingTeams = false; }, 100);
  198. for (var i = 0; i < teamB.length; i++) {
  199. room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS);
  200. }
  201. }
  202.  
  203. function redToSpecBtn() {
  204. resettingTeams = true;
  205. setTimeout(() => { resettingTeams = false; }, 100);
  206. for (var i = 0; i < teamR.length; i++) {
  207. room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS);
  208. }
  209. }
  210.  
  211. function resetBtn() {
  212. resettingTeams = true;
  213. setTimeout(() => { resettingTeams = false; }, 100);
  214. if (teamR.length <= teamB.length) {
  215. for (var i = 0; i < teamR.length; i++) {
  216. room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS);
  217. room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS);
  218. }
  219. for (var i = teamR.length; i < teamB.length; i++) {
  220. room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS);
  221. }
  222. }
  223. else {
  224. for (var i = 0; i < teamB.length; i++) {
  225. room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS);
  226. room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS);
  227. }
  228. for (var i = teamB.length; i < teamR.length; i++) {
  229. room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS);
  230. }
  231. }
  232. }
  233.  
  234. function blueToRedBtn() {
  235. resettingTeams = true;
  236. setTimeout(() => { resettingTeams = false; }, 100);
  237. for (var i = 0; i < teamB.length; i++) {
  238. room.setPlayerTeam(teamB[i].id, Team.RED);
  239. }
  240. }
  241.  
  242. /* GAME FUNCTIONS */
  243.  
  244. function checkTime() {
  245. const scores = room.getScores();
  246. game.scores = scores;
  247. if (Math.abs(scores.time - scores.timeLimit) <= 0.01 && scores.timeLimit != 0) {
  248. if (scores.red != scores.blue) {
  249. if (checkTimeVariable == false) {
  250. checkTimeVariable = true;
  251. setTimeout(() => { checkTimeVariable = false; }, 3000);
  252. scores.red > scores.blue ? endGame(Team.RED) : endGame(Team.BLUE);
  253. setTimeout(() => { room.stopGame(); }, 2000);
  254. }
  255. return;
  256. }
  257. goldenGoal = true;
  258. room.sendChat("⚽ Gol gana !");
  259. }
  260. if (Math.abs(drawTimeLimit * 60 - scores.time - 60) <= 0.01 && players.length > 2) {
  261. if (checkTimeVariable == false) {
  262. checkTimeVariable = true;
  263. setTimeout(() => { checkTimeVariable = false; }, 10);
  264. room.sendChat("⌛ Quedan 60 segundos para que termine el partido !");
  265. }
  266. }
  267. if (Math.abs(scores.time - drawTimeLimit * 60) <= 0.01 && players.length > 2) {
  268. if (checkTimeVariable == false) {
  269. checkTimeVariable = true;
  270. setTimeout(() => { checkTimeVariable = false; }, 10);
  271. endGame(Team.SPECTATORS);
  272. room.stopGame();
  273. goldenGoal = false;
  274. }
  275. }
  276. }
  277.  
  278. function endGame(winner) { // handles the end of a game : no stopGame function inside
  279. players.length >= 2 * maxTeamSize - 1 ? activateChooseMode() : null;
  280. const scores = room.getScores();
  281. game.scores = scores;
  282. Rposs = Rposs/(Rposs+Bposs);
  283. Bposs = 1 - Rposs;
  284. lastWinner = winner;
  285. endGameVariable = true;
  286. if (winner == Team.RED) {
  287. streak++;
  288. room.sendChat("🔴 El Red Team ganó " + scores.red + "-" + scores.blue + " ! Victorias consecutivas : " + streak + " 🏆");
  289. }
  290. else if (winner == Team.BLUE) {
  291. streak = 1;
  292. room.sendChat("🔵 El Blue Team ganó " + scores.blue + "-" + scores.red + " ! Victorias consecutivas : " + streak + " 🏆");
  293. }
  294. else {
  295. streak = 0;
  296. room.sendChat("💤 Límite de empate, terminado! 💤");
  297. }
  298. room.sendChat("⭐ Posesión del balón : 🔴 " + (Rposs*100).toPrecision(3).toString() + "% : " + (Bposs*100).toPrecision(3).toString() + "% 🔵");
  299. scores.red == 0 ? (scores.blue == 0 ? room.sendChat("🏆 " + GKList[0].name + " y " + GKList[1].name + " mantuvieron la portería invicta ! ") : room.sendChat("🏆 " + GKList[1].name + " mantuvo la portería invicta ! ")) : scores.blue == 0 ? room.sendChat("🏆 " + GKList[0].name + " mantuvo la portería invicta ! ") : null;
  300. updateStats();
  301. }
  302.  
  303. function quickRestart() {
  304. room.stopGame();
  305. setTimeout(() => { room.startGame(); }, 2000);
  306. }
  307.  
  308. function resumeGame() {
  309. setTimeout(() => { room.startGame(); }, 2000);
  310. setTimeout(() => { room.pauseGame(false); }, 1000);
  311. }
  312.  
  313. function activateChooseMode() {
  314. inChooseMode = true;
  315. slowMode = 2;
  316. room.sendChat("Modo lento activado (2 segundos)!");
  317. }
  318.  
  319. function deactivateChooseMode() {
  320. inChooseMode = false;
  321. clearTimeout(timeOutCap);
  322. if (slowMode != 0) {
  323. slowMode = 0;
  324. room.sendChat("Modo lento terminado.");
  325. }
  326. redCaptainChoice = "";
  327. blueCaptainChoice = "";
  328. }
  329.  
  330. function loadMap(map, scoreLim, timeLim) {
  331. if (map == aloneMap) {
  332. room.setCustomStadium(aloneMap);
  333. }
  334. else if (map == classicMap) {
  335. (classicMap != '') ? room.setCustomStadium(classicMap) : room.setDefaultStadium("Classic");
  336. }
  337. else if (map == bigMap) {
  338. (bigMap != '.') ? room.setCustomStadium(bigMap) : room.setDefaultStadium("Big");
  339. }
  340. else {
  341. room.setCustomStadium(map);
  342. }
  343. room.setScoreLimit(scoreLim);
  344. room.setTimeLimit(timeLim);
  345. }
  346.  
  347. /* PLAYER FUNCTIONS */
  348.  
  349. function updateTeams() { // update the players' list and all the teams' list
  350. players = room.getPlayerList().filter((player) => player.id != 0 && !getAFK(player));
  351. teamR = players.filter(p => p.team === Team.RED);
  352. teamB = players.filter(p => p.team === Team.BLUE);
  353. teamS = players.filter(p => p.team === Team.SPECTATORS);
  354. }
  355.  
  356. function handleInactivity() { // handles inactivity : players will be kicked after afkLimit
  357. if (countAFK && (teamR.length + teamB.length) > 1) {
  358. for (var i = 0; i < teamR.length ; i++) {
  359. setActivity(teamR[i], getActivity(teamR[i]) + 1);
  360. }
  361. for (var i = 0; i < teamB.length ; i++) {
  362. setActivity(teamB[i], getActivity(teamB[i]) + 1);
  363. }
  364. }
  365. for (var i = 0; i < extendedP.length ; i++) {
  366. if (extendedP[i][eP.ACT] == 60 * (2/3 * afkLimit)) {
  367. room.sendChat("[PV] ⛔ @" + room.getPlayer(extendedP[i][eP.ID]).name + ", si no te mueves o envías un mensaje dentro de los siguientes " + Math.floor(afkLimit / 3) + " segundos, seras kickeado!", extendedP[i][eP.ID]);
  368. }
  369. if (extendedP[i][eP.ACT] >= 60 * afkLimit) {
  370. extendedP[i][eP.ACT] = 0;
  371. if (room.getScores().time <= afkLimit - 0.5) {
  372. setTimeout(() => { !inChooseMode ? quickRestart() : room.stopGame(); }, 10);
  373. }
  374. room.kickPlayer(extendedP[i][eP.ID], "AFK", false);
  375. }
  376. }
  377. }
  378.  
  379. function getAuth(player) {
  380. return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.AUTH] : null;
  381. }
  382.  
  383. function getAFK(player) {
  384. return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.AFK] : null;
  385. }
  386.  
  387. function setAFK(player, value) {
  388. extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.AFK] = value);
  389. }
  390.  
  391. function getActivity(player) {
  392. return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.ACT] : null;
  393. }
  394.  
  395. function setActivity(player, value) {
  396. extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.ACT] = value);
  397. }
  398.  
  399. function getGK(player) {
  400. return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.GK] : null;
  401. }
  402.  
  403. function setGK(player, value) {
  404. extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.GK] = value);
  405. }
  406.  
  407. function getMute(player) {
  408. return extendedP.filter((a) => a[0] == player.id) != null ? extendedP.filter((a) => a[0] == player.id)[0][eP.MUTE] : null;
  409. }
  410.  
  411. function setMute(player, value) {
  412. extendedP.filter((a) => a[0] == player.id).forEach((player) => player[eP.MUTE] = value);
  413. }
  414.  
  415. /* BALANCE & CHOOSE FUNCTIONS */
  416.  
  417. function updateRoleOnPlayerIn() {
  418. updateTeams();
  419. if (inChooseMode) {
  420. if (players.length == 6) {
  421. loadMap(bigMap, scoreLimitBig, timeLimitBig);
  422. }
  423. getSpecList(teamR.length <= teamB.length ? teamR[0] : teamB[0]);
  424. }
  425. balanceTeams();
  426. }
  427.  
  428. function updateRoleOnPlayerOut() {
  429. updateTeams();
  430. if (room.getScores() != null) {
  431. var scores = room.getScores();
  432. if (players.length >= 2 * maxTeamSize && scores.time >= (5/6) * game.scores.timeLimit && teamR.length != teamB.length) {
  433. if (teamR.length < teamB.length) {
  434. if (scores.blue - scores.red == 2) {
  435. endGame(Team.BLUE);
  436. room.sendChat("🤖 Abandono detectado. Juego terminado 🤖");
  437. setTimeout(() => { room.stopGame(); }, 100);
  438. return;
  439. }
  440. }
  441. else {
  442. if (scores.red - scores.blue == 2) {
  443. endGame(Team.RED);
  444. room.sendChat("🤖 Abandono detectado. Juego terminado 🤖");
  445. setTimeout(() => { room.stopGame(); }, 100);
  446. return;
  447. }
  448. }
  449. }
  450. }
  451. if (inChooseMode) {
  452. if (players.length == 5) {
  453. loadMap(classicMap, scoreLimitClassic, timeLimitClassic);
  454. }
  455. if (teamR.length == 0 || teamB.length == 0) {
  456. teamR.length == 0 ? room.setPlayerTeam(teamS[0].id, Team.RED) : room.setPlayerTeam(teamS[0].id, Team.BLUE);
  457. return;
  458. }
  459. if (Math.abs(teamR.length - teamB.length) == teamS.length) {
  460. room.sendChat("No hay alternativa, déjame manejar esta situación ...");
  461. deactivateChooseMode();
  462. resumeGame();
  463. var b = teamS.length;
  464. if (teamR.length > teamB.length) {
  465. for (var i = 0 ; i < b ; i++) {
  466. setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.BLUE); }, 5*i);
  467. }
  468. }
  469. else {
  470. for (var i = 0 ; i < b ; i++) {
  471. setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.RED); }, 5*i);
  472. }
  473. }
  474. return;
  475. }
  476. if (streak == 0 && room.getScores() == null) {
  477. 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
  478. room.sendChat("🤖 Equilibrando equipos... 🤖");
  479. teamR.length > teamB.length ? room.setPlayerTeam(teamR[teamR.length - 1].id, Team.SPECTATORS) : room.setPlayerTeam(teamB[teamB.length - 1].id, Team.SPECTATORS);
  480. }
  481. }
  482. if (teamR.length == teamB.length && teamS.length < 2) {
  483. deactivateChooseMode();
  484. resumeGame();
  485. return;
  486. }
  487. capLeft ? choosePlayer() : getSpecList(teamR.length <= teamB.length ? teamR[0] : teamB[0]);
  488. }
  489. balanceTeams();
  490. }
  491.  
  492. function balanceTeams() {
  493. if (!inChooseMode) {
  494. if (players.length == 1 && teamR.length == 0) {
  495. quickRestart();
  496. loadMap(aloneMap, 0, 0);
  497. room.setPlayerTeam(players[0].id, Team.RED);
  498. }
  499. else if (Math.abs(teamR.length - teamB.length) == teamS.length && teamS.length > 0) {
  500. const n = Math.abs(teamR.length - teamB.length);
  501. if (players.length == 2) {
  502. quickRestart();
  503. loadMap(classicMap, scoreLimitClassic, timeLimitClassic);
  504. }
  505. if (teamR.length > teamB.length) {
  506. for (var i = 0 ; i < n ; i++) {
  507. room.setPlayerTeam(teamS[i].id, Team.BLUE);
  508. }
  509. }
  510. else {
  511. for (var i = 0 ; i < n ; i++) {
  512. room.setPlayerTeam(teamS[i].id, Team.RED);
  513. }
  514. }
  515. }
  516. else if (Math.abs(teamR.length - teamB.length) > teamS.length) {
  517. const n = Math.abs(teamR.length - teamB.length);
  518. if (players.length == 1) {
  519. quickRestart();
  520. loadMap(aloneMap, 0, 0);
  521. room.setPlayerTeam(players[0].id, Team.RED);
  522. return;
  523. }
  524. else if (players.length == 5) {
  525. quickRestart();
  526. loadMap(classicMap, scoreLimitClassic, timeLimitClassic);
  527. }
  528. if (players.length == maxTeamSize * 2 - 1) {
  529. allReds = [];
  530. allBlues = [];
  531. }
  532. if (teamR.length > teamB.length) {
  533. for (var i = 0 ; i < n ; i++) {
  534. room.setPlayerTeam(teamR[teamR.length - 1 - i].id, Team.SPECTATORS);
  535. }
  536. }
  537. else {
  538. for (var i = 0 ; i < n ; i++) {
  539. room.setPlayerTeam(teamB[teamB.length - 1 - i].id, Team.SPECTATORS);
  540. }
  541. }
  542. }
  543. else if (Math.abs(teamR.length - teamB.length) < teamS.length && teamR.length != teamB.length) {
  544. room.pauseGame(true);
  545. activateChooseMode();
  546. choosePlayer();
  547. }
  548. else if (teamS.length >= 2 && teamR.length == teamB.length && teamR.length < maxTeamSize) {
  549. if (teamR.length == 2) {
  550. quickRestart();
  551. loadMap(bigMap, scoreLimitBig, timeLimitBig);
  552. }
  553. topBtn();
  554. }
  555. }
  556. }
  557.  
  558. function choosePlayer() {
  559. clearTimeout(timeOutCap);
  560. if (teamR.length <= teamB.length && teamR.length != 0) {
  561. room.sendChat("[PV] Para elegir un jugador, ingrese su número en la lista dada o use 'top', 'random' o 'bottom'.", teamR[0].id);
  562. timeOutCap = setTimeout(function (player) { room.sendChat("[PV] Date prisa @" + 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]);
  563. }
  564. else if (teamB.length < teamR.length && teamB.length != 0) {
  565. room.sendChat("[PV] Para elegir un jugador, ingrese su número en la lista dada o use 'top', 'random' o 'bottom'.", teamB[0].id);
  566. timeOutCap = setTimeout(function (player) { room.sendChat("[PV] Date prisa @" + 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]);
  567. }
  568. if (teamR.length != 0 && teamB.length != 0) getSpecList(teamR.length <= teamB.length ? teamR[0] : teamB[0]);
  569. }
  570.  
  571. function getSpecList(player) {
  572. var cstm = "[PV] Jugadores : ";
  573. for (var i = 0 ; i < teamS.length ; i++) {
  574. if (140 - cstm.length < (teamS[i].name + "[" + (i+1) + "], ").length) {
  575. room.sendChat(cstm, player.id);
  576. cstm = "... ";
  577. }
  578. cstm += teamS[i].name + "[" + (i+1) + "], ";
  579. }
  580. cstm = cstm.substring(0,cstm.length - 2);
  581. cstm += ".";
  582. room.sendChat(cstm, player.id);
  583. }
  584.  
  585. function getSpecList1(team, player = null) {
  586. var cstm = "[PV] Spectators : ";
  587. for (i = 0; i < teamS.length; i++) {
  588. if (140 - cstm.length < (teamS[i].name + "[" + (i + 1) + "], ").length) {
  589. if (team == Team.RED && teamR.length > 0) room.sendChat(cstm, teamROrder[0].id);
  590. else if (team == Team.BLUE && teamB.length > 0) room.sendChat(cstm, teamBOrder[0].id);
  591. else if (team == Team.SPECTATORS && player != null) room.sendChat(cstm, player.id);
  592. cstm = "... ";
  593. }
  594. cstm += teamS[i].name + "[" + (i + 1) + "], ";
  595. }
  596. if (cstm == "[PV] Spectators : ") {
  597. if (team == Team.RED && teamR.length > 0) room.sendChat(cstm, teamROrder[0].id);
  598. else if (team == Team.BLUE && teamB.length > 0) room.sendChat(cstm, teamBOrder[0].id);
  599. else if (team == Team.SPECTATORS && player != null) room.sendChat(cstm, player.id);
  600. return;
  601. }
  602. cstm = cstm.substring(0, cstm.length - 2) + ".";
  603. if (team == Team.RED && teamR.length > 0) room.sendChat(cstm, teamROrder[0].id);
  604. else if (team == Team.BLUE && teamB.length > 0) room.sendChat(cstm, teamBOrder[0].id);
  605. else if (team == Team.SPECTATORS && player != null) room.sendChat(cstm, player.id);
  606. }
  607.  
  608. /* STATS FUNCTIONS */
  609.  
  610. function getLastTouchOfTheBall() {
  611. const ballPosition = room.getBallPosition();
  612. updateTeams();
  613. for (var i = 0; i < players.length; i++) {
  614. if (players[i].position != null) {
  615. var distanceToBall = pointDistance(players[i].position, ballPosition);
  616. if (distanceToBall < triggerDistance) {
  617. !activePlay ? activePlay = true : null;
  618. if (lastTeamTouched == players[i].team && lastPlayersTouched[0] != null && lastPlayersTouched[0].id != players[i].id) {
  619. lastPlayersTouched[1] = lastPlayersTouched[0];
  620. lastPlayersTouched[0] = players[i];
  621. }
  622. lastTeamTouched = players[i].team;
  623. }
  624. }
  625. }
  626. }
  627.  
  628. function getStats() { // gives possession, ball speed and GK of each team
  629. if (activePlay) {
  630. updateTeams();
  631. lastTeamTouched == Team.RED ? Rposs++ : Bposs++;
  632. var ballPosition = room.getBallPosition();
  633. point[1] = point[0];
  634. point[0] = ballPosition;
  635. ballSpeed = (pointDistance(point[0], point[1]) * 60 * 60 * 60)/15000;
  636. var k = [-1, Infinity];
  637. for (var i = 0; i < teamR.length; i++) {
  638. if (teamR[i].position.x < k[1]) {
  639. k[0] = teamR[i];
  640. k[1] = teamR[i].position.x;
  641. }
  642. }
  643. k[0] != -1 ? setGK(k[0], getGK(k[0]) + 1) : null;
  644. k = [-1, -Infinity];
  645. for (var i = 0; i < teamB.length; i++) {
  646. if (teamB[i].position.x > k[1]) {
  647. k[0] = teamB[i];
  648. k[1] = teamB[i].position.x;
  649. }
  650. }
  651. k[0] != -1 ? setGK(k[0], getGK(k[0]) + 1) : null;
  652. findGK();
  653. }
  654. }
  655.  
  656. function updateStats() {
  657. 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) {
  658. var stats;
  659. for (var i = 0; i < allReds.length; i++) {
  660. 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];
  661. stats[Ss.GA]++;
  662. lastWinner == Team.RED ? stats[Ss.WI]++ : lastWinner == Team.BLUE ? stats[Ss.LS]++ : stats[Ss.DR]++;
  663. stats[Ss.WR] = (100 * stats[Ss.WI] / stats[Ss.GA]).toPrecision(3);
  664. localStorage.setItem(getAuth(allReds[i]), JSON.stringify(stats));
  665. }
  666. for (var i = 0; i < allBlues.length; i++) {
  667. 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];
  668. stats[Ss.GA]++;
  669. lastWinner == Team.BLUE ? stats[Ss.WI]++ : lastWinner == Team.RED ? stats[Ss.LS]++ : stats[Ss.DR]++;
  670. stats[Ss.WR] = (100 * stats[Ss.WI] / stats[Ss.GA]).toPrecision(3);
  671. localStorage.setItem(getAuth(allBlues[i]), JSON.stringify(stats));
  672. }
  673. for (var i = 0; i < game.goals.length; i++) {
  674. if (game.goals[i].striker != null) {
  675. if ((allBlues.concat(allReds)).findIndex((player) => player.id == game.goals[i].striker.id) != -1) {
  676. stats = JSON.parse(localStorage.getItem(getAuth(game.goals[i].striker)));
  677. stats[Ss.GL]++;
  678. localStorage.setItem(getAuth(game.goals[i].striker), JSON.stringify(stats));
  679. }
  680. }
  681. if (game.goals[i].assist != null) {
  682. if ((allBlues.concat(allReds)).findIndex((player) => player.name == game.goals[i].assist.name) != -1) {
  683. stats = JSON.parse(localStorage.getItem(getAuth(game.goals[i].assist)));
  684. stats[Ss.AS]++;
  685. localStorage.setItem(getAuth(game.goals[i].assist), JSON.stringify(stats));
  686. }
  687. }
  688. }
  689. if (allReds.findIndex((player) => player.id == GKList[0].id) != -1) {
  690. stats = JSON.parse(localStorage.getItem(getAuth(GKList[0])));
  691. stats[Ss.GK]++;
  692. game.scores.blue == 0 ? stats[Ss.CS]++ : null;
  693. stats[Ss.CP] = (100 * stats[Ss.CS] / stats[Ss.GK]).toPrecision(3);
  694. localStorage.setItem(getAuth(GKList[0]), JSON.stringify(stats));
  695. }
  696. if (allBlues.findIndex((player) => player.id == GKList[1].id) != -1) {
  697. stats = JSON.parse(localStorage.getItem(getAuth(GKList[1])));
  698. stats[Ss.GK]++;
  699. game.scores.red == 0 ? stats[Ss.CS]++ : null;
  700. stats[Ss.CP] = (100 * stats[Ss.CS] / stats[Ss.GK]).toPrecision(3);
  701. localStorage.setItem(getAuth(GKList[1]), JSON.stringify(stats));
  702. }
  703. }
  704. }
  705.  
  706. function findGK() {
  707. var tab = [[-1,""], [-1,""]];
  708. for (var i = 0; i < extendedP.length ; i++) {
  709. if (room.getPlayer(extendedP[i][eP.ID]) != null && room.getPlayer(extendedP[i][eP.ID]).team == Team.RED) {
  710. if (tab[0][0] < extendedP[i][eP.GK]) {
  711. tab[0][0] = extendedP[i][eP.GK];
  712. tab[0][1] = room.getPlayer(extendedP[i][eP.ID]);
  713. }
  714. }
  715. else if (room.getPlayer(extendedP[i][eP.ID]) != null && room.getPlayer(extendedP[i][eP.ID]).team == Team.BLUE) {
  716. if (tab[1][0] < extendedP[i][eP.GK]) {
  717. tab[1][0] = extendedP[i][eP.GK];
  718. tab[1][1] = room.getPlayer(extendedP[i][eP.ID]);
  719. }
  720. }
  721. }
  722. GKList = [tab[0][1], tab[1][1]];
  723. }
  724.  
  725. setInterval(() => {
  726. var tableau = [];
  727. if (statNumber % 5 == 0) {
  728. 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])]); } });
  729. if (tableau.length < 5) {
  730. return false;
  731. }
  732. tableau.sort(function (a, b) { return b[1] - a[1]; });
  733. room.sendChat("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]);
  734. }
  735. if (statNumber % 5 == 1) {
  736. 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])]); } });
  737. if (tableau.length < 5) {
  738. return false;
  739. }
  740. tableau.sort(function (a, b) { return b[1] - a[1]; });
  741. room.sendChat("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]);
  742. }
  743. if (statNumber % 5 == 2) {
  744. 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])]); } });
  745. if (tableau.length < 5) {
  746. return false;
  747. }
  748. tableau.sort(function (a, b) { return b[1] - a[1]; });
  749. room.sendChat("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]);
  750. }
  751. if (statNumber % 5 == 3) {
  752. 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])]); } });
  753. if (tableau.length < 5) {
  754. return false;
  755. }
  756. tableau.sort(function (a, b) { return b[1] - a[1]; });
  757. room.sendChat("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]);
  758. }
  759. if (statNumber % 5 == 4) {
  760. 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])]); } });
  761. if (tableau.length < 5) {
  762. return false;
  763. }
  764. tableau.sort(function (a, b) { return b[1] - a[1]; });
  765. room.sendChat("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]);
  766. }
  767. statNumber++;
  768. }, statInterval * 60 * 1000);
  769.  
  770. /* EVENTS */
  771.  
  772. /* PLAYER MOVEMENT */
  773.  
  774. room.onPlayerJoin = function(player) {
  775. var authIsAllowed = false;
  776. var nameIsAllowed = false;
  777.  
  778. playersAllowed.forEach(p => {
  779. if (player.auth == p.auth) {
  780. authIsAllowed = true;
  781.  
  782. if (authIsAllowed && player.name == p.name) {
  783. nameIsAllowed = true;
  784. }
  785. }
  786. })
  787.  
  788. player.test = "asdf";
  789. console.log(player)
  790. if (!authIsAllowed) {
  791. room.kickPlayer(player.id, 'No tienes permiso para entrar en estas salas. Info: https://discord.gg/3MhhZPN', true); // ban
  792. return;
  793. } else {
  794. if (!nameIsAllowed && authIsAllowed) {
  795. room.kickPlayer(player.id, 'Este nickname no corresponde a tu id. Info: https://discord.gg/3MhhZPN', false); // kick
  796. return;
  797. }
  798. }
  799.  
  800. console.log('RETURN')
  801. /*if (player.conn && extendedP) {
  802. extendedP.forEach(p => {
  803. if (player.conn === p[2]) {
  804. room.kickPlayer(p[0], 'Mismo usuario!!!', false);
  805. return;
  806. }
  807. });
  808. }*/
  809. bannedPlayers.forEach(p => {
  810. if (player.conn === p) {
  811. room.kickPlayer(player.id, "You aren't allowed to play on this room", true);
  812. return;
  813. }
  814. })
  815.  
  816. extendedP.push([player.id, player.auth, player.conn, false, 0, 0, false]);
  817. updateRoleOnPlayerIn();
  818. room.sendChat("[PV] 👋 Bienvenido " + player.name + " ! Escriba '!help' para ver los comandos. Entra en nuestro Discord: https://discord.gg/3MhhZPN ", player.id);
  819. //room.sendChat("[PV] 👋 Welcome " + player.name + " ! Type '!help' to see the commands. Join our Discord: https://discord.gg/3MhhZPN ", player.id);
  820.  
  821. if (localStorage.getItem(player.auth) != null) {
  822. if (JSON.parse(localStorage.getItem(player.auth))[Ss.RL] != "player") {
  823. room.setPlayerAdmin(player.id, true);
  824. room.sendChat((JSON.parse(localStorage.getItem(player.auth))[Ss.RL] == "master" ? "Master " : "Admin ") + player.name + " has connected to the room !");
  825. }
  826. }
  827. if (players.length >= maxPlayers - 1) { // Poner contraseña
  828. room.setPassword(password);
  829. }
  830. }
  831.  
  832. room.onPlayerTeamChange = function(changedPlayer, byPlayer) {
  833. if (changedPlayer.id == 0) {
  834. room.setPlayerTeam(0, Team.SPECTATORS);
  835. return;
  836. }
  837. if (getAFK(changedPlayer) && changedPlayer.team != Team.SPECTATORS) {
  838. room.setPlayerTeam(changedPlayer.id, Team.SPECTATORS);
  839. room.sendChat(changedPlayer.name + " está AFK !");
  840. return;
  841. }
  842. updateTeams();
  843. if (room.getScores() != null) {
  844. var scores = room.getScores();
  845. if (changedPlayer.team != Team.SPECTATORS && scores.time <= (3/4) * scores.timeLimit && Math.abs(scores.blue - scores.red) < 2) {
  846. (changedPlayer.team == Team.RED) ? allReds.push(changedPlayer) : allBlues.push(changedPlayer);
  847. }
  848. }
  849. if (changedPlayer.team == Team.SPECTATORS) {
  850. setActivity(changedPlayer, 0);
  851. }
  852. if (inChooseMode && resettingTeams == false && byPlayer.id == 0) {
  853. if (Math.abs(teamR.length - teamB.length) == teamS.length) {
  854. deactivateChooseMode();
  855. resumeGame();
  856. var b = teamS.length;
  857. if (teamR.length > teamB.length) {
  858. for (var i = 0 ; i < b ; i++) {
  859. setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.BLUE); }, 200*i);
  860. }
  861. }
  862. else {
  863. for (var i = 0 ; i < b ; i++) {
  864. setTimeout(() => { room.setPlayerTeam(teamS[0].id, Team.RED); }, 200*i);
  865. }
  866. }
  867. return;
  868. }
  869. else if ((teamR.length == maxTeamSize && teamB.length == maxTeamSize) || (teamR.length == teamB.length && teamS.length < 2)) {
  870. deactivateChooseMode();
  871. resumeGame();
  872. }
  873. else if (teamR.length <= teamB.length && redCaptainChoice != "") { // choice remembered
  874. 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);
  875. return;
  876. }
  877. else if (teamB.length < teamR.length && blueCaptainChoice != "") {
  878. 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);
  879. return;
  880. }
  881. else {
  882. choosePlayer();
  883. }
  884. }
  885. }
  886.  
  887. room.onPlayerLeave = function(player) {
  888. if (player.team !== 0) {
  889. if (teamR) {
  890. if (teamR.findIndex((red) => red.id == player.id) == 0 && inChooseMode && teamR.length <= teamB.length) {
  891. choosePlayer();
  892. capLeft = true; setTimeout(() => { capLeft = false; }, 10);
  893. }
  894. }
  895. if (teamB) {
  896. if (teamB.findIndex((blue) => blue.id == player.id) == 0 && inChooseMode && teamB.length < teamR.length) {
  897. choosePlayer();
  898. capLeft = true; setTimeout(() => { capLeft = false; }, 10);
  899. }
  900. }
  901. updateRoleOnPlayerOut();
  902. }
  903. setActivity(player, 0);
  904.  
  905.  
  906. if (players) {
  907. if (players.length <= maxPlayers - 2) { // Quitar contraseña
  908. room.setPassword(null);
  909. }
  910. }
  911. }
  912.  
  913. room.onPlayerKicked = function(kickedPlayer, reason, ban, byPlayer) {
  914. ban == true ? banList.push([kickedPlayer.name, kickedPlayer.id]) : null;
  915. }
  916.  
  917. /* PLAYER ACTIVITY */
  918.  
  919. room.onPlayerChat = function (player, message) {
  920. adminMessage = message;
  921. message = message.split(/ +/);
  922. player.team != Team.SPECTATORS ? setActivity(player, 0) : null;
  923. if (["!help"].includes(message[0].toLowerCase())) {
  924. room.sendChat("[PV] Comandos : !me, !discord, !games, !wins, !goals, !assists, !cs, !afks, !mutes, !bans, !spec, !niveles, !levels.", player.id);
  925. player.admin ? room.sendChat("[PV] Admin : !mute <duration = 3> #<id>, !unmute all/#<id>, !clearbans <number = all>, !slow <duration>, !endslow, !afk", player.id) : null;
  926. }
  927. else if (["!afk"].includes(message[0].toLowerCase())) {
  928. if (localStorage.getItem(getAuth(player)) && JSON.parse(localStorage.getItem(getAuth(player)))[Ss.RL] == "master") {
  929.  
  930. if (players.length != 1 && player.team != Team.SPECTATORS) {
  931. if (player.team == Team.RED && streak > 0 && room.getScores() == null) {
  932. room.setPlayerTeam(player.id, Team.SPECTATORS);
  933. }
  934. else {
  935. room.sendChat("No puedes ser AFK mientras estás en un equipo !", player.id);
  936. return false;
  937. }
  938. }
  939. else if (players.length == 1 && !getAFK(player)) {
  940. room.setPlayerTeam(player.id, Team.SPECTATORS);
  941. }
  942. setAFK(player, !getAFK(player));
  943. room.sendChat(player.name + (getAFK(player) ? " is now AFK !" : " is not AFK anymore !"));
  944. getAFK(player) ? updateRoleOnPlayerOut() : updateRoleOnPlayerIn();
  945. }
  946. }
  947. else if (["!afks", "!afklist"].includes(message[0].toLowerCase())) {
  948. var cstm = "[PV] Lista de AFK : ";
  949. for (var i = 0; i < extendedP.length; i++) {
  950. if (room.getPlayer(extendedP[i][eP.ID]) != null && getAFK(room.getPlayer(extendedP[i][eP.ID]))) {
  951. if (140 - cstm.length < (room.getPlayer(extendedP[i][eP.ID]).name + ", ").length) {
  952. room.sendChat(cstm, player.id);
  953. cstm = "... ";
  954. }
  955. cstm += room.getPlayer(extendedP[i][eP.ID]).name + ", ";
  956. }
  957. }
  958. if (cstm == "[PV] Lista de AFK : ") {
  959. room.sendChat("[PV] No hay nadie en la lista de AFK !", player.id);
  960. return false;
  961. }
  962. cstm = cstm.substring(0, cstm.length - 2);
  963. cstm += ".";
  964. room.sendChat(cstm, player.id);
  965. }
  966. /*else if (["!save"].includes(message[0].toLowerCase())) {
  967. if (player.admin) {
  968. saveStats();
  969. }
  970. }*/
  971. else if (["!discord"].includes(message[0].toLowerCase())) {
  972. room.sendChat("[PV] 👋 Discord Support: https://discord.gg/3MhhZPN ", player.id);
  973. }
  974. else if (["!niveles"].includes(message[0].toLowerCase())) {
  975. room.sendChat("Entra en Discord para mas info: https://discord.gg/3MhhZPN ", player.id);
  976. }
  977. else if (["!levels"].includes(message[0].toLowerCase())) {
  978. room.sendChat("Join our Discord to more info: https://discord.gg/3MhhZPN ", player.id);
  979. }
  980. else if (["!spec", "!specs"].includes(message[0].toLowerCase())) {
  981. getSpecList1(Team.SPECTATORS, player);
  982. }
  983. else if (["!me"].includes(message[0].toLowerCase())) {
  984. var stats;
  985. localStorage.getItem(getAuth(player)) ? stats = JSON.parse(localStorage.getItem(getAuth(player))) : stats = [0, 0, 0, 0, "0.00", 0, 0, 0, 0, "0.00"];
  986. room.sendChat("[PV] " + 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);
  987. }
  988. else if (["!games"].includes(message[0].toLowerCase())) {
  989. var tableau = [];
  990. 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])]); } });
  991. if (tableau.length < 5) {
  992. room.sendChat("[PV] Aún no se han jugado partidos suficientes.", player.id);
  993. return false;
  994. }
  995. tableau.sort(function (a, b) { return b[1] - a[1]; });
  996. room.sendChat("[PV] 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);
  997. }
  998. else if (["!wins"].includes(message[0].toLowerCase())) {
  999. var tableau = [];
  1000. 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])]); } });
  1001. if (tableau.length < 5) {
  1002. room.sendChat("[PV] Aún no se han jugado partidos suficientes.", player.id);
  1003. return false;
  1004. }
  1005. tableau.sort(function (a, b) { return b[1] - a[1]; });
  1006. room.sendChat("[PV] 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);
  1007. }
  1008. else if (["!goals"].includes(message[0].toLowerCase())) {
  1009. var tableau = [];
  1010. 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])]); } });
  1011. if (tableau.length < 5) {
  1012. room.sendChat("[PV] Aún no se han jugado partidos suficientes.", player.id);
  1013. return false;
  1014. }
  1015. tableau.sort(function (a, b) { return b[1] - a[1]; });
  1016. room.sendChat("[PV] 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);
  1017. }
  1018. else if (["!assists"].includes(message[0].toLowerCase())) {
  1019. var tableau = [];
  1020. 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])]); } });
  1021. if (tableau.length < 5) {
  1022. room.sendChat("[PV] Aún no se han jugado partidos suficientes.", player.id);
  1023. return false;
  1024. }
  1025. tableau.sort(function (a, b) { return b[1] - a[1]; });
  1026. room.sendChat("[PV] 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);
  1027. }
  1028. else if (["!cs"].includes(message[0].toLowerCase())) {
  1029. var tableau = [];
  1030. 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])]); } });
  1031. if (tableau.length < 5) {
  1032. room.sendChat("[PV] Aún no se han jugado partidos suficientes.", player.id);
  1033. return false;
  1034. }
  1035. tableau.sort(function (a, b) { return b[1] - a[1]; });
  1036. room.sendChat("[PV] Porterías 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);
  1037. }
  1038. else if (["!claim"].includes(message[0].toLowerCase())) {
  1039. if (message[1] == adminPassword) {
  1040. room.setPlayerAdmin(player.id, true);
  1041. var stats;
  1042. 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];
  1043. if (stats[Ss.RL] != "master") {
  1044. stats[Ss.RL] = "master";
  1045. room.sendChat(player.name + " is now a room master !");
  1046. localStorage.setItem(getAuth(player), JSON.stringify(stats));
  1047. }
  1048. }
  1049. }
  1050. else if (["!setadmin", "!admin"].includes(message[0].toLowerCase())) {
  1051. if (localStorage.getItem(getAuth(player)) && JSON.parse(localStorage.getItem(getAuth(player)))[Ss.RL] == "master") {
  1052. if (message.length >= 2 && message[1][0] == "#") {
  1053. message[1] = message[1].substring(1, message[1].length);
  1054. if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null) {
  1055. var stats;
  1056. 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];
  1057. if (stats[Ss.RL] == "player") {
  1058. stats[Ss.RL] = "admin";
  1059. localStorage.setItem(getAuth(room.getPlayer(Number.parseInt(message[1]))), JSON.stringify(stats));
  1060. room.setPlayerAdmin(room.getPlayer(Number.parseInt(message[1])).id, true);
  1061. room.sendChat(room.getPlayer(Number.parseInt(message[1])).name + " ahora es el administrador del host !");
  1062. }
  1063. }
  1064. }
  1065. }
  1066. }
  1067. else if (["!setplayer", "!removeadmin"].includes(message[0].toLowerCase())) {
  1068. if (localStorage.getItem(getAuth(player)) && JSON.parse(localStorage.getItem(getAuth(player)))[Ss.RL] == "master") {
  1069. if (message.length >= 2 && message[1][0] == "#") {
  1070. message[1] = message[1].substring(1, message[1].length);
  1071. if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null) {
  1072. var stats;
  1073. 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];
  1074. if (stats[Ss.RL] == "admin") {
  1075. room.sendChat(room.getPlayer(Number.parseInt(message[1])).name + " Ya no es administrador del host !");
  1076. stats[Ss.RL] = "player";
  1077. localStorage.setItem(getAuth(room.getPlayer(Number.parseInt(message[1]))), JSON.stringify(stats));
  1078. room.setPlayerAdmin(room.getPlayer(Number.parseInt(message[1])).id, false);
  1079. }
  1080. }
  1081. }
  1082. }
  1083. }
  1084. else if (["!mutes", "!mutelist"].includes(message[0].toLowerCase())) {
  1085. var cstm = "[PV] Lista de muteados : ";
  1086. for (var i = 0; i < extendedP.length; i++) {
  1087. if (room.getPlayer(extendedP[i][eP.ID]) != null && getMute(room.getPlayer(extendedP[i][eP.ID]))) {
  1088. if (140 - cstm.length < (room.getPlayer(extendedP[i][eP.ID]).name + "[" + (extendedP[i][eP.ID]) + "], ").length) {
  1089. room.sendChat(cstm, player.id);
  1090. cstm = "... ";
  1091. }
  1092. cstm += room.getPlayer(extendedP[i][eP.ID]).name + "[" + (extendedP[i][eP.ID]) + "], ";
  1093. }
  1094. }
  1095. if (cstm == "[PV] Lista de Muteados : ") {
  1096. room.sendChat("[PV] No hay nadie en la lista de muteados !", player.id);
  1097. return false;
  1098. }
  1099. cstm = cstm.substring(0, cstm.length - 2);
  1100. cstm += ".";
  1101. room.sendChat(cstm, player.id);
  1102. }
  1103. else if (["!mute"].includes(message[0].toLowerCase())) {
  1104. if (player.admin) {
  1105. updateTeams();
  1106. var timeOut;
  1107. if (!Number.isNaN(Number.parseInt(message[1])) && message.length > 1) {
  1108. if (Number.parseInt(message[1]) > 0) {
  1109. timeOut = Number.parseInt(message[1]) * 60 * 1000;
  1110. }
  1111. else {
  1112. timeOut = 3 * 60 * 1000;
  1113. }
  1114. if (message[2].length > 1 && message[2][0] == "#") {
  1115. message[2] = message[2].substring(1, message[2].length);
  1116. if (!Number.isNaN(Number.parseInt(message[2])) && room.getPlayer(Number.parseInt(message[2])) != null) {
  1117. if (room.getPlayer(Number.parseInt(message[2])).admin || getMute(room.getPlayer(Number.parseInt(message[2])))) {
  1118. return false;
  1119. }
  1120. setTimeout(function (player) { setMute(player, false); }, timeOut, room.getPlayer(Number.parseInt(message[2])));
  1121. setMute(room.getPlayer(Number.parseInt(message[2])), true);
  1122. room.sendChat(room.getPlayer(Number.parseInt(message[2])).name + " ha sido muteado por " + (timeOut / 60000) + " minutos !");
  1123. }
  1124. }
  1125. }
  1126. else if (Number.isNaN(Number.parseInt(message[1]))) {
  1127. if (message[1].length > 1 && message[1][0] == "#") {
  1128. message[1] = message[1].substring(1, message[1].length);
  1129. if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null) {
  1130. if (room.getPlayer(Number.parseInt(message[1])).admin || getMute(room.getPlayer(Number.parseInt(message[1])))) {
  1131. return false;
  1132. }
  1133. setTimeout(function (player) { setMute(player, false); }, 3 * 60 * 1000, room.getPlayer(Number.parseInt(message[1])));
  1134. setMute(room.getPlayer(Number.parseInt(message[1])), true);
  1135. room.sendChat(room.getPlayer(Number.parseInt(message[1])).name + " Te han muteado por 3 minutos!");
  1136. }
  1137. }
  1138. }
  1139. }
  1140. }
  1141. else if (["!unmute"].includes(message[0].toLowerCase())) {
  1142. if (player.admin && message.length >= 2) {
  1143. if (message[1] == "all") {
  1144. extendedP.forEach((ePlayer) => { ePlayer[eP.MUTE] = false; });
  1145. room.sendChat("Se ha limpiado la lista de muteados");
  1146. }
  1147. else if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null && getMute(room.getPlayer(Number.parseInt(message[1])))) {
  1148. setMute(room.getPlayer(Number.parseInt(message[1])), false);
  1149. room.sendChat(room.getPlayer(Number.parseInt(message[1])).name + " ha sido desmuteado !");
  1150. }
  1151. else if (Number.isNaN(Number.parseInt(message[1]))) {
  1152. if (message[1].length > 1 && message[1][0] == "#") {
  1153. message[1] = message[1].substring(1, message[1].length);
  1154. if (!Number.isNaN(Number.parseInt(message[1])) && room.getPlayer(Number.parseInt(message[1])) != null && getMute(room.getPlayer(Number.parseInt(message[1])))) {
  1155. setMute(room.getPlayer(Number.parseInt(message[1])), false);
  1156. room.sendChat(room.getPlayer(Number.parseInt(message[1])).name + " ha sido desmuteado!");
  1157. }
  1158. }
  1159. }
  1160. }
  1161. }
  1162. else if (["!slow"].includes(message[0].toLowerCase())) {
  1163. if (player.admin) {
  1164. if (message.length == 1) {
  1165. slowMode = 2;
  1166. room.sendChat("Modo lento activado (2 segundos)!");
  1167. }
  1168. else if (message.length == 2) {
  1169. if (!Number.isNaN(Number.parseInt(message[1]))) {
  1170. if (Number.parseInt(message[1]) > 0) {
  1171. slowMode = Number.parseInt(message[1]);
  1172. room.sendChat(slowMode + " segundos, modo lento activado !");
  1173. return false;
  1174. }
  1175. }
  1176. slowMode = 2;
  1177. room.sendChat("Modo lento activado (2 segundos)!");
  1178. }
  1179. }
  1180. }
  1181. else if (["!endslow"].includes(message[0].toLowerCase())) {
  1182. if (player.admin) {
  1183. slowMode != 0 ? room.sendChat("Modo lento terminado.") : null;
  1184. slowMode = 0;
  1185. }
  1186. }
  1187. else if (["!banlist", "!bans"].includes(message[0].toLowerCase())) {
  1188. if (banList.length == 0) {
  1189. room.sendChat("[PV] No hay nadie en la lista de baneados!", player.id);
  1190. return false;
  1191. }
  1192. var cstm = "[PV] Lista de baneados : ";
  1193. for (var i = 0; i < banList.length; i++) {
  1194. if (140 - cstm.length < (banList[i][0] + "[" + (banList[i][1]) + "], ").length) {
  1195. room.sendChat(cstm, player.id);
  1196. cstm = "... ";
  1197. }
  1198. cstm += banList[i][0] + "[" + (banList[i][1]) + "], ";
  1199. }
  1200. cstm = cstm.substring(0, cstm.length - 2);
  1201. cstm += ".";
  1202. room.sendChat(cstm, player.id);
  1203. }
  1204. else if (["!clearbans"].includes(message[0].toLowerCase())) {
  1205. if (player.admin) {
  1206. if (message.length == 1) {
  1207. room.clearBans();
  1208. room.sendChat("Bans removidos!");
  1209. banList = [];
  1210. }
  1211. if (message.length == 2) {
  1212. if (!Number.isNaN(Number.parseInt(message[1]))) {
  1213. if (Number.parseInt(message[1]) > 0) {
  1214. ID = Number.parseInt(message[1]);
  1215. room.clearBan(ID);
  1216. if (banList.length != banList.filter((array) => array[1] != ID)) {
  1217. room.sendChat(banList.filter((array) => array[1] == ID)[0][0] + " ha sido baneado del host !");
  1218. }
  1219. setTimeout(() => { banList = banList.filter((array) => array[1] != ID); }, 20);
  1220. }
  1221. }
  1222. }
  1223. }
  1224. }
  1225. else if (["!bb", "!bye", "!cya", "!gn"].includes(message[0].toLowerCase())) {
  1226. room.kickPlayer(player.id, "Bye !", false);
  1227. }
  1228. if (teamR.length != 0 && teamB.length != 0 && inChooseMode) {
  1229. if (player.id == teamR[0].id || player.id == teamB[0].id) { // we care if it's one of the captains choosing
  1230. if (teamR.length <= teamB.length && player.id == teamR[0].id) { // we care if it's red turn && red cap talking
  1231. if (["top", "auto"].includes(message[0].toLowerCase())) {
  1232. room.setPlayerTeam(teamS[0].id, Team.RED);
  1233. redCaptainChoice = "top";
  1234. clearTimeout(timeOutCap);
  1235. room.sendChat(player.name + " elegiste Top !");
  1236. return false;
  1237. }
  1238. else if (["random", "rand"].includes(message[0].toLowerCase())) {
  1239. var r = getRandomInt(teamS.length);
  1240. room.setPlayerTeam(teamS[r].id, Team.RED);
  1241. redCaptainChoice = "random";
  1242. clearTimeout(timeOutCap);
  1243. room.sendChat(player.name + " elegiste Random !");
  1244. return false;
  1245. }
  1246. else if (["bottom", "bot"].includes(message[0].toLowerCase())) {
  1247. room.setPlayerTeam(teamS[teamS.length - 1].id, Team.RED);
  1248. redCaptainChoice = "bottom";
  1249. clearTimeout(timeOutCap);
  1250. room.sendChat(player.name + " elegiste Bottom !");
  1251. return false;
  1252. }
  1253. else if (!Number.isNaN(Number.parseInt(message[0]))) {
  1254. if (Number.parseInt(message[0]) > teamS.length || Number.parseInt(message[0]) < 1) {
  1255. room.sendChat("[PV] El número que elegiste es inválido !", player.id);
  1256. return false;
  1257. }
  1258. else {
  1259. room.setPlayerTeam(teamS[Number.parseInt(message[0]) - 1].id, Team.RED);
  1260. room.sendChat(player.name + " eligió a " + teamS[Number.parseInt(message[0]) - 1].name + " !");
  1261. return false;
  1262. }
  1263. }
  1264. }
  1265. if (teamR.length > teamB.length && player.id == teamB[0].id) { // we care if it's red turn && red cap talking
  1266. if (["top", "auto"].includes(message[0].toLowerCase())) {
  1267. room.setPlayerTeam(teamS[0].id, Team.BLUE);
  1268. blueCaptainChoice = "top";
  1269. clearTimeout(timeOutCap);
  1270. room.sendChat(player.name + " seleccionó Top !");
  1271. return false;
  1272. }
  1273. else if (["random", "rand"].includes(message[0].toLowerCase())) {
  1274. room.setPlayerTeam(teamS[getRandomInt(teamS.length)].id, Team.BLUE);
  1275. blueCaptainChoice = "random";
  1276. clearTimeout(timeOutCap);
  1277. room.sendChat(player.name + " seleccionó Random !");
  1278. return false;
  1279. }
  1280. else if (["bottom", "bot"].includes(message[0].toLowerCase())) {
  1281. room.setPlayerTeam(teamS[teamS.length - 1].id, Team.BLUE);
  1282. blueCaptainChoice = "bottom";
  1283. clearTimeout(timeOutCap);
  1284. room.sendChat(player.name + " seleccionó Bottom !");
  1285. return false;
  1286. }
  1287. else if (!Number.isNaN(Number.parseInt(message[0]))) {
  1288. if (Number.parseInt(message[0]) > teamS.length || Number.parseInt(message[0]) < 1) {
  1289. room.sendChat("[PV] El número que elegiste es inválido !", player.id);
  1290. return false;
  1291. }
  1292. else {
  1293. room.setPlayerTeam(teamS[Number.parseInt(message[0]) - 1].id, Team.BLUE);
  1294. room.sendChat(player.name + " eligió " + teamS[Number.parseInt(message[0]) - 1].name + " !");
  1295. return false;
  1296. }
  1297. }
  1298. }
  1299. }
  1300. }
  1301. if (message[0][0] == "!") {
  1302. return false;
  1303. }
  1304. if (getMute(player)) {
  1305. room.sendChat("Usted está muteado.", player.id);
  1306. return false;
  1307. }
  1308. if (slowMode > 0) {
  1309. if (!player.admin) {
  1310. if (!SMSet.has(player.id)) {
  1311. SMSet.add(player.id);
  1312. setTimeout((number) => { SMSet.delete(number); }, slowMode * 1000, player.id);
  1313. }
  1314. else {
  1315. return false;
  1316. }
  1317. }
  1318. }
  1319. if (player.admin) {
  1320. // Si el usuario es admin, mandar un announcement
  1321. var adminChatColor = 0x33FFE0; // Formato: 0xCOLOR (sustituye COLOR por el color en HEXADECIMAL, ejemplo azul es 33FFE0)
  1322.  
  1323. room.sendAnnouncement(`${player.name}: ${adminMessage}`, null, adminChatColor, 'bold', null);
  1324. return false;
  1325. }
  1326. }
  1327.  
  1328. room.onPlayerActivity = function(player) {
  1329. setActivity(player, 0);
  1330. }
  1331.  
  1332. room.onPlayerBallKick = function(player) {
  1333. if (lastPlayersTouched[0] == null || player.id != lastPlayersTouched[0].id) {
  1334. !activePlay ? activePlay = true : null;
  1335. lastTeamTouched = player.team;
  1336. lastPlayersTouched[1] = lastPlayersTouched[0];
  1337. lastPlayersTouched[0] = player;
  1338. }
  1339. }
  1340.  
  1341. /* GAME MANAGEMENT */
  1342.  
  1343. room.onGameStart = function(byPlayer) {
  1344. game = new Game(Date.now(), room.getScores(), []);
  1345. countAFK = true;
  1346. activePlay = false;
  1347. goldenGoal = false;
  1348. endGameVariable = false;
  1349. lastPlayersTouched = [null, null];
  1350. Rposs = 0;
  1351. Bposs = 0;
  1352. GKList = [];
  1353. allReds = [];
  1354. allBlues = [];
  1355. if (teamR.length == maxTeamSize && teamB.length == maxTeamSize) {
  1356. for (var i = 0; i < maxTeamSize; i++) {
  1357. allReds.push(teamR[i]);
  1358. allBlues.push(teamB[i]);
  1359. }
  1360. }
  1361. for (var i = 0; i < extendedP.length; i++) {
  1362. extendedP[i][eP.GK] = 0;
  1363. extendedP[i][eP.ACT] = 0;
  1364. room.getPlayer(extendedP[i][eP.ID]) == null ? extendedP.splice(i, 1) : null;
  1365. }
  1366. deactivateChooseMode();
  1367. }
  1368.  
  1369. room.onGameStop = function(byPlayer) {
  1370. if (byPlayer.id == 0 && endGameVariable) {
  1371. updateTeams();
  1372. if (inChooseMode) {
  1373. if (players.length == 2 * maxTeamSize) {
  1374. inChooseMode = false;
  1375. resetBtn();
  1376. for (var i = 0; i < maxTeamSize; i++) {
  1377. setTimeout(() => { randomBtn(); }, 400*i);
  1378. }
  1379. setTimeout(() => { room.startGame(); }, 2000);
  1380. }
  1381. else {
  1382. if (lastWinner == Team.RED) {
  1383. blueToSpecBtn();
  1384. }
  1385. else if (lastWinner == Team.BLUE) {
  1386. redToSpecBtn();
  1387. blueToRedBtn();
  1388. }
  1389. else {
  1390. resetBtn();
  1391. }
  1392. setTimeout(() => { topBtn(); }, 500);
  1393. }
  1394. }
  1395. else {
  1396. if (players.length == 2) {
  1397. if (lastWinner == Team.BLUE) {
  1398. room.setPlayerTeam(teamB[0].id, Team.RED);
  1399. room.setPlayerTeam(teamR[0].id, Team.BLUE);
  1400. }
  1401. setTimeout(() => { room.startGame(); }, 2000);
  1402. }
  1403. else if (players.length == 3 || players.length >= 2 * maxTeamSize + 1) {
  1404. if (lastWinner == Team.RED) {
  1405. blueToSpecBtn();
  1406. }
  1407. else {
  1408. redToSpecBtn();
  1409. blueToRedBtn();
  1410. }
  1411. setTimeout(() => { topBtn(); }, 200);
  1412. setTimeout(() => { room.startGame(); }, 2000);
  1413. }
  1414. else if (players.length == 4) {
  1415. resetBtn();
  1416. setTimeout(() => { randomBtn(); setTimeout(() => { randomBtn(); }, 500); }, 500);
  1417. setTimeout(() => { room.startGame(); }, 2000);
  1418. }
  1419. else if (players.length == 5 || players.length >= 2 * maxTeamSize + 1) {
  1420. if (lastWinner == Team.RED) {
  1421. blueToSpecBtn();
  1422. }
  1423. else {
  1424. redToSpecBtn();
  1425. blueToRedBtn();
  1426. }
  1427. setTimeout(() => { topBtn(); }, 200);
  1428. activateChooseMode();
  1429. }
  1430. else if (players.length == 6) {
  1431. resetBtn();
  1432. setTimeout(() => { randomBtn(); setTimeout(() => { randomBtn(); setTimeout(() => { randomBtn(); }, 500); }, 500); }, 500);
  1433. setTimeout(() => { room.startGame(); }, 2000);
  1434. }
  1435. }
  1436. }
  1437. }
  1438.  
  1439. room.onGamePause = function(byPlayer) {
  1440. }
  1441.  
  1442. room.onGameUnpause = function (byPlayer) {
  1443. if (teamR.length == 4 && teamB.length == 4 && inChooseMode || (teamR.length == teamB.length && teamS.length < 2 && inChooseMode)) {
  1444. deactivateChooseMode();
  1445. }
  1446. }
  1447.  
  1448. room.onTeamGoal = function(team) {
  1449. activePlay = false;
  1450. countAFK = false;
  1451. const scores = room.getScores();
  1452. game.scores = scores;
  1453. if (lastPlayersTouched[0] != null && lastPlayersTouched[0].team == team) {
  1454. if (lastPlayersTouched[1] != null && lastPlayersTouched[1].team == team) {
  1455. room.sendChat("⚽ " + getTime(scores) + " Gol de " + lastPlayersTouched[0].name + " ! Asistencia de " + lastPlayersTouched[1].name + ". Velocidad de tiro : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "🔵"));
  1456. game.goals.push(new Goal(scores.time, team, lastPlayersTouched[0], lastPlayersTouched[1]));
  1457. }
  1458. else {
  1459. room.sendChat("⚽ " + getTime(scores) + " Gol de " + lastPlayersTouched[0].name + " ! Velocidad de tiro : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "🔵"));
  1460. game.goals.push(new Goal(scores.time, team, lastPlayersTouched[0], null));
  1461. }
  1462. }
  1463. else {
  1464. room.sendChat("😂 " + getTime(scores) + " Gol en contra de " + lastPlayersTouched[0].name + " ! Velocidad de tiro : " + ballSpeed.toPrecision(4).toString() + "km/h " + (team == Team.RED ? "🔴" : "🔵"));
  1465. game.goals.push(new Goal(scores.time, team, null, null));
  1466. }
  1467. if (scores.scoreLimit != 0 && (scores.red == scores.scoreLimit || scores.blue == scores.scoreLimit && scores.blue > 0 || goldenGoal == true)) {
  1468. endGame(team);
  1469. goldenGoal = false;
  1470. setTimeout(() => { room.stopGame(); }, 1000);
  1471. }
  1472. }
  1473.  
  1474. room.onPositionsReset = function() {
  1475. countAFK = true;
  1476. lastPlayersTouched = [null, null];
  1477. }
  1478.  
  1479. /* MISCELLANEOUS */
  1480.  
  1481. room.onRoomLink = function(url) {
  1482. }
  1483.  
  1484. room.onPlayerAdminChange = function (changedPlayer, byPlayer) {
  1485. if (getMute(changedPlayer) && changedPlayer.admin) {
  1486. room.sendChat(changedPlayer.name + " ha sido desmuteado.");
  1487. setMute(changedPlayer, false);
  1488. }
  1489. if (byPlayer.id != 0 && localStorage.getItem(getAuth(byPlayer)) && JSON.parse(localStorage.getItem(getAuth(byPlayer)))[Ss.RL] == "admin") {
  1490. room.sendChat("No tienes permiso para nombrar a un jugador como Administrador !", byPlayer.id);
  1491. room.setPlayerAdmin(changedPlayer.id, false);
  1492. }
  1493. }
  1494.  
  1495. room.onStadiumChange = function(newStadiumName, byPlayer) {
  1496. }
  1497.  
  1498. room.onGameTick = function() {
  1499. checkTime();
  1500. getLastTouchOfTheBall();
  1501. getStats();
  1502. handleInactivity();
  1503. }
  1504.  
  1505. /*function saveStats() {
  1506. var a = document.createElement("a");
  1507. document.body.appendChild(a);
  1508. a.style = "display: none";
  1509. a.id = "locSto";
  1510. var d = new Date();
  1511. var s = (("0" + d.getDate()).slice(-2) + "" + ("0" + (d.getMonth() + 1)).slice(-2) + "" + (d.getYear() + 1900).toString().substring(2) + "-" + ("0" + d.getHours()).slice(-2) + "" + ("0" + d.getMinutes()).slice(-2) + "" + ("0" + d.getSeconds()).slice(-2)).toString();
  1512. var data = [];
  1513. Object.keys(localStorage).forEach((key) => {
  1514. if (key.length == 43) data.push([key].concat(JSON.parse(localStorage.getItem(key))));
  1515. });
  1516. data.push(["streak"].concat(JSON.parse(localStorage.getItem('streak'))));
  1517. var fileName = `room1_${s}.json`;
  1518. var json = JSON.stringify(data),
  1519. blob = new Blob([json], { type: "octet/stream" });
  1520. randomUrl = window.URL.createObjectURL(blob);
  1521. a.href = randomUrl;
  1522. a.download = fileName;
  1523. console.log("get_update");
  1524. room.sendChat("✅ Stats were saved successfully !");
  1525. }
  1526.  
  1527. setInterval(() => {
  1528. saveStats();
  1529. }, 60 * 60 * 1000);*/
  1530.  
  1531. setTimeout(() => {
  1532. setInterval(() => {
  1533. //room.sendChat("💬 This host was created by Gouiri[FR] and edited by Gimenez20[GI] 👊");
  1534. //room.sendChat("💬 Do you search team to play our leagues? You can enjoy with our leagues (Big 4v4-3def | Real Soccer) 👊");
  1535. //room.sendChat("💬 TS3: hbpt.ts.io, Forum: https://haxball.pt/ , Discord: https://discord.gg/3MhhZPN 👊");
  1536. room.sendChat("💬 Join our Discord: https://discord.gg/3MhhZPN 👊");
  1537. room.sendChat("💬 Mejora tu nivel para jugar en salas con mayor nivel, info en Discord 👊");
  1538. room.sendChat("💬 Improve your level to play in rooms with more level, info in Discord 👊");
  1539. }, discordInterval * 60 * 1000); }, 10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement