export type Stage = 'S0' | 'S1' | 'S2' | 'S3' | 'S4';
export type EndingId = 'E1' | 'E2' | 'E3' | 'E4';

export interface TaskDefinition {
  id: string;
  day: number;
  title: string;
  reward: number;
  optional?: boolean;
}

export const ANNOUNCEMENTS: Record<number, string> = {
  1: '早上好呀！今天的幸福任务贴在板上啦。祝你开心！',
  2: '早上好呀！新的一天，新的幸福。祝你开心！',
  3: '早上好！今天要把幸福装得满满的哦。要开心！',
  4: '早上好呀！今天的幸福任务贴在板上啦。祝你开心！',
  5: '早上好。今天是自由日，你可以自由地选择幸福。要开心哦。',
  6: '明天就是庆典了。大家都会到场，大家都会微笑。你必须开心。',
  7: '庆典开始了。来吧。',
};

export const TASKS: TaskDefinition[] = [
  { id: 'T1', day: 1, title: '从圆圆处取蜂蜜面包送给大宝、咪咪、龟爷爷', reward: 15 },
  { id: 'T2', day: 1, title: '给广场花坛浇水 ×3', reward: 10 },
  { id: 'T3', day: 1, title: '与任意三位村民问好', reward: 10 },
  { id: 'T4', day: 2, title: '替大宝送信 ×3（收件人：圆圆、咪咪、芙医生）', reward: 15 },
  { id: 'T5', day: 2, title: '帮咪咪清点货架', reward: 10 },
  { id: 'T6', day: 3, title: '去花田采莓果 ×5', reward: 10 },
  { id: 'T7', day: 3, title: '湖畔野餐（走到野餐布触发过场）', reward: 15 },
  { id: 'T8', day: 4, title: '从圆圆处取蜂蜜面包送给大宝、咪咪、龟爷爷', reward: 15 },
  { id: 'T9', day: 4, title: '给广场花坛浇水 ×3', reward: 10 },
  { id: 'T10', day: 4, title: '与任意三位村民问好', reward: 10 },
  { id: 'T11', day: 5, title: '帮圆圆揉面', reward: 10, optional: true },
  { id: 'T12', day: 5, title: '擦拭公告板', reward: 10, optional: true },
  { id: 'T13', day: 6, title: '在广场挂彩带 ×4', reward: 10 },
  { id: 'T14', day: 6, title: '保持微笑 60 秒', reward: 15 },
  { id: 'T15', day: 7, title: '参加第 413 届丰收庆典', reward: 0 },
];

export const CLUES: Record<string, string> = {
  C1: '每一页都是同一个日期',
  C2: '手写小字：「按疗程配比。甜度：最大。」',
  C3: '所有邮戳是同一天',
  C4: '署名闪过乱码「PT-0▓」',
  C5: '同一商品重复排列，标签全部空白',
  C6: '「第 412 届丰收庆典」上覆盖着更早的「第 411 届」「第 410 届」',
  C7: '井底回声：极轻的监护仪滴声（靠近并交互 5 秒）',
  C8: '芙医生桌上的表格抬头被手肘挡住，只露出「…谷情绪疗…」',
  C9: '三段递进：「湖水一直很平静」→「面包一直是那个味道」→「孩子，今天是第几个今天？」',
};

export const C9_LINES: Record<number, string> = {
  2: '湖水一直很平静',
  4: '面包一直是那个味道',
  6: '孩子，今天是第几个今天？',
};

export const CORRUPTIONS: Array<[string, string]> = [
  ['幸福', '辛福'], ['开心', '开欣'], ['美好', '美妤'], ['大家', '大伽'], ['微笑', '微效'],
  ['明天', '名天'], ['甜', '恬'], ['阳光', '央光'], ['朋友', '棚友'], ['永远', '泳远'],
];

export const NPCS = {
  afu: { name: '阿福', portrait: 2, frame: 16, offset: 0 },
  yuanyuan: { name: '圆圆', portrait: 3, frame: 19, offset: 15 },
  dabao: { name: '大宝', portrait: 4, frame: 22, offset: 0 },
  mimi: { name: '咪咪', portrait: 5, frame: 25, offset: -10 },
  doctor: { name: '芙医生', portrait: 6, frame: 28, offset: 999 },
  birds: { name: '双子鸟', portrait: 7, frame: 31, offset: 0 },
  turtle: { name: '龟爷爷', portrait: 8, frame: 34, offset: 999 },
} as const;

export type NpcId = keyof typeof NPCS;

export const MAP_KEYS = [
  'HouseScene', 'PlazaScene', 'BakeryScene', 'ShopScene', 'ClinicScene',
  'LakeScene', 'FieldScene', 'WellScene', 'MistScene', 'WhiteScene',
] as const;

export const MAP_LABELS: Record<(typeof MAP_KEYS)[number], string> = {
  HouseScene: '小满小屋', PlazaScene: '村广场', BakeryScene: '面包房', ShopScene: '杂货店',
  ClinicScene: '诊所', LakeScene: '湖畔', FieldScene: '花田', WellScene: '古井空地',
  MistScene: '雾墙边界', WhiteScene: '白色层',
};

export const NPC_CHAT: Record<NpcId, string[]> = {
  afu: ['今天也要把幸福装满哦。', '微笑会让大家都安心。'],
  yuanyuan: ['刚出炉的蜂蜜面包最甜啦。', '只要按配方做，每次都会一样美好。'],
  dabao: ['每一封信都会准时送到。', '名册上写着的住户，一个也不会少。'],
  mimi: ['货架永远整整齐齐，真让人开心。', '朋友需要什么，我这里都有哦。'],
  doctor: ['村里有诊所，但你不需要去那里哦。'],
  birds: ['啾、啾。旋律每天都一样好听。'],
  turtle: ['湖水一直很平静。'],
};
