/** * All tuning values of the offline version, read once at start-up (implementation notes; user * quote 119): values the offline version decides itself (prices, rewards, drop weights, * limits, preset content). Values the game data already has are read from the game files * instead, and protocol constants stay in the code next to their source. */ import { readClanTuning, type ClanTuning } from '../clans/clan-tuning.ts'; import { readMarketplaceTuning, type MarketplaceTuning } from '../inventory/marketplace-tuning.ts'; import { readRecyclingTuning, type RecyclingTuning } from '../inventory/recycling-tuning.ts'; import { readSupplyChestTuning, type SupplyChestTuning } from '../inventory/supply-chest-tuning.ts'; import { readTrophyTuning, type TrophyTuning } from '../inventory/trophy-tuning.ts'; import { readNewProfileTuning, type NewProfileTuning } from '../profile/new-profile-tuning.ts'; import { readResearchTuning, type ResearchTuning } from '../research/research-tuning.ts'; import { readRedeemTuning, type RedeemTuning } from '../store/redeem-tuning.ts'; import { readStoreTuning, type StoreTuning } from '../store/store-tuning.ts'; import { readLimitsTuning, type LimitsTuning } from './limits-tuning.ts'; import { tuningFiles } from './tuning-loader.ts'; export interface Tuning { readonly store: StoreTuning; readonly redeemCodes: RedeemTuning; readonly newProfile: NewProfileTuning; readonly research: ResearchTuning; readonly marketplace: MarketplaceTuning; readonly supplyChests: SupplyChestTuning; readonly recycling: RecyclingTuning; readonly trophies: TrophyTuning; readonly clans: ClanTuning; readonly limits: LimitsTuning; } export function loadTuning(dataFolder: string, report: (line: string) => void): Tuning { const files = tuningFiles(dataFolder, report); return { store: readStoreTuning(files.read('store')), redeemCodes: readRedeemTuning(files.read('redeem-codes')), newProfile: readNewProfileTuning(files.read('new-profile')), research: readResearchTuning(files.read('research')), marketplace: readMarketplaceTuning(files.read('marketplace')), supplyChests: readSupplyChestTuning(files.read('supply-chests')), recycling: readRecyclingTuning(files.read('recycling')), trophies: readTrophyTuning(files.read('trophies')), clans: readClanTuning(files.read('clans')), limits: readLimitsTuning(files.read('limits')), }; }