From 8a6609f2c29e3a43ac9b41980590790127b270bd Mon Sep 17 00:00:00 2001 From: panfudan Date: Fri, 7 Feb 2025 20:26:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/game/skill/HeroSkillSystem.ts | 31 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/assets/script/game/skill/HeroSkillSystem.ts b/assets/script/game/skill/HeroSkillSystem.ts index 67c70228..8d44364a 100644 --- a/assets/script/game/skill/HeroSkillSystem.ts +++ b/assets/script/game/skill/HeroSkillSystem.ts @@ -1,3 +1,26 @@ +/** + * 这是一个 使用cocos creator 3.8.2引擎 开发的游戏英雄技能系统TS脚本 + * SkillSet 技能配置表 + * HeroViewComp 英雄视图组件 + * HeroSkillsComp 英雄技能组件 + * Skill 技能实体 + * SkillCom 技能视图组件 + * 目前实现功能: + * 1. 技能冷却 + * 2. 技能释放 + * 3. 技能目标选择 + * 4. 基础攻击技能的伤害应用 及view的伤害显示 + * 未完成功能 + + + + * 1. 技能的动画显示和运动 + * 2. debuff技能的实现和动画显示 + * 3. buff技能实现和动画显示 + */ + + + import { Node, Vec3 } from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { HeroViewComp } from "../hero/HeroViewComp"; @@ -6,13 +29,15 @@ import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet"; import { CdType } from "../common/config/SkillSet"; import { oops } from "db://oops-framework/core/Oops"; import { GameEvent } from "../common/config/GameEvent"; +import { Skill } from "../skills/Skill"; +import { SkillCom } from "../skills/SkillCom"; /** 技能系统 */ @ecs.register('HeroSkillSystem') export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { - private updateInterval: number = 0.1; // 每0.1秒更新一次 - private accumulator: number = 0; + // private updateInterval: number = 0.1; // 每0.1秒更新一次 + // private accumulator: number = 0; private _timers: { [key: string]: number } = {}; init(): void { oops.message.on(GameEvent.MissionEnd, this.clear_timer, this); @@ -56,7 +81,7 @@ export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUp private updateCooldown(comp: HeroSkillsComp, skillId: number) { let cd = comp.cooldowns.has(skillId) ? comp.cooldowns.get(skillId)! : 0; if (cd > 0) { - comp.cooldowns.set(skillId, cd - this.updateInterval); + comp.cooldowns.set(skillId, cd - this.dt); } }