Compare commits

...

7 Commits
2.9.4 ... 2.9.5

Author SHA1 Message Date
willyb321
0474af912a Merge branch 'release/2.9.5' 2018-04-21 11:05:29 +10:00
willyb321
7df5953824 bump 2018-04-21 11:05:19 +10:00
willyb321
e391b563fb change preset rolls to 100%, 75%, 50% and random 2018-04-21 11:03:23 +10:00
willyb321
53f62f96d0 Merge branch 'master' into develop 2018-04-21 07:17:11 +10:00
willyb321
18745979a0 update about page 2018-04-20 19:20:47 +10:00
willyb321
c1966a38ff Merge branch 'master' into develop 2018-04-20 12:49:10 +10:00
willyb321
d86973f3b1 specify appVersion for bugsnag 2018-04-20 12:48:46 +10:00
7 changed files with 30 additions and 63 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "coriolis_shipyard", "name": "coriolis_shipyard",
"version": "2.9.4", "version": "2.9.5",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/EDCD/coriolis" "url": "https://github.com/EDCD/coriolis"

View File

@@ -6,7 +6,7 @@ import { isEmpty, stopCtxPropagation } from '../utils/UtilityFunctions';
import cn from 'classnames'; import cn from 'classnames';
import { Modifications } from 'coriolis-data/dist'; import { Modifications } from 'coriolis-data/dist';
import Modification from './Modification'; import Modification from './Modification';
import { getBlueprint, blueprintTooltip, setWorst, setBest, setExtreme, setRandom } from '../utils/BlueprintFunctions'; import { getBlueprint, blueprintTooltip, setPercent, setRandom } from '../utils/BlueprintFunctions';
/** /**
* Modifications menu * Modifications menu
@@ -30,10 +30,10 @@ export default class ModificationsMenu extends TranslatedComponent {
this._toggleBlueprintsMenu = this._toggleBlueprintsMenu.bind(this); this._toggleBlueprintsMenu = this._toggleBlueprintsMenu.bind(this);
this._toggleSpecialsMenu = this._toggleSpecialsMenu.bind(this); this._toggleSpecialsMenu = this._toggleSpecialsMenu.bind(this);
this._rollWorst = this._rollWorst.bind(this); this._rollFifty = this._rollFifty.bind(this);
this._rollRandom = this._rollRandom.bind(this); this._rollRandom = this._rollRandom.bind(this);
this._rollBest = this._rollBest.bind(this); this._rollBest = this._rollBest.bind(this);
this._rollExtreme = this._rollExtreme.bind(this); this._rollSevenFive = this._rollSevenFive.bind(this);
this._reset = this._reset.bind(this); this._reset = this._reset.bind(this);
this.state = { this.state = {
@@ -168,11 +168,11 @@ export default class ModificationsMenu extends TranslatedComponent {
} }
/** /**
* Provide a 'worst' roll within the information we have * Provide a '50%' roll within the information we have
*/ */
_rollWorst() { _rollFifty() {
const { m, ship } = this.props; const { m, ship } = this.props;
setWorst(ship, m); setPercent(ship, m, 50);
this.props.onChange(); this.props.onChange();
} }
@@ -190,16 +190,16 @@ export default class ModificationsMenu extends TranslatedComponent {
*/ */
_rollBest() { _rollBest() {
const { m, ship } = this.props; const { m, ship } = this.props;
setBest(ship, m); setPercent(ship, m, 100);
this.props.onChange(); this.props.onChange();
} }
/** /**
* Provide an 'extreme' roll within the information we have * Provide an '75%' roll within the information we have
*/ */
_rollExtreme() { _rollSevenFive() {
const { m, ship } = this.props; const { m, ship } = this.props;
setExtreme(ship, m); setPercent(ship, m, 75);
this.props.onChange(); this.props.onChange();
} }
@@ -226,9 +226,9 @@ export default class ModificationsMenu extends TranslatedComponent {
const _toggleBlueprintsMenu = this._toggleBlueprintsMenu; const _toggleBlueprintsMenu = this._toggleBlueprintsMenu;
const _toggleSpecialsMenu = this._toggleSpecialsMenu; const _toggleSpecialsMenu = this._toggleSpecialsMenu;
const _rollBest = this._rollBest; const _rollFull = this._rollBest;
const _rollExtreme = this._rollExtreme; const _rollSevenFive = this._rollSevenFive;
const _rollWorst = this._rollWorst; const _rollFifty = this._rollFifty;
const _rollRandom = this._rollRandom; const _rollRandom = this._rollRandom;
const _reset = this._reset; const _reset = this._reset;
@@ -275,9 +275,9 @@ export default class ModificationsMenu extends TranslatedComponent {
{ showRolls ? { showRolls ?
<tr> <tr>
<td> { translate('roll') }: </td> <td> { translate('roll') }: </td>
<td style={{ cursor: 'pointer' }} onClick={_rollWorst} onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_WORST')} onMouseOut={tooltip.bind(null, null)}> { translate('worst') } </td> <td style={{ cursor: 'pointer' }} onClick={_rollFifty} onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_FIFTY')} onMouseOut={tooltip.bind(null, null)}> { translate('50%') } </td>
<td style={{ cursor: 'pointer' }} onClick={_rollBest}onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_BEST')} onMouseOut={tooltip.bind(null, null)}> { translate('best') } </td> <td style={{ cursor: 'pointer' }} onClick={_rollSevenFive} onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_SEVEN_FIVE')} onMouseOut={tooltip.bind(null, null)}> { translate('75%') } </td>
<td style={{ cursor: 'pointer' }} onClick={_rollExtreme}onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_EXTREME')} onMouseOut={tooltip.bind(null, null)}> { translate('extreme') } </td> <td style={{ cursor: 'pointer' }} onClick={_rollFull} onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_BEST')} onMouseOut={tooltip.bind(null, null)}> { translate('100%') } </td>
<td style={{ cursor: 'pointer' }} onClick={_rollRandom} onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_RANDOM')} onMouseOut={tooltip.bind(null, null)}> { translate('random') } </td> <td style={{ cursor: 'pointer' }} onClick={_rollRandom} onMouseOver={termtip.bind(null, 'PHRASE_BLUEPRINT_RANDOM')} onMouseOut={tooltip.bind(null, null)}> { translate('random') } </td>
</tr> : null } </tr> : null }
{ showReset ? { showReset ?

View File

@@ -16,6 +16,8 @@
"PHRASE_ENGAGEMENT_RANGE": "The distance between your ship and its target", "PHRASE_ENGAGEMENT_RANGE": "The distance between your ship and its target",
"PHRASE_SELECT_BLUEPRINT": "Click to select a blueprint", "PHRASE_SELECT_BLUEPRINT": "Click to select a blueprint",
"PHRASE_BLUEPRINT_WORST": "Worst primary values for this blueprint", "PHRASE_BLUEPRINT_WORST": "Worst primary values for this blueprint",
"PHRASE_BLUEPRINT_FIFTY": "50% of full values for this blueprint",
"PHRASE_BLUEPRINT_SEVEN_FIVE": "75% of full values for this blueprint",
"PHRASE_BLUEPRINT_RANDOM": "Random selection between worst and best primary values for this blueprint", "PHRASE_BLUEPRINT_RANDOM": "Random selection between worst and best primary values for this blueprint",
"PHRASE_BLUEPRINT_BEST": "Best primary values for this blueprint", "PHRASE_BLUEPRINT_BEST": "Best primary values for this blueprint",
"PHRASE_BLUEPRINT_EXTREME": "Best beneficial and worst detrimental primary values for this blueprint", "PHRASE_BLUEPRINT_EXTREME": "Best beneficial and worst detrimental primary values for this blueprint",

View File

@@ -41,6 +41,9 @@ export default class AboutPage extends Page {
<h3>Chat</h3> <h3>Chat</h3>
<p>You can chat to us on our <a href='https://discord.gg/0uwCh6R62aPRjk9w' target='_blank'>EDCD Discord server</a>.</p> <p>You can chat to us on our <a href='https://discord.gg/0uwCh6R62aPRjk9w' target='_blank'>EDCD Discord server</a>.</p>
<h3>Supporting Coriolis</h3>
<p>Coriolis is an open source project, and I work on it in my free time. I have set up a patreon at <a href='https://www.patreon.com/coriolis_elite'>patreon.com/coriolis_elite</a>, which will be used to keep Coriolis up to date and the servers running.</p>
</div>; </div>;
} }
} }

View File

@@ -253,57 +253,19 @@ export function getBlueprint(name, module) {
* Provide 'worst' primary modifications * Provide 'worst' primary modifications
* @param {Object} ship The ship for which to perform the modifications * @param {Object} ship The ship for which to perform the modifications
* @param {Object} m The module for which to perform the modifications * @param {Object} m The module for which to perform the modifications
* @param {Number} percent The percent to set values to of full.
*/ */
export function setWorst(ship, m) { export function setPercent(ship, m, percent) {
ship.clearModifications(m); ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features; const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) { for (const featureName in features) {
const value = features[featureName][0]; const value = features[featureName][0];
_setValue(ship, m, featureName, value); const featureIsBeneficial = isBeneficial(featureName, features[featureName]);
} if (featureIsBeneficial === true) {
} _setValue(ship, m, featureName, (percent / 100) * value);
/**
* Provide 'best' primary modifications
* @param {Object} ship The ship for which to perform the modifications
* @param {Object} m The module for which to perform the modifications
*/
export function setBest(ship, m) {
ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) {
const value = features[featureName][1];
_setValue(ship, m, featureName, value);
}
}
/**
* Provide 'extreme' primary modifications
* @param {Object} ship The ship for which to perform the modifications
* @param {Object} m The module for which to perform the modifications
*/
export function setExtreme(ship, m) {
ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) {
let value;
if (Modifications.modifications[featureName].higherbetter) {
// Higher is better, but is this making it better or worse?
if (features[featureName][0] < 0 || (features[featureName][0] === 0 && features[featureName][1] < 0)) {
value = features[featureName][0];
} else {
value = features[featureName][1];
}
} else { } else {
// Higher is worse, but is this making it better or worse? _setValue(ship, m, featureName, value);
if (features[featureName][0] < 0 || (features[featureName][0] === 0 && features[featureName][1] < 0)) {
value = features[featureName][1];
} else {
value = features[featureName][0];
}
} }
_setValue(ship, m, featureName, value);
} }
} }

