set original thrust to 0
This commit is contained in:
parent
8d99a63648
commit
6e819dbce6
@ -7,7 +7,7 @@ import reqs from "../reqs.js";
|
|||||||
const dux = new Updux({
|
const dux = new Updux({
|
||||||
subduxes: { reqs },
|
subduxes: { reqs },
|
||||||
initial: {
|
initial: {
|
||||||
rating: 1,
|
rating: 0,
|
||||||
advanced: false,
|
advanced: false,
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -20,7 +20,7 @@ dux.setMutation("setDrive", (changes) => u(changes));
|
|||||||
dux.setMutation("setDriveReqs", (reqs) => u({ reqs }));
|
dux.setMutation("setDriveReqs", (reqs) => u({ reqs }));
|
||||||
|
|
||||||
// needs to be at the top level
|
// needs to be at the top level
|
||||||
export const calculateDriveReqs = store =>
|
export const calculateDriveReqs = (store) =>
|
||||||
createSelector(
|
createSelector(
|
||||||
[
|
[
|
||||||
(ship) => ship.reqs.mass,
|
(ship) => ship.reqs.mass,
|
||||||
@ -29,7 +29,7 @@ export const calculateDriveReqs = store =>
|
|||||||
],
|
],
|
||||||
(ship_mass, rating, advanced) =>
|
(ship_mass, rating, advanced) =>
|
||||||
store.dispatch.setDriveReqs(calcDriveReqs(ship_mass, rating, advanced))
|
store.dispatch.setDriveReqs(calcDriveReqs(ship_mass, rating, advanced))
|
||||||
);
|
);
|
||||||
|
|
||||||
export function calcDriveReqs(shipMass, rating, advanced = false) {
|
export function calcDriveReqs(shipMass, rating, advanced = false) {
|
||||||
const mass = Math.ceil(rating * 0.05 * shipMass);
|
const mass = Math.ceil(rating * 0.05 * shipMass);
|
||||||
|
Loading…
Reference in New Issue
Block a user