Implement vehicle research and purchases
Recompute unlocked ranks, prerequisites, and unit states before serving profiles. Add research target selection, research conversion, vehicle and slot purchases, and the price table. Support editing convertible RP and restrict hidden vehicle visibility to eligible entries. The client still displays zero purchase prices pending price table integration.
This commit is contained in:
1 parent
8b31277c58
commit
7a08fff85e
37 files changed
+1336
-75
No files matched your search
@@ -1,15 +1,20 @@
|
||||
/** Char action names mapped to their handlers (full list of names: research-data/char_actions_37.json). */
|
||||
import type { AccountStore } from '../../accounts/account-store.ts';
|
||||
import type { PlayerProfiles } from '../../profile/player-profiles.ts';
|
||||
import type { ResearchRules } from '../../research/research-rules.ts';
|
||||
import type { CharActionHandler } from '../char-action.ts';
|
||||
import { acceptEula } from './agreement-actions.ts';
|
||||
import { bulkTrainCrews, trainCrew } from './crew-actions.ts';
|
||||
import { entitlementsFull, initialMeta, legacyUserData } from './online-init-actions.ts';
|
||||
import { priceEx } from './price-actions.ts';
|
||||
import { buyAircraft, buySlot } from './purchase-actions.ts';
|
||||
import { convertExp, resetResearchable, setResearchable } from './research-actions.ts';
|
||||
import { setStartingInfo } from './starting-info-actions.ts';
|
||||
|
||||
export interface ActionDependencies {
|
||||
readonly profiles: PlayerProfiles;
|
||||
readonly accounts: AccountStore;
|
||||
readonly research: ResearchRules;
|
||||
}
|
||||
|
||||
export function actionTable(deps: ActionDependencies): ReadonlyMap<string, CharActionHandler> {
|
||||
@@ -21,5 +26,11 @@ export function actionTable(deps: ActionDependencies): ReadonlyMap<string, CharA
|
||||
['cln_set_starting_info', setStartingInfo(deps.profiles, deps.accounts)],
|
||||
['cln_bulk_train_aircraft', bulkTrainCrews(deps.profiles, deps.accounts)],
|
||||
['cln_train_aircraft', trainCrew(deps.profiles, deps.accounts)],
|
||||
['cln_set_researchable', setResearchable(deps.profiles, deps.accounts, deps.research)],
|
||||
['cln_reset_researchable', resetResearchable(deps.profiles, deps.accounts, deps.research)],
|
||||
['cln_convert_exp', convertExp(deps.profiles, deps.accounts, deps.research)],
|
||||
['cln_buy_aircraft', buyAircraft(deps.profiles, deps.accounts, deps.research)],
|
||||
['cln_buy_slot', buySlot(deps.profiles, deps.accounts, deps.research)],
|
||||
['cln_get_price_ex', priceEx(deps.research)],
|
||||
]);
|
||||
}
|
||||
Reference in new issue
Block a user