style: 移除日志消息中的冗余"[HeroAttrs]"前缀
移除HeroAttrsComp中所有调试日志里重复的"[HeroAttrs]"前缀,使日志输出更简洁。这些前缀在日志标签参数中已提供,无需在消息内容中重复。
This commit is contained in:
@@ -101,7 +101,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
const uuid = args;
|
||||
const attrCard = AttrCards[uuid];
|
||||
if (attrCard) {
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 使用属性卡: ${attrCard.desc}`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` 使用属性卡: ${attrCard.desc}`);
|
||||
// 构造 BuffConf,默认使用 BType.VALUE,永久生效 (time: 0)
|
||||
const buffConf: BuffConf = {
|
||||
buff: attrCard.attr,
|
||||
@@ -123,7 +123,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
// 1. 尝试从 PotionCards 获取 (新版药水)
|
||||
const potion = PotionCards[itemId];
|
||||
if (potion) {
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 使用药水: ${potion.desc}`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` 使用药水: ${potion.desc}`);
|
||||
const buffConf: BuffConf = {
|
||||
buff: potion.attr,
|
||||
value: potion.value,
|
||||
@@ -144,7 +144,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
// 只有主角才响应升级事件
|
||||
if (!this.is_master) return;
|
||||
const newLv = args.lv;
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 英雄升级处理: Lv.${this.lv} -> Lv.${newLv}`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` 英雄升级处理: Lv.${this.lv} -> Lv.${newLv}`);
|
||||
if (newLv > this.lv) {
|
||||
this.lv = newLv;
|
||||
|
||||
@@ -256,7 +256,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.hp = Math.max(0, Math.min(this.hp, this.Attrs[Attrs.HP_MAX]));
|
||||
this.dirty_hp = true; // ✅ 仅标记需要更新
|
||||
smc.updateHeroInfo(this);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] HP变更: ${this.hero_name}, 变化=${addValue.toFixed(1)}, ${oldHp.toFixed(1)} -> ${this.hp.toFixed(1)}`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` HP变更: ${this.hero_name}, 变化=${addValue.toFixed(1)}, ${oldHp.toFixed(1)} -> ${this.hp.toFixed(1)}`);
|
||||
}
|
||||
add_mp(value:number,isValue:boolean){
|
||||
const oldMp = this.mp;
|
||||
@@ -274,7 +274,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.mp += addValue;
|
||||
this.mp = Math.max(0, Math.min(this.mp, this.Attrs[Attrs.MP_MAX]));
|
||||
this.dirty_mp = true; // ✅ 仅标记需要更新
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] MP变更: ${this.hero_name}, 变化=${addValue.toFixed(1)}, ${oldMp.toFixed(1)} -> ${this.mp.toFixed(1)}`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` MP变更: ${this.hero_name}, 变化=${addValue.toFixed(1)}, ${oldMp.toFixed(1)} -> ${this.mp.toFixed(1)}`);
|
||||
}
|
||||
add_shield(value:number,isValue:boolean){
|
||||
const oldShield = this.shield;
|
||||
@@ -284,7 +284,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
}
|
||||
this.shield += addValue;
|
||||
this.dirty_shield = true; // 标记护盾需要更新
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 护盾变更: ${this.hero_name}, 变化=${addValue.toFixed(1)}, ${oldShield.toFixed(1)} -> ${this.shield.toFixed(1)}`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` 护盾变更: ${this.hero_name}, 变化=${addValue.toFixed(1)}, ${oldShield.toFixed(1)} -> ${this.shield.toFixed(1)}`);
|
||||
}
|
||||
// ==================== BUFF 管理 ====================
|
||||
/**
|
||||
@@ -399,7 +399,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
const [val, count] = smc.global_attrs[attrIndex];
|
||||
const globalAdd = val * count;
|
||||
totalRatio += globalAdd;
|
||||
// mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 全局加成: ${this.hero_name} Attr=${attrIndex} Val=${val} Count=${count} Add=${globalAdd}%`);
|
||||
// mLogger.log(this.debugMode, 'HeroAttrs', ` 全局加成: ${this.hero_name} Attr=${attrIndex} Val=${val} Count=${count} Add=${globalAdd}%`);
|
||||
}
|
||||
|
||||
// 4. 根据属性类型计算最终值
|
||||
@@ -418,7 +418,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.clampSingleAttr(attrIndex);
|
||||
|
||||
if (oldVal !== this.Attrs[attrIndex]) {
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 属性重算: ${this.hero_name}, 属性ID=${attrIndex}, ${oldVal} -> ${this.Attrs[attrIndex]} (Base=${baseVal}, Add=${totalValue-baseVal}, Ratio=${totalRatio}%)`);
|
||||
mLogger.log(this.debugMode, 'HeroAttrs', ` 属性重算: ${this.hero_name}, 属性ID=${attrIndex}, ${oldVal} -> ${this.Attrs[attrIndex]} (Base=${baseVal}, Add=${totalValue-baseVal}, Ratio=${totalRatio}%)`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user