fix(battle): assign combat presets to AI aircraft

Read stock weapon triggers and prerequisite modifications. Supply a suitable native preset for aircraft whose default lacks the relevant armament and preserve repeated modification names in the launch block.
This commit is contained in:
N0VAN0M4LY committed 2026-12-01 13:50:04 +08:00
1 parent 44e64fa414
commit 70c4ee4880
8 files changed
+190 -9

No files matched your search

+4 -1
View File
@@ -8,6 +8,7 @@ import { RegistrationService } from './accounts/registration-service.ts';
import { BattleEconomy } from './battle/battle-economy.ts';
import { BattleMatchmaker } from './battle/battle-matchmaker.ts';
import { BattleSessionStore } from './battle/battle-session-store.ts';
import { selectBotAircraftLoadouts } from './battle/bot-aircraft-loadouts.ts';
import { actionTable } from './char/actions/action-table.ts';
import { CharService } from './char/char-service.ts';
import { ClanStore } from './clans/clan-store.ts';
@@ -28,6 +29,7 @@ import { crewSkillData } from './game-data/datasets/crew-skills.ts';
import { DatasetCache } from './game-data/datasets/dataset-cache.ts';
import { decorCatalogue } from './game-data/datasets/decor-catalogue.ts';
import { externalItemSources } from './game-data/datasets/external-item-sources.ts';
import { flightModelPresets } from './game-data/datasets/flight-model-presets.ts';
import { itemCatalogue } from './game-data/datasets/item-catalogue.ts';
import { multiplayerMissions } from './game-data/datasets/multiplayer-missions.ts';
import { shopCountries } from './game-data/datasets/shop-countries.ts';
@@ -103,12 +105,13 @@ export async function startServer(options: ServerOptions): Promise<RunningServer
listings: catalogues.inventory.marketplaceListings(),
}, report);
const webUi = new WebUiService(datasets.load(webIcons), labels, options.dataFolder, artwork);
const botAircraftLoadouts = selectBotAircraftLoadouts(vehicles, datasets.load(flightModelPresets), equipment);
gameFiles.releasePacks();
let matching: MatchingService | undefined;
const notifyInventoryChanged = () => matching?.broadcastNotify('mrpc.generic_notify', { from: 'inventory', func: 'changed' });
const battleSessions = new BattleSessionStore(tuning.limits.battleSessionsKept);
const battleMatchmaker = new BattleMatchmaker(gameModes, vehicles, battleSessions, tuning.battle, spawnRules);
const battleMatchmaker = new BattleMatchmaker(gameModes, vehicles, battleSessions, tuning.battle, spawnRules, botAircraftLoadouts);
const economy = new BattleEconomy(
economyData,
tuning.battleEconomy,