feat(hero): 初始化角色和怪物技能数据,修改技能数据引用

- 在Hero实体中初始化技能数组,添加技能UUID和冷却时间信息
- 在Monster实体中遍历怪物技能,准备技能相关数据
- 在HeroViewComp中新增skills属性以存储技能信息
- 在SkillEnt中修正技能属性赋值,使用深拷贝避免引用问题
- 删除SkillConComp中无用的空行,优化update方法代码格式
This commit is contained in:
2025-10-17 22:29:10 +08:00
parent 2cdb25ac58
commit a3e4e70d9d
5 changed files with 14 additions and 7 deletions

View File

@@ -94,7 +94,10 @@ export class Monster extends ecs.Entity {
finalAp = Math.floor(baseAp * stageMultipliers.attack);
// console.log(`[Monster]: 怪物${hero.name} 关卡倍数 - HP: ${baseHp} x ${stageMultipliers.hp.toFixed(2)} = ${finalHp}, AP: ${baseAp} x ${stageMultipliers.attack.toFixed(2)} = ${finalAp}`);
}
for(let i=0;i<hero.skills.length;i++){
let skill={ uuid:SkillSet[hero.skills[i]].uuid, cd_max:SkillSet[hero.skills[i]].cd,cd:0 }
hv.skills.push(skill)
}
hv.base_ap=finalAp
hv.base_map=hero.mp
hv.base_def=hero.def