Professional Documents
Culture Documents
// Version: 1.0
// Build Date: 07/12/2022
// Author: alexis.c05
// * SPK | Real Soccer Revolution (RSR)
// Changelog:
// 1.0 Official Release
//
// =========================================================================
return realSoccerMap;
}
// ------------------------------------------------
// Global Variables
// ------------------------------------------------
var roomName = "🔵🟡 • 🏅 SPK vs ??? ⚽ • ⚪🔵"; //para cambiar el nombre de la sala
cambiar lo escrito entre las comillas ""
var roomPassword = null; //para poner contraseña a la sala pone "(contraseña)", si
no quieres contraseña deja (null)
var maxPlayers = 30;
var roomPublic = true; //para que la sala no aparezca en la lista de salas poner
(false), si quieres que aparezca pon (true)
// -------------------------------------------------
// Classes
// -------------------------------------------------
class Game{constructor(){this.ticks=0,this.time=0,this.active=!0,this.paused=!
1,this.ballRadius,this.rsTouchTeam=0,this.rsActive=!0,this.rsReady=!
1,this.rsCorner=!1,this.rsGoalKick=!
1,this.rsSwingTimer=1e3,this.rsTimer,this.ballOutPositionX,this.ballOutPositionY,th
is.throwInPosY,this.outStatus="",this.warningCount=0,this.bringThrowBack=!
1,this.extraTime=!
1,this.extraTimeCount=0,this.extraTimeEnd,this.extraTimeAnnounced=!
1,this.lastPlayAnnounced=!1,this.boosterState,this.throwinKicked=!
1,this.pushedOut,this.lastKickerId,this.lastKickerName,this.lastKickerTeam,this.sec
ondLastKickerId,this.secondLastKickerName,this.secondLastKickerTeam,this.redScore=0
,this.blueScore=0}updateLastKicker(a,b,c)
{this.secondLastKickerId=this.lastKickerId,this.secondLastKickerName=this.lastKicke
rName,this.secondLastKickerTeam=this.lastKickerTeam,this.lastKickerId=a,this.lastKi
ckerName=b,this.lastKickerTeam=c}}room.setCustomStadium(getRealSoccerMap()),room.se
tScoreLimit(0),room.setTimeLimit(10),room.onRoomLink=function(a)
{roomLink=a,console.log(roomLink)},room.onStadiumChange=function(a,b)
{map=null==b?"RSR":"custom"},room.onPlayerJoin=function(a){console.log(a.name+"
joined the room"),whisper("\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2557\
u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2557\u2591\u2591\
u2588\u2588\u2557\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592",a.id,1715019,"bold",0),whisper("\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2554\
u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\
u2588\u2588\u2551\u2591\u2588\u2588\u2554\u255D\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592",a.id,1715019,"bold",0),whisper("\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u255A\u2588\u2588\u2588\u2588\u2588\
u2557\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\
u2588\u2588\u2550\u255D\u2591\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592",a.id,16777215,"bold",0),whisper("\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2591\
u255A\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\
u255D\u2591\u2588\u2588\u2554\u2550\u2588\u2588\u2557\u2591\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592",a.id,16777215,"bold",0),whisper("\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2588\u2588\u2588\u2588\
u2554\u255D\u2588\u2588\u2551\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2551\
u2591\u255A\u2588\u2588\u2557\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592",a.id,1715019,"bold",0),whisper("\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u255A\
u2550\u2550\u2550\u2550\u2550\u255D\u2591\u255A\u2550\u255D\u2591\u2591\u2591\
u2591\u2591\u255A\u2550\u255D\u2591\u2591\u255A\u2550\u255D\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\
u2592",a.id,1715019,"bold",0),whisper("\uD83D\uDCE2 Host oficial de Sporting
Kalacawa.",a.id,16564041,"bold",0),whisper("\uD83D\uDCE2 Script creador por:
Bachira \
xAE",a.id,16564041,"bold",0),displayAdminMessage()},room.onPlayerLeave=function(a)
{displayAdminMessage(),console.log(a.name+" sali\xF3 del
host")},room.onGameStart=function(a){"RSR"==map&&(null==a?(game=new
Game,announce("\uD83D\uDD52 Tiempo de juego: "+gameTime+" minutos"),announce("\
uD83C\uDFA5 La partida esta siendo grabada."),room.startRecording()):
(gameTime=0==room.getScores().timeLimit?10:room.getScores().timeLimit/
60,room.stopGame(),room.setTimeLimit(0),room.startGame()))},room.onGameStop=functio
n(a){"RSR"==map&&!
0==a&&(room.setTimeLimit(gameTime),RecSistem.sendDiscordWebhook(room.getScores()),a
nnounce("\uD83C\uDFA5 La partida a sido enviada al
discord."))},room.onPlayerBallKick=function(a){if("RSR"==map)
{if(game.rsTouchTeam=a.team,game.updateLastKicker(a.id,a.name,a.team),!
0==game.rsReady){var b=room.getPlayerList().filter(a=>0!
=a.team);b.forEach(function(a){.3!
=room.getPlayerDiscProperties(a.id).invMass.toFixed(1)&&room.setPlayerDiscPropertie
s(a.id,{invMass:.3})})}!1==game.rsActive&&!0==game.rsReady&&(!0==game.rsCorner||!
0==game.rsGoalKick)&&(game.boosterState=!0,game.rsActive=!0,game.rsReady=!
1,room.setDiscProperties(1,{x:2e3,y:2e3}),room.setDiscProperties(2,
{x:2e3,y:2e3}),room.setDiscProperties(0,
{color:"0xffffff"}),game.rsTimer=1e6,game.warningCount++,!
0==game.rsCorner&&(0>room.getDiscProperties(0).y?room.setDiscProperties(0,
{xgravity:-1*(room.getPlayerDiscProperties(a.id).xspeed/
35),ygravity:.05}):room.setDiscProperties(0,{xgravity:-
1*(room.getPlayerDiscProperties(a.id).xspeed/35),ygravity:-.05})),!
0==game.rsGoalKick&&room.setDiscProperties(0,{xgravity:0,ygravity:-
1*(room.getPlayerDiscProperties(a.id).yspeed/40)}),game.rsCorner=!
1,game.rsGoalKick=!1,game.outStatus=""),
("redThrow"==game.outStatus||"blueThrow"==game.outStatus)&&(game.throwinKicked=!
0)}},room.onTeamVictory=a=>{RecSistem.sendDiscordWebhook(a),announce("\uD83C\uDFA5
La partida a sido enviada al discord.")},room.onPlayerChat=function(a,b)
{if(console.log(a.name+": "+b),b.startsWith("!")){b=b.substr(1);let d=b.split("
");if("admin"==d[0]&&1==d.length)!1==isAdminPresent()?room.setPlayerAdmin(a.id,!
0):whisper("\u274C Ya hay admin presente!",a.id);else
if("admin"==d[0]&&2==d.length)d[1]==superAdminCode&&room.setPlayerAdmin(a.id,!
0);else if("clearbans"==d[0])a.admin?(room.clearBans(),announce("\uD83D\uDCE2 Los
bans han sido eliminadas por "+a.name)):whisper("\u274C Comando de
admins!",a.id);else if("court"==d[0]&&1==d.length)whisper("\u2757 El color de fondo
actual es "+mapBGColor);else
if("court"==d[0]&&2==d.length&&a.admin)null==room.getScores()?("reset"==d[1]?
(mapBGColor="86A578",announce("\uD83D\uDCE2 Color de fondo del host restablecido
por "+a.name)):(mapBGColor=d[1],announce("\uD83D\uDCE2 Color de fondo del host
establecido en "+d[1]+" por
"+a.name)),room.setCustomStadium(getRealSoccerMap())):whisper("\u274C No se puede
cambiar el color del Estadio mientras se juega",a.id);else if("swap"!
=d[0])"setpassword"==d[0]&&2==d.length&&a.admin?
(room.setPassword(d[1]),roomPassword=d[1],announce("\uD83D\uDCE2 La contrase\xF1a
ha sido cambiada por "+a.name)):"clearpassword"==d[0]&&a.admin?
(room.setPassword(null),roomPassword=null,announce("\uD83D\uDCE2 La contrase\xF1a
ha sido borrada por "+a.name)):"rs"==d[0]&&a.admin?null==room.getScores()?
room.setCustomStadium(getRealSoccerMap()):whisper("\u274C No se puede cambiar de
Estadio mientras se juega",a.id):"rr"==d[0]&&a.admin?
(room.stopGame(),room.startGame()):"bb"==d[0]?room.kickPlayer(a.id,"Hasta la pr\
xF3xima",!1):"help"==d[0]&&displayHelp(a.id,d[1]);else if(!a.admin)whisper("\u274C
Comando de admins!",a.id);else if(1==d.length){var
c=room.getPlayerList().filter(a=>0!=a.id);if(0==c.length)return!
1;c.forEach(function(a)
{1==a.team&&room.setPlayerTeam(a.id,2),2==a.team&&room.setPlayerTeam(a.id,1)}),anno
unce("\uD83D\uDD04 Los equipos fueron cambiados de lado")}return!
1}if(b.startsWith("t ")){if(teamMsg=b.substring(1).trim(),1==a.team){var
c=room.getPlayerList().filter(a=>1==a.team);c.forEach(function(b)
{room.sendAnnouncement("\uD83D\uDD34 [Red] "+a.name+":
"+teamMsg,b.id,15559258,"normal",1)})}if(2==a.team){var
c=room.getPlayerList().filter(a=>2==a.team);c.forEach(function(b)
{room.sendAnnouncement("\uD83D\uDD35 [Blue] "+a.name+":
"+teamMsg,b.id,5871085,"normal",1)})}return 0==a.team&&whisper("\u274C No est\xE1s
jugando como para usar el chat de equipo",a.id),!
1}if(b.startsWith("@@")&&(b=b.substr(2).trim(),-1!==b.indexOf(" "))){let
f=b.match(/^(\S+)\s(.*)/).slice(1);if(1<f.length){var
d=f[1],c=room.getPlayerList(),e=!1;return c.forEach(function(b){(b.name===f[0]||
b.name===f[0].replace(/_/g," "))&&(whisper("[MD > "+b.name+"] "+a.name+":
"+d,a.id,16720127,"normal",1),whisper("[MD] "+a.name+":
"+d,b.id,16720127,"normal",1),e=!0)}),!1==e&&whisper("No se encontro al usuario
'"+f[0]+"'",a.id,16720127,"normal",1),!1}}};function displayHelp(a,b)
{null==b&&whisper("\u2757 Commandos: !rs, !rr, !bb, !admin, !clearbans, !swap,
@@[jugador] [mensaje privado], t [mensaje de equipo], !court, !court [hexcolor], !
court reset",a,null,"small")}let RecSistem={getCustomDate:()=>{let a=new
Date().toLocaleDateString().split("/").join("-"),b=new
Date().toLocaleTimeString().split(":");return`${a}-${b[0]}h$
{b[1]}m`},getScoresTime:a=>~~(Math.trunc(a)/60)+":"+(Math.trunc(a)
%60).toString().padStart(2,"0"),sendDiscordWebhook:a=>{let
b=room.getPlayerList().filter(a=>1==a.team).map(a=>a.name),c=room.getPlayerList().f
ilter(a=>2==a.team).map(a=>a.name),d=new FormData;d.append(null,new
File([room.stopRecording()],`HBReplay-${RecSistem.getCustomDate()}.hbr2`,
{type:"text/
plain"})),d.append("payload_json",JSON.stringify(RecSistem.getParams(a,b,c)));let
e=new
XMLHttpRequest;e.open("POST","https://discord.com/api/webhooks/1050223142573985892/
w2s5WVglIikTzXkcVzO-Rbbtq8eguPaB8cwCxXrPZEZr2M71HIZk1DjKCws-
mqpubFRd"),e.send(d)},getParams:(a,b,c)=>{let
d={username:roomName,avatar_url:"https://cdn.discordapp.com/attachments/
1010959295921274900/1050251639916867584/Sin_titulo-1.png?
width=676&height=676",content:"",embeds:
[{title:"",color:2078513,description:"",timestamp:null,author:{name:"\uD83C\uDFA5
Grabacion del partido SPK."},image:{},thumbnail:{},footer:{text:`HBReplay-$
{RecSistem.getCustomDate()}`,icon_url:"https://upload.wikimedia.org/wikipedia/
commons/thumb/0/06/ORCID_iD.svg/2048px-ORCID_iD.svg.png"},fields:
[{name:"RED",value:`${b.join("\n")}\n**GOLES**\n${a.red}`,inline:!0},
{name:"BLUE",value:`${c.join("\n")}\n**GOLES**\n${a.blue}`,inline:!0},
{name:"TIEMPO",value:RecSistem.getScoresTime(a.time)},{name:"LIMITE DE
TIEMPO",value:RecSistem.getScoresTime(a.timeLimit)},{name:"LIMITE DE
GOLES",value:a.scoreLimit}]}],components:[]};return
d}};room.onPlayerTeamChange=function(){"RSR"==map&&null!=room.getScores()&&!
1==game.rsActive&&room.getPlayerList().forEach(function(a){a!=null&&(!
0==game.rsGoalKick||!0==game.rsCorner)&&room.setPlayerDiscProperties(a.id,
{invMass:9999999})})},room.onTeamGoal=function(a){if("RSR"==map){game.rsActive=!
1;let
b,c,d=secondsToMinutes(Math.floor(room.getScores().time)),e="";1==a&&(1==game.lastK
ickerTeam&&(c="GOOOL!",b="\u26BD Gol de
"+game.lastKickerName,avatarCelebration(game.lastKickerId,"\
u26BD"),1==game.secondLastKickerTeam&&game.lastKickerId!
=game.secondLastKickerId&&(e=" (Asistencia:
"+game.secondLastKickerName+")",avatarCelebration(game.secondLastKickerId,"\uD83D\
uDC5F"))),2==game.lastKickerTeam&&(c="AUTOGOL!",b="\u26BD Autogol de
"+game.lastKickerName,avatarCelebration(game.lastKickerId,"\
u274C"),1==game.secondLastKickerTeam&&(e=" (Asistencia:
"+game.secondLastKickerName+")",avatarCelebration(game.secondLastKickerId,"\uD83D\
uDC5F"))),game.redScore++),2==a&&(2==game.lastKickerTeam&&(c="GOOOL!",b="\u26BD Gol
de "+game.lastKickerName,avatarCelebration(game.lastKickerId,"\
u26BD"),2==game.secondLastKickerTeam&&game.lastKickerId!
=game.secondLastKickerId&&(e=" (Asistencia:
"+game.secondLastKickerName+")",avatarCelebration(game.secondLastKickerId,"\uD83D\
uDC5F"))),1==game.lastKickerTeam&&(c="AUTOGOL!",b="\u26BD Autogol de
"+game.lastKickerName,avatarCelebration(game.lastKickerId,"\
u274C"),2==game.secondLastKickerTeam&&(e=" (Asistencia:
"+game.secondLastKickerName+")",avatarCelebration(game.secondLastKickerId,"\uD83D\
uDC5F"))),game.blueScore++),announce(c+" \uD83D\uDD34 "+game.redScore+" -
"+game.blueScore+" \uD83D\uDD35\u2007\uD83D\uDD52"+d+"\
u2007"+b+e),game.lastKicker=void 0,game.secondLastKicker=void
0,game.lastKickerTeam=void 0,game.secondLastKickerTeam=void
0}},room.onPositionsReset=function(){"RSR"==map&&!
0==game.lastPlayAnnounced&&(room.pauseGame(!0),game.lastPlayAnnounced=!
1,RecSistem.sendDiscordWebhook(room.getScores()),announce("\uD83D\uDCE2 Termino el
partido!!"),announce("\uD83C\uDFA5 La partida a sido enviada al
discord."))},room.onGameTick=function()
{"RSR"==map&&(updateGameStatus(),handleBallTouch(),realSoccerRef())};function
realSoccerRef()
{blockThrowIn(),blockGoalKick(),removeBlock(),game.time==60*gameTime&&!
1==game.extraTimeAnnounced&&(extraTime(),game.extraTimeAnnounced=!
0),game.time==game.extraTimeEnd&&!1==game.lastPlayAnnounced&&(announce("\uD83D\
uDCE2 Ultima jugada!!",null,null,null,1),game.lastPlayAnnounced=!0),(!
0==game.rsCorner||!0==game.rsGoalKick)&&game.extraTimeCount++,99999>game.rsTimer&&!
1==game.paused&&!1==game.rsActive&&!0==game.rsReady&&game.rsTimer+
+,150>game.rsSwingTimer&&!1==game.rsCorner&&!
1==game.rsGoalKick&&(game.rsSwingTimer+
+,5<game.rsSwingTimer&&room.setDiscProperties(0,
{xgravity:.97*room.getDiscProperties(0).xgravity,ygravity:.97*room.getDiscPropertie
s(0).ygravity}),150==game.rsSwingTimer&&room.setDiscProperties(0,
{xgravity:0,ygravity:0})),!0==game.boosterState&&game.boosterCount+
+,30<game.boosterCount&&(game.boosterState=!
1,game.boosterCount=0,room.setDiscProperties(0,
{cMask:63})),0==room.getBallPosition().x&&0==room.getBallPosition().y&&(game.rsActi
ve=!0,game.outStatus=""),!1==game.rsActive&&!
0==game.rsReady&&("redThrow"==game.outStatus?(game.rsTimer==throwTimeOut-
120&&ballWarning("0xff3f34",++game.warningCount),game.rsTimer==throwTimeOut&&!
1==game.bringThrowBack&&(game.outStatus="blueThrow",game.rsTimer=0,room.setDiscProp
erties(3,{x:0,y:2e3,radius:0}),sleep(100).then(()=>{room.setDiscProperties(0,
{color:"0x0fbcf9",xspeed:0,yspeed:0,x:game.ballOutPositionX,y:game.throwInPosY})}))
):"blueThrow"==game.outStatus?(game.rsTimer==throwTimeOut-
120&&ballWarning("0x0fbcf9",++game.warningCount),game.rsTimer==throwTimeOut&&!
1==game.bringThrowBack&&(game.outStatus="redThrow",game.rsTimer=0,room.setDiscPrope
rties(3,{x:0,y:2e3,radius:0}),sleep(100).then(()=>{room.setDiscProperties(0,
{color:"0xff3f34",xspeed:0,yspeed:0,x:game.ballOutPositionX,y:game.throwInPosY})}))
):"blueGK"==game.outStatus||"redGK"==game.outStatus?(game.rsTimer==gkTimeOut-
120&&("blueGK"==game.outStatus&&ballWarning("0x0fbcf9",+
+game.warningCount),"redGK"==game.outStatus&&ballWarning("0xff3f34",+
+game.warningCount)),game.rsTimer==gkTimeOut&&(game.outStatus="",room.setDiscProper
ties(0,{color:"0xffffff"}),game.rsTimer=1e6)):
("blueCK"==game.outStatus||"redCK"==game.outStatus)&&(game.rsTimer==ckTimeOut-
120&&("blueCK"==game.outStatus&&ballWarning("0x0fbcf9",+
+game.warningCount),"redCK"==game.outStatus&&ballWarning("0xff3f34",+
+game.warningCount)),game.rsTimer==ckTimeOut&&(game.outStatus="",room.setDiscProper
ties(1,{x:0,y:2e3,radius:0}),room.setDiscProperties(2,
{x:0,y:2e3,radius:0}),room.setDiscProperties(0,
{color:"0xffffff"}),game.rsTimer=1e6))),!
0==game.rsActive&&((612<room.getBallPosition().y||-
612>room.getBallPosition().y)&&(game.rsActive=!1,!
0==game.lastPlayAnnounced&&(room.pauseGame(!0),game.lastPlayAnnounced=!
1,RecSistem.sendDiscordWebhook(room.getScores()),announce("\uD83D\uDCE2 Termino el
partido!!"),announce("\uD83C\uDFA5 La partida a sido enviada al
discord.")),room.setDiscProperties(0,
{xgravity:0,ygravity:0}),game.ballOutPositionX=Math.round(10*room.getBallPosition()
.x)/
10,612<room.getBallPosition().y&&(game.ballOutPositionY=400485,game.throwInPosY=618
),-612>room.getBallPosition().y&&(game.ballOutPositionY=-400485,game.throwInPosY=-
618),1130<room.getBallPosition().x&&(game.ballOutPositionX=1130),-
1130>room.getBallPosition().x&&(game.ballOutPositionX=-1130),1==game.rsTouchTeam?
(room.setDiscProperties(3,
{x:game.ballOutPositionX,y:game.throwInPosY,radius:18}),sleep(100).then(()=>{game.o
utStatus="blueThrow",game.throwinKicked=!1,game.rsTimer=0,game.rsReady=!
0,room.setDiscProperties(0,
{xspeed:0,yspeed:0,x:game.ballOutPositionX,y:game.throwInPosY,xgravity:0,ygravity:0
}),room.setDiscProperties(0,
{color:"0x0fbcf9"})}),sleep(100).then(()=>{room.setDiscProperties(3,
{x:0,y:2e3,radius:0})})):(room.setDiscProperties(3,
{x:game.ballOutPositionX,y:game.throwInPosY,radius:18}),sleep(100).then(()=>{game.o
utStatus="redThrow",game.throwinKicked=!1,game.rsTimer=0,game.rsReady=!
0,room.setDiscProperties(0,
{xspeed:0,yspeed:0,x:game.ballOutPositionX,y:game.throwInPosY,xgravity:0,ygravity:0
}),room.setDiscProperties(0,
{color:"0xff3f34"})}),sleep(100).then(()=>{room.setDiscProperties(3,
{x:0,y:2e3,radius:0})}))),1162<room.getBallPosition().x&&(124<room.getBallPosition(
).y||-124>room.getBallPosition().y)&&(game.rsActive=!1,!
0==game.lastPlayAnnounced&&(room.pauseGame(!0),game.lastPlayAnnounced=!
1,RecSistem.sendDiscordWebhook(room.getScores()),announce("\uD83D\uDCE2 Termino el
partido!!"),announce("\uD83C\uDFA5 La partida a sido enviada al
discord.")),room.setDiscProperties(0,
{xgravity:0,ygravity:0}),room.getPlayerList().forEach(function(a)
{room.setPlayerDiscProperties(a.id,{invMass:1e5})}),1==game.rsTouchTeam?
(room.setDiscProperties(3,
{x:1060,y:0,radius:18}),sleep(100).then(()=>{game.outStatus="blueGK",game.rsTimer=0
,game.rsReady=!0,game.rsGoalKick=!
0,game.rsSwingTimer=0,game.boosterCount=0,game.boosterState=!
1,room.setDiscProperties(0,
{xspeed:0,yspeed:0,x:1060,y:0,color:"0x0fbcf9",cMask:268435519,xgravity:0,ygravity:
0})}),sleep(3e3).then(()=>{room.setDiscProperties(3,{x:0,y:2e3,radius:0})})):
(game.rsSwingTimer=0,-124>room.getBallPosition().y&&(room.setDiscProperties(3,
{x:1140,y:-590,radius:18}),sleep(100).then(()=>{game.rsCorner=!
0,game.outStatus="redCK",game.rsTimer=0,game.rsReady=!
0,game.boosterCount=0,game.boosterState=!1,room.setDiscProperties(0,{x:1140,y:-
590,xspeed:0,yspeed:0,color:"0xff3f34",cMask:268435519,xgravity:0,ygravity:0}),room
.setDiscProperties(2,{x:1150,y:-670,radius:420}),room.setDiscProperties(3,
{x:0,y:2e3,radius:0})})),124<room.getBallPosition().y&&(room.setDiscProperties(3,
{x:1140,y:590,radius:18}),sleep(100).then(()=>{game.rsCorner=!
0,game.outStatus="redCK",game.rsTimer=0,game.rsReady=!
0,game.boosterCount=0,game.boosterState=!1,room.setDiscProperties(0,
{x:1140,y:590,xspeed:0,yspeed:0,color:"0xff3f34",cMask:268435519,xgravity:0,ygravit
y:0}),room.setDiscProperties(2,{x:1150,y:670,radius:420}),room.setDiscProperties(3,
{x:0,y:2e3,radius:0})})))),-
1162>room.getBallPosition().x&&(124<room.getBallPosition().y||-
124>room.getBallPosition().y)&&(game.rsActive=!1,!
0==game.lastPlayAnnounced&&(room.pauseGame(!0),game.lastPlayAnnounced=!
1,announce("\uD83D\uDCE2 Termino el partido!!")),room.setDiscProperties(0,
{xgravity:0,ygravity:0}),room.getPlayerList().forEach(function(a)
{room.setPlayerDiscProperties(a.id,{invMass:1e5})}),1==game.rsTouchTeam?
(game.rsSwingTimer=0,-124>room.getBallPosition().y&&(room.setDiscProperties(3,{x:-
1140,y:-590,radius:18}),sleep(100).then(()=>{game.rsCorner=!
0,game.outStatus="blueCK",game.rsTimer=0,game.rsReady=!
0,game.boosterCount=0,game.boosterState=!1,room.setDiscProperties(0,{x:-1140,y:-
590,xspeed:0,yspeed:0,color:"0x0fbcf9",cMask:268435519,xgravity:0,ygravity:0}),room
.setDiscProperties(1,{x:-1150,y:-670,radius:420}),room.setDiscProperties(3,
{x:0,y:2e3,radius:0})})),124<room.getBallPosition().y&&(room.setDiscProperties(3,
{x:-1140,y
:590,radius:18}),sleep(100).then(()=>{game.rsCorner=!
0,game.outStatus="blueCK",game.rsTimer=0,game.rsReady=!
0,game.boosterCount=0,game.boosterState=!1,room.setDiscProperties(0,{x:-
1140,y:590,xspeed:0,yspeed:0,color:"0x0fbcf9",cMask:268435519,xgravity:0,ygravity:0
}),room.setDiscProperties(1,{x:-1150,y:670,radius:420}),room.setDiscProperties(3,
{x:0,y:2e3,radius:0})}))):(room.setDiscProperties(3,{x:-
1060,y:0,radius:18}),sleep(100).then(()=>{game.outStatus="redGK",game.rsTimer=0,gam
e.rsReady=!0,game.rsGoalKick=!
0,game.rsSwingTimer=0,game.boosterCount=0,game.boosterState=!
1,room.setDiscProperties(0,{xspeed:0,yspeed:0,x:-
1060,y:0,color:"0xff3f34",cMask:268435519,xgravity:0,ygravity:0})}),sleep(3e3).then
(()=>{room.setDiscProperties(3,{x:0,y:2e3,radius:0})})))),!
1==game.rsActive&&("redThrow"==game.outStatus||"blueThrow"==game.outStatus)&&((612<
room.getBallPosition().y||-
612>room.getBallPosition().y)&&(room.getBallPosition().x<game.ballOutPositionX-
throwinDistance||room.getBallPosition().x>game.ballOutPositionX+throwinDistance)&&!
1==game.bringThrowBack&&(game.bringThrowBack=!0,"redThrow"==game.outStatus?
(game.rsTimer=0,game.warningCount+
+,game.outStatus="blueThrow",room.setDiscProperties(3,
{x:0,y:2e3,radius:0}),sleep(100).then(()=>{room.setDiscProperties(0,
{xspeed:0,yspeed:0,color:"0x0fbcf9",x:game.ballOutPositionX,y:game.throwInPosY})}))
:"blueThrow"==game.outStatus&&(game.rsTimer=0,game.warningCount+
+,game.outStatus="redThrow",room.setDiscProperties(3,
{x:0,y:2e3,radius:0}),sleep(100).then(()=>{room.setDiscProperties(0,
{xspeed:0,yspeed:0,color:"0xff3f34",x:game.ballOutPositionX,y:game.throwInPosY})}))
),612>room.getBallPosition().y&&-612<room.getBallPosition().y&&!
1==game.throwinKicked&&!1==game.pushedOut&&("redThrow"==game.outStatus?
(game.rsTimer=0,game.warningCount+
+,game.outStatus="blueThrow",room.setDiscProperties(3,
{x:0,y:2e3,radius:0}),sleep(100).then(()=>{room.setDiscProperties(0,
{xspeed:0,yspeed:0,color:"0x0fbcf9",x:game.ballOutPositionX,y:game.throwInPosY})}))
:"blueThrow"==game.outStatus&&(game.rsTimer=0,game.warningCount+
+,game.outStatus="redThrow",room.setDiscProperties(3,
{x:0,y:2e3,radius:0}),sleep(100).then(()=>{room.setDiscProperties(0,
{xspeed:0,yspeed:0,color:"0xff3f34",x:game.ballOutPositionX,y:game.throwInPosY})}))
,game.pushedOut=!0),612>room.getBallPosition().y&&-612<room.getBallPosition().y&&!
0==game.throwinKicked&&(game.outStatus="",game.rsActive=!0,game.rsReady=!
1,room.setDiscProperties(0,{color:"0xffffff"}),game.rsTimer=1e6,game.warningCount+
+),room.getBallPosition().y.toFixed(1)==game.throwInPosY.toFixed(1)&&room.getBallPo
sition().x.toFixed(1)==game.ballOutPositionX.toFixed(1)&&(game.bringThrowBack=!
1,game.pushedOut=!1))}function handleBallTouch(){for(var
a,b=room.getPlayerList(),c=room.getBallPosition(),d=game.ballRadius,e=0;e<b.length;
e++)if(a=b[e],null!=a.position){var
f=pointDistance(a.position,c);f<d+15+.01&&(game.rsTouchTeam=a.team,game.throwinKick
ed=!1,!1==game.rsCorner&&0!
=room.getDiscProperties(0).xgravity&&(room.setDiscProperties(0,
{xgravity:0,ygravity:0}),game.rsSwingTimer=1e4))}}function updateGameStatus()
{game.time=Math.floor(room.getScores().time),game.ballRadius=room.getDiscProperties
(0).radius,game.ticks++}function announce(a,b,c,d,e)
{null==c&&(c=16776578),null==d&&(d="bold"),null==e&&(e=0),room.sendAnnouncement(a,b
,c,d,e),console.log("Announce: "+a)}function whisper(a,b,c,d,e)
{null==c&&(c=6735871),null==d&&(d="normal"),null==e&&(e=0),room.sendAnnouncement(a,
b,c,d,e),null!=room.getPlayer(b)&&console.log("Whisper ->
"+room.getPlayer(b).name+": "+a)}function isAdminPresent(){var
a=room.getPlayerList();return null!=a.find(a=>a.admin)}function
displayAdminMessage(){!1==isAdminPresent()&&announce("\uD83D\uDCE2 No hay admin
presente: escribe !admin")}function pointDistance(a,b){var c=a.x-b.x,d=a.y-
b.y;return Math.sqrt(c*c+d*d)}function sleep(a){return new
Promise(b=>setTimeout(b,a))}function ballWarning(a,b)
{sleep(200).then(()=>{game.warningCount==b&&room.setDiscProperties(0,
{color:"0xffffff"})}),sleep(400).then(()=>{game.warningCount==b&&room.setDiscProper
ties(0,
{color:a})}),sleep(600).then(()=>{game.warningCount==b&&room.setDiscProperties(0,
{color:"0xffffff"})}),sleep(800).then(()=>{game.warningCount==b&&room.setDiscProper
ties(0,
{color:a})}),sleep(1e3).then(()=>{game.warningCount==b&&room.setDiscProperties(0,
{color:"0xffffff"})}),sleep(1200).then(()=>{game.warningCount==b&&room.setDiscPrope
rties(0,
{color:a})}),sleep(1400).then(()=>{game.warningCount==b&&room.setDiscProperties(0,
{color:"0xffffff"})}),sleep(1600).then(()=>{game.warningCount==b&&room.setDiscPrope
rties(0,
{color:a})}),sleep(1675).then(()=>{game.warningCount==b&&room.setDiscProperties(0,
{color:"0xffffff"})}),sleep(1750).then(()=>{game.warningCount==b&&room.setDiscPrope
rties(0,{color:a})})}function extraTime(){var
a=Math.ceil(game.extraTimeCount/60);game.extraTimeEnd=60*gameTime+a,announce("\
uD83D\uDCE2 Tiempo agregado: "+a+" Segundos",null,null,null,1)}function
avatarCelebration(a,b)
{room.setPlayerAvatar(a,b),sleep(250).then(()=>{room.setPlayerAvatar(a,null)}),slee
p(500).then(()=>{room.setPlayerAvatar(a,b)}),sleep(750).then(()=>{room.setPlayerAva
tar(a,null)}),sleep(1e3).then(()=>{room.setPlayerAvatar(a,b)}),sleep(1250).then(()=
>{room.setPlayerAvatar(a,null)}),sleep(1500).then(()=>{room.setPlayerAvatar(a,b)}),
sleep(1750).then(()=>{room.setPlayerAvatar(a,null)}),sleep(2e3).then(()=>{room.setP
layerAvatar(a,b)}),sleep(2250).then(()=>{room.setPlayerAvatar(a,null)}),sleep(2500)
.then(()=>{room.setPlayerAvatar(a,b)}),sleep(2750).then(()=>{room.setPlayerAvatar(a
,null)}),sleep(3e3).then(()=>{room.setPlayerAvatar(a,b)}),sleep(3250).then(()=>{roo
m.setPlayerAvatar(a,null)})}function secondsToMinutes(a){var b=~~(a/3600),c=~~(a
%3600/60),d=~~a%60,e="";return
0<b&&(e+=""+b+":"+(10>c?"0":"")),e+=""+c+":"+(10>d?"0":""),e+=""+d,e}function
blockThrowIn(){var a=room.getPlayerList().filter(a=>0!
=a.team);0>room.getBallPosition().y&&("redThrow"==game.outStatus&&a.forEach(functio
n(a){2==a.team&&0>room.getPlayerDiscProperties(a.id).y&&(536870918!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:536870918}),-485>a.position.y&&room.setPlayerDiscProperties(a.id,{y:-
470})),1==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2}),1149!=room.getDiscProperties(17).x&&room.setDiscProperties(17,
{x:1149}),-1149!=room.getDiscProperties(19).x&&room.setDiscProperties(19,{x:-
1149})}),"blueThrow"==game.outStatus&&a.forEach(function(a)
{1==a.team&&0>room.getPlayerDiscProperties(a.id).y&&(536870918!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:536870918}),-485>a.position.y&&room.setPlayerDiscProperties(a.id,{y:-
470})),2==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2}),1149!=room.getDiscProperties(19).x&&room.setDiscProperties(19,
{x:1149}),-1149!=room.getDiscProperties(17).x&&room.setDiscProperties(17,{x:-
1149})})),0<room.getBallPosition().y&&("redThrow"==game.outStatus&&a.forEach(functi
on(a){2==a.team&&0<room.getPlayerDiscProperties(a.id).y&&(536870918!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:536870918}),485<a.position.y&&room.setPlayerDiscProperties(a.id,
{y:470})),1==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2}),1149!=room.getDiscProperties(21).x&&room.setDiscProperties(21,
{x:1149}),-1149!=room.getDiscProperties(23).x&&room.setDiscProperties(23,{x:-
1149})}),"blueThrow"==game.outStatus&&a.forEach(function(a)
{1==a.team&&0<room.getPlayerDiscProperties(a.id).y&&(536870918!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:536870918}),485<a.position.y&&room.setPlayerDiscProperties(a.id,
{y:470})),2==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2}),1149!=room.getDiscProperties(23).x&&room.setDiscProperties(23,
{x:1149}),-1149!=room.getDiscProperties(21).x&&room.setDiscProperties(21,{x:-
1149})}))}function blockGoalKick(){var a=room.getPlayerList().filter(a=>0!
=a.team);0>room.getBallPosition().x&&"redGK"==game.outStatus&&a.forEach(function(a)
{2==a.team&&0>room.getPlayerDiscProperties(a.id).x&&(268435462!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:268435462}),-840>a.position.x&&-
320<a.position.y&&320>a.position.y&&room.setPlayerDiscProperties(a.id,{x:-
825})),1==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2})}),0<room.getBallPosition().x&&"blueGK"==game.outStatus&&a.forEach(funct
ion(a){1==a.team&&0<room.getPlayerDiscProperties(a.id).x&&(268435462!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:268435462}),840<a.position.x&&-
320<a.position.y&&320>a.position.y&&room.setPlayerDiscProperties(a.id,
{x:825})),2==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2})})}function removeBlock(){var a=room.getPlayerList().filter(a=>0!
=a.team);""==game.outStatus&&(a.forEach(function(a){1==a.team&&2!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:2}),2==a.team&&4!
=room.getPlayerDiscProperties(a.id).cGroup&&room.setPlayerDiscProperties(a.id,
{cGroup:4})}),-1149!=room.getDiscProperties(17).x&&room.setDiscProperties(17,{x:-
1149}),-1149!=room.getDiscProperties(19).x&&room.setDiscProperties(19,{x:-1149}),-
1149!=room.getDiscProperties(21).x&&room.setDiscProperties(21,{x:-1149}),-1149!
=room.getDiscProperties(23).x&&room.setDiscProperties(23,{x:-1149}))}function
rfc3986EncodeURIComponent(a){return
encodeURIComponent(a).replace(/[!'()*]/g,escape)}