feat: add era-based camp soundscapes

This commit is contained in:
2026-07-13 05:18:32 +09:00
parent 1eedd63163
commit b88a2d6ec2
21 changed files with 1347 additions and 14 deletions

View File

@@ -16,6 +16,7 @@ import { compareUnitStrategyCoverage, getUnitStrategyCoverage, getUnitStrategyNa
import { getUnitClass, terrainRules, type TerrainType, type UnitClassKey } from '../data/battleRules';
import { defaultBattleScenario, getBattleScenario, type BattleScenarioDefinition, type BattleScenarioId } from '../data/battles';
import { getSortieFlow } from '../data/campaignFlow';
import { getCampSoundscape, type CampSoundscape } from '../data/campSoundscapes';
import {
campaignPortraitKeysByUnitId,
portraitAssetEntriesForKey,
@@ -11070,6 +11071,7 @@ export class CampScene extends Phaser.Scene {
private campSkinSeal?: Phaser.GameObjects.Arc;
private campSkinBadge?: Phaser.GameObjects.Rectangle;
private campSkinSummary?: Phaser.GameObjects.Text;
private campSoundscape?: CampSoundscape;
private campSkinRenderedTextureKey?: string;
private campSkinUsedFallback = false;
private campSkinTransitionRevision = 0;
@@ -11206,6 +11208,7 @@ export class CampScene extends Phaser.Scene {
nextBattleId: sortieFlow.nextBattleId,
currentBattleId: this.currentCampBattleId()
});
this.campSoundscape = getCampSoundscape(this.campSkinSelection.skin.id);
this.campSkinBackdrop = undefined;
this.campSkinWash = undefined;
this.campSkinVignette = undefined;
@@ -11223,7 +11226,12 @@ export class CampScene extends Phaser.Scene {
this.sortieItemAssignments = this.normalizedSortieItemAssignments(this.campaign.sortieItemAssignments);
this.selectedDialogueId = this.availableCampDialogues()[0]?.id ?? campDialogues[0].id;
this.selectedVisitId = this.availableCampVisits()[0]?.id ?? campVisits[0].id;
soundDirector.playMusic('militia-theme');
soundDirector.playSoundscape({
musicKey: this.campSoundscape.music.trackKey,
ambienceKey: this.campSoundscape.ambience.trackKey,
musicVolume: this.campSoundscape.music.volume,
ambienceVolume: this.campSoundscape.ambience.volume
});
this.input.keyboard?.on('keydown-ESC', () => this.handleEscapeKey());
this.input.keyboard?.on('keydown-ENTER', (event: KeyboardEvent) => this.handleSortieEnterKey(event));
this.input.keyboard?.on('keydown', (event: KeyboardEvent) => this.handleSaveSlotKey(event));
@@ -21673,6 +21681,20 @@ export class CampScene extends Phaser.Scene {
campaignProgress: this.campaignTimelineProgress(),
campBattleId: this.currentCampBattleId(),
campTitle: this.currentCampTitle(),
campSoundscape: this.campSoundscape
? {
skinId: this.campSoundscape.skinId,
musicGroupId: this.campSoundscape.music.id,
musicKey: this.campSoundscape.music.trackKey,
musicLabel: this.campSoundscape.music.label,
musicVolume: this.campSoundscape.music.volume,
ambienceId: this.campSoundscape.ambience.id,
ambienceKey: this.campSoundscape.ambience.trackKey,
ambienceLabel: this.campSoundscape.ambience.label,
ambienceVolume: this.campSoundscape.ambience.volume
}
: null,
audio: soundDirector.getDebugState(),
campSkin: this.campSkinSelection
? {
id: this.campSkinSelection.skin.id,