diff --git a/src/lib/components/ShipEdit/Identification/shipTypes.js b/src/lib/components/ShipEdit/Identification/shipTypes.js index be32552..19ad819 100644 --- a/src/lib/components/ShipEdit/Identification/shipTypes.js +++ b/src/lib/components/ShipEdit/Identification/shipTypes.js @@ -1,5 +1,5 @@ const ship_types = [ - { name: "Scout", mass: [4, 10], abbrev: "SC" }, + { name: "Scout", mass: [0, 10], abbrev: "SC" }, { name: "Courier", mass: [4, 10], abbrev: "SC" }, { name: "Corvette", mass: [8, 16], abbrev: "CT" }, { name: "Frigate", mass: [14, 28], abbrev: "FF" }, @@ -14,7 +14,7 @@ const ship_types = [ { name: "Heavy Battleship", mass: [120, 160], abbrev: "BDN" }, { name: "Dreadnought", mass: [140, 180], abbrev: "DN" }, { name: "Superdreadnought", mass: [160, 300], abbrev: "SDN" }, - { name: "Escort Carrier", mass: [60, 140], abbrev: "CVE", carrier: true }, + { name: "Escort Carrier", mass: [0, 140], abbrev: "CVE", carrier: true }, { name: "Light Carrier", mass: [120, 180], abbrev: "CVL", carrier: true }, { name: "Heavy Carrier", mass: [160, 300], abbrev: "CVH", carrier: true }, { name: "Attack Carrier", mass: [150, 300], abbrev: "CVA", carrier: true }, diff --git a/src/lib/components/ShipEdit/index.svelte b/src/lib/components/ShipEdit/index.svelte index 89dec7a..ecfa2fd 100644 --- a/src/lib/components/ShipEdit/index.svelte +++ b/src/lib/components/ShipEdit/index.svelte @@ -8,6 +8,8 @@ + + diff --git a/src/lib/shipDux/identification.js b/src/lib/shipDux/identification.js index 50abc17..71e4085 100644 --- a/src/lib/shipDux/identification.js +++ b/src/lib/shipDux/identification.js @@ -1,10 +1,13 @@ import { Updux } from "updux"; import u from "updeep"; +import carrier from './carrier.js'; + const dux = new Updux({ actions: { setShipType: null, setShipClass: null, + setCarrierBays: carrier.actions.setCarrierBays, }, initial: { shipType: "", @@ -16,5 +19,8 @@ const dux = new Updux({ dux.setMutation("setShipType", (shipType) => u({ shipType })); dux.setMutation("setShipClass", (shipClass) => u({ shipClass })); +dux.setMutation('setCarrierBays', (bays) => u({ + isCarrier: bays > 0, +})) export default dux; diff --git a/src/lib/shipDux/index.js b/src/lib/shipDux/index.js index 4b74aab..d2a8f25 100644 --- a/src/lib/shipDux/index.js +++ b/src/lib/shipDux/index.js @@ -6,13 +6,14 @@ import identification from "./identification.js"; import { calculateDriveReqs } from './propulsion/drive.js'; import { ftlReqsReaction } from './propulsion/ftl.js'; import structure from './structure/index.js'; +import carrier from './carrier.js'; import { screenReqsReaction, screensReqsReaction } from './structure/screens.js' const dux = new Updux({ subduxes: { identification, propulsion, - structure + structure, carrier }, initial: { reqs: { cost: 0, mass: 10, usedMass: 0 },