Files
WT-Offline/packages/local-service/src/tuning/tuning.ts
T
N0VAN0M4LY a09ac41299 Keep a default vehicle research target for each branch
The accelerated research dialog reads currUnit when it first opens.
Assign a valid target whenever an eligible vehicle exists and replace
stale selections when refreshing a profile.

Prefer an available direct successor when configured. Otherwise use
the configured rank or tech tree order. Type checking and profile
initialization passed. In-game acceptance is pending.
2026-11-25 13:41:29 +08:00

47 lines
2.4 KiB
TypeScript

/**
* 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')),
};
}