refactor: 重构buff系统,移除预定义buff列表
- 将SkillConfig.buffs字段改为直接存储BuffConf对象数组 - 移除预定义的BuffsList和相关导入引用 - 简化SCastSystem中buff应用逻辑,直接使用配置对象 - 移除CardComp中Buff/Debuff类型的图标获取逻辑 - 简化HeroAttrsComp调试日志,移除buff名称显示
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user