refactor: 重构buff系统,移除预定义buff列表

- 将SkillConfig.buffs字段改为直接存储BuffConf对象数组
- 移除预定义的BuffsList和相关导入引用
- 简化SCastSystem中buff应用逻辑,直接使用配置对象
- 移除CardComp中Buff/Debuff类型的图标获取逻辑
- 简化HeroAttrsComp调试日志,移除buff名称显示
This commit is contained in:
walkpan
2026-03-22 19:09:02 +08:00
parent a685d94818
commit 354f242930
5 changed files with 9 additions and 40 deletions

View File

@@ -125,7 +125,7 @@ export class HeroAttrsComp extends ecs.Comp {
addBuff(buffConf: BuffConf) {
this.applyAttrChange(buffConf.buff, buffConf.value);
if (this.debugMode) {
mLogger.log(this.debugMode, 'HeroAttrs', `添加属性: ${buffConf.name}, 属性:${buffConf.buff}, 值:${buffConf.value}`);
mLogger.log(this.debugMode, 'HeroAttrs', `属性:${buffConf.buff}, 值:${buffConf.value}`);
}
}

View File

@@ -2,7 +2,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
import { Vec3 } from "cc";
import { HeroAttrsComp } from "./HeroAttrsComp";
import { HeroViewComp } from "./HeroViewComp";
import { BuffsList, DTType, SkillConfig, SkillKind, SkillSet, TGroup } from "../common/config/SkillSet";
import { DTType, SkillConfig, SkillKind, SkillSet, TGroup } from "../common/config/SkillSet";
import { Skill } from "../skill/Skill";
import { smc } from "../common/SingletonModuleComp";
import { GameConst } from "../common/config/GameConst";
@@ -150,13 +150,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
if (!target.ent) continue;
const model = target.ent.get(HeroAttrsComp);
if (!model || model.is_dead) continue;
if (config.buffs) {
for (const buffId of config.buffs) {
const buffConf = BuffsList[buffId];
if (buffConf) {
model.addBuff(buffConf);
}
}
if (!config.buffs || config.buffs.length === 0) continue;
for (const buffConf of config.buffs) {
if (!buffConf) continue;
model.addBuff(buffConf);
}
}
}