tweaks
This commit is contained in:
parent
40b4752ed2
commit
1c383282dd
29 changed files with 241 additions and 108 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules/
|
||||
18
README.md
18
README.md
|
|
@ -2,6 +2,24 @@
|
|||
|
||||
Open `index.html` in a browser.
|
||||
|
||||
Production uses the committed `dist/game.js` bundle. Edit source files under
|
||||
`src/`, then run `npm install` once and `npm run build` after JavaScript
|
||||
changes to regenerate the bundle.
|
||||
|
||||
## Static server cache setup
|
||||
|
||||
Serve `index.html`, the bundled JavaScript, and CSS with cache validation
|
||||
instead of import query strings. This prevents stale files while keeping reloads
|
||||
fast.
|
||||
|
||||
Use the example in `deploy/` for your HTTP server:
|
||||
|
||||
- nginx: include `deploy/nginx-cache.conf` inside the server block.
|
||||
- Apache: copy or include `deploy/apache-cache.htaccess` from the site root.
|
||||
- Caddy: adapt `deploy/Caddyfile-cache`.
|
||||
|
||||
After deploying, purge any CDN or reverse-proxy cache once.
|
||||
|
||||
## Current baseline
|
||||
|
||||
- Build, move, box-select, sell, and repair factory equipment during Build phase.
|
||||
|
|
|
|||
9
deploy/Caddyfile-cache
Normal file
9
deploy/Caddyfile-cache
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Adapt these directives inside the Caddy site block that serves this static app.
|
||||
|
||||
encode gzip zstd
|
||||
|
||||
@html path /index.html
|
||||
header @html Cache-Control "no-cache"
|
||||
|
||||
@assets path *.js *.css
|
||||
header @assets Cache-Control "no-cache"
|
||||
17
deploy/apache-cache.htaccess
Normal file
17
deploy/apache-cache.htaccess
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Use this from the static site root when served by Apache with .htaccess enabled.
|
||||
|
||||
FileETag MTime Size
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
<Files "index.html">
|
||||
Header set Cache-Control "no-cache"
|
||||
</Files>
|
||||
|
||||
<FilesMatch "\.(js|css)$">
|
||||
Header set Cache-Control "no-cache"
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_deflate.c>
|
||||
AddOutputFilterByType DEFLATE text/css application/javascript text/javascript
|
||||
</IfModule>
|
||||
20
deploy/nginx-cache.conf
Normal file
20
deploy/nginx-cache.conf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Include this in the nginx server block that serves this static app.
|
||||
#
|
||||
# Example:
|
||||
# server {
|
||||
# root /var/www/zunda-shiwake;
|
||||
# include /var/www/zunda-shiwake/deploy/nginx-cache.conf;
|
||||
# }
|
||||
|
||||
etag on;
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript text/javascript;
|
||||
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-cache";
|
||||
}
|
||||
|
||||
location ~* \.(js|css)$ {
|
||||
add_header Cache-Control "no-cache";
|
||||
gzip_static on;
|
||||
}
|
||||
55
dist/game.js
vendored
Normal file
55
dist/game.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -105,6 +105,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module" src="./src/game.js?v=27.6-cache2"></script>
|
||||
<script type="module" src="./dist/game.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
13
package.json
Normal file
13
package.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "zunda-shiwake",
|
||||
"version": "27.6.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
||||
"build": "npm run clean && esbuild src/game.js --bundle --format=esm --target=es2020 --minify --outfile=dist/game.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.25.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ export const BALANCE = {
|
|||
rarity: 'common',
|
||||
type: 'equipmentUpgrade',
|
||||
target: 'trash',
|
||||
description: 'Choose SHREDDER and raise it by 1 level. Bonus chance increases by the current upgrade count. Max 30 upgrades.',
|
||||
description: 'Shred poops for a little money. Max 30 upgrades.',
|
||||
tags: ['POOP', 'ACTIVE']
|
||||
},
|
||||
{
|
||||
|
|
@ -194,7 +194,7 @@ export const BALANCE = {
|
|||
rarity: 'rare',
|
||||
type: 'cellAction',
|
||||
target: 'blockedCell',
|
||||
description: 'Remove any 3 blocked cells with a burst effect.',
|
||||
description: 'Remove any 3 unbuildable cells',
|
||||
tags: ['RISK', 'RARE', 'ONE-SHOT']
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { BALANCE } from './balance.js?v=27.6-cache2';
|
||||
import { BALANCE } from './balance.js';
|
||||
|
||||
export const VERSION = BALANCE.version;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { BUILD_COSTS, FACILITY_DEFS, GRID } from './config.js?v=27.6-cache2';
|
||||
import { nextSpawnDelay } from './state.js?v=27.6-cache2';
|
||||
import { currentPoopRate } from '../systems/contracts.js?v=27.6-cache2';
|
||||
import { BUILD_COSTS, FACILITY_DEFS, GRID } from './config.js';
|
||||
import { nextSpawnDelay } from './state.js';
|
||||
import { currentPoopRate } from '../systems/contracts.js';
|
||||
|
||||
const DEFAULT_MANUAL_KEYS = [
|
||||
[{ key: 'a', code: 'KeyA', label: 'A' }, { key: 'd', code: 'KeyD', label: 'D' }],
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { BALANCE } from './balance.js?v=27.6-cache2';
|
||||
import { GRID } from './config.js?v=27.6-cache2';
|
||||
import { key, parseKey } from './utils.js?v=27.6-cache2';
|
||||
import { BALANCE } from './balance.js';
|
||||
import { GRID } from './config.js';
|
||||
import { key, parseKey } from './utils.js';
|
||||
|
||||
export const GRID_CHUNK_SIZE = 10;
|
||||
const INITIAL_CHUNKS_X = 2;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { GRID } from './config.js?v=27.6-cache2';
|
||||
import { key } from './utils.js?v=27.6-cache2';
|
||||
import { GRID } from './config.js';
|
||||
import { key } from './utils.js';
|
||||
|
||||
function hashSeed(seedText) {
|
||||
let h = 2166136261;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { STARTING_CASH, TURN_SECONDS, FARM_SHUTDOWN_GRACE_SECONDS, BUILD_COSTS, FACILITY_DEFS, GRID, EGG_SPAWN_RANGES } from './config.js?v=27.6-cache2';
|
||||
import { BALANCE } from './balance.js?v=27.6-cache2';
|
||||
import { createRunSeed, generateBlockedCells } from './mapGen.js?v=27.6-cache2';
|
||||
import { resetOwnedCells } from './gridExpansion.js?v=27.6-cache2';
|
||||
import { randomBetween, key, inGrid, directionNameBetweenCells } from './utils.js?v=27.6-cache2';
|
||||
import { STARTING_CASH, TURN_SECONDS, FARM_SHUTDOWN_GRACE_SECONDS, BUILD_COSTS, FACILITY_DEFS, GRID, EGG_SPAWN_RANGES } from './config.js';
|
||||
import { BALANCE } from './balance.js';
|
||||
import { createRunSeed, generateBlockedCells } from './mapGen.js';
|
||||
import { resetOwnedCells } from './gridExpansion.js';
|
||||
import { randomBetween, key, inGrid, directionNameBetweenCells } from './utils.js';
|
||||
|
||||
export function newTurnStats() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { AUTO_SCANNER_COOLDOWN, FACILITY_DEFS, VERSION } from './config.js?v=27.6-cache2';
|
||||
import { yen } from './utils.js?v=27.6-cache2';
|
||||
import { AUTO_SCANNER_COOLDOWN, FACILITY_DEFS, VERSION } from './config.js';
|
||||
import { yen } from './utils.js';
|
||||
|
||||
export const TEXT = {
|
||||
appTitle: 'Chick Sorter',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { GRID } from './config.js?v=27.6-cache2';
|
||||
import { GRID } from './config.js';
|
||||
|
||||
export function yen(value) {
|
||||
const n = Number(value) || 0;
|
||||
|
|
|
|||
32
src/game.js
32
src/game.js
|
|
@ -1,19 +1,19 @@
|
|||
import { GRID, TURN_SECONDS, THEME } from './core/config.js?v=27.6-cache2';
|
||||
import { buildToolButtonHtml } from './core/text.js?v=27.6-cache2';
|
||||
import { createGame, resetLayout, newTurnStats } from './core/state.js?v=27.6-cache2';
|
||||
import { clamp, pointToCell, cellCenter, key, yen } from './core/utils.js?v=27.6-cache2';
|
||||
import { expansionLots, lotBounds } from './core/gridExpansion.js?v=27.6-cache2';
|
||||
import { commitFactoryGraphForDay, facilityConnectionIssues } from './systems/routing.js?v=27.6-cache2';
|
||||
import { applyRevenue, collectChemicalWeaponSubsidy, collectFairiesTribute, collectLoanRepayments, collectZundaTax, settleTruckRevenue } from './systems/economy.js?v=27.6-cache2';
|
||||
import { undo, redo } from './systems/history.js?v=27.6-cache2';
|
||||
import { drawAll } from './render/draw.js?v=27.6-cache2';
|
||||
import { createBuildSystem } from './systems/buildSystem.js?v=27.6-cache2';
|
||||
import { createUISystem } from './systems/uiSystem.js?v=27.6-cache2';
|
||||
import { createChickSystem } from './systems/chickSystem.js?v=27.6-cache2';
|
||||
import { CARD_DEFS, conveyorSpeedForGame, createCardSystem, debugGrantCard } from './systems/cards.js?v=27.6-cache2';
|
||||
import { floating, shockwave, sparkBurst, updateEffects } from './systems/effects.js?v=27.6-cache2';
|
||||
import { rollContractOffer, activateAcceptedContract, clearActiveContract, resolveContract } from './systems/contracts.js?v=27.6-cache2';
|
||||
import { ensureMaintenanceState, hireRepairmanForNextDay, activateRepairmanForDay, deactivateRepairman, conveyorSpeedFactorForKey } from './systems/maintenance.js?v=27.6-cache2';
|
||||
import { GRID, TURN_SECONDS, THEME } from './core/config.js';
|
||||
import { buildToolButtonHtml } from './core/text.js';
|
||||
import { createGame, resetLayout, newTurnStats } from './core/state.js';
|
||||
import { clamp, pointToCell, cellCenter, key, yen } from './core/utils.js';
|
||||
import { expansionLots, lotBounds } from './core/gridExpansion.js';
|
||||
import { commitFactoryGraphForDay, facilityConnectionIssues } from './systems/routing.js';
|
||||
import { applyRevenue, collectChemicalWeaponSubsidy, collectFairiesTribute, collectLoanRepayments, collectZundaTax, settleTruckRevenue } from './systems/economy.js';
|
||||
import { undo, redo } from './systems/history.js';
|
||||
import { drawAll } from './render/draw.js';
|
||||
import { createBuildSystem } from './systems/buildSystem.js';
|
||||
import { createUISystem } from './systems/uiSystem.js';
|
||||
import { createChickSystem } from './systems/chickSystem.js';
|
||||
import { CARD_DEFS, conveyorSpeedForGame, createCardSystem, debugGrantCard } from './systems/cards.js';
|
||||
import { floating, shockwave, sparkBurst, updateEffects } from './systems/effects.js';
|
||||
import { rollContractOffer, activateAcceptedContract, clearActiveContract, resolveContract } from './systems/contracts.js';
|
||||
import { ensureMaintenanceState, hireRepairmanForNextDay, activateRepairmanForDay, deactivateRepairman, conveyorSpeedFactorForKey } from './systems/maintenance.js';
|
||||
|
||||
const canvas = document.getElementById('gameCanvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { DIRS, GRID, THEME, EFFECT_PRIORITY, VERSION } from '../core/config.js?v=27.6-cache2';
|
||||
import { expansionCost, expansionLots, lotBounds, expansionButtonBounds, isOwnedCell } from '../core/gridExpansion.js?v=27.6-cache2';
|
||||
import { key, parseKey, pointToCell, cellCenter, mixHex, randomBetween, yen } from '../core/utils.js?v=27.6-cache2';
|
||||
import { getConveyorNeighbors, routeFromFarmToScanner, outputRoute, scannerCenter, scannerConnector, scannerOutputs, destinationLabel, destinationColor, scannerPortHasConveyor, disconnectedBuildWarnings } from '../systems/routing.js?v=27.6-cache2';
|
||||
import { upgradedMixerPrice, upgradedTruckPrice } from '../systems/economy.js?v=27.6-cache2';
|
||||
import { cardTargetBounds } from '../systems/cards.js?v=27.6-cache2';
|
||||
import { wearRatio } from '../systems/maintenance.js?v=27.6-cache2';
|
||||
import { DIRS, GRID, THEME, EFFECT_PRIORITY, VERSION } from '../core/config.js';
|
||||
import { expansionCost, expansionLots, lotBounds, expansionButtonBounds, isOwnedCell } from '../core/gridExpansion.js';
|
||||
import { key, parseKey, pointToCell, cellCenter, mixHex, randomBetween, yen } from '../core/utils.js';
|
||||
import { getConveyorNeighbors, routeFromFarmToScanner, outputRoute, scannerCenter, scannerConnector, scannerOutputs, destinationLabel, destinationColor, scannerPortHasConveyor, disconnectedBuildWarnings } from '../systems/routing.js';
|
||||
import { upgradedMixerPrice, upgradedTruckPrice } from '../systems/economy.js';
|
||||
import { cardTargetBounds } from '../systems/cards.js';
|
||||
import { wearRatio } from '../systems/maintenance.js';
|
||||
|
||||
// Optional art overlay hook.
|
||||
// Keep external art probing disabled by default so a clean checkout does not emit 404s for missing PNGs.
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
import { BALANCE } from '../core/balance.js?v=27.6-cache2';
|
||||
import { MACHINE_FACILITY_IDS, GRID, THEME } from '../core/config.js?v=27.6-cache2';
|
||||
import { getSpawnRange } from '../core/state.js?v=27.6-cache2';
|
||||
import { createEggFarm, createScanner, createFacility } from '../core/entities.js?v=27.6-cache2';
|
||||
import { generateBlockedCellsInRect } from '../core/mapGen.js?v=27.6-cache2';
|
||||
import { expansionCost, expansionLot, expansionLots, lotFromChunk, lotBounds, lotContainsPoint, cellsInLot, isOwnedCell, countOwnedCells, shiftRowIndexedSet, shiftRowIndexedMap, ownChunk } from '../core/gridExpansion.js?v=27.6-cache2';
|
||||
import { key, parseKey, pointToCell, cellCenter, yen, directionNameBetweenCells } from '../core/utils.js?v=27.6-cache2';
|
||||
import { TEXT, equipmentName } from '../core/text.js?v=27.6-cache2';
|
||||
import { farmAt, scannerAt, scannerCenter, routeFromFarmToScanner, refreshRoutingAfterEdit, disconnectedBuildWarnings } from './routing.js?v=27.6-cache2';
|
||||
import { buildPrice, equipmentBasePrice, incomeMultiplier, mixerPoopPenalty, refundCash, spendCash, truckPoopPenalty, upgradedMixerPrice, upgradedTruckPrice, resaleValueFor, shredderUpgradeCount, shredderBonusChance, shredderBonusMaxCards } from './economy.js?v=27.6-cache2';
|
||||
import { autoScannerCooldownSeconds } from './cards.js?v=27.6-cache2';
|
||||
import { record } from './history.js?v=27.6-cache2';
|
||||
import { floating, eraseEffect } from './effects.js?v=27.6-cache2';
|
||||
import { createSelectionSystem } from './selectionSystem.js?v=27.6-cache2';
|
||||
import { ensureMaintenanceState, remainingPercent, performanceFactor, autoScannerDelayMultiplier, eggSpawnDelayMultiplier, facilityProcessingDelay, durabilityCapFor } from './maintenance.js?v=27.6-cache2';
|
||||
import { BALANCE } from '../core/balance.js';
|
||||
import { MACHINE_FACILITY_IDS, GRID, THEME } from '../core/config.js';
|
||||
import { getSpawnRange } from '../core/state.js';
|
||||
import { createEggFarm, createScanner, createFacility } from '../core/entities.js';
|
||||
import { generateBlockedCellsInRect } from '../core/mapGen.js';
|
||||
import { expansionCost, expansionLot, expansionLots, lotFromChunk, lotBounds, lotContainsPoint, cellsInLot, isOwnedCell, countOwnedCells, shiftRowIndexedSet, shiftRowIndexedMap, ownChunk } from '../core/gridExpansion.js';
|
||||
import { key, parseKey, pointToCell, cellCenter, yen, directionNameBetweenCells } from '../core/utils.js';
|
||||
import { TEXT, equipmentName } from '../core/text.js';
|
||||
import { farmAt, scannerAt, scannerCenter, routeFromFarmToScanner, refreshRoutingAfterEdit, disconnectedBuildWarnings } from './routing.js';
|
||||
import { buildPrice, equipmentBasePrice, incomeMultiplier, mixerPoopPenalty, refundCash, spendCash, truckPoopPenalty, upgradedMixerPrice, upgradedTruckPrice, resaleValueFor, shredderUpgradeCount, shredderBonusChance, shredderBonusMaxCards } from './economy.js';
|
||||
import { autoScannerCooldownSeconds } from './cards.js';
|
||||
import { record } from './history.js';
|
||||
import { floating, eraseEffect } from './effects.js';
|
||||
import { createSelectionSystem } from './selectionSystem.js';
|
||||
import { ensureMaintenanceState, remainingPercent, performanceFactor, autoScannerDelayMultiplier, eggSpawnDelayMultiplier, facilityProcessingDelay, durabilityCapFor } from './maintenance.js';
|
||||
|
||||
export function createBuildSystem({ game, ui, canvas, canvasPoint, onUpdatePanels }) {
|
||||
function updatePanels() { if (onUpdatePanels) onUpdatePanels(); }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { AUTO_SCANNER_COOLDOWN, AUTO_SCANNER_UPGRADE_RATE, AUTO_SCANNER_MIN_COOLDOWN, BEARING_SPEED_MULTIPLIER, CARD_BALANCE, CARD_DEFAULT_EFFECTS, CARD_DEFS as CARD_DEFINITIONS, CONVEYOR_SPEED, CONVEYOR_SPEED_MAX, ECONOMY, EGG_SPAWN_RANGES, GRID, THEME } from '../core/config.js?v=27.6-cache2';
|
||||
import { nextSpawnDelay } from '../core/state.js?v=27.6-cache2';
|
||||
import { cellCenter, key, yen } from '../core/utils.js?v=27.6-cache2';
|
||||
import { applyPenalty, applyRevenue, upgradedMixerPrice, upgradedTruckPrice, shredderUpgradeCount, rawShredderUpgradeCount, shredderBonusChance, shredderBonusMaxCards } from './economy.js?v=27.6-cache2';
|
||||
import { floating, shake, eraseEffect, shockwave, sparkBurst, smokeBurst } from './effects.js?v=27.6-cache2';
|
||||
import { averageConveyorPerformance, autoScannerDelayMultiplier, ensureMaintenanceState } from './maintenance.js?v=27.6-cache2';
|
||||
import { scannerCenter, refreshRoutingAfterEdit } from './routing.js?v=27.6-cache2';
|
||||
import { AUTO_SCANNER_COOLDOWN, AUTO_SCANNER_UPGRADE_RATE, AUTO_SCANNER_MIN_COOLDOWN, BEARING_SPEED_MULTIPLIER, CARD_BALANCE, CARD_DEFAULT_EFFECTS, CARD_DEFS as CARD_DEFINITIONS, CONVEYOR_SPEED, CONVEYOR_SPEED_MAX, ECONOMY, EGG_SPAWN_RANGES, GRID, THEME } from '../core/config.js';
|
||||
import { nextSpawnDelay } from '../core/state.js';
|
||||
import { cellCenter, key, yen } from '../core/utils.js';
|
||||
import { applyPenalty, applyRevenue, upgradedMixerPrice, upgradedTruckPrice, shredderUpgradeCount, rawShredderUpgradeCount, shredderBonusChance, shredderBonusMaxCards } from './economy.js';
|
||||
import { floating, shake, eraseEffect, shockwave, sparkBurst, smokeBurst } from './effects.js';
|
||||
import { averageConveyorPerformance, autoScannerDelayMultiplier, ensureMaintenanceState } from './maintenance.js';
|
||||
import { scannerCenter, refreshRoutingAfterEdit } from './routing.js';
|
||||
|
||||
const COMMON_WEIGHT = CARD_BALANCE.commonWeight;
|
||||
const RARE_WEIGHT = CARD_BALANCE.rareWeight;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { DIRS, GRID, THEME } from '../core/config.js?v=27.6-cache2';
|
||||
import { createChick } from '../core/entities.js?v=27.6-cache2';
|
||||
import { nextSpawnDelay } from '../core/state.js?v=27.6-cache2';
|
||||
import { key, parseKey, pointToCell, cellCenter, randomBetween, yen, inGrid } from '../core/utils.js?v=27.6-cache2';
|
||||
import { scannerById, scannerBySlot, scannerCenter, scannerConnector, nearestConveyorKey, buildConveyorComponents, autoSideFor, ensureFactoryGraph } from './routing.js?v=27.6-cache2';
|
||||
import { applyMixerIncome, applyMixerPoopFine, applyTruckPoopFine, applyWrongTruckFine, upgradedTruckPrice, applyShredderBonus, applyRevenue } from './economy.js?v=27.6-cache2';
|
||||
import { autoScannerCooldownSeconds, eggProductionDelayMultiplier, extraEggOutletCount } from './cards.js?v=27.6-cache2';
|
||||
import { productionMultiplier, truckTarget, isTargetTruckCargo, shouldFineMaleTruck } from './contracts.js?v=27.6-cache2';
|
||||
import { floating, shake, spawnPulse, scannerPulse, meatEffect, sludgeEffect, shredEffect, truckLoadEffect, shockwave, sparkBurst, smokeBurst, flyingDebris, rageEffect } from './effects.js?v=27.6-cache2';
|
||||
import { countAutoSorted, countCorrect, countMistake, countMixer, countPoopDestination, countPoopSpawned, countTrash, countTruckCargo } from './stats.js?v=27.6-cache2';
|
||||
import { eggSpawnDelayMultiplier, recordFarmProduction, recordConveyorPass, recordAutoScan, recordFacilityProcess, updateProcessingCooldowns, setFacilityCooldownAfterProcess, updateRepairman } from './maintenance.js?v=27.6-cache2';
|
||||
import { DIRS, GRID, THEME } from '../core/config.js';
|
||||
import { createChick } from '../core/entities.js';
|
||||
import { nextSpawnDelay } from '../core/state.js';
|
||||
import { key, parseKey, pointToCell, cellCenter, randomBetween, yen, inGrid } from '../core/utils.js';
|
||||
import { scannerById, scannerBySlot, scannerCenter, scannerConnector, nearestConveyorKey, buildConveyorComponents, autoSideFor, ensureFactoryGraph } from './routing.js';
|
||||
import { applyMixerIncome, applyMixerPoopFine, applyTruckPoopFine, applyWrongTruckFine, upgradedTruckPrice, applyShredderBonus, applyRevenue } from './economy.js';
|
||||
import { autoScannerCooldownSeconds, eggProductionDelayMultiplier, extraEggOutletCount } from './cards.js';
|
||||
import { productionMultiplier, truckTarget, isTargetTruckCargo, shouldFineMaleTruck } from './contracts.js';
|
||||
import { floating, shake, spawnPulse, scannerPulse, meatEffect, sludgeEffect, shredEffect, truckLoadEffect, shockwave, sparkBurst, smokeBurst, flyingDebris, rageEffect } from './effects.js';
|
||||
import { countAutoSorted, countCorrect, countMistake, countMixer, countPoopDestination, countPoopSpawned, countTrash, countTruckCargo } from './stats.js';
|
||||
import { eggSpawnDelayMultiplier, recordFarmProduction, recordConveyorPass, recordAutoScan, recordFacilityProcess, updateProcessingCooldowns, setFacilityCooldownAfterProcess, updateRepairman } from './maintenance.js';
|
||||
|
||||
export function createChickSystem({ game, currentConveyorSpeed, onGameOverCheck }) {
|
||||
function currentSpawnDelay(farm) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { TURN_SECONDS, POOP_RATE, CONTRACT_EVENT_CHANCE, CONTRACT_EVENT_FIRST_TURN } from '../core/config.js?v=27.6-cache2';
|
||||
import { getSpawnRange } from '../core/state.js?v=27.6-cache2';
|
||||
import { applyRevenue } from './economy.js?v=27.6-cache2';
|
||||
import { TURN_SECONDS, POOP_RATE, CONTRACT_EVENT_CHANCE, CONTRACT_EVENT_FIRST_TURN } from '../core/config.js';
|
||||
import { getSpawnRange } from '../core/state.js';
|
||||
import { applyRevenue } from './economy.js';
|
||||
|
||||
const CONTRACT_TARGETS = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ECONOMY, FACILITY_DEFS, INCOME_FACILITY_IDS } from '../core/config.js?v=27.6-cache2';
|
||||
import { factoryValue, targetTruckCount, truckTarget } from './contracts.js?v=27.6-cache2';
|
||||
import { ECONOMY, FACILITY_DEFS, INCOME_FACILITY_IDS } from '../core/config.js';
|
||||
import { factoryValue, targetTruckCount, truckTarget } from './contracts.js';
|
||||
|
||||
function effectCount(game, id) {
|
||||
return Math.max(0, Number(game?.cardEffects?.[id]) || 0);
|
||||
|
|
|
|||
6
src/systems/effects.js
vendored
6
src/systems/effects.js
vendored
|
|
@ -1,6 +1,6 @@
|
|||
import { EFFECT_PRIORITY, THEME } from '../core/config.js?v=27.6-cache2';
|
||||
import { randomBetween, yen } from '../core/utils.js?v=27.6-cache2';
|
||||
import { applyExplosionDamage } from './economy.js?v=27.6-cache2';
|
||||
import { EFFECT_PRIORITY, THEME } from '../core/config.js';
|
||||
import { randomBetween, yen } from '../core/utils.js';
|
||||
import { applyExplosionDamage } from './economy.js';
|
||||
|
||||
export function floating(game, x, y, text, color = THEME.ink) {
|
||||
game.floatingTexts.push({ x, y, text, color, life: 1, maxLife: 1 });
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { BALANCE } from '../core/balance.js?v=27.6-cache2';
|
||||
import { GRID } from '../core/config.js?v=27.6-cache2';
|
||||
import { BALANCE } from '../core/balance.js';
|
||||
import { GRID } from '../core/config.js';
|
||||
export function cleanScanner(scanner) {
|
||||
return { ...scanner, keys: scanner.keys ? { left: { ...scanner.keys.left }, right: { ...scanner.keys.right } } : null, queue: [], cooldown: scanner.cooldown || 0 };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { BALANCE } from '../core/balance.js?v=27.6-cache2';
|
||||
import { GRID, THEME } from '../core/config.js?v=27.6-cache2';
|
||||
import { cellCenter, parseKey, key, yen } from '../core/utils.js?v=27.6-cache2';
|
||||
import { spendCash } from './economy.js?v=27.6-cache2';
|
||||
import { floating } from './effects.js?v=27.6-cache2';
|
||||
import { BALANCE } from '../core/balance.js';
|
||||
import { GRID, THEME } from '../core/config.js';
|
||||
import { cellCenter, parseKey, key, yen } from '../core/utils.js';
|
||||
import { spendCash } from './economy.js';
|
||||
import { floating } from './effects.js';
|
||||
|
||||
const RULES = BALANCE.maintenance;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { DIRS, GRID, MACHINE_FACILITY_IDS } from '../core/config.js?v=27.6-cache2';
|
||||
import { routeLabel } from '../core/text.js?v=27.6-cache2';
|
||||
import { key, parseKey, inGrid, cellCenter, distance, sameCell } from '../core/utils.js?v=27.6-cache2';
|
||||
import { DIRS, GRID, MACHINE_FACILITY_IDS } from '../core/config.js';
|
||||
import { routeLabel } from '../core/text.js';
|
||||
import { key, parseKey, inGrid, cellCenter, distance, sameCell } from '../core/utils.js';
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Object lookup
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { GRID } from '../core/config.js?v=27.6-cache2';
|
||||
import { key, parseKey, cellCenter } from '../core/utils.js?v=27.6-cache2';
|
||||
import { nearestGridEdge, layoutFacilityOnEdge } from '../core/entities.js?v=27.6-cache2';
|
||||
import { farmAt, scannerAt, scannerCenter, refreshRoutingAfterEdit } from './routing.js?v=27.6-cache2';
|
||||
import { snapshot } from './history.js?v=27.6-cache2';
|
||||
import { buildPrice } from './economy.js?v=27.6-cache2';
|
||||
import { GRID } from '../core/config.js';
|
||||
import { key, parseKey, cellCenter } from '../core/utils.js';
|
||||
import { nearestGridEdge, layoutFacilityOnEdge } from '../core/entities.js';
|
||||
import { farmAt, scannerAt, scannerCenter, refreshRoutingAfterEdit } from './routing.js';
|
||||
import { snapshot } from './history.js';
|
||||
import { buildPrice } from './economy.js';
|
||||
|
||||
export function createSelectionSystem({ game, canvasPoint, updatePanels, equipmentAtPoint, fail, pointInGrid, rectOfFacility, rectsOverlap }) {
|
||||
function selectionToken(item) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { BUILD_TOOL_IDS, CONVEYOR_SPEED_MAX, CONTRACT_EVENT_FIRST_TURN, FACILITY_DEFS, MACHINE_FACILITY_IDS, STARTING_CASH } from '../core/config.js?v=27.6-cache2';
|
||||
import { yen } from '../core/utils.js?v=27.6-cache2';
|
||||
import { TEXT } from '../core/text.js?v=27.6-cache2';
|
||||
import { routeFromFarmToScanner, factoryReady, facilityConnectionIssues } from './routing.js?v=27.6-cache2';
|
||||
import { buildPrice, fairiesTributeInfo, finalScore, maleTruckPenalty, mixerPoopPenalty, truckPoopPenalty, zundaTaxInfo } from './economy.js?v=27.6-cache2';
|
||||
import { truckTarget } from './contracts.js?v=27.6-cache2';
|
||||
import { conveyorSpeedForGame } from './cards.js?v=27.6-cache2';
|
||||
import { maintenanceSummary, repairmanDailyCost } from './maintenance.js?v=27.6-cache2';
|
||||
import { BUILD_TOOL_IDS, CONVEYOR_SPEED_MAX, CONTRACT_EVENT_FIRST_TURN, FACILITY_DEFS, MACHINE_FACILITY_IDS, STARTING_CASH } from '../core/config.js';
|
||||
import { yen } from '../core/utils.js';
|
||||
import { TEXT } from '../core/text.js';
|
||||
import { routeFromFarmToScanner, factoryReady, facilityConnectionIssues } from './routing.js';
|
||||
import { buildPrice, fairiesTributeInfo, finalScore, maleTruckPenalty, mixerPoopPenalty, truckPoopPenalty, zundaTaxInfo } from './economy.js';
|
||||
import { truckTarget } from './contracts.js';
|
||||
import { conveyorSpeedForGame } from './cards.js';
|
||||
import { maintenanceSummary, repairmanDailyCost } from './maintenance.js';
|
||||
|
||||
export function createUISystem({ game, ui, build, startGame, beginCardDraft, activeQueuedChick }) {
|
||||
function escapeHtml(value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue