diff --git a/ChangeLog.md b/ChangeLog.md index 870d1bc0..f064705f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,13 @@ +#2.5.1 + * Passenger count on main page + * AX Modules + * Engineering fixes + * Use coriolis-data 2.5.1 + +#2.5.0 + * willyb321 and myself have conquered engineering. Mainly him though... + * Use coriolis-data 2.5.0 + #2.4.2 Lots of kind people have helped out for this release! Check out the PR history! * Uses coriolis-data update: diff --git a/package-lock.json b/package-lock.json index 1ea63c67..e81bff1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.4.1", + "version": "2.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1943,6 +1943,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -5034,6 +5035,910 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -7860,6 +8765,13 @@ "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", "dev": true }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -9823,6 +10735,7 @@ "anymatch": "1.3.2", "exec-sh": "0.2.1", "fb-watchman": "2.0.0", + "fsevents": "1.1.3", "minimatch": "3.0.4", "minimist": "1.2.0", "walker": "1.0.7", diff --git a/package.json b/package.json index a57defa6..395a33d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.4.2", + "version": "2.5.1", "repository": { "type": "git", "url": "https://github.com/EDCD/coriolis" diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index 37fb865a..680001ba 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -37,10 +37,13 @@ const GRPCAT = { 'ml': 'lasers', 'c': 'projectiles', 'mc': 'projectiles', + 'axmc': 'experimental', 'fc': 'projectiles', + 'rfl': 'experimental', 'pa': 'projectiles', 'rg': 'projectiles', 'mr': 'ordnance', + 'axmr': 'experimental', 'tp': 'ordnance', 'nl': 'ordnance', 'sc': 'scanners', @@ -49,9 +52,11 @@ const GRPCAT = { 'cs': 'scanners', 'kw': 'scanners', 'ws': 'scanners', + 'xs': 'scanners', 'ch': 'defence', 'po': 'defence', 'ec': 'defence', + 'sfn': 'defence' }; // Order here is the order in which items will be shown in the modules menu const CATEGORIES = { @@ -76,6 +81,8 @@ const CATEGORIES = { 'hs': ['hs'], 'defence': ['ch', 'po', 'ec'], 'scanners': ['sc', 'ss', 'cs', 'kw', 'ws'], // Overloaded with internal scanners + // Experimental + 'experimental': ['axmc', 'axmr', 'rfl', 'xs', 'sfn'] }; /** diff --git a/src/app/components/EngagementRange.jsx b/src/app/components/EngagementRange.jsx index 84749a46..87168b20 100644 --- a/src/app/components/EngagementRange.jsx +++ b/src/app/components/EngagementRange.jsx @@ -25,7 +25,7 @@ export default class EngagementRange extends TranslatedComponent { const { ship } = props; - const maxRange = this._calcMaxRange(ship); + const maxRange = Math.round(this._calcMaxRange(ship)); this.state = { maxRange diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index dd1521c8..8eb87450 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -98,8 +98,10 @@ "kw": "Kill Warrant Scanner", "ls": "Life Support", "mc": "Multi-cannon", + "axmc": "AX Multi-cannon", "ml": "Mining Laser", "mr": "Missile Rack", + "axmr": "AX Missile Rack", "mrp": "Module Reinforcement Package", "nl": "Mine Launcher", "pa": "Plasma Accelerator", @@ -116,11 +118,13 @@ "psg": "Prismatic Shield Generator", "pv": "Planetary Vehicle Hangar", "rf": "Refinery", + "rfl": "Remote Release Flak Launcher", "rg": "Rail Gun", "s": "Sensors", "sb": "Shield Booster", "sc": "Stellar Scanners", "scb": "Shield Cell Bank", + "sfn": "Shutdown Field Neutraliser", "sg": "Shield Generator", "ss": "Surface Scanners", "t": "thrusters", @@ -128,6 +132,7 @@ "ul": "Burst Laser", "ws": "Frame Shift Wake Scanner", "rpl": "Repair Limpet Controller", + "xs": "Xeno Scanner", "emptyrestricted": "empty (restricted)", "damage dealt to": "Damage dealt to", "damage received from": "Damage received from", diff --git a/src/app/pages/ShipyardPage.jsx b/src/app/pages/ShipyardPage.jsx index 8ef8f8e4..1e74466f 100644 --- a/src/app/pages/ShipyardPage.jsx +++ b/src/app/pages/ShipyardPage.jsx @@ -25,6 +25,25 @@ function countInt(slot) { this.int[slot.maxClass - 1]++; // Subtract 1 since there is no Class 0 Internal compartment this.intCount++; this.maxCargo += crEligible ? ModuleUtils.findInternal('cr', slot.maxClass, 'E').cargo : 0; + + // if no eligiblity, then assume pce + let passSlotType = null; + let passSlotRating = null; + if (!slot.eligible || slot.eligible.pce) { + passSlotType = 'pce'; + passSlotRating = 'E'; + } else if (slot.eligible.pci) { + passSlotType = 'pci'; + passSlotRating = 'D'; + } else if (slot.eligible.pcm) { + passSlotType = 'pcm'; + passSlotRating = 'C'; + } else if (slot.eligible.pcq) { + passSlotType = 'pcq'; + passSlotRating = 'B'; + } + let passengerBay = passSlotType ? ModuleUtils.findInternal(passSlotType, slot.maxClass, passSlotRating) : null; + this.maxPassengers += passengerBay ? passengerBay.passengers : 0; } /** @@ -39,6 +58,7 @@ function shipSummary(shipId, shipData) { hpCount: 0, intCount: 0, maxCargo: 0, + maxPassengers: 0, hp: [0, 0, 0, 0, 0], // Utility, Small, Medium, Large, Huge int: [0, 0, 0, 0, 0, 0, 0, 0], // Sizes 1 - 8 standard: shipData.slots.standard, @@ -139,15 +159,16 @@ export default class ShipyardPage extends Page { * @param {Object} u Localized unit map * @param {Function} fInt Localized integer formatter * @param {Function} fRound Localized round formatter + * @param {Boolean} highlight Should this row be highlighted * @return {React.Component} Table Row */ - _shipRowElement(s, translate, u, fInt, fRound) { + _shipRowElement(s, translate, u, fInt, fRound, highlight) { let noTouch = this.context.noTouch; return {s.manufacturer} @@ -166,6 +187,7 @@ export default class ShipyardPage extends Page { {fInt(s.topBoost)} {fRound(s.maxJumpRange)} {fInt(s.maxCargo)} + {fInt(s.maxPassengers)} {s.standard[0]} {s.standard[1]} {s.standard[2]} @@ -246,13 +268,26 @@ export default class ShipyardPage extends Page { let shipRows = new Array(shipSummaries.length); let detailRows = new Array(shipSummaries.length); + let lastShipSortValue = null; + let backgroundHighlight = false; + for (let s of shipSummaries) { - detailRows[i] = this._shipRowElement(s, translate, units, fInt, formats.f1); + let shipSortValue = s[shipPredicate]; + if( shipPredicateIndex != undefined ) { + shipSortValue = shipSortValue[shipPredicateIndex]; + } + + if( shipSortValue != lastShipSortValue ) { + backgroundHighlight = !backgroundHighlight; + lastShipSortValue = shipSortValue; + } + + detailRows[i] = this._shipRowElement(s, translate, units, fInt, formats.f1, backgroundHighlight); shipRows[i] = ( {s.name} @@ -293,7 +328,7 @@ export default class ShipyardPage extends Page { {translate('hrd')}   {translate('base')} - {translate('max')} + {translate('max')} @@ -310,22 +345,24 @@ export default class ShipyardPage extends Page { {translate('boost')} {translate('jump')} {translate('cargo')} + {translate('passengers')} {translate('core module classes')} {translate('hardpoints')} {translate('internal compartments')} - {units.CR} - {units.T} - {units['m/s']} - {units['m/s']} -   - {units.MJ} - {units['m/s']} - {units['m/s']} - {units.LY} - {units.T} + {units.CR} + {units.T} + {units['m/s']} + {units['m/s']} +   + {units.MJ} + {units['m/s']} + {units['m/s']} + {units.LY} + {units.T} +   {'pp'} {'th'} {'fsd'} diff --git a/src/app/shipyard/Constants.js b/src/app/shipyard/Constants.js index 262120ef..5763923a 100755 --- a/src/app/shipyard/Constants.js +++ b/src/app/shipyard/Constants.js @@ -58,19 +58,24 @@ export const ModuleGroupToName = { cm: 'Countermeasure', ec: 'Electronic Countermeasure', fc: 'Fragment Cannon', + rfl: 'Remote Release Flak Launcher', hs: 'Heat Sink Launcher', ws: 'Frame Shift Wake Scanner', kw: 'Kill Warrant Scanner', nl: 'Mine Launcher', ml: 'Mining Laser', mr: 'Missile Rack', + axmr: 'AX Missile Rack', pa: 'Plasma Accelerator', po: 'Point Defence', mc: 'Multi-cannon', + axmc: 'AX Multi-cannon', pl: 'Pulse Laser', rg: 'Rail Gun', sb: 'Shield Booster', - tp: 'Torpedo Pylon' + tp: 'Torpedo Pylon', + sfn: 'Shutdown Field Neutraliser', + xs: 'Xeno Scanner' }; let GrpNameToCodeMap = {}; diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js index 9072c2ba..b568ac91 100644 --- a/src/app/utils/CompanionApiUtils.js +++ b/src/app/utils/CompanionApiUtils.js @@ -142,6 +142,8 @@ export function shipFromJson(json) { ship.cargoHatch.enabled = false; ship.cargoHatch.priority = 4; } + + let rootModule; // Add the bulkheads const armourJson = json.modules.Armour.module; @@ -159,13 +161,15 @@ export function shipFromJson(json) { throw 'Unknown bulkheads "' + armourJson.name + '"'; } ship.bulkheads.enabled = true; - if (armourJson.modifiers) _addModifications(ship.bulkheads.m, armourJson.modifiers, armourJson.recipeName, armourJson.recipeLevel); + rootModule = json.modules.Armour; + if (rootModule.WorkInProgress_modifications) _addModifications(ship.bulkheads.m, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); // Add the standard modules // Power plant const powerplantJson = json.modules.PowerPlant.module; const powerplant = _moduleFromEdId(powerplantJson.id); - if (powerplantJson.modifiers) _addModifications(powerplant, powerplantJson.modifiers, powerplantJson.recipeName, powerplantJson.recipeLevel); + rootModule = json.modules.PowerPlant; + if (rootModule.WorkInProgress_modifications) _addModifications(powerplant, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.standard[0], powerplant, true); ship.standard[0].enabled = powerplantJson.on === true; ship.standard[0].priority = powerplantJson.priority; @@ -173,7 +177,8 @@ export function shipFromJson(json) { // Thrusters const thrustersJson = json.modules.MainEngines.module; const thrusters = _moduleFromEdId(thrustersJson.id); - if (thrustersJson.modifiers) _addModifications(thrusters, thrustersJson.modifiers, thrustersJson.recipeName, thrustersJson.recipeLevel); + rootModule = json.modules.MainEngines; + if (rootModule.WorkInProgress_modifications) _addModifications(thrusters, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.standard[1], thrusters, true); ship.standard[1].enabled = thrustersJson.on === true; ship.standard[1].priority = thrustersJson.priority; @@ -181,7 +186,8 @@ export function shipFromJson(json) { // FSD const frameshiftdriveJson = json.modules.FrameShiftDrive.module; const frameshiftdrive = _moduleFromEdId(frameshiftdriveJson.id); - if (frameshiftdriveJson.modifiers) _addModifications(frameshiftdrive, frameshiftdriveJson.modifiers, frameshiftdriveJson.recipeName, frameshiftdriveJson.recipeLevel); + rootModule = json.modules.FrameShiftDrive; + if (rootModule.WorkInProgress_modifications) _addModifications(frameshiftdrive, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.standard[2], frameshiftdrive, true); ship.standard[2].enabled = frameshiftdriveJson.on === true; ship.standard[2].priority = frameshiftdriveJson.priority; @@ -189,7 +195,8 @@ export function shipFromJson(json) { // Life support const lifesupportJson = json.modules.LifeSupport.module; const lifesupport = _moduleFromEdId(lifesupportJson.id); - if (lifesupportJson.modifiers)_addModifications(lifesupport, lifesupportJson.modifiers, lifesupportJson.recipeName, lifesupportJson.recipeLevel); + rootModule = json.modules.LifeSupport; + if (rootModule.WorkInProgress_modifications) _addModifications(lifesupport, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.standard[3], lifesupport, true); ship.standard[3].enabled = lifesupportJson.on === true; ship.standard[3].priority = lifesupportJson.priority; @@ -197,7 +204,8 @@ export function shipFromJson(json) { // Power distributor const powerdistributorJson = json.modules.PowerDistributor.module; const powerdistributor = _moduleFromEdId(powerdistributorJson.id); - if (powerdistributorJson.modifiers) _addModifications(powerdistributor, powerdistributorJson.modifiers, powerdistributorJson.recipeName, powerdistributorJson.recipeLevel); + rootModule = json.modules.PowerDistributor; + if (rootModule.WorkInProgress_modifications) _addModifications(powerdistributor, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.standard[4], powerdistributor, true); ship.standard[4].enabled = powerdistributorJson.on === true; ship.standard[4].priority = powerdistributorJson.priority; @@ -205,7 +213,8 @@ export function shipFromJson(json) { // Sensors const sensorsJson = json.modules.Radar.module; const sensors = _moduleFromEdId(sensorsJson.id); - if (sensorsJson.modifiers) _addModifications(sensors, sensorsJson.modifiers, sensorsJson.recipeName, sensorsJson.recipeLevel); + rootModule = json.modules.Radar; + if (rootModule.WorkInProgress_modifications) _addModifications(sensors, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.standard[5], sensors, true); ship.standard[5].enabled = sensorsJson.on === true; ship.standard[5].priority = sensorsJson.priority; @@ -241,7 +250,8 @@ export function shipFromJson(json) { } else { const hardpointJson = hardpointSlot.module; const hardpoint = _moduleFromEdId(hardpointJson.id); - if (hardpointJson.modifiers) _addModifications(hardpoint, hardpointJson.modifiers, hardpointJson.recipeName, hardpointJson.recipeLevel); + rootModule = hardpointSlot; + if (rootModule.WorkInProgress_modifications) _addModifications(hardpoint, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel, rootModule.specialModifications); ship.use(ship.hardpoints[hardpointArrayNum], hardpoint, true); ship.hardpoints[hardpointArrayNum].enabled = hardpointJson.on === true; ship.hardpoints[hardpointArrayNum].priority = hardpointJson.priority; @@ -283,7 +293,8 @@ export function shipFromJson(json) { } else { const internalJson = internalSlot.module; const internal = _moduleFromEdId(internalJson.id); - if (internalJson.modifiers) _addModifications(internal, internalJson.modifiers, internalJson.recipeName, internalJson.recipeLevel); + rootModule = internalSlot; + if (rootModule.WorkInProgress_modifications) _addModifications(internal, rootModule.WorkInProgress_modifications, rootModule.engineer.recipeName, rootModule.engineer.recipeLevel); ship.use(ship.internal[i], internal, true); ship.internal[i].enabled = internalJson.on === true; ship.internal[i].priority = internalJson.priority; @@ -300,35 +311,50 @@ export function shipFromJson(json) { * @param {Object} modifiers the modifiers * @param {Object} blueprint the blueprint of the modification * @param {Object} grade the grade of the modification + * @param {Object} specialModifications special modification */ -function _addModifications(module, modifiers, blueprint, grade) { - if (!modifiers || !modifiers.modifiers) return; - +function _addModifications(module, modifiers, blueprint, grade, specialModifications) { + if (!modifiers) return; + console.log(module); + console.log(modifiers); let special; - for (const i in modifiers.modifiers) { + if (specialModifications) { + special = Modifications.specials[Object.keys(specialModifications)[0]] + } + for (const i in modifiers) { // Some special modifications - if (modifiers.modifiers[i].name === 'mod_weapon_clip_size_override') { + if (modifiers[i].name === 'mod_weapon_clip_size_override') { // This is a numeric addition to the clip size, but we need to work it out in terms of being a percentage so // that it works the same as other modifications const origClip = module.clip || 1; - module.setModValue('clip', ((modifiers.modifiers[i].value - origClip) / origClip) * 10000); - } else if (modifiers.modifiers[i].name === 'mod_weapon_burst_size') { + module.setModValue('clip', ((modifiers[i].value - origClip) / origClip) * 10000); + } else if (modifiers[i].name === 'mod_weapon_burst_size') { // This is an absolute number that acts as an override - module.setModValue('burst', modifiers.modifiers[i].value * 100); - } else if (modifiers.modifiers[i].name === 'mod_weapon_burst_rof') { + module.setModValue('burst', modifiers[i].value * 100); + } else if (modifiers[i].name === 'mod_weapon_burst_rof') { // This is an absolute number that acts as an override - module.setModValue('burstrof', modifiers.modifiers[i].value * 100); - } else if (modifiers.modifiers[i].name === 'mod_weapon_falloffrange_from_range') { + module.setModValue('burstrof', modifiers[i].value * 100); + } else if (modifiers[i].name === 'mod_weapon_falloffrange_from_range') { // Obtain the falloff value directly from the range module.setModValue('fallofffromrange', 1); - } else if (modifiers.modifiers[i].name && modifiers.modifiers[i].name.startsWith('special_')) { + } else if (modifiers[i].name && modifiers[i].name.startsWith('special_')) { // We don't add special effects directly, but keep a note of them so they can be added when fetching values - special = Modifications.specials[modifiers.modifiers[i].name]; + special = Modifications.specials[modifiers[i].name]; } else { // Look up the modifiers to find what we need to do - const modifierActions = Modifications.modifierActions[modifiers.modifiers[i].name]; - const value = modifiers.modifiers[i].value; - + const modifierActions = Modifications.modifierActions[i]; + let value; + if (i === 'OutfittingFieldType_DefenceModifierShieldMultiplier') { + value = modifiers[i].value - 1; + } else if (i === 'OutfittingFieldType_DefenceModifierHealthMultiplier' && blueprint.startsWith('Armour_')) { + value = (modifiers[i].value - module.hullboost) / module.hullboost; + } else if (i === 'OutfittingFieldType_DefenceModifierHealthMultiplier') { + value = modifiers[i].value / module.hullboost; + } else if (i === 'OutfittingFieldType_RateOfFire') { + value = (1 / Math.abs(modifiers[i].value)); + } else { + value = modifiers[i].value - 1; + } // Carry out the required changes for (const action in modifierActions) { if (isNaN(modifierActions[action])) { @@ -355,7 +381,7 @@ function _addModifications(module, modifiers, blueprint, grade) { module.blueprint.special = special; } } - + // Need to fix up a few items // Shield boosters are treated internally as straight modifiers, so rather than (for example) @@ -378,7 +404,7 @@ function _addModifications(module, modifiers, blueprint, grade) { module.setModValue('thermres', ((module.getModValue('thermres') / 10000) * -1) * 10000); } } - + // Shield generator resistance is actually a damage modifier, so needs to be inverted. // In addition, the modification is based off the inherent resistance of the module if (ModuleUtils.isShieldGenerator(module.grp)) { @@ -406,7 +432,7 @@ function _addModifications(module, modifiers, blueprint, grade) { module.setModValue('thermres', ((1 - (1 - module.thermres) * (1 + module.getModValue('thermres') / 10000)) - module.thermres) * 10000); } } - + // Bulkhead resistance is actually a damage modifier, so needs to be inverted. // In addition, the modification is based off the inherent resistance of the module if (module.grp == 'bh') { @@ -424,7 +450,7 @@ function _addModifications(module, modifiers, blueprint, grade) { // Bulkhead boost is based off the inherent boost of the module if (module.grp == 'bh') { const alteredBoost = (1 + module.hullboost) * (1 + module.getModValue('hullboost') / 10000) - 1; - module.setModValue('hullboost', (alteredBoost / module.hullboost - 1) * 10000); + module.setModValue('hullboost', (alteredBoost / module.hullboost - 1) * 1000); } // Jitter is an absolute number, so we need to divide it by 100 @@ -432,11 +458,6 @@ function _addModifications(module, modifiers, blueprint, grade) { module.setModValue('jitter', module.getModValue('jitter') / 100); } - // FD uses interval between bursts internally, so we need to translate this to a real rate of fire - if (module.getModValue('rof')) { - module.setModValue('rof', ((1 / (1 + module.getModValue('rof') / 10000)) - 1) * 10000); - } - // Clip size is rounded up so that the result is a whole number if (module.getModValue('clip')) { const individual = 1 / (module.clip || 1); diff --git a/src/less/colors.less b/src/less/colors.less index 4814e724..2a18f6de 100755 --- a/src/less/colors.less +++ b/src/less/colors.less @@ -18,6 +18,7 @@ @bg: rgba(30,30,30,1); @bgBlack: #000; @primary-bg: fadeout(darken(@primary, 47%), 15%); +@alt-primary-bg: fadeout(darken(@primary, 42%), 15%); // Lighter brown background @secondary-bg: fadeout(darken(@secondary, @bgDarken), @bgTransparency); // Brown background @warning-bg: fadeout(darken(@warning, @bgDarken), @bgTransparency); // Dark Red diff --git a/src/less/table.less b/src/less/table.less index 93f6f8e3..1cce0319 100755 --- a/src/less/table.less +++ b/src/less/table.less @@ -54,6 +54,10 @@ tbody tr { .no-touch &.highlight:hover, .no-touch &.highlighted { background-color: @warning-bg; } + + &.alt { + background-color: @alt-primary-bg; + } } td {