View File

@@ -58,7 +58,7 @@
<script src="//d2wy8f7a9ursnm.cloudfront.net/v4/bugsnag.min.js"></script> <script src="//d2wy8f7a9ursnm.cloudfront.net/v4/bugsnag.min.js"></script>
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-plugins/v1/bugsnag-react.min.js"></script> <script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-plugins/v1/bugsnag-react.min.js"></script>
<script> <script>
window.bugsnagClient = bugsnag('ba9fae819372850fb660755341fa6ef5') window.bugsnagClient = bugsnag('ba9fae819372850fb660755341fa6ef5', {appVersion: window.CORIOLIS_VERSION || undefined})
window.Bugsnag = window.bugsnagClient window.Bugsnag = window.bugsnagClient
</script> </script>
</head> </head>

View File

@@ -4,7 +4,7 @@ const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin')
const AppCachePlugin = require('appcache-webpack-plugin') const AppCachePlugin = require('appcache-webpack-plugin')
const {BugsnagSourceMapUploaderPlugin, BugsnagBuildReporterPlugin} = require('webpack-bugsnag-plugins') const {BugsnagSourceMapUploaderPlugin} = require('webpack-bugsnag-plugins')
const pkgJson = require('./package') const pkgJson = require('./package')
function CopyDirPlugin (source, destination) { function CopyDirPlugin (source, destination) {