refactor(技能/英雄): 重构移动结束检测和冰冻状态逻辑
- 移除移动结束类型中的距离结束检测,仅保留碰撞结束 - 删除 HeroViewComp 中未使用的 mp_add 和 playIntervalEffect 方法 - 简化 HeroAttrsComp 中冰冻状态判断逻辑,移除 in_frost 字段 - 在 HeroBuffSystem 中添加定时器自动减少冰冻剩余时间
This commit is contained in:
@@ -385,39 +385,6 @@ export class HeroViewComp extends CCComp {
|
||||
this.lastBarUpdateTime = Date.now() / 1000;
|
||||
}
|
||||
|
||||
mp_add(mp: number = 0) {
|
||||
// ✅ 仅显示提示,不调用 mp_show()
|
||||
this.hp_tip(TooltipTypes.addmp, mp.toFixed(0));
|
||||
this.lastBarUpdateTime = Date.now() / 1000;
|
||||
}
|
||||
|
||||
playIntervalEffect(attr: Attrs, value: number, s_uuid: number) {
|
||||
if (!this.node || !this.node.isValid) return;
|
||||
this.lastBarUpdateTime = Date.now() / 1000;
|
||||
if (attr === Attrs.hp) {
|
||||
if (value > 0) {
|
||||
this.heathed();
|
||||
this.hp_tip(TooltipTypes.health, value.toFixed(0), s_uuid);
|
||||
} else if (value < 0) {
|
||||
this.activateTopBar();
|
||||
this.playHpBarShake();
|
||||
this.in_atked("atked", this.model?.fac == FacSet.HERO ? 1 : -1);
|
||||
this.hp_tip(TooltipTypes.life, Math.abs(value).toFixed(0), s_uuid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (attr === Attrs.shield) {
|
||||
if (this.model && this.model.shield > 0) {
|
||||
this.show_shield(this.model.shield, this.model.shield_max);
|
||||
}
|
||||
this.hp_tip(TooltipTypes.health, Math.abs(value).toFixed(0), s_uuid);
|
||||
return;
|
||||
}
|
||||
if (attr === Attrs.IN_FROST && value > 0) {
|
||||
this.in_iced(0.3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
alive(){
|
||||
// 重置复活标记 - 必须最先重置,否则status_change会被拦截
|
||||
|
||||
Reference in New Issue
Block a user