feat: enrich campaign reward and roster visuals

This commit is contained in:
2026-07-19 12:16:30 +09:00
parent 7c6a8174d1
commit f83296db7b
11 changed files with 1164 additions and 205 deletions

View File

@@ -9,7 +9,11 @@ import {
type BattleUiIconKey
} from '../data/battleUiIcons';
import { portraitAssetEntriesForKey, portraitKeyForSpeaker, type PortraitAssetEntry } from '../data/portraitAssets';
import { storyBackgroundAssets, storyBackgroundKeyForPage } from '../data/storyAssets';
import {
storyBackgroundAssets,
storyBackgroundKeyForPage,
storyBackgroundKeysForPages
} from '../data/storyAssets';
import {
ensureUnitAnimations,
loadUnitBaseSheets,
@@ -130,6 +134,7 @@ const firstBattleWarmupUnitTextureKeys = [
export class StoryScene extends Phaser.Scene {
private pageIndex = 0;
private pages: StoryPage[] = prologuePages;
private selectedStoryBackgroundKeys = storyBackgroundKeysForPages(prologuePages);
private nextScene = 'BattleScene';
private nextSceneData?: Record<string, unknown>;
private transitioning = false;
@@ -159,6 +164,7 @@ export class StoryScene extends Phaser.Scene {
init(data?: StorySceneData) {
this.pages = data?.pages?.length ? data.pages : prologuePages;
this.selectedStoryBackgroundKeys = storyBackgroundKeysForPages(this.pages);
this.nextScene = data?.nextScene ?? 'BattleScene';
this.nextSceneData = data?.nextSceneData;
this.pageIndex = 0;
@@ -745,7 +751,10 @@ export class StoryScene extends Phaser.Scene {
}
private pageBackgroundAssetKey(page: StoryPage) {
const key = storyBackgroundKeyForPage(page.background, page.id);
const pageIndex = this.pages.indexOf(page);
const key = pageIndex >= 0
? this.selectedStoryBackgroundKeys[pageIndex]
: storyBackgroundKeyForPage(page.background, page.id);
return storyBackgroundAssets[key] ? key : page.background;
}