Skip to content

Commit

Permalink
Added Tender Bay and FTL tug capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Apr 25, 2023
1 parent 03f582a commit 87a06a9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v3.4.0] - 2023-04-25

### Added

* Added a fourth "Hold or Berth" option called "Tender Bay" (see page 89 of the *Continuum* rules). It looks and works exactly the same as a "Boat Bay" but costs points.
* Added the option to add FTL tug capacity to any ship.

## [v3.3.2] - 2023-04-17

### Added
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ftshipbuilder",
"private": true,
"version": "3.3.2",
"version": "3.4.0",
"description": "A web-based tool for generating valid Full Thrust ships",
"author": "Aaron Dalton <aaron@daltons.ca> (https://www.perlkonig.com)",
"license": "MIT",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@zerodevx/svelte-toast": "^0.9.3",
"canvg": "^4.0.1",
"fast-xml-parser": "^4.2.0",
"ftlibship": "github:perlkonig/ftLibShip#v2.0.3",
"ftlibship": "github:perlkonig/ftLibShip#v2.0.4",
"lz-string": "^1.5.0",
"nanoid": "^4.0.2",
"robust-point-in-polygon": "^1.0.3",
Expand Down
22 changes: 22 additions & 0 deletions src/components/Builder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
let ftl: boolean;
let ftlAdvanced: boolean;
let transferMass = 0;
ship.subscribe((obj) => {
const idx = obj.systems.findIndex(x => x.name === "ftl");
if (idx === -1) {
Expand Down Expand Up @@ -72,6 +73,20 @@
$ship = $ship;
}
const updateTransferMass = () => {
if ( (transferMass === undefined) || (transferMass === null) ) {
transferMass = 0;
}
if (transferMass % 5 !== 0) {
transferMass = Math.ceil(transferMass / 5) * 5;
}
const idx = $ship.systems.findIndex(x => x.name === "ftl");
if (idx !== -1) {
$ship.systems[idx].transferMass = transferMass;
}
$ship = $ship;
}
let shipSystem: string;
const addSystem = () => {
if (shipSystem !== undefined) {
Expand Down Expand Up @@ -400,6 +415,13 @@
<input type="checkbox" bind:checked="{ftlAdvanced}">
Advanced FTL
</label>
<div class="field">
<label class="label" for="transferMass">Tug capacity (transfer mass)</label>
<div class="control">
<input id="transferMass" class="input" type="number" placeholder="Tug capacity (transfer mass)" bind:value={transferMass} on:blur={updateTransferMass}>
</div>
<p class="help">Must be a multiple of 5. Ship doesn't update until you exit the field.</p>
</div>
<MassPts
obj={systems.getSystem($ship.systems.find(x => x.name === "ftl"), $ship)}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SysDisplay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<Type
prop={prop}
idx={idx}
choices={[["passenger","Passenger Berth"],["troop","Troop Berth"],["cargo","Cargo Hold"],["boat", "Boat Bay"]]}
choices={[["passenger","Passenger Berth"],["troop","Troop Berth"],["cargo","Cargo Hold"],["boat", "Boat Bay"], ["tender", "Tender Bay"]]}
/>
<Capacity
prop={prop}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SysDisplay/Ratio.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sys.ratio = undefined;
}
if (sys.ratio === undefined) {
if (sys.type === "boat") {
if ( (sys.type === "boat") || (sys.type === "tender") ) {
placeholder = 1.5;
} else if (sys.type === "passenger") {
placeholder = 1/4;
Expand Down

0 comments on commit 87a06a9

Please sign in to comment.