refactor(战斗系统): 优化伤害计算与技能释放逻辑,下一步 将伤害信标处理,改为队列处理
- 移除HeroViewComp中的调试日志 - 缩短技能释放前摇时间从0.3秒到0.1秒 - 重构Skill类,清理无用导入并优化属性传递 - 改进HeroAtkSystem,添加伤害数据深拷贝避免重复处理 - 完善SkillView,增加技能结束类型处理并优化伤害应用逻辑
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
import { instantiate, Node, Prefab, v3, Vec3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { Hero } from "../hero/Hero";
|
||||
import { Monster } from "../hero/Mon";
|
||||
import { ECSEntity } from "db://oops-framework/libs/ecs/ECSEntity";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { AtkConCom } from "./AtkConCom";
|
||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HType } from "../common/config/heroSet";
|
||||
|
||||
import { SkillView } from "./SkillView";
|
||||
import { SDataCom } from "./SDataCom";
|
||||
import { Attrs } from "../common/config/HeroAttrs";
|
||||
import { SMoveDataComp } from "../skill/SMoveComp";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
|
||||
@@ -75,13 +69,14 @@ export class Skill extends ecs.Entity {
|
||||
sMoveCom.s_uuid=s_uuid
|
||||
sMoveCom.scale=caster.node.scale.x < 0 ? -1 : 1
|
||||
|
||||
let casterAttrs=caster.ent.get(HeroAttrsComp).Attrs
|
||||
let cAttrsComp=caster.ent.get(HeroAttrsComp)
|
||||
// 初始化数据组件
|
||||
const sDataCom = this.get(SDataCom);
|
||||
sDataCom.group=caster.box_group
|
||||
sDataCom.caster=caster
|
||||
sDataCom.Attrs=casterAttrs
|
||||
sDataCom.Attrs=cAttrsComp.Attrs
|
||||
sDataCom.s_uuid=s_uuid
|
||||
sDataCom.fac=cAttrsComp.fac
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
|
||||
Reference in New Issue
Block a user