refactor(skillSet): 基本功完成 新buff系统 优化DBuff与Attrs映射及转换逻辑
- 规范化DBuff的枚举命名,修正属性对应关系 - 统一DBuff与Attrs的双向映射,通过TransformBuffs函数处理转换 - 移除旧的getAttrFieldFromDebuff方法,改用更灵活的映射数组 - 更新Attrs枚举,增加被易伤、防护盾等新属性 - 重新调整AttrsType映射,保证属性类型一致性 refactor(hero): 重构Hero和Monster初始化属性及buff系统 - Hero初始化时完善基础属性赋值,新增基础移动速度与攻击距离 - Hero使用initAttrs替代initBuffsDebuffs,重构buff/debuff初始化流程 - Monster初始化简化,统一按Hero写法初始化基础属性和Attrs - 实现buff/debuff属性智能覆盖与叠加时长的改进逻辑 - 属性计算改用统一逻辑,支持数值型和百分比型准确计算 - 增加属性值范围限制,确保部分属性在合理区间内 refactor(heroViewComp): 优化buff/debuff管理及状态判断 - 统一buff和debuff的持久与临时管理字典及更新方法 - 优化临时buff/debuff的更新时间处理,自动触发属性重新计算 - 提供isStun和isFrost接口简化眩晕、冰冻状态判断 - 规范注释及代码格式,提升可读性和维护性 refactor(skillConComp): 优化眩晕与冰冻状态判断逻辑 - 移除遍历判断,改用HeroViewComp的isStun和isFrost方法 - 简化技能冷却更新逻辑,提升性能 chore(heroSet): 添加AttrSet枚举定义属性最大值限制 docs(rogueConfig): 更新说明文档中的属性枚举定义说明 - 将属性增强枚举由BuffAttr修改为Attrs,以保持一致性
This commit is contained in:
@@ -38,7 +38,6 @@ load(startPos: Vec3, parent: Node, uuid: number, targetPos: any[], caster:Hero
|
||||
node.setPosition(startPos);
|
||||
if(caster.fac==FacSet.MON){
|
||||
node.scale=v3(node.scale.x*-1,1,1)
|
||||
|
||||
}else{
|
||||
if(caster.type==HType.warrior){
|
||||
if(caster.node.scale.x<0){
|
||||
@@ -49,21 +48,18 @@ load(startPos: Vec3, parent: Node, uuid: number, targetPos: any[], caster:Hero
|
||||
// 添加技能组件
|
||||
const SComp = node.getComponent(SkillViewCom); // 初始化技能参数
|
||||
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
|
||||
Object.assign(SComp, {
|
||||
// 核心标识
|
||||
s_uuid: uuid,
|
||||
cName:caster.hero_name,
|
||||
scale: caster.node.scale.x,
|
||||
// 位置和施法者信息
|
||||
startPos: startPos,
|
||||
targetPos: targetPos,
|
||||
group: caster.box_group,
|
||||
fac: caster.fac,
|
||||
// 技能数值
|
||||
ap: caster.Attrs[Attrs.AP],
|
||||
caster: caster,
|
||||
|
||||
});
|
||||
SComp.s_uuid= uuid
|
||||
SComp.cName=caster.hero_name
|
||||
SComp.scale= caster.node.scale.x
|
||||
// 位置和施法者信息
|
||||
SComp.startPos= startPos
|
||||
SComp.targetPos= targetPos
|
||||
SComp.group= caster.box_group
|
||||
SComp.fac= caster.fac,
|
||||
// 技能数值
|
||||
SComp.Attrs= caster.Attrs
|
||||
SComp.caster= caster,
|
||||
this.add(SComp);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,12 @@ export class SkillViewCom extends CCComp {
|
||||
target:HeroViewComp=null;
|
||||
parent:Node=null;
|
||||
target_postions:any[]=null
|
||||
group:0
|
||||
fac: 0
|
||||
group:number=0
|
||||
fac:number=0
|
||||
// 战斗相关运行时数据
|
||||
Attrs:any=null
|
||||
targetPos:any[]=null
|
||||
startPos:any=null
|
||||
targetPos:any=null
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
this.node.getChildByName("ready").active = this.hasReady
|
||||
|
||||
Reference in New Issue
Block a user