Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //script made by Andy, Edit by Pabol for HSHL
- //version 1.1.3
- //read documentation in README file!
- geo = {"code": "us", "lat": 37.0902, "lon": -95.7129} //geolokalizacja stanowi o tym, gdzie na liscie bedzie nasz room
- var roomConfig = { roomName : "🏒HOCKEY BOT PUB🏒", playerName : "HHL BOT", maxPlayers : 16, public : true, geo}; //ustawienia bota (nazwa rooma/bota/l.graczy/publiczne czy nie/geolokalizacja
- var stadiumFileTextBig = '{"name":"2019OfficialHHLStadiumbyATLAS","width":950,"height":450,"spawnDistance":170,"bg":{"type":"hockey","height":400,"width":900,"cornerRadius":200},"vertexes":[/*0*/{"trait":"wall","x":-700,"y":-400,"curve":-90,"color":"CC3300"},/*1*/{"trait":"wall","x":700,"y":-400,"curve":90},/*2*/{"trait":"wall","x":-700,"y":400,"color":"CC3300"},/*3*/{"trait":"wall","x":700,"y":400,"curve":-90},/*4*/{"trait":"wall","x":-900,"y":-200,"curve":-90},/*5*/{"trait":"wall","x":-900,"y":200},/*6*/{"trait":"wall","x":900,"y":-200,"curve":90},/*7*/{"trait":"wall","x":900,"y":200,"curve":-90},/*8*/{"bCoef":0.7,"cMask":["red","blue","ball"],"x":-697,"y":70,"color":"CCCCCC","curve":80},/*9*/{"bCoef":0.7,"cMask":["red","blue","ball"],"x":-697,"y":-70,"color":"cccccc","curve":-80},/*10*/{"trait":"netFrame","x":-760,"y":-40,"curve":140,"color":"000000"},/*11*/{"trait":"netFrame","x":-760,"y":40,"curve":-140,"color":"000000"},/*12*/{"cMask":["none"],"x":-701,"y":-397},/*13*/{"cMask":["none"],"x":-701,"y":397},/*14*/{"trait":"netFrame","x":700,"y":-70,"color":"000000"},/*15*/{"trait":"netFrame","x":760,"y":-40,"color":"000000"},/*16*/{"trait":"netFrame","x":700,"y":70,"color":"000000"},/*17*/{"trait":"netFrame","x":760,"y":40,"color":"000000"},/*18*/{"cMask":["none"],"x":701,"y":-397},/*19*/{"cMask":["none"],"x":701,"y":397},/*20*/{"cMask":["none"],"x":1,"y":-397},/*21*/{"cMask":["none"],"x":1,"y":397},/*22*/{"cMask":["none"],"x":-231,"y":-397,"color":"4466BB"},/*23*/{"cMask":["none"],"x":-231,"y":397,"color":"4466BB"},/*24*/{"cMask":["none"],"x":231,"y":-397,"color":"4466BB"},/*25*/{"cMask":["none"],"x":231,"y":397,"color":"4466BB"},/*26*/{"cMask":["none"],"x":0,"y":-100,"color":"4466BB","curve":-180},/*27*/{"cMask":["none"],"x":0,"y":100,"color":"4466BB","curve":-180},/*28*/{"trait":"circleRed","x":-540,"y":120,"curve":-180},/*29*/{"trait":"circleRed","x":-540,"y":320,"curve":-180},/*30*/{"trait":"circleRed","x":540,"y":-320,"curve":-180},/*31*/{"trait":"circleRed","x":540,"y":-120,"curve":-180},/*32*/{"trait":"circleRed","x":540,"y":120,"curve":-180},/*33*/{"trait":"circleRed","x":540,"y":320,"curve":-180},/*34*/{"trait":"circleRed","x":-540,"y":-320,"curve":-180},/*35*/{"trait":"circleRed","x":-540,"y":-120,"curve":0},/*36*/{"trait":"circleRed","x":540,"y":-224,"curve":-180},/*37*/{"trait":"circleRed","x":540,"y":-216,"curve":-180},/*38*/{"trait":"circleRed","x":540,"y":-222,"curve":-180},/*39*/{"trait":"circleRed","x":540,"y":-218,"curve":-180},/*40*/{"trait":"circleRed","x":540,"y":-222,"curve":-180},/*41*/{"trait":"circleRed","x":540,"y":-218,"curve":-180},/*42*/{"trait":"circleRed","x":540,"y":216,"curve":-180},/*43*/{"trait":"circleRed","x":540,"y":224,"curve":-180},/*44*/{"trait":"circleRed","x":540,"y":218,"curve":-180},/*45*/{"trait":"circleRed","x":540,"y":222,"curve":-180},/*46*/{"trait":"circleRed","x":540,"y":218,"curve":-180},/*47*/{"trait":"circleRed","x":540,"y":222,"curve":-180},/*48*/{"trait":"circleRed","x":-540,"y":-224,"curve":-180},/*49*/{"trait":"circleRed","x":-540,"y":-216,"curve":-180},/*50*/{"trait":"circleRed","x":-540,"y":-222,"curve":-180},/*51*/{"trait":"circleRed","x":-540,"y":-218,"curve":-180},/*52*/{"trait":"circleRed","x":-540,"y":-222,"curve":-180},/*53*/{"trait":"circleRed","x":-540,"y":-218,"curve":-180},/*54*/{"trait":"circleRed","x":-540,"y":216,"curve":-180},/*55*/{"trait":"circleRed","x":-540,"y":224,"curve":-180},/*56*/{"trait":"circleRed","x":-540,"y":218,"curve":-180},/*57*/{"trait":"circleRed","x":-540,"y":222,"curve":-180},/*58*/{"trait":"circleRed","x":-540,"y":218,"curve":-180},/*59*/{"trait":"circleRed","x":-540,"y":222,"curve":-180},/*60*/{"cMask":["redKO"],"x":0,"y":-2,"color":"F0F0F0","curve":-180},/*61*/{"cMask":["redKO"],"x":0,"y":6,"color":"F0F0F0","curve":-180},/*62*/{"cMask":["redKO"],"x":0,"y":0,"color":"F0F0F0","curve":-180},/*63*/{"cMask":["redKO"],"x":0,"y":4,"color":"F0F0F0","curve":-180},/*64*/{"cMask":["redKO"],"x":0,"y":0,"color":"F0F0F0","curve":-180},/*65*/{"cMask":["redKO"],"x":0,"y":4,"color":"F0F0F0","curve":-180},/*66*/{"cMask":["none"],"x":-697,"y":-101,"curve":180},/*67*/{"cMask":["none"],"x":-697,"y":101,"curve":180},/*68*/{"cMask":["none"],"x":-697,"y":-74,"curve":180,"color":"4466BB"},/*69*/{"cMask":["none"],"x":-697,"y":74,"curve":180,"color":"4466BB"},/*70*/{"cMask":["none"],"x":-697,"y":-71,"curve":180,"color":"4466BB"},/*71*/{"cMask":["none"],"x":-697,"y":71,"curve":180,"color":"4466BB"},/*72*/{"cMask":["none"],"x":-697,"y":-68,"curve":180,"color":"4466BB"},/*73*/{"cMask":["none"],"x":-697,"y":68,"curve":180,"color":"4466BB"},/*74*/{"cMask":["none"],"x":-697,"y":-65,"curve":180,"color":"4466BB"},/*75*/{"cMask":["none"],"x":-697,"y":65,"curve":180,"color":"4466BB"},/*76*/{"cMask":["none"],"x":-697,"y":-62,"curve":180,"color":"4466BB"},/*77*/{"cMask":["none"],"x":-697,"y":62,"curve":180,"color":"4466BB"},/*78*/{"cMask":["none"],"x":-697,"y":-59,"curve":180,"color":"4466BB"},/*79*/{"cMask":["none"],"x":-697,"y":59,"curve":180,"color":"4466BB"},/*80*/{"cMask":["none"],"x":-697,"y":-56,"curve":180,"color":"4466BB"},/*81*/{"cMask":["none"],"x":-697,"y":56,"curve":180,"color":"4466BB"},/*82*/{"cMask":["none"],"x":-697,"y":-53,"curve":180,"color":"4466BB"},/*83*/{"cMask":["none"],"x":-697,"y":53,"curve":180,"color":"4466BB"},/*84*/{"cMask":["none"],"x":-697,"y":-50,"curve":180,"color":"4466BB"},/*85*/{"cMask":["none"],"x":-697,"y":50,"curve":180,"color":"4466BB"},/*86*/{"cMask":["none"],"x":-697,"y":-47,"curve":180,"color":"4466BB"},/*87*/{"cMask":["none"],"x":-697,"y":47,"curve":180,"color":"4466BB"},/*88*/{"cMask":["none"],"x":-697,"y":-44,"curve":180,"color":"4466BB"},/*89*/{"cMask":["none"],"x":-697,"y":44,"curve":180,"color":"4466BB"},/*90*/{"cMask":["none"],"x":-697,"y":-41,"curve":180,"color":"4466BB"},/*91*/{"cMask":["none"],"x":-697,"y":41,"curve":180,"color":"4466BB"},/*92*/{"cMask":["none"],"x":-697,"y":-38,"curve":180,"color":"4466BB"},/*93*/{"cMask":["none"],"x":-697,"y":38,"curve":180,"color":"4466BB"},/*94*/{"cMask":["none"],"x":-697,"y":-35,"curve":180,"color":"4466BB"},/*95*/{"cMask":["none"],"x":-697,"y":35,"curve":180,"color":"4466BB"},/*96*/{"cMask":["none"],"x":-697,"y":-32,"curve":180,"color":"4466BB"},/*97*/{"cMask":["none"],"x":-697,"y":32,"curve":180,"color":"4466BB"},/*98*/{"cMask":["none"],"x":-697,"y":-29,"curve":180,"color":"4466BB"},/*99*/{"cMask":["none"],"x":-697,"y":29,"curve":180,"color":"4466BB"},/*100*/{"cMask":["none"],"x":-697,"y":-26,"curve":180,"color":"4466BB"},/*101*/{"cMask":["none"],"x":-697,"y":26,"curve":180,"color":"4466BB"},/*102*/{"cMask":["none"],"x":-697,"y":-23,"curve":180,"color":"4466BB"},/*103*/{"cMask":["none"],"x":-697,"y":23,"curve":180,"color":"4466BB"},/*104*/{"cMask":["none"],"x":-697,"y":-20,"curve":180,"color":"4466BB"},/*105*/{"cMask":["none"],"x":-697,"y":20,"curve":180,"color":"4466BB"},/*106*/{"cMask":["none"],"x":-697,"y":-17,"curve":180,"color":"4466BB"},/*107*/{"cMask":["none"],"x":-697,"y":17,"curve":180,"color":"4466BB"},/*108*/{"cMask":["none"],"x":-697,"y":-14,"curve":180,"color":"4466BB"},/*109*/{"cMask":["none"],"x":-697,"y":14,"curve":180,"color":"4466BB"},/*110*/{"cMask":["none"],"x":-697,"y":-11,"curve":180,"color":"4466BB"},/*111*/{"cMask":["none"],"x":-697,"y":11,"curve":180,"color":"4466BB"},/*112*/{"cMask":["none"],"x":-697,"y":-8,"curve":180,"color":"4466BB"},/*113*/{"cMask":["none"],"x":-697,"y":8,"curve":180,"color":"4466BB"},/*114*/{"cMask":["none"],"x":-697,"y":-5,"curve":180,"color":"4466BB"},/*115*/{"cMask":["none"],"x":-697,"y":5,"curve":180,"color":"4466BB"},/*116*/{"cMask":["none"],"x":-697,"y":-2,"curve":180,"color":"4466BB"},/*117*/{"cMask":["none"],"x":-697,"y":2,"curve":180,"color":"4466BB"},/*118*/{"cMask":["none"],"x":697,"y":74,"curve":180,"color":"4466BB"},/*119*/{"cMask":["none"],"x":697,"y":-74,"curve":180,"color":"4466BB"},/*120*/{"cMask":["none"],"x":697,"y":71,"curve":180,"color":"4466BB"},/*121*/{"cMask":["none"],"x":697,"y":-71,"curve":180,"color":"4466BB"},/*122*/{"cMask":["none"],"x":697,"y":68,"curve":180,"color":"4466BB"},/*123*/{"cMask":["none"],"x":697,"y":-68,"curve":180,"color":"4466BB"},/*124*/{"cMask":["none"],"x":697,"y":65,"curve":180,"color":"4466BB"},/*125*/{"cMask":["none"],"x":697,"y":-65,"curve":180,"color":"4466BB"},/*126*/{"cMask":["none"],"x":697,"y":62,"curve":180,"color":"4466BB"},/*127*/{"cMask":["none"],"x":697,"y":-62,"curve":180,"color":"4466BB"},/*128*/{"cMask":["none"],"x":697,"y":59,"curve":180,"color":"4466BB"},/*129*/{"cMask":["none"],"x":697,"y":-59,"curve":180,"color":"4466BB"},/*130*/{"cMask":["none"],"x":697,"y":56,"curve":180,"color":"4466BB"},/*131*/{"cMask":["none"],"x":697,"y":-56,"curve":180,"color":"4466BB"},/*132*/{"cMask":["none"],"x":697,"y":53,"curve":180,"color":"4466BB"},/*133*/{"cMask":["none"],"x":697,"y":-53,"curve":180,"color":"4466BB"},/*134*/{"cMask":["none"],"x":697,"y":50,"curve":180,"color":"4466BB"},/*135*/{"cMask":["none"],"x":697,"y":-50,"curve":180,"color":"4466BB"},/*136*/{"cMask":["none"],"x":697,"y":47,"curve":180,"color":"4466BB"},/*137*/{"cMask":["none"],"x":697,"y":-47,"curve":180,"color":"4466BB"},/*138*/{"cMask":["none"],"x":697,"y":101,"curve":180,"color":"CC3300"},/*139*/{"cMask":["none"],"x":697,"y":-101,"curve":180,"color":"CC3300"},/*140*/{"cMask":["none"],"x":697,"y":44,"curve":180,"color":"4466BB"},/*141*/{"cMask":["none"],"x":697,"y":-44,"curve":180,"color":"4466BB"},/*142*/{"cMask":["none"],"x":697,"y":41,"curve":180,"color":"4466BB"},/*143*/{"cMask":["none"],"x":697,"y":-41,"curve":180,"color":"4466BB"},/*144*/{"cMask":["none"],"x":697,"y":38,"curve":180,"color":"4466BB"},/*145*/{"cMask":["none"],"x":697,"y":-38,"curve":180,"color":"4466BB"},/*146*/{"cMask":["none"],"x":697,"y":35,"curve":180,"color":"4466BB"},/*147*/{"cMask":["none"],"x":697,"y":-35,"curve":180,"color":"4466BB"},/*148*/{"cMask":["none"],"x":697,"y":32,"curve":180,"color":"4466BB"},/*149*/{"cMask":["none"],"x":697,"y":-32,"curve":180,"color":"4466BB"},/*150*/{"cMask":["none"],"x":697,"y":29,"curve":180,"color":"4466BB"},/*151*/{"cMask":["none"],"x":697,"y":-29,"curve":180,"color":"4466BB"},/*152*/{"cMask":["none"],"x":697,"y":26,"curve":180,"color":"4466BB"},/*153*/{"cMask":["none"],"x":697,"y":-26,"curve":180,"color":"4466BB"},/*154*/{"cMask":["none"],"x":697,"y":23,"curve":180,"color":"4466BB"},/*155*/{"cMask":["none"],"x":697,"y":-23,"curve":180,"color":"4466BB"},/*156*/{"cMask":["none"],"x":697,"y":20,"curve":180,"color":"4466BB"},/*157*/{"cMask":["none"],"x":697,"y":-20,"curve":180,"color":"4466BB"},/*158*/{"cMask":["none"],"x":697,"y":17,"curve":180,"color":"4466BB"},/*159*/{"cMask":["none"],"x":697,"y":-17,"curve":180,"color":"4466BB"},/*160*/{"cMask":["none"],"x":697,"y":14,"curve":180,"color":"4466BB"},/*161*/{"cMask":["none"],"x":697,"y":-14,"curve":180,"color":"4466BB"},/*162*/{"cMask":["none"],"x":697,"y":11,"curve":180,"color":"4466BB"},/*163*/{"cMask":["none"],"x":697,"y":-11,"curve":180,"color":"4466BB"},/*164*/{"cMask":["none"],"x":697,"y":8,"curve":180,"color":"4466BB"},/*165*/{"cMask":["none"],"x":697,"y":-8,"curve":180,"color":"4466BB"},/*166*/{"cMask":["none"],"x":697,"y":5,"curve":180,"color":"4466BB"},/*167*/{"cMask":["none"],"x":697,"y":-5,"curve":180,"color":"4466BB"},/*168*/{"cMask":["none"],"x":697,"y":2,"curve":180,"color":"4466BB"},/*169*/{"cMask":["none"],"x":697,"y":-2,"curve":180,"color":"4466BB"},/*170*/{"trait":"netFrame","x":-700,"y":-68,"curve":140,"color":"000000"},/*171*/{"trait":"netFrame","x":-700,"y":68,"curve":-140,"color":"000000"},/*172*/{"trait":"bouncePuck","x":-749,"y":-403,"curve":-60},/*173*/{"trait":"bouncePuck","x":-903,"y":-265,"curve":-60},/*174*/{"trait":"bouncePuck","x":903,"y":-261,"curve":-60},/*175*/{"trait":"bouncePuck","x":759,"y":-401,"curve":-60},/*176*/{"trait":"bouncePuck","x":737,"y":410,"curve":-65},/*177*/{"trait":"bouncePuck","x":907,"y":255,"curve":-65},/*178*/{"trait":"bouncePuck","x":-904,"y":254,"curve":-65},/*179*/{"trait":"bouncePuck","x":-748,"y":406,"curve":-65},/*180*/{"cMask":["none"],"x":700,"y":-70},/*181*/{"cMask":["none"],"x":700,"y":70},/*182*/{"cMask":["none"],"x":-697,"y":77},/*183*/{"cMask":["none"],"x":-697,"y":80},/*184*/{"cMask":["none"],"x":-697,"y":83},/*185*/{"cMask":["none"],"x":-697,"y":86},/*186*/{"cMask":["none"],"x":-697,"y":89},/*187*/{"cMask":["none"],"x":-697,"y":92},/*188*/{"cMask":["none"],"x":-697,"y":95},/*189*/{"cMask":["none"],"x":-697,"y":98},/*190*/{"cMask":["none"],"x":696.942828717,"y":77,"curve":180,"color":"4466BB"},/*191*/{"cMask":["none"],"x":697.056758252,"y":-77,"curve":180,"color":"4466BB"},/*192*/{"cMask":["none"],"x":696.942828717,"y":80,"curve":180,"color":"4466BB"},/*193*/{"cMask":["none"],"x":697.056758252,"y":-80,"curve":180,"color":"4466BB"},/*194*/{"cMask":["none"],"x":696.942828717,"y":83,"curve":180,"color":"4466BB"},/*195*/{"cMask":["none"],"x":697.056758252,"y":-83,"curve":180,"color":"4466BB"},/*196*/{"cMask":["none"],"x":696.942828717,"y":86,"curve":180,"color":"4466BB"},/*197*/{"cMask":["none"],"x":697.056758252,"y":-86,"curve":180,"color":"4466BB"},/*198*/{"cMask":["none"],"x":696.942828717,"y":89,"curve":180,"color":"4466BB"},/*199*/{"cMask":["none"],"x":697.056758252,"y":-89,"curve":180,"color":"4466BB"},/*200*/{"cMask":["none"],"x":696.942828717,"y":92,"curve":180,"color":"4466BB"},/*201*/{"cMask":["none"],"x":697.056758252,"y":-92,"curve":180,"color":"4466BB"},/*202*/{"cMask":["none"],"x":696.942828717,"y":95,"curve":180,"color":"4466BB"},/*203*/{"cMask":["none"],"x":697.056758252,"y":-95,"curve":180,"color":"4466BB"},/*204*/{"cMask":["none"],"x":696.942828717,"y":98,"curve":180,"color":"4466BB"},/*205*/{"cMask":["none"],"x":697.056758252,"y":-98,"curve":180,"color":"4466BB"},/*206*/{"cMask":["none"],"x":0,"y":-97,"color":"F0F0F0","curve":-180},/*207*/{"cMask":["none"],"x":0,"y":97,"color":"4466BB","curve":-180},/*208*/{"cMask":["none"],"x":0,"y":-97,"color":"F0F0F0","curve":-180},/*209*/{"cMask":["none"],"x":0,"y":97,"color":"4466BB","curve":-180},/*210*/{"cMask":["none"],"x":-697.056758252,"y":-98,"curve":180,"color":"4466BB"},/*211*/{"cMask":["none"],"x":-697,"y":-98},/*212*/{"cMask":["none"],"x":-697,"y":-92},/*213*/{"cMask":["none"],"x":-697,"y":-86},/*214*/{"cMask":["none"],"x":-697,"y":-89},/*215*/{"cMask":["none"],"x":-697,"y":-95},/*216*/{"cMask":["none"],"x":-697,"y":-83},/*217*/{"cMask":["none"],"x":-697,"y":-80},/*218*/{"cMask":["none"],"x":-697,"y":-77},/*219*/{"cMask":["none"],"x":-756,"y":0},/*220*/{"cMask":["none"],"x":756,"y":0},/*221*/{"cMask":["none"],"x":-697,"y":-74},/*222*/{"cMask":["none"],"x":-697,"y":74},/*223*/{"cMask":["none"],"x":-1,"y":-397},/*224*/{"cMask":["none"],"x":-1,"y":397},/*225*/{"x":-21,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*226*/{"x":-21,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*227*/{"x":23,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*228*/{"x":23,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*229*/{"x":-21,"y":-1,"color":"F0F0F0","cMask":["redKO"]},/*230*/{"x":22,"y":0,"color":"F0F0F0","cMask":["redKO"]},/*231*/{"x":41,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*232*/{"x":41,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*233*/{"x":83,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*234*/{"x":-81,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*235*/{"x":-81,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*236*/{"x":-37,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*237*/{"x":-37,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*238*/{"x":-81,"y":-1,"color":"F0F0F0","cMask":["redKO"]},/*239*/{"x":-38,"y":0,"color":"F0F0F0","cMask":["redKO"]},/*240*/{"x":-18,"y":-26,"color":"000000","cMask":["redKO"]},/*241*/{"x":-18,"y":34,"color":"000000","cMask":["redKO"]},/*242*/{"x":26,"y":-26,"color":"000000","cMask":["redKO"]},/*243*/{"x":26,"y":34,"color":"000000","cMask":["redKO"]},/*244*/{"x":-18,"y":2,"color":"000000","cMask":["redKO"]},/*245*/{"x":25,"y":3,"color":"000000","cMask":["redKO"]},/*246*/{"x":44,"y":-26,"color":"000000","cMask":["redKO"]},/*247*/{"x":44,"y":34,"color":"000000","cMask":["redKO"]},/*248*/{"x":86,"y":34,"color":"000000","cMask":["redKO"]},/*249*/{"x":-78,"y":-26,"color":"000000","cMask":["redKO"]},/*250*/{"x":-78,"y":34,"color":"000000","cMask":["redKO"]},/*251*/{"x":-34,"y":-26,"color":"000000","cMask":["redKO"]},/*252*/{"x":-34,"y":34,"color":"000000","cMask":["redKO"]},/*253*/{"x":-78,"y":2,"color":"000000","cMask":["redKO"]},/*254*/{"x":-35,"y":3,"color":"000000","cMask":["redKO"]}],"segments":[{"trait":"wall","v0":0,"v1":1},{"trait":"wall","v0":2,"v1":3},{"trait":"wall","v0":4,"v1":5},{"trait":"wall","v0":6,"v1":7},{"curve":-90,"trait":"wall","v0":0,"v1":4},{"curve":-90,"trait":"wall","v0":5,"v1":2},{"curve":-90,"trait":"wall","v0":3,"v1":7},{"curve":90,"trait":"wall","v0":1,"v1":6},{"trait":"netFrame","v0":10,"v1":11,"curve":20,"color":"FF0000"},{"curve":0,"trait":"circleRed","v0":12,"v1":13},{"trait":"netFrame","v0":14,"v1":15,"y":-70,"curve":140,"color":"000000"},{"trait":"netFrame","v0":16,"v1":17,"y":70,"curve":-140,"color":"000000"},{"curve":0,"trait":"circleRed","v0":18,"v1":19,"x":700},{"curve":0,"trait":"circleRed","v0":20,"v1":21,"x":0},{"curve":0,"trait":"circleRed","v0":223,"v1":224,"x":0},{"curve":0,"vis":true,"cMask":["none"],"color":"4466BB","v0":22,"v1":23,"x":-230},{"curve":0,"vis":true,"cMask":["none"],"color":"4466BB","v0":24,"v1":25,"x":230},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":26,"v1":27,"x":-230},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":26,"v1":27},{"curve":-180,"trait":"circleRed","v0":28,"v1":29,"x":-540},{"curve":180,"trait":"circleRed","v0":28,"v1":29,"x":-540},{"curve":-180,"trait":"circleRed","v0":30,"v1":31,"x":540},{"curve":180,"trait":"circleRed","v0":30,"v1":31,"x":540},{"curve":-180,"trait":"circleRed","v0":32,"v1":33,"x":540},{"curve":180,"trait":"circleRed","v0":32,"v1":33,"x":540},{"curve":-180,"trait":"circleRed","v0":34,"v1":35,"x":-540},{"curve":180,"trait":"circleRed","v0":34,"v1":35,"x":-540},{"curve":-180,"trait":"circleRed","v0":36,"v1":37,"x":540},{"curve":180,"trait":"circleRed","v0":36,"v1":37,"x":540},{"curve":-180,"trait":"circleRed","v0":38,"v1":39,"x":540},{"curve":180,"trait":"circleRed","v0":38,"v1":39,"x":540},{"curve":-180,"trait":"circleRed","v0":40,"v1":41,"x":540},{"curve":180,"trait":"circleRed","v0":40,"v1":41,"x":540},{"curve":-180,"trait":"circleRed","v0":42,"v1":43,"x":540},{"curve":180,"trait":"circleRed","v0":42,"v1":43,"x":540},{"curve":-180,"trait":"circleRed","v0":44,"v1":45,"x":540},{"curve":180,"trait":"circleRed","v0":44,"v1":45,"x":540},{"curve":-180,"trait":"circleRed","v0":46,"v1":47,"x":540},{"curve":180,"trait":"circleRed","v0":46,"v1":47,"x":540},{"curve":-180,"trait":"circleRed","v0":48,"v1":49,"x":-540},{"curve":180,"trait":"circleRed","v0":48,"v1":49,"x":-540},{"curve":-180,"trait":"circleRed","v0":50,"v1":51,"x":-540},{"curve":180,"trait":"circleRed","v0":50,"v1":51,"x":-540},{"curve":-180,"trait":"circleRed","v0":52,"v1":53,"x":-540},{"curve":180,"trait":"circleRed","v0":52,"v1":53,"x":-540},{"curve":-180,"trait":"circleRed","v0":54,"v1":55,"x":-540},{"curve":180,"trait":"circleRed","v0":54,"v1":55,"x":-540},{"curve":-180,"trait":"circleRed","v0":56,"v1":57,"x":-540},{"curve":180,"trait":"circleRed","v0":56,"v1":57,"x":-540},{"curve":-180,"trait":"circleRed","v0":58,"v1":59,"x":-540},{"curve":180,"trait":"circleRed","v0":58,"v1":59,"x":-540},{"curve":-180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":60,"v1":61,"x":0},{"curve":180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":60,"v1":61,"x":0},{"curve":-180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":62,"v1":63,"x":0},{"curve":180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":62,"v1":63,"x":0},{"curve":-180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":64,"v1":65,"x":0},{"curve":180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":64,"v1":65,"x":0},{"curve":180,"trait":"circleRed","v0":66,"v1":67,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":70,"v1":71,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":72,"v1":73,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":74,"v1":75,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":76,"v1":77,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":78,"v1":79,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":80,"v1":81,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":82,"v1":83,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":84,"v1":85,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":86,"v1":87,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":88,"v1":89,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":90,"v1":91,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":92,"v1":93,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":94,"v1":95,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":96,"v1":97,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":98,"v1":99,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":100,"v1":101,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":102,"v1":103,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":104,"v1":105,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":106,"v1":107,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":108,"v1":109,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":110,"v1":111,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":112,"v1":113,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":114,"v1":115,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":116,"v1":117,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":118,"v1":119,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":120,"v1":121,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":122,"v1":123,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":124,"v1":125,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":126,"v1":127,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":128,"v1":129,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":130,"v1":131,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":132,"v1":133,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":134,"v1":135,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":136,"v1":137,"x":-697},{"curve":180,"trait":"circleRed","v0":138,"v1":139,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":140,"v1":141,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":142,"v1":143,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":144,"v1":145,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":146,"v1":147,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":148,"v1":149,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":150,"v1":151,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":152,"v1":153,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":154,"v1":155,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":156,"v1":157,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":158,"v1":159,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":160,"v1":161,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":162,"v1":163,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":164,"v1":165,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":166,"v1":167,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":168,"v1":169,"x":697},{"trait":"netFrameRed","v0":170,"v1":171,"x":-700},{"trait":"bouncePuck","v0":172,"v1":173,"curve":-60},{"trait":"bouncePuck","v0":174,"v1":175,"curve":-60},{"trait":"bouncePuck","v0":176,"v1":177,"curve":-65},{"trait":"bouncePuck","v0":178,"v1":179,"curve":-65},{"trait":"netFrameRed","v0":180,"v1":181,"x":-700},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":190,"v1":191,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":192,"v1":193,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":194,"v1":195,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":196,"v1":197,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":198,"v1":199,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":200,"v1":201,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":202,"v1":203,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":204,"v1":205,"x":-697},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":206,"v1":207,"x":-230},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":208,"v1":209},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":182,"v1":218},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":183,"v1":217},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":184,"v1":216},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":185,"v1":213},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":186,"v1":214},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":187,"v1":212},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":188,"v1":215},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":189,"v1":211},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":221,"v1":222},{"trait":"netFrame","v0":10,"v1":170,"curve":140,"color":"000000"},{"trait":"netFrame","v0":11,"v1":171,"curve":-140,"color":"000000"},{"trait":"netFrame","v0":17,"v1":15,"curve":20,"color":"0000FF"},{"vis":true,"color":"F0F0F0","v0":225,"v1":226,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":227,"v1":228,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":229,"v1":230,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":231,"v1":232,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":232,"v1":233,"cMask":["redKO"],"y":30},{"vis":true,"color":"F0F0F0","v0":234,"v1":235,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":236,"v1":237,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":238,"v1":239,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":240,"v1":241,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":242,"v1":243,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":244,"v1":245,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":246,"v1":247,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":247,"v1":248,"cMask":["redKO"],"y":30},{"vis":true,"color":"000000","v0":249,"v1":250,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":251,"v1":252,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":253,"v1":254,"cMask":["redKO"]}],"goals":[{"team":"red","p0":[-708,70],"p1":[-708,-70],"cMask":["ball"],"bCoef":1},{"team":"blue","p0":[708,-70],"p1":[708,70],"cMask":["ball"],"bCoef":1}],"discs":[{"trait":"goalPost","pos":[-700,-70]},{"trait":"goalPost","pos":[-700,70]},{"trait":"goalPost","pos":[700,70]},{"trait":"goalPost","pos":[700,-70]},{"trait":"stopDisc","pos":[-753,0]},{"trait":"stopDisc","pos":[-753,17]},{"trait":"stopDisc","pos":[-755,35]},{"trait":"stopDisc","pos":[-754,-18]},{"trait":"stopDisc","pos":[-755,-35]},{"trait":"stopDisc","pos":[755,-35]},{"trait":"stopDisc","pos":[754,-18]},{"trait":"stopDisc","pos":[753,0]},{"trait":"stopDisc","pos":[753,18]},{"trait":"stopDisc","pos":[755,35]},{"trait":"stopDisc","pos":[-753,-53]},{"trait":"stopDisc","pos":[-740,-68]},{"trait":"stopDisc","pos":[-722,-72]},{"trait":"stopDisc","pos":[-753,54]},{"trait":"stopDisc","pos":[-740,70]},{"trait":"stopDisc","pos":[-722,74]},{"trait":"stopDisc","pos":[754,54]},{"trait":"stopDisc","pos":[741,70]},{"trait":"stopDisc","pos":[721,74]},{"trait":"stopDisc","pos":[722,-74]},{"trait":"stopDisc","pos":[740,-68]},{"trait":"stopDisc","pos":[753,-53]},{"trait":"stopDisc","pos":[-748,62]},{"trait":"stopDisc","pos":[-754,45]},{"trait":"stopDisc","pos":[-753,27]},{"trait":"stopDisc","pos":[-752,8]},{"trait":"stopDisc","pos":[-752,-9]},{"trait":"stopDisc","pos":[-754,-27]},{"trait":"stopDisc","pos":[-754,-45]},{"trait":"stopDisc","pos":[-747,-62]},{"trait":"stopDisc","pos":[-732,-71]},{"trait":"stopDisc","pos":[-713,-70]},{"trait":"stopDisc","pos":[-732,73]},{"trait":"stopDisc","pos":[-712,72]},{"trait":"stopDisc","pos":[711,72]},{"trait":"stopDisc","pos":[731,73]},{"trait":"stopDisc","pos":[749,63]},{"trait":"stopDisc","pos":[756,44]},{"trait":"stopDisc","pos":[753,27]},{"trait":"stopDisc","pos":[753,9]},{"trait":"stopDisc","pos":[753,-9]},{"trait":"stopDisc","pos":[755,-26]},{"trait":"stopDisc","pos":[755,-44]},{"trait":"stopDisc","pos":[749,-61]},{"trait":"stopDisc","pos":[731,-72]},{"trait":"stopDisc","pos":[713,-73]}],"planes":[{"bCoef":1,"cMask":["red","blue"],"dist":-900,"normal":[1,0]},{"bCoef":1,"cMask":["red","blue"],"dist":-900,"normal":[-1,0]},{"bCoef":1,"cMask":["ball"],"dist":-400,"normal":[0,1]},{"bCoef":1,"cMask":["ball"],"dist":-400,"normal":[0,-1]},{"bCoef":1,"cMask":["ball"],"dist":-900,"normal":[1,0]},{"bCoef":1,"cMask":["ball"],"dist":-900,"normal":[-1,0]}],"traits":{"ballArea":{"vis":false,"bCoef":1,"cMask":["ball"]},"wall":{"vis":true,"color":"7e1e1f","bCoef":1,"cMask":["all"],"cGroup":["all"]},"invis":{"vis":false,"cMask":["none"],"color":"666666"},"net":{"vis":true,"cMask":["none"],"color":"dddddd"},"netTop":{"vis":true,"cMask":["none"],"color":"999999"},"netFrame":{"vis":true,"bCoef":0.1,"cMask":["all"],"color":"dddddd"},"netFrameRed":{"vis":false,"cMask":["none"],"color":"7e1e1f"},"circleRed":{"vis":true,"cMask":["none"],"color":"A73D2D"},"goalPost":{"radius":4,"invMass":0,"color":"7e1e1f","bCoef":0.4,"cMask":["all"]},"goalNet":{"vis":true,"bCoef":0.1,"cMask":["ball"]},"bouncePuck":{"vis":false,"bCoef":-6,"cMask":["ball"],"color":"ffee00"},"bouncePuck2":{"vis":true,"bCoef":-6,"cMask":["ball"],"color":"ffee00"},"stopDisc":{"vis":false,"radius":3,"invMass":0,"bCoef":0.1,"cMask":["ball"],"color":"dddddd"},"kickOffBarrier":{"vis":false,"bCoef":0.1,"cGroup":["redKO","blueKO"],"cMask":["red","blue"]}},"ballPhysics":{"radius":7,"bCoef":0.33,"damping":0.994,"color":"000000","invMass":1.3},"playerPhysics":{"bCoef":0.5,"invMass":0.5,"damping":0.98,"acceleration":0.1,"kickStrength":7,"kickingDamping":0.97,"kickingAcceleration":0.15}}' //mapa by natsu
- var room = HBInit(roomConfig); //inicjacja obiektu room, glownego obiektu naszego pokoju
- room.setCustomStadium(stadiumFileTextBig); //ustawiamy mape hokeja jako domyslna
- room.setScoreLimit(3); //ustawiamy limit bramek na 3
- room.setTimeLimit(5); //ustawiamy limit minut na 5
- room.setTeamsLock(true); //blokujemy samodzielne przemieszczanie miedzy druzynami
- function updateAdmins() //funkcja, ktora daje graczowi admina jesli nie ma na roomie zadnego admina
- {
- var players = room.getPlayerList().filter((player) => player.id != 0 );
- if ( players.length == 0 ) return;
- if ( players.find((player) => player.admin) != null ) return;
- room.setPlayerAdmin(players[0].id, true);
- }
- function initPlayerStats(player) //funkcja inicjująca statystyki gracza
- {
- if (stats.get(player.name)) return;
- stats.set(player.name, [0, 0, 0]) // gole, asysty, czyste konta
- }
- function pushAfkFun(player)
- {// !afk
- if (!(afkPlayers.includes(player.name)))
- {
- afkPlayers.push(player.name);
- room.setPlayerTeam(player.id, 0);
- room.sendChat("Player " + player.name + " is AFK!");
- }
- }
- function gotAfkFun(player)
- {
- if (afkPlayers.includes(player.name))
- return true;
- }
- function unAfkFun(player)
- { // !jj
- if(afkPlayers.includes(player.name))
- {
- pos = afkPlayers.indexOf(player.name);
- afkPlayers.splice(pos, 1);
- room.sendChat("Player " + player.name + " is not AFK anymore!");
- }
- }
- function pushMuteFun(player, message)
- {// !mute Pabol
- if (player.admin == true)
- if (!(mutedPlayers.includes(message.substr(6)))) mutedPlayers.push(message.substr(6));
- }
- function gotMutedFun(player)
- {
- if (mutedPlayers.includes(player.name))
- return true;
- }
- function unmuteFun(player, message)
- { // !unmute Pabol
- if (player.admin == true)
- {
- pos = mutedPlayers.indexOf(message.substr(9));
- mutedPlayers.splice(pos, 1);
- }
- }
- function statsFun(player, message)
- { // !stats Pabol
- if (stats.get(message.substr(7)))
- sendStats(message.substr(7));
- else
- return false;
- }
- function gkFun(player)
- { // !gk
- if (room.getScores() != null)
- {
- if (player.team == 1)
- {
- gk[0] = player;
- room.sendChat("New GK of Red Team is " + player.name);
- }
- else if (player.team == 2)
- {
- gk[1] = player;
- room.sendChat("New GK of Blue Team is " + player.name);
- }
- }
- return;
- }
- function resetStatsFun (player)
- { // !resetstats
- if (rankingCalc(player.name) > 0)
- {
- stats.set(player.name, [0,0,0]);
- room.sendChat("Your stats have been reseted! ");
- }
- else
- room.sendChat("You must have positive points to be able to reset it, sorry.");
- }
- function rankingCalc(player)
- {
- // Goal: 5 pts, assist: 3 pts, win: 3 pts, cs: 6 pts
- return stats.get(player)[0] * 5 + stats.get(player)[1] * 3 +
- stats.get(player)[2] * 6;
- }
- function ranking()
- {
- var overall = [];
- players = Array.from(stats.keys());
- for (var i = 2; i < players.length; i++)
- {
- score = rankingCalc(players[i])
- overall.push({name: players[i], goals: stats.get(players[i])[0], assist: stats.get(players[i])[1], cs: stats.get(players[i])[2]});
- }
- overall.sort(function(a,b)
- {
- return b.value - a.value;
- })
- string = "";
- var temp = 0;
- var pozycji = 0;
- for (var i = 0; i < overall.length; i++)
- {
- if ((overall[i].goals + overall[i].assist + overall[i].cs ) != 0)
- {
- if(pozycji < 3)
- {
- string += (i+1-temp) + ") " + overall[i].name + ": " + overall[i].goals + " goals, " + overall[i].assist + " assist, " + overall[i].cs + " cleansheets ";
- pozycji++;
- }
- }
- else
- {
- temp++;
- }
- }
- return string;
- }
- function sendStats(name)
- {
- ps = stats.get(name); // stands for playerstats
- room.sendChat(name + ": goals: " + ps[0] + ", assists: " + ps[1]
- + ", cs: " + ps[2]);
- }
- function whichTeam()
- { // gives the players in the red or blue team
- var players = room.getPlayerList();
- var redTeam = players.filter(player => player.team == 1);
- var blueTeam = players.filter(player => player.team == 2);
- return [redTeam, blueTeam]
- }
- function isGk()
- { // gives the mosts backward players before the first kickOff
- var players = room.getPlayerList();
- var min = players[0];
- min.position = {x: room.getBallPosition().x + 60}
- var max = min;
- for (var i = 0; i < players.length; i++)
- {
- if (players[i].position != null)
- {
- if (min.position.x > players[i].position.x) min = players[i];
- if (max.position.x < players[i].position.x) max = players[i];
- }
- }
- return [min, max]
- }
- /*
- For the game
- */
- // Gives the last player who touched the ball, works only if the ball has the same
- // size than in classics maps.
- var radiusBall = 7;
- var triggerDistance = radiusBall + 15 + 0.1;
- function getLastTouchTheBall(lastPlayerTouched, time)
- {
- var ballPosition = room.getBallPosition();
- var players = room.getPlayerList();
- for(var i = 0; i < players.length; i++)
- {
- if(players[i].position != null)
- {
- var distanceToBall = pointDistance(players[i].position, ballPosition);
- if(distanceToBall < triggerDistance)
- {
- lastPlayerTouched = players[i];
- return lastPlayerTouched;
- }
- }
- }
- return lastPlayerTouched;
- }
- // Calculate the distance between 2 points
- function pointDistance(p1, p2)
- {
- var d1 = p1.x - p2.x;
- var d2 = p1.y - p2.y;
- return Math.sqrt(d1 * d1 + d2 * d2);
- }
- function isOvertime()
- {
- scores = room.getScores();
- if (scores != null)
- {
- if (scores.timeLimit != 0)
- {
- if (scores.time > scores.timeLimit)
- {
- if (scores.red == 0 && hasFinished == false)
- {
- stats.get(gk[0].name)[2] += 1;
- stats.get(gk[1].name)[2] += 1;
- hasFinished = true;
- }
- }
- }
- }
- }
- // return: the name of the team who took a goal
- var team_name = team => team == 1 ? "blue" : "red";
- // return: whether it's an OG
- var isOwnGoal = (team, player) => team != player.team ? " (og)" : "";
- // return: a better display of the second when a goal is scored
- var floor = s => s < 10 ? "0" + s : s;
- // return: whether there's an assist
- var playerTouchedTwice = playerList => playerList[0].team == playerList[1].team ? " (" + playerList[1].name + ")" : "";
- /*
- Events
- */
- var stats = new Map(); // map where will be set all player stats
- var mutedPlayers = []; // Array where will be added muted players
- var afkPlayers = [];
- var init = "init"; // Smth to initialize smth
- init.id = 0; // Faster than getting host's id with the method
- init.name = "init";
- var scorers ; // Map where will be set all scorers in the current game (undefined if reset or end)
- var whoTouchedLast; // var representing the last player who touched the ball
- var whoTouchedBall = [init, init]; // Array where will be set the 2 last players who touched the ball
- var gk = [init, init];
- var goalScored = false;
- var checked = false; //TO DO CZESCI Z BETONAMI - warunek wyswietlania info o power play
- var betonPlayers = [];
- var listOfPlayers;
- initPlayerStats(room.getPlayerList()[0]) // lazy lol, i'll fix it later
- initPlayerStats(init);
- room.onPlayerLeave = function(player)
- {
- updateAdmins();
- }
- room.onPlayerJoin = function(player)
- {
- updateAdmins(); // Gives admin to the first player who join the room if there's no one
- initPlayerStats(player); // Set new player's stat
- room.sendChat("Hi " + player.name + "! Write !info, !rules, !discord" )
- }
- var redTeam;
- var blueTeam;
- room.onGameStart = function()
- {
- [redTeam,blueTeam] = whichTeam();
- timebetongk = 3.0;
- }
- room.onPlayerTeamChange = function(player)
- {
- if(player.id == 0)
- room.setPlayerTeam(player.id, 0);
- }
- function infoFun()
- { // !info
- room.sendChat("Pabol is the author of this bot. Player commands: !rules, !info, !discord, !stats [nick], !ranking, !afk, !jj");
- }
- function helpadminFun()
- { // !helpadmin
- if(player.admin == true)
- {
- room.sendChat("Admin commands: !mute [nick], !unmute [nick], !hockey, !pub [sec] [nick]");
- }
- return false;
- }
- function loginFun(player, message)
- { // !hasloadmina
- room.setPlayerAdmin(player.id, true);
- return false; // The message won't be displayed
- }
- function discordFun()
- { // !discord
- room.sendChat("Our discord: https://discord.gg/tWzURex");
- }
- function hockeyFun(player)
- { // !hockey
- if(player.admin == true)
- {
- room.setCustomStadium(stadiumFileTextBig);
- room.sendChat("Map has been changed to Hockey 4v4!");
- }
- return false;
- }
- function rulesFun(player)
- { // !rules
- room.sendChat("Rules: 1) A goalkeeper can only be in his blue area or behind a net. Can´t touch puck or player outside. [Penalty for 2 minutes]", player.id);
- room.sendChat("2) A goalkeeper can´t shoot a puck which is behind net, while being inside a net. [Penalty for 30 seconds]", player.id);
- room.sendChat("3) A player can´t touch puck in his own gk blue area (beton). [Penalty for 1 minute]", player.id);
- room.sendChat("4) A player can´t push an opponent gk during shots. [Penalty for 30 seconds]", player.id);
- room.sendChat("5) A team can pull out a goalie to attack when they are loosing, 1 minute before end of the match (powerplay-pp). ", player.id);
- room.sendChat("6) A team can make player change in a match only during a period pause or game pause if player have a serious problem. ", player.id);
- }
- function positionFun(player)
- { // !position (command for development only, useless during the game)
- if(player.team == 2)
- {
- var srodekKola = { x: 698.256, y: -2.0135073 }
- var distans = pointDistance(player.position, srodekKola);
- room.sendChat("Position x: " + player.position.x + " Position y: " + player.position.y, player.id);
- room.sendChat("Distance = " + distans, player.id);
- }
- else if(player.team == 1)
- {
- var srodekKola = { x: -698.256, y: -2.0135073 }
- var distans = pointDistance(player.position, srodekKola);
- room.sendChat("Position x: " + player.position.x + " Position y: " + player.position.y, player.id);
- room.sendChat("Distance = " + distans, player.id);
- }
- return false;
- }
- function pubFun(player, message)
- { // !pub 60 Pabol
- if(player.admin == true)
- {
- var scores2 = room.getScores();
- var liczba = parseFloat(message.substr(5).substr(0, message.substr(5).indexOf(" ")));
- for(var i =0; i<listOfPlayers.length; i++)
- {
- if(listOfPlayers[i].name == message.substr(5).substr(message.substr(5).indexOf(" ") + 1))
- {
- var penaltyMinutes = parseInt(liczba/60);
- var penaltySeconds = parseInt(liczba%60);
- if(penaltySeconds < 10)
- {
- penaltySeconds = "0" + penaltySeconds;
- }
- var returnMinutes = parseInt((scores2.time + liczba)/60);
- var returnSeconds = parseInt((scores2.time + liczba)%60);
- if(returnSeconds < 10)
- {
- returnSeconds = "0" + returnSeconds;
- }
- betonPlayers.push({player: listOfPlayers[i], value: scores2.time + liczba , team: listOfPlayers[i].team});
- room.setPlayerTeam(listOfPlayers[i].id, 0);
- room.sendChat("Player " + listOfPlayers[i].name + " has recived " + penaltyMinutes + ":" + penaltySeconds + " minute penalty!" + " He will return on a rink in " + returnMinutes + ":" + returnSeconds + " min!");
- }
- }
- }
- return false;
- }
- function rankFun()
- { // !ranking
- string = ranking();
- room.sendChat("Rank: " + string);
- }
- function clearBansFun(player)
- { // !clearbans
- if(player.admin == true)
- {
- room.clearBans();
- return false;
- }
- }
- var commands = {
- // Command that doesnt need to know players attributes.
- "!info": infoFun,
- "!helpadmin": helpadminFun,
- "!krulemjestem": loginFun,
- "!rules": rulesFun,
- "!discord": discordFun,
- "!hockey": hockeyFun,
- "!position": positionFun,
- "!pub": pubFun,
- "!ranking": rankFun,
- "!clearbans": clearBansFun,
- "!afk": pushAfkFun,
- "!jj": unAfkFun,
- // Command that need to know who is the player.
- "!resetstats": resetStatsFun,
- "!gk": gkFun,
- // Command that need to know what's the message.
- "!stats": statsFun,
- // Command that need to know who is the player and what's the message.
- "!mute" : pushMuteFun,
- "!unmute": unmuteFun
- }
- room.onPlayerChat = function(player, message)
- {
- if (mutedPlayers.includes(player.name)) return false;
- let spacePos = message.search(" ");
- let command = message.substr(0, spacePos !== -1 ? spacePos : message.length);
- if (commands.hasOwnProperty(command) == true) return commands[command](player, message);
- }
- var bluePlayers;
- var redPlayers;
- //zmienne tablicowe do wylapywania czy jest 3v3 czy ktos pauzuje za beton
- var blueBeton;
- var redBeton;
- //zmienne do betonu gk (czas opoznienia po betonie) oraz do betonu gracza z pola
- var timebetongk = 0;
- var timebetonpole = 0;
- function betonPlayer()
- {
- betonPlayers.push({player: whoTouchedLast, value: scores.time + 60, team: whoTouchedLast.team});
- room.setPlayerTeam(whoTouchedLast.id, 0);
- timebetonpole = scores.time + 1.0;
- var returnMinutes = parseInt((scores.time + 60) / 60);
- var returnSeconds = parseInt((scores.time + 60) % 60);
- if(returnSeconds < 10)
- returnSeconds = "0" + returnSeconds;
- room.sendChat("Player " + whoTouchedLast.name + " has touched a puck into his GK box. He has recived the 1 minute penalty. He will return in " + returnMinutes + ":" + returnSeconds + ".");
- }
- function betonGk()
- {
- room.pauseGame(true);
- room.sendChat("Player " + players[0].name + " has touched a puck outside the blue box as a goalkeeper. Capitain has to choose some player who will serve this penalty.");
- timebetongk = scores.time + 2.0;
- }
- var players;
- function IsBeton()
- { // funkcja, ktora wykrywa czy byl beton czy nie
- bluePlayers = room.getPlayerList().filter((player) => player.team == 2);
- redPlayers = room.getPlayerList().filter((player) => player.team == 1);
- scores = room.getScores();
- blueBeton = betonPlayers.filter((player) => player.team == 2);
- redBeton = betonPlayers.filter((player) => player.team == 1);
- if((bluePlayers.length + blueBeton.length) >= 3 && (redPlayers.length + redBeton.length) >= 3 && scores.time > timebetongk && scores.time > timebetonpole)
- {
- // BETON BLUE GK
- var srodekKola = { x: 697, y: 0}
- var liczba = 101;
- var ballPosition;
- var distans;
- var distansBallPlayer;
- if(gk[1].position != undefined && gk[1].id != 0)
- {
- players = room.getPlayerList().filter((player) => player.id == gk[1].id && player.id != 0);
- distans;
- distansBallPlayer
- var gkPos;
- if(players.length != 0)
- {
- distans = pointDistance(players[0].position, srodekKola);
- ballPosition = room.getBallPosition();
- distansBallPlayer = pointDistance(players[0].position, ballPosition);
- gkPos = players[0].position.x;
- }
- else //Jest to zabezpieczenie, gdy lista graczy jest mniejsza od 0, czyli gdy nie ma gk, nie bedzie betonu dla gk
- {
- distans = 0;
- distansBallPlayer = 50;
- gkPos = 0;
- }
- if((whoTouchedLast != null) && (gk[1].id == whoTouchedLast.id) && (distans > liczba) && distansBallPlayer < 24.0)
- {
- if(players[0].position.x < 700.72)
- {
- if(scores.time < 240)
- betonGk();
- else
- {
- if (scores.red <= scores.blue)
- betonGk();
- }
- }
- }
- }
- //BETON BLUE Team
- bluePlayers = room.getPlayerList().filter((player) => player.team == 2 && player.id != gk[1].id && player.id != 0);
- liczba = 118.5;
- var playerPos;
- for(var i = 0; i<bluePlayers.length; i++)
- {
- playerPos = bluePlayers[i].position.x;
- if(bluePlayers[i].position != undefined)
- {
- distans = pointDistance(bluePlayers[i].position, srodekKola);
- ballPosition = room.getBallPosition();
- distansBallPlayer = pointDistance(bluePlayers[i].position, ballPosition);
- if((whoTouchedLast != null) && (bluePlayers[i].position.x < 700.72) && (bluePlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
- {
- if(scores.time < 240)
- betonPlayer();
- else
- {
- if(scores.red <= scores.blue)
- betonPlayer();
- }
- }
- if((whoTouchedLast != null) && (bluePlayers[i].position.x > 700.72 && bluePlayers[i].position.x < 756.0 && bluePlayers[i].position.y < 101 && bluePlayers[i].position.y > -101) && (bluePlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
- {
- if(scores.time < 240)
- betonPlayer();
- else
- {
- if(scores.red <= scores.blue)
- betonPlayer();
- }
- }
- }
- }
- // BETON RED GK
- var srodekKola2 = { x: -697, y: 0}
- liczba = 101;
- if(gk[0].position != undefined && gk[0].id != 0)
- {
- players = room.getPlayerList().filter((player) => player.id == gk[0].id && player.id != 0);
- distans;
- distansBallPlayer;
- var gkPos;
- if(players.length != 0)
- {
- distans = pointDistance(players[0].position, srodekKola2);
- ballPosition = room.getBallPosition();
- distansBallPlayer = pointDistance(players[0].position, ballPosition);
- gkPos = players[0].position.x;
- }
- else
- {
- distans = 0;
- distansBallPlayer = 50;
- gkPos = 0;
- }
- if((whoTouchedLast != null) && (gk[0].id == whoTouchedLast.id) && (distans > liczba) && distansBallPlayer < 24.0)
- {
- if(players[0].position.x > -700.72)
- {
- if(scores.time < 240)
- betonGk();
- else
- {
- if(scores.red >= scores.blue)
- betonGk();
- }
- }
- }
- }
- //BETON Red team
- redPlayers = room.getPlayerList().filter((player) => player.team == 1 && player.id != gk[0].id && player.id != 0);
- liczba = 118.5;
- for(var i = 0; i<redPlayers.length; i++)
- {
- if(redPlayers[i].position != undefined)
- {
- distans = pointDistance(redPlayers[i].position, srodekKola2);
- ballPosition = room.getBallPosition();
- distansBallPlayer = pointDistance(redPlayers[i].position, ballPosition);
- playerPos = redPlayers[i].position.x;
- if((whoTouchedLast != null) && (redPlayers[i].position.x > -700.72) && (redPlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
- {
- if(scores.time < 240)
- betonPlayer();
- else
- {
- if(scores.red >= scores.blue)
- betonPlayer();
- }
- }
- if((whoTouchedLast != null) && (redPlayers[i].position.x < -700.72 && redPlayers[i].position.x > -756.0 && redPlayers[i].position.y < 101 && redPlayers[i].position.y > -101) && (redPlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
- {
- if(scores.time < 240)
- betonPlayer();
- else
- {
- if(scores.red >= scores.blue)
- betonPlayer();
- }
- }
- }
- }
- }
- }
- room.onPlayerBallKick = function (player)
- {
- whoTouchedLast = player;
- IsBeton();
- }
- var kickOff = false;
- var hasFinished = false;
- room.onGameTick = function()
- {
- setInterval(isOvertime, 5000, hasFinished);
- listOfPlayers = room.getPlayerList().filter((player) => player.id != 0);
- if (kickOff == false)
- { // simplest comparison to not charge usulessly the tick thing
- if (room.getScores().time != 0)
- {
- kickOff = true;
- gk = isGk();
- room.sendChat("Red GK: " + gk[0].name + ", Blue GK: " + gk[1].name)
- }
- }
- if (goalScored == false)
- whoTouchedLast = getLastTouchTheBall(whoTouchedLast);
- if (whoTouchedLast != undefined)
- {
- if (whoTouchedLast.id != whoTouchedBall[0].id)
- {
- whoTouchedBall[1] = whoTouchedBall[0];
- whoTouchedBall[0] = whoTouchedLast; // last player who touched the ball
- }
- scores = room.getScores();
- //checked - previously initialized boolean variable - send powerplay info
- if(checked == false && scores.time > 240 && scores.time < 300 && scores.blue != scores.red)
- {
- checked = true;
- if(scores.blue > scores.red)
- room.sendChat("POWERPLAY FOR RED TEAM! RED TEAM'S GK CAN GO OUTSIDE A BLUE BOX");
- else
- room.sendChat("POWER PLAY FOR BLUE TEAM! BLUE TEAM'S GK CAN GO OUTSIDE A BLUE BOX");
- }
- IsBeton();
- }
- //po uplywie czasu kary gracz wraca do druzyny
- for(var i = 0; i<betonPlayers.length; i++)
- {
- if(betonPlayers[i].value <= scores.time)
- {
- betonPlayers[i].player.team = betonPlayers[i].team;
- room.setPlayerTeam(betonPlayers[i].player.id, betonPlayers[i].team);
- betonPlayers.shift();
- }
- }
- }
- room.onTeamGoal = function(team)
- { // Write on chat who scored and when.
- var temp_name = "";
- goalScored = true;
- var time = room.getScores().time;
- timebetongk = time + 3.0;
- var m = Math.trunc(time/60); var s = Math.trunc(time % 60);
- time = m + ":" + floor(s); // MM:SS format
- var ownGoal = isOwnGoal(team, whoTouchedBall[0]);
- var assist = "";
- if (ownGoal == "") assist = playerTouchedTwice(whoTouchedBall);
- if(ownGoal == "")
- {
- room.sendChat("A goal has been scored by " + whoTouchedBall[0].name +
- assist + " at " +
- time + " against team " + team_name(team));
- }
- else
- {
- for(var pom = 0; pom < whoTouchedBall.length; pom++)
- {
- if(whoTouchedBall[pom].team == team)
- {
- temp_name = whoTouchedBall[pom].name;
- room.sendChat("A goal has been scored by " + whoTouchedBall[pom].name + " " +
- time + " against team " + team_name(team));
- break;
- }
- }
- }
- if (ownGoal != "")
- {
- if(temp_name != "")
- stats.get(temp_name)[0] += 1;
- }
- else
- {
- stats.get(whoTouchedBall[0].name)[0] += 1;
- }
- if (whoTouchedBall[1] != init && assist != "") stats.get(whoTouchedBall[1].name)[1] += 1;
- if (scorers == undefined) scorers = new Map(); // Initializing dict of scorers
- if(ownGoal != "")
- {
- scorers.set(scorers.size + 1 +") " + temp_name, [time, assist, ownGoal]);
- temp_name = "";
- }
- else
- scorers.set(scorers.size + 1 +") " + whoTouchedLast.name, [time, assist, ownGoal])
- whoTouchedBall = [init, init];
- whoTouchedLast = undefined;
- //jak druzyna strzela gola to gracz ktory odbywal kare w przeciwnej druzynie wchodzi na boisko
- for(var i = 0; i<betonPlayers.length; i++)
- {
- if(betonPlayers[i].team != team)
- {
- betonPlayers[i].player.team = betonPlayers[i].team;
- betonPlayers[i].value = 0;
- room.sendChat(betonPlayers[i].player.name + "'s penalty has been shortened due to lost goal by his team.");
- }
- }
- }
- room.onPositionsReset = function()
- {
- goalScored = false;
- }
- room.onTeamVictory = function(scores)
- { // Sum up all scorers since the beginning of the match.
- if (scores.blue == 0 && gk[0].position != null && hasFinished == false) stats.get(gk[0].name)[2] += 1;
- if (scores.red == 0 && gk[1].position != null && hasFinished == false) stats.get(gk[1].name)[2] += 1;
- room.sendChat("Scored goals:")
- for (var [key, value] of scorers)
- { // key: name of the player, value: time of the goal
- if(value[2] == " (og)")
- {
- room.sendChat(key + " : " + value[0]);
- }
- else
- {
- room.sendChat(key + " " + value[1] + value[2] + ": " + value[0]);
- }
- }
- for(var i = 0; i<betonPlayers.length; i++)
- {
- betonPlayers[i].player.team = betonPlayers[i].team;
- room.setPlayerTeam(betonPlayers[i].player.id, betonPlayers[i].team);
- betonPlayers.shift();
- }
- timebetongk = 0;
- timebetonpole = 0;
- goalScored = false;
- }
- room.onPlayerTeamChange = function(changedPlayer)
- {
- if(changedPlayer.id == gk[0].id)
- {
- gk[0].id = 0;
- room.sendChat("GK red left team. New gk must type !gk");
- }
- if(changedPlayer.id == gk[1].id)
- {
- gk[1].id = 0;
- room.sendChat("GK blue left team. New gk must type !gk");
- }
- if(gotAfkFun(changedPlayer) && changedPlayer.team != 0)
- {
- room.setPlayerTeam(changedPlayer.id, 0);
- room.sendChat("Pick another player! (AFK)");
- }
- }
- room.onGameStop = function()
- {
- scorers = undefined;
- whoTouchedBall = [init, init];
- whoTouchedLast = undefined;
- gk = [init, init];
- kickOff = false;
- hasFinished = false;
- checked = false;
- goalScored = false;
- for(var i = 0; i<betonPlayers.length; i++)
- {
- betonPlayers[i].player.team = betonPlayers[i].team;
- room.setPlayerTeam(betonPlayers[i].player.id, betonPlayers[i].team);
- betonPlayers.shift();
- }
- timebetongk = 0;
- timebetonpole = 0;
- }
- room.onStadiumChange = function(newStadiumName, byPlayer)
- {
- if(byPlayer.id != 0)
- {
- room.setCustomStadium(stadiumFileTextBig);
- room.sendChat("Map change function is blocked! Map changed to Hockey 4v4!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement