Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 116.65 KB | None | 0 0
  1. //map info here
  2.  
  3. checkpoints = [];
  4.  
  5. tracks = [];
  6.  
  7. mapSeed = 144;
  8. mapSize = 60;
  9.  
  10. track1 = {checkpoints:[],roadblocks:[],laps:3,name:"rm -rf / circuit"};
  11. track1.checkpoints.push({x:30, y:40});
  12. track1.checkpoints.push({x:-10, y:40});
  13. track1.checkpoints.push({x:-25, y:-115});
  14. track1.checkpoints.push({x:-135, y:-115});
  15. track1.checkpoints.push({x:-265, y:-100});
  16. track1.checkpoints.push({x:-180, y:75});
  17. track1.checkpoints.push({x:-100, y:140});
  18. track1.checkpoints.push({x:75, y:115});
  19. track1.checkpoints.push({x:30, y:80});
  20. track1.roadblocks=[1,0,1, 0,0,0, 0,1,1,0];
  21.  
  22. tracks.push(track1);
  23.  
  24. track2 = {checkpoints:[],roadblocks:[],laps:0,name:"Sprint alpha"};
  25. track2.checkpoints.push({x:25, y:-185});
  26. track2.checkpoints.push({x:25, y:-130});
  27. track2.checkpoints.push({x:55, y:0});
  28. track2.checkpoints.push({x:165, y:0});
  29. track2.checkpoints.push({x:200, y:125});
  30. track2.checkpoints.push({x:-295, y:140});
  31. track2.checkpoints.push({x:-70, y:160});
  32. track2.checkpoints.push({x:80, y:120});
  33. track2.checkpoints.push({x:25, y:80});
  34. track2.checkpoints.push({x:55, y:40});
  35. track2.checkpoints.push({x:-15, y:-115});
  36. track2.checkpoints.push({x:-160, y:-80});
  37. track2.checkpoints.push({x:-270, y:-105});
  38. track2.checkpoints.push({x:-225, y:5});
  39. track2.roadblocks=[1,1,0, 1,1,1, 1,0,0,1, 1,1,1, 0,0,0, 0,0,1,1];
  40.  
  41. tracks.push(track2);
  42.  
  43. checkpoints = track1.checkpoints;
  44.  
  45. sandboxArea = {x:155, y:-150};
  46. cornerOfShame = {x:250, y:-150};
  47.  
  48. roadblocks = [];
  49.  
  50. roadblocks.push({x:5,y:-125,angle:Math.PI/2});
  51. roadblocks.push({x:55,y:-125,angle:Math.PI/2});
  52.  
  53. roadblocks.push({x:85,y:35,angle:Math.PI/2});
  54.  
  55. roadblocks.push({x:125,y:15,angle:0});
  56. roadblocks.push({x:115,y:15,angle:0});
  57.  
  58. roadblocks.push({x:125,y:-15,angle:0});
  59. roadblocks.push({x:115,y:-15,angle:0});
  60.  
  61. roadblocks.push({x:-75,y:155,angle:0});
  62. roadblocks.push({x:-65,y:155,angle:0});
  63.  
  64. roadblocks.push({x:-85,y:145,angle:Math.PI/2});
  65. roadblocks.push({x:-85,y:135,angle:Math.PI/2});
  66.  
  67. roadblocks.push({x:5,y:-245,angle:Math.PI/2});
  68.  
  69. roadblocks.push({x:185,y:5,angle:Math.PI/2});
  70.  
  71. roadblocks.push({x:165,y:15,angle:0});
  72. roadblocks.push({x:175,y:15,angle:0});
  73.  
  74. roadblocks.push({x:155,y:5,angle:Math.PI/2});
  75. roadblocks.push({x:155,y:-5,angle:Math.PI/2});
  76.  
  77. roadblocks.push({x:255,y:-55,angle:Math.PI/2});
  78.  
  79. roadblocks.push({x:285,y:125,angle:0});
  80. roadblocks.push({x:295,y:125,angle:0});
  81.  
  82. bannerPositions = [];
  83.  
  84. bannerPositions.push({x:25,y:-205});
  85. bannerPositions.push({x:-20,y:-110});
  86. bannerPositions.push({x:-95,y:-120});
  87. bannerPositions.push({x:-220,y:-120});
  88. bannerPositions.push({x:-120,y:60});
  89. bannerPositions.push({x:75,y:100});
  90. bannerPositions.push({x:120,y:0});
  91.  
  92. //noPassageSigns.push();
  93.  
  94. customMap = true;
  95. map =
  96. "999999999999999999999999999999999999999999999999999999999999\n"+
  97. "999999999999999999999999999999999999999999999999999999999999\n"+
  98. "999999999999999999999999999999999999999999999999999999999999\n"+
  99. "999999999999999999999999999999999999999999999999999999999999\n"+
  100. "999999999999999999999999999999999999999999999999999999999999\n"+
  101. "999999999999999999999999999999999999999999999999999999999999\n"+
  102. "999999999999999999999999999999999999999999999999999999999999\n"+
  103. "999999999999999999999999999999999999999999999999999999999999\n"+
  104. "999999999999999999999999999999999999999999999999999999999999\n"+
  105. "999999999999999999999999999999999999999999999999999999999999\n"+
  106. "999999999999999999999999999999999999999999999999999999999999\n"+
  107. "9999999 9 9 9999999999999999999999999999999999999\n"+
  108. "99999 999 99 9999999999999999999999999999999999999\n"+
  109. "99999 9999999999999 999999999999999999999999999999999999\n"+
  110. " 999 999999999999999 9999999999999999999999999999 99 \n"+
  111. " 99999999999999 9 9 999999999999999 999 \n"+
  112. " 9999999999993 22 99999999999 99 \n"+
  113. "99999999999999 3999 9 9 9 99999999 9 99 \n"+
  114. "99999999999993 9999 9999999999999999 9999999 9 999 9 \n"+
  115. "9999999999999299999 99999999999 999999 999 99 \n"+
  116. "99999999999 99 99999999999 999999 999999999 \n"+
  117. "99999999999 99 99999999999 99999999999 99999999 9\n"+
  118. "99999999999 99 99 99999999999 9999999 99999999 9\n"+
  119. "99999999 99 99999999999 9999999 99999999 9\n"+
  120. "99999999 99 999999999999999 99999999 99999999 9\n"+
  121. "99999999 99999999999999999 99999999 99999999 9\n"+
  122. "99999999 999999999999999993 4 999 99999999 9\n"+
  123. "99999999 399999999999999999 4 99999999999 999 99999999 9\n"+
  124. "999999 999999999999999994 399999999999 999 99999999 9\n"+
  125. "999999 99999999999999999 4 99 999999 9\n"+
  126. "999999 99999999999999999993 499 9 99999 9\n"+
  127. "9999993 9999999999999999999 4 99 99999 9999999 9999 9\n"+
  128. "999999 99999999999999999994 399 99999 99999999 999 9\n"+
  129. "999999 9999999999999999999 4 999 999999 999999999 99 9\n"+
  130. "999999 99999999999999999993 49992 999999 9999999 9 9\n"+
  131. "999999 49999999999999999999 4 993 9999999999 99999999 9\n"+
  132. "999999 99999999999999999994 399 199999999999 9999999999 9\n"+
  133. "999999 9993 39999999999 4 993 99999999999 9999999999 9\n"+
  134. "99 3 999 99999999993 4999 9999999999 9999999999 9\n"+
  135. "99 999 99 9999999999 4 999 19999999999 9999999999 9\n"+
  136. "99 9999999 99 999999999 4 399 9999999999 9999999999 9\n"+
  137. "99 99 99 219999993354 5345999999 9\n"+
  138. "99 5 99 11 3454999999 9\n"+
  139. "999999999999999999999999999999991 9999934543 3554399999 \n"+
  140. " 9999999999999999999999999999 9999994454 535999999999 \n"+
  141. " 999999999999999999999999999 99999994539 9445399999999\n"+
  142. "999 99999999999999999999999999 9999999459 3454999999999\n"+
  143. "9999 99999999999999999999999993 99999993455434599999999999\n"+
  144. "9999 9999999999999999999999999 99999999345345559999999999\n"+
  145. "9999 999999999999999999999999 9999999999999999999999999\n"+
  146. "9999 999999999999999999999999 9999999999999999999999999\n"+
  147. "9999 999999999999999999999999 9999999999999999999999999\n"+
  148. "9999 999999999999999 9999999999999999999999999\n"+
  149. "9999 9 9 999 9999999999999999999999999\n"+
  150. "99999999999999 9 9999999999999999999999999\n"+
  151. "999999999999999999999999999999999999999999999999999999999999\n"+
  152. "999999999999999999999999999999999999999999999999999999999999\n"+
  153. "999999999999999999999999999999999999999999999999999999999999\n"+
  154. "999999999999999999999999999999999999999999999999999999999999" ;
  155.  
  156. 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}}';
  157.  
  158. //ship info here
  159.  
  160. speedBuff = 10;
  161. dashSpeedBuff = 10;
  162. accelerationBuff = 1.05;
  163. dashAccelerationBuff = 1.05;
  164. energyRegenBuff = 1.25;
  165.  
  166. 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}}},'+
  167. '"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}}';
  168. 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}}},'+
  169. '"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}}';
  170. 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}}},'+
  171. '"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}}';
  172. 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]}},'+
  173. '"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}}';
  174. 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}}},'+
  175. '"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}}';
  176. 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}}},'+
  177. '"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}}';
  178. 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}}},'+
  179. '"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}}';
  180. 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]}},'+
  181. '"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}}';
  182. 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}}},'+
  183. '"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}}';
  184. 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}}},'+
  185. '"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}}';
  186. 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}}},'+
  187. '"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}}';
  188. 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}}},'+
  189. '"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}}';
  190. 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}}},'+
  191. '"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}}';
  192. 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}}},'+
  193. '"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}}';
  194. 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}}},'+
  195. '"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}}';
  196. 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}}},'+
  197. '"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}}';
  198. 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}}},'+
  199. '"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}}';
  200. 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}}},'+
  201. '"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}}';
  202.  
  203. ships = [];
  204. shipInfos = [];
  205.  
  206. racingShipsAmount = 18;
  207.  
  208. ships.push(Astral);
  209. shipInfos.push({company:"FinaDrive", creator:"Finalizer",
  210. desc:"Powerful boost, high cruising speed,\n amazing hot look. What else do you need?"});
  211.  
  212. ships.push(ShadowX1);
  213. shipInfos.push({company:"Starblast", creator:"pmgl",
  214. 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."});
  215.  
  216. ships.push(RADDiamondLancer);
  217. shipInfos.push({company:"RAD Diamond", creator:"UranusOrbiter",
  218. desc:"It might look a bit weird and feel sluggish, \nbut it's strength is it's boost tank. \nHold that dash button."});
  219.  
  220. ships.push(ZerdBooster);
  221. shipInfos.push({company:"ZerdTech", creator:"Revenge Zerd",
  222. desc:"Beautiful and powerful, this lovely rocket \ncan change. It's. Movement. Direction. Instantly."});
  223.  
  224. ships.push(LGViper);
  225. shipInfos.push({company:"Halo L.Starships", creator:"L.Gaming",
  226. desc:"A sleek, compact, fast ship capable of\n powerful overdrive allowing you to surpass your competition.\n Great handling although low thrust."});
  227.  
  228. ships.push(VoidA);
  229. shipInfos.push({company:"Abyss Racecraft ltd.", creator:"Void",
  230. desc:"Simple, nice-looking racing vehicle. \nNothing too fancy. \nDoes it's job well."});
  231.  
  232. ships.push(Starsurfer);
  233. shipInfos.push({company:"SpaceGGFlight", creator:"UranusOrbiter",
  234. 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."});
  235.  
  236. ships.push(ZerdTurbine);
  237. shipInfos.push({company:"ZerdTech", creator:"Revenge Zerd",
  238. 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."});
  239.  
  240. ships.push(Arrowhead);
  241. shipInfos.push({company:"T. T. Tun design bureau", creator:"Cmdre. T. T. Tun",
  242. 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."});
  243.  
  244. ships.push(SweptWingedRacecraft);
  245. shipInfos.push({company:"SCM Racing", creator:"SChickenMan",
  246. 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"});
  247.  
  248. ships.push(ShadowX2);
  249. shipInfos.push({company:"Starblast", creator:"pmgl",
  250. 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"});
  251.  
  252. ships.push(ShadowX2MKII);
  253. shipInfos.push({company:"MALEFOR MACHINATIONS", creator:"MALEFOR",
  254. 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!"});
  255.  
  256. ships.push(Thunderstorm);
  257. shipInfos.push({company:"Halo L.Starships", creator:"L.Gaming",
  258. 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."});
  259.  
  260. ships.push(Amalgam);
  261. shipInfos.push({company:"W115", creator:"Wikstorm115",
  262. desc:"Cute bulky racing vehicle with many capacitors,\n an efficient dash system, and \nreasonable maneuverability"});
  263.  
  264. ships.push(PrototypeT);
  265. shipInfos.push({company:"SCM Racing", creator:"SChickenMan",
  266. desc:"A simple spaceplane certified for racing.\n Lightweight wings and compact, \nstreamlined shape."});
  267.  
  268. ships.push(Piranha);
  269. shipInfos.push({company:"SCM Starfighters", creator:"SChickenMan",
  270. 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"});
  271.  
  272. ships.push(Vengar);
  273. shipInfos.push({company:"SCM Starfighters", creator:"SChickenMan",
  274. desc:"Beutiful and dangerous starfighter, \n stripped of it's weapons, which were \n replaced by large capacitors and \na dash system."});
  275.  
  276. ships.push(Bull);
  277. shipInfos.push({company:"SCM Starfighters", creator:"SChickenMan",
  278. 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."});
  279.  
  280. for(i =0;i<ships.length;i++){
  281. ships[i] = JSON.parse(ships[i]);
  282. ships[i].typespec.specs.shield.capacity = [1000,1000];
  283.  
  284. ships[i].typespec.specs.ship.speed[1]+=speedBuff;
  285. if(ships[i].typespec.specs.ship.dash!=undefined)
  286. ships[i].typespec.specs.ship.dash.speed[1]+=dashSpeedBuff;
  287.  
  288. ships[i].typespec.specs.ship.acceleration[1]*=accelerationBuff;
  289. if(ships[i].typespec.specs.ship.dash!=undefined)
  290. ships[i].typespec.specs.ship.dash.acceleration[1]*=dashAccelerationBuff;
  291. ships[i].typespec.specs.generator.reload[1]*=energyRegenBuff;
  292.  
  293. ships[i] = JSON.stringify(ships[i]);
  294. }
  295.  
  296. shipBuilders = [];
  297. for(i=0; i<shipInfos.length; i++){
  298. designedBy = -1;
  299. for(j=0; j<shipBuilders.length; j++){
  300. if(shipBuilders[j].name == shipInfos[i].creator){
  301. designedBy = j; break;
  302. }
  303. }
  304. if(designedBy==-1)
  305. shipBuilders.push({name:shipInfos[i].creator,shipAmount:1});
  306. else shipBuilders[designedBy].shipAmount++;
  307. }
  308.  
  309.  
  310. ships.push(Spectatorship)
  311.  
  312. //mod code - edit at your own risk
  313.  
  314. this.options = {
  315. // see documentation for options reference
  316. //root_mode: "survival",
  317. weapons_store: false,
  318. ships: ships,
  319. map_size: mapSize,
  320. map_id: mapSeed,
  321. crystal_value: 0,
  322. radar_zoom: 1.5,
  323. asteroids_strength: 1000000,
  324. invulnerable_ships: true
  325. };
  326.  
  327. if(customMap)
  328. this.options.custom_map = map;
  329.  
  330. const map_size = mapSize*5; //the size of the map
  331.  
  332. const checkpointrange = 25; //size of checkpoints
  333. const quickRaceStartTime = 20; //time it takes to start a race if all players are ready
  334. const longRaceStartTime = 60; //time it takes to start a race if some players are ready
  335. const DNFTime = 60; //did not finish time
  336. const finalCountdownTime = 10; //the final countdown before the race
  337. const sandboxAreaSize = 65;//size of the sandbox/waiting area
  338. const shipsInLine = 2;//how many ships per starting line
  339. const startingLinesWidth = 10;//width of the starting grid
  340. const startingLinesDist = 7;//distance between lines in starting grid
  341. const noActivityTime = 30;//if nobody picks up a checkpoint in this time, the race is over
  342. laps = 3;
  343.  
  344. raceinprogress = false; //whether there's a race going on
  345. racetime = 0; //race timer
  346. lastfinished = 0; //how many players finished
  347. countdown = quickRaceStartTime; //lobby countdown timer(all players ready)
  348. countdownLong = longRaceStartTime; //lobby countdown timer(some players ready)
  349. DNFCountdown = 0; //DNF timer
  350. noActivityCountdown = 0;//no activity timer
  351. finalCountdown = 0; //final countdown
  352. raceStarted = false; //whether the final countdown is finished
  353. everySecond = 0;
  354. dislikedBy = 0;
  355. readyAmount = 0;
  356.  
  357. const votekickTime = 20;//votekick system - voting time
  358. const votekickCooldownTime = 60;//how many seconds until another player can be votekicked
  359. votekickCountdown = -1;
  360. proposedVotekick = {id:-1, name:""};
  361.  
  362.  
  363. const playerLogFadeoutStart = 0.7;
  364. const playerLogFadeoutSpeed = 0.2;
  365. playersLog = []
  366. for(i=0;i<5;i++){
  367. playersLog.push({log:"",fade:0});
  368. }
  369.  
  370. requestTrack = -1;
  371. requestLaps = -1;
  372.  
  373. nextTrack = 0;
  374.  
  375. //direction from the start to the first checkpoint
  376. firstCheckpointDir = [];
  377. firstCheckpointAngle = 0;
  378.  
  379. highestCheckpoint = [-1, -1];
  380.  
  381. top1time = {name:"", time:-1};
  382. top2time = {name:"", time:-1};
  383. top3time = {name:"", time:-1};
  384.  
  385. ads = [];
  386. adTimer = 0;
  387. adRefreshTime = 5;
  388.  
  389. ads.push("Uranus Racing League by /u/UranusOrbiter aka Uranus_is_big#7833");
  390. ads.push("Uranus Racing League version 0.0003");
  391. ads.push("Have a nice day");
  392.  
  393. ads.push("Huge thanks to pmgl for making all of this possible");
  394. ads.push("Huge thanks to Starblast dev team for making all of this possible");
  395.  
  396. ads.push("Thanks to everybody who helped test this mod");
  397.  
  398. ads.push("Map created by rm -rf / and improved by Uranus");
  399. ads.push("Huge thanks to rm -rf / for creating this beautiful map");
  400.  
  401. ads.push("Huge thanks to SChickenMan for helping with ship balance");
  402.  
  403. banners = [];
  404.  
  405. RADDiamondLogo = {
  406. id: "RAD",
  407. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  408. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/RadDiamond.png"
  409. };
  410. banners.push(RADDiamondLogo);
  411.  
  412. RADDiamondLancer1 = {
  413. id: "RADL1",
  414. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  415. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/RAD%20DIAMOND%20LANCER%20ad1.png"
  416. };
  417. banners.push(RADDiamondLancer1);
  418.  
  419. RADDiamondLancer2 = {
  420. id: "RADL2",
  421. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  422. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/RAD%20DIAMOND%20LANCER%20ad2.png"
  423. };
  424. banners.push(RADDiamondLancer2);
  425.  
  426. SpaceGG = {
  427. id: "SPACEGG",
  428. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  429. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/SpaceGGFlight.png"
  430. };
  431. banners.push(SpaceGG);
  432.  
  433. ZerdTech = {
  434. id: "ZerdTech",
  435. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  436. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/ZerdTech.png"
  437. };
  438. banners.push(ZerdTech);
  439.  
  440. ECP1 = {
  441. id: "ECP1",
  442. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  443. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/lovethegameECP.png"
  444. };
  445. ECP2 = {
  446. id: "ECP2",
  447. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  448. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/starblastisfreeECP.png"
  449. };
  450. ECP3 = {
  451. id: "ECP3",
  452. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  453. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/havingFunECP.png"
  454. };
  455. ECP4 = {
  456. id: "ECP4",
  457. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  458. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/unclesamECP.png"
  459. };
  460. banners.push(ECP1, ECP2, ECP3, ECP4);
  461.  
  462. USeries1 = {
  463. id: "US1",
  464. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  465. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ships/useries1.png"
  466. };
  467. USeries2 = {
  468. id: "US2",
  469. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  470. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ships/useries2.png"
  471. };
  472. USeries3 = {
  473. id: "US3",
  474. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  475. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ships/useries3.png"
  476. };
  477. banners.push(USeries1,USeries2,USeries3);
  478.  
  479. LG = {
  480. id: "LG",
  481. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  482. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/ads/lgaming.png"
  483. };
  484. banners.push(LG);
  485.  
  486. doge1 = {
  487. id: "doge1",
  488. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  489. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/doge1.png"
  490. };
  491. doge2 = {
  492. id: "doge2",
  493. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  494. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/doge2.png"
  495. };
  496. doge3 = {
  497. id: "doge3",
  498. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  499. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/doge3.png"
  500. };
  501. banners.push(doge1, doge2, doge3);
  502.  
  503. noPassage = {
  504. id: "noPassage",
  505. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  506. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/noPassage.png",
  507. };
  508.  
  509. checkpoint = {
  510. id: "checkpoint",
  511. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  512. emissive: "https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/images/other/checkpoint.png"
  513. };
  514.  
  515. startline = {
  516. id: "startline",
  517. obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  518. emissive: "https://starblast.data.neuronality.com/mods/objects/startline.png"
  519. };
  520.  
  521. localizations = [];
  522.  
  523. loadLocalization = function(string){
  524. lines = string.split("\n");
  525. localization = {};
  526. for(i=0; i<lines.length-1; i+=2){
  527. localization[lines[i].trim().substring(1)] = lines[i+1];
  528. }
  529. localizations.push(localization);
  530. }
  531.  
  532. getHTTP = function(aUrl, aCallback) {
  533. var anHttpRequest = new XMLHttpRequest();
  534. anHttpRequest.onreadystatechange = function() {
  535. if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)
  536. aCallback(anHttpRequest.responseText);
  537. }
  538.  
  539. anHttpRequest.open( "GET", aUrl, true );
  540. anHttpRequest.send( null );
  541. }
  542.  
  543. getLocalizedString = function(ship, i){
  544. loc = ship.custom.localization;
  545. if(loc!=undefined&&loc>=0&&loc<localizations.length){
  546. ls = localizations[loc][i];
  547. if(ls == undefined) return "no transl";
  548. return ls;
  549. }else return "unkn locale";
  550. }
  551. en = "";
  552. ru = "";
  553. getHTTP("https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/loc_en.txt", function(k){
  554. en = k;loadLocalization(en);
  555. getHTTP("https://raw.githubusercontent.com/rvan-der/Starblast.io-modding/master/loc_ru.txt", function(k){ru = k;ru=decodeURIComponent(ru);loadLocalization(ru);});
  556. });
  557.  
  558. distance = function(x, y){
  559. return Math.sqrt(x*x+y*y);
  560. };
  561.  
  562. shortestPath = function(x1, y1, x2, y2){
  563.  
  564. shortestDist = 10000;
  565.  
  566.  
  567. coords = [];
  568.  
  569. xx = x2-x1;
  570. yy = y2-y1;
  571. coords.push(xx, yy);
  572. shortest = [xx, yy];
  573.  
  574. xx = x2+map_size*2-x1;
  575. yy = y2-y1;
  576. coords.push(xx, yy);
  577.  
  578. xx = x2-map_size*2-x1;
  579. yy = y2-y1;
  580. coords.push(xx, yy);
  581.  
  582. xx = x2-x1;
  583. yy = y2+map_size*2-y1;
  584. coords.push(xx, yy);
  585.  
  586. xx = x2-x1;
  587. yy = y2-map_size*2-y1;
  588. coords.push(xx, yy);
  589.  
  590.  
  591. xx = x2+map_size*2-x1;
  592. yy = y2+map_size*2-y1;
  593. coords.push(xx, yy);
  594.  
  595. xx = x2+map_size*2-x1;
  596. yy = y2-map_size*2-y1;
  597. coords.push(xx, yy);
  598.  
  599. xx = x2-map_size*2-x1;
  600. yy = y2+map_size*2-y1;
  601. coords.push(xx, yy);
  602.  
  603. xx = x2-map_size*2-x1;
  604. yy = y2-map_size*2-y1;
  605. coords.push(xx, yy);
  606.  
  607. for(var i = 0; i<9; i++){
  608. dist = distance(coords[i*2], coords[i*2+1]);
  609. if(dist<shortestDist){
  610. shortestDist = dist;
  611. shortest = [coords[i*2], coords[i*2+1]];
  612. }
  613. }
  614.  
  615. return shortest;
  616.  
  617. };
  618.  
  619. debugDrawAllRoadblocks = function(){
  620. game.removeObject();
  621. for(i=0; i<roadblocks.length; i++){
  622. game.setObject({
  623. id:"np"+i,
  624. type:noPassage,
  625. position:{x:roadblocks[i].x, y:roadblocks[i].y,z:-2},
  626. scale:{x:12,y:12,z:12},
  627. rotation: {x:Math.PI,y:0,z:roadblocks[i].angle}
  628. });
  629. }
  630. }
  631.  
  632. debugFindClosestRoadblockIndex = function(shipindex){
  633. closestDist = map_size*2;
  634. closest = -1;
  635. ship = game.ships[shipindex];
  636. for(i=0; i<roadblocks.length; i++){
  637.  
  638. shortest = shortestPath(ship.x,ship.y,roadblocks[i].x,roadblocks[i].y);
  639. if(distance(shortest[0],shortest[1])<closestDist){
  640. closestDist = distance(shortest[0],shortest[1]);
  641. closest = i;
  642. }
  643. }
  644. return closest;
  645.  
  646.  
  647. }
  648.  
  649. shamePlayer = function(shipindex){
  650. game.ships[shipindex].custom.ignoreMod = true;
  651. log(game.ships[shipindex].name + " is now in the corner of shame.");
  652. }
  653.  
  654. unshamePlayer = function(shipindex){
  655. game.ships[shipindex].custom.ignoreMod = false;
  656. log(game.ships[shipindex].name + " has been unshamed.");
  657. game.ships[shipindex].set({x:sandboxArea.x, y:sandboxArea.y});
  658. }
  659.  
  660. playerList = function(){
  661. log("List of players:");
  662. for(i=0; i<game.ships.length; i++){
  663. log("game.ships["+i + "]: "+game.ships[i].name);
  664. }
  665. }
  666.  
  667. writeTextLarge = function(ship, string){
  668. ship.setUIComponent({
  669. id:"largeText",
  670. position:[25,25,50,25],
  671. clickable: false,
  672. visible: true,
  673. components: [
  674. { type: "text",position: [0,0,100,100],color: "#FFFFFF",value: string}
  675. ]
  676. });
  677.  
  678.  
  679. };
  680.  
  681. writeTextSmol = function(ship, string){
  682. ship.setUIComponent({
  683. id:"smolText",
  684. position:[25,10,50,25],
  685. clickable: false,
  686. visible: true,
  687. components: [
  688. { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: string}
  689. ]
  690. });
  691. };
  692.  
  693. updatePlayersLog = function(){
  694.  
  695. comps = [];
  696.  
  697. for(i=0;i<playersLog.length;i++){
  698. fade = Math.min(playersLog[i].fade/playerLogFadeoutStart,1.0);
  699. playersLog[i].fade -= playerLogFadeoutSpeed;
  700. if(fade<0)continue;
  701. 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});
  702. }
  703.  
  704. for (i=0;i<game.ships.length;i++)
  705. {
  706. game.ships[i].setUIComponent({
  707. id:"log",
  708. position:[25,70,50,20],
  709. clickable: false,
  710. visible: true,
  711. components: comps
  712. });
  713.  
  714. }
  715. };
  716.  
  717. addPlayersLog = function(string){
  718. playersLog.shift();
  719. playersLog.push({log:string,fade:1.0});
  720. }
  721.  
  722. randomAd = function(){
  723. adIndex = Math.floor(Math.random()*ads.length);
  724. ad = ads[adIndex];
  725. if(Math.random()<0.5){
  726. shipIndex = Math.floor(Math.random()*shipInfos.length);
  727. if(shipInfos[shipIndex].creator != "UranusOrbiter"){
  728. name = JSON.parse(ships[shipIndex]).name;
  729. ad = "Huge thanks to "+shipInfos[shipIndex].creator+" for his "+name+" design";
  730. }
  731. }
  732.  
  733. for (i=0;i<game.ships.length;i++)
  734. {
  735. game.ships[i].setUIComponent({
  736. id:"ad",
  737. position:[30,3,40,25],
  738. clickable: false,
  739. visible: true,
  740. components: [
  741. { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: ad}
  742. ]
  743. });
  744. }
  745. };
  746.  
  747. showBanners = function(){
  748. for(i = 0; i<bannerPositions.length; i++){
  749. index = Math.floor(Math.random()*banners.length);
  750. game.setObject({
  751. id:"banner"+i,
  752. type:banners[index],
  753. position:{x:bannerPositions[i].x, y:bannerPositions[i].y,z:-4},
  754. scale:{x:20,y:20,z:20},
  755. rotation: {x:Math.PI,y:0,z:0}
  756. });
  757. }
  758.  
  759. }
  760.  
  761. announce = function(string){
  762. for (i=0;i<game.ships.length;i++)
  763. {
  764. ship = game.ships[i];
  765. ship.setUIComponent({
  766. id:"announceText",
  767. position:[25,45,50,25],
  768. clickable: false,
  769. visible: true,
  770. components: [
  771. { type: "text",position: [0,0,100,20],color: "#FFBBBB",value: string}
  772. ]
  773. });
  774.  
  775. }
  776. };
  777.  
  778. drawButton = function(ship, x, y, id, fill, visible, shortcut, text){
  779. components = [];
  780. if(visible)
  781. components = [
  782. { type:"box",position:[0,0,100,100],fill:fill,stroke:"#CDE",width:2},
  783. { type: "text",position:[10,15,80,30],value:text,color:"#CDE"},
  784. { type: "text",position:[20,40,60,40],value:"["+shortcut+"]",color:"#CDE"}
  785. ]
  786. ship.setUIComponent(
  787. {id: id,
  788. position: [x,y,8,12],
  789. clickable: visible,
  790. shortcut: shortcut,
  791. visible: visible,
  792. components: components
  793. }
  794. );
  795. }
  796.  
  797. log = function(string){
  798. game.modding.terminal.echo(string);
  799. }
  800.  
  801. drawTopScores = function(ship, b){
  802. sc1 = "#1 - ";
  803. sc2 = "#2 - ";
  804. sc3 = "#3 - "
  805. if(top1time.time>=0)sc1+=top1time.name+" - "+top1time.time.toFixed(2);
  806. if(top2time.time>=0)sc2+=top2time.name+" - "+top2time.time.toFixed(2);
  807. if(top3time.time>=0)sc3+=top3time.name+" - "+top3time.time.toFixed(2);
  808.  
  809. if(ship.custom.lasttime>=0)
  810. yourLastTime = "your time: " + ship.custom.lasttime.toFixed(2);
  811. else
  812. yourLastTime = "your time: N/A";
  813.  
  814. ship.setUIComponent({
  815. id:"topscores",
  816. position:[50,80,40,20],
  817. clickable: false,
  818. visible: b,
  819. components: [
  820. { type: "text",position: [0,0,100,20],color: "#FFFF33",value: sc1},
  821. { type: "text",position: [0,20,100,20],color: "#BBBBBB",value: sc2},
  822. { type: "text",position: [0,40,100,20],color: "#FFAA33",value: sc3},
  823. { type: "text",position: [0,80,100,20],color: "#FFFFFF",value: yourLastTime}
  824. ]
  825. });
  826.  
  827. };
  828.  
  829. shipChooseScreen = function(ship, b){
  830.  
  831. text = getLocalizedString(ship, "back");
  832. change = ship.custom.UIScreen == 1;
  833. mainscreen = ship.custom.UIScreen == 0;
  834.  
  835. drawButton(ship, 12, 45, "back", "#33333370", b, "X", text);
  836.  
  837. drawButton(ship, 2, 45, "prevship", "#33333370", b, "W", getLocalizedString(ship, "pship"));
  838. drawButton(ship, 90, 45, "nextship", "#33333370", b, "E", getLocalizedString(ship, "nship"));
  839.  
  840. index = 0;
  841.  
  842. index = ship.custom.type;
  843. if(index>=shipInfos.length)return;
  844. if(index<0)return;
  845.  
  846. if(b)
  847. desc = shipInfos[index].desc.split("\n");
  848.  
  849. UIDesc = [{ type:"box",position:[0,0,100,100],fill:"#33333370",stroke:"#CDE",width:2}];
  850.  
  851. if(b)
  852. UIDesc.push(
  853. { type: "text",position: [0,0,100,10],color: "#3333AA",value: shipInfos[index].company},
  854. { type: "text",position: [0,10,100,20],color: "#FFFFFF",value: JSON.parse(ships[index]).name},
  855. { type: "text",position: [0,30,100,10],color: "#AAAAAA",value: "by "+shipInfos[index].creator},
  856. );
  857.  
  858. if(b)
  859. for(i = 0; i<desc.length; i++){
  860. UIDesc.push(
  861. { type: "text",position: [0,40+i*10,100,7],color: "#FFFFFF",value: desc[i]}
  862. );
  863. }
  864.  
  865. ship.setUIComponent({
  866. id:"shipInfo",
  867. position:[2,60,50,38],
  868. clickable: false,
  869. visible: b,
  870. components: UIDesc
  871. });
  872.  
  873. }
  874.  
  875. votekickScreen = function(ship, b){
  876.  
  877. text = getLocalizedString(ship, "back");
  878. kickId =ship.custom.wantVotekick;
  879.  
  880. drawButton(ship, 12, 60, "back", "#33333370", b, "X", text);
  881.  
  882. drawButton(ship, 2, 60, "votekicknext", "#33333370", b, "W", "Previous player");
  883. drawButton(ship, 70, 60, "votekickprevious", "#33333370", b, "E", "Next player");
  884. kickText = "ERROR";
  885. if(kickId!=-1)kickText = getLocalizedString(ship, "proposeKick")+game.ships[kickId].name;
  886.  
  887. drawButton(ship, 45, 60, "proposeVotekick", "#33333370", b, "Y", kickText);
  888.  
  889. }
  890.  
  891. creditsScreen = function(ship, b){
  892.  
  893. text = getLocalizedString(ship, "back");
  894. drawButton(ship, 12, 60, "back", "#33333370", b, "X", text);
  895.  
  896. getText = function(x, y, sx, sy, value){
  897. return { type: "text",position:[x,y,sx,sy],value:value,color:"#CDE"};
  898. }
  899.  
  900. comps = [];
  901. comps.push({ type:"box",position:[0,0,100,100],fill:"#33333370",stroke:"#CDE",width:2});
  902. comps.push(getText(0,5,100,10,"Uranus Racing League"));
  903. comps.push(getText(0,15,100,5,"Mod developed by /u/UranusOrbiter aka Uranus_is_big#7833"));
  904. comps.push(getText(0,20,100,5,"with help of many members of the Starblast community"));
  905. comps.push(getText(0,30,100,5,"The amazing ship builders: "));
  906.  
  907. shipBuildersText = "";
  908. for(i=0; i<shipBuilders.length; i++){
  909. s = "";
  910. if(shipBuilders[i].shipAmount>1)s="s";
  911. shipBuildersText += shipBuilders[i].name + "("+shipBuilders[i].shipAmount+" ship"+s+"), ";
  912. if((i+1)%3==0){comps.push(
  913. getText(0,35+(((i+1)/3)-1)*5,100,5,shipBuildersText));
  914. shipBuildersText = "";
  915. }
  916. }
  917.  
  918. ship.setUIComponent(
  919. {id: "creditsWindow",
  920. position: [25,30,50,60],
  921. clickable: false,
  922. visible: b,
  923. components: comps/*[
  924. { type:"box",position:[0,0,100,100],fill:"#33333370",stroke:"#CDE",width:2},
  925. { type: "text",position:[0,5,100,10],value:,color:"#CDE"},
  926. { type: "text",position:[0,15,100,5],value:"Mod developed by /u/UranusOrbiter aka Uranus_is_big#7833",color:"#CDE"},
  927. { type: "text",position:[0,20,100,5],value:"with help of many members of the Starblast community",color:"#CDE"},
  928. { type: "text",position:[0,25,100,40],value:"and the amazing ship builders: "+shipBuildersText,color:"#CDE"},
  929. { type: "text",position:[0,90,100,5],value:"From Ukraine with love. <3",color:"#CDE"},
  930.  
  931. ]*/
  932.  
  933. }
  934. );
  935.  
  936. }
  937.  
  938. drawVotekickVoteUI = function(ship, b){
  939. color1 = "#AAAAAA70";
  940. color2 = "#AAAAAA70";
  941. if(ship.custom.votekickVote<0)
  942. color2 = "#33FF3370";
  943. if(ship.custom.votekickVote>0)
  944. color1 = "#FF333370";
  945. drawButton(ship, 70, 2, "yesKick", color1, b, "Y", getLocalizedString(ship, "kickPlayer")+proposedVotekick.name);
  946. drawButton(ship, 70, 14, "noKick", color2, b, "T", getLocalizedString(ship, "dontKickPlayer"));
  947. }
  948.  
  949. drawStatusButtons = function(ship, b){
  950. color = "#AA000090";
  951. text = getLocalizedString(ship, "notReady");
  952. if(ship.custom.ready){
  953. color = "#00AA0040";
  954. text = getLocalizedString(ship, "ready");
  955. }
  956.  
  957. drawButton(ship, 2, 29, "readyToggle", color, b, "U", text);
  958.  
  959. color = "#00AA0040";
  960. text = getLocalizedString(ship, "notAFK");
  961. if(ship.custom.ignoreSelf){
  962. color = "#88888890";
  963. text = getLocalizedString(ship, "AFK");;
  964. }
  965.  
  966. drawButton(ship, 12, 29, "ignoreMeToggle", color, b, "I", text);
  967.  
  968. }
  969.  
  970. drawSpectateButton = function(ship, b){
  971. color = "#0000AA";
  972. text = "SPECTATE"
  973. if(ship.custom.spectating!=-1){
  974. color = "#00AA00";
  975. text = "RETURN";
  976. }
  977.  
  978. ship.setUIComponent(
  979. {id: "spectateToggle",
  980. position: [25,20,8,14],
  981. clickable: b,
  982. shortcut: "L",
  983. visible: b,
  984. components: [
  985. { type:"box",position:[0,0,100,100],fill:color,stroke:"#CDE",width:2},
  986. { type: "text",position:[10,35,80,30],value:text,color:"#CDE"},
  987. { type: "text",position:[20,70,60,20],value:"[L]",color:"#CDE"}
  988. ]
  989.  
  990. }
  991. );
  992.  
  993. ship.setUIComponent(
  994. {id: "spectateNext",
  995. position: [35,20,8,14],
  996. clickable: ship.custom.spectating!=-1,
  997. shortcut: "K",
  998. visible: ship.custom.spectating!=-1,
  999. components: [
  1000. { type:"box",position:[0,0,100,100],fill:color,stroke:"#CDE",width:2},
  1001. { type: "text",position:[10,35,80,30],value:"SPECTATE NEXT",color:"#CDE"},
  1002. { type: "text",position:[20,70,60,20],value:"[K]",color:"#CDE"}
  1003. ]
  1004.  
  1005. }
  1006. );
  1007. }
  1008.  
  1009. writeTrackInfo = function(ship, b){
  1010.  
  1011. trackName = tracks[nextTrack].name + ", "+tracks[nextTrack].laps+" laps";
  1012.  
  1013. dislike = "Press [N] to dislike this track";
  1014. dislikeCol = "#FFFFFF";
  1015. if(ship.custom.dislikeTrack){
  1016. if(dislikedBy>1)
  1017. dislike = "You and "+(dislikedBy-1)+" people dislike this track [N]"
  1018. else "You dislike this track [N]";
  1019. dislikeCol = "#FFAAAA";
  1020. }
  1021. if(!ship.custom.ready){
  1022. dislike = "You are not ready and cannot vote."
  1023. dislikeCol = "#AAAAAA";
  1024. }
  1025.  
  1026. ship.setUIComponent({
  1027. id:"trackInfo",
  1028. position:[75,30,25,5],
  1029. shortcut:"N",
  1030. clickable: true,
  1031. visible: b,
  1032. components: [
  1033. {type: "text",position: [0,0,100,50],color: "#FFFFFF",value: trackName},
  1034. {type: "text",position: [0,50,100,50],color: dislikeCol,value: dislike}
  1035. ]
  1036. });
  1037.  
  1038. };
  1039.  
  1040. mainScreen = function(ship, b){
  1041. text = getLocalizedString(ship, "chooseShip");
  1042. drawButton(ship, 2, 45, "chooseShip", "#33333370", b, "S", text);
  1043. text = getLocalizedString(ship, "votekick");
  1044. if(ship.custom.votekickCooldown>0) text = "Wait "+ship.custom.votekickCooldown+"s";
  1045. drawButton(ship, 2, 60, "chooseKick", "#33333370", b, "K", text);
  1046. text = getLocalizedString(ship, "credits");
  1047. drawButton(ship, 2, 75, "credits", "#33333370", b, "C", text);
  1048. text = getLocalizedString(ship, "changeLanguage");
  1049. drawButton(ship, 12, 75, "language", "#33333370", b, "Q", text);
  1050. //writeTrackInfo(ship, b);
  1051. }
  1052.  
  1053. setScreen = function(ship, i, b){
  1054. switch(i){
  1055. case 0: mainScreen(ship, b); break;
  1056. case 1: shipChooseScreen(ship, b); break;
  1057. case 2: votekickScreen(ship, b); break;
  1058. case 3: creditsScreen(ship, b); break;
  1059. }
  1060. }
  1061.  
  1062. updateScreen = function(ship){
  1063. setScreen(ship, ship.custom.UIScreen, true);
  1064. }
  1065.  
  1066. changeScreen = function(ship,i){
  1067. j = ship.custom.UIScreen;
  1068. setScreen(ship, i, true);
  1069. ship.custom.UIScreen = i;
  1070. setScreen(ship, j, false);
  1071. }
  1072.  
  1073. previousScreen = function(ship){
  1074. setScreen(ship, ship.custom.UIScreen, false);
  1075. switch(ship.custom.UIScreen){
  1076. case 0: break;
  1077. case 1:
  1078. setScreen(ship, 0, true);
  1079. ship.custom.UIScreen = 0;
  1080. break;
  1081. case 2:
  1082. setScreen(ship, 0, true);
  1083. ship.custom.UIScreen = 0;
  1084. break;
  1085. case 3:
  1086. setScreen(ship, 0, true);
  1087. ship.custom.UIScreen = 0;
  1088. break;
  1089. }
  1090. }
  1091.  
  1092. drawRaceTrack = function(ship, b){
  1093.  
  1094. positionX = 85;
  1095. positionY = 30;
  1096.  
  1097. size = 10;
  1098.  
  1099.  
  1100.  
  1101. ship.setUIComponent({
  1102. id:"playerMarker",
  1103. position:[positionX, positionY,25,25],
  1104. clickable: false,
  1105. visible: b,
  1106. components: [
  1107. { type:"round",position:[0,0,3,4],fill:"#777777",stroke:"#CDE",width:1}
  1108. ]
  1109. });
  1110.  
  1111. for(var i = 0; i<checkpoints.length; i++){
  1112.  
  1113. path = shortestPath(ship.x, ship.y, checkpoints[i].x, checkpoints[i].y);
  1114. x = path[0];
  1115. y = path[1];
  1116.  
  1117. chX = x/map_size;
  1118. chY = y/map_size;
  1119.  
  1120. fill = "#00ff00";
  1121. if(i<ship.custom.checkpoint)
  1122. fill = "#aaaaaa";
  1123. else if (i==ship.custom.checkpoint)
  1124. fill = "#ff0000";
  1125. else if (i==ship.custom.checkpoint+1)
  1126. fill = "#3333ff";
  1127. else if (i==checkpoints.length)
  1128. fill = "#ffffff";
  1129.  
  1130. ship.setUIComponent({
  1131. id:"ch"+i,
  1132. position:[positionX + chX*size, positionY - chY*size,25,25],
  1133. clickable: false,
  1134. visible: b,
  1135. components: [
  1136. { type:"round",position:[0,0,5,8],fill:fill,stroke:"#CDE",width:1}
  1137. ]
  1138. });
  1139.  
  1140. }
  1141.  
  1142. ship.setUIComponent({
  1143. id:"minimap",
  1144. position:[positionX-size, positionY-size,100,100],
  1145. clickable: false,
  1146. visible: b,
  1147. components: [
  1148. { type:"box",position:[0,0,size*2,size*2],fill:"#222222",stroke:"#CDE",width:1}, ]
  1149. });
  1150.  
  1151. };
  1152.  
  1153. votekickResult = function(){
  1154. kickResult = 0;
  1155. kickNeeded = 0;
  1156. for (i=0;i<game.ships.length;i++)
  1157. {
  1158. ship = game.ships[i];
  1159. if(ship.custom.votekickVote!=0){
  1160. if(ship.custom.votekickVote>0)kickResult += 1;
  1161. if(ship.custom.votekickVote<0)kickResult -= 0.5;
  1162. kickNeeded += 0.5;
  1163. }
  1164. drawVotekickVoteUI(ship, false);
  1165. }
  1166. if(kickResult >= kickNeeded&&game.ships[proposedVotekick.id].name == proposedVotekick.name){
  1167. shamePlayer(proposedVotekick.id);
  1168. addPlayersLog("Kicked "+proposedVotekick.name+" ("+kickResult+"/"+kickNeeded+")");
  1169. }else{
  1170. addPlayersLog("Votekick failed"+" ("+kickResult+"/"+kickNeeded+")");
  1171. }
  1172. }
  1173.  
  1174. startVotekick = function(id){
  1175. if(!(proposedVotekick.id<0||proposedVotekick.id>=game.ships.length||game.ships[proposedVotekick].name!=proposedVotekick.name))return;
  1176. proposedVotekick.id = id;
  1177. proposedVotekick.name = game.ships[id].name;
  1178. for (i=0;i<game.ships.length;i++)
  1179. {
  1180. ship = game.ships[i];
  1181. ship.custom.votekickVote = 0;
  1182. drawVotekickVoteUI(ship, true);
  1183. }
  1184. votekickCountdown = votekickTime;
  1185. addPlayersLog("Want to kick "+proposedVotekick.name+"?");
  1186. }
  1187.  
  1188. startRace = function(){
  1189. if(!raceinprogress){
  1190. game.removeObject();
  1191.  
  1192. showBanners();
  1193.  
  1194. if(requestTrack==-1)
  1195. trackId = nextTrack;
  1196. else trackId = requestTrack;
  1197.  
  1198. if(requestLaps==-1)
  1199. laps = tracks[trackId].laps;
  1200. else laps = requestLaps;
  1201.  
  1202. checkpoints = tracks[trackId].checkpoints;
  1203. firstCheckpointDir = shortestPath(checkpoints[0].x, checkpoints[0].y, checkpoints[1].x, checkpoints[1].y);
  1204. firstCheckpointAngle = Math.atan2(firstCheckpointDir[0], firstCheckpointDir[1]);
  1205.  
  1206. highestCheckpoint = [-1, -1];
  1207.  
  1208. game.setObject({
  1209. id:"start",
  1210. type:startline,
  1211. position:{x:checkpoints[0].x, y:checkpoints[0].y,z:-2},
  1212. scale:{x:15,y:15,z:15},
  1213. rotation: {x:0,y:0,z:firstCheckpointAngle}
  1214. });
  1215.  
  1216. for(i=1; i<checkpoints.length; i++){
  1217. if(i==checkpoints.length-1&&laps==0){
  1218. lastCheckpointDir = shortestPath(checkpoints[i-1].x, checkpoints[i-1].y, checkpoints[i].x, checkpoints[i].y);
  1219. lastCheckpointAngle = Math.atan2(lastCheckpointDir[0], lastCheckpointDir[1]);
  1220. game.setObject({
  1221. id:"finish",
  1222. type:startline,
  1223. position:{x:checkpoints[i].x, y:checkpoints[i].y,z:-2},
  1224. scale:{x:15,y:15,z:15},
  1225. rotation: {x:0,y:0,z:lastCheckpointAngle}
  1226. });
  1227. }else
  1228. game.setObject({
  1229. id:"ch"+i,
  1230. type:checkpoint,
  1231. position:{x:checkpoints[i].x, y:checkpoints[i].y,z:-2},
  1232. scale:{x:15,y:15,z:15},
  1233. rotation: {x:Math.PI,y:0,z:0}
  1234. });
  1235. }
  1236.  
  1237. for(i=0; i<tracks[trackId].roadblocks.length; i++){
  1238. if(i>=roadblocks.length)break;
  1239. if(tracks[trackId].roadblocks[i]==0)continue;
  1240. direction = [Math.sin(roadblocks[i].angle),Math.cos(roadblocks[i].angle)];
  1241. direction[0]*=3;
  1242. direction[1]*=3;
  1243. game.setObject({
  1244. id:"np"+i,
  1245. type:noPassage,
  1246. position:{x:roadblocks[i].x+direction[0], y:roadblocks[i].y+direction[1],z:-2},
  1247. scale:{x:12,y:12,z:12},
  1248. rotation: {x:Math.PI/2,y:roadblocks[i].angle,z:Math.PI}
  1249. });
  1250. game.setObject({
  1251. id:"npb"+i,
  1252. type:noPassage,
  1253. position:{x:roadblocks[i].x-direction[0], y:roadblocks[i].y-direction[1],z:-2},
  1254. scale:{x:12,y:12,z:12},
  1255. rotation: {x:Math.PI/2,y:roadblocks[i].angle+Math.PI,z:Math.PI}
  1256. });
  1257. }
  1258.  
  1259. lastfinished = 0;
  1260. raceinprogress = true;
  1261. raceStarted = false;
  1262. finalCountdown=finalCountdownTime;
  1263. DNFCountdown = DNFTime;
  1264.  
  1265. top1time.time = -1;
  1266. top2time.time = -1;
  1267. top3time.time = -1;
  1268.  
  1269. shipsInRace=0;
  1270. startingGrid=[];
  1271.  
  1272. for (i=0;i<game.ships.length;i++)
  1273. {
  1274. ship = game.ships[i];
  1275. if(!ship)continue;
  1276. if(!ship.custom.ready)continue;
  1277. if(ship.custom.ignoreMod)continue;
  1278. if(ship.custom.ignoreSelf)continue;
  1279. drawSpectateButton(ship, false);
  1280. shipsInRace++;
  1281. startingGrid.push(i);
  1282. ship.custom.lap = 0;
  1283. ship.custom.inrace = true;
  1284. ship.custom.checkpoint = 0;
  1285. ship.custom.lasttime = -1;
  1286. drawStatusButtons(ship, false);
  1287. drawTopScores(ship, false);
  1288. changeScreen(ship,0);
  1289. mainScreen(ship,false)
  1290. }
  1291.  
  1292. while(Math.random()>0.01){
  1293. i1 = Math.floor(Math.random()*startingGrid.length);
  1294. i2 = Math.floor(Math.random()*startingGrid.length);
  1295. buffer = startingGrid[i1];
  1296. startingGrid[i1] = startingGrid[i2];
  1297. startingGrid[i2] = buffer;
  1298. }
  1299.  
  1300. for (i=0;i<startingGrid.length;i++)
  1301. {
  1302. ship = game.ships[startingGrid[i]];
  1303. if(!ship)continue;
  1304. if(!ship.custom.ready)continue;
  1305. if(ship.custom.ignoreMod)continue;
  1306. if(ship.custom.ignoreSelf)continue;
  1307. ship.custom.gridPos = i;
  1308. }
  1309. firstCheckpointAngle=Math.PI-(Math.PI/2+firstCheckpointAngle);
  1310.  
  1311. log("Race started!");
  1312. }else{
  1313. log("Race already started");
  1314. }
  1315. }
  1316.  
  1317. stopRace = function(){
  1318. if(raceinprogress){
  1319. game.removeObject();
  1320. showBanners();
  1321. raceinprogress = false;
  1322. racetime = 0;
  1323. countdown = quickRaceStartTime;
  1324. countdownLong = longRaceStartTime;
  1325. lastfinished = 0;
  1326. nextTrack = Math.floor(Math.random()*tracks.length);
  1327. for (i=0;i<game.ships.length;i++)
  1328. {
  1329. ship = game.ships[i];
  1330. if(!ship)continue;
  1331. if(ship.custom.inrace)
  1332. shipFinished(ship);
  1333. drawRaceTrack(ship, false);
  1334. ship.custom.checkpoint = 0;
  1335. ship.custom.ready = false;
  1336. drawStatusButtons(ship, true);
  1337. drawSpectateButton(ship, false);
  1338. ship.custom.inrace = false;
  1339. ship.custom.dislikeTrack = false;
  1340. ship.custom.spectating = -1;
  1341. writeTextSmol(ship,getLocalizedString(ship, "pressUWhenReady"));
  1342. }
  1343. log("Race stopped.");
  1344. }else{
  1345. log("No race in progress");
  1346. }
  1347. }
  1348.  
  1349. initShip = function(ship){
  1350. //this is a new ship, we have to set it up
  1351. ship.custom.init = true;
  1352. ship.custom.inrace = false;
  1353. ship.custom.checkpoint = 0;
  1354. ship.custom.lasttime = -1;
  1355. ship.custom.type = 0;
  1356. ship.custom.ready = false;
  1357. ship.custom.lap = 0;
  1358. ship.custom.dislikeTrack = false;
  1359. ship.custom.ignoreSelf = false;
  1360. ship.custom.ignoreMod = false;
  1361. ship.custom.spectating = -1;
  1362. ship.custom.wantChangeShip = false;
  1363. ship.custom.votekickVote = 0;
  1364. ship.custom.votekickCooldown = 0;
  1365. ship.custom.wantVotekick = -1;
  1366. ship.custom.UIScreen = 0;
  1367. ship.custom.localization = 0;
  1368. ship.set({
  1369. x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
  1370. y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
  1371. });
  1372. drawStatusButtons(ship, true);
  1373. mainScreen(ship, true);
  1374. //tell them what to do
  1375. if(!raceinprogress) writeTextSmol(ship,getLocalizedString(ship, "pressUWhenReady"));
  1376. }
  1377.  
  1378. deadShip = function(ship){
  1379. x = 0;
  1380. y = 0;
  1381. if(ship.custom.inrace){
  1382. if(ship.custom.checkpoint == 0){
  1383. x = checkpoints[0].x;
  1384. y = checkpoints[0].y;
  1385. }else{
  1386. ch = ship.custom.checkpoint-1;
  1387. x = checkpoints[ch].x;
  1388. y = checkpoints[ch].y;
  1389. }
  1390. }else{
  1391. x = sandboxArea.x;
  1392. y = sandboxArea.y;
  1393. }
  1394. ship.set({x:x, y:y});
  1395. }
  1396.  
  1397. startingLine = function(ship){
  1398. noActivityCountdown = noActivityTime;
  1399. //get the direction to the first checkpoint, normalized
  1400. dist = distance(firstCheckpointDir[0],firstCheckpointDir[1]);
  1401. x = firstCheckpointDir[0]/dist;
  1402. y = firstCheckpointDir[1]/dist;
  1403. //launchvel represent the initial boop the ships experience when
  1404. //the countdown is over
  1405. launchvel = 40;
  1406. //get a vector perpendicular to the direction to the first checkpoint
  1407. perpY = x;
  1408. perpX = -y;
  1409.  
  1410. vx = 0;
  1411. vy = 0;
  1412. //launch the player as the race starts
  1413. if(finalCountdown<1){
  1414. raceStarted = true;
  1415. racetime = 0;
  1416. writeTextLarge(ship,"GO GO GO");
  1417. vx = x*launchVel;
  1418. vy = y*launchVel;
  1419. }else
  1420. //output the final countdown
  1421. writeTextLarge(ship,""+finalCountdown);
  1422. posInLine = ship.custom.gridPos%shipsInLine;
  1423. line = Math.floor(ship.custom.gridPos/shipsInLine);
  1424.  
  1425. //keep the player at the starting line
  1426. ship.set({
  1427. idle:true,
  1428. x:checkpoints[0].x-perpX*(startingLinesWidth/2) + perpX*(startingLinesWidth)*(posInLine/(shipsInLine-1))+(-x*line*startingLinesDist),
  1429. y:checkpoints[0].y-perpY*(startingLinesWidth/2) + perpY*(startingLinesWidth)*(posInLine/(shipsInLine-1))+(-y*line*startingLinesDist),
  1430. vx:0,
  1431. vy:0,
  1432. angle:57.2958*firstCheckpointAngle
  1433. });
  1434. }
  1435.  
  1436. shipNotInRace = function(ship){
  1437. if(ship.custom.spectating>-1){
  1438. if(game.ships[ship.custom.spectating].custom.inrace){
  1439. ship.set({
  1440. x:game.ships[ship.custom.spectating].x,
  1441. y:game.ships[ship.custom.spectating].y,
  1442. vx:game.ships[ship.custom.spectating].vx,
  1443. vy:game.ships[ship.custom.spectating].vy,
  1444. idle:true
  1445. })
  1446. }
  1447. }
  1448. //this ship either finished or just joined, tell them
  1449. drawSpectateButton(ship, true);
  1450. writeTextSmol(ship,getLocalizedString(ship, "waitAllPlayersFinish")+lastfinished+
  1451. getLocalizedString(ship, "waitAllPlayersFinishSoFar") + DNFCountdown + getLocalizedString(ship, "seconds"));
  1452. x = sandboxArea.x-ship.x;
  1453. y = sandboxArea.y-ship.y;
  1454. if(ship.custom.spectating==-1&&distance(x,y)>sandboxAreaSize)
  1455. ship.set({
  1456. score:0,
  1457. x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
  1458. y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
  1459. });
  1460. }
  1461.  
  1462. randomizeNextTrack = function(){
  1463. nt = nextTrack
  1464. nextTrack = Math.floor(Math.random()*tracks.length);
  1465. while(tracks.length>1&&nt==nextTrack){
  1466. nextTrack = Math.floor(Math.random()*tracks.length);
  1467. }
  1468. for (i=0;i<game.ships.length;i++)
  1469. {
  1470. ship = game.ships[i];
  1471. if(!ship)continue;
  1472. ship.custom.dislikeTrack = false;
  1473. }
  1474. log("Next race: "+tracks[nextTrack].name);
  1475. }
  1476.  
  1477. shipFinished = function(ship){
  1478.  
  1479. if(raceinprogress){
  1480. if(lastfinished==0)DNFCountdown = DNFTime;
  1481. lastfinished++;
  1482. if(lastfinished==1){top1time.name = ship.name; top1time.time = racetime;}
  1483. if(lastfinished==2){top2time.name = ship.name; top2time.time = racetime;}
  1484. if(lastfinished==3){top3time.name = ship.name; top3time.time = racetime;}
  1485. }
  1486.  
  1487. if(raceinprogress){
  1488. writeTextLarge(ship,"Your place: "+lastfinished+" in "+racetime.toFixed(2)+"s");
  1489. log("#"+lastfinished+" - "+ship.name+" - "+racetime + " s");
  1490. }else{
  1491. writeTextLarge(ship,"Did Not Finish");
  1492. log("#"+lastfinished+" - "+ship.name+" - DNF");
  1493. }
  1494. changeScreen(ship, 0);
  1495. updateScreen(ship)
  1496. ship.custom.inrace=false;
  1497. ship.custom.checkpoint = 0;
  1498. ship.custom.lasttime = racetime;
  1499. for (j=0;j<game.ships.length;j++)
  1500. drawTopScores(game.ships[j], true);
  1501. ship.set({score:(checkpoints.length*10000)-(lastfinished*1000)});
  1502. }
  1503.  
  1504. lobby = function(){
  1505. //whether all players are ready
  1506. ready = true;
  1507. lastReadyAmount = readyAmount;
  1508. //whether there's at least one fool that wants a race
  1509. atLeastOnePlayer = false;
  1510. readyAmount = 0;
  1511. dislikedBy = 0;
  1512.  
  1513. for (i=0;i<game.ships.length;i++)
  1514. {
  1515. ship = game.ships[i];
  1516. if(!ship)continue;
  1517. ship.custom.spectating = -1;
  1518. if(ship.custom.ignoreMod)continue;
  1519. if(ship.custom.ignoreSelf)continue;
  1520. //check if the ship is in range of starting checkpoint
  1521. x = checkpoints[0].x-ship.x;
  1522. y = checkpoints[0].y-ship.y;
  1523. if(!ship.custom.ready){
  1524. //if not, then clearly not all players are ready
  1525. ready = false;
  1526. if(countdownLong<longRaceStartTime-1)
  1527. writeTextLarge(ship,getLocalizedString(ship, "raceStartsIn")+Math.max(countdown,countdownLong)+" - "+getLocalizedString(ship, "notReady"));
  1528. else writeTextLarge(ship, "");
  1529. continue;
  1530. }else atLeastOnePlayer = true;//otherwise at least somebody's willing to race
  1531. //countdownLong overrides countdown
  1532.  
  1533. if(ship.custom.dislikeTrack)
  1534. dislikedBy++;
  1535. readyAmount++;
  1536.  
  1537. if(countdownLong<countdown)countdown=countdownLong;
  1538.  
  1539. //if the countdown is at maximum, we're probably still waiting for players
  1540. if(countdown>=quickRaceStartTime-1)
  1541. writeTextLarge(ship,getLocalizedString(ship, "waitingForPlayers")+countdownLong+" ("+lastReadyAmount+getLocalizedString(ship, "numberPlayersReady"));
  1542. //otherwise we're starting soon
  1543. if(countdown<quickRaceStartTime-1)writeTextLarge(ship,getLocalizedString(ship, "startingSoon")+countdown+getLocalizedString(ship, "startingSoonSeconds"));
  1544. //if the countdown finished successfuly
  1545. if(countdown<0||countdownLong<0){
  1546. startRace();
  1547. }
  1548. }
  1549.  
  1550. if(atLeastOnePlayer)countdownLong-=1; else{
  1551. countdownLong = longRaceStartTime;
  1552. }
  1553. if(ready&&atLeastOnePlayer)countdown-=1; else{
  1554. countdown = quickRaceStartTime;
  1555. }
  1556. }
  1557.  
  1558. showBanners();
  1559.  
  1560. this.tick = function(game) {
  1561. if(game.ships.length<1)return;
  1562. var i = 0;
  1563. if(raceinprogress)
  1564. racetime += 1/60;
  1565. everySecond++;
  1566. if(everySecond>60){
  1567. everySecond-=60;
  1568. adTimer++;
  1569.  
  1570. if(adTimer>adRefreshTime){
  1571. adTimer = 0;
  1572. randomAd();
  1573. }
  1574.  
  1575.  
  1576. //ship initialization
  1577. for (i=0;i<game.ships.length;i++)
  1578. {
  1579. ship = game.ships[i];
  1580. if(!ship)continue;
  1581. if (!ship.custom.init){
  1582. initShip(ship);
  1583. }
  1584. x = sandboxArea.x-ship.x;
  1585. y = sandboxArea.y-ship.y;
  1586. if(!ship.custom.inrace&&ship.custom.spectating==-1&&(!raceinprogress||distance(x,y)<=sandboxAreaSize))
  1587. ship.set({type:101+ship.custom.type, stats:100011111});
  1588. //no fighting for now
  1589. //ship.set({invulnerable:400});
  1590. if(!ship.alive){
  1591. deadShip(ship);
  1592. }
  1593. if(ship.custom.ignoreMod){
  1594. ship.set({score:0,x:cornerOfShame.x, y:cornerOfShame.y,idle:true})
  1595. writeTextLarge(ship, getLocalizedString(ship, "shame"));
  1596. }else{
  1597. ship.set({idle:false});
  1598. }
  1599. if(ship.custom.ignoreSelf){
  1600. writeTextLarge(ship, getLocalizedString(ship, "youreAFK"));
  1601. }
  1602. ship.custom.votekickCooldown--;
  1603.  
  1604. }
  1605.  
  1606. if(votekickCountdown>=0){
  1607. if(votekickCountdown==0){
  1608. votekickResult();
  1609. }
  1610. votekickCountdown--;
  1611. }
  1612. updatePlayersLog();
  1613.  
  1614. //if there is a race going on
  1615. if(raceinprogress){
  1616. finalCountdown -= 1; //countdown at the start of the race
  1617. noActivityCountdown -= 1;
  1618. ready = true; //whether the race is over
  1619. for (i=0;i<game.ships.length;i++) //iterate
  1620. {
  1621. ship = game.ships[i];
  1622. if(!ship)continue;
  1623. if(ship.custom.ignoreMod)continue;
  1624. if(!ship.custom.inrace){
  1625. shipNotInRace(ship);
  1626. continue;
  1627. }
  1628.  
  1629. //there are still players racing, so we're not ready to end the race
  1630. ready = false;
  1631.  
  1632. //starting countdown
  1633. if(finalCountdown>=0){
  1634. startingLine(ship);
  1635. }
  1636.  
  1637. //update the race track minimap
  1638. drawRaceTrack(ship, true);
  1639. }
  1640. if(lastfinished>0)DNFCountdown--;
  1641. if(ready||(lastfinished>0&&DNFCountdown<0)||noActivityCountdown<0){
  1642. if(ready)
  1643. log("All players finished");
  1644. else if(DNFCountdown<0) log("Race ends - timeout"); else
  1645. log("Race ends - no activity");
  1646. stopRace();
  1647. }
  1648.  
  1649. }else{
  1650.  
  1651.  
  1652. if(dislikedBy>0.5*readyAmount){
  1653. randomizeNextTrack();
  1654. }
  1655.  
  1656. lobby();
  1657. }
  1658.  
  1659. }
  1660.  
  1661. if(game.step%1==0){
  1662.  
  1663. if(raceinprogress){
  1664. for (i=0;i<game.ships.length;i++)
  1665. {
  1666. ship = game.ships[i];
  1667. if(!ship)continue;
  1668. if(!ship.custom.inrace)continue;
  1669.  
  1670. //checkpoint execution
  1671. ch = ship.custom.checkpoint;
  1672. x = checkpoints[ch].x-ship.x;
  1673. y = checkpoints[ch].y-ship.y;
  1674. //if we're in range of the next checkpoint
  1675. if(distance(x, y)<checkpointrange){
  1676.  
  1677. //proceed to the next checkpoint
  1678. ship.custom.checkpoint=ship.custom.checkpoint+1;
  1679. if(ship.custom.lap>highestCheckpoint[0]){
  1680. highestCheckpoint[0] = ship.custom.lap;
  1681. highestCheckpoint[1] = ship.custom.checkpoint;
  1682. }else if(ship.custom.lap==highestCheckpoint[0]&&ship.custom.checkpoint>highestCheckpoint[1]){
  1683. highestCheckpoint[1] = ship.custom.checkpoint;
  1684. }
  1685. noActivityCountdown = noActivityTime;
  1686.  
  1687. if(ship.custom.checkpoint>=checkpoints.length&&laps>0&&ship.custom.lap<laps){
  1688. ship.custom.lap++;
  1689. ship.custom.checkpoint = 0;
  1690. }
  1691.  
  1692. //if this is the last checkpoint
  1693. if( ((laps>0)&&(ship.custom.lap==laps)&&(ship.custom.checkpoint==2)) ||
  1694. ((laps==0)&&(ship.custom.checkpoint>=checkpoints.length)) ){
  1695. shipFinished(ship);
  1696. }else{
  1697. ship.set({score:ship.custom.checkpoint*1000+checkpoints.length*ship.custom.lap*1000});
  1698. writeTextLarge(ship," ");
  1699. if(ship.custom.checkpoint > 1||ship.custom.lap>0){
  1700. if(laps>0)
  1701. lapText = " (lap "+(ship.custom.lap+1)+"/"+laps+")";
  1702. if(ship.custom.lap!=laps)
  1703. writeTextSmol(ship,"Checkpoint "+ ship.custom.checkpoint + "/"+checkpoints.length+lapText);
  1704. else writeTextSmol(ship, "Almost there!");
  1705. } else {
  1706. writeTextSmol(ship,"Follow the red dot.");
  1707. }
  1708. }
  1709. }
  1710. }
  1711. for (i=0;i<game.ships.length;i++)
  1712. {
  1713. ship = game.ships[i];
  1714. if(!ship)continue;
  1715. if(!ship.custom.inrace)continue;
  1716. if(ship.custom.lap==highestCheckpoint[0]&&ship.custom.checkpoint==highestCheckpoint[1])
  1717. ship.set({stats:100000000});
  1718. else ship.set({stats:100011111});
  1719. }
  1720. }
  1721. }
  1722.  
  1723. // do mod stuff here ; see documentation
  1724. if (game.step%10==0) // ensure this is done only once per second
  1725. {
  1726. for (i=0;i<game.ships.length;i++)
  1727. {
  1728. ship = game.ships[i];
  1729. if(!ship)continue;
  1730. if(!ship.custom.inrace)continue;
  1731. ch = ship.custom.checkpoint;
  1732. if(ch>=checkpoints.length)continue;
  1733. path = shortestPath(ship.x, ship.y, checkpoints[ch].x, checkpoints[ch].y);
  1734. x = path[0];
  1735. y = path[1];
  1736. vis = true;
  1737. if(distance(x, y)<checkpointrange)
  1738. vis = false;
  1739. xx = 25*x/distance(x, y);
  1740. yy = 25*y/distance(x, y);
  1741. ship.setUIComponent({
  1742. id:"nextCh",
  1743. position:[50+xx,50-yy,25,25],
  1744. clickable: false,
  1745. visible: vis,
  1746. components: [
  1747. { type:"round",position:[0,0,5,10],fill:"#ff0000",stroke:"#CDE",width:1}
  1748. ]
  1749. });
  1750.  
  1751. }
  1752.  
  1753. }
  1754. };
  1755.  
  1756. this.event = function(event,game) {
  1757. switch (event.name)
  1758. {
  1759. case "ui_component_clicked":
  1760. var ship = event.ship;
  1761. var component = event.id;
  1762. if(ship.custom.ignoreMod)return;
  1763.  
  1764. if (component == "back"){
  1765. previousScreen(ship);
  1766. }
  1767.  
  1768. if (component == "credits")
  1769. {
  1770. changeScreen(ship, 3);
  1771. }
  1772.  
  1773. if (component == "language")
  1774. {
  1775. ship.custom.localization++;
  1776. if(ship.custom.localization>=localizations.length)
  1777. ship.custom.localization = 0;
  1778. updateScreen(ship);
  1779. }
  1780.  
  1781. if (component == "chooseShip")
  1782. {
  1783. changeScreen(ship, 1);
  1784. }
  1785. if (component == "nextship")
  1786. {
  1787. ship.custom.type++;
  1788. if(ship.custom.type>=racingShipsAmount)
  1789. ship.custom.type = 0;
  1790. updateScreen(ship);
  1791. }
  1792. if (component == "prevship")
  1793. {
  1794. ship.custom.type--;
  1795. if(ship.custom.type<0)
  1796. ship.custom.type = racingShipsAmount-1;
  1797. updateScreen(ship);
  1798. }
  1799.  
  1800. if (component == "chooseKick")
  1801. {
  1802. i = ship.custom.wantVotekick;
  1803. if(ship.custom.votekickCooldown>0)
  1804. ship.custom.wantVotekick = -1; else
  1805. if(i==-1){
  1806.  
  1807. istart=0;
  1808. i=0;
  1809. for(j=0;j<game.ships.length*2;j++){
  1810. i++;
  1811. if(i>=game.ships.length) i = 0;
  1812. if(game.ships[i]!=ship/*&&!game.ships[i].custom.ignoreMod*/){
  1813. ship.custom.wantVotekick = i;
  1814. break;
  1815. }
  1816. if(i==istart){ship.custom.wantVotekick=-1;break;}
  1817. }}else
  1818. ship.custom.wantVotekick = -1;
  1819. changeScreen(ship, 2);
  1820. }
  1821. if (component == "votekicknext")
  1822. {
  1823. i = ship.custom.wantVotekick;
  1824. for(j=0;j<game.ships.length*2;j++){
  1825. i++;
  1826. if(i>=game.ships.length) i = 0;
  1827. if(i==ship.custom.wantVotekick)break;
  1828. if(game.ships[i]!=ship&&!game.ships[i].custom.ignoreMod){
  1829. ship.custom.wantVotekick = i;
  1830. break;
  1831. }
  1832. }
  1833. updateScreen(ship);
  1834. }
  1835. if (component == "votekickprevious")
  1836. {
  1837. i = ship.custom.wantVotekick;
  1838. for(j=0;j<game.ships.length*2;j++){
  1839. i--;
  1840. if(i<0) i = game.ships.length;
  1841. if(i==ship.custom.wantVotekick)break;
  1842. if(game.ships[i]!=ship&&!game.ships[i].custom.ignoreMod){
  1843. ship.custom.wantVotekick = i;
  1844. break;
  1845. }
  1846. }
  1847. updateScreen(ship);
  1848. }
  1849. if (component == "proposeVotekick")
  1850. {
  1851. previousScreen(ship);
  1852. if(ship.custom.votekickCooldown<0&&ship.custom.wantVotekick!=-1){
  1853. log(ship.name+" wants to kick "+game.ships[ship.custom.wantVotekick].name);
  1854. startVotekick(ship.custom.wantVotekick);
  1855. ship.custom.votekickCooldown = votekickCooldownTime;
  1856. }else{
  1857. ship.custom.wantVotekick = -1;
  1858. }
  1859.  
  1860. }
  1861.  
  1862. if (component == "noKick"){
  1863. ship.custom.votekickVote = -1;
  1864. drawVotekickVoteUI(ship, true);
  1865. }
  1866. if (component == "yesKick"){
  1867. ship.custom.votekickVote = 1;
  1868. drawVotekickVoteUI(ship, true);
  1869. }
  1870.  
  1871. if (component == "readyToggle"){
  1872. ship.custom.ready = !ship.custom.ready;
  1873. drawStatusButtons(ship, !ship.custom.inrace);
  1874. }
  1875. if (component == "ignoreMeToggle"){
  1876. ship.custom.ignoreSelf = !ship.custom.ignoreSelf;
  1877. drawStatusButtons(ship, !ship.custom.inrace);
  1878. }
  1879. if (component == "trackInfo"){
  1880. ship.custom.dislikeTrack = !ship.custom.dislikeTrack;
  1881. writeTrackInfo(ship, !ship.custom.inrace);
  1882. }
  1883. if (component == "spectateToggle"){
  1884. if(!ship.custom.inrace){
  1885.  
  1886. if(ship.custom.spectating == -1){
  1887. for (i=0;i<game.ships.length;i++)
  1888. {
  1889. ship1 = game.ships[i];
  1890. if(!ship1)continue;
  1891. if(ship1.custom.inrace){
  1892. ship.custom.spectating = i;
  1893. break;
  1894. }
  1895. }
  1896.  
  1897. ship.set({type:301});
  1898. }else ship.custom.spectating = -1;
  1899. }
  1900. }
  1901. if (component == "spectateNext"){
  1902. if(!ship.custom.inrace&&ship.custom.spectating!=-1){
  1903. i = ship.custom.spectating;
  1904. for(j=0;j<game.ships.length*2;j++){
  1905. i++;
  1906. if(i>=game.ships.length) i = 0;
  1907. if(i==ship.custom.spectating)break;
  1908. if(game.ships[i].custom.inrace){
  1909. ship.custom.spectating = i;
  1910. break;
  1911. }
  1912. }
  1913. }
  1914. }
  1915. break;
  1916. }
  1917. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement