fix: 修复技能冷却时间初始化和治疗特效调用错误

- 将技能初始化时的冷却时间设为0,避免首次使用时需要等待完整冷却
- 修正HeroViewComp中health方法错误调用heathed属性而非方法的问题
This commit is contained in:
panw
2026-03-24 14:29:54 +08:00
parent b62e6649cb
commit 33e549d22c
3 changed files with 3 additions and 3 deletions

View File

@@ -84,7 +84,7 @@ export class Hero extends ecs.Entity {
const skill = hero.skills[key]; const skill = hero.skills[key];
if (!skill) continue; if (!skill) continue;
//用于增量 计算最终技能等级英雄等级与技能初始等级均从1开始需各减1抵消故-2最低等级时0 //用于增量 计算最终技能等级英雄等级与技能初始等级均从1开始需各减1抵消故-2最低等级时0
model.skills[skill.uuid] = { ...skill, lv: Math.max(0,skill.lv + hero_lv - 2), ccd: skill.cd }; model.skills[skill.uuid] = { ...skill, lv: Math.max(0,skill.lv + hero_lv - 2), ccd: 0 };
} }
model.updateSkillDistanceCache(); model.updateSkillDistanceCache();

View File

@@ -368,7 +368,7 @@ export class HeroViewComp extends CCComp {
health(hp: number = 0) { health(hp: number = 0) {
// ✅ 仅显示特效和提示,不调用 hp_show() // ✅ 仅显示特效和提示,不调用 hp_show()
if(hp<=20) return; if(hp<=20) return;
this.heathed(); this.heathed
this.hp_tip(TooltipTypes.health, hp.toFixed(0)); this.hp_tip(TooltipTypes.health, hp.toFixed(0));
this.lastBarUpdateTime = Date.now() / 1000; this.lastBarUpdateTime = Date.now() / 1000;
} }

View File

@@ -145,7 +145,7 @@ export class Monster extends ecs.Entity {
for (const key in hero.skills) { for (const key in hero.skills) {
const skill = hero.skills[key]; const skill = hero.skills[key];
if (!skill) continue; if (!skill) continue;
model.skills[skill.uuid] = { ...skill, ccd: skill.cd }; model.skills[skill.uuid] = { ...skill, ccd: 0 };
} }
model.updateSkillDistanceCache(); model.updateSkillDistanceCache();
//根据刷怪控制脚本对ap和hp进行加强 //根据刷怪控制脚本对ap和hp进行加强