feat: 实装AI改写结局功能 - 接入DeepSeek API - AI动态生成新结局名称 - 新增rewrite类型结局样式 - 修复请求超时问题

This commit is contained in:
2026-03-05 15:57:51 +08:00
parent 89b5a3b658
commit d47ccd7039
11 changed files with 513 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ export default class EndingScene extends BaseScene {
super(main, params);
this.storyId = params.storyId;
this.ending = params.ending;
console.log('EndingScene 接收到的结局:', JSON.stringify(this.ending));
this.showButtons = false;
this.fadeIn = 0;
this.particles = [];
@@ -103,6 +104,11 @@ export default class EndingScene extends BaseScene {
gradient.addColorStop(0.5, '#3a3515');
gradient.addColorStop(1, '#2d2d1f');
break;
case 'rewrite':
gradient.addColorStop(0, '#1a0a2e');
gradient.addColorStop(0.5, '#2d1b4e');
gradient.addColorStop(1, '#4a1942');
break;
default:
gradient.addColorStop(0, '#0f0c29');
gradient.addColorStop(0.5, '#302b63');
@@ -195,6 +201,7 @@ export default class EndingScene extends BaseScene {
case 'good': return '✨ 完美结局';
case 'bad': return '💔 悲伤结局';
case 'hidden': return '🔮 隐藏结局';
case 'rewrite': return '🤖 AI改写结局';
default: return '📖 普通结局';
}
}
@@ -239,6 +246,7 @@ export default class EndingScene extends BaseScene {
case 'good': return `rgba(100, 255, 150, ${alpha})`;
case 'bad': return `rgba(255, 100, 100, ${alpha})`;
case 'hidden': return `rgba(255, 215, 0, ${alpha})`;
case 'rewrite': return `rgba(168, 85, 247, ${alpha})`;
default: return `rgba(150, 150, 255, ${alpha})`;
}
}