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

@@ -1,5 +1,5 @@
import Phaser from 'phaser';
import { effectTracks, musicTracks } from './game/audio/audioAssets';
import { ambienceTracks, effectTracks, musicTracks } from './game/audio/audioAssets';
import { soundDirector } from './game/audio/SoundDirector';
import { BootScene } from './game/scenes/BootScene';
import { startLazySceneFromGame } from './game/scenes/lazyScenes';
@@ -26,6 +26,7 @@ type DebugCampScene = Phaser.Scene & {
type HerosDebugApi = {
game: Phaser.Game;
activeScenes: () => string[];
audio: () => ReturnType<typeof soundDirector.getDebugState>;
battle: () => unknown;
camp: () => unknown;
goToBattle: (battleId?: string) => Promise<void>;
@@ -57,6 +58,7 @@ const config: Phaser.Types.Core.GameConfig = {
};
soundDirector.registerMusicTracks(musicTracks);
soundDirector.registerAmbienceTracks(ambienceTracks);
soundDirector.registerEffectTracks(effectTracks);
const game = new Phaser.Game(config);
@@ -76,6 +78,7 @@ function createDebugApi(game: Phaser.Game): HerosDebugApi {
return {
game,
activeScenes: () => game.scene.getScenes(true).map((activeScene) => activeScene.scene.key),
audio: () => soundDirector.getDebugState(),
battle: () => battleScene()?.getDebugState?.() ?? { active: false, reason: 'BattleScene is not active yet.' },
camp: () => campScene()?.getDebugState?.() ?? { active: false, reason: 'CampScene is not active yet.' },
goToBattle: (battleId) => startLazySceneFromGame(game, 'BattleScene', battleId ? { battleId } : undefined),