Route battle continues through sortie prep

This commit is contained in:
2026-07-03 22:23:59 +09:00
parent 17e1a14808
commit 487d70326a
2 changed files with 35 additions and 5 deletions

View File

@@ -263,6 +263,11 @@ type CampaignTimelineChapter = {
nextHints: string[];
};
type CampSceneData = {
openSortiePrep?: boolean;
skipIntroStory?: boolean;
};
const portraitByUnitId: Record<string, PortraitKey> = {
'liu-bei': 'liuBei',
'guan-yu': 'guanYu',
@@ -10009,11 +10014,18 @@ export class CampScene extends Phaser.Scene {
private sortieFocusedUnitId = 'liu-bei';
private sortieRosterScroll = 0;
private terrainCountCache = new Map<BattleScenarioId, SortieTerrainCounts>();
private openSortiePrepOnCreate = false;
private skipIntroStoryForSortie = false;
constructor() {
super('CampScene');
}
init(data?: CampSceneData) {
this.openSortiePrepOnCreate = Boolean(data?.openSortiePrep);
this.skipIntroStoryForSortie = Boolean(data?.skipIntroStory);
}
create() {
this.contentObjects = [];
this.dialogueObjects = [];
@@ -10054,6 +10066,9 @@ export class CampScene extends Phaser.Scene {
this.renderStaticButtons();
this.render();
if (this.openSortiePrepOnCreate) {
this.time.delayedCall(0, () => this.showSortiePrep());
}
}
private ensureCampAssets(onReady: () => void) {
@@ -12322,6 +12337,15 @@ export class CampScene extends Phaser.Scene {
markCampaignStep(flow.campaignStep);
const selectedSortieUnitIds = [...this.selectedSortieUnitIds];
const sortieFormationAssignments = { ...this.sortieFormationAssignments };
if (this.skipIntroStoryForSortie) {
void startLazyScene(this, 'BattleScene', {
battleId: flow.nextBattleId,
selectedSortieUnitIds,
sortieFormationAssignments
});
return;
}
void startLazyScene(this, 'StoryScene', {
pages: flow.pages,
nextScene: 'BattleScene',
@@ -13613,6 +13637,8 @@ export class CampScene extends Phaser.Scene {
campaignProgress: this.campaignTimelineProgress(),
campBattleId: this.currentCampBattleId(),
campTitle: this.currentCampTitle(),
openSortiePrepOnCreate: this.openSortiePrepOnCreate,
skipIntroStoryForSortie: this.skipIntroStoryForSortie,
availableDialogueIds: this.availableCampDialogues().map((dialogue) => dialogue.id),
completedAvailableDialogues: this.completedAvailableDialogues().map((dialogue) => dialogue.id),
availableVisitIds: this.availableCampVisits().map((visit) => visit.id),