Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //map info here
- checkpoints = [];
- tracks = [];
- mapSeed = 144;
- mapSize = 60;
- track1 = {checkpoints:[],roadblocks:[],laps:3,name:"rm -rf / circuit"};
- track1.checkpoints.push({x:30, y:40});
- track1.checkpoints.push({x:-10, y:40});
- track1.checkpoints.push({x:-25, y:-115});
- track1.checkpoints.push({x:-135, y:-115});
- track1.checkpoints.push({x:-265, y:-100});
- track1.checkpoints.push({x:-180, y:75});
- track1.checkpoints.push({x:-100, y:140});
- track1.checkpoints.push({x:75, y:115});
- track1.checkpoints.push({x:30, y:80});
- track1.roadblocks=[1,0,1, 0,0,0, 0,1,1,0];
- tracks.push(track1);
- track2 = {checkpoints:[],roadblocks:[],laps:0,name:"Sprint alpha"};
- track2.checkpoints.push({x:25, y:-185});
- track2.checkpoints.push({x:25, y:-130});
- track2.checkpoints.push({x:55, y:0});
- track2.checkpoints.push({x:165, y:0});
- track2.checkpoints.push({x:200, y:125});
- track2.checkpoints.push({x:-295, y:140});
- track2.checkpoints.push({x:-70, y:160});
- track2.checkpoints.push({x:80, y:120});
- track2.checkpoints.push({x:25, y:80});
- track2.checkpoints.push({x:55, y:40});
- track2.checkpoints.push({x:-15, y:-115});
- track2.checkpoints.push({x:-160, y:-80});
- track2.checkpoints.push({x:-270, y:-105});
- track2.checkpoints.push({x:-225, y:5});
- track2.roadblocks=[1,1,0, 1,1,1, 1,0,0,1, 1,1,1, 0,0,0, 0,0,1,1];
- tracks.push(track2);
- checkpoints = track1.checkpoints;
- sandboxArea = {x:155, y:-150};
- cornerOfShame = {x:250, y:-150};
- roadblocks = [];
- roadblocks.push({x:5,y:-125,angle:Math.PI/2});
- roadblocks.push({x:55,y:-125,angle:Math.PI/2});
- roadblocks.push({x:85,y:35,angle:Math.PI/2});
- roadblocks.push({x:125,y:15,angle:0});
- roadblocks.push({x:115,y:15,angle:0});
- roadblocks.push({x:125,y:-15,angle:0});
- roadblocks.push({x:115,y:-15,angle:0});
- roadblocks.push({x:-75,y:155,angle:0});
- roadblocks.push({x:-65,y:155,angle:0});
- roadblocks.push({x:-85,y:145,angle:Math.PI/2});
- roadblocks.push({x:-85,y:135,angle:Math.PI/2});
- roadblocks.push({x:5,y:-245,angle:Math.PI/2});
- roadblocks.push({x:185,y:5,angle:Math.PI/2});
- roadblocks.push({x:165,y:15,angle:0});
- roadblocks.push({x:175,y:15,angle:0});
- roadblocks.push({x:155,y:5,angle:Math.PI/2});
- roadblocks.push({x:155,y:-5,angle:Math.PI/2});
- roadblocks.push({x:255,y:-55,angle:Math.PI/2});
- roadblocks.push({x:285,y:125,angle:0});
- roadblocks.push({x:295,y:125,angle:0});
- bannerPositions = [];
- bannerPositions.push({x:25,y:-205});
- bannerPositions.push({x:-20,y:-110});
- bannerPositions.push({x:-95,y:-120});
- bannerPositions.push({x:-220,y:-120});
- bannerPositions.push({x:-120,y:60});
- bannerPositions.push({x:75,y:100});
- bannerPositions.push({x:120,y:0});
- //noPassageSigns.push();
- customMap = true;
- map =
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "9999999 9 9 9999999999999999999999999999999999999\n"+
- "99999 999 99 9999999999999999999999999999999999999\n"+
- "99999 9999999999999 999999999999999999999999999999999999\n"+
- " 999 999999999999999 9999999999999999999999999999 99 \n"+
- " 99999999999999 9 9 999999999999999 999 \n"+
- " 9999999999993 22 99999999999 99 \n"+
- "99999999999999 3999 9 9 9 99999999 9 99 \n"+
- "99999999999993 9999 9999999999999999 9999999 9 999 9 \n"+
- "9999999999999299999 99999999999 999999 999 99 \n"+
- "99999999999 99 99999999999 999999 999999999 \n"+
- "99999999999 99 99999999999 99999999999 99999999 9\n"+
- "99999999999 99 99 99999999999 9999999 99999999 9\n"+
- "99999999 99 99999999999 9999999 99999999 9\n"+
- "99999999 99 999999999999999 99999999 99999999 9\n"+
- "99999999 99999999999999999 99999999 99999999 9\n"+
- "99999999 999999999999999993 4 999 99999999 9\n"+
- "99999999 399999999999999999 4 99999999999 999 99999999 9\n"+
- "999999 999999999999999994 399999999999 999 99999999 9\n"+
- "999999 99999999999999999 4 99 999999 9\n"+
- "999999 99999999999999999993 499 9 99999 9\n"+
- "9999993 9999999999999999999 4 99 99999 9999999 9999 9\n"+
- "999999 99999999999999999994 399 99999 99999999 999 9\n"+
- "999999 9999999999999999999 4 999 999999 999999999 99 9\n"+
- "999999 99999999999999999993 49992 999999 9999999 9 9\n"+
- "999999 49999999999999999999 4 993 9999999999 99999999 9\n"+
- "999999 99999999999999999994 399 199999999999 9999999999 9\n"+
- "999999 9993 39999999999 4 993 99999999999 9999999999 9\n"+
- "99 3 999 99999999993 4999 9999999999 9999999999 9\n"+
- "99 999 99 9999999999 4 999 19999999999 9999999999 9\n"+
- "99 9999999 99 999999999 4 399 9999999999 9999999999 9\n"+
- "99 99 99 219999993354 5345999999 9\n"+
- "99 5 99 11 3454999999 9\n"+
- "999999999999999999999999999999991 9999934543 3554399999 \n"+
- " 9999999999999999999999999999 9999994454 535999999999 \n"+
- " 999999999999999999999999999 99999994539 9445399999999\n"+
- "999 99999999999999999999999999 9999999459 3454999999999\n"+
- "9999 99999999999999999999999993 99999993455434599999999999\n"+
- "9999 9999999999999999999999999 99999999345345559999999999\n"+
- "9999 999999999999999999999999 9999999999999999999999999\n"+
- "9999 999999999999999999999999 9999999999999999999999999\n"+
- "9999 999999999999999999999999 9999999999999999999999999\n"+
- "9999 999999999999999 9999999999999999999999999\n"+
- "9999 9 9 999 9999999999999999999999999\n"+
- "99999999999999 9 9999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999\n"+
- "999999999999999999999999999999999999999999999999999999999999" ;
- var Spectatorship = '{"name":"Spectatorship","level":3,"model":1,"size":1,"zoom":0.4,"specs":{"shield":{"capacity":[1000,1000],"reload":[100,100]},"generator":{"capacity":[1,1],"reload":[100,100]},"ship":{"mass":1e-7,"speed":[200,200],"rotation":[1,1],"acceleration":[1,1]}},"bodies":{"main":{"section_segments":4,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0],"y":[-60,0,60],"z":[0,0,0,0,0,0]},"width":[0,20,0],"height":[0,20,0],"texture":[17],"propeller":false}},"typespec":{"name":"Spectatorship","level":3,"model":1,"code":301,"specs":{"shield":{"capacity":[1000,1000],"reload":[100,100]},"generator":{"capacity":[1,1],"reload":[100,100]},"ship":{"mass":1e-7,"speed":[200,200],"rotation":[1,1],"acceleration":[1,1]}},"shape":[1.2,1.01,0.77,0.632,0.546,0.486,0.443,0.414,0.396,0.385,0.38,0.385,0.396,0.4,0.385,0.38,0.385,0.396,0.414,0.443,0.486,0.546,0.632,0.77,1.01,1.2,1.01,0.77,0.632,0.546,0.486,0.443,0.414,0.396,0.385,0.38,0.385,0.396,0.4,0.385,0.38,0.385,0.396,0.414,0.443,0.486,0.546,0.632,0.77,1.01],"lasers":[],"radius":1.2}}';
- //ship info here
- speedBuff = 10;
- dashSpeedBuff = 10;
- accelerationBuff = 1.05;
- dashAccelerationBuff = 1.05;
- energyRegenBuff = 1.25;
- var Astral = '{"name":"Astral Accelerator","level":1,"model":1,"size":1.5,"zoom":1.2,"specs":{"shield":{"capacity":[150,150],"reload":[10,10]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":80,"speed":[140,140],"rotation":[40,40],"acceleration":[150,150],"dash":{"rate":1,"burst_speed":[200,200],"speed":[240,240],"acceleration":[90,90],"initial_energy":[10,10],"energy":[100,100]}}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":-40,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-90,-93,-95,-90,-30,0,50,100,105],"z":[-7,-7,-7,-7,-7,-7,0,0,0]},"width":[20,23,25,27,30,27,30,26,0],"height":[0,6,8,10,15,18,8,10,0],"texture":[17,13,63,1,10,1,10,12]},"stripes":{"section_segments":16,"offset":{"x":15,"y":-40,"z":10},"position":{"x":[-4,-4,-4,11,5,0,0,0],"y":[-92,-30,0,50,100],"z":[1,6,10,3,3,0]},"width":[3,3,3,3,3,3],"height":[1,1,1,1,1],"texture":[63]},"cockpit":{"section_segments":10,"offset":{"x":0,"y":-20,"z":17},"position":{"x":[0,0,0,0,0,0],"y":[10,30,40,70,80],"z":[-2,0,0,0,0]},"width":[7.5,10,10,9.5,0],"height":[3,10,11,10,0],"texture":[9,4,13,4],"propeller":false},"detail":{"section_segments":8,"angle":3,"offset":{"x":26,"y":-50,"z":6},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"y":[0,3,7,11,14,17,21,25,28,31,35,39,42,45,49,53,57],"z":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"width":[1,4,6,4,1,4,6,4,1,4,6,4,1,4,6,4,1],"height":[1,4,6,4,1,4,6,4,1,4,6,4,1,4,6,4,1],"texture":[4,17,17,4,4,17,17,4,4,17,17,4,4,17,17,4]},"engine":{"section_segments":4,"offset":{"x":0,"y":-95,"z":18},"position":{"x":[0,0,0,0],"y":[-18,-15,15,18],"z":[0,0,0,0]},"width":[0,10,10,0],"height":[0,4,4,0],"texture":[18]},"bracings1":{"section_segments":8,"angle":90,"offset":{"x":0,"y":-85,"z":18},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0],"y":[-15,-14,-11.5,-10,-8,0,8,10,11.5,14,15],"z":[-20,-10,-1,1,2,0,2,1,-1,-10,-20]},"width":[4,4,4,4,4,5,4,4,4,4,4],"height":[0,10,4,3,2,3,2,3,4,10,0],"propeller":false,"texture":[13]},"bracings2":{"section_segments":8,"angle":90,"offset":{"x":0,"y":-105,"z":18},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0],"y":[-15,-14,-11.5,-10,-8,0,8,10,11.5,14,15],"z":[-20,-10,-1,1,2,0,2,1,-1,-10,-20]},"width":[4,4,4,4,4,5,4,4,4,4,4],"height":[0,10,4,3,2,3,2,3,4,10,0],"propeller":false,"texture":[13]},"engines":{"section_segments":12,"offset":{"x":18,"y":0,"z":15},"position":{"x":[0,0,0,0,0,0,0,0],"y":[25,20,25,40,75,70,65],"z":[5,0,0,0,0,0,0,0]},"width":[0,5,7,8,8,6,0],"height":[0,14,15,15,13,10,0],"texture":[13,1,63,10,18,17],"propeller":true}},"wings":{"main":{"length":[46,0,25,-25,20],"width":[100,20,70,0,70,10],"angle":[10,0,110,110,-70],"position":[-30,5,-10,30,-10,20],"texture":[18,11,63],"doubleside":true,"bump":{"position":30,"size":7},"offset":{"x":0,"y":30,"z":0}},"font":{"length":[45],"width":[61,10],"angle":[-6,20],"position":[-60,-100],"texture":[63],"doubleside":true,"bump":{"position":30,"size":20},"offset":{"x":0,"y":-20,"z":5}}},'+
- '"typespec":{"name":"Turbo","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[150,150],"reload":[10,10]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":150,"speed":[140,140],"rotation":[40,40],"acceleration":[150,150],"dash":{"rate":1,"burst_speed":[200,200],"speed":[240,240],"acceleration":[90,90],"initial_energy":[10,10],"energy":[100,100]}}},"shape":[4.058,4.112,4.016,3.983,1.924,1.681,1.362,1.335,1.111,1.114,1.432,1.413,1.408,1.442,1.495,1.584,1.707,1.9,2.145,2.274,2.14,2.112,2.381,2.366,2.29,1.95,2.29,2.366,2.381,2.112,2.14,2.274,2.145,1.9,1.707,1.584,1.495,1.442,1.41,1.413,1.432,1.114,1.111,1.335,1.362,1.681,1.924,3.983,4.016,4.112],"lasers":[],"radius":4.112}}';
- var ShadowX1 = '{"name":"Shadow X-1","level":1,"model":2,"size":0.8,"zoom":0.8,"specs":{"shield":{"capacity":[130,130],"reload":[6,6]},"generator":{"capacity":[80,80],"reload":[16,16]},"ship":{"mass":70,"speed":[155,155],"rotation":[60,60],"acceleration":[150,150],"dash":{"rate":2,"burst_speed":[180,180],"speed":[170,170],"acceleration":[170,170],"initial_energy":[10,10],"energy":[5,5]}}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-100,-98,-95,-70,-40,0,40,70,80,90,100],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,10,20,30,40,20,20,40,40,40,20,0],"height":[0,4,4,20,20,10,10,15,15,15,10,10],"texture":[12,5,63,4,4,63,4,4,5]},"back":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[90,95,100,105,90],"z":[0,0,0,0,0]},"width":[10,15,18,19,2],"height":[3,5,7,8,2],"texture":[63],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-25,"z":15},"position":{"x":[0,0,0,0,0,0],"y":[-45,-40,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,13,0],"height":[0,10,15,5,0],"texture":[9]},"laser":{"section_segments":10,"offset":{"x":70,"y":10,"z":-20},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-20,-15,0,10,20,25,30,40,70,60],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,15,15,10,10,15,5,0],"height":[0,10,15,15,15,10,10,15,5,0],"texture":[3,4,10,3],"propeller":true}},"wings":{"top":{"offset":{"x":0,"y":50,"z":5},"length":[30],"width":[70,30],"angle":[90],"position":[0,50],"texture":[4],"bump":{"position":10,"size":15}},"side_joins":{"offset":{"x":0,"y":30,"z":-3},"length":[100],"width":[100,40],"angle":[0],"position":[-50,50],"texture":[4],"bump":{"position":10,"size":10}}},'+
- '"typespec":{"name":"Shadow X-1","level":3,"model":3,"code":303,"specs":{"shield":{"capacity":[130,130],"reload":[6,6]},"generator":{"capacity":[80,80],"reload":[16,16]},"ship":{"mass":70,"speed":[155,155],"rotation":[60,60],"acceleration":[150,150]}},"shape":[1.6,1.582,1.552,1.313,1.138,1.009,0.919,0.75,0.688,0.708,0.733,1.157,1.297,1.359,1.392,1.431,1.696,1.975,2.192,2.258,1.661,1.429,1.58,1.628,1.705,1.835,1.705,1.628,1.58,1.429,1.661,2.258,2.192,1.975,1.696,1.431,1.392,1.359,1.297,1.157,0.733,0.708,0.688,0.75,0.919,1.009,1.138,1.313,1.552,1.582],"lasers":[],"radius":2.258}}';
- var RADDiamondLancer = '{"name":"Lancer","level":1,"model":3,"size":2,"specs":{"shield":{"capacity":[110,110],"reload":[5,5]},"generator":{"capacity":[300,300],"reload":[10,10]},"ship":{"mass":120,"speed":[135,135],"rotation":[55,55],"acceleration":[180,180],"dash":{"rate":2,"burst_speed":[165,165],"speed":[165,165],"acceleration":[200,200],"initial_energy":[35,35],"energy":[17,17]}}},"bodies":{"main":{"section_segments":6,"offset":{"x":0,"y":-50,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-53,-50,-40,-20,10,40,80,84],"z":[0,0,0,0,0,0,0,0]},"width":[18,25,25,23,23,25,20,0],"height":[0,5,10,10,10,10,7,0],"texture":[1,1,1,1,1,8,3.9],"angle":0},"bumper":{"section_segments":6,"offset":{"x":-1,"y":-100,"z":0},"position":{"x":[1.5,1,0,-5,-5,0,0],"y":[0,10,15,25,27],"z":[0,0,0,0,0,0,0]},"width":[5,5,5,5,0],"height":[5,5,5,5,0],"texture":[3.9,16.9,3.9],"angle":90},"cockpitWindshield":{"section_segments":3,"offset":{"x":0,"y":-40,"z":10},"position":{"x":[-20,0,5,0,-20,0,0],"y":[-20,-10,0,10,20],"z":[-6,-2,0,-2,-6,0,0]},"width":[0,12,12,12,0],"height":[0,5,5,5,0],"texture":[8.6],"angle":90},"cockpitBack":{"section_segments":6,"offset":{"x":0,"y":10,"z":7},"position":{"x":[0,0,0,0,0,0,0],"y":[-50,-20,0,20,23],"z":[-2,0,0,0,0,0,0]},"width":[15,15,15,13,0],"height":[0,10,10,10,0],"texture":[4,10,17.9,3.9],"angle":0},"cockpitBackSides":{"section_segments":6,"offset":{"x":13,"y":0,"z":7},"position":{"x":[5,0,0,0,0,0,0],"y":[-20,-10,0,3],"z":[-3,0,0,0,0,0,0]},"width":[0,7,7,0],"height":[0,5,5,0],"texture":[4,17.5,4,3],"angle":0},"enginesTop":{"section_segments":6,"offset":{"x":12,"y":70,"z":7},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-60,-58,-55,-40,-30,-25,-20,-8,-30],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7,7,5,5,8,6,0],"height":[0,5,7,7,5,5,8,6,0],"texture":[3.9,3.9,10.4,63,2.9,2.9,3.9,16.9],"angle":0,"propeller":true},"enginesBottom":{"section_segments":6,"offset":{"x":18,"y":65,"z":-5},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-55,-54,-50,-40,-30,-25,-20,-8,-30],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7,7,5,5,8,6,0],"height":[0,5,7,7,5,5,8,6,0],"texture":[3.9,3.9,17.9,63,2.9,2.9,3.9,16.9],"angle":0,"propeller":true},"enginesConnect":{"section_segments":6,"offset":{"x":1,"y":36,"z":0},"position":{"x":[4,-12,0,0,0,0,0],"y":[-20,10],"z":[-5,8,0,0,0,0,0]},"width":[2,2],"height":[2,2],"texture":[1.9],"angle":90},"boostTank":{"section_segments":12,"offset":{"x":0,"y":-15,"z":0},"position":{"x":[-30,-30,-30,-30,-30,-30,-30,-30,-30,-30],"y":[-30,-30,-26,-20,-5,5,20,26,30,30],"z":[0,0,0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7.5,8,8,8,8,7.5,5,0],"height":[0,5,7.5,8,8,8,8,7.5,5,0],"texture":[63,63,63,13,4,13,63,63,63],"angle":0},"boostTankHolder":{"section_segments":6,"angle":90,"offset":{"x":0,"y":-15,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-44,-43,-39,-38,0],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,6,8,4,4],"height":[0,4,6,4,4],"texture":[4,63,4,4,4,4,4,63,4]},"boostPipeMain":{"section_segments":6,"offset":{"x":0,"y":-20,"z":11},"position":{"x":[-30,-30,-30,-30,-27,-15,-15,0,0],"y":[-20,-18,-15,30,35,45,48],"z":[-6,-2,0,0,0,0,0,0]},"width":[2,2,2,2,2,2,0],"height":[2,2,2,2,2,2,0],"texture":[63],"angle":0},"boostPipeSide":{"section_segments":6,"offset":{"x":0,"y":-20,"z":9},"position":{"x":[-34,-34,-34,-34,-36,-40,-42,-42,-42],"y":[-20,-18,-15,25,30,33,40,46],"z":[-6,-2,0,0,0,0,0,0]},"width":[2,2,2,2,2,2,2,0],"height":[2,2,2,2,2,2,2,0],"texture":[63],"angle":0},"boostTankEngineHolder":{"section_segments":6,"angle":90,"offset":{"x":0,"y":27,"z":3},"position":{"x":[0,0,0,0,10,0,0,0,0],"y":[-54,-53,-49,-48,0],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,6,8,3,3],"height":[0,4,6,3,3],"texture":[4,63,4,4,4,4,4,63,4]},"engineBoostTankOffset":{"section_segments":6,"offset":{"x":0,"y":70,"z":3},"position":{"x":[-42,-42,-42,-42,-42,-42,-42,-42,-42],"y":[-60,-58,-55,-40,-30,-25,-20,-8,-30],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7,7,5,5,8,6,0],"height":[0,5,7,7,5,5,8,6,0],"texture":[3.9,3.9,10.4,63,2.9,2.9,3.9,16.9],"angle":0,"propeller":true},"logo1":{"section_segments":4,"offset":{"x":0,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5],"z":[0,0,0,0,0,0,0]},"width":[0,3.2],"height":[0,0],"texture":[4,3,4,3],"angle":0},"logo2":{"section_segments":4,"offset":{"x":0.1,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5],"z":[0,0,0,0,0,0,0]},"width":[0,3.2],"height":[0,0],"texture":[4,3,4,3],"angle":120},"logo3":{"section_segments":4,"offset":{"x":0.1,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[5,15],"z":[0,-3,0,0,0,0,0]},"width":[3.2,0],"height":[0,0],"texture":[4],"angle":60},"logo4":{"section_segments":4,"offset":{"x":0,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[5,15],"z":[0,0,0,0,0,0,0]},"width":[3.2,0],"height":[0,0],"texture":[4],"angle":180},"logoDeco":{"section_segments":4,"offset":{"x":5,"y":-72,"z":9},"position":{"x":[0,0,3,5,8,13,14,15],"y":[-20,-10,2,5,8,14,20,26],"z":[-4,0,-1,-1,-1,-2,-3,-3,0]},"width":[3,3,3,3,3,3,2,0,0],"height":[2,2,2,2,2,1,0,0],"texture":[3.9],"angle":0}},"wings":{"cockpitTop":{"doubleside":false,"offset":{"x":0,"y":-30,"z":15},"length":[10,13],"width":[30,20,4],"angle":[-11,-42],"position":[0,0,11],"texture":[11.5,9],"bump":{"position":20,"size":3}},"cockpitTopBack":{"doubleside":false,"offset":{"x":0,"y":-17,"z":14.8},"length":[10,13],"width":[10,10,20],"angle":[-11,-42],"position":[0,0,10],"texture":[4],"bump":{"position":20,"size":3}},"wingsBackTop":{"doubleside":true,"offset":{"x":14,"y":37,"z":10},"length":[20],"width":[20,7],"angle":[20],"position":[0,20],"texture":[63],"bump":{"position":20,"size":5}},"wingsBackBottom":{"doubleside":true,"offset":{"x":20,"y":31,"z":-8},"length":[30],"width":[16,4],"angle":[-25],"position":[0,20],"texture":[63],"bump":{"position":20,"size":5}}},'+
- '"typespec":{"name":"RAD Diamond Lancer","level":1,"model":3,"code":103,"specs":{"shield":{"capacity":[110,110],"reload":[5,5]},"generator":{"capacity":[300,300],"reload":[10,10]},"ship":{"mass":125,"speed":[135,135],"rotation":[55,55],"acceleration":[180,180],"dash":{"rate":2,"burst_speed":[165,165],"speed":[165,165],"acceleration":[200,200],"initial_energy":[35,35],"energy":[17,17]}}},"shape":[4.233,4.229,4.139,2.578,1.863,1.514,1.3,1.152,1.053,0.983,0.922,0.87,0.839,0.823,0.825,0.846,1.051,1.188,1.318,2.839,2.589,2.753,2.465,2.574,2.524,1.813,2.524,2.574,2.465,2.936,3.117,2.997,2.542,2.481,2.443,2.066,1.892,1.532,1.532,1.786,1.874,1.9,1.876,2.081,2.256,2.28,2.132,2.578,4.139,4.229],"lasers":[],"radius":4.233}}';
- var ZerdBooster = '{"name":"Z Booster","level":1,"model":4,"size":1.4,"specs":{"shield":{"capacity":[150,150],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[13,13]},"ship":{"mass":140,"speed":[160,160],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[200,200],"speed":[160,160],"acceleration":[0,0],"initial_energy":[50,50],"energy":[0,0]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":-45,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-65,-60,-50,-20,20,30,55,75,60],"z":[-10,-10,-10,-5,0,0,0,0,0]},"width":[0,8,13,20,25,25,30,30,0],"height":[0,6,10,17,21,22,22,22,0],"texture":[4,63,10,1,10,1,9,17]},"main1":{"section_segments":12,"offset":{"x":0,"y":80,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-65,-60,-50,-25,-15,-5,0,15,5],"z":[0,0,0,0,0,0,0,0,0]},"width":[0,45,45,45,25,25,30,27,0],"height":[0,22,22,20,17,17,20,17,0],"propeller":true,"texture":[4,63,10,1,10,1,12,17]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-60,"z":20},"position":{"x":[0,0,0,0,0,0,0],"y":[-15,0,20,30,60],"z":[-5,-3,0,0,0]},"width":[0,10,13,13,5],"height":[0,10,13,13,5],"propeller":false,"texture":[7,9,9,4,4]},"cannon":{"section_segments":6,"offset":{"x":20,"y":-30,"z":10},"position":{"x":[-1,-1,0,0,0,0],"y":[-30,-40,-20,-5,5,15],"z":[-5,-5,-3,0,0,0]},"width":[0,5,8,11,9,0],"height":[0,5,8,11,10,0],"angle":0,"texture":[4,8,10,63,4]},"cannon1":{"section_segments":8,"offset":{"x":10,"y":30,"z":11},"position":{"x":[0,0,0,0,0,0],"y":[10,-20,-10,-5,5,15],"z":[0,0,0,0,0,0]},"width":[0,28,30,30,30,30],"height":[0,15,16,16,16,16],"angle":0,"texture":[6,8,63,63,4]},"cannon2":{"section_segments":8,"offset":{"x":37,"y":45,"z":20},"position":{"x":[0,0,0,4,4,4],"y":[-10,-20,-10,-5,15,10],"z":[0,0,0,0,0,0]},"width":[0,7,10,10,10,0],"height":[0,8,10,10,10,0],"propeller":true,"angle":0,"texture":[4,8,63,11,17]},"cannon3":{"section_segments":8,"offset":{"x":43,"y":45,"z":4},"position":{"x":[0,0,0,4,4,4],"y":[-10,-20,-10,-5,15,10],"z":[0,0,0,0,0,0]},"width":[0,7,10,10,10,0],"height":[0,8,10,10,10,0],"propeller":true,"angle":0,"texture":[4,8,63,11,17]},"cannon4":{"section_segments":6,"offset":{"x":15,"y":40,"z":29},"position":{"x":[0,0,0,0,0,0],"y":[-10,-20,-10,-5,5,20],"z":[2,2,2,0,0,-5]},"width":[0,5,5,5,5,0],"height":[0,4,4,5,5,0],"angle":180,"texture":[4,8,63,11,4],"propeller":false}},"wings":{"main":{"length":[10,20],"width":[30,20,10],"angle":[0,-50],"position":[0,0,10],"doubleside":true,"offset":{"x":20,"y":-40,"z":10},"bump":{"position":30,"size":20},"texture":[11,63]}},'+
- '"typespec":{"name":"Zerd Booster","level":1,"model":4,"code":104,"specs":{"shield":{"capacity":[150,150],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[13,13]},"ship":{"mass":140,"speed":[160,160],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[200,200],"speed":[160,160],"acceleration":[160,160],"initial_energy":[50,50],"energy":[0,0]}}},"shape":[3.08,2.968,2.358,2.066,1.708,1.619,1.572,1.55,1.483,0.805,0.781,0.771,0.783,0.81,0.852,1.176,1.625,1.973,2.187,2.317,2.18,1.989,2.577,2.765,2.708,2.665,2.708,2.765,2.577,1.989,2.18,2.317,2.187,1.973,1.625,1.176,0.852,0.81,0.784,0.771,0.781,0.805,1.483,1.55,1.572,1.619,1.708,2.066,2.358,2.968],"lasers":[],"radius":3.08}}';
- var LGViper = '{"name":"LG Viper","level":1,"model":5,"size":0.7,"specs":{"shield":{"capacity":[140,140],"reload":[5,5]},"generator":{"capacity":[150,150],"reload":[17,17]},"ship":{"mass":100,"speed":[150,150],"rotation":[60,60],"acceleration":[120,120],"dash":{"rate":2,"burst_speed":[205,205],"speed":[170,170],"acceleration":[150,150],"initial_energy":[40,40],"energy":[25,25]}}},"bodies":{"main":{"section_segments":8,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-110,-60,-99,-90,-70,0,50,70],"z":[0,0,0,0,0,0,0,5,1]},"width":[2,4,15,16,25,35,20,0],"height":[0,4,2,4,8,13,10,3],"texture":[5,17,5,1,1,1,1]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-15,"z":15},"position":{"x":[0,0,0,0,0,0],"y":[-55,-40,-25,0,5],"z":[0,0,0,0,9,9]},"width":[0,10,15,20,10],"height":[0,10,10,10,0],"texture":[9]},"cockpitDeco":{"section_segments":12,"offset":{"x":20,"y":8,"z":18},"position":{"x":[-4,0,0,-10],"y":[-75,-70,-20,0],"z":[0,0,0,-10]},"width":[1,2,4,2],"height":[1,1,2,2],"texture":[5],"angle":10},"cockpitDeco2":{"section_segments":12,"offset":{"x":0,"y":-11,"z":22},"position":{"x":[1.5,-3,-3,1.5],"y":[-16,-1,-1,16],"z":[0,0,0,0]},"width":[2,2,2,2],"height":[1,1,1,1],"texture":[5],"angle":90},"logo4":{"section_segments":4,"offset":{"x":0,"y":40,"z":20},"position":{"x":[0,0,0,0,0,0,0,0],"y":[120,10],"z":[-1.5,6]},"width":[1,1],"height":[1,1],"texture":[5],"angle":180},"engines1":{"section_segments":6,"offset":{"x":48,"y":34,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-20,0,2,-10],"z":[0,0,0,0,0,0,0,0]},"width":[7,7,5,0],"height":[0,2,1,0,10,0],"texture":[1,1,17],"angle":0,"propeller":true},"engines2":{"section_segments":6,"offset":{"x":60,"y":30,"z":-1},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-20,0,2,-10],"z":[0,0,0,0,0,0,0,0]},"width":[7,7,5,0],"height":[0,2,1,0,10,0],"texture":[1,1,17],"angle":0,"propeller":true},"engines3":{"section_segments":6,"offset":{"x":72,"y":25,"z":-4},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-20,0,2,-10],"z":[0,0,0,0,0,0,0,0]},"width":[7,7,5,0],"height":[0,2,1,0,10,0],"texture":[1,1,17],"angle":0,"propeller":true},"headlights":{"section_segments":8,"offset":{"x":50,"y":-50,"z":5},"position":{"x":[0,-1,0,1,1,0],"y":[-15,-20,-10,0,10,20,15,0],"z":[0,-3,0,0,0,-2,0,0,0]},"width":[0,9,10,8,7,5,5,0],"height":[0,6,4,2,0,0,0,0],"texture":[17,4,3,10,3],"propeller":false,"angle":-3},"turbine":{"section_segments":12,"offset":{"x":0,"y":30,"z":35},"position":{"x":[0,0,0,0,0,0,0],"y":[-20,-25,-20,0,20,30,40],"z":[0,0,0,0,0,-10,-20]},"width":[0,10,13,13,13,13,8],"height":[0,18,23,23,15,10,5],"angle":0,"texture":[17,5,1,1,1,1,1,1,1]},"turbineDeco":{"section_segments":10,"offset":{"x":13,"y":35,"z":43},"position":{"x":[0,0,0,0,0],"y":[0,1,10],"z":[0,0,0,0,0]},"width":[0,3,3],"height":[0,10,10],"texture":[5],"angle":-90},"turbineDeco2":{"section_segments":10,"offset":{"x":13,"y":20,"z":45},"position":{"x":[0,0,0,0,0],"y":[0,1,10],"z":[0,0,0,0,0]},"width":[0,3,3],"height":[0,10,10],"texture":[5],"angle":-90},"BackDeco":{"section_segments":10,"offset":{"x":32,"y":30,"z":10},"position":{"x":[0,0,0,0,0],"y":[-10,10,10],"z":[10,0,0,0,0]},"width":[0,15,15],"height":[0,5,5],"texture":[18],"angle":-90},"fukkenLongLine":{"section_segments":6,"offset":{"x":50,"y":-45,"z":7},"position":{"x":[-13,-5,0,0,0,0,0,-20,-30],"y":[-105,-80,-60,-40,-10,20,40,60,80],"z":[-5,-5,-5,-5,-10,-2.5,0,0,0,0]},"width":[1,1,1,1,1,1,1,4],"height":[1,1,1,1,1,1,1,1],"texture":[5],"angle":0}},"wings":{"outer":{"offset":{"x":35,"y":-115,"z":0},"length":[1,30,20],"width":[0,190,150,50],"angle":[0,-8,-8,-8],"position":[100,57,70,100],"texture":[1,1,10,10],"doubleside":true,"bump":{"position":30,"size":5}},"inner":{"offset":{"x":-36,"y":-90,"z":0},"length":[25],"width":[165,10],"angle":[8],"position":[20,100],"texture":[1,1],"doubleside":true,"bump":{"position":0,"size":5}}},'+
- '"typespec":{"name":"GLS Viper","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[140,140],"reload":[5,5]},"generator":{"capacity":[150,150],"reload":[17,17]},"ship":{"mass":90,"speed":[150,150],"rotation":[60,60],"acceleration":[120,120],"dash":{"rate":2,"burst_speed":[205,205],"speed":[170,170],"acceleration":[150,150],"initial_energy":[40,40],"energy":[25,25]}}},"shape":[1.54,1.402,2.2,2.087,1.96,1.792,1.606,1.482,1.398,1.34,1.286,1.234,1.206,1.205,1.196,1.148,1.032,0.93,0.857,0.743,0.685,0.698,0.777,0.887,0.986,0.982,0.986,0.887,0.777,0.698,0.685,0.743,0.857,0.93,1.032,1.148,1.196,1.205,1.206,1.234,1.286,1.34,1.398,1.482,1.606,1.792,1.96,2.087,2.2,1.402],"lasers":[],"radius":2.2}}';
- var VoidA = '{"name":"V1","level":1,"model":6,"size":1,"specs":{"shield":{"capacity":[130,130],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":100,"speed":[155,155],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[230,230],"speed":[160,160],"acceleration":[180,180],"initial_energy":[45,45],"energy":[35,35]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":-10,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-90,-75,-20,0,50,105,90],"z":[0,0,0,0,0,0,0]},"width":[0,15,25,25,25,25,0],"height":[0,10,20,20,20,20,0],"propeller":true,"texture":[63,2,2,10,4,17]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-30,"z":12},"position":{"x":[0,0,0,0,0,0,0],"y":[-50,-30,10,30,40],"z":[0,0,0,0,0]},"width":[0,10,15,15,5],"height":[0,18,25,25,5],"propeller":false,"texture":9},"deco":{"section_segments":8,"offset":{"x":23,"y":20,"z":10},"position":{"x":[5,5,10,10,10,10,10],"y":[-52,-50,-20,0,20,70,65],"z":[0,0,0,0,0,0,0]},"width":[0,10,15,15,15,15,0],"height":[0,10,10,10,10,10,0],"angle":0,"propeller":true,"texture":[4,3,4,10,4,17]},"cannons":{"section_segments":12,"offset":{"x":33,"y":40,"z":20},"position":{"x":[0,0,0,0,0,0,0],"y":[-30,-40,-20,0,20,40,42],"z":[0,-5,-1,0,0,0,0]},"width":[0,5,6,10,10,7.5,0],"height":[0,5,5,5,5,5,0],"angle":0,"propeller":false,"texture":[4,4,10,4,63,4]}},"wings":{"main":{"length":[80,40],"width":[80,50,30],"angle":[0,90],"position":[30,50,80],"doubleside":true,"bump":{"position":30,"size":10},"texture":[11,63],"offset":{"x":-10,"y":0,"z":0}}},'+
- '"typespec":{"name":"Void","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[130,130],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":100,"speed":[155,155],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[230,230],"speed":[160,160],"acceleration":[180,180],"initial_energy":[45,45],"energy":[35,35]}}},"shape":[2,1.884,1.664,1.257,1.029,0.881,0.906,0.968,0.954,0.925,0.913,0.928,0.958,0.967,0.991,1.513,1.638,1.818,2.034,2.241,2.36,2.04,1.989,1.965,1.934,1.904,1.934,1.965,1.989,2.04,2.36,2.241,2.034,1.818,1.638,1.513,0.991,0.967,0.96,0.928,0.913,0.925,0.954,0.968,0.906,0.881,1.029,1.257,1.664,1.884],"lasers":[],"radius":2.36}}';
- var Starsurfer = '{"name":"Starsurfer","level":1,"model":7,"size":1.3,"specs":{"shield":{"capacity":[230,230],"reload":[7,7]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":130,"speed":[140,140],"rotation":[40,40],"acceleration":[210,210],"dash":{"rate":2,"burst_speed":[200,20],"speed":[165,165],"acceleration":[230,230],"initial_energy":[45,45],"energy":[27,27]}}},"bodies":{"mainBody":{"section_segments":6,"offset":{"x":20,"y":20,"z":5},"position":{"x":[-20,-20,-5,0,0,0,0,0,-10,-10],"y":[-145,-140,-120,-90,-30,-20,-15,15,40,40],"z":[-5,-5,-5,-5,-5,0,0,0,0,0,0]},"width":[0,20,20,20,20,15,15,15,15,0],"height":[0,10,10,10,10,10,10,10,15,0],"texture":[4]},"engineBottom":{"section_segments":6,"offset":{"x":0,"y":50,"z":-3},"position":{"x":[0,0,0,0,0,0],"y":[-20,-15,15,20,15],"z":[0,0,0,0,0,0]},"width":[0,28,28,26,0],"height":[0,9,9,6,0],"texture":[3,3,2,17],"propeller":true},"engineTop":{"section_segments":6,"offset":{"x":0,"y":50,"z":13},"position":{"x":[0,0,0,0,0,0],"y":[-20,-15,15,20,15],"z":[0,0,0,0,0,0]},"width":[0,24,24,22,0],"height":[0,9,9,6,0],"texture":[3,3,2,17],"propeller":true},"reactor":{"section_segments":8,"offset":{"x":0,"y":8,"z":12},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-25,-20,-10,0,10,20,25,35],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,15,15,15,15,15,15,5,0],"height":[0,15,15,15,15,15,15,5,0],"texture":[1,1,17,1,17,1,1]},"bottom":{"section_segments":6,"offset":{"x":0,"y":20,"z":-3},"position":{"x":[0,0,0,0,0,0],"y":[-141,-125,15,20],"z":[-5,0,0,0,0,0]},"width":[0,15,15,0],"height":[0,10,10,0],"texture":[2]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-5,"z":12},"position":{"x":[0,0,0,0,0,0],"y":[-95,-62,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,15,0],"height":[0,8,15,13,0],"texture":[9]},"cockpit2":{"section_segments":8,"offset":{"x":0,"y":-5,"z":10},"position":{"x":[0,0,0,0,0,0],"y":[-115,-100,-55,-25,20],"z":[0,0,0,0,0,0]},"width":[0,12,15,20,16],"height":[0,4,12,4,0],"texture":[13,18,8,1]},"backStructural":{"section_segments":6,"offset":{"x":32,"y":15,"z":0},"position":{"x":[0,5,5,0,0,0],"y":[-20,-15,40,50],"z":[0,0,0,0,0,0]},"width":[3,3,3,3],"height":[3,3,3,3],"texture":[1]},"backStructura2":{"section_segments":6,"offset":{"x":32,"y":65,"z":0},"position":{"x":[0,0,0,0,0],"y":[-20,0,3],"z":[-3,0,0,0,0,0]},"width":[3,3,0],"height":[3,3,0],"angle":90,"texture":[1]}},"wings":{"defense1":{"doubleside":true,"offset":{"x":37,"y":35,"z":0},"length":[-9,-4,-20],"width":[5,5,20,20],"angle":[280,315,330],"position":[0,0,0,0],"texture":[3,18],"bump":{"position":0,"size":-10}},"defense2":{"doubleside":true,"offset":{"x":37,"y":10,"z":0},"length":[-9,-4,-20],"width":[5,5,20,20],"angle":[280,315,330],"position":[0,0,0,0],"texture":[3,18],"bump":{"position":0,"size":-10}}},'+
- '"typespec":{"name":"Starsurfer","level":1,"model":8,"code":108,"specs":{"shield":{"capacity":[230,230],"reload":[7,7]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":130,"speed":[140,140],"rotation":[40,40],"acceleration":[210,210],"dash":{"rate":2,"burst_speed":[200,200],"speed":[165,165],"acceleration":[230,230],"initial_energy":[45,45],"energy":[27,27]}}},"shape":[4,3.936,3.714,3.346,2.711,2.223,1.866,1.629,1.47,1.358,1.278,1.226,1.266,1.277,1.306,1.36,1.441,1.563,1.731,1.988,2.241,2.393,2.391,2.353,2.28,2.244,2.28,2.353,2.391,2.393,2.241,1.988,1.731,1.563,1.441,1.36,1.306,1.277,1.267,1.226,1.278,1.358,1.47,1.629,1.866,2.223,2.711,3.346,3.714,3.936],"lasers":[],"radius":4}}';
- var ZerdTurbine = '{"name":"Z Tri-turbine","level":1,"model":8,"size":1.3,"specs":{"shield":{"capacity":[200,200],"reload":[3,3]},"generator":{"capacity":[60,60],"reload":[15,15]},"ship":{"mass":140,"speed":[135,135],"rotation":[80,80],"acceleration":[200,200],"dash":{"rate":1,"burst_speed":[205,205],"speed":[170,170],"acceleration":[250,250],"initial_energy":[30,30],"energy":[25,25]}}},"bodies":{"main1":{"section_segments":12,"offset":{"x":57,"y":-55,"z":-11},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-55,-33,-40,0,10,40,48,66,77,67],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,6,15,20,14,14,20,20,15,0],"height":[0,6,15,20,14,14,20,20,15,0],"propeller":true,"texture":[4,18,10,63,8,63,11,12,17]},"main2":{"section_segments":12,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-55,-60,-50,-20,10,15,45,75,60],"z":[-7,-7,-5,0,0,0,0,0,0]},"width":[0,8,15,25,25,20,20,14,0],"height":[0,6,10,15,18,18,18,14,0],"propeller":true,"texture":[12,63,10,1,5,8,12,17]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-48,"z":22},"position":{"x":[0,0,0,0,0,0],"y":[-5,10,30,60],"z":[-20,-8,0,0]},"width":[5,8,12,5],"height":[4,10,10,5],"propeller":false,"texture":[7,9,4,4]},"cannons":{"section_segments":6,"offset":{"x":20,"y":30,"z":15},"position":{"x":[0,0,0,0,0,0],"y":[-60,-70,-30,0,25,30],"z":[0,0,0,0,0,0]},"width":[0,5,6,11,7,0],"height":[0,5,6,11,7,0],"angle":180,"texture":[3,8,10,63]},"cannons2":{"section_segments":6,"offset":{"x":27,"y":0,"z":-5},"position":{"x":[0,0,0,0,0,0],"y":[-70,-80,-35,0,25,30],"z":[0,0,0,0,0,0]},"width":[0,5,6,11,7,0],"height":[0,5,6,11,7,0],"angle":180,"texture":[3,8,10,63]}},"wings":{"main1":{"length":[20,20],"width":[50,30,15],"angle":[-10,-15],"position":[0,-20,-11],"doubleside":true,"offset":{"x":20,"y":-12,"z":5},"bump":{"position":35,"size":15},"texture":[11,63]},"main2":{"length":[30],"width":[33,15],"angle":[-20],"position":[0,20],"doubleside":true,"offset":{"x":65,"y":-33,"z":-9},"bump":{"position":30,"size":15},"texture":[8]}},'+
- '"typespec":{"name":"Fly","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[200,200],"reload":[3,3]},"generator":{"capacity":[60,60],"reload":[15,15]},"ship":{"mass":160,"speed":[135,135],"rotation":[80,80],"acceleration":[200,200],"dash":{"rate":1,"burst_speed":[205,205],"speed":[170,170],"acceleration":[250,250],"initial_energy":[30,30],"energy":[25,25]}}},"shape":[1.262,1.271,1.199,2.205,2.602,2.503,2.397,2.159,1.995,1.844,1.96,2.004,1.972,1.629,1.633,1.592,1.254,0.868,0.939,1.055,1.243,1.555,1.804,2.161,2.138,1.578,2.138,2.161,1.804,1.555,1.243,1.055,0.939,0.868,1.254,1.592,1.633,1.629,1.972,2.004,1.96,1.844,1.995,2.159,2.397,2.503,2.602,2.205,1.199,1.271],"lasers":[],"radius":2.602}}';
- var Arrowhead = '{"name":"Arrowhead","level":1,"model":9,"size":1,"scale":0.65,"specs":{"shield":{"capacity":[120,120],"reload":[7,7]},"generator":{"capacity":[140,140],"reload":[25,25]},"ship":{"mass":70,"speed":[165,165],"rotation":[30,30],"acceleration":[250,250]}},"bodies":{"main":{"section_segments":11,"offset":{"x":0,"y":-50,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[0,6,12,48,77,110,137,141],"z":[0,0,0,0,0,0,0,0]},"width":[0,15,15,15,15,15,23,0],"height":[0,1,1,15,15,14,23,0],"texture":[9,3,2,8,3,2,3]},"engines":{"section_segments":12,"offset":{"x":0,"y":-15,"z":0},"position":{"x":[0,0,0,0,0,0],"y":[40,74,98,113,100,150],"z":[10,0,0,0,0,0,0]},"width":[0,10,14,20,0],"height":[0,11,14,20,0],"texture":[3,3,3,17],"propeller":true},"engineSpike":{"section_segments":12,"offset":{"x":0,"y":105,"z":0},"position":{"x":[0,0,0,0,0,0],"y":[-20,40,0],"z":[0,0,0]},"width":[15,8,0],"height":[15,8,0],"texture":[17],"propeller":true},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-75,"z":5},"position":{"x":[0,0,0,0,0],"y":[0,40,66,84,89],"z":[-8,-2,-1,1,20]},"width":[0,15,15,10,10],"height":[0,15,15,10],"texture":[9],"propeller":false}},"wings":{"bottom":{"offset":{"x":3,"y":-115,"z":0},"length":[0,2,12,2,4,38],"width":[165,235,390,232,167,122,35],"angle":[25,0,0,0,0,0],"position":[20,54,54,47,79,100,101],"texture":[8,1,4,2,2,4],"doubleside":true,"bump":{"position":30,"size":4}},"top":{"offset":{"x":0,"y":-125,"z":0},"length":[60],"width":[250,0],"angle":[10],"position":[0,60],"texture":[63,63],"doubleside":true,"bump":{"position":100,"size":4}},"deco1":{"offset":{"x":7,"y":10,"z":8},"length":[40,5],"width":[50,0,0],"angle":[6,7],"position":[40,-30],"texture":[19],"doubleside":false,"bump":{"position":100,"size":4}},"cockpitFront":{"offset":{"x":0,"y":-57,"z":-2},"length":[10,20],"width":[30,30,30],"angle":[-10,-10,0,0,0,0],"position":[-2,10,30],"texture":[4],"doubleside":true,"bump":{"position":30,"size":50}}},'+
- '"typespec":{"name":"Arrow Head","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[120,120],"reload":[7,7]},"generator":{"capacity":[140,140],"reload":[25,25]},"ship":{"mass":75,"speed":[160,160],"rotation":[30,30],"acceleration":[250,250]}},"shape":[5.992,4.865,3.71,3.018,2.597,2.317,2.102,1.725,1.595,1.606,1.535,1.472,1.439,1.43,1.358,1.256,1.191,1.146,1.123,1.131,1.161,1.286,1.49,2.34,3.245,3.398,3.245,2.34,1.49,1.286,1.161,1.131,1.123,1.146,1.191,1.256,1.358,1.43,1.439,1.472,1.535,1.606,1.595,1.725,2.102,2.317,2.597,3.018,3.71,4.865],"lasers":[],"radius":5.992}}';
- var SweptWingedRacecraft = '{"name":"Swept-Winged Racecraft","level":1,"model":10,"size":1,"specs":{"shield":{"capacity":[150,150],"reload":[6,6]},"generator":{"capacity":[120,120],"reload":[20,20]},"ship":{"mass":140,"speed":[140,140],"rotation":[45,45],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[255,255],"speed":[185,185],"acceleration":[180,180],"initial_energy":[55,55],"energy":[37,37]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-130,-115,-90,0,50,105,90],"z":[0,0,0,0,0,0,0]},"width":[0,15,25,30,35,20,0],"height":[0,10,15,25,25,20,0],"propeller":true,"texture":[63,3,2,1,4,12]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-20,"z":20},"position":{"x":[0,0,0,0,0,0,0],"y":[-90,-10,40,70,80],"z":[0,0,0,0,0]},"width":[0,10,15,10,5],"height":[0,18,25,18,5],"propeller":false,"texture":[4,9,4,4]},"cannon":{"section_segments":6,"offset":{"x":0,"y":-100,"z":10},"position":{"x":[0,0,0,0,0,0],"y":[-70,-50,-20,0,20,50],"z":[0,0,0,0,0,0]},"width":[0,5,10,10,15,0],"height":[0,5,10,10,15,0],"angle":0,"texture":[63]},"deco":{"section_segments":8,"offset":{"x":30,"y":50,"z":-5},"position":{"x":[0,0,5,5,0,0,0],"y":[-52,-50,-20,0,20,40,30],"z":[10,10,10,0,0,0,0]},"width":[0,5,10,10,15,15,0],"height":[0,5,10,15,10,15,0],"angle":0,"texture":[4],"propeller":true},"deco2":{"section_segments":8,"offset":{"x":30,"y":50,"z":20},"position":{"x":[0,0,5,5,0,0,0],"y":[-52,-50,-20,0,20,40,30],"z":[-10,-10,-10,0,0,0,0]},"width":[0,5,10,10,15,15,0],"height":[0,5,10,15,10,15,0],"angle":0,"texture":[4],"propeller":true}},"wings":{"main":{"length":[30,20],"width":[120,50,40],"angle":[-10,20],"position":[100,-50,30],"doubleside":true,"bump":{"position":30,"size":10},"texture":[11,63],"offset":{"x":0,"y":-60,"z":0}},"main2":{"length":[30,20],"width":[120,50,40],"angle":[10,-20],"position":[100,-50,30],"doubleside":true,"bump":{"position":30,"size":10},"texture":[11,63],"offset":{"x":0,"y":-60,"z":0}},"winglets":{"length":[40],"width":[40,20,30],"angle":[10,-10],"position":[-40,-60,-55],"bump":{"position":0,"size":30},"texture":63,"offset":{"x":0,"y":0,"z":-5}},"stab":{"length":[80,10],"width":[60,40,50],"angle":[0,30],"position":[50,75,90],"doubleside":true,"texture":[63,4],"bump":{"position":0,"size":20},"offset":{"x":0,"y":-20,"z":10}}},'+
- '"typespec":{"name":"Swept-Winged Racecraft","level":3,"model":1,"code":301,"specs":{"shield":{"capacity":[150,150],"reload":[6,6]},"generator":{"capacity":[120,120],"reload":[20,20]},"ship":{"mass":120,"speed":[140,140],"rotation":[45,45],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[255,255],"speed":[185,185],"acceleration":[180,180],"initial_energy":[55,55],"energy":[37,37]}}},"shape":[3.4,2.507,2.764,2.285,1.895,1.634,1.462,1.324,1.191,1.102,1.037,0.998,0.699,0.736,0.788,0.866,2.021,2.187,2.429,2.599,1.838,2.012,1.989,2.128,2.138,2.104,2.138,2.128,1.989,2.012,1.838,2.599,2.429,2.187,2.021,0.866,0.788,0.736,0.7,0.998,1.037,1.102,1.191,1.324,1.462,1.634,1.895,2.285,2.764,2.507],"lasers":[],"radius":3.4}}';
- var ShadowX2 = '{"name":"Shadow X-2","level":1,"model":11,"size":1.1,"specs":{"shield":{"capacity":[150,220],"reload":[5,7]},"generator":{"capacity":[80,145],"reload":[19,29]},"ship":{"mass":125,"speed":[110,140],"rotation":[35,48],"acceleration":[140,160]}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-100,-98,-95,-70,-40,0,40,70,80,90,100],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,5,10,20,30,20,20,30,30,30,20,0],"height":[0,4,4,20,20,10,10,15,15,15,10,10],"texture":[12,5,63,4,4,3,4,4,5]},"back":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[90,95,100,105,90],"z":[0,0,0,0,0]},"width":[10,15,18,19,2],"height":[3,5,7,8,2],"texture":[63],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-25,"z":12},"position":{"x":[0,0,0,0,0,0],"y":[-45,-40,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,5,0],"height":[0,10,15,5,0],"texture":[9]},"laser":{"section_segments":10,"offset":{"x":50,"y":10,"z":-13},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-30,-25,0,10,20,25,30,40,70,60],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,15,15,10,10,15,10,0],"height":[0,10,15,15,15,10,10,15,5,0],"texture":[6,4,10,3,4,3,2],"propeller":true}},"wings":{"top":{"doubleside":true,"offset":{"x":10,"y":60,"z":5},"length":[30],"width":[50,30],"angle":[60],"position":[0,50],"texture":[3],"bump":{"position":10,"size":10}},"side":{"doubleside":true,"offset":{"x":10,"y":70,"z":5},"length":[30],"width":[40,20],"angle":[-13],"position":[0,60],"texture":[63],"bump":{"position":10,"size":10}},"wings":{"offset":{"x":0,"y":35,"z":0},"length":[80],"width":[100,70],"angle":[0],"position":[-80,50],"texture":[4],"bump":{"position":10,"size":15}}},'+
- '"typespec":{"name":"Shadow X-2","level":1,"model":12,"code":112,"specs":{"shield":{"capacity":[220,220],"reload":[7,7]},"generator":{"capacity":[145,145],"reload":[29,29]},"ship":{"mass":125,"speed":[140,140],"rotation":[48,48],"acceleration":[160,160]}},"shape":[2.2,2.141,1.787,1.481,1.272,1.135,1.076,1.035,1.016,1.188,1.343,1.35,1.371,1.416,1.46,1.564,1.887,2.17,2.405,2.753,3.16,2.084,2.79,3.199,2.656,2.315,2.656,3.199,2.79,2.084,3.16,2.753,2.405,2.17,1.887,1.564,1.46,1.416,1.372,1.35,1.343,1.188,1.016,1.035,1.076,1.135,1.272,1.481,1.787,2.141],"lasers":[],"radius":3.199}}';
- var ShadowX2MKII = '{"name":"Shadow X-2 MKII","level":1,"model":12,"size":1.1,"specs":{"shield":{"capacity":[150,240],"reload":[5,7]},"generator":{"capacity":[80,145],"reload":[20,60]},"ship":{"mass":145,"speed":[110,150],"rotation":[40,65],"acceleration":[140,160]}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-125,-113,-110,-72,-40,0,40,70,80,90,100],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,2,6,20,30,35,20,30,30,30,20,0],"height":[0,2,6,20,20,10,10,15,15,15,10,10],"texture":[1,5,63,4,4,3,4,4,5]},"back":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[90,95,100,105,90],"z":[0,0,0,0,0]},"width":[10,15,18,19,2],"height":[3,5,7,8,2],"texture":[63],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-25,"z":12},"position":{"x":[0,0,0,0,0,0],"y":[-45,-40,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,5,0],"height":[0,10,15,5,0],"texture":[9]},"cannons":{"section_segments":4,"offset":{"x":60,"y":-20,"z":5},"position":{"x":[0,0,0,0,0,0,0],"y":[-20,0,40,60,80],"z":[0,0,0,0,0]},"width":[0,4,8,14,6],"height":[0,2,6,12,0],"texture":[17,4]},"engines":{"section_segments":10,"offset":{"x":50,"y":10,"z":-15},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-30,-25,0,10,20,25,30,40,70,60],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,15,15,10,10,15,10,0],"height":[0,10,15,15,15,10,10,15,5,0],"texture":[6,4,10,3,4,3,2],"propeller":true}},"wings":{"top":{"doubleside":true,"offset":{"x":10,"y":55,"z":5},"length":[30],"width":[50,30],"angle":[40],"position":[0,50],"texture":[1],"bump":{"position":10,"size":10}},"side":{"doubleside":true,"offset":{"x":10,"y":70,"z":5},"length":[30],"width":[40,20],"angle":[-13],"position":[0,60],"texture":[63],"bump":{"position":10,"size":10}},"wings":{"doubleside":true,"offset":{"x":0,"y":45,"z":0},"length":[80,30],"width":[120,70,40],"angle":[0,0],"position":[-70,50,-10],"texture":[4],"bump":{"position":15,"size":15}},"lower":{"doubleside":true,"offset":{"x":15,"y":0,"z":-5},"length":[60],"width":[140,40],"angle":[0],"position":[-70,60],"texture":[1],"bump":{"position":10,"size":8}}},'+
- '"typespec":{"name":"Shadow X-2 MKII","level":1,"model":11,"code":111,"specs":{"shield":{"capacity":[240,240],"reload":[7,7]},"generator":{"capacity":[145,145],"reload":[20,20]},"ship":{"mass":145,"speed":[150,150],"rotation":[70,70],"acceleration":[180,180]}},"shape":[2.75,3.098,2.614,2.158,1.84,1.644,1.501,1.405,1.586,1.538,1.49,1.461,1.451,1.482,2.498,2.602,2.714,2.778,2.891,3.07,3.316,3.358,2.79,3.199,2.419,2.315,2.419,3.199,2.79,3.358,3.316,3.07,2.891,2.778,2.714,2.602,2.498,1.482,1.452,1.461,1.49,1.538,1.586,1.405,1.501,1.644,1.84,2.158,2.614,3.098],"lasers":[],"radius":3.358}}';
- var Thunderstorm = '{"name":"Thunderstorm","level":1,"model":13,"size":1,"specs":{"shield":{"capacity":[200,200],"reload":[15,15]},"generator":{"capacity":[30,30],"reload":[20,20]},"ship":{"mass":160,"speed":[155,155],"rotation":[40,40],"acceleration":[120,120],"dash":{"rate":2,"burst_speed":[230,230],"speed":[170,170],"acceleration":[250,250],"initial_energy":[15,15],"energy":[30,30]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-80,-65,-40,0,50,105,100],"z":[3,5,2,0,0,0,0]},"width":[6,10,15,30,30,2,0],"height":[0,5,15,24,30,18,0],"propeller":false,"texture":[4,63]},"cockpit":{"section_segments":9,"offset":{"x":0,"y":-10,"z":20},"position":{"x":[0,0,0,0,0,0,0,0,0],"y":[-30,-10,10,30,50,60,90,129,130],"z":[0,0,0,0,0,10,13,12,12]},"width":[0,10,15,15,10,30,10,5,0],"height":[0,15,20,20,18,10,5,3,0],"propeller":false,"texture":[9,9,9,9,63]},"side_propulsors":{"section_segments":10,"offset":{"x":15,"y":35,"z":16},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-20,-15,0,10,20,25,30,40,80,70],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,15,20,20,20,15,15,14,7,0],"height":[0,15,20,20,20,15,15,20,8,0],"propeller":true,"texture":[63,63,63,63,63,17,4,13,17]},"deco":{"section_segments":8,"offset":{"x":-17,"y":-5,"z":13},"position":{"x":[0,0,70],"y":[-48,-50,20],"z":[0,0,13]},"width":[0,40,25,25],"height":[0,7,10,10],"angle":-59,"texture":[5,4]},"frontDeco":{"section_segments":9,"offset":{"x":18,"y":-50,"z":16},"position":{"x":[-5,0,0,0],"y":[-95,-50,40,50],"z":[-15,-10,0,0]},"width":[1,8,16,2],"height":[2,5,5,2],"angle":0,"propeller":false,"texture":[4,63]},"fukkenLongLine":{"section_segments":6,"offset":{"x":11,"y":60,"z":34},"position":{"x":[-11,-3,1,1,-2,-10],"y":[-90,-80,-60,-55,-35,-23],"z":[-5,-5,-1,0,1,5]},"width":[1.5,1.5,1.5,1.5,1.5,1.5],"height":[1,1,1,1,1,1],"texture":[5],"angle":0}},"wings":{"main":{"length":[35,30,25],"width":[100,100,40,20],"angle":[30,10,20],"position":[-30,50,90,60],"doubleside":true,"bump":{"position":30,"size":10},"texture":[63,4,63],"offset":{"x":5,"y":30,"z":15}},"stab":{"length":[40,15],"width":[60,30,20],"angle":[10,-10],"position":[30,75,80],"doubleside":true,"texture":[4,63],"bump":{"position":0,"size":10},"offset":{"x":10,"y":-55,"z":0}}},'+
- '"typespec":{"name":"Thunderstorm","level":1,"model":13,"code":113,"specs":{"shield":{"capacity":[200,200],"reload":[15,15]},"generator":{"capacity":[40,40],"reload":[10,10]},"ship":{"mass":130,"speed":[155,155],"rotation":[40,40],"acceleration":[120,120],"dash":{"rate":2,"burst_speed":[230,230],"speed":[170,170],"acceleration":[250,250],"initial_energy":[15,15],"energy":[30,30]}}},"shape":[1.603,2.913,2.339,1.763,1.359,1.133,0.97,0.875,0.803,0.786,0.811,0.854,0.917,1.04,1.325,1.38,1.462,1.451,2.422,2.696,2.847,3.07,3.086,2.788,2.34,2.4,2.34,2.788,3.086,3.07,2.847,2.696,2.422,1.451,1.462,1.38,1.325,1.04,0.917,0.854,0.811,0.786,0.803,0.875,0.97,1.133,1.359,1.763,2.339,2.913],"lasers":[],"radius":3.086}}';
- var Amalgam = '{"name":"Amalgam","level":1,"model":14,"size":1,"specs":{"shield":{"capacity":[300,300],"reload":[12,12]},"generator":{"capacity":[200,200],"reload":[10,10]},"ship":{"mass":160,"speed":[140,140],"rotation":[60,60],"acceleration":[140,140],"dash":{"rate":3,"burst_speed":[240,240],"speed":[140,140],"acceleration":[140,140],"initial_energy":[40,40],"energy":[0,0]}}},"bodies":{"main":{"section_segments":8,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0],"y":[-100,-120,-100,-60,0,90,140,140],"z":[0,0,0,0,0,0,0,0]},"width":[0,15,30,40,40,30,5,0],"height":[1,15,30,45,45,30,5,0],"texture":[17,1,2,3,4,18,17],"propeller":true},"engines":{"section_segments":12,"offset":{"x":-30,"y":20,"z":15},"position":{"x":[25,-2,-4,-2,0,0],"y":[0,40,74,98,108,105],"z":[18,10,0,0,0,0]},"width":[9,10,9,14,11,0],"height":[2,10,9,14,11,0],"texture":[3,3,3,3,17],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-60,"z":35},"position":{"x":[0,0,0,0,0,0,0],"y":[-40,-20,0,30,35],"z":[0,0,0,0,0]},"width":[0,13,12,10,5],"height":[0,15,13,12,5],"texture":[9,9,8,9],"propeller":false},"motor":{"section_segments":8,"offset":{"x":20,"y":-90,"z":30},"position":{"x":[0,0,0,0,0],"y":[90,80,90,111,95],"z":[0,0,0,0,0]},"width":[0,0,10,5,0],"height":[0,0,15,0,0],"texture":[17,17,17,17]},"motor2":{"section_segments":8,"offset":{"x":0,"y":-50,"z":35},"position":{"x":[0,0,0,0,0],"y":[90,80,90,111,95],"z":[0,0,0,0,0]},"width":[0,0,10,5,0],"height":[0,0,15,0,0],"texture":[17,17,17,17]},"bumpers":{"section_segments":8,"offset":{"x":40,"y":80,"z":0},"position":{"x":[0,0,0,0,0,0,0],"y":[-80,-50,-20,0,20,50,55],"z":[0,0,0,0,0,0,0]},"width":[0,10,15,15,15,5,0],"height":[0,10,10,15,15,10,0],"texture":[17,7,7,17,7],"angle":-130},"bumpers2":{"section_segments":8,"offset":{"x":40,"y":30,"z":0},"position":{"x":[0,0,0,0,0,0,0],"y":[-80,-50,-20,0,20,50,55],"z":[0,0,0,0,0,0,0]},"width":[0,10,15,15,15,5,0],"height":[0,10,10,15,15,10,0],"texture":[17,7,7,17,7],"angle":-130},"bumpers3":{"section_segments":8,"offset":{"x":40,"y":-20,"z":0},"position":{"x":[0,0,0,0,0,0,0],"y":[-80,-50,-20,0,20,50,55],"z":[0,0,0,0,0,0,0]},"width":[0,10,15,15,15,5,0],"height":[0,10,10,15,15,10,0],"texture":[17,7,7,17,7],"angle":-130},"arms":{"section_segments":8,"offset":{"x":40,"y":0,"z":-24},"position":{"x":[0,0,0,5,10,0,0,-10],"y":[-85,-70,-80,-30,0,30,100,90],"z":[0,0,0,0,0,0,0,0]},"width":[1,5,6,15,15,15,10,0],"height":[1,5,6,20,30,25,10,0],"texture":[6,4,18,18,18,18,12],"angle":1,"propeller":true},"canon":{"section_segments":12,"offset":{"x":30,"y":-40,"z":30},"position":{"x":[0,0,0,0,0,0,0],"y":[-50,-45,-20,0,20,30,40],"z":[0,0,0,0,0,0,0]},"width":[0,5,7,7,3,5,0],"height":[0,5,15,15,3,5,0],"angle":3,"propeller":false,"texture":[6,4,10,4,4,4]}},"wings":{"main":{"offset":{"x":40,"y":-15,"z":-10},"length":[60,40],"width":[50,30,20],"angle":[-20,10],"position":[30,50,80],"texture":[4,18],"bump":{"position":50,"size":10}},"font":{"length":[60],"width":[20,15],"angle":[-10,20],"position":[-20,-40],"texture":[7],"bump":{"position":30,"size":10},"offset":{"x":20,"y":0,"z":-20}},"font2":{"offset":{"x":20,"y":40,"z":-20},"length":[60],"width":[20,15],"angle":[-10,20],"position":[20,40],"texture":[7],"bump":{"position":30,"size":10}}},'+
- '"typespec":{"name":"Amalgam","level":1,"model":14,"code":114,"specs":{"shield":{"capacity":[300,300],"reload":[12,12]},"generator":{"capacity":[200,200],"reload":[10,10]},"ship":{"mass":160,"speed":[140,140],"rotation":[60,60],"acceleration":[140,140],"dash":{"rate":3,"burst_speed":[240,240],"speed":[140,140],"acceleration":[140,140],"initial_energy":[40,40],"energy":[0,0]}}},"shape":[2.405,2.419,2.272,2.011,1.863,1.735,1.578,1.468,1.845,1.805,1.367,1.469,1.616,1.791,2.145,2.86,3.098,3.1,2.599,2.357,3.318,2.885,2.675,2.688,2.665,2.802,2.665,2.688,2.675,2.885,3.318,2.357,2.599,3.1,3.098,2.86,2.145,1.791,1.616,1.469,1.367,1.805,1.845,1.468,1.578,1.735,1.863,2.011,2.272,2.419],"lasers":[],"radius":3.318}}';
- var PrototypeT = '{"name":"Prototype-T","level":1,"model":15,"size":1,"specs":{"shield":{"capacity":[350,350],"reload":[20,20]},"generator":{"capacity":[300,300],"reload":[20,20]},"ship":{"mass":130,"speed":[150,150],"rotation":[50,50],"acceleration":[170,170],"dash":{"rate":2,"burst_speed":[250,250],"speed":[175,175],"acceleration":[200,200],"initial_energy":[85,85],"energy":[40,40]}}},"bodies":{"front":{"section_segments":8,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[-150,-105,-25,0,25],"z":[-5,0,0,0,0]},"width":[7,17,17,17,20],"height":[0,20,30,20,5],"texture":[63,11,2,63]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0],"y":[-70,-70,-25,0,100],"z":[0,0,0,0,9]},"width":[0,10,15,15,10],"height":[0,15,25,20,0],"texture":[9,9,9,4]},"side":{"section_segments":8,"offset":{"x":40,"y":90,"z":10},"position":{"x":[-30,-10,-5,0],"y":[-200,-50,0,20],"z":[-5,0,0,0]},"width":[0,10,10,0],"height":[0,10,10,0],"texture":[4,63,3]},"bigpropel":{"section_segments":8,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[10,20,30,100,95],"z":[0,0,0,0,0]},"width":[10,20,20,20,0],"height":[10,20,40,30,0],"texture":[63,63,10,4],"propeller":true},"propulsors":{"section_segments":8,"offset":{"x":15,"y":50,"z":10},"position":{"x":[0,0,0,0,0,5,10,10,10,10],"y":[-160,-130,-110,10,20,25,30,40,50,40],"z":[-5,-5,-5,-5,0,0,0,0,0,0]},"width":[0,10,15,15,10,10,10,10,10,0],"height":[0,10,15,15,10,10,10,10,10,0],"texture":[3,63,3,3,3,63,4],"propeller":true}},"wings":{"main":{"doubleside":true,"offset":{"x":15,"y":-30,"z":-3},"length":[20,15],"width":[150,90,10],"angle":[-20,-20,0],"position":[-20,0,70],"texture":[4,63],"bump":{"position":20,"size":5}},"winglets":{"doubleside":true,"offset":{"x":20,"y":60,"z":10},"length":[20,60,20],"width":[20,40,20],"angle":[0,0,0],"position":[0,0,10,0],"texture":[63,3],"bump":{"position":30,"size":10}}},'+
- '"typespec":{"name":"Prototype-T","level":1,"model":15,"code":115,"specs":{"shield":{"capacity":[350,350],"reload":[20,20]},"generator":{"capacity":[300,300],"reload":[20,20]},"ship":{"mass":130,"speed":[150,150],"rotation":[50,50],"acceleration":[170,170],"dash":{"rate":2,"burst_speed":[250,250],"speed":[175,175],"acceleration":[200,200],"initial_energy":[85,85],"energy":[40,40]}}},"shape":[3.003,2.835,2.22,1.853,1.589,1.339,1.177,1.051,0.981,0.925,0.885,0.866,0.868,0.888,0.921,0.977,1.059,2.471,2.561,2.335,2.072,2.069,2.341,2.103,2.036,2.004,2.036,2.103,2.341,2.069,2.072,2.335,2.561,2.471,1.059,0.977,0.921,0.888,0.868,0.866,0.885,0.925,0.981,1.051,1.177,1.339,1.589,1.853,2.22,2.835],"lasers":[],"radius":3.003}}';
- var Piranha = '{"name":"Piranha","level":1,"model":16,"size":1.1,"specs":{"shield":{"capacity":[250,250],"reload":[20,20]},"generator":{"capacity":[150,150],"reload":[10,10]},"ship":{"mass":140,"speed":[150,150],"rotation":[120,120],"acceleration":[140,140],"dash":{"rate":2,"burst_speed":[180,180],"speed":[160,160],"acceleration":[280,280],"initial_energy":[50,50],"energy":[30,30]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":50,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-97,-95,-90,-80,-40,-30,30,40,55,50,50],"z":[0,0,0,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,20,23,23,10,10,10,10,0],"height":[0,5,10,15,20,20,5,10,10,10,10,0],"texture":[4,4,4,63,11,4,11,63,17],"propeller":true},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-25,"z":6},"position":{"x":[0,0,0,0,0,0,0],"y":[-20,-10,10,30,60],"z":[0,0,0,0,0]},"width":[0,10,13,16,5],"height":[0,5,10,18,5],"propeller":false,"texture":9},"propulsors":{"section_segments":10,"offset":{"x":95,"y":-75,"z":5},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-21,-20,0,10,20,25,30,40,60,50],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,20,25,27,25,20,20,15,10,0],"height":[0,20,25,27,25,20,20,15,10,0],"texture":[17,4,10,3,3,63,4],"propeller":true},"cannons":{"section_segments":12,"offset":{"x":15,"y":-40,"z":-4.7},"position":{"x":[0,0,0,50],"y":[-30,-10,70,100],"z":[0,0,0,20]},"width":[2,5,50,0],"height":[2,5,5,2],"angle":[0],"propeller":false,"texture":[6,4,63]}},"wings":{"main":{"doubleside":true,"length":[50,50],"width":[50,40,30],"angle":[-10,10],"position":[-40,-80,-120],"texture":[63,4],"bump":{"position":30,"size":10},"offset":{"x":-5,"y":50,"z":5}},"winglets":{"doubleside":true,"offset":{"x":5,"y":60,"z":0},"length":[40],"width":[70,40],"angle":[40],"position":[0,50],"texture":[4],"bump":{"position":10,"size":20}}},'+
- '"typespec":{"name":"Piranha","level":1,"model":16,"code":116,"specs":{"shield":{"capacity":[250,250],"reload":[20,20]},"generator":{"capacity":[150,150],"reload":[10,10]},"ship":{"mass":140,"speed":[150,150],"rotation":[120,120],"acceleration":[140,140],"dash":{"rate":2,"burst_speed":[180,180],"speed":[160,160],"acceleration":[280,280],"initial_energy":[50,50],"energy":[30,30]}}},"shape":[1.034,1.568,1.585,1.337,1.124,2.716,3.071,3.265,3.167,3.024,2.698,2.442,1.054,1.141,1.27,1.463,1.631,1.766,1.946,1.907,1.527,1.291,2.535,2.966,2.55,2.315,2.55,2.966,2.535,1.291,1.527,1.907,1.946,1.766,1.631,1.463,1.27,1.141,1.054,2.442,2.698,3.024,3.167,3.265,3.071,2.716,1.124,1.337,1.585,1.568],"lasers":[],"radius":3.265}}';
- var Vengar = '{"name":"Vengar","level":1,"model":17,"size":1.3,"specs":{"shield":{"capacity":[220,220],"reload":[15,15]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":110,"speed":[160,160],"rotation":[60,60],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[240,240],"speed":[190,190],"acceleration":[250,250],"initial_energy":[50,50],"energy":[40,40]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-72,-70,-45,-25,-10,20,30,45,40],"z":[0,0,0,0,0,0,0,0]},"width":[0,5,10,13,15,15,10,7,0],"height":[0,5,10,13,15,15,10,7,0],"texture":[3,3,63,63,3,11,63,3],"propeller":true},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-15,"z":3},"position":{"x":[0,0,0,0,0,0],"y":[-45,-40,-25,20,45],"z":[0,0,0,10,5,10]},"width":[0,5,8,8,0],"height":[0,5,8,8,0],"texture":[3,3,9,3,3]},"cannon":{"section_segments":12,"offset":{"x":0,"y":-15,"z":-20},"position":{"x":[0,0,0,0,0,0],"y":[-75,-80,-20,0,20,60],"z":[0,0,0,-5,0,20]},"width":[0,10,15,40,35,0],"height":[0,7,10,10,10,0],"angle":0,"propeller":false,"texture":[6,4,4,3]},"cannons2":{"section_segments":12,"offset":{"x":40,"y":70,"z":0},"position":{"x":[0,0,0,0,0],"y":[-30,-20,0,20,30],"z":[0,0,0,0,0]},"width":[2,5,7,10,3],"height":[2,5,7,10,3],"texture":[6,4,63,4],"propeller":true,"angle":0},"propulsors":{"section_segments":8,"offset":{"x":60,"y":-50,"z":-25},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0],"y":[30,55,60,80,95,100,90,95],"z":[0,0,0,0,0,0,0,0]},"width":[7,9,9,5,7,5,0],"height":[1,9,9,5,7,5,0],"texture":[4,63,4,11,63,12],"propeller":true}},"wings":{"wings1":{"doubleside":true,"offset":{"x":0,"y":20,"z":13},"length":[-20,-10,-40],"width":[50,50,130,30],"angle":[100,-20,10],"position":[0,0,-50,0],"texture":[4,4,8,4],"bump":{"position":10,"size":-10}},"join":{"doubleside":true,"offset":{"x":0,"y":10,"z":0},"length":[70],"width":[50,30],"angle":[-20],"position":[0,0,0,50],"texture":63,"bump":{"position":10,"size":15}},"side_joins":{"offset":{"x":0,"y":30,"z":-3},"length":[40],"width":[90,30],"angle":[10],"position":[-50,50],"texture":[4],"bump":{"position":10,"size":10}}},'+
- '"typespec":{"name":"Vengar","level":1,"model":17,"code":117,"specs":{"shield":{"capacity":[220,220],"reload":[15,15]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":110,"speed":[160,160],"rotation":[60,60],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[240,240],"speed":[190,190],"acceleration":[250,250],"initial_energy":[50,50],"energy":[40,40]}}},"shape":[2.475,2.484,1.959,1.642,1.438,1.295,1.191,1.121,1.08,1.098,1.818,1.804,1.783,1.808,1.813,1.84,1.952,2.117,2.132,1.856,2.316,2.773,2.83,1.601,1.184,1.172,1.184,1.601,2.83,2.773,2.316,1.856,2.132,2.117,1.952,1.84,1.813,1.808,1.784,1.804,1.818,1.098,1.08,1.121,1.191,1.295,1.438,1.642,1.959,2.484],"lasers":[],"radius":2.83}}';
- var Bull = '{"name":"Bull","level":1,"model":18,"size":1.1,"specs":{"shield":{"capacity":[275,275],"reload":[15,15]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":170,"speed":[140,140],"rotation":[40,40],"acceleration":[150,150],"dash":{"rate":1,"burst_speed":[200,200],"speed":[180,180],"acceleration":[170,170],"initial_energy":[45,45],"energy":[30,30]}}},"bodies":{"main":{"section_segments":8,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0],"y":[-100,-99,-98,-50,0,110,90],"z":[0,0,0,0,0,0,0]},"width":[0,5,6,17,28,20,0],"height":[0,2,4,15,25,20,0],"texture":[4,6,10,10,11,12],"propeller":true},"front":{"section_segments":8,"offset":{"x":0,"y":-20,"z":0},"position":{"x":[0,0,0,0,0],"y":[-90,-85,-60,-60,-20],"z":[0,0,0,0,0]},"width":[0,30,45,10,12],"height":[0,15,18,8,12],"texture":[8,63,4,4,4],"propeller":true},"propulsors":{"section_segments":10,"offset":{"x":30,"y":40,"z":10},"position":{"x":[-30,-10,0,0,0,0,0,0,0,0],"y":[-150,-90,0,10,20,25,30,40,70,60],"z":[-10,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,15,15,10,10,20,15,0],"height":[0,10,15,15,15,10,10,18,8,0],"texture":[4,4,10,3,3,63,4,63,12],"propeller":true},"sides":{"section_segments":6,"angle":90,"offset":{"x":0,"y":-50,"z":-3},"position":{"x":[-50,-50,0,0,0,0,0,0,-50,-50],"y":[-80,-65,-50,-50,-10,10,50,50,65,80],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,30,55,10,12,12,10,55,30,0],"height":[0,10,12,8,12,12,8,12,10,0],"texture":[4,63,4,4,4,4,4,63,4]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-20,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-50,-20,0,10,30,50],"z":[0,0,0,0,0,0]},"width":[0,12,18,20,15,0],"height":[0,10,12,14,10,0],"texture":[9]}},"wings":{"top":{"doubleside":true,"offset":{"x":0,"y":50,"z":5},"length":[70],"width":[100,50],"angle":[-10],"position":[-20,50],"texture":[4],"bump":{"position":10,"size":10}},"top2":{"doubleside":true,"offset":{"x":0,"y":51,"z":5},"length":[70],"width":[80,20],"angle":[40],"position":[0,100],"texture":[4],"bump":{"position":10,"size":10}}},'+
- '"typespec":{"name":"Bull","level":1,"model":18,"code":118,"specs":{"shield":{"capacity":[275,275],"reload":[15,15]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":170,"speed":[140,140],"rotation":[40,40],"acceleration":[150,150],"dash":{"rate":1,"burst_speed":[200,200],"speed":[180,180],"acceleration":[170,170],"initial_energy":[45,45],"energy":[30,30]}}},"shape":[2.42,2.4,2.402,2.325,2.413,2.172,1.934,1.769,1.658,1.585,1.582,1.651,1.757,1.76,1.651,1.582,1.54,1.162,1.373,2.374,2.828,3.14,3.733,3.642,2.712,2.425,2.712,3.642,3.733,3.14,2.828,2.374,1.373,1.162,1.54,1.582,1.651,1.757,1.76,1.651,1.582,1.585,1.658,1.769,1.934,2.172,2.413,2.325,2.402,2.4],"lasers":[],"radius":3.733}}';
- ships = [];
- shipInfos = [];
- racingShipsAmount = 18;
- ships.push(Astral);
- shipInfos.push({company:"FinaDrive", creator:"Finalizer",
- desc:"Powerful boost, high cruising speed,\n amazing hot look. What else do you need?"});
- ships.push(ShadowX1);
- shipInfos.push({company:"Starblast", creator:"pmgl",
- desc:"Deadly little beast. People always wondered if\n it would be good for racing, so we bought several of these\n and removed the weapons. \nBoy oh boy you won't be disappointed."});
- ships.push(RADDiamondLancer);
- shipInfos.push({company:"RAD Diamond", creator:"UranusOrbiter",
- desc:"It might look a bit weird and feel sluggish, \nbut it's strength is it's boost tank. \nHold that dash button."});
- ships.push(ZerdBooster);
- shipInfos.push({company:"ZerdTech", creator:"Revenge Zerd",
- desc:"Beautiful and powerful, this lovely rocket \ncan change. It's. Movement. Direction. Instantly."});
- ships.push(LGViper);
- shipInfos.push({company:"Halo L.Starships", creator:"L.Gaming",
- desc:"A sleek, compact, fast ship capable of\n powerful overdrive allowing you to surpass your competition.\n Great handling although low thrust."});
- ships.push(VoidA);
- shipInfos.push({company:"Abyss Racecraft ltd.", creator:"Void",
- desc:"Simple, nice-looking racing vehicle. \nNothing too fancy. \nDoes it's job well."});
- ships.push(Starsurfer);
- shipInfos.push({company:"SpaceGGFlight", creator:"UranusOrbiter",
- desc:"SpaceGG develops spaceships. People say\n those ships are good. People say this \nship is good. A sleek, fast space surfboard \ncapable of pretty much everything. \nIncluding racing."});
- ships.push(ZerdTurbine);
- shipInfos.push({company:"ZerdTech", creator:"Revenge Zerd",
- desc:"When one engine isn't enough - attach more.\n Attaching one isn't trivial, but two,\n sure - and you get this thing. Incredibly good\n handling, great acceleration and overdrive."});
- ships.push(Arrowhead);
- shipInfos.push({company:"T. T. Tun design bureau", creator:"Cmdre. T. T. Tun",
- desc:"'What an original name', said our investors.\n 'What else are you gonna call it?', said we.\n Behold - a cockpit, a reactor, an engine and some wings.\n Really that's all you need for a spaceship."});
- ships.push(SweptWingedRacecraft);
- shipInfos.push({company:"SCM Racing", creator:"SChickenMan",
- desc:"Wings are unnecessary for spaceships.\n Unless you want your spaceship to look cool.\n And yes, we want our racing ships to look cool.\n These wings are lightweight and hollow, \nso they barely impact the performance"});
- ships.push(ShadowX2);
- shipInfos.push({company:"Starblast", creator:"pmgl",
- desc:"When we were busy buying Shadow X1s, \n folks at Starblast HQ offered a discount \n on X2s, so we were like, uhh, yes please!\n Obviously we removed the weapons.\n X2 isn't nearly as maneuverable,\n so use it at your own risk"});
- ships.push(ShadowX2MKII);
- shipInfos.push({company:"MALEFOR MACHINATIONS", creator:"MALEFOR",
- desc:"Some people just know how to do it, y'know?\n Some people just know how to make a ship better.\n Shadow X2, but better. And it looks\n so much cooler too!"});
- ships.push(Thunderstorm);
- shipInfos.push({company:"Halo L.Starships", creator:"L.Gaming",
- desc:"Now that's a racing ship! Look at those curves!\n High dashrate and good cruising speed, \nalthough somewhat low maneuverability. \nIf you're a good pilot, this ship is for you.\n Rumors say this ship just YEETS.\n Beware."});
- ships.push(Amalgam);
- shipInfos.push({company:"W115", creator:"Wikstorm115",
- desc:"Cute bulky racing vehicle with many capacitors,\n an efficient dash system, and \nreasonable maneuverability"});
- ships.push(PrototypeT);
- shipInfos.push({company:"SCM Racing", creator:"SChickenMan",
- desc:"A simple spaceplane certified for racing.\n Lightweight wings and compact, \nstreamlined shape."});
- ships.push(Piranha);
- shipInfos.push({company:"SCM Starfighters", creator:"SChickenMan",
- desc:"3 fusion cores, one per turbine + one \non the main body provide great thrust,\n reliability and response time. \n All in all a great ship, especially for\n tracks with many turns and obstacles"});
- ships.push(Vengar);
- shipInfos.push({company:"SCM Starfighters", creator:"SChickenMan",
- desc:"Beutiful and dangerous starfighter, \n stripped of it's weapons, which were \n replaced by large capacitors and \na dash system."});
- ships.push(Bull);
- shipInfos.push({company:"SCM Starfighters", creator:"SChickenMan",
- desc:"If playing bumper cars is your thing,\n then this is your ship. We didn't\n even have to modify it to use it for racing\n - even though it is a combat ship."});
- for(i =0;i<ships.length;i++){
- ships[i] = JSON.parse(ships[i]);
- ships[i].typespec.specs.shield.capacity = [1000,1000];
- ships[i].typespec.specs.ship.speed[1]+=speedBuff;
- if(ships[i].typespec.specs.ship.dash!=undefined)
- ships[i].typespec.specs.ship.dash.speed[1]+=dashSpeedBuff;
- ships[i].typespec.specs.ship.acceleration[1]*=accelerationBuff;
- if(ships[i].typespec.specs.ship.dash!=undefined)
- ships[i].typespec.specs.ship.dash.acceleration[1]*=dashAccelerationBuff;
- ships[i].typespec.specs.generator.reload[1]*=energyRegenBuff;
- ships[i] = JSON.stringify(ships[i]);
- }
- shipBuilders = [];
- for(i=0; i<shipInfos.length; i++){
- designedBy = -1;
- for(j=0; j<shipBuilders.length; j++){
- if(shipBuilders[j].name == shipInfos[i].creator){
- designedBy = j; break;
- }
- }
- if(designedBy==-1)
- shipBuilders.push({name:shipInfos[i].creator,shipAmount:1});
- else shipBuilders[designedBy].shipAmount++;
- }
- ships.push(Spectatorship)
- //mod code - edit at your own risk
- this.options = {
- // see documentation for options reference
- //root_mode: "survival",
- weapons_store: false,
- ships: ships,
- map_size: mapSize,
- map_id: mapSeed,
- crystal_value: 0,
- radar_zoom: 1.5,
- asteroids_strength: 1000000,
- invulnerable_ships: true
- };
- if(customMap)
- this.options.custom_map = map;
- const map_size = mapSize*5; //the size of the map
- const checkpointrange = 25; //size of checkpoints
- const quickRaceStartTime = 20; //time it takes to start a race if all players are ready
- const longRaceStartTime = 60; //time it takes to start a race if some players are ready
- const DNFTime = 60; //did not finish time
- const finalCountdownTime = 10; //the final countdown before the race
- const sandboxAreaSize = 65;//size of the sandbox/waiting area
- const shipsInLine = 2;//how many ships per starting line
- const startingLinesWidth = 10;//width of the starting grid
- const startingLinesDist = 7;//distance between lines in starting grid
- const noActivityTime = 30;//if nobody picks up a checkpoint in this time, the race is over
- laps = 3;
- raceinprogress = false; //whether there's a race going on
- racetime = 0; //race timer
- lastfinished = 0; //how many players finished
- countdown = quickRaceStartTime; //lobby countdown timer(all players ready)
- countdownLong = longRaceStartTime; //lobby countdown timer(some players ready)
- DNFCountdown = 0; //DNF timer
- noActivityCountdown = 0;//no activity timer
- finalCountdown = 0; //final countdown
- raceStarted = false; //whether the final countdown is finished
- everySecond = 0;
- dislikedBy = 0;
- readyAmount = 0;
- const votekickTime = 20;//votekick system - voting time
- const votekickCooldownTime = 60;//how many seconds until another player can be votekicked
- votekickCountdown = -1;
- proposedVotekick = {id:-1, name:""};
- const playerLogFadeoutStart = 0.7;
- const playerLogFadeoutSpeed = 0.2;
- playersLog = []
- for(i=0;i<5;i++){
- playersLog.push({log:"",fade:0});
- }
- requestTrack = -1;
- requestLaps = -1;
- nextTrack = 0;
- //direction from the start to the first checkpoint
- firstCheckpointDir = [];
- firstCheckpointAngle = 0;
- highestCheckpoint = [-1, -1];
- top1time = {name:"", time:-1};
- top2time = {name:"", time:-1};
- top3time = {name:"", time:-1};
- ads = [];
- adTimer = 0;
- adRefreshTime = 5;
- ads.push("Uranus Racing League by /u/UranusOrbiter aka Uranus_is_big#7833");
- ads.push("Uranus Racing League version 0.0003");
- ads.push("Have a nice day");
- ads.push("Huge thanks to pmgl for making all of this possible");
- ads.push("Huge thanks to Starblast dev team for making all of this possible");
- ads.push("Thanks to everybody who helped test this mod");
- ads.push("Map created by rm -rf / and improved by Uranus");
- ads.push("Huge thanks to rm -rf / for creating this beautiful map");
- ads.push("Huge thanks to SChickenMan for helping with ship balance");
- banners = [];
- RADDiamondLogo = {
- id: "RAD",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/RadDiamond.png"
- };
- banners.push(RADDiamondLogo);
- RADDiamondLancer1 = {
- id: "RADL1",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/RAD%20DIAMOND%20LANCER%20ad1.png"
- };
- banners.push(RADDiamondLancer1);
- RADDiamondLancer2 = {
- id: "RADL2",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/RAD%20DIAMOND%20LANCER%20ad2.png"
- };
- banners.push(RADDiamondLancer2);
- SpaceGG = {
- id: "SPACEGG",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/SpaceGGFlight.png"
- };
- banners.push(SpaceGG);
- ZerdTech = {
- id: "ZerdTech",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/ZerdTech.png"
- };
- banners.push(ZerdTech);
- ECP1 = {
- id: "ECP1",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/lovethegameECP.png"
- };
- ECP2 = {
- id: "ECP2",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/starblastisfreeECP.png"
- };
- ECP3 = {
- id: "ECP3",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/havingFunECP.png"
- };
- ECP4 = {
- id: "ECP4",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/unclesamECP.png"
- };
- banners.push(ECP1, ECP2, ECP3, ECP4);
- USeries1 = {
- id: "US1",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ships/useries1.png"
- };
- USeries2 = {
- id: "US2",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ships/useries2.png"
- };
- USeries3 = {
- id: "US3",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ships/useries3.png"
- };
- banners.push(USeries1,USeries2,USeries3);
- LG = {
- id: "LG",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/lgaming.png"
- };
- banners.push(LG);
- doge1 = {
- id: "doge1",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/doge1.png"
- };
- doge2 = {
- id: "doge2",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/doge2.png"
- };
- doge3 = {
- id: "doge3",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/doge3.png"
- };
- banners.push(doge1, doge2, doge3);
- noPassage = {
- id: "noPassage",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/noPassage.png",
- };
- checkpoint = {
- id: "checkpoint",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/checkpoint.png"
- };
- startline = {
- id: "startline",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://starblast.data.neuronality.com/mods/objects/startline.png"
- };
- localizations = [];
- loadLocalization = function(string){
- lines = string.split("\n");
- localization = {};
- for(i=0; i<lines.length-1; i+=2){
- localization[lines[i].trim().substring(1)] = lines[i+1];
- }
- localizations.push(localization);
- }
- getHTTP = function(aUrl, aCallback) {
- var anHttpRequest = new XMLHttpRequest();
- anHttpRequest.onreadystatechange = function() {
- if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)
- aCallback(anHttpRequest.responseText);
- }
- anHttpRequest.open( "GET", aUrl, true );
- anHttpRequest.send( null );
- }
- getLocalizedString = function(ship, i){
- loc = ship.custom.localization;
- if(loc!=undefined&&loc>=0&&loc<localizations.length){
- ls = localizations[loc][i];
- if(ls == undefined) return "no transl";
- return ls;
- }else return "unkn locale";
- }
- en = "";
- ru = "";
- getHTTP("https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/loc_en.txt", function(k){
- en = k;loadLocalization(en);
- getHTTP("https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/loc_ru.txt", function(k){ru = k;ru=decodeURIComponent(ru);loadLocalization(ru);});
- });
- distance = function(x, y){
- return Math.sqrt(x*x+y*y);
- };
- shortestPath = function(x1, y1, x2, y2){
- shortestDist = 10000;
- coords = [];
- xx = x2-x1;
- yy = y2-y1;
- coords.push(xx, yy);
- shortest = [xx, yy];
- xx = x2+map_size*2-x1;
- yy = y2-y1;
- coords.push(xx, yy);
- xx = x2-map_size*2-x1;
- yy = y2-y1;
- coords.push(xx, yy);
- xx = x2-x1;
- yy = y2+map_size*2-y1;
- coords.push(xx, yy);
- xx = x2-x1;
- yy = y2-map_size*2-y1;
- coords.push(xx, yy);
- xx = x2+map_size*2-x1;
- yy = y2+map_size*2-y1;
- coords.push(xx, yy);
- xx = x2+map_size*2-x1;
- yy = y2-map_size*2-y1;
- coords.push(xx, yy);
- xx = x2-map_size*2-x1;
- yy = y2+map_size*2-y1;
- coords.push(xx, yy);
- xx = x2-map_size*2-x1;
- yy = y2-map_size*2-y1;
- coords.push(xx, yy);
- for(var i = 0; i<9; i++){
- dist = distance(coords[i*2], coords[i*2+1]);
- if(dist<shortestDist){
- shortestDist = dist;
- shortest = [coords[i*2], coords[i*2+1]];
- }
- }
- return shortest;
- };
- debugDrawAllRoadblocks = function(){
- game.removeObject();
- for(i=0; i<roadblocks.length; i++){
- game.setObject({
- id:"np"+i,
- type:noPassage,
- position:{x:roadblocks[i].x, y:roadblocks[i].y,z:-2},
- scale:{x:12,y:12,z:12},
- rotation: {x:Math.PI,y:0,z:roadblocks[i].angle}
- });
- }
- }
- debugFindClosestRoadblockIndex = function(shipindex){
- closestDist = map_size*2;
- closest = -1;
- ship = game.ships[shipindex];
- for(i=0; i<roadblocks.length; i++){
- shortest = shortestPath(ship.x,ship.y,roadblocks[i].x,roadblocks[i].y);
- if(distance(shortest[0],shortest[1])<closestDist){
- closestDist = distance(shortest[0],shortest[1]);
- closest = i;
- }
- }
- return closest;
- }
- shamePlayer = function(shipindex){
- game.ships[shipindex].custom.ignoreMod = true;
- log(game.ships[shipindex].name + " is now in the corner of shame.");
- }
- unshamePlayer = function(shipindex){
- game.ships[shipindex].custom.ignoreMod = false;
- log(game.ships[shipindex].name + " has been unshamed.");
- game.ships[shipindex].set({x:sandboxArea.x, y:sandboxArea.y});
- }
- playerList = function(){
- log("List of players:");
- for(i=0; i<game.ships.length; i++){
- log("game.ships["+i + "]: "+game.ships[i].name);
- }
- }
- writeTextLarge = function(ship, string){
- ship.setUIComponent({
- id:"largeText",
- position:[25,25,50,25],
- clickable: false,
- visible: true,
- components: [
- { type: "text",position: [0,0,100,100],color: "#FFFFFF",value: string}
- ]
- });
- };
- writeTextSmol = function(ship, string){
- ship.setUIComponent({
- id:"smolText",
- position:[25,10,50,25],
- clickable: false,
- visible: true,
- components: [
- { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: string}
- ]
- });
- };
- updatePlayersLog = function(){
- comps = [];
- for(i=0;i<playersLog.length;i++){
- fade = Math.min(playersLog[i].fade/playerLogFadeoutStart,1.0);
- playersLog[i].fade -= playerLogFadeoutSpeed;
- if(fade<0)continue;
- comps.push({ type: "text",position: [0,i*(100/playersLog.length),100,100/playersLog.length],color: "#FFFFFF"+Math.floor(fade*255).toString(16).toUpperCase(),value: playersLog[i].log});
- }
- for (i=0;i<game.ships.length;i++)
- {
- game.ships[i].setUIComponent({
- id:"log",
- position:[25,70,50,20],
- clickable: false,
- visible: true,
- components: comps
- });
- }
- };
- addPlayersLog = function(string){
- playersLog.shift();
- playersLog.push({log:string,fade:1.0});
- }
- randomAd = function(){
- adIndex = Math.floor(Math.random()*ads.length);
- ad = ads[adIndex];
- if(Math.random()<0.5){
- shipIndex = Math.floor(Math.random()*shipInfos.length);
- if(shipInfos[shipIndex].creator != "UranusOrbiter"){
- name = JSON.parse(ships[shipIndex]).name;
- ad = "Huge thanks to "+shipInfos[shipIndex].creator+" for his "+name+" design";
- }
- }
- for (i=0;i<game.ships.length;i++)
- {
- game.ships[i].setUIComponent({
- id:"ad",
- position:[30,3,40,25],
- clickable: false,
- visible: true,
- components: [
- { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: ad}
- ]
- });
- }
- };
- showBanners = function(){
- for(i = 0; i<bannerPositions.length; i++){
- index = Math.floor(Math.random()*banners.length);
- game.setObject({
- id:"banner"+i,
- type:banners[index],
- position:{x:bannerPositions[i].x, y:bannerPositions[i].y,z:-4},
- scale:{x:20,y:20,z:20},
- rotation: {x:Math.PI,y:0,z:0}
- });
- }
- }
- announce = function(string){
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- ship.setUIComponent({
- id:"announceText",
- position:[25,45,50,25],
- clickable: false,
- visible: true,
- components: [
- { type: "text",position: [0,0,100,20],color: "#FFBBBB",value: string}
- ]
- });
- }
- };
- drawButton = function(ship, x, y, id, fill, visible, shortcut, text){
- components = [];
- if(visible)
- components = [
- { type:"box",position:[0,0,100,100],fill:fill,stroke:"#CDE",width:2},
- { type: "text",position:[10,15,80,30],value:text,color:"#CDE"},
- { type: "text",position:[20,40,60,40],value:"["+shortcut+"]",color:"#CDE"}
- ]
- ship.setUIComponent(
- {id: id,
- position: [x,y,8,12],
- clickable: visible,
- shortcut: shortcut,
- visible: visible,
- components: components
- }
- );
- }
- log = function(string){
- game.modding.terminal.echo(string);
- }
- drawTopScores = function(ship, b){
- sc1 = "#1 - ";
- sc2 = "#2 - ";
- sc3 = "#3 - "
- if(top1time.time>=0)sc1+=top1time.name+" - "+top1time.time.toFixed(2);
- if(top2time.time>=0)sc2+=top2time.name+" - "+top2time.time.toFixed(2);
- if(top3time.time>=0)sc3+=top3time.name+" - "+top3time.time.toFixed(2);
- if(ship.custom.lasttime>=0)
- yourLastTime = "your time: " + ship.custom.lasttime.toFixed(2);
- else
- yourLastTime = "your time: N/A";
- ship.setUIComponent({
- id:"topscores",
- position:[50,80,40,20],
- clickable: false,
- visible: b,
- components: [
- { type: "text",position: [0,0,100,20],color: "#FFFF33",value: sc1},
- { type: "text",position: [0,20,100,20],color: "#BBBBBB",value: sc2},
- { type: "text",position: [0,40,100,20],color: "#FFAA33",value: sc3},
- { type: "text",position: [0,80,100,20],color: "#FFFFFF",value: yourLastTime}
- ]
- });
- };
- shipChooseScreen = function(ship, b){
- text = getLocalizedString(ship, "back");
- change = ship.custom.UIScreen == 1;
- mainscreen = ship.custom.UIScreen == 0;
- drawButton(ship, 12, 45, "back", "#33333370", b, "X", text);
- drawButton(ship, 2, 45, "prevship", "#33333370", b, "W", getLocalizedString(ship, "pship"));
- drawButton(ship, 90, 45, "nextship", "#33333370", b, "E", getLocalizedString(ship, "nship"));
- index = 0;
- index = ship.custom.type;
- if(index>=shipInfos.length)return;
- if(index<0)return;
- if(b)
- desc = shipInfos[index].desc.split("\n");
- UIDesc = [{ type:"box",position:[0,0,100,100],fill:"#33333370",stroke:"#CDE",width:2}];
- if(b)
- UIDesc.push(
- { type: "text",position: [0,0,100,10],color: "#3333AA",value: shipInfos[index].company},
- { type: "text",position: [0,10,100,20],color: "#FFFFFF",value: JSON.parse(ships[index]).name},
- { type: "text",position: [0,30,100,10],color: "#AAAAAA",value: "by "+shipInfos[index].creator},
- );
- if(b)
- for(i = 0; i<desc.length; i++){
- UIDesc.push(
- { type: "text",position: [0,40+i*10,100,7],color: "#FFFFFF",value: desc[i]}
- );
- }
- ship.setUIComponent({
- id:"shipInfo",
- position:[2,60,50,38],
- clickable: false,
- visible: b,
- components: UIDesc
- });
- }
- votekickScreen = function(ship, b){
- text = getLocalizedString(ship, "back");
- kickId =ship.custom.wantVotekick;
- drawButton(ship, 12, 60, "back", "#33333370", b, "X", text);
- drawButton(ship, 2, 60, "votekicknext", "#33333370", b, "W", "Previous player");
- drawButton(ship, 70, 60, "votekickprevious", "#33333370", b, "E", "Next player");
- kickText = "ERROR";
- if(kickId!=-1)kickText = getLocalizedString(ship, "proposeKick")+game.ships[kickId].name;
- drawButton(ship, 45, 60, "proposeVotekick", "#33333370", b, "Y", kickText);
- }
- creditsScreen = function(ship, b){
- text = getLocalizedString(ship, "back");
- drawButton(ship, 12, 60, "back", "#33333370", b, "X", text);
- getText = function(x, y, sx, sy, value){
- return { type: "text",position:[x,y,sx,sy],value:value,color:"#CDE"};
- }
- comps = [];
- comps.push({ type:"box",position:[0,0,100,100],fill:"#33333370",stroke:"#CDE",width:2});
- comps.push(getText(0,5,100,10,"Uranus Racing League"));
- comps.push(getText(0,15,100,5,"Mod developed by /u/UranusOrbiter aka Uranus_is_big#7833"));
- comps.push(getText(0,20,100,5,"with help of many members of the Starblast community"));
- comps.push(getText(0,30,100,5,"The amazing ship builders: "));
- shipBuildersText = "";
- for(i=0; i<shipBuilders.length; i++){
- s = "";
- if(shipBuilders[i].shipAmount>1)s="s";
- shipBuildersText += shipBuilders[i].name + "("+shipBuilders[i].shipAmount+" ship"+s+"), ";
- if((i+1)%3==0){comps.push(
- getText(0,35+(((i+1)/3)-1)*5,100,5,shipBuildersText));
- shipBuildersText = "";
- }
- }
- ship.setUIComponent(
- {id: "creditsWindow",
- position: [25,30,50,60],
- clickable: false,
- visible: b,
- components: comps/*[
- { type:"box",position:[0,0,100,100],fill:"#33333370",stroke:"#CDE",width:2},
- { type: "text",position:[0,5,100,10],value:,color:"#CDE"},
- { type: "text",position:[0,15,100,5],value:"Mod developed by /u/UranusOrbiter aka Uranus_is_big#7833",color:"#CDE"},
- { type: "text",position:[0,20,100,5],value:"with help of many members of the Starblast community",color:"#CDE"},
- { type: "text",position:[0,25,100,40],value:"and the amazing ship builders: "+shipBuildersText,color:"#CDE"},
- { type: "text",position:[0,90,100,5],value:"From Ukraine with love. <3",color:"#CDE"},
- ]*/
- }
- );
- }
- drawVotekickVoteUI = function(ship, b){
- color1 = "#AAAAAA70";
- color2 = "#AAAAAA70";
- if(ship.custom.votekickVote<0)
- color2 = "#33FF3370";
- if(ship.custom.votekickVote>0)
- color1 = "#FF333370";
- drawButton(ship, 70, 2, "yesKick", color1, b, "Y", getLocalizedString(ship, "kickPlayer")+proposedVotekick.name);
- drawButton(ship, 70, 14, "noKick", color2, b, "T", getLocalizedString(ship, "dontKickPlayer"));
- }
- drawStatusButtons = function(ship, b){
- color = "#AA000090";
- text = getLocalizedString(ship, "notReady");
- if(ship.custom.ready){
- color = "#00AA0040";
- text = getLocalizedString(ship, "ready");
- }
- drawButton(ship, 2, 29, "readyToggle", color, b, "U", text);
- color = "#00AA0040";
- text = getLocalizedString(ship, "notAFK");
- if(ship.custom.ignoreSelf){
- color = "#88888890";
- text = getLocalizedString(ship, "AFK");;
- }
- drawButton(ship, 12, 29, "ignoreMeToggle", color, b, "I", text);
- }
- drawSpectateButton = function(ship, b){
- color = "#0000AA";
- text = "SPECTATE"
- if(ship.custom.spectating!=-1){
- color = "#00AA00";
- text = "RETURN";
- }
- ship.setUIComponent(
- {id: "spectateToggle",
- position: [25,20,8,14],
- clickable: b,
- shortcut: "L",
- visible: b,
- components: [
- { type:"box",position:[0,0,100,100],fill:color,stroke:"#CDE",width:2},
- { type: "text",position:[10,35,80,30],value:text,color:"#CDE"},
- { type: "text",position:[20,70,60,20],value:"[L]",color:"#CDE"}
- ]
- }
- );
- ship.setUIComponent(
- {id: "spectateNext",
- position: [35,20,8,14],
- clickable: ship.custom.spectating!=-1,
- shortcut: "K",
- visible: ship.custom.spectating!=-1,
- components: [
- { type:"box",position:[0,0,100,100],fill:color,stroke:"#CDE",width:2},
- { type: "text",position:[10,35,80,30],value:"SPECTATE NEXT",color:"#CDE"},
- { type: "text",position:[20,70,60,20],value:"[K]",color:"#CDE"}
- ]
- }
- );
- }
- writeTrackInfo = function(ship, b){
- trackName = tracks[nextTrack].name + ", "+tracks[nextTrack].laps+" laps";
- dislike = "Press [N] to dislike this track";
- dislikeCol = "#FFFFFF";
- if(ship.custom.dislikeTrack){
- if(dislikedBy>1)
- dislike = "You and "+(dislikedBy-1)+" people dislike this track [N]"
- else "You dislike this track [N]";
- dislikeCol = "#FFAAAA";
- }
- if(!ship.custom.ready){
- dislike = "You are not ready and cannot vote."
- dislikeCol = "#AAAAAA";
- }
- ship.setUIComponent({
- id:"trackInfo",
- position:[75,30,25,5],
- shortcut:"N",
- clickable: true,
- visible: b,
- components: [
- {type: "text",position: [0,0,100,50],color: "#FFFFFF",value: trackName},
- {type: "text",position: [0,50,100,50],color: dislikeCol,value: dislike}
- ]
- });
- };
- mainScreen = function(ship, b){
- text = getLocalizedString(ship, "chooseShip");
- drawButton(ship, 2, 45, "chooseShip", "#33333370", b, "S", text);
- text = getLocalizedString(ship, "votekick");
- if(ship.custom.votekickCooldown>0) text = "Wait "+ship.custom.votekickCooldown+"s";
- drawButton(ship, 2, 60, "chooseKick", "#33333370", b, "K", text);
- text = getLocalizedString(ship, "credits");
- drawButton(ship, 2, 75, "credits", "#33333370", b, "C", text);
- text = getLocalizedString(ship, "changeLanguage");
- drawButton(ship, 12, 75, "language", "#33333370", b, "Q", text);
- //writeTrackInfo(ship, b);
- }
- setScreen = function(ship, i, b){
- switch(i){
- case 0: mainScreen(ship, b); break;
- case 1: shipChooseScreen(ship, b); break;
- case 2: votekickScreen(ship, b); break;
- case 3: creditsScreen(ship, b); break;
- }
- }
- updateScreen = function(ship){
- setScreen(ship, ship.custom.UIScreen, true);
- }
- changeScreen = function(ship,i){
- j = ship.custom.UIScreen;
- setScreen(ship, i, true);
- ship.custom.UIScreen = i;
- setScreen(ship, j, false);
- }
- previousScreen = function(ship){
- setScreen(ship, ship.custom.UIScreen, false);
- switch(ship.custom.UIScreen){
- case 0: break;
- case 1:
- setScreen(ship, 0, true);
- ship.custom.UIScreen = 0;
- break;
- case 2:
- setScreen(ship, 0, true);
- ship.custom.UIScreen = 0;
- break;
- case 3:
- setScreen(ship, 0, true);
- ship.custom.UIScreen = 0;
- break;
- }
- }
- drawRaceTrack = function(ship, b){
- positionX = 85;
- positionY = 30;
- size = 10;
- ship.setUIComponent({
- id:"playerMarker",
- position:[positionX, positionY,25,25],
- clickable: false,
- visible: b,
- components: [
- { type:"round",position:[0,0,3,4],fill:"#777777",stroke:"#CDE",width:1}
- ]
- });
- for(var i = 0; i<checkpoints.length; i++){
- path = shortestPath(ship.x, ship.y, checkpoints[i].x, checkpoints[i].y);
- x = path[0];
- y = path[1];
- chX = x/map_size;
- chY = y/map_size;
- fill = "#00ff00";
- if(i<ship.custom.checkpoint)
- fill = "#aaaaaa";
- else if (i==ship.custom.checkpoint)
- fill = "#ff0000";
- else if (i==ship.custom.checkpoint+1)
- fill = "#3333ff";
- else if (i==checkpoints.length)
- fill = "#ffffff";
- ship.setUIComponent({
- id:"ch"+i,
- position:[positionX + chX*size, positionY - chY*size,25,25],
- clickable: false,
- visible: b,
- components: [
- { type:"round",position:[0,0,5,8],fill:fill,stroke:"#CDE",width:1}
- ]
- });
- }
- ship.setUIComponent({
- id:"minimap",
- position:[positionX-size, positionY-size,100,100],
- clickable: false,
- visible: b,
- components: [
- { type:"box",position:[0,0,size*2,size*2],fill:"#222222",stroke:"#CDE",width:1}, ]
- });
- };
- votekickResult = function(){
- kickResult = 0;
- kickNeeded = 0;
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(ship.custom.votekickVote!=0){
- if(ship.custom.votekickVote>0)kickResult += 1;
- if(ship.custom.votekickVote<0)kickResult -= 0.5;
- kickNeeded += 0.5;
- }
- drawVotekickVoteUI(ship, false);
- }
- if(kickResult >= kickNeeded&&game.ships[proposedVotekick.id].name == proposedVotekick.name){
- shamePlayer(proposedVotekick.id);
- addPlayersLog("Kicked "+proposedVotekick.name+" ("+kickResult+"/"+kickNeeded+")");
- }else{
- addPlayersLog("Votekick failed"+" ("+kickResult+"/"+kickNeeded+")");
- }
- }
- startVotekick = function(id){
- if(!(proposedVotekick.id<0||proposedVotekick.id>=game.ships.length||game.ships[proposedVotekick].name!=proposedVotekick.name))return;
- proposedVotekick.id = id;
- proposedVotekick.name = game.ships[id].name;
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- ship.custom.votekickVote = 0;
- drawVotekickVoteUI(ship, true);
- }
- votekickCountdown = votekickTime;
- addPlayersLog("Want to kick "+proposedVotekick.name+"?");
- }
- startRace = function(){
- if(!raceinprogress){
- game.removeObject();
- showBanners();
- if(requestTrack==-1)
- trackId = nextTrack;
- else trackId = requestTrack;
- if(requestLaps==-1)
- laps = tracks[trackId].laps;
- else laps = requestLaps;
- checkpoints = tracks[trackId].checkpoints;
- firstCheckpointDir = shortestPath(checkpoints[0].x, checkpoints[0].y, checkpoints[1].x, checkpoints[1].y);
- firstCheckpointAngle = Math.atan2(firstCheckpointDir[0], firstCheckpointDir[1]);
- highestCheckpoint = [-1, -1];
- game.setObject({
- id:"start",
- type:startline,
- position:{x:checkpoints[0].x, y:checkpoints[0].y,z:-2},
- scale:{x:15,y:15,z:15},
- rotation: {x:0,y:0,z:firstCheckpointAngle}
- });
- for(i=1; i<checkpoints.length; i++){
- if(i==checkpoints.length-1&&laps==0){
- lastCheckpointDir = shortestPath(checkpoints[i-1].x, checkpoints[i-1].y, checkpoints[i].x, checkpoints[i].y);
- lastCheckpointAngle = Math.atan2(lastCheckpointDir[0], lastCheckpointDir[1]);
- game.setObject({
- id:"finish",
- type:startline,
- position:{x:checkpoints[i].x, y:checkpoints[i].y,z:-2},
- scale:{x:15,y:15,z:15},
- rotation: {x:0,y:0,z:lastCheckpointAngle}
- });
- }else
- game.setObject({
- id:"ch"+i,
- type:checkpoint,
- position:{x:checkpoints[i].x, y:checkpoints[i].y,z:-2},
- scale:{x:15,y:15,z:15},
- rotation: {x:Math.PI,y:0,z:0}
- });
- }
- for(i=0; i<tracks[trackId].roadblocks.length; i++){
- if(i>=roadblocks.length)break;
- if(tracks[trackId].roadblocks[i]==0)continue;
- direction = [Math.sin(roadblocks[i].angle),Math.cos(roadblocks[i].angle)];
- direction[0]*=3;
- direction[1]*=3;
- game.setObject({
- id:"np"+i,
- type:noPassage,
- position:{x:roadblocks[i].x+direction[0], y:roadblocks[i].y+direction[1],z:-2},
- scale:{x:12,y:12,z:12},
- rotation: {x:Math.PI/2,y:roadblocks[i].angle,z:Math.PI}
- });
- game.setObject({
- id:"npb"+i,
- type:noPassage,
- position:{x:roadblocks[i].x-direction[0], y:roadblocks[i].y-direction[1],z:-2},
- scale:{x:12,y:12,z:12},
- rotation: {x:Math.PI/2,y:roadblocks[i].angle+Math.PI,z:Math.PI}
- });
- }
- lastfinished = 0;
- raceinprogress = true;
- raceStarted = false;
- finalCountdown=finalCountdownTime;
- DNFCountdown = DNFTime;
- top1time.time = -1;
- top2time.time = -1;
- top3time.time = -1;
- shipsInRace=0;
- startingGrid=[];
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- if(!ship.custom.ready)continue;
- if(ship.custom.ignoreMod)continue;
- if(ship.custom.ignoreSelf)continue;
- drawSpectateButton(ship, false);
- shipsInRace++;
- startingGrid.push(i);
- ship.custom.lap = 0;
- ship.custom.inrace = true;
- ship.custom.checkpoint = 0;
- ship.custom.lasttime = -1;
- drawStatusButtons(ship, false);
- drawTopScores(ship, false);
- changeScreen(ship,0);
- mainScreen(ship,false)
- }
- while(Math.random()>0.01){
- i1 = Math.floor(Math.random()*startingGrid.length);
- i2 = Math.floor(Math.random()*startingGrid.length);
- buffer = startingGrid[i1];
- startingGrid[i1] = startingGrid[i2];
- startingGrid[i2] = buffer;
- }
- for (i=0;i<startingGrid.length;i++)
- {
- ship = game.ships[startingGrid[i]];
- if(!ship)continue;
- if(!ship.custom.ready)continue;
- if(ship.custom.ignoreMod)continue;
- if(ship.custom.ignoreSelf)continue;
- ship.custom.gridPos = i;
- }
- firstCheckpointAngle=Math.PI-(Math.PI/2+firstCheckpointAngle);
- log("Race started!");
- }else{
- log("Race already started");
- }
- }
- stopRace = function(){
- if(raceinprogress){
- game.removeObject();
- showBanners();
- raceinprogress = false;
- racetime = 0;
- countdown = quickRaceStartTime;
- countdownLong = longRaceStartTime;
- lastfinished = 0;
- nextTrack = Math.floor(Math.random()*tracks.length);
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- if(ship.custom.inrace)
- shipFinished(ship);
- drawRaceTrack(ship, false);
- ship.custom.checkpoint = 0;
- ship.custom.ready = false;
- drawStatusButtons(ship, true);
- drawSpectateButton(ship, false);
- ship.custom.inrace = false;
- ship.custom.dislikeTrack = false;
- ship.custom.spectating = -1;
- writeTextSmol(ship,getLocalizedString(ship, "pressUWhenReady"));
- }
- log("Race stopped.");
- }else{
- log("No race in progress");
- }
- }
- initShip = function(ship){
- //this is a new ship, we have to set it up
- ship.custom.init = true;
- ship.custom.inrace = false;
- ship.custom.checkpoint = 0;
- ship.custom.lasttime = -1;
- ship.custom.type = 0;
- ship.custom.ready = false;
- ship.custom.lap = 0;
- ship.custom.dislikeTrack = false;
- ship.custom.ignoreSelf = false;
- ship.custom.ignoreMod = false;
- ship.custom.spectating = -1;
- ship.custom.wantChangeShip = false;
- ship.custom.votekickVote = 0;
- ship.custom.votekickCooldown = 0;
- ship.custom.wantVotekick = -1;
- ship.custom.UIScreen = 0;
- ship.custom.localization = 0;
- ship.set({
- x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
- y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
- });
- drawStatusButtons(ship, true);
- mainScreen(ship, true);
- //tell them what to do
- if(!raceinprogress) writeTextSmol(ship,getLocalizedString(ship, "pressUWhenReady"));
- }
- deadShip = function(ship){
- x = 0;
- y = 0;
- if(ship.custom.inrace){
- if(ship.custom.checkpoint == 0){
- x = checkpoints[0].x;
- y = checkpoints[0].y;
- }else{
- ch = ship.custom.checkpoint-1;
- x = checkpoints[ch].x;
- y = checkpoints[ch].y;
- }
- }else{
- x = sandboxArea.x;
- y = sandboxArea.y;
- }
- ship.set({x:x, y:y});
- }
- startingLine = function(ship){
- noActivityCountdown = noActivityTime;
- //get the direction to the first checkpoint, normalized
- dist = distance(firstCheckpointDir[0],firstCheckpointDir[1]);
- x = firstCheckpointDir[0]/dist;
- y = firstCheckpointDir[1]/dist;
- //launchvel represent the initial boop the ships experience when
- //the countdown is over
- launchvel = 40;
- //get a vector perpendicular to the direction to the first checkpoint
- perpY = x;
- perpX = -y;
- vx = 0;
- vy = 0;
- //launch the player as the race starts
- if(finalCountdown<1){
- raceStarted = true;
- racetime = 0;
- writeTextLarge(ship,"GO GO GO");
- vx = x*launchVel;
- vy = y*launchVel;
- }else
- //output the final countdown
- writeTextLarge(ship,""+finalCountdown);
- posInLine = ship.custom.gridPos%shipsInLine;
- line = Math.floor(ship.custom.gridPos/shipsInLine);
- //keep the player at the starting line
- ship.set({
- idle:true,
- x:checkpoints[0].x-perpX*(startingLinesWidth/2) + perpX*(startingLinesWidth)*(posInLine/(shipsInLine-1))+(-x*line*startingLinesDist),
- y:checkpoints[0].y-perpY*(startingLinesWidth/2) + perpY*(startingLinesWidth)*(posInLine/(shipsInLine-1))+(-y*line*startingLinesDist),
- vx:0,
- vy:0,
- angle:57.2958*firstCheckpointAngle
- });
- }
- shipNotInRace = function(ship){
- if(ship.custom.spectating>-1){
- if(game.ships[ship.custom.spectating].custom.inrace){
- ship.set({
- x:game.ships[ship.custom.spectating].x,
- y:game.ships[ship.custom.spectating].y,
- vx:game.ships[ship.custom.spectating].vx,
- vy:game.ships[ship.custom.spectating].vy,
- idle:true
- })
- }
- }
- //this ship either finished or just joined, tell them
- drawSpectateButton(ship, true);
- writeTextSmol(ship,getLocalizedString(ship, "waitAllPlayersFinish")+lastfinished+
- getLocalizedString(ship, "waitAllPlayersFinishSoFar") + DNFCountdown + getLocalizedString(ship, "seconds"));
- x = sandboxArea.x-ship.x;
- y = sandboxArea.y-ship.y;
- if(ship.custom.spectating==-1&&distance(x,y)>sandboxAreaSize)
- ship.set({
- score:0,
- x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
- y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
- });
- }
- randomizeNextTrack = function(){
- nt = nextTrack
- nextTrack = Math.floor(Math.random()*tracks.length);
- while(tracks.length>1&&nt==nextTrack){
- nextTrack = Math.floor(Math.random()*tracks.length);
- }
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- ship.custom.dislikeTrack = false;
- }
- log("Next race: "+tracks[nextTrack].name);
- }
- shipFinished = function(ship){
- if(raceinprogress){
- if(lastfinished==0)DNFCountdown = DNFTime;
- lastfinished++;
- if(lastfinished==1){top1time.name = ship.name; top1time.time = racetime;}
- if(lastfinished==2){top2time.name = ship.name; top2time.time = racetime;}
- if(lastfinished==3){top3time.name = ship.name; top3time.time = racetime;}
- }
- if(raceinprogress){
- writeTextLarge(ship,"Your place: "+lastfinished+" in "+racetime.toFixed(2)+"s");
- log("#"+lastfinished+" - "+ship.name+" - "+racetime + " s");
- }else{
- writeTextLarge(ship,"Did Not Finish");
- log("#"+lastfinished+" - "+ship.name+" - DNF");
- }
- changeScreen(ship, 0);
- updateScreen(ship)
- ship.custom.inrace=false;
- ship.custom.checkpoint = 0;
- ship.custom.lasttime = racetime;
- for (j=0;j<game.ships.length;j++)
- drawTopScores(game.ships[j], true);
- ship.set({score:(checkpoints.length*10000)-(lastfinished*1000)});
- }
- lobby = function(){
- //whether all players are ready
- ready = true;
- lastReadyAmount = readyAmount;
- //whether there's at least one fool that wants a race
- atLeastOnePlayer = false;
- readyAmount = 0;
- dislikedBy = 0;
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- ship.custom.spectating = -1;
- if(ship.custom.ignoreMod)continue;
- if(ship.custom.ignoreSelf)continue;
- //check if the ship is in range of starting checkpoint
- x = checkpoints[0].x-ship.x;
- y = checkpoints[0].y-ship.y;
- if(!ship.custom.ready){
- //if not, then clearly not all players are ready
- ready = false;
- if(countdownLong<longRaceStartTime-1)
- writeTextLarge(ship,getLocalizedString(ship, "raceStartsIn")+Math.max(countdown,countdownLong)+" - "+getLocalizedString(ship, "notReady"));
- else writeTextLarge(ship, "");
- continue;
- }else atLeastOnePlayer = true;//otherwise at least somebody's willing to race
- //countdownLong overrides countdown
- if(ship.custom.dislikeTrack)
- dislikedBy++;
- readyAmount++;
- if(countdownLong<countdown)countdown=countdownLong;
- //if the countdown is at maximum, we're probably still waiting for players
- if(countdown>=quickRaceStartTime-1)
- writeTextLarge(ship,getLocalizedString(ship, "waitingForPlayers")+countdownLong+" ("+lastReadyAmount+getLocalizedString(ship, "numberPlayersReady"));
- //otherwise we're starting soon
- if(countdown<quickRaceStartTime-1)writeTextLarge(ship,getLocalizedString(ship, "startingSoon")+countdown+getLocalizedString(ship, "startingSoonSeconds"));
- //if the countdown finished successfuly
- if(countdown<0||countdownLong<0){
- startRace();
- }
- }
- if(atLeastOnePlayer)countdownLong-=1; else{
- countdownLong = longRaceStartTime;
- }
- if(ready&&atLeastOnePlayer)countdown-=1; else{
- countdown = quickRaceStartTime;
- }
- }
- showBanners();
- this.tick = function(game) {
- if(game.ships.length<1)return;
- var i = 0;
- if(raceinprogress)
- racetime += 1/60;
- everySecond++;
- if(everySecond>60){
- everySecond-=60;
- adTimer++;
- if(adTimer>adRefreshTime){
- adTimer = 0;
- randomAd();
- }
- //ship initialization
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- if (!ship.custom.init){
- initShip(ship);
- }
- x = sandboxArea.x-ship.x;
- y = sandboxArea.y-ship.y;
- if(!ship.custom.inrace&&ship.custom.spectating==-1&&(!raceinprogress||distance(x,y)<=sandboxAreaSize))
- ship.set({type:101+ship.custom.type, stats:100011111});
- //no fighting for now
- //ship.set({invulnerable:400});
- if(!ship.alive){
- deadShip(ship);
- }
- if(ship.custom.ignoreMod){
- ship.set({score:0,x:cornerOfShame.x, y:cornerOfShame.y,idle:true})
- writeTextLarge(ship, getLocalizedString(ship, "shame"));
- }else{
- ship.set({idle:false});
- }
- if(ship.custom.ignoreSelf){
- writeTextLarge(ship, getLocalizedString(ship, "youreAFK"));
- }
- ship.custom.votekickCooldown--;
- }
- if(votekickCountdown>=0){
- if(votekickCountdown==0){
- votekickResult();
- }
- votekickCountdown--;
- }
- updatePlayersLog();
- //if there is a race going on
- if(raceinprogress){
- finalCountdown -= 1; //countdown at the start of the race
- noActivityCountdown -= 1;
- ready = true; //whether the race is over
- for (i=0;i<game.ships.length;i++) //iterate
- {
- ship = game.ships[i];
- if(!ship)continue;
- if(ship.custom.ignoreMod)continue;
- if(!ship.custom.inrace){
- shipNotInRace(ship);
- continue;
- }
- //there are still players racing, so we're not ready to end the race
- ready = false;
- //starting countdown
- if(finalCountdown>=0){
- startingLine(ship);
- }
- //update the race track minimap
- drawRaceTrack(ship, true);
- }
- if(lastfinished>0)DNFCountdown--;
- if(ready||(lastfinished>0&&DNFCountdown<0)||noActivityCountdown<0){
- if(ready)
- log("All players finished");
- else if(DNFCountdown<0) log("Race ends - timeout"); else
- log("Race ends - no activity");
- stopRace();
- }
- }else{
- if(dislikedBy>0.5*readyAmount){
- randomizeNextTrack();
- }
- lobby();
- }
- }
- if(game.step%1==0){
- if(raceinprogress){
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- if(!ship.custom.inrace)continue;
- //checkpoint execution
- ch = ship.custom.checkpoint;
- x = checkpoints[ch].x-ship.x;
- y = checkpoints[ch].y-ship.y;
- //if we're in range of the next checkpoint
- if(distance(x, y)<checkpointrange){
- //proceed to the next checkpoint
- ship.custom.checkpoint=ship.custom.checkpoint+1;
- if(ship.custom.lap>highestCheckpoint[0]){
- highestCheckpoint[0] = ship.custom.lap;
- highestCheckpoint[1] = ship.custom.checkpoint;
- }else if(ship.custom.lap==highestCheckpoint[0]&&ship.custom.checkpoint>highestCheckpoint[1]){
- highestCheckpoint[1] = ship.custom.checkpoint;
- }
- noActivityCountdown = noActivityTime;
- if(ship.custom.checkpoint>=checkpoints.length&&laps>0&&ship.custom.lap<laps){
- ship.custom.lap++;
- ship.custom.checkpoint = 0;
- }
- //if this is the last checkpoint
- if( ((laps>0)&&(ship.custom.lap==laps)&&(ship.custom.checkpoint==2)) ||
- ((laps==0)&&(ship.custom.checkpoint>=checkpoints.length)) ){
- shipFinished(ship);
- }else{
- ship.set({score:ship.custom.checkpoint*1000+checkpoints.length*ship.custom.lap*1000});
- writeTextLarge(ship," ");
- if(ship.custom.checkpoint > 1||ship.custom.lap>0){
- if(laps>0)
- lapText = " (lap "+(ship.custom.lap+1)+"/"+laps+")";
- if(ship.custom.lap!=laps)
- writeTextSmol(ship,"Checkpoint "+ ship.custom.checkpoint + "/"+checkpoints.length+lapText);
- else writeTextSmol(ship, "Almost there!");
- } else {
- writeTextSmol(ship,"Follow the red dot.");
- }
- }
- }
- }
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- if(!ship.custom.inrace)continue;
- if(ship.custom.lap==highestCheckpoint[0]&&ship.custom.checkpoint==highestCheckpoint[1])
- ship.set({stats:100000000});
- else ship.set({stats:100011111});
- }
- }
- }
- // do mod stuff here ; see documentation
- if (game.step%10==0) // ensure this is done only once per second
- {
- for (i=0;i<game.ships.length;i++)
- {
- ship = game.ships[i];
- if(!ship)continue;
- if(!ship.custom.inrace)continue;
- ch = ship.custom.checkpoint;
- if(ch>=checkpoints.length)continue;
- path = shortestPath(ship.x, ship.y, checkpoints[ch].x, checkpoints[ch].y);
- x = path[0];
- y = path[1];
- vis = true;
- if(distance(x, y)<checkpointrange)
- vis = false;
- xx = 25*x/distance(x, y);
- yy = 25*y/distance(x, y);
- ship.setUIComponent({
- id:"nextCh",
- position:[50+xx,50-yy,25,25],
- clickable: false,
- visible: vis,
- components: [
- { type:"round",position:[0,0,5,10],fill:"#ff0000",stroke:"#CDE",width:1}
- ]
- });
- }
- }
- };
- this.event = function(event,game) {
- switch (event.name)
- {
- case "ui_component_clicked":
- var ship = event.ship;
- var component = event.id;
- if(ship.custom.ignoreMod)return;
- if (component == "back"){
- previousScreen(ship);
- }
- if (component == "credits")
- {
- changeScreen(ship, 3);
- }
- if (component == "language")
- {
- ship.custom.localization++;
- if(ship.custom.localization>=localizations.length)
- ship.custom.localization = 0;
- updateScreen(ship);
- }
- if (component == "chooseShip")
- {
- changeScreen(ship, 1);
- }
- if (component == "nextship")
- {
- ship.custom.type++;
- if(ship.custom.type>=racingShipsAmount)
- ship.custom.type = 0;
- updateScreen(ship);
- }
- if (component == "prevship")
- {
- ship.custom.type--;
- if(ship.custom.type<0)
- ship.custom.type = racingShipsAmount-1;
- updateScreen(ship);
- }
- if (component == "chooseKick")
- {
- i = ship.custom.wantVotekick;
- if(ship.custom.votekickCooldown>0)
- ship.custom.wantVotekick = -1; else
- if(i==-1){
- istart=0;
- i=0;
- for(j=0;j<game.ships.length*2;j++){
- i++;
- if(i>=game.ships.length) i = 0;
- if(game.ships[i]!=ship/*&&!game.ships[i].custom.ignoreMod*/){
- ship.custom.wantVotekick = i;
- break;
- }
- if(i==istart){ship.custom.wantVotekick=-1;break;}
- }}else
- ship.custom.wantVotekick = -1;
- changeScreen(ship, 2);
- }
- if (component == "votekicknext")
- {
- i = ship.custom.wantVotekick;
- for(j=0;j<game.ships.length*2;j++){
- i++;
- if(i>=game.ships.length) i = 0;
- if(i==ship.custom.wantVotekick)break;
- if(game.ships[i]!=ship&&!game.ships[i].custom.ignoreMod){
- ship.custom.wantVotekick = i;
- break;
- }
- }
- updateScreen(ship);
- }
- if (component == "votekickprevious")
- {
- i = ship.custom.wantVotekick;
- for(j=0;j<game.ships.length*2;j++){
- i--;
- if(i<0) i = game.ships.length;
- if(i==ship.custom.wantVotekick)break;
- if(game.ships[i]!=ship&&!game.ships[i].custom.ignoreMod){
- ship.custom.wantVotekick = i;
- break;
- }
- }
- updateScreen(ship);
- }
- if (component == "proposeVotekick")
- {
- previousScreen(ship);
- if(ship.custom.votekickCooldown<0&&ship.custom.wantVotekick!=-1){
- log(ship.name+" wants to kick "+game.ships[ship.custom.wantVotekick].name);
- startVotekick(ship.custom.wantVotekick);
- ship.custom.votekickCooldown = votekickCooldownTime;
- }else{
- ship.custom.wantVotekick = -1;
- }
- }
- if (component == "noKick"){
- ship.custom.votekickVote = -1;
- drawVotekickVoteUI(ship, true);
- }
- if (component == "yesKick"){
- ship.custom.votekickVote = 1;
- drawVotekickVoteUI(ship, true);
- }
- if (component == "readyToggle"){
- ship.custom.ready = !ship.custom.ready;
- drawStatusButtons(ship, !ship.custom.inrace);
- }
- if (component == "ignoreMeToggle"){
- ship.custom.ignoreSelf = !ship.custom.ignoreSelf;
- drawStatusButtons(ship, !ship.custom.inrace);
- }
- if (component == "trackInfo"){
- ship.custom.dislikeTrack = !ship.custom.dislikeTrack;
- writeTrackInfo(ship, !ship.custom.inrace);
- }
- if (component == "spectateToggle"){
- if(!ship.custom.inrace){
- if(ship.custom.spectating == -1){
- for (i=0;i<game.ships.length;i++)
- {
- ship1 = game.ships[i];
- if(!ship1)continue;
- if(ship1.custom.inrace){
- ship.custom.spectating = i;
- break;
- }
- }
- ship.set({type:301});
- }else ship.custom.spectating = -1;
- }
- }
- if (component == "spectateNext"){
- if(!ship.custom.inrace&&ship.custom.spectating!=-1){
- i = ship.custom.spectating;
- for(j=0;j<game.ships.length*2;j++){
- i++;
- if(i>=game.ships.length) i = 0;
- if(i==ship.custom.spectating)break;
- if(game.ships[i].custom.inrace){
- ship.custom.spectating = i;
- break;
- }
- }
- }
- }
- break;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement