Package weight, payload capacity and per-kg payout (ISS-045)
CI / build + unit + e2e (pull_request) Successful in 8m2s
CI / build + unit + e2e (pull_request) Successful in 8m2s
Packages carry a real weightKg (unit weight x count with +/-30% jitter), plane capacity becomes maxPayloadKg instead of 6 slots, load validation sums cargo weight against the payload, and the payout gains a per-kg part. Loadout display shows tonnage; OpenAPI swaps CatalogEntry.capacity for maxPayloadKg and adds PackageState.weightKg.
This commit is contained in:
@@ -42,7 +42,7 @@ interface CatalogEntry {
|
||||
burnPerKm: number;
|
||||
emptyWeightKg: number; // v0.16.0 weighted burn input
|
||||
speedKmh: number;
|
||||
capacity: number;
|
||||
maxPayloadKg: number; // v0.27.0 — replaces the v0.12.0 slot capacity
|
||||
}
|
||||
|
||||
interface StateBody {
|
||||
@@ -309,7 +309,7 @@ test('market buy/sell render with previews from the catalog in /api/state; left-
|
||||
const body = await getState(page); // authoritative catalog + economy constants (v0.10.0)
|
||||
expect(body.catalog.length).toBeGreaterThan(0);
|
||||
const entry = body.catalog.find((e) => e.model === 'atr72')!;
|
||||
expect(entry.capacity).toBe(6); // v0.12.0 slot capacity exposed in the snapshot
|
||||
expect(entry.maxPayloadKg).toBe(4_800); // ATR 72-600 max payload (lib/game/catalog.ts)
|
||||
|
||||
await page.goto('/');
|
||||
// Buy: the model picker lists the catalog entry and the price preview is its full price.
|
||||
|
||||
Reference in New Issue
Block a user