Route battle continues through sortie prep
This commit is contained in:
@@ -263,6 +263,11 @@ type CampaignTimelineChapter = {
|
|||||||
nextHints: string[];
|
nextHints: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type CampSceneData = {
|
||||||
|
openSortiePrep?: boolean;
|
||||||
|
skipIntroStory?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
const portraitByUnitId: Record<string, PortraitKey> = {
|
const portraitByUnitId: Record<string, PortraitKey> = {
|
||||||
'liu-bei': 'liuBei',
|
'liu-bei': 'liuBei',
|
||||||
'guan-yu': 'guanYu',
|
'guan-yu': 'guanYu',
|
||||||
@@ -10009,11 +10014,18 @@ export class CampScene extends Phaser.Scene {
|
|||||||
private sortieFocusedUnitId = 'liu-bei';
|
private sortieFocusedUnitId = 'liu-bei';
|
||||||
private sortieRosterScroll = 0;
|
private sortieRosterScroll = 0;
|
||||||
private terrainCountCache = new Map<BattleScenarioId, SortieTerrainCounts>();
|
private terrainCountCache = new Map<BattleScenarioId, SortieTerrainCounts>();
|
||||||
|
private openSortiePrepOnCreate = false;
|
||||||
|
private skipIntroStoryForSortie = false;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super('CampScene');
|
super('CampScene');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init(data?: CampSceneData) {
|
||||||
|
this.openSortiePrepOnCreate = Boolean(data?.openSortiePrep);
|
||||||
|
this.skipIntroStoryForSortie = Boolean(data?.skipIntroStory);
|
||||||
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
this.contentObjects = [];
|
this.contentObjects = [];
|
||||||
this.dialogueObjects = [];
|
this.dialogueObjects = [];
|
||||||
@@ -10054,6 +10066,9 @@ export class CampScene extends Phaser.Scene {
|
|||||||
|
|
||||||
this.renderStaticButtons();
|
this.renderStaticButtons();
|
||||||
this.render();
|
this.render();
|
||||||
|
if (this.openSortiePrepOnCreate) {
|
||||||
|
this.time.delayedCall(0, () => this.showSortiePrep());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ensureCampAssets(onReady: () => void) {
|
private ensureCampAssets(onReady: () => void) {
|
||||||
@@ -12322,6 +12337,15 @@ export class CampScene extends Phaser.Scene {
|
|||||||
markCampaignStep(flow.campaignStep);
|
markCampaignStep(flow.campaignStep);
|
||||||
const selectedSortieUnitIds = [...this.selectedSortieUnitIds];
|
const selectedSortieUnitIds = [...this.selectedSortieUnitIds];
|
||||||
const sortieFormationAssignments = { ...this.sortieFormationAssignments };
|
const sortieFormationAssignments = { ...this.sortieFormationAssignments };
|
||||||
|
if (this.skipIntroStoryForSortie) {
|
||||||
|
void startLazyScene(this, 'BattleScene', {
|
||||||
|
battleId: flow.nextBattleId,
|
||||||
|
selectedSortieUnitIds,
|
||||||
|
sortieFormationAssignments
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void startLazyScene(this, 'StoryScene', {
|
void startLazyScene(this, 'StoryScene', {
|
||||||
pages: flow.pages,
|
pages: flow.pages,
|
||||||
nextScene: 'BattleScene',
|
nextScene: 'BattleScene',
|
||||||
@@ -13613,6 +13637,8 @@ export class CampScene extends Phaser.Scene {
|
|||||||
campaignProgress: this.campaignTimelineProgress(),
|
campaignProgress: this.campaignTimelineProgress(),
|
||||||
campBattleId: this.currentCampBattleId(),
|
campBattleId: this.currentCampBattleId(),
|
||||||
campTitle: this.currentCampTitle(),
|
campTitle: this.currentCampTitle(),
|
||||||
|
openSortiePrepOnCreate: this.openSortiePrepOnCreate,
|
||||||
|
skipIntroStoryForSortie: this.skipIntroStoryForSortie,
|
||||||
availableDialogueIds: this.availableCampDialogues().map((dialogue) => dialogue.id),
|
availableDialogueIds: this.availableCampDialogues().map((dialogue) => dialogue.id),
|
||||||
completedAvailableDialogues: this.completedAvailableDialogues().map((dialogue) => dialogue.id),
|
completedAvailableDialogues: this.completedAvailableDialogues().map((dialogue) => dialogue.id),
|
||||||
availableVisitIds: this.availableCampVisits().map((visit) => visit.id),
|
availableVisitIds: this.availableCampVisits().map((visit) => visit.id),
|
||||||
|
|||||||
@@ -319,11 +319,15 @@ export class TitleScene extends Phaser.Scene {
|
|||||||
|
|
||||||
const battleId = battleIdForCampaignStep(campaign.step);
|
const battleId = battleIdForCampaignStep(campaign.step);
|
||||||
if (battleId) {
|
if (battleId) {
|
||||||
await this.navigateTo('BattleScene', {
|
if (campaign.step !== 'first-battle' && campaign.firstBattleReport?.outcome === 'victory') {
|
||||||
battleId,
|
await this.navigateTo('CampScene', {
|
||||||
selectedSortieUnitIds: campaign.selectedSortieUnitIds,
|
openSortiePrep: true,
|
||||||
sortieFormationAssignments: campaign.sortieFormationAssignments
|
skipIntroStory: true
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.navigateTo('BattleScene', { battleId });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user