refactor(debug-log): 优化全模块调试日志格式与默认开关
1. 将BuffManager的静态DEBUG开关改为运行时可配置的debug属性,默认开启 2. 统一所有模块的调试日志输出格式,增加技能/ buff名称、UUID、目标信息和判定详情 3. 为HeroAtkSystem的概率判定添加统一日志,修复击退判定逻辑并补充日志 4. 开启SkillView和HeroAtkSystem的默认调试模式
This commit is contained in:
@@ -58,7 +58,7 @@ export class SkillView extends CCComp {
|
||||
@property({ type: CCFloat, slide: true, range: [0, 500, 5], tooltip: "抛射物高度增量(叠加到贝塞尔弹道中点高度)" })
|
||||
height_offset: number = 0;
|
||||
|
||||
private debugMode: boolean = false;
|
||||
private debugMode: boolean = true;
|
||||
|
||||
anim: Animation = null;
|
||||
group: number = 0;
|
||||
@@ -135,10 +135,9 @@ export class SkillView extends CCComp {
|
||||
this.sData.max_hit_count++;
|
||||
// 概率衰减(减去固定的 PUNCTURE_DOWN 值,比如 50)
|
||||
this.sData.Attrs[Attrs.puncture_chance] = Math.max(0, punctureChance - FightSet.PUNCTURE_DOWN);
|
||||
if (this.debugMode) {
|
||||
mLogger.log(this.debugMode, 'SkillView', `[SkillView] 触发穿透!剩余概率: ${this.sData.Attrs[Attrs.puncture_chance]}%`);
|
||||
}
|
||||
mLogger.log(this.debugMode, 'SkillView', `[概率判定] 穿透 概率:${punctureChance.toFixed(1)}% 随机:${rand.toFixed(1)} -> ✔成功(衰减后剩余:${this.sData.Attrs[Attrs.puncture_chance]}%)`);
|
||||
} else {
|
||||
mLogger.log(this.debugMode, 'SkillView', `[概率判定] 穿透 概率:${punctureChance.toFixed(1)}% 随机:${rand.toFixed(1)} -> ✘失败,投射物销毁`);
|
||||
// 未触发穿透,正常销毁
|
||||
this.handle_collision_limit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user