This commit is contained in:
33333-33333 2026-06-09 10:38:29 +09:00
commit 383a46955c
18 changed files with 755 additions and 254 deletions

View file

@ -33,6 +33,9 @@ export function newTurnStats() {
chemicalWeaponSubsidy: 0,
rescueLoan: 0,
cardRerollCost: 0,
dudRefundIncome: 0,
composterIncome: 0,
sparePartsRepair: 0,
mixerPoopFine: 0,
truckPoopFine: 0,
maleTruckFine: 0,
@ -74,6 +77,9 @@ export function newTotalStats() {
manualComboFailure: 0,
repairWorkerWages: 0,
cardRerollCost: 0,
dudRefundIncome: 0,
composterIncome: 0,
sparePartsRepair: 0,
mixerPoopFine: 0,
truckPoopFine: 0,
maleTruckFine: 0,
@ -135,7 +141,7 @@ export function createGame() {
lastExplodedComponent: new Map(),
contractOffer: null,
contractActive: null,
cardEffects: { bearing: 0, legalWork: 0, fairiesFlatteryNext: 0, crowdedFarming: 0, extraEggOutlet: 0, hatchingFeed: 0, safetyCover: 0, recyclingSubsidy: 0, chemicalWeaponSubsidy: 0, preventiveMaintenance: 0, dudFilter: 0, durabilityCoating: 0, laborExploitation: 0, usedMachineActive: false, rescueLoanCharges: 0, loans: [] },
cardEffects: { bearing: 0, legalWork: 0, fairiesFlatteryNext: 0, crowdedFarming: 0, extraEggOutlet: 0, hatchingFeed: 0, safetyCover: 0, recyclingSubsidy: 0, chemicalWeaponSubsidy: 0, preventiveMaintenance: 0, dudFilter: 0, durabilityCoating: 0, sparePartsBin: 0, dudRefund: 0, freeReroll: 0, composter: 0, laborExploitation: 0, usedMachineActive: false, rescueLoanCharges: 0, loans: [] },
cardDraft: { pending: false, choices: [], rerolls: 0, picksRemaining: 0 },
cardTargetPick: null,
manualCombo: { count: 0, lastBonus: 0 },
@ -182,15 +188,15 @@ export function defaultFacilities() {
const INITIAL_CONVEYOR_BACKBONE = Object.freeze([
// Egg Farm -> S1 top input. The S1/S2 rows were moved down so unrelated
// belt streams keep at least one blank tile between side-by-side flows.
[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [8, 2], [8, 3],
[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [8, 2],
// S1 left output -> Mixer receiver on the left grid edge.
[7, 4], [6, 4], [5, 4], [4, 4], [3, 4], [2, 4], [1, 4], [0, 4],
// S1 right output -> S2 top input.
[9, 4], [10, 4], [11, 4], [12, 4], [13, 4], [14, 4], [15, 4], [15, 5], [15, 6],
[10, 4], [11, 4], [12, 4], [13, 4], [14, 4], [15, 4], [15, 5],
// S2 left output -> Waste Shredder receiver on bottom grid edge.
[14, 7], [13, 7], [12, 7], [12, 8], [12, 9],
// S2 right output -> Truck receiver on the bottom grid edge.
[16, 7], [17, 7], [18, 7], [18, 8], [18, 9]
[17, 7], [18, 7], [18, 8], [18, 9]
]);
const INITIAL_SCANNERS = Object.freeze([
@ -213,13 +219,19 @@ function addConveyorTile(game, col, row, options = {}) {
uses: 0,
durability: BALANCE.maintenance.durability.conveyor,
maintenanceType: 'conveyor',
kind: options.kind || 'conveyor',
speedMultiplier: options.speedMultiplier || 1,
dir: options.dir || null,
outDirs: Array.isArray(options.outDirs) ? [...options.outDirs] : []
outDirs: Array.isArray(options.outDirs) ? [...options.outDirs] : [],
branchMode: options.branchMode || 'random'
});
} else if (options.dir || options.outDirs) {
const meta = game.conveyorMeta.get(k);
if (options.dir) meta.dir = options.dir;
if (Array.isArray(options.outDirs)) meta.outDirs = [...new Set([...(meta.outDirs || []), ...options.outDirs])];
if (!meta.branchMode) meta.branchMode = 'random';
if (!meta.kind) meta.kind = 'conveyor';
if (!meta.speedMultiplier) meta.speedMultiplier = 1;
}
}
@ -242,9 +254,20 @@ function markInitialConveyorDirection(game, from, to) {
function scannerPortCells(scanner) {
return [
{ col: scanner.col, row: scanner.row - 1 },
{ col: scanner.col, row: scanner.row - 2 },
{ col: scanner.col - 1, row: scanner.row },
{ col: scanner.col + 1, row: scanner.row }
{ col: scanner.col + 2, row: scanner.row }
].filter(p => inGrid(p.col, p.row));
}
function scannerBodyCells(scanner) {
return [
{ col: scanner.col, row: scanner.row - 1 },
{ col: scanner.col + 1, row: scanner.row - 1 },
{ col: scanner.col, row: scanner.row },
{ col: scanner.col + 1, row: scanner.row },
{ col: scanner.col, row: scanner.row + 1 },
{ col: scanner.col + 1, row: scanner.row + 1 }
].filter(p => inGrid(p.col, p.row));
}
@ -261,7 +284,7 @@ function protectedInitialCells(game) {
const reserved = new Set([...game.conveyorTiles]);
const add = p => { if (p && inGrid(p.col, p.row)) reserved.add(key(p.col, p.row)); };
for (const scanner of game.scanners) {
add(scanner);
for (const p of scannerBodyCells(scanner)) add(p);
for (const p of scannerPortCells(scanner)) add(p);
}
for (const farm of game.eggFarms) {