refactor: 优化主界面布局与通知系统

重构App.vue,首页独立无侧边栏,其他页面采用统一侧边栏布局。新增右下角固定通知区,集成返回顶部、队列通知、外交通知和敌方警报。移除新手引导组件,替换为弱引导提示系统。支持星球重命名弹窗。优化NPC成长与行为定时器逻辑,提升性能和可维护性。删除issue模板及相关文档描述。
This commit is contained in:
谦君
2025-12-19 12:01:45 +08:00
parent a689ce21b7
commit 752cade67c
61 changed files with 5774 additions and 2817 deletions

View File

@@ -317,6 +317,23 @@ export const processNPCAttackArrival = async (
createdAt: Date.now()
}
}
// NPC攻击玩家后降低好感度
if (!npc.relations) {
npc.relations = {}
}
if (!npc.relations[defender.id]) {
npc.relations[defender.id] = diplomaticLogic.initializeDiplomaticRelation(npc.id, defender.id)
}
// 根据战斗结果降低好感度
// NPC获胜降低更多好感度失败降低较少
const reputationChange = battleResult.winner === 'attacker' ? -15 : -10
const relation = npc.relations[defender.id]
if (relation) {
diplomaticLogic.updateReputation(relation, reputationChange, 'attack', `NPC ${npc.name} attacked player ${defender.name}`)
}
return { battleResult, moon, debrisField }
}