set original thrust to 0

This commit is contained in:
Yanick Champoux 2022-04-17 12:22:28 -04:00
parent 8d99a63648
commit 6e819dbce6

View File

@ -7,7 +7,7 @@ import reqs from "../reqs.js";
const dux = new Updux({
subduxes: { reqs },
initial: {
rating: 1,
rating: 0,
advanced: false,
},
actions: {
@ -20,7 +20,7 @@ dux.setMutation("setDrive", (changes) => u(changes));
dux.setMutation("setDriveReqs", (reqs) => u({ reqs }));
// needs to be at the top level
export const calculateDriveReqs = store =>
export const calculateDriveReqs = (store) =>
createSelector(
[
(ship) => ship.reqs.mass,
@ -29,7 +29,7 @@ export const calculateDriveReqs = store =>
],
(ship_mass, rating, advanced) =>
store.dispatch.setDriveReqs(calcDriveReqs(ship_mass, rating, advanced))
);
);
export function calcDriveReqs(shipMass, rating, advanced = false) {
const mass = Math.ceil(rating * 0.05 * shipMass);