Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let counter1 = 0;
- function makeAutoN(type, sides = 1, name = -1, swivel = false, otherSetting = g.blank) {
- let output = JSON.parse(JSON.stringify(type));
- exports['_auto' + counter] = JSON.parse(JSON.stringify(type));
- let tank = exports['_auto' + counter];
- tank.TURRETS = type.TURRETS;
- /*exports['_turret_type' + counter1] = output.GUNS[i].PROPERTIES.TYPE.TURRETS[i];
- tank.GUNS[i].PROPERTIES.TYPE.TURRETS[i].TYPE = exports['_turret_type' + counter1];*/
- for (let i = 0; i < tank.GUNS.length; i++) try {
- let gun = tank.GUNS[i].PROPERTIES.SHOOT_SETTINGS;
- tank.GUNS[i].PROPERTIES.SHOOT_SETTINGS = combineStats([[
- gun.reload,
- gun.recoil,
- gun.shudder,
- gun.size,
- gun.health,
- gun.damage,
- gun.pen,
- gun.speed,
- gun.maxSpeed,
- gun.range,
- gun.density,
- gun.spray,
- gun.resist
- ], g.auto_turret, otherSetting]);
- exports['_weapon_type' + counter1] = output.GUNS[i].PROPERTIES.TYPE;
- tank.GUNS[i].PROPERTIES.TYPE = exports['_weapon_type' + counter1];
- counter1++;
- } catch (e) {}
- let a = 0,
- turret = a => ([{
- 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],
- TYPE: [tank, {
- LABEL: '',
- BODY: {
- FOV: 2.5
- },
- CONTROLLERS: ['canRepel', 'onlyAcceptInArc', 'mapAltToFire', 'nearestDifferentMaster'],
- COLOR: 16
- }]
- }]);
- if (type.DANGER != null) output.DANGER = type.DANGER >= 7 ? 7 : type.DANGER + 2;
- output.TURRETS = [];
- for (let i = 0; i < sides; i++) {
- output.TURRETS = output.TURRETS.concat(turret(a));
- a += 360 / sides;
- };
- output.LABEL = name === -1 ? type.LABEL + '-' + sides : name;
- output.FACING_TYPE = 'autospin';
- output.GUNS = [];
- counter++;
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement