fix(battle): preserve the Bullet Hell AI loadout flow
Use the game mode declaration to omit offline combat-preset selection in the cannon-only mode.
This commit is contained in:
1 parent
b4af034756
commit
01f7b5769b
4 files changed
+7
-3
No files matched your search
@@ -151,7 +151,7 @@ export class BattleMatchmaker {
|
||||
minMrank,
|
||||
maxMrank,
|
||||
limitPerType: this.#tuning.botPoolLimitPerType,
|
||||
}, this.#aircraftLoadouts);
|
||||
}, declaration.allowBotAircraftLoadouts === false ? undefined : this.#aircraftLoadouts);
|
||||
return {
|
||||
ok: true,
|
||||
launch: this.#buildLaunchPlan(input, chosenMode, mission, coalitions, playerMrank, minMrank, maxMrank, customBots),
|
||||
|
||||
@@ -108,14 +108,14 @@ export function lineupMrank(
|
||||
}
|
||||
|
||||
export function selectCustomBots(
|
||||
vehicles: readonly CatalogueVehicle[], query: BotPoolQuery, aircraftLoadouts: ReadonlyMap<string, BotAircraftLoadout>,
|
||||
vehicles: readonly CatalogueVehicle[], query: BotPoolQuery, aircraftLoadouts?: ReadonlyMap<string, BotAircraftLoadout>,
|
||||
): CustomBotsPool {
|
||||
const allowed = new Set(query.allowedClasses);
|
||||
const orderedCountries = [...new Set(query.countries.map((c) => (c.startsWith(COUNTRY_PREFIX) ? c : `${COUNTRY_PREFIX}${c}`)))];
|
||||
const aircrafts = allowed.has('aircraft') ? pickCategoryPool(vehicles, orderedCountries, 'aircraft', query) : [];
|
||||
return {
|
||||
tanks: allowed.has('tank') ? pickCategoryPool(vehicles, orderedCountries, 'tank', query) : [],
|
||||
aircrafts: query.requiredClass === 'aircraft' ? aircrafts.map((entry) => {
|
||||
aircrafts: query.requiredClass === 'aircraft' && aircraftLoadouts ? aircrafts.map((entry) => {
|
||||
const aircraftLoadout = aircraftLoadouts.get(entry.name);
|
||||
return aircraftLoadout === undefined ? entry : { ...entry, aircraftLoadout };
|
||||
}) : aircrafts,
|
||||
|
||||
@@ -50,6 +50,8 @@ export interface GameModeDeclaration {
|
||||
* `true`; `false` for single-slot modes (`air_realistic` and its `small_teams_` sub-mode).
|
||||
*/
|
||||
readonly multiSlot?: boolean;
|
||||
/** False for modes whose native weapon rules replace combat presets. Defaults to true. */
|
||||
readonly allowBotAircraftLoadouts?: boolean;
|
||||
/** Minimum `mrank` exposed on the parent mode for Night Battles (`scripts/events/eventinfo.nut:134-136`). */
|
||||
readonly minMRankForNightBattles?: number;
|
||||
/** Minimum `mrank` exposed on the parent mode for Tactical Skies (`scripts/events/eventinfo.nut:137`). */
|
||||
|
||||
@@ -82,6 +82,8 @@ export const SUB_GAME_MODES: readonly GameModeDeclaration[] = [
|
||||
difficulty: 'realistic',
|
||||
displayType: 'random_battle',
|
||||
minCraftsToPlay: MIN_CRAFTS_BULLET_HELL,
|
||||
// Bullet Hell uses cannons and permits only compatible secondary equipment.
|
||||
allowBotAircraftLoadouts: false,
|
||||
allowedCraftMinMrank: { aircraft: MIN_MRANK_BULLET_HELL },
|
||||
minQueueMrank: MIN_MRANK_BULLET_HELL,
|
||||
requiredClass: 'aircraft',
|
||||
|
||||
Reference in new issue
Block a user