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:1,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" ;
- //ship info here
- 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,20],"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}}';
- ships = [];
- shipInfos = [];
- 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:"Chickenman's Coop", 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"});
- for(i =0;i<ships.length;i++){
- ships[i] = JSON.parse(ships[i]);
- ships[i].typespec.specs.shield.capacity = [1000,1000];
- ships[i] = JSON.stringify(ships[i]);
- }
- //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,
- asteroids_strength: 10,
- crystal_value: 0,
- radar_zoom: 1.5
- };
- if(customMap)
- this.options.custom_map = map;
- const map_size = mapSize*5; //the size of the map
- const checkpointrange = 40; //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;
- const shipsInLine = 2;
- const startingLinesWidth = 10;
- const startingLinesDist = 7;
- const noActivityTime = 30;
- 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;
- requestTrack = -1;
- requestLaps = -1;
- nextTrack = 0;
- 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/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/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/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/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/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/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/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/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/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/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/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/useries3.png"
- };
- banners.push(USeries1,USeries2,USeries3);
- noPassage = {
- id: "noPassage",
- obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
- emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/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/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"
- };
- 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}
- ]
- });
- };
- 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:[25,3,50,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}
- ]
- });
- }
- };
- 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:[60,50,40,25],
- 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}
- ]
- });
- };
- drawShipChooseButtons = function(ship, b){
- ship.setUIComponent(
- {id: "prevship",
- position: [2,40,8,14],
- clickable: b,
- shortcut: "W",
- visible: b,
- components: [
- { type:"round",position:[0,0,100,100],fill:"#456",stroke:"#CDE",width:2},
- { type: "text",position:[10,35,80,30],value:"Previous ship",color:"#CDE"},
- { type: "text",position:[20,70,60,20],value:"[W]",color:"#CDE"}
- ]
- }
- );
- ship.setUIComponent(
- {id: "nextship",
- position: [90,40,8,14],
- clickable: b,
- shortcut: "E",
- visible: b,
- components: [
- { type:"round",position:[0,0,100,100],fill:"#456",stroke:"#CDE",width:2},
- { type: "text",position:[10,35,80,30],value:"Next ship",color:"#CDE"},
- { type: "text",position:[20,70,60,20],value:"[E]",color:"#CDE"}
- ]
- }
- );
- }
- drawReadyButton = function(ship, b){
- color = "#AA0000";
- text = "NOT READY"
- if(ship.custom.ready){
- color = "#00AA00";
- text = "READY";
- }
- ship.setUIComponent(
- {id: "readyToggle",
- position: [5,20,8,14],
- clickable: b,
- shortcut: "U",
- visible: b,
- components: [
- { type:"round",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:"[U]",color:"#CDE"}
- ]
- }
- );
- }
- drawIgnoreMeButton = function(ship, b){
- color = "#00AA00";
- text = "NOT AFK"
- if(ship.custom.ignoreSelf){
- color = "#888888";
- text = "AFK";
- }
- ship.setUIComponent(
- {id: "ignoreMeToggle",
- position: [15,20,8,14],
- clickable: b,
- shortcut: "I",
- visible: b,
- components: [
- { type:"round",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:"[I]",color:"#CDE"}
- ]
- }
- );
- }
- writeShipInfo = function(ship, b){
- index = 0;
- index = ship.custom.type;
- if(index>=shipInfos.length)return;
- if(index<0)return;
- if(b)
- desc = shipInfos[index].desc.split("\n");
- UIDesc = [];
- 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:[4,50,50,50],
- clickable: false,
- visible: b,
- components: UIDesc
- });
- };
- 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,50],
- shortcut:"N",
- clickable: true,
- visible: b,
- components: [
- {type: "text",position: [0,0,100,7],color: "#FFFFFF",value: trackName},
- {type: "text",position: [0,10,100,7],color: dislikeCol,value: dislike}
- ]
- });
- };
- 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:"round",position:[0,0,size*2,size*2],fill:"#222222",stroke:"#CDE",width:1}, ]
- });
- };
- 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]);
- 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++){
- 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;
- 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}
- });
- }
- 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;
- shipsInRace++;
- startingGrid.push(i);
- ship.custom.lap = 0;
- ship.custom.inrace = true;
- ship.custom.checkpoint = 0;
- ship.custom.lasttime = -1;
- drawShipChooseButtons(ship, false);
- drawReadyButton(ship, false);
- drawIgnoreMeButton(ship, false);
- drawTopScores(ship, false);
- writeShipInfo(ship, false);
- writeTrackInfo(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;
- ship.custom.gridPos = i;
- }
- 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;
- drawRaceTrack(ship, false);
- ship.custom.checkpoint = 0;
- ship.custom.ready = false;
- drawReadyButton(ship, true);
- drawIgnoreMeButton(ship, true);
- writeTrackInfo(ship, true);
- ship.custom.inrace = false;
- ship.custom.dislikeTrack = false;
- writeTextSmol(ship,"Press U when ready.");
- }
- log("Race stopped.");
- }else{
- log("No race in progress");
- }
- }
- //direction from the start to the first checkpoint
- firstCheckpointDir = [];
- 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){
- //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.set({
- x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
- y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
- });
- drawReadyButton(ship, true);
- drawIgnoreMeButton(ship, true);
- writeTrackInfo(ship, true);
- //tell them what to do
- if(!raceinprogress) writeTextSmol(ship,"Press U when ready.");
- }
- if(!ship.custom.inrace)
- ship.set({type:101+ship.custom.type});
- //no fighting for now
- ship.set({invulnerable:400});
- if(!ship.alive){
- 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});
- }
- if(ship.custom.ignoreMod){
- ship.set({score:0,x:cornerOfShame.x, y:cornerOfShame.y,idle:true})
- writeTextLarge(ship, "SHAME");
- }else{
- ship.set({idle:false});
- }
- if(ship.custom.ignoreSelf){
- writeTextLarge(ship, "You're AFK. Press [I] to continue racing.");
- }
- }
- //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){
- //this ship either finished or just joined, tell them
- drawShipChooseButtons(ship, true);
- writeTextSmol(ship,"Wait until all players finish the race ("+lastfinished+" so far) or wait " + DNFCountdown + " seconds");
- x = sandboxArea.x-ship.x;
- y = sandboxArea.y-ship.y;
- if(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()
- })
- continue;
- }
- //there are still players racing, so we're not ready to end the race
- ready = false;
- //starting countdown
- if(finalCountdown>=0){
- 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
- });
- }
- //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){
- 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;
- }
- }
- //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;
- 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;
- writeTrackInfo(ship, true);
- if(!ship.custom.ready){
- //if not, then clearly not all players are ready
- ready = false;
- drawShipChooseButtons(ship, true);
- if(countdownLong<longRaceStartTime-1)
- writeTextLarge(ship,"Race starts in "+Math.max(countdown,countdownLong)+" - YOU ARE NOT READY [U]");
- else writeTextLarge(ship, "");
- continue;
- }else atLeastOnePlayer = true;//otherwise at least somebody's willing to race
- //countdownLong overrides countdown
- if(ship.custom.dislikeTrack)
- dislikedBy++;
- readyAmount++;
- writeTrackInfo(ship, true);
- if(countdownLong<countdown)countdown=countdownLong;
- //if the countdown is at maximum, we're probably still waiting for players
- if(countdown>=quickRaceStartTime-1)
- writeTextLarge(ship,"Waiting for other players... "+countdownLong+" ("+lastReadyAmount+" ready)");
- //otherwise we're starting soon
- if(countdown<quickRaceStartTime-1)writeTextLarge(ship,"Starting in "+countdown+" seconds...");
- //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;
- }
- }
- }
- 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;
- noActivityCountdown = noActivityTime;
- //if this is the last checkpoint
- if(ship.custom.checkpoint>=checkpoints.length){
- if(ship.custom.lap<laps-1){
- ship.custom.lap++;
- ship.custom.checkpoint = 0;
- }else{
- //if this is the first ship to finish, start the DNF countdown
- 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;}
- log("#"+lastfinished+" - "+racetime + " s");
- writeTextLarge(ship,"Your place: "+lastfinished+" in "+racetime.toFixed(2)+"s");
- 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)});
- }
- }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+")";
- writeTextSmol(ship,"Checkpoint "+ ship.custom.checkpoint + "/"+checkpoints.length+" "+lapText);
- } else {
- writeTextSmol(ship,"Follow the red dot.");
- }
- }
- }
- }
- }
- // 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 (component == "nextship")
- {
- ship.custom.type++;
- if(ship.custom.type>=ships.length)
- ship.custom.type = 0;
- writeShipInfo(ship, !ship.custom.inrace);
- }
- if (component == "prevship")
- {
- ship.custom.type--;
- if(ship.custom.type<0)
- ship.custom.type = ships.length-1;
- writeShipInfo(ship, !ship.custom.inrace);
- }
- if (component == "readyToggle"){
- ship.custom.ready = !ship.custom.ready;
- drawReadyButton(ship, !ship.custom.inrace);
- }
- if (component == "ignoreMeToggle"){
- ship.custom.ignoreSelf = !ship.custom.ignoreSelf;
- drawIgnoreMeButton(ship, !ship.custom.inrace);
- }
- if (component == "trackInfo"){
- ship.custom.dislikeTrack = !ship.custom.dislikeTrack;
- writeTrackInfo(ship, !ship.custom.inrace);
- }
- break;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement