diff --git a/packages/blk/src/index.ts b/packages/blk/src/index.ts index c936028..4e48eec 100644 --- a/packages/blk/src/index.ts +++ b/packages/blk/src/index.ts @@ -10,5 +10,5 @@ export { emptyBlock } from './model.ts'; export { BlkFormatError } from './errors.ts'; export { BlkLabel, decodeBlk, encodeBlk, type SharedNameContext } from './binary/format.ts'; export { parseSharedNameMap, type SharedNameMap } from './shared-name-map.ts'; -export { ensureBlock, findBlock, findParam, setParam, visitParams } from './tree.ts'; +export { appendParam, ensureBlock, findBlock, findParam, setParam, visitParams } from './tree.ts'; export { formatBlkText } from './text/format-text.ts'; diff --git a/packages/blk/src/tree.ts b/packages/blk/src/tree.ts index 50fe49d..c1c1a85 100644 --- a/packages/blk/src/tree.ts +++ b/packages/blk/src/tree.ts @@ -29,6 +29,11 @@ export function setParam(block: BlkBlock, name: string, value: BlkValue): void { block.params = block.params.filter((param, position) => position <= index || param.name !== name); } +/** Append a parameter called `name` without touching existing parameters of the same name (for repeated BLK keys such as `aircraftGift:t`). */ +export function appendParam(block: BlkBlock, name: string, value: BlkValue): void { + block.params.push({ name, value }); +} + /** Visit every parameter of the tree, depth first, with the path of block names leading to it. */ export function visitParams(block: BlkBlock, visit: (param: BlkParam, path: readonly string[]) => void, path: readonly string[] = []): void { diff --git a/packages/local-service/src/char/actions/store-actions.ts b/packages/local-service/src/char/actions/store-actions.ts index f58da8f..4efc4a0 100644 --- a/packages/local-service/src/char/actions/store-actions.ts +++ b/packages/local-service/src/char/actions/store-actions.ts @@ -6,7 +6,7 @@ * full profile update). Note: `cln_buy_entitlement_and_get_reward_for_day` is not referenced * anywhere in 2.61.0.37 GUI scripts and is intentionally not registered. */ -import { emptyBlock, setParam, type BlkBlock } from '@wto/blk'; +import { appendParam, emptyBlock, setParam, type BlkBlock } from '@wto/blk'; import type { AccountStore } from '../../accounts/account-store.ts'; import { clientProfile } from '../../profile/client-profile.ts'; import type { PlayerProfiles } from '../../profile/player-profiles.ts'; @@ -69,10 +69,13 @@ function buildEntitlementsPriceBlk(products: readonly StoreProduct[]): BlkBlock setParam(block, 'alias', { type: 'string', value: 'PremiumAccount' }); setParam(block, 'group', { type: 'string', value: 'PremiumAccount' }); setParam(block, 'ttl', { type: 'int', value: product.premiumDays! }); - } else if (product.kind === 'vehicle-pack' && product.vehicle) { + } else if (product.kind === 'vehicle-pack' && product.vehicles) { setParam(block, 'onlinePurchase', { type: 'bool', value: true }); - setParam(block, 'aircraftGift', { type: 'string', value: product.vehicle.name }); + for (const vehicle of product.vehicles) { + appendParam(block, 'aircraftGift', { type: 'string', value: vehicle.name }); + } if (product.goldIncome) setParam(block, 'goldIncome', { type: 'int', value: product.goldIncome }); + if (product.silverIncome) setParam(block, 'wpIncome', { type: 'int', value: product.silverIncome }); } root.blocks.push(block); diff --git a/packages/local-service/src/game-data/datasets/ui-labels.ts b/packages/local-service/src/game-data/datasets/ui-labels.ts index 0792a7e..40b1971 100644 --- a/packages/local-service/src/game-data/datasets/ui-labels.ts +++ b/packages/local-service/src/game-data/datasets/ui-labels.ts @@ -1,24 +1,26 @@ /** * Dataset: the game's own names for countries and vehicle types, from lang.vromfs.bin - * lang/menu.csv, for the local web pages: - * country_usa, country_germany, ... country names - * mainmenu/type_aircraft, mainmenu/type_tank, ... vehicle type names + *: + * lang/_common_languages.csv: country_usa, country_germany, ... country names + * lang/menu.csv: mainmenu/type_aircraft, type_tank, ... vehicle type names */ import type { Dataset } from './dataset.ts'; import { parseLocalizedCsvMap, type LocalizedCsvText } from './lang-csv.ts'; -const MENU_CSV = 'lang/menu.csv'; +const LABEL_FILES = ['lang/_common_languages.csv', 'lang/menu.csv'] as const; const KEY_PREFIXES = ['country_', 'mainmenu/type_']; export type UiLabels = Readonly>; export const uiLabels: Dataset = { id: 'ui-labels', - version: 1, + version: 2, extract: (source) => { const labels: Record = {}; - for (const [key, text] of parseLocalizedCsvMap(source.readText('lang.vromfs.bin', MENU_CSV))) { - if (KEY_PREFIXES.some((prefix) => key.startsWith(prefix))) labels[key] = text; + for (const file of LABEL_FILES) { + for (const [key, text] of parseLocalizedCsvMap(source.readText('lang.vromfs.bin', file))) { + if (KEY_PREFIXES.some((prefix) => key.startsWith(prefix))) labels[key] = text; + } } return labels; }, diff --git a/packages/local-service/src/game-data/datasets/unit-names.ts b/packages/local-service/src/game-data/datasets/unit-names.ts index cecf5b6..9cd2a0a 100644 --- a/packages/local-service/src/game-data/datasets/unit-names.ts +++ b/packages/local-service/src/game-data/datasets/unit-names.ts @@ -14,7 +14,7 @@ export type UnitNamesMap = Readonly>; export const unitNames: Dataset = { id: 'unit-names', - version: 1, + version: 2, extract: (source) => { const lines = source.readText('lang.vromfs.bin', UNITS_CSV).split(/\r?\n/); const header = parseSemicolonCsvRow(lines[0] ?? ''); @@ -24,28 +24,35 @@ export const unitNames: Dataset = { const shopNames = new Map(); const fullNames = new Map(); + const groupNames = new Map(); for (let i = 1; i < lines.length; i++) { const line = lines[i]!; if (!line.startsWith('"')) continue; const firstSemi = line.indexOf(';'); if (firstSemi <= 2) continue; const key = line.slice(1, firstSemi - 1); - const isShop = key.endsWith('_shop'); - const isFull = !isShop && key.endsWith('_0'); - if (!isShop && !isFull) continue; + const isGroup = key.startsWith('shop/group/'); + const isShop = !isGroup && key.endsWith('_shop'); + const isFull = !isGroup && !isShop && key.endsWith('_0'); + if (!isGroup && !isShop && !isFull) continue; const cols = parseSemicolonCsvRow(line); const en = cleanLangText(cols[enCol] ?? ''); if (!en) continue; const zh = cleanLangText((hzhCol >= 0 ? cols[hzhCol] : '') || (zhCol >= 0 ? cols[zhCol] : '') || en); - const unitId = key.slice(0, isShop ? -5 : -2); - if (isShop) shopNames.set(unitId, { en, zh }); - else fullNames.set(unitId, { en, zh }); + if (isGroup) { + groupNames.set(key, { en, zh }); + } else { + const unitId = key.slice(0, isShop ? -5 : -2); + if (isShop) shopNames.set(unitId, { en, zh }); + else fullNames.set(unitId, { en, zh }); + } } const result: Record = {}; for (const [unitId, text] of fullNames) result[unitId] = text; for (const [unitId, text] of shopNames) result[unitId] = text; + for (const [groupKey, text] of groupNames) result[groupKey] = text; return result; }, }; diff --git a/packages/local-service/src/research/research-rules.ts b/packages/local-service/src/research/research-rules.ts index 313965a..d199f54 100644 --- a/packages/local-service/src/research/research-rules.ts +++ b/packages/local-service/src/research/research-rules.ts @@ -19,6 +19,7 @@ import { clanEconomy, type ClanEconomy } from '../game-data/datasets/clan-econom import { itemCatalogue } from '../game-data/datasets/item-catalogue.ts'; import { externalItemSources } from '../game-data/datasets/external-item-sources.ts'; import { storeBundles } from '../game-data/datasets/store-bundles.ts'; +import { uiLabels } from '../game-data/datasets/ui-labels.ts'; import { unitNames } from '../game-data/datasets/unit-names.ts'; import { InventoryCatalogue } from '../inventory/itemdef-catalogue.ts'; import { TrophyCatalogue } from '../inventory/trophy-catalogue.ts'; @@ -72,7 +73,7 @@ export function loadResearchRules(datasets: DatasetCache, tuning: Tuning): Resea crew: new CrewSkillCatalogue(datasets.load(crewSkillData)), unlocks: new UnlockShop(datasets.load(unlockPrices)), items: new ItemCatalogue(classicItemDefs, tuning.limits.itemPiecesPerPurchase), - store: new StoreCatalogue(vehicles, datasets.load(storeBundles), localizedUnitNames, tuning.store), + store: new StoreCatalogue(vehicles, datasets.load(storeBundles), localizedUnitNames, datasets.load(uiLabels), tuning.store), inventory: new InventoryCatalogue(vehicles, localizedUnitNames, datasets.load(externalItemSources), classicItemDefs, tuning), trophies: new TrophyCatalogue(vehicles, classicItemDefs, tuning.trophies), clanEconomy: datasets.load(clanEconomy), diff --git a/packages/local-service/src/store/store-catalogue.ts b/packages/local-service/src/store/store-catalogue.ts index afca538..0fa75e7 100644 --- a/packages/local-service/src/store/store-catalogue.ts +++ b/packages/local-service/src/store/store-catalogue.ts @@ -1,16 +1,19 @@ /** * Local store catalogue: Golden Eagles packs, Silver Lions - * packs, Premium Account durations (both Golden Eagles and GJN), and one vehicle pack per - * gift vehicle in the tech tree. What is sold and for how much is tuning (tuning/store.jsonc); - * which vehicles get a pack follows the game data (isPackVehicle). + * packs, Premium Account durations (both Golden Eagles and GJN), multi-vehicle bundles/starter + * packs, and one vehicle pack per remaining gift vehicle in the tech tree. What is sold and for + * how much is tuning (tuning/store.jsonc); which vehicles get a single-vehicle pack follows the + * game data (isPackVehicle). * * Pure domain catalogue: protocol-layer DataBlock serialization for `cln_get_entitlements_price_ex` * lives in `char/actions/store-actions.ts`. */ import type { StoreBundleGuids } from '../game-data/datasets/store-bundles.ts'; +import type { UiLabels } from '../game-data/datasets/ui-labels.ts'; import type { LocalizedText, UnitNamesMap } from '../game-data/datasets/unit-names.ts'; import type { CatalogueVehicle } from '../game-data/datasets/vehicle-catalogue.ts'; -import { vehiclePackContent, type StoreTuning } from './store-tuning.ts'; +import { TuningError } from '../tuning/tuning-reader.ts'; +import { vehiclePackContent, type MultiPackNaming, type StoreTuning } from './store-tuning.ts'; export type StoreProductKind = 'eagles' | 'warpoints' | 'premium-gold' | 'premium-gjn' | 'vehicle-pack'; @@ -31,24 +34,33 @@ export interface StoreProduct { readonly silverIncome?: number; /** Premium Account days granted on purchase. */ readonly premiumDays?: number; - /** Gift vehicle granted on purchase, with any split-vehicle parts. */ - readonly vehicle?: CatalogueVehicle; + /** Vehicles granted on purchase (1 for single packs, 2-3 for starter/bundle packs), with any split-vehicle parts. */ + readonly vehicles?: readonly CatalogueVehicle[]; + /** Localized names of `vehicles` in the same order. */ + readonly vehicleTitles?: readonly LocalizedText[]; } export class StoreCatalogue { readonly #byId = new Map(); readonly #byGuid = new Map(); - constructor(vehicles: readonly CatalogueVehicle[], bundleGuids: StoreBundleGuids, names: UnitNamesMap, tuning: StoreTuning) { + constructor( + vehicles: readonly CatalogueVehicle[], + bundleGuids: StoreBundleGuids, + names: UnitNamesMap, + labels: UiLabels, + tuning: StoreTuning, + ) { const products: StoreProduct[] = [ ...buildEaglesProducts(tuning, bundleGuids), ...buildSilverProducts(tuning), ...buildPremiumGoldProducts(tuning), ...buildPremiumGjnProducts(tuning, bundleGuids), - ...buildVehiclePackProducts(tuning, vehicles, names), + ...buildVehiclePackProducts(tuning, vehicles, names, labels), ]; for (const product of products) { + if (this.#byId.has(product.id)) throw new TuningError(`store catalogue: duplicate product id "${product.id}"`); this.#byId.set(product.id, product); if (product.guid) this.#byGuid.set(product.guid.toUpperCase(), product); } @@ -119,21 +131,73 @@ function buildPremiumGjnProducts(tuning: StoreTuning, bundleGuids: StoreBundleGu }); } -function buildVehiclePackProducts(tuning: StoreTuning, vehicles: readonly CatalogueVehicle[], names: UnitNamesMap): StoreProduct[] { - return vehicles.filter(isPackVehicle).map((vehicle) => { - const content = vehiclePackContent(tuning, vehicle.name, vehicle.rank); - const unitLabel = names[vehicle.name] ?? { en: vehicle.name, zh: vehicle.name }; +function buildVehiclePackProducts( + tuning: StoreTuning, + vehicles: readonly CatalogueVehicle[], + names: UnitNamesMap, + labels: UiLabels, +): StoreProduct[] { + const byName = new Map(vehicles.map((vehicle) => [vehicle.name, vehicle])); + const inMultiPack = new Set(); + const multiPacks: StoreProduct[] = tuning.multiVehiclePacks.map((pack) => { + const packVehicles = pack.vehicles.map((unitName) => { + const found = byName.get(unitName); + if (!found) throw new TuningError(`tuning file store.jsonc: multiVehiclePacks (${pack.id}) references unknown vehicle "${unitName}"`); + inMultiPack.add(unitName); + return found; + }); return { - id: `wto_pack_${vehicle.name}`, + id: pack.id, kind: 'vehicle-pack', chapter: 'bonuses', - title: { en: `${unitLabel.en} Pack`, zh: `${unitLabel.zh} 礼包` }, - gjnCostCents: content.gjnCents, - ...(content.goldenEagles ? { goldIncome: content.goldenEagles } : {}), - ...(content.premiumDays ? { premiumDays: content.premiumDays } : {}), - vehicle, + title: resolveMultiPackTitle(pack.id, pack.naming, packVehicles[0]!, names, labels), + gjnCostCents: pack.gjnCents, + ...(pack.goldenEagles ? { goldIncome: pack.goldenEagles } : {}), + ...(pack.silverLions ? { silverIncome: pack.silverLions } : {}), + ...(pack.premiumDays ? { premiumDays: pack.premiumDays } : {}), + vehicles: packVehicles, + vehicleTitles: packVehicles.map((vehicle) => names[vehicle.name] ?? { en: vehicle.name, zh: vehicle.name }), }; }); + + const singlePacks: StoreProduct[] = vehicles + .filter((vehicle) => isPackVehicle(vehicle) && !inMultiPack.has(vehicle.name)) + .map((vehicle) => { + const content = vehiclePackContent(tuning, vehicle.name, vehicle.rank); + const unitLabel = names[vehicle.name] ?? { en: vehicle.name, zh: vehicle.name }; + return { + id: `wto_pack_${vehicle.name}`, + kind: 'vehicle-pack', + chapter: 'bonuses', + title: { en: `${unitLabel.en} Pack`, zh: `${unitLabel.zh} 礼包` }, + gjnCostCents: content.gjnCents, + ...(content.goldenEagles ? { goldIncome: content.goldenEagles } : {}), + ...(content.silverLions ? { silverIncome: content.silverLions } : {}), + ...(content.premiumDays ? { premiumDays: content.premiumDays } : {}), + vehicles: [vehicle], + vehicleTitles: [unitLabel], + }; + }); + + return [...multiPacks, ...singlePacks]; +} + +function resolveMultiPackTitle( + packId: string, + naming: MultiPackNaming, + firstVehicle: CatalogueVehicle, + names: UnitNamesMap, + labels: UiLabels, +): LocalizedText { + if (naming.kind === 'custom') return naming.title; + if (naming.kind === 'group') { + const group = names[naming.groupKey]; + if (!group) throw new Error(`lang/units.csv has no "${naming.groupKey}" entry for multi-vehicle pack "${packId}"`); + return { en: `${group.en} Pack`, zh: `${group.zh}礼包` }; + } + const country = labels[firstVehicle.country]; + if (!country) throw new Error(`lang/menu.csv has no "${firstVehicle.country}" entry for starter pack "${packId}"`); + return { en: `${country.en} Starter Pack`, zh: `${country.zh}新手礼包` }; } function isPackVehicle(vehicle: CatalogueVehicle): boolean { diff --git a/packages/local-service/src/store/store-purchase.ts b/packages/local-service/src/store/store-purchase.ts index 45be408..de6f08a 100644 --- a/packages/local-service/src/store/store-purchase.ts +++ b/packages/local-service/src/store/store-purchase.ts @@ -38,19 +38,16 @@ export type GjnPurchaseOutcome = export function canBuyGjnProduct(profile: BlkBlock, product: StoreProduct, nowFiletime: bigint): boolean { if (product.gjnCostCents === undefined) return false; - if (product.kind === 'vehicle-pack' && product.vehicle) { - return !ownsVehicle(profile, product.vehicle.name) && !hasEntitlement(profile, product.id, nowFiletime); + if (product.kind === 'vehicle-pack' && product.vehicles) { + if (hasEntitlement(profile, product.id, nowFiletime)) return false; + return !product.vehicles.every((vehicle) => ownsVehicle(profile, vehicle.name)); } return true; } export function buyGjnProduct(profile: BlkBlock, product: StoreProduct, nowFiletime: bigint): GjnPurchaseOutcome { if (product.gjnCostCents === undefined) return { ok: false, reason: 'NOT_FOUND' }; - if (product.kind === 'vehicle-pack' && product.vehicle) { - if (ownsVehicle(profile, product.vehicle.name) || hasEntitlement(profile, product.id, nowFiletime)) { - return { ok: false, reason: 'ALREADY_BOUGHT' }; - } - } + if (!canBuyGjnProduct(profile, product, nowFiletime)) return { ok: false, reason: 'ALREADY_BOUGHT' }; if (balanceOf(profile).gjnCents < product.gjnCostCents) return { ok: false, reason: 'NOT_ENOUGH_GJN' }; payGjnCents(profile, product.gjnCostCents); @@ -58,13 +55,18 @@ export function buyGjnProduct(profile: BlkBlock, product: StoreProduct, nowFilet return { ok: true }; } + function grantProductRewards(profile: BlkBlock, product: StoreProduct, nowFiletime: bigint): void { if (product.id !== 'PremiumAccount') recordEntitlementPurchase(profile, product.id); if (product.goldIncome) addGoldenEagles(profile, product.goldIncome); if (product.silverIncome) addSilverLions(profile, product.silverIncome); if (product.premiumDays) extendPremiumAccount(profile, product.premiumDays, nowFiletime); - if (product.vehicle) { - addOwnedVehicle(profile, product.vehicle.name); - for (const part of product.vehicle.parts) addOwnedVehicle(profile, part); + if (product.vehicles) { + for (const vehicle of product.vehicles) { + if (!ownsVehicle(profile, vehicle.name)) addOwnedVehicle(profile, vehicle.name); + for (const part of vehicle.parts) { + if (!ownsVehicle(profile, part)) addOwnedVehicle(profile, part); + } + } } } diff --git a/packages/local-service/src/store/store-tuning.ts b/packages/local-service/src/store/store-tuning.ts index dcdd660..194b6ee 100644 --- a/packages/local-service/src/store/store-tuning.ts +++ b/packages/local-service/src/store/store-tuning.ts @@ -1,4 +1,5 @@ /** Typed content of tuning/store.jsonc. */ +import type { LocalizedText } from '../game-data/datasets/unit-names.ts'; import { TuningError, type TuningReader } from '../tuning/tuning-reader.ts'; export interface GoldenEaglePack { @@ -24,6 +25,18 @@ export interface VehiclePackContent { readonly gjnCents: number; readonly goldenEagles: number; readonly premiumDays: number; + readonly silverLions?: number; +} + +export type MultiPackNaming = + | { readonly kind: 'group'; readonly groupKey: string } + | { readonly kind: 'starter' } + | { readonly kind: 'custom'; readonly title: LocalizedText }; + +export interface MultiVehiclePack extends VehiclePackContent { + readonly id: string; + readonly naming: MultiPackNaming; + readonly vehicles: readonly string[]; } export interface StoreTuning { @@ -31,6 +44,8 @@ export interface StoreTuning { readonly silverLionPacks: readonly SilverLionPack[]; readonly premiumForGoldenEagles: readonly PremiumTier[]; readonly premiumForGjn: readonly PremiumTier[]; + /** Multi-vehicle bundles and starter packs sold as a single pack. */ + readonly multiVehiclePacks: readonly MultiVehiclePack[]; /** Sorted by upToRank. */ readonly vehiclePacksByRank: readonly (VehiclePackContent & { readonly upToRank: number })[]; /** Per-vehicle content; a field left out comes from the vehicle's rank tier. */ @@ -42,13 +57,22 @@ export function readStoreTuning(file: TuningReader): StoreTuning { const byRank = packs.list('byRank', (entry) => ({ upToRank: entry.int('upToRank', { min: 1 }), ...packContent(entry) })) .sort((a, b) => a.upToRank - b.upToRank); if (byRank.length === 0) throw new TuningError('tuning file store.jsonc: vehiclePacks.byRank must have at least one tier'); + const goldenEaglePacks = file.list('goldenEaglePacks', (entry) => ({ id: entry.string('id'), goldenEagles: entry.int('goldenEagles', { min: 1 }), gjnCents: entry.money('gjn', { min: 0.01 }) })); + const silverLionPacks = file.list('silverLionPacks', (entry) => ({ id: entry.string('id'), silverLions: entry.int('silverLions', { min: 1 }), goldenEagles: entry.int('goldenEagles', { min: 1 }) })); + const premiumForGoldenEagles = file.list('premiumForGoldenEagles', (entry) => premiumTier(entry, 'goldenEagles')); + const premiumForGjn = file.list('premiumForGjn', (entry) => premiumTier(entry, 'gjn')); + const multiVehiclePacks = packs.list('multiVehiclePacks', readMultiVehiclePack); + const vehiclePacksByVehicle = packs.table('byVehicle', partialPackContent); + + validateStoreUniqueness(goldenEaglePacks, silverLionPacks, premiumForGoldenEagles, premiumForGjn, multiVehiclePacks); return { - goldenEaglePacks: file.list('goldenEaglePacks', (entry) => ({ id: entry.string('id'), goldenEagles: entry.int('goldenEagles', { min: 1 }), gjnCents: entry.money('gjn', { min: 0.01 }) })), - silverLionPacks: file.list('silverLionPacks', (entry) => ({ id: entry.string('id'), silverLions: entry.int('silverLions', { min: 1 }), goldenEagles: entry.int('goldenEagles', { min: 1 }) })), - premiumForGoldenEagles: file.list('premiumForGoldenEagles', (entry) => premiumTier(entry, 'goldenEagles')), - premiumForGjn: file.list('premiumForGjn', (entry) => premiumTier(entry, 'gjn')), + goldenEaglePacks, + silverLionPacks, + premiumForGoldenEagles, + premiumForGjn, + multiVehiclePacks, vehiclePacksByRank: byRank, - vehiclePacksByVehicle: packs.table('byVehicle', partialPackContent), + vehiclePacksByVehicle, }; } @@ -56,10 +80,12 @@ export function readStoreTuning(file: TuningReader): StoreTuning { export function vehiclePackContent(tuning: StoreTuning, vehicle: string, rank: number): VehiclePackContent { const tier = tuning.vehiclePacksByRank.find((entry) => rank <= entry.upToRank) ?? tuning.vehiclePacksByRank[tuning.vehiclePacksByRank.length - 1]!; const own = tuning.vehiclePacksByVehicle.get(vehicle) ?? {}; + const silverLions = own.silverLions ?? tier.silverLions; return { gjnCents: own.gjnCents ?? tier.gjnCents, goldenEagles: own.goldenEagles ?? tier.goldenEagles, premiumDays: own.premiumDays ?? tier.premiumDays, + ...(silverLions ? { silverLions } : {}), }; } @@ -69,7 +95,63 @@ function premiumTier(entry: TuningReader, currency: 'goldenEagles' | 'gjn'): Pre } function packContent(entry: TuningReader): VehiclePackContent { - return { gjnCents: entry.money('gjn', { min: 0.01 }), goldenEagles: entry.int('goldenEagles', { min: 0 }), premiumDays: entry.int('premiumDays', { min: 0 }) }; + const silverLions = entry.has('silverLions') ? entry.int('silverLions', { min: 0 }) : 0; + return { + gjnCents: entry.money('gjn', { min: 0.01 }), + goldenEagles: entry.int('goldenEagles', { min: 0 }), + premiumDays: entry.int('premiumDays', { min: 0 }), + ...(silverLions > 0 ? { silverLions } : {}), + }; +} + +function readMultiVehiclePack(entry: TuningReader): MultiVehiclePack { + const id = entry.string('id'); + const naming = readMultiPackNaming(entry, id); + const vehicles = entry.stringList('vehicles'); + if (vehicles.length === 0) throw new TuningError(`tuning file store.jsonc: multiVehiclePacks (${id}) must list at least one vehicle`); + const uniqueInPack = new Set(vehicles); + if (uniqueInPack.size !== vehicles.length) { + throw new TuningError(`tuning file store.jsonc: multiVehiclePacks (${id}) lists duplicate vehicles`); + } + return { id, naming, vehicles, ...packContent(entry) }; +} + +function readMultiPackNaming(entry: TuningReader, id: string): MultiPackNaming { + const hasGroup = entry.has('groupKey'); + const hasStarter = entry.has('starter') && entry.bool('starter'); + const hasTitle = entry.has('title'); + const chosen = Number(hasGroup) + Number(hasStarter) + Number(hasTitle); + if (chosen !== 1) { + throw new TuningError(`tuning file store.jsonc: multiVehiclePacks (${id}) must set exactly one of groupKey, starter: true, or title`); + } + if (hasGroup) return { kind: 'group', groupKey: entry.string('groupKey') }; + if (hasStarter) return { kind: 'starter' }; + const titleObj = entry.object('title'); + return { kind: 'custom', title: { en: titleObj.string('en'), zh: titleObj.string('zh') } }; +} + +function validateStoreUniqueness( + eagles: readonly GoldenEaglePack[], + silver: readonly SilverLionPack[], + premGold: readonly PremiumTier[], + premGjn: readonly PremiumTier[], + multiPacks: readonly MultiVehiclePack[], +): void { + const ids = new Set(); + for (const item of [...eagles, ...silver, ...premGold, ...premGjn, ...multiPacks]) { + if (ids.has(item.id)) throw new TuningError(`tuning file store.jsonc: duplicate product id "${item.id}"`); + ids.add(item.id); + } + // Vehicles in multiVehiclePacks automatically take precedence over byVehicle in StoreCatalogue, + // allowing /tuning/store.jsonc overrides to bundle vehicles that were single packs by default. + const vehiclesInMulti = new Map(); + for (const pack of multiPacks) { + for (const unit of pack.vehicles) { + const earlier = vehiclesInMulti.get(unit); + if (earlier) throw new TuningError(`tuning file store.jsonc: vehicle "${unit}" appears in both "${earlier}" and "${pack.id}"`); + vehiclesInMulti.set(unit, pack.id); + } + } } function partialPackContent(entry: TuningReader): Partial { @@ -77,5 +159,6 @@ function partialPackContent(entry: TuningReader): Partial { ...(entry.has('gjn') ? { gjnCents: entry.money('gjn', { min: 0.01 }) } : {}), ...(entry.has('goldenEagles') ? { goldenEagles: entry.int('goldenEagles', { min: 0 }) } : {}), ...(entry.has('premiumDays') ? { premiumDays: entry.int('premiumDays', { min: 0 }) } : {}), + ...(entry.has('silverLions') ? { silverLions: entry.int('silverLions', { min: 0 }) } : {}), }; } diff --git a/packages/local-service/src/store/store-web-api.ts b/packages/local-service/src/store/store-web-api.ts index 5cb9c6b..e696cf5 100644 --- a/packages/local-service/src/store/store-web-api.ts +++ b/packages/local-service/src/store/store-web-api.ts @@ -67,7 +67,6 @@ export class StoreWebApi { if (!product || product.gjnCostCents === undefined) { return jsonResponse({ ok: false, message: { zh: '没有找到这个商品。', en: 'Product not found.' } }, 'store web buy: unknown product'); } - let outcome: GjnPurchaseOutcome = { ok: false, reason: 'NOT_FOUND' }; const now = serverTimeNow(); this.#profiles.updateWhen(account.userId, (saved) => { @@ -101,21 +100,35 @@ function purchaseMessage(outcome: GjnPurchaseOutcome, product: StoreProduct): Lo }; } if (outcome.reason === 'NOT_ENOUGH_GJN') { - return { zh: `GJN 不够:需要 ${cost} GJN。可以在"兑换码"页用 GJN 充值码补充。`, en: `Not enough GJN: ${cost} GJN needed. A GJN code on the Redeem tab adds more.` }; + return { zh: `GJN 不够:需要 ${cost} GJN,可在"兑换码"页用 GJN 充值码补充。`, en: `Not enough GJN: ${cost} GJN needed. Use a GJN code on the Redeem tab.` }; } - if (outcome.reason === 'ALREADY_BOUGHT') return { zh: '你已经拥有这辆载具。', en: 'You already own this vehicle.' }; + if (outcome.reason === 'ALREADY_BOUGHT') return { zh: '你已经拥有该礼包内的载具。', en: 'You already own the vehicle(s) in this pack.' }; return { zh: '这个商品现在买不了。', en: 'This product cannot be bought right now.' }; } function webProduct(product: StoreProduct, owned: boolean): Record { + const vehicles = product.vehicles; + const firstVehicle = vehicles?.[0]; + const ranks = vehicles ? [...new Set(vehicles.map((vehicle) => vehicle.rank))].sort((a, b) => a - b) : undefined; return { id: product.id, kind: product.kind, title: product.title, gjnCostCents: product.gjnCostCents, ...(product.goldIncome ? { goldIncome: product.goldIncome } : {}), + ...(product.silverIncome ? { silverIncome: product.silverIncome } : {}), ...(product.premiumDays ? { premiumDays: product.premiumDays } : {}), - ...(product.vehicle ? { unitName: product.vehicle.name, country: product.vehicle.country, rank: product.vehicle.rank } : {}), + ...(firstVehicle && vehicles ? { + unitName: firstVehicle.name, + country: firstVehicle.country, + rank: ranks![ranks!.length - 1]!, + ranks, + vehicles: vehicles.map((vehicle, index) => ({ + unitName: vehicle.name, + rank: vehicle.rank, + title: product.vehicleTitles?.[index] ?? { en: vehicle.name, zh: vehicle.name }, + })), + } : {}), owned, }; } diff --git a/packages/local-service/src/store/web/app.js b/packages/local-service/src/store/web/app.js index cf766de..6d4ee09 100644 --- a/packages/local-service/src/store/web/app.js +++ b/packages/local-service/src/store/web/app.js @@ -6,16 +6,16 @@ const T = { title: 'WTOffline 本地商店', hint: '买完关闭本窗口,机库会自动刷新', toMarket: '前往交易所', eagles: '金鹰', lions: '银狮', premium: '高级账户', premiumOff: '未开通', premiumLeft: '剩余 {days} 天', tabPacks: '礼包载具', tabPremium: '高级账户', tabEagles: '金鹰', tabRedeem: '兑换码', - search: '搜索载具名称', allCountries: '全部国家', allRanks: '全部等级', rank: '{rank} 级', - containsEagles: '附赠 {n} 金鹰', containsPremium: '附赠 {days} 天高级账户', premiumDays: '{days} 天高级账户', + search: '搜索礼包或载具名称', allCountries: '全部国家', allRanks: '全部等级', rank: '{rank} 级', + includesUnit: '包含载具:{name}', containsEagles: '附赠 {n} 金鹰', containsSilver: '附赠 {n} 银狮', containsPremium: '附赠 {days} 天高级账户', premiumDays: '{days} 天高级账户', buy: '购买', owned: '已拥有', pickAccount: '请先选择账号', redeem: '兑换', codePlaceholder: '输入兑换码', empty: '没有符合条件的商品', }, en: { title: 'WTOffline Store', hint: 'Close this window after buying to refresh the hangar', toMarket: 'Go to Marketplace', eagles: 'Golden Eagles', lions: 'Silver Lions', premium: 'Premium', premiumOff: 'inactive', premiumLeft: '{days} days left', tabPacks: 'Vehicle packs', tabPremium: 'Premium Account', tabEagles: 'Golden Eagles', tabRedeem: 'Redeem code', - search: 'Search vehicles', allCountries: 'All nations', allRanks: 'All ranks', rank: 'Rank {rank}', - containsEagles: '+{n} Golden Eagles', containsPremium: '+{days} days of Premium Account', premiumDays: '{days} days of Premium Account', + search: 'Search packs or vehicles', allCountries: 'All nations', allRanks: 'All ranks', rank: 'Rank {rank}', + includesUnit: 'Vehicle: {name}', containsEagles: '+{n} Golden Eagles', containsSilver: '+{n} Silver Lions', containsPremium: '+{days} days of Premium Account', premiumDays: '{days} days of Premium Account', buy: 'Buy', owned: 'Owned', pickAccount: 'Pick an account first', redeem: 'Redeem', codePlaceholder: 'Enter a code', empty: 'Nothing matches the filters', }, }; @@ -35,8 +35,6 @@ function applyStaticTexts() { async function loadState(userId) { state = await WtoUi.getJson('/store/api/state' + (userId ? '?userId=' + encodeURIComponent(userId) : '')); - if (userId && !state.activeUserId) return loadState(''); - if (state.activeUserId) WtoUi.saveAccount(state.activeUserId); renderHeader(); renderFilters(); renderContent(); @@ -59,8 +57,9 @@ function fillSelect(select, firstText, values, textOf) { function renderFilters() { const packs = state.products.filter((p) => p.kind === 'vehicle-pack'); - fillSelect($('countryFilter'), t('allCountries'), [...new Set(packs.map((p) => p.country))], WtoUi.label); - fillSelect($('rankFilter'), t('allRanks'), [...new Set(packs.map((p) => p.rank))].sort((a, b) => a - b), (r) => t('rank', { rank: ROMAN[r] || r })); + fillSelect($('countryFilter'), t('allCountries'), [...new Set(packs.map((p) => p.country).filter(Boolean))], WtoUi.label); + const allRanks = packs.flatMap((p) => p.ranks || (p.rank ? [p.rank] : [])); + fillSelect($('rankFilter'), t('allRanks'), [...new Set(allRanks)].sort((a, b) => a - b), (r) => t('rank', { rank: ROMAN[r] || r })); } function matchesFilters(product) { @@ -70,8 +69,11 @@ function matchesFilters(product) { const rank = $('rankFilter').value; const query = $('searchInput').value.trim().toLowerCase(); if (country && product.country !== country) return false; - if (rank && String(product.rank) !== rank) return false; - return !query || [product.title.zh, product.title.en, product.unitName].some((s) => (s || '').toLowerCase().includes(query)); + if (rank && !(product.ranks || [product.rank]).map(String).includes(rank)) return false; + if (!query) return true; + const searchTerms = [product.title.zh, product.title.en, product.unitName]; + for (const v of product.vehicles || []) searchTerms.push(v.unitName, v.title && v.title.zh, v.title && v.title.en); + return searchTerms.some((s) => (s || '').toLowerCase().includes(query)); } function renderContent() { @@ -91,6 +93,32 @@ function renderContent() { function productCard(product) { const card = document.createElement('div'); card.className = 'card'; + card.appendChild(productCardHead(product)); + + const contents = productContents(product); + if (contents.length) { + const list = document.createElement('ul'); + list.className = 'contents'; + for (const line of contents) list.appendChild(Object.assign(document.createElement('li'), { textContent: line })); + card.appendChild(list); + } + + const foot = document.createElement('div'); + foot.className = 'card-foot'; + foot.innerHTML = ''; + foot.querySelector('.price').textContent = WtoUi.gjn(product.gjnCostCents) + ' GJN'; + const btn = Object.assign(document.createElement('button'), { + className: 'buy', + textContent: product.owned ? t('owned') : (state.activeUserId ? t('buy') : t('pickAccount')), + disabled: product.owned || !state.activeUserId, + }); + if (!btn.disabled) btn.onclick = () => buy(product.id); + foot.appendChild(btn); + card.appendChild(foot); + return card; +} + +function productCardHead(product) { const head = document.createElement('div'); head.className = 'card-head'; if (product.unitName) head.appendChild(WtoUi.iconImg('vehicle', product.unitName, 'vehicle-icon')); @@ -103,29 +131,19 @@ function productCard(product) { sub.appendChild(document.createTextNode(WtoUi.label(product.country) + ' · ' + t('rank', { rank: ROMAN[product.rank] || product.rank }))); } head.appendChild(titles); - card.appendChild(head); + return head; +} +function productContents(product) { const contents = []; + if (product.vehicles && product.vehicles.length > 1) { + for (const v of product.vehicles) contents.push(t('includesUnit', { name: WtoUi.text(v.title) })); + } if (product.kind === 'premium-gjn') contents.push(t('premiumDays', { days: product.premiumDays })); else if (product.premiumDays) contents.push(t('containsPremium', { days: product.premiumDays })); if (product.kind === 'vehicle-pack' && product.goldIncome) contents.push(t('containsEagles', { n: WtoUi.num(product.goldIncome) })); - if (contents.length) { - const list = document.createElement('ul'); - list.className = 'contents'; - for (const line of contents) list.appendChild(Object.assign(document.createElement('li'), { textContent: line })); - card.appendChild(list); - } - - const foot = document.createElement('div'); - foot.className = 'card-foot'; - foot.innerHTML = ''; - foot.querySelector('.price').textContent = WtoUi.gjn(product.gjnCostCents) + ' GJN'; - const button = foot.querySelector('button'); - button.textContent = product.owned ? t('owned') : state.activeUserId ? t('buy') : t('pickAccount'); - button.disabled = product.owned || !state.activeUserId; - button.onclick = () => buy(product.id); - card.appendChild(foot); - return card; + if (product.kind === 'vehicle-pack' && product.silverIncome) contents.push(t('containsSilver', { n: WtoUi.num(product.silverIncome) })); + return contents; } function renderRedeemHelp() { diff --git a/packages/local-service/tuning/store.jsonc b/packages/local-service/tuning/store.jsonc index 1407521..c139607 100644 --- a/packages/local-service/tuning/store.jsonc +++ b/packages/local-service/tuning/store.jsonc @@ -44,8 +44,135 @@ { "id": "wto_prem_180d", "days": 180, "gjn": 39.99 } ], - // 礼包载具:每辆科技树礼包车一个礼包,用 GJN 买,买下送载具和附赠内容。 + // 礼包载具:按官方礼包售卖(多车礼包一次给多辆车及附赠内容,其余科技树礼包车每辆车一个礼包),用 GJN 买(或用"老福爷付过了"直接买下)。 "vehiclePacks": { + // 多车礼包(5 个三车礼包、9 个国家的新手礼包;用户原话 123 方案 A):买下一次发放列表中全部载具及附赠的金鹰、高级账户天数、银狮。 + // 这里列出的载具不再另外生成单车礼包。名称不手写,运行时从玩家的游戏语言包读取: + // - groupKey:取 lang/units.csv 的科技树折叠组名(如 shop/group/germ_tiger_east_west_group)拼成礼包名; + // - starter: true:取第一辆车所属国家在 lang/menu.csv 的国家名拼成新手礼包名。 + "multiVehiclePacks": [ + { + "id": "wto_pack_two_fronts", + "groupKey": "shop/group/germ_tiger_east_west_group", + "vehicles": ["germ_pzkpfw_VI_ausf_h1_tiger_east", "germ_pzkpfw_VI_ausf_h1_tiger_west", "germ_flakpanzer_IV_Ostwind_2_net"], + "gjn": 34.99, + "goldenEagles": 1000, + "premiumDays": 15 + }, + { + "id": "wto_pack_be_prepared", + "groupKey": "shop/group/ussr_kit_4rank_group", + "vehicles": ["ussr_t_44_kit_4rank", "ussr_is_2m_kit_4rank", "ussr_m53_59_kit_4rank"], + "gjn": 59.99, + "goldenEagles": 1000, + "premiumDays": 15 + }, + { + "id": "wto_pack_echoes_of_overlord", + "groupKey": "shop/group/uk_kit_3rank_group", + "vehicles": ["uk_sherman_vc_firefly_kit_3rank", "uk_a30_sp_avenger_kit_3rank", "uk_crusader_aa_mk_2_kit_3rank"], + "gjn": 34.99, + "goldenEagles": 1000, + "premiumDays": 15 + }, + { + "id": "wto_pack_hell_on_wheels", + "groupKey": "shop/group/us_kit_3rank_group", + "vehicles": ["us_m4a3e8_76w_sherman_kit_3rank", "us_m18_hellcat_kit_3rank", "us_skink_aa_kit_3rank"], + "gjn": 34.99, + "goldenEagles": 1000, + "premiumDays": 15 + }, + { + "id": "wto_pack_in_may_45", + "groupKey": "shop/group/ussr_kit_3rank_group", + "vehicles": ["ussr_is_1_kit_3rank", "ussr_t_34_85_zis_53_kit_3rank", "ussr_sdkfz_251_21_kit_3rank"], + "gjn": 34.99, + "goldenEagles": 1000, + "premiumDays": 15 + }, + { + "id": "wto_pack_us_starter", + "starter": true, + "vehicles": ["us_m3a1_stuart_usmc", "p-36a_rasmussen"], + "gjn": 4.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_germany_beginners", + "starter": true, + "vehicles": ["germ_pzkpfw_38t_Aufklarungspanzer", "ju-87r-2_snake"], + "gjn": 4.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_ussr_starter", + "starter": true, + "vehicles": ["ussr_t_126sp", "i-153_m62_zhukovskiy"], + "gjn": 7.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_british_starter", + "starter": true, + "vehicles": ["uk_crusader_mk_2_the_saint", "spitfiremkiia_ep"], + "gjn": 9.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_japanese_starter", + "starter": true, + "vehicles": ["jp_type_1_chi_he_5th_regiment", "ki_44_1_ep"], + "gjn": 9.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_chinese_starter", + "starter": true, + "vehicles": ["cn_m3a3_stuart_1st_ptg", "p-40c_china"], + "gjn": 9.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_italian_starter", + "starter": true, + "vehicles": ["it_m14_41_47_40", "re_2001_serie1_ep"], + "gjn": 9.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_french_starter", + "starter": true, + "vehicles": ["fr_b1_ter", "p-40f-5_france_ep"], + "gjn": 9.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + }, + { + "id": "wto_pack_swedish_starter", + "starter": true, + "vehicles": ["sw_strv_m41_s1", "fokker_d21_mod20"], + "gjn": 9.99, + "goldenEagles": 0, + "premiumDays": 7, + "silverLions": 120000 + } + ], // 默认内容按载具等级:取第一个 upToRank 不小于载具等级的档位。 // 只用于官方价格查不到的车(implementation notes 第 8 节)。每档取官方礼包在该等级最常见的价格和附赠内容; // 2 级官方没有单车礼包,按上面的规则落到 3 级那档。 @@ -60,7 +187,7 @@ ], // 单辆车的礼包内容,覆盖按等级的默认值;键是载具名(char.vromfs.bin config/wpcost.blk)。 // 价格是官方礼包的美元价(implementation notes,出处见 implementation notes 第 8 节); - // 附赠的金鹰和高级账户天数按官方礼包页面写的内容。多车礼包(如 Two Fronts)里的每辆车各记一次整个礼包的价格。 + // 附赠的金鹰和高级账户天数按官方礼包页面写的内容。 "byVehicle": { "a-26c-45-dt": {"gjn": 19.99, "goldenEagles": 2000, "premiumDays": 15}, "a_10a_early": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, @@ -88,16 +215,12 @@ "fr_somua_sm": {"gjn": 44.99, "goldenEagles": 1000, "premiumDays": 7}, "germ_battleship_gneisenau_380mm": {"gjn": 79.99, "goldenEagles": 3000, "premiumDays": 30}, "germ_erprobungstrager_3_achs_turm": {"gjn": 49.99, "goldenEagles": 2000, "premiumDays": 15}, - "germ_flakpanzer_IV_Ostwind_2_net": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "germ_leopard_2a4_pzbtl_123": {"gjn": 64.99, "goldenEagles": 2000, "premiumDays": 15}, "germ_leopard_2a4m_can": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, "germ_leopard_2a4m_can_sm": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, "germ_leopard_a1a1_120": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, "germ_marder_clovis": {"gjn": 49.99, "goldenEagles": 2000, "premiumDays": 15}, - "germ_pzkpfw_38t_Aufklarungspanzer": {"gjn": 4.99, "goldenEagles": 0, "premiumDays": 7}, "germ_pzkpfw_VI_ausf_b_tiger_IIh_sla": {"gjn": 39.99, "goldenEagles": 1000, "premiumDays": 7}, - "germ_pzkpfw_VI_ausf_h1_tiger_east": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, - "germ_pzkpfw_VI_ausf_h1_tiger_west": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "germ_schutzenpanzer_puma_vjtf_mod": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, "hawk_t1a": {"gjn": 49.99, "goldenEagles": 2000, "premiumDays": 15}, "ia_58a_pucara": {"gjn": 39.99, "goldenEagles": 2000, "premiumDays": 15}, @@ -131,26 +254,19 @@ "sw_strv121b_christian2": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, "tiger_had_spain": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, "tornado_ids_de_wtd61": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, - "uk_a30_sp_avenger_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "uk_battleship_duke_of_york": {"gjn": 79.99, "goldenEagles": 3000, "premiumDays": 30}, "uk_battleship_nelson": {"gjn": 79.99, "goldenEagles": 3000, "premiumDays": 30}, "uk_challenger_1_mk_3_gulf": {"gjn": 64.99, "goldenEagles": 2000, "premiumDays": 15}, "uk_challenger_2_megatron_sm": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, - "uk_crusader_aa_mk_2_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "uk_olifant_optimering": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, - "uk_sherman_vc_firefly_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "uk_vickers_gbt_155": {"gjn": 39.99, "goldenEagles": 1000, "premiumDays": 7}, "us_battleship_colorado_class_maryland": {"gjn": 79.99, "goldenEagles": 3000, "premiumDays": 30}, "us_destroyer_fletcher_bennion": {"gjn": 49.99, "goldenEagles": 2000, "premiumDays": 15}, - "us_m18_hellcat_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "us_m1_abrams_kvt": {"gjn": 64.99, "goldenEagles": 2000, "premiumDays": 15}, "us_m1a1_hc_usmc": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, "us_m1a1_hc_usmc_sm": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, - "us_m3a1_stuart_usmc": {"gjn": 4.99, "goldenEagles": 0, "premiumDays": 7}, - "us_m4a3e8_76w_sherman_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "us_m60a1_rise_mod": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, "us_rdf_lt": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, - "us_skink_aa_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, "us_stingray_2": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, "us_t29": {"gjn": 39.99, "goldenEagles": 1000, "premiumDays": 7}, "us_t58": {"gjn": 49.99, "goldenEagles": 2000, "premiumDays": 15}, @@ -158,14 +274,8 @@ "ussr_battlecruiser_sevastopol": {"gjn": 79.99, "goldenEagles": 3000, "premiumDays": 30}, "ussr_bmd_4m": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, "ussr_bmpt_72": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20}, - "ussr_is_1_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, - "ussr_is_2m_kit_4rank": {"gjn": 59.99, "goldenEagles": 1000, "premiumDays": 15}, "ussr_is_6": {"gjn": 44.99, "goldenEagles": 1000, "premiumDays": 7}, - "ussr_m53_59_kit_4rank": {"gjn": 59.99, "goldenEagles": 1000, "premiumDays": 15}, "ussr_object_120": {"gjn": 49.99, "goldenEagles": 2000, "premiumDays": 15}, - "ussr_sdkfz_251_21_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, - "ussr_t_34_85_zis_53_kit_3rank": {"gjn": 34.99, "goldenEagles": 1000, "premiumDays": 15}, - "ussr_t_44_kit_4rank": {"gjn": 59.99, "goldenEagles": 1000, "premiumDays": 15}, "ussr_t_55_am": {"gjn": 59.99, "goldenEagles": 2000, "premiumDays": 15}, "ussr_t_72av_turms": {"gjn": 64.99, "goldenEagles": 2000, "premiumDays": 15}, "ussr_t_80ue1": {"gjn": 69.99, "goldenEagles": 2500, "premiumDays": 20},