mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Allow 3dp for ship and module discounts
This commit is contained in:
@@ -27,7 +27,7 @@ function normalizePercent(val) {
|
||||
if (val === '' || isNaN(val)) {
|
||||
return 0;
|
||||
}
|
||||
val = Math.round(val * 100) / 100;
|
||||
val = Math.round(val * 1000) / 1000;
|
||||
return val >= 100 ? 100 : val;
|
||||
}
|
||||
|
||||
@@ -512,4 +512,4 @@ export default class Header extends TranslatedComponent {
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ export function toDetailedBuild(buildName, ship) {
|
||||
return data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Instantiates a ship from a ship-loadout object, using the code
|
||||
* @param {Object} detailedBuild ship-loadout object
|
||||
* @return {Ship} Ship instance
|
||||
*/
|
||||
export function fromDetailedBuild(detailedBuild) {
|
||||
let shipId = Object.keys(Ships).find((shipId) => Ships[shipId].properties.name.toLowerCase() == detailedBuild.ship.toLowerCase());
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Module from './Module';
|
||||
import LZString from 'lz-string';
|
||||
import isEqual from 'lodash/lang';
|
||||
import { Modifications } from 'coriolis-data/dist';
|
||||
var zlib = require('zlib');
|
||||
const zlib = require('zlib');
|
||||
|
||||
const UNIQUE_MODULES = ['psg', 'sg', 'bsg', 'rf', 'fs', 'fh'];
|
||||
|
||||
@@ -234,7 +234,7 @@ export default class Ship {
|
||||
}
|
||||
|
||||
// TODO obtain shield boost
|
||||
//return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, this.shieldMultiplier + (multiplierDelta || 0));
|
||||
// return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, this.shieldMultiplier + (multiplierDelta || 0));
|
||||
return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, 0 + (multiplierDelta || 0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user