Add modification, ammunition, and spare vehicle actions
Include modification, weapon, and spare vehicle prices, omitting zero prices. Recalculate modification research and ranks and handle research target selection, purchases, bulk purchases, and equipment toggles.
This commit is contained in:
1 parent
56731efa76
commit
8692a13577
18 files changed
+742
-23
No files matched your search
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Assemble the players' profiles with the rules they depend on, the same way for the local
|
||||
* service and for the save editor (save-cli.ts): static data from the dataset cache, the
|
||||
* save store with its format upgrades, and the research state kept up to date.
|
||||
* save store with its format upgrades, and the research and modification state kept up to date.
|
||||
*/
|
||||
import type { DatasetCache } from './game-data/datasets/dataset-cache.ts';
|
||||
import { reserveVehicles } from './game-data/datasets/reserve-vehicles.ts';
|
||||
@@ -10,6 +10,7 @@ import type { GameFiles } from './game-data/game-files.ts';
|
||||
import { PlayerProfiles } from './profile/player-profiles.ts';
|
||||
import { profileUpgrades } from './profile/profile-upgrades.ts';
|
||||
import type { StartingContent } from './profile/starting-content.ts';
|
||||
import { refreshModuleState } from './modifications/module-state.ts';
|
||||
import { refreshResearchState } from './research/research-state.ts';
|
||||
import { loadResearchRules, type ResearchRules } from './research/research-rules.ts';
|
||||
import { SaveStore } from './saves/save-store.ts';
|
||||
@@ -23,6 +24,9 @@ export function setUpProfiles(dataFolder: string, gameFiles: GameFiles, datasets
|
||||
const startingContent: StartingContent = { reserveVehicles: datasets.load(reserveVehicles), branches: datasets.load(shopBranches) };
|
||||
const research = loadResearchRules(datasets);
|
||||
const saves = new SaveStore(dataFolder, profileUpgrades(startingContent));
|
||||
const profiles = new PlayerProfiles(saves, gameFiles, startingContent, (profile) => refreshResearchState(profile, research));
|
||||
const profiles = new PlayerProfiles(saves, gameFiles, startingContent, (profile) => {
|
||||
refreshResearchState(profile, research);
|
||||
refreshModuleState(profile, research.equipment);
|
||||
});
|
||||
return { profiles, research };
|
||||
}
|
||||
Reference in new issue
Block a user