diff --git a/assets/resources/game/heros/hk1.prefab b/assets/resources/game/heros/hk1.prefab index ab58a058..2c05eb7e 100644 --- a/assets/resources/game/heros/hk1.prefab +++ b/assets/resources/game/heros/hk1.prefab @@ -902,7 +902,7 @@ "_anchorPoint": { "__type__": "cc.Vec2", "x": 0.5, - "y": 0 + "y": 0.2 }, "_id": "" }, diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 0eb417a6..27bd63eb 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -1,3 +1,4 @@ +import { Timer } from "db://oops-framework/core/common/timer/Timer"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { smc } from "../common/SingletonModuleComp"; import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs"; @@ -406,7 +407,7 @@ export class HeroAttrSystem extends ecs.ComblockSystem private entityCount: number = 0; // 本帧处理的实体数 private frameCount: number = 0; // 总帧数 private debugMode: boolean = false; // 是否启用调试模式 - + private timer:Timer=new Timer(1) /** * 过滤器:只处理拥有 HeroAttrsComp 的实体 */ @@ -455,10 +456,11 @@ export class HeroAttrSystem extends ecs.ComblockSystem // 1. 更新临时 Buff/Debuff(时间递减,过期自动移除) model.updateTemporaryBuffsDebuffs(this.dt); - - // 2. HP/MP 自然回复(业务规则) - model.mp += HeroUpSet.MP * this.dt/60; - model.hp += HeroUpSet.HP * this.dt/60; + if(this.timer.update(this.dt)){ + // 2. HP/MP 自然回复(业务规则) + model.mp += HeroUpSet.MP + model.hp += HeroUpSet.HP + } // 3. 限制属性值在合理范围内 if (model.mp > model.Attrs[Attrs.MP_MAX]) {