// WhiteLayerScene.ts: 白色层 (E3 ward). Chart reveal + ending E3.
import Phaser from 'phaser';
import { MapScene } from '../MapScene';
import { director } from '../../systems/CorruptionDirector';
import { audio } from '../../systems/AudioEngine';

export class WhiteLayerScene extends MapScene {
  constructor() { super('WhiteLayerScene', 'map:white_layer', 'white_layer'); }

  onBuild(map: Phaser.Tilemaps.Tilemap, ts: Phaser.Tilemaps.Tileset) {
    // desaturated: camera grayscale-ish via low saturation
    this.cameras.main.setBackgroundColor('#e8e8e8');
    // chart
    this.addInteract(9, 10, () => {
      this.say([{ speaker:'', text:'桌上的病历……' },
        { speaker:'', text:`蜜糖谷情绪疗养中心` },
        { speaker:'', text:`姓名：${director.playerName}` },
        { speaker:'', text:`编号：PT-07` },
        { speaker:'', text:`疗程时长：${director.formatPlayTime()}` },
      ], () => {
        // go to E3 ending
        this.scene.stop('DebugScene');
        this.scene.start('EndingScene', { ending: 'E3' });
      });
    }, { promptText: '按 E 看病历' });
  }
}
