feat(hero&buff): 新增限时最大生命Buff与配套技能
新增7029生命爆发Buff和对应6517技能,实现限时提升最大生命功能: 1. Buff生效时按增量等量回血,到期自动钳回血量防止溢血 2. 血条显示逻辑适配动态最大生命值变化 3. 新增血量与最终最大生命同步方法统一处理边界情况
This commit is contained in:
@@ -119,8 +119,11 @@ export class HeroTopBarComp extends CCComp {
|
||||
/** 更新血量进度条 */
|
||||
public hpShow(): void {
|
||||
if (!this._model || !this.hpProgressBar) return;
|
||||
// 计时 hp_max buff 的增删不走 dirty_hp,显示前先做上限-血量同步(等量回血/到期钳回)
|
||||
this._model.syncHpWithFinalMax();
|
||||
const hp = this._model.hp;
|
||||
const hpMax = this._model.hp_max;
|
||||
// 分母用 getFinalHpMax:计时 hp_max buff 的上限加成需实时反映到血条
|
||||
const hpMax = this._model.getFinalHpMax();
|
||||
let targetProgress = hpMax > 0 ? hp / hpMax : 0;
|
||||
targetProgress = clamp(targetProgress, 0, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user