Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. let counter1 = 0;
  3. function makeAutoN(type, sides = 1, name = -1, swivel = false, otherSetting = g.blank) {
  4.     let output = JSON.parse(JSON.stringify(type));
  5.     exports['_auto' + counter] = JSON.parse(JSON.stringify(type));
  6.     let tank = exports['_auto' + counter];
  7.     tank.TURRETS = type.TURRETS;
  8.     /*exports['_turret_type' + counter1] = output.GUNS[i].PROPERTIES.TYPE.TURRETS[i];
  9.     tank.GUNS[i].PROPERTIES.TYPE.TURRETS[i].TYPE = exports['_turret_type' + counter1];*/
  10.     for (let i = 0; i < tank.GUNS.length; i++) try {
  11.         let gun = tank.GUNS[i].PROPERTIES.SHOOT_SETTINGS;
  12.         tank.GUNS[i].PROPERTIES.SHOOT_SETTINGS = combineStats([[
  13.             gun.reload,
  14.             gun.recoil,
  15.             gun.shudder,
  16.             gun.size,
  17.             gun.health,
  18.             gun.damage,
  19.             gun.pen,
  20.             gun.speed,
  21.             gun.maxSpeed,
  22.             gun.range,
  23.             gun.density,
  24.             gun.spray,
  25.             gun.resist
  26.         ], g.auto_turret, otherSetting]);
  27.         exports['_weapon_type' + counter1] = output.GUNS[i].PROPERTIES.TYPE;
  28.         tank.GUNS[i].PROPERTIES.TYPE = exports['_weapon_type' + counter1];
  29.         counter1++;
  30.     } catch (e) {}
  31.     let a = 0,
  32.         turret = a => ([{
  33.             POSITION: [swivel === true ? (9 / (Math.pow(Math.sqrt(7 / 9), 3))) * (Math.pow(Math.sqrt(7 / 9), sides)) : (11 / (Math.pow(Math.sqrt(0.8, 4), 3))) * (Math.pow(Math.sqrt(0.8, 4), sides)), swivel === true ? 6 : 9, 0, a, swivel === true ? 360 : 360 / sides + 65, swivel === true ? 1 : 0],
  34.             TYPE: [tank, {
  35.                 LABEL: '',
  36.                 BODY: {
  37.                     FOV: 2.5
  38.                 },
  39.                 CONTROLLERS: ['canRepel', 'onlyAcceptInArc', 'mapAltToFire', 'nearestDifferentMaster'],
  40.                 COLOR: 16
  41.             }]
  42.         }]);
  43.     if (type.DANGER != null) output.DANGER = type.DANGER >= 7 ? 7 : type.DANGER + 2;
  44.     output.TURRETS = [];
  45.     for (let i = 0; i < sides; i++) {
  46.         output.TURRETS = output.TURRETS.concat(turret(a));
  47.         a += 360 / sides;
  48.     };
  49.     output.LABEL = name === -1 ? type.LABEL + '-' + sides : name;
  50.     output.FACING_TYPE = 'autospin';
  51.     output.GUNS = [];
  52.     counter++;
  53.     return output;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement