refactor(hero): 移除多余的日志输出并简化代码逻辑
本次提交清理了多个英雄相关组件中的调试日志,同时简化了条件判断写法: 1. 将多行if判断简化为单行return形式 2. 删除HeroViewComp中护盾特效相关的冗余日志和节点查找逻辑 3. 优化absorbShield和add_shield等方法的代码可读性
This commit is contained in:
@@ -539,9 +539,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
} else if (kind === SkillKind.Shield && sAp !== 0) {
|
||||
// 护盾值 = ap% × 施法者最终最大生命(getFinalHpMax 含驻场光环与计时 buff 加成)
|
||||
const addShield = Math.max(0, Math.floor(_cAttrsComp.getFinalHpMax() * sAp / 100));
|
||||
mLogger.log(this.debugMode, 'SCastSystem', `applyActualFriendlyEffect Shield: caster=${_cAttrsComp.hero_name}, target=${model.hero_name}, casterHpMax=${_cAttrsComp.getFinalHpMax()}, sAp=${sAp}, addShield=${addShield}, targetOldShield=${model.shield}`);
|
||||
model.add_shield(addShield);
|
||||
mLogger.log(this.debugMode, 'SCastSystem', `applyActualFriendlyEffect Shield: after add_shield, targetNewShield=${model.shield}, dirty_shield=${model.dirty_shield}`);
|
||||
}
|
||||
|
||||
if (config.buff_type !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user