refactor(战斗): 重构英雄与怪物属性系统,简化数据结构

- 移除 HeroSkillsComp 组件,将技能逻辑合并到 HeroAttrsComp
- 将属性从 Attrs 枚举映射改为 HeroAttrsComp 中的独立字段
- 为 HeroAttrsComp 添加攻击和技能冷却时间管理功能
- 统一英雄和怪物的属性初始化方式,简化配置数据
- 在 GameSet 中添加击退概率配置项
- 修复 SkillView 中属性名大小写错误
This commit is contained in:
walkpan
2026-03-11 23:13:21 +08:00
parent 9d6075be6e
commit a544f65d73
9 changed files with 85 additions and 202 deletions

View File

@@ -3,6 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
import { EType, SkillSet } from "../common/config/SkillSet";
import { oops } from "db://oops-framework/core/Oops";
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
import { Attrs } from "../common/config/HeroAttrs";
import { SkillView } from "./SkillView";
import { SDataCom } from "./SDataCom";
@@ -122,7 +123,18 @@ export class Skill extends ecs.Entity {
sDataCom.group=caster.box_group
sDataCom.caster=caster
sDataCom.casterEid=caster.ent.eid
sDataCom.Attrs={...cAttrsComp.Attrs}
sDataCom.Attrs = {};
sDataCom.Attrs[Attrs.ap] = cAttrsComp.ap;
sDataCom.Attrs[Attrs.critical] = cAttrsComp.critical;
sDataCom.Attrs[Attrs.critical_dmg] = cAttrsComp.critical_dmg;
sDataCom.Attrs[Attrs.freeze_chance] = cAttrsComp.freeze_chance;
sDataCom.Attrs[Attrs.stun_chance] = cAttrsComp.stun_chance;
sDataCom.Attrs[Attrs.back_chance] = cAttrsComp.back_chance;
sDataCom.Attrs[Attrs.slow_chance] = cAttrsComp.slow_chance;
sDataCom.Attrs[Attrs.puncture] = cAttrsComp.puncture;
sDataCom.Attrs[Attrs.puncture_dmg] = cAttrsComp.puncture_dmg;
sDataCom.Attrs[Attrs.wfuny] = cAttrsComp.wfuny;
sDataCom.s_uuid=s_uuid
sDataCom.fac=cAttrsComp.fac
sDataCom.ext_dmg=ext_dmg

View File

@@ -183,7 +183,7 @@ export class SkillView extends CCComp {
this.sData.hit_count++
// 检查技能是否应该销毁
if (
this.sData.hit_count >= (this.SConf.hit + this.sData.Attrs[Attrs.PUNCTURE]) &&
this.sData.hit_count >= (this.SConf.hit + this.sData.Attrs[Attrs.puncture]) &&
(this.SConf.DTType != DTType.range) &&
(this.SConf.EType != EType.animationEnd) &&
(this.SConf.EType != EType.timeEnd)