Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 66.76 KB | None | 0 0
  1. //map info here
  2.  
  3. checkpoints = [];
  4.  
  5. mapSeed = 144;
  6. mapSize = 60;
  7.  
  8. checkpoints.push(JSON.parse('{"x":-10, "y":35}'));
  9. checkpoints.push(JSON.parse('{"x":-40, "y":35}'));
  10. checkpoints.push(JSON.parse('{"x":-44, "y":-115}'));
  11. checkpoints.push(JSON.parse('{"x":-135, "y":-115}'));
  12. checkpoints.push(JSON.parse('{"x":-265, "y":-100}'));
  13. checkpoints.push(JSON.parse('{"x":-180, "y":75}'));
  14. checkpoints.push(JSON.parse('{"x":-100, "y":140}'));
  15. checkpoints.push(JSON.parse('{"x":75, "y":115}'));
  16.  
  17. sandboxArea = JSON.parse('{"x":155, "y":35}');
  18. customMap = true;
  19. map =
  20. "999999999999999999999999999999999999999999999999999999999999\n"+
  21. "999999999999999999999999999999999999999999999999999999999999\n"+
  22. "999999999999999999999999999999999999999999999999999999999999\n"+
  23. "999999999999999999999999999999999999999999999999999999999999\n"+
  24. "999999999999999999999999999999999999999999999999999999999999\n"+
  25. "999999999999999999999999999999999999999999999999999999999999\n"+
  26. "999999999999999999999999999999999999999999999999999999999999\n"+
  27. "999999999999999999999999999999999999999999999999999999999999\n"+
  28. "999999999999999999999999999999999999999999999999999999999999\n"+
  29. "999999999999999999999999999999999999999999999999999999999999\n"+
  30. "999999999999999999999999999999999999999999999999999999999999\n"+
  31. "999999999999999999999999999999999999999999999999999999999999\n"+
  32. "999999999999999999999999999999999999999999999999999999999999\n"+
  33. "999999999999999999999999999999999999999999999999999999999999\n"+
  34. "999999999999999999999999999999999999999999999999999999999999\n"+
  35. "9999999999999999999 9 9 999999999999999999999999\n"+
  36. "9999999999999993 22 999999999999999999999\n"+
  37. "99999999999999 3999 9 9 9 999999999999999999999\n"+
  38. "99999999999993 9999 9999999999999999 999999999999999999999\n"+
  39. "9999999999999299999 99999999999 999999999999999999999\n"+
  40. "99999999999 99 99999999999 999999999999999999999\n"+
  41. "99999999999 99 99999999999 99999999999999999999999999\n"+
  42. "99999999999 99 99 99999999999 999999999 9999999\n"+
  43. "99999999 99 999999999999 999999 9999999 9999999\n"+
  44. "99999999 99 999999999999 999999 999999 9999999\n"+
  45. "99999999 99999999999999999 999999 99 9 99999999999\n"+
  46. "99999999 999999999999999993 4 9 99999999999\n"+
  47. "99999999 399999999999999999 4 99999999999 99 9 9999999999\n"+
  48. "999999 999999999999999994 399999999999 9999999 9999999999\n"+
  49. "999999 99999999999999999 4 999999999 999999 9999999999\n"+
  50. "999999 99999999999999999993 4999999999 99999 99999999999\n"+
  51. "9999993 9999999999999999999 4 999999999 99999 99999999999999\n"+
  52. "999999 99999999999999999994 3999999999 99999999999999\n"+
  53. "999999 9999999999999999999 4 999999999999999999999999999999\n"+
  54. "999999 99999999999999999993 4999999999999999999999999999999\n"+
  55. "999999 49999999999999999999 4 999999999999999999999999999999\n"+
  56. "999999 99999999999999999994 3999999999999999999999999999999\n"+
  57. "999999 9993 39999999999 4 999999999999999999999999999999\n"+
  58. "99 3 999 99999999993 4999999999999999999999999999999\n"+
  59. "99 999 99 9999999999 4 999999999999999999999999999999\n"+
  60. "99 9999999 99 999999999 4 3999999999999999999999999999999\n"+
  61. "99 99 999999999999999999999999999999\n"+
  62. "99 5 99 999999999999999999999999999999\n"+
  63. "999999999999999999999999999999999999999999999999999999999999\n"+
  64. "999999999999999999999999999999999999999999999999999999999999\n"+
  65. "999999999999999999999999999999999999999999999999999999999999\n"+
  66. "999999999999999999999999999999999999999999999999999999999999\n"+
  67. "999999999999999999999999999999999999999999999999999999999999\n"+
  68. "999999999999999999999999999999999999999999999999999999999999\n"+
  69. "999999999999999999999999999999999999999999999999999999999999\n"+
  70. "999999999999999999999999999999999999999999999999999999999999\n"+
  71. "999999999999999999999999999999999999999999999999999999999999\n"+
  72. "999999999999999999999999999999999999999999999999999999999999\n"+
  73. "999999999999999999999999999999999999999999999999999999999999\n"+
  74. "999999999999999999999999999999999999999999999999999999999999\n"+
  75. "999999999999999999999999999999999999999999999999999999999999\n"+
  76. "999999999999999999999999999999999999999999999999999999999999\n"+
  77. "999999999999999999999999999999999999999999999999999999999999\n"+
  78. "999999999999999999999999999999999999999999999999999999999999" ;
  79.  
  80. //ship info here
  81.  
  82. var Astral = '{"name":"Astral Accelerator","level":1,"model":1,"size":1.5,"zoom":1.2,"specs":{"shield":{"capacity":[150,150],"reload":[10,10]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":80,"speed":[140,140],"rotation":[40,40],"acceleration":[150,150],"dash":{"rate":1,"burst_speed":[200,200],"speed":[240,240],"acceleration":[90,90],"initial_energy":[10,10],"energy":[100,100]}}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":-40,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-90,-93,-95,-90,-30,0,50,100,105],"z":[-7,-7,-7,-7,-7,-7,0,0,0]},"width":[20,23,25,27,30,27,30,26,0],"height":[0,6,8,10,15,18,8,10,0],"texture":[17,13,63,1,10,1,10,12]},"stripes":{"section_segments":16,"offset":{"x":15,"y":-40,"z":10},"position":{"x":[-4,-4,-4,11,5,0,0,0],"y":[-92,-30,0,50,100],"z":[1,6,10,3,3,0]},"width":[3,3,3,3,3,3],"height":[1,1,1,1,1],"texture":[63]},"cockpit":{"section_segments":10,"offset":{"x":0,"y":-20,"z":17},"position":{"x":[0,0,0,0,0,0],"y":[10,30,40,70,80],"z":[-2,0,0,0,0]},"width":[7.5,10,10,9.5,0],"height":[3,10,11,10,0],"texture":[9,4,13,4],"propeller":false},"detail":{"section_segments":8,"angle":3,"offset":{"x":26,"y":-50,"z":6},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"y":[0,3,7,11,14,17,21,25,28,31,35,39,42,45,49,53,57],"z":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"width":[1,4,6,4,1,4,6,4,1,4,6,4,1,4,6,4,1],"height":[1,4,6,4,1,4,6,4,1,4,6,4,1,4,6,4,1],"texture":[4,17,17,4,4,17,17,4,4,17,17,4,4,17,17,4]},"engine":{"section_segments":4,"offset":{"x":0,"y":-95,"z":18},"position":{"x":[0,0,0,0],"y":[-18,-15,15,18],"z":[0,0,0,0]},"width":[0,10,10,0],"height":[0,4,4,0],"texture":[18]},"bracings1":{"section_segments":8,"angle":90,"offset":{"x":0,"y":-85,"z":18},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0],"y":[-15,-14,-11.5,-10,-8,0,8,10,11.5,14,15],"z":[-20,-10,-1,1,2,0,2,1,-1,-10,-20]},"width":[4,4,4,4,4,5,4,4,4,4,4],"height":[0,10,4,3,2,3,2,3,4,10,0],"propeller":false,"texture":[13]},"bracings2":{"section_segments":8,"angle":90,"offset":{"x":0,"y":-105,"z":18},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0],"y":[-15,-14,-11.5,-10,-8,0,8,10,11.5,14,15],"z":[-20,-10,-1,1,2,0,2,1,-1,-10,-20]},"width":[4,4,4,4,4,5,4,4,4,4,4],"height":[0,10,4,3,2,3,2,3,4,10,0],"propeller":false,"texture":[13]},"engines":{"section_segments":12,"offset":{"x":18,"y":0,"z":15},"position":{"x":[0,0,0,0,0,0,0,0],"y":[25,20,25,40,75,70,65],"z":[5,0,0,0,0,0,0,0]},"width":[0,5,7,8,8,6,0],"height":[0,14,15,15,13,10,0],"texture":[13,1,63,10,18,17],"propeller":true}},"wings":{"main":{"length":[46,0,25,-25,20],"width":[100,20,70,0,70,10],"angle":[10,0,110,110,-70],"position":[-30,5,-10,30,-10,20],"texture":[18,11,63],"doubleside":true,"bump":{"position":30,"size":7},"offset":{"x":0,"y":30,"z":0}},"font":{"length":[45],"width":[61,10],"angle":[-6,20],"position":[-60,-100],"texture":[63],"doubleside":true,"bump":{"position":30,"size":20},"offset":{"x":0,"y":-20,"z":5}}},"typespec":{"name":"Turbo","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[150,150],"reload":[10,10]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":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]}}},"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}}';
  83. var ShadowX1 = '{"name":"Shadow X-1","level":1,"model":2,"size":0.8,"zoom":0.8,"specs":{"shield":{"capacity":[130,130],"reload":[6,6]},"generator":{"capacity":[80,80],"reload":[16,16]},"ship":{"mass":70,"speed":[155,155],"rotation":[60,60],"acceleration":[150,150],"dash":{"rate":2,"burst_speed":[180,180],"speed":[170,170],"acceleration":[170,170],"initial_energy":[10,10],"energy":[5,5]}}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-100,-98,-95,-70,-40,0,40,70,80,90,100],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,10,20,30,40,20,20,40,40,40,20,0],"height":[0,4,4,20,20,10,10,15,15,15,10,10],"texture":[12,5,63,4,4,63,4,4,5]},"back":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[90,95,100,105,90],"z":[0,0,0,0,0]},"width":[10,15,18,19,2],"height":[3,5,7,8,2],"texture":[63],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-25,"z":15},"position":{"x":[0,0,0,0,0,0],"y":[-45,-40,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,13,0],"height":[0,10,15,5,0],"texture":[9]},"laser":{"section_segments":10,"offset":{"x":70,"y":10,"z":-20},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-20,-15,0,10,20,25,30,40,70,60],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,15,15,10,10,15,5,0],"height":[0,10,15,15,15,10,10,15,5,0],"texture":[3,4,10,3],"propeller":true}},"wings":{"top":{"offset":{"x":0,"y":50,"z":5},"length":[30],"width":[70,30],"angle":[90],"position":[0,50],"texture":[4],"bump":{"position":10,"size":15}},"side_joins":{"offset":{"x":0,"y":30,"z":-3},"length":[100],"width":[100,40],"angle":[0],"position":[-50,50],"texture":[4],"bump":{"position":10,"size":10}}},"typespec":{"name":"Shadow X-1","level":3,"model":3,"code":303,"specs":{"shield":{"capacity":[130,130],"reload":[6,6]},"generator":{"capacity":[80,80],"reload":[16,16]},"ship":{"mass":70,"speed":[155,155],"rotation":[60,60],"acceleration":[150,150]}},"shape":[1.6,1.582,1.552,1.313,1.138,1.009,0.919,0.75,0.688,0.708,0.733,1.157,1.297,1.359,1.392,1.431,1.696,1.975,2.192,2.258,1.661,1.429,1.58,1.628,1.705,1.835,1.705,1.628,1.58,1.429,1.661,2.258,2.192,1.975,1.696,1.431,1.392,1.359,1.297,1.157,0.733,0.708,0.688,0.75,0.919,1.009,1.138,1.313,1.552,1.582],"lasers":[],"radius":2.258}}';
  84. var RADDiamondLancer = '{"name":"Lancer","level":1,"model":3,"size":2,"specs":{"shield":{"capacity":[110,110],"reload":[5,5]},"generator":{"capacity":[300,300],"reload":[10,10]},"ship":{"mass":120,"speed":[135,135],"rotation":[55,55],"acceleration":[180,180],"dash":{"rate":2,"burst_speed":[165,165],"speed":[165,165],"acceleration":[200,200],"initial_energy":[35,35],"energy":[17,17]}}},"bodies":{"main":{"section_segments":6,"offset":{"x":0,"y":-50,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-53,-50,-40,-20,10,40,80,84],"z":[0,0,0,0,0,0,0,0]},"width":[18,25,25,23,23,25,20,0],"height":[0,5,10,10,10,10,7,0],"texture":[1,1,1,1,1,8,3.9],"angle":0},"bumper":{"section_segments":6,"offset":{"x":-1,"y":-100,"z":0},"position":{"x":[1.5,1,0,-5,-5,0,0],"y":[0,10,15,25,27],"z":[0,0,0,0,0,0,0]},"width":[5,5,5,5,0],"height":[5,5,5,5,0],"texture":[3.9,16.9,3.9],"angle":90},"cockpitWindshield":{"section_segments":3,"offset":{"x":0,"y":-40,"z":10},"position":{"x":[-20,0,5,0,-20,0,0],"y":[-20,-10,0,10,20],"z":[-6,-2,0,-2,-6,0,0]},"width":[0,12,12,12,0],"height":[0,5,5,5,0],"texture":[8.6],"angle":90},"cockpitBack":{"section_segments":6,"offset":{"x":0,"y":10,"z":7},"position":{"x":[0,0,0,0,0,0,0],"y":[-50,-20,0,20,23],"z":[-2,0,0,0,0,0,0]},"width":[15,15,15,13,0],"height":[0,10,10,10,0],"texture":[4,10,17.9,3.9],"angle":0},"cockpitBackSides":{"section_segments":6,"offset":{"x":13,"y":0,"z":7},"position":{"x":[5,0,0,0,0,0,0],"y":[-20,-10,0,3],"z":[-3,0,0,0,0,0,0]},"width":[0,7,7,0],"height":[0,5,5,0],"texture":[4,17.5,4,3],"angle":0},"enginesTop":{"section_segments":6,"offset":{"x":12,"y":70,"z":7},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-60,-58,-55,-40,-30,-25,-20,-8,-30],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7,7,5,5,8,6,0],"height":[0,5,7,7,5,5,8,6,0],"texture":[3.9,3.9,10.4,63,2.9,2.9,3.9,16.9],"angle":0,"propeller":true},"enginesBottom":{"section_segments":6,"offset":{"x":18,"y":65,"z":-5},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-55,-54,-50,-40,-30,-25,-20,-8,-30],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7,7,5,5,8,6,0],"height":[0,5,7,7,5,5,8,6,0],"texture":[3.9,3.9,17.9,63,2.9,2.9,3.9,16.9],"angle":0,"propeller":true},"enginesConnect":{"section_segments":6,"offset":{"x":1,"y":36,"z":0},"position":{"x":[4,-12,0,0,0,0,0],"y":[-20,10],"z":[-5,8,0,0,0,0,0]},"width":[2,2],"height":[2,2],"texture":[1.9],"angle":90},"boostTank":{"section_segments":12,"offset":{"x":0,"y":-15,"z":0},"position":{"x":[-30,-30,-30,-30,-30,-30,-30,-30,-30,-30],"y":[-30,-30,-26,-20,-5,5,20,26,30,30],"z":[0,0,0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7.5,8,8,8,8,7.5,5,0],"height":[0,5,7.5,8,8,8,8,7.5,5,0],"texture":[63,63,63,13,4,13,63,63,63],"angle":0},"boostTankHolder":{"section_segments":6,"angle":90,"offset":{"x":0,"y":-15,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-44,-43,-39,-38,0],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,6,8,4,4],"height":[0,4,6,4,4],"texture":[4,63,4,4,4,4,4,63,4]},"boostPipeMain":{"section_segments":6,"offset":{"x":0,"y":-20,"z":11},"position":{"x":[-30,-30,-30,-30,-27,-15,-15,0,0],"y":[-20,-18,-15,30,35,45,48],"z":[-6,-2,0,0,0,0,0,0]},"width":[2,2,2,2,2,2,0],"height":[2,2,2,2,2,2,0],"texture":[63],"angle":0},"boostPipeSide":{"section_segments":6,"offset":{"x":0,"y":-20,"z":9},"position":{"x":[-34,-34,-34,-34,-36,-40,-42,-42,-42],"y":[-20,-18,-15,25,30,33,40,46],"z":[-6,-2,0,0,0,0,0,0]},"width":[2,2,2,2,2,2,2,0],"height":[2,2,2,2,2,2,2,0],"texture":[63],"angle":0},"boostTankEngineHolder":{"section_segments":6,"angle":90,"offset":{"x":0,"y":27,"z":3},"position":{"x":[0,0,0,0,10,0,0,0,0],"y":[-54,-53,-49,-48,0],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,6,8,3,3],"height":[0,4,6,3,3],"texture":[4,63,4,4,4,4,4,63,4]},"engineBoostTankOffset":{"section_segments":6,"offset":{"x":0,"y":70,"z":3},"position":{"x":[-42,-42,-42,-42,-42,-42,-42,-42,-42],"y":[-60,-58,-55,-40,-30,-25,-20,-8,-30],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,5,7,7,5,5,8,6,0],"height":[0,5,7,7,5,5,8,6,0],"texture":[3.9,3.9,10.4,63,2.9,2.9,3.9,16.9],"angle":0,"propeller":true},"logo1":{"section_segments":4,"offset":{"x":0,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5],"z":[0,0,0,0,0,0,0]},"width":[0,3.2],"height":[0,0],"texture":[4,3,4,3],"angle":0},"logo2":{"section_segments":4,"offset":{"x":0.1,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5],"z":[0,0,0,0,0,0,0]},"width":[0,3.2],"height":[0,0],"texture":[4,3,4,3],"angle":120},"logo3":{"section_segments":4,"offset":{"x":0.1,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[5,15],"z":[0,-3,0,0,0,0,0]},"width":[3.2,0],"height":[0,0],"texture":[4],"angle":60},"logo4":{"section_segments":4,"offset":{"x":0,"y":-65,"z":11},"position":{"x":[0,0,0,0,0,0,0],"y":[5,15],"z":[0,0,0,0,0,0,0]},"width":[3.2,0],"height":[0,0],"texture":[4],"angle":180},"logoDeco":{"section_segments":4,"offset":{"x":5,"y":-72,"z":9},"position":{"x":[0,0,3,5,8,13,14,15],"y":[-20,-10,2,5,8,14,20,26],"z":[-4,0,-1,-1,-1,-2,-3,-3,0]},"width":[3,3,3,3,3,3,2,0,0],"height":[2,2,2,2,2,1,0,0],"texture":[3.9],"angle":0}},"wings":{"cockpitTop":{"doubleside":false,"offset":{"x":0,"y":-30,"z":15},"length":[10,13],"width":[30,20,4],"angle":[-11,-42],"position":[0,0,11],"texture":[11.5,9],"bump":{"position":20,"size":3}},"cockpitTopBack":{"doubleside":false,"offset":{"x":0,"y":-17,"z":14.8},"length":[10,13],"width":[10,10,20],"angle":[-11,-42],"position":[0,0,10],"texture":[4],"bump":{"position":20,"size":3}},"wingsBackTop":{"doubleside":true,"offset":{"x":14,"y":37,"z":10},"length":[20],"width":[20,7],"angle":[20],"position":[0,20],"texture":[63],"bump":{"position":20,"size":5}},"wingsBackBottom":{"doubleside":true,"offset":{"x":20,"y":31,"z":-8},"length":[30],"width":[16,4],"angle":[-25],"position":[0,20],"texture":[63],"bump":{"position":20,"size":5}}},"typespec":{"name":"RAD Diamond Lancer","level":1,"model":3,"code":103,"specs":{"shield":{"capacity":[110,110],"reload":[5,5]},"generator":{"capacity":[300,300],"reload":[10,10]},"ship":{"mass":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]}}},"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}}';
  85. var ZerdBooster = '{"name":"Z Booster","level":1,"model":4,"size":1.4,"specs":{"shield":{"capacity":[150,150],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[13,13]},"ship":{"mass":140,"speed":[160,160],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[200,200],"speed":[160,160],"acceleration":[0,0],"initial_energy":[50,50],"energy":[0,0]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":-45,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-65,-60,-50,-20,20,30,55,75,60],"z":[-10,-10,-10,-5,0,0,0,0,0]},"width":[0,8,13,20,25,25,30,30,0],"height":[0,6,10,17,21,22,22,22,0],"texture":[4,63,10,1,10,1,9,17]},"main1":{"section_segments":12,"offset":{"x":0,"y":80,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-65,-60,-50,-25,-15,-5,0,15,5],"z":[0,0,0,0,0,0,0,0,0]},"width":[0,45,45,45,25,25,30,27,0],"height":[0,22,22,20,17,17,20,17,0],"propeller":true,"texture":[4,63,10,1,10,1,12,17]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-60,"z":20},"position":{"x":[0,0,0,0,0,0,0],"y":[-15,0,20,30,60],"z":[-5,-3,0,0,0]},"width":[0,10,13,13,5],"height":[0,10,13,13,5],"propeller":false,"texture":[7,9,9,4,4]},"cannon":{"section_segments":6,"offset":{"x":20,"y":-30,"z":10},"position":{"x":[-1,-1,0,0,0,0],"y":[-30,-40,-20,-5,5,15],"z":[-5,-5,-3,0,0,0]},"width":[0,5,8,11,9,0],"height":[0,5,8,11,10,0],"angle":0,"texture":[4,8,10,63,4]},"cannon1":{"section_segments":8,"offset":{"x":10,"y":30,"z":11},"position":{"x":[0,0,0,0,0,0],"y":[10,-20,-10,-5,5,15],"z":[0,0,0,0,0,0]},"width":[0,28,30,30,30,30],"height":[0,15,16,16,16,16],"angle":0,"texture":[6,8,63,63,4]},"cannon2":{"section_segments":8,"offset":{"x":37,"y":45,"z":20},"position":{"x":[0,0,0,4,4,4],"y":[-10,-20,-10,-5,15,10],"z":[0,0,0,0,0,0]},"width":[0,7,10,10,10,0],"height":[0,8,10,10,10,0],"propeller":true,"angle":0,"texture":[4,8,63,11,17]},"cannon3":{"section_segments":8,"offset":{"x":43,"y":45,"z":4},"position":{"x":[0,0,0,4,4,4],"y":[-10,-20,-10,-5,15,10],"z":[0,0,0,0,0,0]},"width":[0,7,10,10,10,0],"height":[0,8,10,10,10,0],"propeller":true,"angle":0,"texture":[4,8,63,11,17]},"cannon4":{"section_segments":6,"offset":{"x":15,"y":40,"z":29},"position":{"x":[0,0,0,0,0,0],"y":[-10,-20,-10,-5,5,20],"z":[2,2,2,0,0,-5]},"width":[0,5,5,5,5,0],"height":[0,4,4,5,5,0],"angle":180,"texture":[4,8,63,11,4],"propeller":false}},"wings":{"main":{"length":[10,20],"width":[30,20,10],"angle":[0,-50],"position":[0,0,10],"doubleside":true,"offset":{"x":20,"y":-40,"z":10},"bump":{"position":30,"size":20},"texture":[11,63]}},"typespec":{"name":"Zerd Booster","level":1,"model":4,"code":104,"specs":{"shield":{"capacity":[150,150],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[13,13]},"ship":{"mass":140,"speed":[160,160],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[200,200],"speed":[160,160],"acceleration":[160,160],"initial_energy":[50,50],"energy":[0,0]}}},"shape":[3.08,2.968,2.358,2.066,1.708,1.619,1.572,1.55,1.483,0.805,0.781,0.771,0.783,0.81,0.852,1.176,1.625,1.973,2.187,2.317,2.18,1.989,2.577,2.765,2.708,2.665,2.708,2.765,2.577,1.989,2.18,2.317,2.187,1.973,1.625,1.176,0.852,0.81,0.784,0.771,0.781,0.805,1.483,1.55,1.572,1.619,1.708,2.066,2.358,2.968],"lasers":[],"radius":3.08}}';
  86. var LGViper = '{"name":"LG Viper","level":1,"model":5,"size":0.7,"specs":{"shield":{"capacity":[140,140],"reload":[5,5]},"generator":{"capacity":[150,150],"reload":[17,17]},"ship":{"mass":100,"speed":[150,150],"rotation":[60,60],"acceleration":[120,120],"dash":{"rate":2,"burst_speed":[205,205],"speed":[170,170],"acceleration":[150,150],"initial_energy":[40,40],"energy":[25,25]}}},"bodies":{"main":{"section_segments":8,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-110,-60,-99,-90,-70,0,50,70],"z":[0,0,0,0,0,0,0,5,1]},"width":[2,4,15,16,25,35,20,0],"height":[0,4,2,4,8,13,10,3],"texture":[5,17,5,1,1,1,1]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-15,"z":15},"position":{"x":[0,0,0,0,0,0],"y":[-55,-40,-25,0,5],"z":[0,0,0,0,9,9]},"width":[0,10,15,20,10],"height":[0,10,10,10,0],"texture":[9]},"cockpitDeco":{"section_segments":12,"offset":{"x":20,"y":8,"z":18},"position":{"x":[-4,0,0,-10],"y":[-75,-70,-20,0],"z":[0,0,0,-10]},"width":[1,2,4,2],"height":[1,1,2,2],"texture":[5],"angle":10},"cockpitDeco2":{"section_segments":12,"offset":{"x":0,"y":-11,"z":22},"position":{"x":[1.5,-3,-3,1.5],"y":[-16,-1,-1,16],"z":[0,0,0,0]},"width":[2,2,2,2],"height":[1,1,1,1],"texture":[5],"angle":90},"logo4":{"section_segments":4,"offset":{"x":0,"y":40,"z":20},"position":{"x":[0,0,0,0,0,0,0,0],"y":[120,10],"z":[-1.5,6]},"width":[1,1],"height":[1,1],"texture":[5],"angle":180},"engines1":{"section_segments":6,"offset":{"x":48,"y":34,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-20,0,2,-10],"z":[0,0,0,0,0,0,0,0]},"width":[7,7,5,0],"height":[0,2,1,0,10,0],"texture":[1,1,17],"angle":0,"propeller":true},"engines2":{"section_segments":6,"offset":{"x":60,"y":30,"z":-1},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-20,0,2,-10],"z":[0,0,0,0,0,0,0,0]},"width":[7,7,5,0],"height":[0,2,1,0,10,0],"texture":[1,1,17],"angle":0,"propeller":true},"engines3":{"section_segments":6,"offset":{"x":72,"y":25,"z":-4},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-20,0,2,-10],"z":[0,0,0,0,0,0,0,0]},"width":[7,7,5,0],"height":[0,2,1,0,10,0],"texture":[1,1,17],"angle":0,"propeller":true},"headlights":{"section_segments":8,"offset":{"x":50,"y":-50,"z":5},"position":{"x":[0,-1,0,1,1,0],"y":[-15,-20,-10,0,10,20,15,0],"z":[0,-3,0,0,0,-2,0,0,0]},"width":[0,9,10,8,7,5,5,0],"height":[0,6,4,2,0,0,0,0],"texture":[17,4,3,10,3],"propeller":false,"angle":-3},"turbine":{"section_segments":12,"offset":{"x":0,"y":30,"z":35},"position":{"x":[0,0,0,0,0,0,0],"y":[-20,-25,-20,0,20,30,40],"z":[0,0,0,0,0,-10,-20]},"width":[0,10,13,13,13,13,8],"height":[0,18,23,23,15,10,5],"angle":0,"texture":[17,5,1,1,1,1,1,1,1]},"turbineDeco":{"section_segments":10,"offset":{"x":13,"y":35,"z":43},"position":{"x":[0,0,0,0,0],"y":[0,1,10],"z":[0,0,0,0,0]},"width":[0,3,3],"height":[0,10,10],"texture":[5],"angle":-90},"turbineDeco2":{"section_segments":10,"offset":{"x":13,"y":20,"z":45},"position":{"x":[0,0,0,0,0],"y":[0,1,10],"z":[0,0,0,0,0]},"width":[0,3,3],"height":[0,10,10],"texture":[5],"angle":-90},"BackDeco":{"section_segments":10,"offset":{"x":32,"y":30,"z":10},"position":{"x":[0,0,0,0,0],"y":[-10,10,10],"z":[10,0,0,0,0]},"width":[0,15,15],"height":[0,5,5],"texture":[18],"angle":-90},"fukkenLongLine":{"section_segments":6,"offset":{"x":50,"y":-45,"z":7},"position":{"x":[-13,-5,0,0,0,0,0,-20,-30],"y":[-105,-80,-60,-40,-10,20,40,60,80],"z":[-5,-5,-5,-5,-10,-2.5,0,0,0,0]},"width":[1,1,1,1,1,1,1,4],"height":[1,1,1,1,1,1,1,1],"texture":[5],"angle":0}},"wings":{"outer":{"offset":{"x":35,"y":-115,"z":0},"length":[1,30,20],"width":[0,190,150,50],"angle":[0,-8,-8,-8],"position":[100,57,70,100],"texture":[1,1,10,10],"doubleside":true,"bump":{"position":30,"size":5}},"inner":{"offset":{"x":-36,"y":-90,"z":0},"length":[25],"width":[165,10],"angle":[8],"position":[20,100],"texture":[1,1],"doubleside":true,"bump":{"position":0,"size":5}}},"typespec":{"name":"GLS Viper","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[140,140],"reload":[5,5]},"generator":{"capacity":[150,150],"reload":[17,17]},"ship":{"mass":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]}}},"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}}';
  87. var VoidA = '{"name":"V1","level":1,"model":6,"size":1,"specs":{"shield":{"capacity":[130,130],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":100,"speed":[155,155],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[230,230],"speed":[160,160],"acceleration":[180,180],"initial_energy":[45,45],"energy":[35,35]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":-10,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-90,-75,-20,0,50,105,90],"z":[0,0,0,0,0,0,0]},"width":[0,15,25,25,25,25,0],"height":[0,10,20,20,20,20,0],"propeller":true,"texture":[63,2,2,10,4,17]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-30,"z":12},"position":{"x":[0,0,0,0,0,0,0],"y":[-50,-30,10,30,40],"z":[0,0,0,0,0]},"width":[0,10,15,15,5],"height":[0,18,25,25,5],"propeller":false,"texture":9},"deco":{"section_segments":8,"offset":{"x":23,"y":20,"z":10},"position":{"x":[5,5,10,10,10,10,10],"y":[-52,-50,-20,0,20,70,65],"z":[0,0,0,0,0,0,0]},"width":[0,10,15,15,15,15,0],"height":[0,10,10,10,10,10,0],"angle":0,"propeller":true,"texture":[4,3,4,10,4,17]},"cannons":{"section_segments":12,"offset":{"x":33,"y":40,"z":20},"position":{"x":[0,0,0,0,0,0,0],"y":[-30,-40,-20,0,20,40,42],"z":[0,-5,-1,0,0,0,0]},"width":[0,5,6,10,10,7.5,0],"height":[0,5,5,5,5,5,0],"angle":0,"propeller":false,"texture":[4,4,10,4,63,4]}},"wings":{"main":{"length":[80,40],"width":[80,50,30],"angle":[0,90],"position":[30,50,80],"doubleside":true,"bump":{"position":30,"size":10},"texture":[11,63],"offset":{"x":-10,"y":0,"z":0}}},"typespec":{"name":"Void","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[130,130],"reload":[7,7]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":100,"speed":[155,155],"rotation":[50,50],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[230,230],"speed":[160,160],"acceleration":[180,180],"initial_energy":[45,45],"energy":[35,35]}}},"shape":[2,1.884,1.664,1.257,1.029,0.881,0.906,0.968,0.954,0.925,0.913,0.928,0.958,0.967,0.991,1.513,1.638,1.818,2.034,2.241,2.36,2.04,1.989,1.965,1.934,1.904,1.934,1.965,1.989,2.04,2.36,2.241,2.034,1.818,1.638,1.513,0.991,0.967,0.96,0.928,0.913,0.925,0.954,0.968,0.906,0.881,1.029,1.257,1.664,1.884],"lasers":[],"radius":2.36}}';
  88. var Blackbird = '{"name":"Blackbird","level":1,"model":7,"size":0.8,"specs":{"shield":{"capacity":[250,250],"reload":[6,6]},"generator":{"capacity":[140,140],"reload":[15,15]},"ship":{"mass":170,"speed":[140,140],"rotation":[55,55],"acceleration":[150,150]}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0],"y":[-300,-200,-160,-100,0,100,180,250,260],"z":[0,0,0,0,0,0,0,0,0]},"width":[0,20,25,25,25,25,20,8,0],"height":[0,20,25,25,25,25,20,8,0],"propeller":false,"texture":[1,1,10,10,1,10,1,63]},"main2":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0],"y":[-300,-200,-160,-100,0,100,180,250,250],"z":[0,0,0,0,0,0,0,0,0]},"width":[0,39,44,44,44,44,39,8,0],"height":[0,8,13,13,13,13,8,4,0],"propeller":false,"texture":[63]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-200,"z":0},"position":{"x":[0,0,0,0,0,0,0],"y":[-25,-10,16,30,45],"z":[13,16,19,21,23]},"width":[0,8,12,10,0],"height":[0,8,14,10,0],"propeller":false,"texture":[9,9,1,1,1]},"propulsors":{"section_segments":12,"offset":{"x":110,"y":-14,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0],"y":[-40,10,0,0,24,130,190,220,180],"z":[0,0,0,0,0,0,0,0,0]},"width":[0,16,18,18,23,23,23,18,0],"height":[0,16,18,18,23,23,23,18,0],"propeller":true,"texture":[4,3,1,63,10,63,8,17]},"deco":{"section_segments":8,"offset":{"x":132,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[12,30,45,100,120],"z":[0,0,0,0,0]},"width":[0,10,13,8,0],"height":[0,10,10,10,0],"texture":[4],"angle":0,"propeller":false}},"wings":{"main":{"length":[50,30,30,50],"width":[300,180,100,100,30],"angle":[0,0,0,0],"position":[30,70,70,100,120],"bump":{"position":0,"size":0},"offset":{"x":30,"y":55,"z":0},"texture":[11,1,10,63],"doubleside":true},"winglets":{"doubleside":true,"offset":{"x":110,"y":170,"z":23},"length":[13,33,13],"width":[100,100,50],"angle":[110,110,110],"position":[-5,10,20,0],"texture":[1,63],"bump":{"position":0,"size":0}}},"typespec":{"name":"Blackbird","level":3,"model":1,"code":301,"specs":{"shield":{"capacity":[250,250],"reload":[6,6]},"generator":{"capacity":[140,140],"reload":[15,15]},"ship":{"mass":170,"speed":[140,140],"rotation":[55,55],"acceleration":[150,150]}},"shape":[6,5.13,3.999,2.697,1.949,1.546,1.304,1.161,1.132,2.451,2.43,2.466,2.618,2.715,2.96,3.093,3.24,3.447,5.211,5.374,5.135,5.005,5.061,4.672,4.738,5.2,4.738,4.672,5.061,5.005,5.135,5.374,5.211,3.447,3.24,3.093,2.96,2.715,2.618,2.466,2.43,2.451,1.132,1.161,1.304,1.546,1.949,2.697,3.999,5.13],"lasers":[],"radius":6}}';
  89. var Starsurfer = '{"name":"Starsurfer","level":1,"model":8,"size":1.3,"specs":{"shield":{"capacity":[230,230],"reload":[7,7]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":130,"speed":[140,140],"rotation":[40,40],"acceleration":[210,210],"dash":{"rate":2,"burst_speed":[200,20],"speed":[165,165],"acceleration":[230,230],"initial_energy":[45,45],"energy":[27,27]}}},"bodies":{"mainBody":{"section_segments":6,"offset":{"x":20,"y":20,"z":5},"position":{"x":[-20,-20,-5,0,0,0,0,0,-10,-10],"y":[-145,-140,-120,-90,-30,-20,-15,15,40,40],"z":[-5,-5,-5,-5,-5,0,0,0,0,0,0]},"width":[0,20,20,20,20,15,15,15,15,0],"height":[0,10,10,10,10,10,10,10,15,0],"texture":[4]},"engineBottom":{"section_segments":6,"offset":{"x":0,"y":50,"z":-3},"position":{"x":[0,0,0,0,0,0],"y":[-20,-15,15,20,15],"z":[0,0,0,0,0,0]},"width":[0,28,28,26,0],"height":[0,9,9,6,0],"texture":[3,3,2,17],"propeller":true},"engineTop":{"section_segments":6,"offset":{"x":0,"y":50,"z":13},"position":{"x":[0,0,0,0,0,0],"y":[-20,-15,15,20,15],"z":[0,0,0,0,0,0]},"width":[0,24,24,22,0],"height":[0,9,9,6,0],"texture":[3,3,2,17],"propeller":true},"reactor":{"section_segments":8,"offset":{"x":0,"y":8,"z":12},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-25,-20,-10,0,10,20,25,35],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,15,15,15,15,15,15,5,0],"height":[0,15,15,15,15,15,15,5,0],"texture":[1,1,17,1,17,1,1]},"bottom":{"section_segments":6,"offset":{"x":0,"y":20,"z":-3},"position":{"x":[0,0,0,0,0,0],"y":[-141,-125,15,20],"z":[-5,0,0,0,0,0]},"width":[0,15,15,0],"height":[0,10,10,0],"texture":[2]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-5,"z":12},"position":{"x":[0,0,0,0,0,0],"y":[-95,-62,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,15,0],"height":[0,8,15,13,0],"texture":[9]},"cockpit2":{"section_segments":8,"offset":{"x":0,"y":-5,"z":10},"position":{"x":[0,0,0,0,0,0],"y":[-115,-100,-55,-25,20],"z":[0,0,0,0,0,0]},"width":[0,12,15,20,16],"height":[0,4,12,4,0],"texture":[13,18,8,1]},"backStructural":{"section_segments":6,"offset":{"x":32,"y":15,"z":0},"position":{"x":[0,5,5,0,0,0],"y":[-20,-15,40,50],"z":[0,0,0,0,0,0]},"width":[3,3,3,3],"height":[3,3,3,3],"texture":[1]},"backStructura2":{"section_segments":6,"offset":{"x":32,"y":65,"z":0},"position":{"x":[0,0,0,0,0],"y":[-20,0,3],"z":[-3,0,0,0,0,0]},"width":[3,3,0],"height":[3,3,0],"angle":90,"texture":[1]}},"wings":{"defense1":{"doubleside":true,"offset":{"x":37,"y":35,"z":0},"length":[-9,-4,-20],"width":[5,5,20,20],"angle":[280,315,330],"position":[0,0,0,0],"texture":[3,18],"bump":{"position":0,"size":-10}},"defense2":{"doubleside":true,"offset":{"x":37,"y":10,"z":0},"length":[-9,-4,-20],"width":[5,5,20,20],"angle":[280,315,330],"position":[0,0,0,0],"texture":[3,18],"bump":{"position":0,"size":-10}}},"typespec":{"name":"Starsurfer","level":1,"model":8,"code":108,"specs":{"shield":{"capacity":[230,230],"reload":[7,7]},"generator":{"capacity":[150,150],"reload":[20,20]},"ship":{"mass":130,"speed":[140,140],"rotation":[40,40],"acceleration":[210,210],"dash":{"rate":2,"burst_speed":[200,20],"speed":[165,165],"acceleration":[230,230],"initial_energy":[45,45],"energy":[27,27]}}},"shape":[4,3.936,3.714,3.346,2.711,2.223,1.866,1.629,1.47,1.358,1.278,1.226,1.266,1.277,1.306,1.36,1.441,1.563,1.731,1.988,2.241,2.393,2.391,2.353,2.28,2.244,2.28,2.353,2.391,2.393,2.241,1.988,1.731,1.563,1.441,1.36,1.306,1.277,1.267,1.226,1.278,1.358,1.47,1.629,1.866,2.223,2.711,3.346,3.714,3.936],"lasers":[],"radius":4}}';
  90. var ZerdTurbine = '{"name":"Z Tri-turbine","level":1,"model":9,"size":1.3,"specs":{"shield":{"capacity":[200,200],"reload":[3,3]},"generator":{"capacity":[60,60],"reload":[15,15]},"ship":{"mass":140,"speed":[135,135],"rotation":[80,80],"acceleration":[200,200],"dash":{"rate":1,"burst_speed":[205,205],"speed":[170,170],"acceleration":[250,250],"initial_energy":[30,30],"energy":[25,25]}}},"bodies":{"main1":{"section_segments":12,"offset":{"x":57,"y":-55,"z":-11},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-55,-33,-40,0,10,40,48,66,77,67],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,6,15,20,14,14,20,20,15,0],"height":[0,6,15,20,14,14,20,20,15,0],"propeller":true,"texture":[4,18,10,63,8,63,11,12,17]},"main2":{"section_segments":12,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-55,-60,-50,-20,10,15,45,75,60],"z":[-7,-7,-5,0,0,0,0,0,0]},"width":[0,8,15,25,25,20,20,14,0],"height":[0,6,10,15,18,18,18,14,0],"propeller":true,"texture":[12,63,10,1,5,8,12,17]},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-48,"z":22},"position":{"x":[0,0,0,0,0,0],"y":[-5,10,30,60],"z":[-20,-8,0,0]},"width":[5,8,12,5],"height":[4,10,10,5],"propeller":false,"texture":[7,9,4,4]},"cannons":{"section_segments":6,"offset":{"x":20,"y":30,"z":15},"position":{"x":[0,0,0,0,0,0],"y":[-60,-70,-30,0,25,30],"z":[0,0,0,0,0,0]},"width":[0,5,6,11,7,0],"height":[0,5,6,11,7,0],"angle":180,"texture":[3,8,10,63]},"cannons2":{"section_segments":6,"offset":{"x":27,"y":0,"z":-5},"position":{"x":[0,0,0,0,0,0],"y":[-70,-80,-35,0,25,30],"z":[0,0,0,0,0,0]},"width":[0,5,6,11,7,0],"height":[0,5,6,11,7,0],"angle":180,"texture":[3,8,10,63]}},"wings":{"main1":{"length":[20,20],"width":[50,30,15],"angle":[-10,-15],"position":[0,-20,-11],"doubleside":true,"offset":{"x":20,"y":-12,"z":5},"bump":{"position":35,"size":15},"texture":[11,63]},"main2":{"length":[30],"width":[33,15],"angle":[-20],"position":[0,20],"doubleside":true,"offset":{"x":65,"y":-33,"z":-9},"bump":{"position":30,"size":15},"texture":[8]}},"typespec":{"name":"Fly","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[200,200],"reload":[3,3]},"generator":{"capacity":[60,60],"reload":[15,15]},"ship":{"mass":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]}}},"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}}';
  91. var Arrowhead = '{"name":"Arrowhead","level":1,"model":10,"size":1,"scale":0.65,"specs":{"shield":{"capacity":[120,120],"reload":[7,7]},"generator":{"capacity":[140,140],"reload":[25,25]},"ship":{"mass":70,"speed":[165,165],"rotation":[30,30],"acceleration":[250,250]}},"bodies":{"main":{"section_segments":11,"offset":{"x":0,"y":-50,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[0,6,12,48,77,110,137,141],"z":[0,0,0,0,0,0,0,0]},"width":[0,15,15,15,15,15,23,0],"height":[0,1,1,15,15,14,23,0],"texture":[9,3,2,8,3,2,3]},"engines":{"section_segments":12,"offset":{"x":0,"y":-15,"z":0},"position":{"x":[0,0,0,0,0,0],"y":[40,74,98,113,100,150],"z":[10,0,0,0,0,0,0]},"width":[0,10,14,20,0],"height":[0,11,14,20,0],"texture":[3,3,3,17],"propeller":true},"engineSpike":{"section_segments":12,"offset":{"x":0,"y":105,"z":0},"position":{"x":[0,0,0,0,0,0],"y":[-20,40,0],"z":[0,0,0]},"width":[15,8,0],"height":[15,8,0],"texture":[17],"propeller":true},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-75,"z":5},"position":{"x":[0,0,0,0,0],"y":[0,40,66,84,89],"z":[-8,-2,-1,1,20]},"width":[0,15,15,10,10],"height":[0,15,15,10],"texture":[9],"propeller":false}},"wings":{"bottom":{"offset":{"x":3,"y":-115,"z":0},"length":[0,2,12,2,4,38],"width":[165,235,390,232,167,122,35],"angle":[25,0,0,0,0,0],"position":[20,54,54,47,79,100,101],"texture":[8,1,4,2,2,4],"doubleside":true,"bump":{"position":30,"size":4}},"top":{"offset":{"x":0,"y":-125,"z":0},"length":[60],"width":[250,0],"angle":[10],"position":[0,60],"texture":[63,63],"doubleside":true,"bump":{"position":100,"size":4}},"deco1":{"offset":{"x":7,"y":10,"z":8},"length":[40,5],"width":[50,0,0],"angle":[6,7],"position":[40,-30],"texture":[19],"doubleside":false,"bump":{"position":100,"size":4}},"cockpitFront":{"offset":{"x":0,"y":-57,"z":-2},"length":[10,20],"width":[30,30,30],"angle":[-10,-10,0,0,0,0],"position":[-2,10,30],"texture":[4],"doubleside":true,"bump":{"position":30,"size":50}}},"typespec":{"name":"Arrow Head","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[120,120],"reload":[7,7]},"generator":{"capacity":[140,140],"reload":[25,25]},"ship":{"mass":70,"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}}';
  92. var SweptWingedRacecraft = '{"name":"Swept-Winged Racecraft","level":1,"model":11,"size":1,"specs":{"shield":{"capacity":[150,150],"reload":[6,6]},"generator":{"capacity":[120,120],"reload":[20,20]},"ship":{"mass":140,"speed":[140,140],"rotation":[45,45],"acceleration":[160,160],"dash":{"rate":2,"burst_speed":[255,255],"speed":[185,185],"acceleration":[180,180],"initial_energy":[55,55],"energy":[37,37]}}},"bodies":{"main":{"section_segments":12,"offset":{"x":0,"y":0,"z":10},"position":{"x":[0,0,0,0,0,0,0,0],"y":[-130,-115,-90,0,50,105,90],"z":[0,0,0,0,0,0,0]},"width":[0,15,25,30,35,20,0],"height":[0,10,15,25,25,20,0],"propeller":true,"texture":[63,3,2,1,4,12]},"cockpit":{"section_segments":12,"offset":{"x":0,"y":-20,"z":20},"position":{"x":[0,0,0,0,0,0,0],"y":[-90,-10,40,70,80],"z":[0,0,0,0,0]},"width":[0,10,15,10,5],"height":[0,18,25,18,5],"propeller":false,"texture":[4,9,4,4]},"cannon":{"section_segments":6,"offset":{"x":0,"y":-100,"z":10},"position":{"x":[0,0,0,0,0,0],"y":[-70,-50,-20,0,20,50],"z":[0,0,0,0,0,0]},"width":[0,5,10,10,15,0],"height":[0,5,10,10,15,0],"angle":0,"texture":[63]},"deco":{"section_segments":8,"offset":{"x":30,"y":50,"z":-5},"position":{"x":[0,0,5,5,0,0,0],"y":[-52,-50,-20,0,20,40,30],"z":[10,10,10,0,0,0,0]},"width":[0,5,10,10,15,15,0],"height":[0,5,10,15,10,15,0],"angle":0,"texture":[4],"propeller":true},"deco2":{"section_segments":8,"offset":{"x":30,"y":50,"z":20},"position":{"x":[0,0,5,5,0,0,0],"y":[-52,-50,-20,0,20,40,30],"z":[-10,-10,-10,0,0,0,0]},"width":[0,5,10,10,15,15,0],"height":[0,5,10,15,10,15,0],"angle":0,"texture":[4],"propeller":true}},"wings":{"main":{"length":[30,20],"width":[120,50,40],"angle":[-10,20],"position":[100,-50,30],"doubleside":true,"bump":{"position":30,"size":10},"texture":[11,63],"offset":{"x":0,"y":-60,"z":0}},"main2":{"length":[30,20],"width":[120,50,40],"angle":[10,-20],"position":[100,-50,30],"doubleside":true,"bump":{"position":30,"size":10},"texture":[11,63],"offset":{"x":0,"y":-60,"z":0}},"winglets":{"length":[40],"width":[40,20,30],"angle":[10,-10],"position":[-40,-60,-55],"bump":{"position":0,"size":30},"texture":63,"offset":{"x":0,"y":0,"z":-5}},"stab":{"length":[80,10],"width":[60,40,50],"angle":[0,30],"position":[50,75,90],"doubleside":true,"texture":[63,4],"bump":{"position":0,"size":20},"offset":{"x":0,"y":-20,"z":10}}},"typespec":{"name":"Swept-Winged Racecraft","level":3,"model":1,"code":301,"specs":{"shield":{"capacity":[150,150],"reload":[6,6]},"generator":{"capacity":[120,120],"reload":[20,20]},"ship":{"mass":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]}}},"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}}';
  93. var Sidecutter = '{"name":"Sidecutter","level":1,"model":12,"size":1,"specs":{"shield":{"capacity":[150,150],"reload":[10,10]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":100,"speed":[135,135],"rotation":[90,90],"acceleration":[100,100],"dash":{"rate":1,"burst_speed":[220,220],"speed":[200,200],"acceleration":[90,90],"initial_energy":[10,10],"energy":[100,100]}}},"bodies":{"main":{"section_segments":8,"offset":{"x":10,"y":0,"z":0},"position":{"x":[10,10,10,5,-10,-10,-10,-10,-10,-10],"y":[-120,-125,-100,-90,20,40,55,90,85,80],"z":[0,0,0,0,0,0,0,0,0]},"width":[0,3,3,10,30,35,35,30,25,0],"height":[0,3,3,3,20,25,25,20,15,0],"texture":[4,13,11,10,2,12,11,18,17],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-80,"z":0},"position":{"x":[0,0,0,0,0,0,0],"y":[-10,10,80,100,130],"z":[0,0,12,15,9]},"width":[10,10,10,15,15],"height":[0,10,10,10,15],"texture":[4,4,9]},"engines":{"section_segments":10,"offset":{"x":105,"y":-15,"z":0},"position":{"x":[0,0,0,0,0,0,0,0],"y":[0,70,85,95,100,105,110,100],"z":[0,0,0,0,0,0,0,0]},"width":[4,10,20,25,28,30,24,0],"height":[0,9,9,10,11,12,8,0],"texture":[4,10,1,63,2,18,17]},"flames":{"section_segments":10,"offset":{"x":105,"y":15,"z":0},"position":{"x":[0],"y":[110],"z":[0]},"width":[24],"height":[8],"propeller":true,"texture":[1]}},"wings":{"main":{"doubleside":true,"offset":{"x":30,"y":50,"z":0},"length":[10,0,25,0,40,70],"width":[30,90,350,290,240,100,40],"angle":[0,0,0,0,0,0,0],"position":[0,-5,-135,-107,-82,-17,3],"texture":[11,63,63,11,11,11],"bump":{"position":45,"size":5}}},"typespec":{"name":"Sidecutter","level":1,"model":1,"code":101,"specs":{"shield":{"capacity":[150,150],"reload":[10,10]},"generator":{"capacity":[200,200],"reload":[20,20]},"ship":{"mass":100,"speed":[135,135],"rotation":[90,90],"acceleration":[100,100],"dash":{"rate":1,"burst_speed":[220,220],"speed":[200,200],"acceleration":[90,90],"initial_energy":[10,10],"energy":[100,100]}}},"shape":[1.814,5.261,4.975,4.206,3.157,2.782,2.527,2.358,2.237,2.154,2.118,2.202,2.562,3.146,3.612,3.762,3.792,3.228,3.193,2.774,2.258,2.101,1.985,1.892,1.832,1.803,1.832,1.892,1.985,2.101,2.258,2.774,3.193,3.228,3.792,3.762,3.612,3.146,2.576,2.202,2.118,2.154,2.237,2.358,2.527,2.782,3.157,4.206,4.975,5.261],"lasers":[],"radius":5.261}}';
  94.  
  95. ships = [];
  96. shipInfos = [];
  97.  
  98. ships.push(Astral);
  99. shipInfos.push({company:"FinaDrive", creator:"Finalizer",
  100. desc:"Powerful boost, high cruising speed,\n amazing hot look. What else do you need?"});
  101.  
  102. ships.push(ShadowX1);
  103. shipInfos.push({company:"Starblast", creator:"pmgl",
  104. 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."});
  105.  
  106. ships.push(RADDiamondLancer);
  107. shipInfos.push({company:"RAD Diamond", creator:"UranusOrbiter",
  108. desc:"It might look a bit weird and feel sluggish, \nbut it's strength is it's boost tank. \nHold that dash button."});
  109.  
  110. ships.push(ZerdBooster);
  111. shipInfos.push({company:"ZerdTech", creator:"Revenge Zerd",
  112. desc:"Beautiful and powerful, this lovely rocket \ncan change. It's. Movement. Direction. Instantly."});
  113.  
  114. ships.push(LGViper);
  115. shipInfos.push({company:"Halo L.Starships", creator:"L.Gaming",
  116. desc:"A sleek, compact, fast ship capable of\n powerful overdrive allowing you to surpass your competition.\n Great handling although low thrust."});
  117.  
  118. ships.push(VoidA);
  119. shipInfos.push({company:"Abyss Racecraft ltd.", creator:"Void",
  120. desc:"Simple, nice-looking racing vehicle. \nNothing too fancy. \nDoes it's job well."});
  121.  
  122. ships.push(Blackbird);
  123. shipInfos.push({company:"Jello's Hangars", creator:"HardBoiledJello",
  124. desc:"Back when humans were struggling to put\n satellites in space, some American humans\n spied on non-American humans using planes\n that looked like this. Since the planes\n looked very cool, we decided to use their design for racing."});
  125.  
  126. ships.push(Starsurfer);
  127. shipInfos.push({company:"SpaceGGFlight", creator:"UranusOrbiter",
  128. 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."});
  129.  
  130. ships.push(ZerdTurbine);
  131. shipInfos.push({company:"ZerdTech", creator:"Revenge Zerd",
  132. 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."});
  133.  
  134. ships.push(Arrowhead);
  135. shipInfos.push({company:"T. T. Tun design bureau", creator:"Cmdre. T. T. Tun",
  136. 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."});
  137.  
  138. ships.push(SweptWingedRacecraft);
  139. shipInfos.push({company:"Chickenman's Coop", creator:"SChickenMan",
  140. 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"});
  141.  
  142. ships.push(Sidecutter);
  143. shipInfos.push({company:"FinaDrive", creator:"Finalizer",
  144. desc:"Boost through your opponents then \n block them with your huge wings. \nIf you can."});
  145.  
  146. for(i =0;i<ships.length;i++){
  147. ships[i] = JSON.parse(ships[i]);
  148. ships[i].typespec.specs.shield.capacity = [1000,1000];
  149. ships[i] = JSON.stringify(ships[i]);
  150. }
  151.  
  152. //mod code - edit at your own risk
  153.  
  154. this.options = {
  155. // see documentation for options reference
  156. //root_mode: "survival",
  157. weapons_store: false,
  158. ships: ships,
  159. map_size: mapSize,
  160. map_id: mapSeed,
  161. asteroids_strength: 10,
  162. crystal_value: 0,
  163. radar_zoom: 1.5
  164. };
  165.  
  166. if(customMap)
  167. this.options.custom_map = map;
  168.  
  169. const map_size = mapSize*5; //the size of the map
  170.  
  171. const checkpointrange = 40; //size of checkpoints
  172. const quickRaceStartTime = 20; //time it takes to start a race if all players are ready
  173. const longRaceStartTime = 60; //time it takes to start a race if some players are ready
  174. const DNFTime = 60; //did not finish time
  175. const finalCountdownTime = 10; //the final countdown before the race
  176. const sandboxAreaSize = 85;
  177. const shipsInLine = 2;
  178. const startingLinesWidth = 30;
  179. const startingLinesDist = 30;
  180. const laps = 5;
  181.  
  182. raceinprogress = false; //whether there's a race going on
  183. racetime = 0; //race timer
  184. lastfinished = 0; //how many players finished
  185. countdown = quickRaceStartTime; //lobby countdown timer(all players ready)
  186. countdownLong = longRaceStartTime; //lobby countdown timer(some players ready)
  187. DNFCountdown = 0; //DNF timer
  188. finalCountdown = 0; //final countdown
  189. raceStarted = false; //whether the final countdown is finished
  190. everySecond = 0;
  191.  
  192. top1time = {name:"", time:-1};
  193. top2time = {name:"", time:-1};
  194. top3time = {name:"", time:-1};
  195.  
  196. ads = [];
  197. adTimer = 0;
  198. adRefreshTime = 10;
  199.  
  200. ads.push("Uranus Racing League by /u/UranusOrbiter aka Uranus_is_big#7833");
  201. ads.push("Uranus Racing League version 0.0003");
  202. ads.push("Have a nice day");
  203.  
  204. ads.push("Huge thanks to pmgl for making all of this possible");
  205. ads.push("Huge thanks to Starblast dev team for making all of this possible");
  206.  
  207. ads.push("Thanks to everybody who helped test this mod");
  208.  
  209. ads.push("Map created by rm -rf / and improved by Uranus");
  210. ads.push("Huge thanks to rm -rf / for creating this beautiful map");
  211.  
  212. distance = function(x, y){
  213. return Math.sqrt(x*x+y*y);
  214. };
  215.  
  216. shortestPath = function(x1, y1, x2, y2){
  217.  
  218. shortestDist = 10000;
  219.  
  220.  
  221. coords = [];
  222.  
  223. xx = x2-x1;
  224. yy = y2-y1;
  225. coords.push(xx, yy);
  226. shortest = [xx, yy];
  227.  
  228. xx = x2+map_size*2-x1;
  229. yy = y2-y1;
  230. coords.push(xx, yy);
  231.  
  232. xx = x2-map_size*2-x1;
  233. yy = y2-y1;
  234. coords.push(xx, yy);
  235.  
  236. xx = x2-x1;
  237. yy = y2+map_size*2-y1;
  238. coords.push(xx, yy);
  239.  
  240. xx = x2-x1;
  241. yy = y2-map_size*2-y1;
  242. coords.push(xx, yy);
  243.  
  244.  
  245. xx = x2+map_size*2-x1;
  246. yy = y2+map_size*2-y1;
  247. coords.push(xx, yy);
  248.  
  249. xx = x2+map_size*2-x1;
  250. yy = y2-map_size*2-y1;
  251. coords.push(xx, yy);
  252.  
  253. xx = x2-map_size*2-x1;
  254. yy = y2+map_size*2-y1;
  255. coords.push(xx, yy);
  256.  
  257. xx = x2-map_size*2-x1;
  258. yy = y2-map_size*2-y1;
  259. coords.push(xx, yy);
  260.  
  261. for(var i = 0; i<9; i++){
  262. dist = distance(coords[i*2], coords[i*2+1]);
  263. if(dist<shortestDist){
  264. shortestDist = dist;
  265. shortest = [coords[i*2], coords[i*2+1]];
  266. }
  267. }
  268.  
  269. return shortest;
  270.  
  271. };
  272.  
  273. writeTextLarge = function(ship, string){
  274. ship.setUIComponent({
  275. id:"largeText",
  276. position:[25,25,50,25],
  277. clickable: false,
  278. visible: true,
  279. components: [
  280. { type: "text",position: [0,0,100,100],color: "#FFFFFF",value: string}
  281. ]
  282. });
  283.  
  284.  
  285. };
  286.  
  287. writeTextSmol = function(ship, string){
  288. ship.setUIComponent({
  289. id:"smolText",
  290. position:[25,10,50,25],
  291. clickable: false,
  292. visible: true,
  293. components: [
  294. { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: string}
  295. ]
  296. });
  297. };
  298.  
  299. randomAd = function(){
  300. adIndex = Math.floor(Math.random()*ads.length);
  301. if(Math.random()<0.5){
  302. shipIndex = Math.floor(Math.random()*shipInfos.length);
  303. if(shipInfos[shipIndex].creator != "UranusOrbiter"){
  304. name = JSON.parse(ships[shipIndex]).name;
  305. for (i=0;i<game.ships.length;i++)
  306. {
  307. ship.setUIComponent({
  308. id:"ad",
  309. position:[25,3,50,25],
  310. clickable: false,
  311. visible: true,
  312. components: [
  313. { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: "Huge thanks to "+shipInfos[shipIndex].creator+" for his "+name+" design"}
  314. ]
  315. });
  316. }
  317. return;
  318. }
  319. }
  320.  
  321. for (i=0;i<game.ships.length;i++)
  322. {
  323. ship.setUIComponent({
  324. id:"ad",
  325. position:[25,3,50,25],
  326. clickable: false,
  327. visible: true,
  328. components: [
  329. { type: "text",position: [0,0,100,20],color: "#FFFFFF",value: ads[adIndex]}
  330. ]
  331. });
  332. }
  333. };
  334.  
  335. announce = function(string){
  336. for (i=0;i<game.ships.length;i++)
  337. {
  338. ship = game.ships[i];
  339. ship.setUIComponent({
  340. id:"announceText",
  341. position:[25,75,50,25],
  342. clickable: false,
  343. visible: true,
  344. components: [
  345. { type: "text",position: [0,0,100,20],color: "#FFBBBB",value: string}
  346. ]
  347. });
  348.  
  349. }
  350. };
  351.  
  352. log = function(string){
  353. game.modding.terminal.echo(string);
  354. }
  355.  
  356. drawTopScores = function(ship, b){
  357. sc1 = "#1 - ";
  358. sc2 = "#2 - ";
  359. sc3 = "#3 - "
  360. if(top1time.time>=0)sc1+=top1time.name+" - "+top1time.time.toFixed(2);
  361. if(top2time.time>=0)sc2+=top2time.name+" - "+top2time.time.toFixed(2);
  362. if(top3time.time>=0)sc3+=top3time.name+" - "+top3time.time.toFixed(2);
  363.  
  364. if(ship.custom.lasttime>=0)
  365. yourLastTime = "your time: " + ship.custom.lasttime.toFixed(2);
  366. else
  367. yourLastTime = "your time: N/A";
  368.  
  369. ship.setUIComponent({
  370. id:"topscores",
  371. position:[60,50,40,25],
  372. clickable: false,
  373. visible: b,
  374. components: [
  375. { type: "text",position: [0,0,100,20],color: "#FFFF33",value: sc1},
  376. { type: "text",position: [0,20,100,20],color: "#BBBBBB",value: sc2},
  377. { type: "text",position: [0,40,100,20],color: "#FFAA33",value: sc3},
  378. { type: "text",position: [0,80,100,20],color: "#FFFFFF",value: yourLastTime}
  379. ]
  380. });
  381.  
  382. };
  383.  
  384. drawShipChooseButtons = function(ship, b){
  385. ship.setUIComponent(
  386. {id: "prevship",
  387. position: [2,40,8,14],
  388. clickable: b,
  389. shortcut: "W",
  390. visible: b,
  391. components: [
  392. { type:"round",position:[0,0,100,100],fill:"#456",stroke:"#CDE",width:2},
  393. { type: "text",position:[10,35,80,30],value:"Previous ship",color:"#CDE"},
  394. { type: "text",position:[20,70,60,20],value:"[W]",color:"#CDE"}
  395. ]
  396.  
  397. }
  398. );
  399.  
  400. ship.setUIComponent(
  401. {id: "nextship",
  402. position: [90,40,8,14],
  403. clickable: b,
  404. shortcut: "E",
  405. visible: b,
  406. components: [
  407. { type:"round",position:[0,0,100,100],fill:"#456",stroke:"#CDE",width:2},
  408. { type: "text",position:[10,35,80,30],value:"Next ship",color:"#CDE"},
  409. { type: "text",position:[20,70,60,20],value:"[E]",color:"#CDE"}
  410. ]
  411.  
  412. }
  413. );
  414.  
  415. }
  416.  
  417. drawReadyButton = function(ship, b){
  418. color = "#AA0000";
  419. text = "NOT READY"
  420. if(ship.custom.ready){
  421. color = "#00AA00";
  422. text = "READY";
  423. }
  424.  
  425. ship.setUIComponent(
  426. {id: "readyToggle",
  427. position: [10,20,8,14],
  428. clickable: b,
  429. shortcut: "U",
  430. visible: b,
  431. components: [
  432. { type:"round",position:[0,0,100,100],fill:color,stroke:"#CDE",width:2},
  433. { type: "text",position:[10,35,80,30],value:text,color:"#CDE"},
  434. { type: "text",position:[20,70,60,20],value:"[U]",color:"#CDE"}
  435. ]
  436.  
  437. }
  438. );
  439. }
  440.  
  441. writeShipInfo = function(ship, b){
  442.  
  443. index = 0;
  444.  
  445. index = ship.custom.type;
  446. if(index>=shipInfos.length)return;
  447. if(index<0)return;
  448.  
  449. if(b)
  450. desc = shipInfos[index].desc.split("\n");
  451. UIDesc = [];
  452.  
  453. if(b)
  454. UIDesc.push(
  455. { type: "text",position: [0,0,100,10],color: "#3333AA",value: shipInfos[index].company},
  456. { type: "text",position: [0,10,100,20],color: "#FFFFFF",value: JSON.parse(ships[index]).name},
  457. { type: "text",position: [0,30,100,10],color: "#AAAAAA",value: "by "+shipInfos[index].creator},
  458. );
  459.  
  460. if(b)
  461. for(i = 0; i<desc.length; i++){
  462. UIDesc.push(
  463. { type: "text",position: [0,40+i*10,100,7],color: "#FFFFFF",value: desc[i]}
  464. );
  465. }
  466.  
  467. ship.setUIComponent({
  468. id:"shipInfo",
  469. position:[4,50,50,50],
  470. clickable: false,
  471. visible: b,
  472. components: UIDesc
  473. });
  474.  
  475. };
  476.  
  477. drawRaceTrack = function(ship, b){
  478.  
  479. positionX = 85;
  480. positionY = 30;
  481.  
  482. size = 10;
  483.  
  484.  
  485.  
  486. ship.setUIComponent({
  487. id:"playerMarker",
  488. position:[positionX, positionY,25,25],
  489. clickable: false,
  490. visible: b,
  491. components: [
  492. { type:"round",position:[0,0,3,4],fill:"#777777",stroke:"#CDE",width:1}
  493. ]
  494. });
  495.  
  496. for(var i = 0; i<checkpoints.length; i++){
  497.  
  498. path = shortestPath(ship.x, ship.y, checkpoints[i].x, checkpoints[i].y);
  499. x = path[0];
  500. y = path[1];
  501.  
  502. chX = x/map_size;
  503. chY = y/map_size;
  504.  
  505. fill = "#00ff00";
  506. if(i<ship.custom.checkpoint)
  507. fill = "#aaaaaa";
  508. else if (i==ship.custom.checkpoint)
  509. fill = "#ff0000";
  510. else if (i==ship.custom.checkpoint+1)
  511. fill = "#3333ff";
  512. else if (i==checkpoints.length)
  513. fill = "#ffffff";
  514.  
  515. ship.setUIComponent({
  516. id:"ch"+i,
  517. position:[positionX + chX*size, positionY - chY*size,25,25],
  518. clickable: false,
  519. visible: b,
  520. components: [
  521. { type:"round",position:[0,0,5,8],fill:fill,stroke:"#CDE",width:1}
  522. ]
  523. });
  524.  
  525. }
  526.  
  527. ship.setUIComponent({
  528. id:"minimap",
  529. position:[positionX-size, positionY-size,100,100],
  530. clickable: false,
  531. visible: b,
  532. components: [
  533. { type:"round",position:[0,0,size*2,size*2],fill:"#222222",stroke:"#CDE",width:1}, ]
  534. });
  535.  
  536. };
  537.  
  538. startRace = function(){
  539. if(!raceinprogress){
  540. lastfinished = 0;
  541. raceinprogress = true;
  542. raceStarted = false;
  543. finalCountdown=finalCountdownTime;
  544. DNFCountdown = DNFTime;
  545.  
  546. top1time.time = -1;
  547. top2time.time = -1;
  548. top3time.time = -1;
  549.  
  550. for (i=0;i<game.ships.length;i++)
  551. {
  552. ship = game.ships[i];
  553. if(!ship)continue;
  554. if(!ship.custom.ready)continue;
  555. ship.custom.lap = 0;
  556. ship.custom.inrace = true;
  557. ship.custom.checkpoint = 0;
  558. ship.custom.lasttime = -1;
  559. drawShipChooseButtons(ship, false);
  560. drawReadyButton(ship, false);
  561. drawTopScores(ship, false);
  562. writeShipInfo(ship, false);
  563. }
  564. log("Race started!");
  565. }else{
  566. log("Race already started");
  567. }
  568. }
  569.  
  570. stopRace = function(){
  571. if(raceinprogress){
  572. raceinprogress = false;
  573. racetime = 0;
  574. countdown = quickRaceStartTime;
  575. countdownLong = longRaceStartTime;
  576. lastfinished = 0;
  577. for (i=0;i<game.ships.length;i++)
  578. {
  579. ship = game.ships[i];
  580. if(!ship)continue;
  581. drawRaceTrack(ship, false);
  582. ship.custom.checkpoint = 0;
  583. ship.custom.ready = false;
  584. drawReadyButton(ship, true);
  585. writeTextSmol(ship,"Press U when ready.");
  586. }
  587. log("Race stopped.");
  588. }else{
  589. log("No race in progress");
  590. }
  591. }
  592.  
  593. //direction from the start to the first checkpoint
  594. firstCheckpointDir = shortestPath(checkpoints[0].x, checkpoints[0].y, checkpoints[1].x, checkpoints[1].y);
  595.  
  596. this.tick = function(game) {
  597. if(game.ships.length<1)return;
  598. var i = 0;
  599. if(raceinprogress)
  600. racetime += 1/60;
  601. everySecond++;
  602. if(everySecond>60){
  603. everySecond-=60;
  604. adTimer++;
  605.  
  606. if(adTimer>adRefreshTime){
  607. adTimer = 0;
  608. randomAd();
  609. }
  610.  
  611.  
  612. //ship initialization
  613. for (i=0;i<game.ships.length;i++)
  614. {
  615. ship = game.ships[i];
  616. if(!ship)continue;
  617. if (!ship.custom.init){
  618. //this is a new ship, we have to set it up
  619. ship.custom.init = true;
  620. ship.custom.inrace = false;
  621. ship.custom.checkpoint = 0;
  622. ship.custom.lasttime = -1;
  623. ship.custom.type = 0;
  624. ship.custom.ready = false;
  625. ship.custom.lap = 0;
  626. ship.set({
  627. x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
  628. y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
  629. });
  630. drawReadyButton(ship, true);
  631. //tell them what to do
  632. if(!raceinprogress) writeTextSmol(ship,"Press U when ready.");
  633. }
  634. if(!ship.custom.inrace)
  635. ship.set({type:101+ship.custom.type});
  636. //no fighting for now
  637. ship.set({invulnerable:400});
  638. if(!ship.alive){
  639. x = 0;
  640. y = 0;
  641. if(ship.custom.inrace){
  642. if(ship.custom.checkpoint == 0){
  643. x = checkpoints[0].x;
  644. y = checkpoints[0].y;
  645. }else{
  646. ch = ship.custom.checkpoint-1;
  647. x = checkpoints[ch].x;
  648. y = checkpoints[ch].y;
  649. }
  650. }else{
  651. x = sandboxArea.x;
  652. y = sandboxArea.y;
  653. }
  654. ship.set({x:x, y:y});
  655. }
  656. }
  657.  
  658. //if there is a race going on
  659. if(raceinprogress){
  660. finalCountdown -= 1; //countdown at the start of the race
  661. ready = true; //whether the race is over
  662. for (i=0;i<game.ships.length;i++) //iterate
  663. {
  664. ship = game.ships[i];
  665. if(!ship)continue;
  666. if(!ship.custom.inrace){
  667. //this ship either finished or just joined, tell them
  668. drawShipChooseButtons(ship, true);
  669. writeTextSmol(ship,"Wait until all players finish the race ("+lastfinished+" so far) or wait " + DNFCountdown + " seconds");
  670. x = sandboxArea.x-ship.x;
  671. y = sandboxArea.y-ship.y;
  672. if(distance(x,y)>sandboxAreaSize)
  673. ship.set({
  674. x:sandboxArea.x-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random(),
  675. y:sandboxArea.y-(sandboxAreaSize/8)+(sandboxAreaSize/4)*Math.random()
  676. })
  677. continue;
  678. }
  679.  
  680. //there are still players racing, so we're not ready to end the race
  681. ready = false;
  682.  
  683. //starting countdown
  684. if(finalCountdown>=0){
  685. //get the direction to the first checkpoint, normalized
  686. dist = distance(firstCheckpointDir[0],firstCheckpointDir[0]);
  687. x = firstCheckpointDir[0]/dist;
  688. y = firstCheckpointDir[1]/dist;
  689. //launchvel represent the initial boop the ships experience when
  690. //the countdown is over
  691. launchvel = 40;
  692. //get a vector perpendicular to the direction to the first checkpoint
  693. perpY = x;
  694. perpX = -y;
  695.  
  696. vx = 0;
  697. vy = 0;
  698. //launch the player as the race starts
  699. if(finalCountdown<1){
  700. raceStarted = true;
  701. racetime = 0;
  702. writeTextLarge(ship,"GO GO GO");
  703. vx = x*launchVel;
  704. vy = y*launchVel;
  705. }else
  706. //output the final countdown
  707. writeTextLarge(ship,""+finalCountdown);
  708. posInLine = i%shipsInLine;
  709. line = Math.floor(i/shipsInLine);
  710. //keep the player at the starting line
  711. ship.set({
  712. x:checkpoints[0].x-perpX*(startingLinesWidth/2) + perpX*(startingLinesWidth)*(posInLine/shipsInLine)+(-y*line*startingLinesDist),
  713. y:checkpoints[0].y-perpY*(startingLinesWidth/2) + perpY*(startingLinesWidth)*(posInLine/shipsInLine)+(-y*line*startingLinesDist),
  714. });
  715. }
  716.  
  717. //update the race track minimap
  718. drawRaceTrack(ship, true);
  719. }
  720. if(lastfinished>0)DNFCountdown--;
  721. if(ready||(lastfinished>0&&DNFCountdown<0)){
  722. if(ready)
  723. log("All players finished");
  724. else log("Race ends - timeout");
  725. stopRace();
  726. }
  727.  
  728. }else{
  729. //whether all players are ready
  730. ready = true;
  731. //whether there's at least one fool that wants a race
  732. atLeastOnePlayer = false;
  733. for (i=0;i<game.ships.length;i++)
  734. {
  735. ship = game.ships[i];
  736. if(!ship)continue;
  737. //check if the ship is in range of starting checkpoint
  738. x = checkpoints[0].x-ship.x;
  739. y = checkpoints[0].y-ship.y;
  740. if(!ship.custom.ready){
  741. //if not, then clearly not all players are ready
  742. ready = false;
  743. drawShipChooseButtons(ship, true);
  744. if(countdownLong<longRaceStartTime-1)
  745. writeTextLarge(ship,"Race starts in "+Math.max(countdown,countdownLong)+" - YOU ARE NOT READY [U]");
  746. else writeTextLarge(ship, "");
  747. continue;
  748. }else atLeastOnePlayer = true;//otherwise at least somebody's willing to race
  749. //countdownLong overrides countdown
  750.  
  751.  
  752. if(countdownLong<countdown)countdown=countdownLong;
  753.  
  754. //if the countdown is at maximum, we're probably still waiting for players
  755. if(countdown>=quickRaceStartTime-1)
  756. writeTextLarge(ship,"Waiting for other players... "+countdownLong);
  757. //otherwise we're starting soon
  758. if(countdown<quickRaceStartTime-1)writeTextLarge(ship,"Starting in "+countdown+" seconds...");
  759. //if the countdown finished successfuly
  760. if(countdown<0||countdownLong<0){
  761. startRace();
  762. }
  763. }
  764.  
  765. if(atLeastOnePlayer)countdownLong-=1; else{
  766. countdownLong = longRaceStartTime;
  767. }
  768. if(ready)countdown-=1; else{
  769. countdown = quickRaceStartTime;
  770. }
  771.  
  772. }
  773.  
  774. }
  775.  
  776. if(game.step%10==0){
  777. if(raceinprogress)
  778. for (i=0;i<game.ships.length;i++)
  779. {
  780. ship = game.ships[i];
  781. if(!ship)continue;
  782. if(!ship.custom.inrace)continue;
  783. //checkpoint execution
  784. ch = ship.custom.checkpoint;
  785. x = checkpoints[ch].x-ship.x;
  786. y = checkpoints[ch].y-ship.y;
  787. //if we're in range of the next checkpoint
  788. if(distance(x, y)<checkpointrange){
  789.  
  790. //proceed to the next checkpoint
  791. ship.custom.checkpoint=ship.custom.checkpoint+1;
  792.  
  793. //if this is the last checkpoint
  794. if(ship.custom.checkpoint>=checkpoints.length){
  795. if(ship.custom.lap<laps-1){
  796. ship.custom.lap++;
  797. ship.custom.checkpoint = 0;
  798. }else{
  799. //if this is the first ship to finish, start the DNF countdown
  800. if(lastfinished==0)DNFCountdown = DNFTime;
  801. lastfinished++;
  802. if(lastfinished==1){top1time.name = ship.name; top1time.time = racetime;}
  803. if(lastfinished==2){top2time.name = ship.name; top2time.time = racetime;}
  804. if(lastfinished==3){top3time.name = ship.name; top3time.time = racetime;}
  805. log("#"+lastfinished+" - "+racetime + " s");
  806. writeTextLarge(ship,"Your place: "+lastfinished+" in "+racetime.toFixed(2)+"s");
  807. ship.custom.inrace=false;
  808. ship.custom.checkpoint = 0;
  809. ship.custom.lasttime = racetime;
  810. for (j=0;j<game.ships.length;j++)
  811. drawTopScores(game.ships[j], true);
  812. ship.set({score:(checkpoints.length*100000)-(lastfinished*1000)});
  813. }
  814. }else{
  815. ship.set({score:ship.custom.checkpoint*1000+checkpoints.length*ship.custom.lap*1000});
  816. writeTextLarge(ship," ");
  817. if(ship.custom.checkpoint > 1||ship.custom.lap>0){
  818. if(laps>0)
  819. lapText = "(lap "+(ship.custom.lap+1)+"/"+laps+")";
  820. writeTextSmol(ship,"Checkpoint "+ ship.custom.checkpoint + "/"+checkpoints.length+" "+lapText);
  821. } else {
  822. writeTextSmol(ship,"Follow the red dot.");
  823. }
  824. }
  825. }
  826. }
  827.  
  828. }
  829.  
  830. // do mod stuff here ; see documentation
  831. if (game.step%10==0) // ensure this is done only once per second
  832. {
  833. for (i=0;i<game.ships.length;i++)
  834. {
  835. ship = game.ships[i];
  836. if(!ship)continue;
  837. if(!ship.custom.inrace)continue;
  838. ch = ship.custom.checkpoint;
  839. if(ch>=checkpoints.length)continue;
  840. path = shortestPath(ship.x, ship.y, checkpoints[ch].x, checkpoints[ch].y);
  841. x = path[0];
  842. y = path[1];
  843. vis = true;
  844. if(distance(x, y)<checkpointrange)
  845. vis = false;
  846. xx = 25*x/distance(x, y);
  847. yy = 25*y/distance(x, y);
  848. ship.setUIComponent({
  849. id:"nextCh",
  850. position:[50+xx,50-yy,25,25],
  851. clickable: false,
  852. visible: vis,
  853. components: [
  854. { type:"round",position:[0,0,5,10],fill:"#ff0000",stroke:"#CDE",width:1}
  855. ]
  856. });
  857.  
  858. }
  859.  
  860. }
  861. };
  862.  
  863. this.event = function(event,game) {
  864. switch (event.name)
  865. {
  866. case "ui_component_clicked":
  867. var ship = event.ship;
  868. var component = event.id;
  869. if (component == "nextship")
  870. {
  871. ship.custom.type++;
  872. if(ship.custom.type>=ships.length)
  873. ship.custom.type = 0;
  874. writeShipInfo(ship, !ship.custom.inrace);
  875. }
  876. if (component == "prevship")
  877. {
  878. ship.custom.type--;
  879. if(ship.custom.type<0)
  880. ship.custom.type = ships.length-1;
  881. writeShipInfo(ship, !ship.custom.inrace);
  882. }
  883. if (component == "readyToggle"){
  884. ship.custom.ready = !ship.custom.ready;
  885. drawReadyButton(ship, !ship.custom.inrace);
  886. }
  887.  
  888. break;
  889. }
  890. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement