refactor: 重构buff系统,移除预定义buff列表
- 将SkillConfig.buffs字段改为直接存储BuffConf对象数组 - 移除预定义的BuffsList和相关导入引用 - 简化SCastSystem中buff应用逻辑,直接使用配置对象 - 移除CardComp中Buff/Debuff类型的图标获取逻辑 - 简化HeroAttrsComp调试日志,移除buff名称显示
This commit is contained in:
@@ -144,7 +144,7 @@ export interface SkillConfig {
|
|||||||
crt?:number, // 额外暴击率
|
crt?:number, // 额外暴击率
|
||||||
frz?:number, // 额外冰冻概率
|
frz?:number, // 额外冰冻概率
|
||||||
bck?:number, // 额外击退概率
|
bck?:number, // 额外击退概率
|
||||||
buffs:BuffConf[], // 对施法者的buff配置列表(Buff UUID 列表)
|
buffs:BuffConf[], // 对目标应用的 buff 配置列表
|
||||||
call_hero?:number, // 召唤技能召唤英雄id(可选)
|
call_hero?:number, // 召唤技能召唤英雄id(可选)
|
||||||
info:string, // 技能描述
|
info:string, // 技能描述
|
||||||
}
|
}
|
||||||
@@ -314,28 +314,3 @@ export const SkillSet: Record<number, SkillConfig> = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ==================== 预定义 Buff 列表 ====================
|
|
||||||
// 使用 ID 作为 Key,方便在技能配置中引用或作为模板
|
|
||||||
export const BuffsList: Record<number, BuffConf> = {
|
|
||||||
1001: { uuid: 1001, name: "攻击提升", icon: "10001", buff: Attrs.ap, value: 2, info: "攻击力+2" },
|
|
||||||
1002: { uuid: 1002, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 5, info: "攻击力+5" },
|
|
||||||
1003: { uuid: 1003, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 10, info: "攻击力+10" },
|
|
||||||
1004: { uuid: 1004, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 15, info: "攻击力+15" },
|
|
||||||
1005: { uuid: 1005, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 20, info: "攻击力+20" },
|
|
||||||
1006: { uuid: 1006, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 25, info: "攻击力+25" },
|
|
||||||
1007: { uuid: 1007, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 30, info: "攻击力+30" },
|
|
||||||
1008: { uuid: 1008, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 35, info: "攻击力+35" },
|
|
||||||
1009: { uuid: 1009, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 40, info: "攻击力+40" },
|
|
||||||
1010: { uuid: 1010, name: "攻击提升", icon: "10002", buff: Attrs.ap, value: 45, info: "攻击力+45" },
|
|
||||||
1101: { uuid: 1101, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 10, info: "最大生命值+10" },
|
|
||||||
1102: { uuid: 1102, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 20, info: "最大生命值+20" },
|
|
||||||
1103: { uuid: 1103, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 30, info: "最大生命值+30" },
|
|
||||||
1104: { uuid: 1104, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 40, info: "最大生命值+40" },
|
|
||||||
1105: { uuid: 1105, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 50, info: "最大生命值+50" },
|
|
||||||
1106: { uuid: 1106, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 60, info: "最大生命值+60" },
|
|
||||||
1107: { uuid: 1107, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 70, info: "最大生命值+70" },
|
|
||||||
1108: { uuid: 1108, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 80, info: "最大生命值+80" },
|
|
||||||
1109: { uuid: 1109, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 90, info: "最大生命值+90" },
|
|
||||||
1110: { uuid: 1110, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, value: 100, info: "最大生命值+100" },
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
|||||||
addBuff(buffConf: BuffConf) {
|
addBuff(buffConf: BuffConf) {
|
||||||
this.applyAttrChange(buffConf.buff, buffConf.value);
|
this.applyAttrChange(buffConf.buff, buffConf.value);
|
||||||
if (this.debugMode) {
|
if (this.debugMode) {
|
||||||
mLogger.log(this.debugMode, 'HeroAttrs', `添加属性: ${buffConf.name}, 属性:${buffConf.buff}, 值:${buffConf.value}`);
|
mLogger.log(this.debugMode, 'HeroAttrs', `属性:${buffConf.buff}, 值:${buffConf.value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { Vec3 } from "cc";
|
import { Vec3 } from "cc";
|
||||||
import { HeroAttrsComp } from "./HeroAttrsComp";
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
import { HeroViewComp } from "./HeroViewComp";
|
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 { Skill } from "../skill/Skill";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { GameConst } from "../common/config/GameConst";
|
import { GameConst } from "../common/config/GameConst";
|
||||||
@@ -150,13 +150,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
if (!target.ent) continue;
|
if (!target.ent) continue;
|
||||||
const model = target.ent.get(HeroAttrsComp);
|
const model = target.ent.get(HeroAttrsComp);
|
||||||
if (!model || model.is_dead) continue;
|
if (!model || model.is_dead) continue;
|
||||||
if (config.buffs) {
|
if (!config.buffs || config.buffs.length === 0) continue;
|
||||||
for (const buffId of config.buffs) {
|
for (const buffConf of config.buffs) {
|
||||||
const buffConf = BuffsList[buffId];
|
if (!buffConf) continue;
|
||||||
if (buffConf) {
|
model.addBuff(buffConf);
|
||||||
model.addBuff(buffConf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
|
|||||||
import { CardConfig, CardType, SpecialCardList } from "../common/config/CardSet";
|
import { CardConfig, CardType, SpecialCardList } from "../common/config/CardSet";
|
||||||
import { CardUseComp } from "./CardUseComp";
|
import { CardUseComp } from "./CardUseComp";
|
||||||
import { HeroInfo } from "../common/config/heroSet";
|
import { HeroInfo } from "../common/config/heroSet";
|
||||||
import { BuffsList, SkillSet } from "../common/config/SkillSet";
|
import { SkillSet } from "../common/config/SkillSet";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -425,9 +425,6 @@ export class CardComp extends CCComp {
|
|||||||
if (type === CardType.Skill) {
|
if (type === CardType.Skill) {
|
||||||
return SkillSet[uuid]?.icon || `${uuid}`;
|
return SkillSet[uuid]?.icon || `${uuid}`;
|
||||||
}
|
}
|
||||||
if (type === CardType.Buff || type === CardType.Debuff) {
|
|
||||||
return BuffsList[uuid]?.icon || `${uuid}`;
|
|
||||||
}
|
|
||||||
if (type === CardType.Hero) {
|
if (type === CardType.Hero) {
|
||||||
return HeroInfo[uuid]?.icon || `${uuid}`;
|
return HeroInfo[uuid]?.icon || `${uuid}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { _decorator, Animation, CCInteger, Collider2D, Contact2DType, UITransfor
|
|||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||||
import { BuffsList, DTType, EType, RType, SkillConfig, SkillSet } from "../common/config/SkillSet";
|
import { EType, SkillConfig, SkillSet } from "../common/config/SkillSet";
|
||||||
import { SDataCom } from "./SDataCom";
|
import { SDataCom } from "./SDataCom";
|
||||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||||
import { DamageQueueHelper } from "../hero/DamageQueueComp";
|
import { DamageQueueHelper } from "../hero/DamageQueueComp";
|
||||||
|
|||||||
Reference in New Issue
Block a user