diff --git a/assets/script/game/common/config/HeroAttrs.ts b/assets/script/game/common/config/HeroAttrs.ts index 6431b73a..b75558d0 100644 --- a/assets/script/game/common/config/HeroAttrs.ts +++ b/assets/script/game/common/config/HeroAttrs.ts @@ -133,7 +133,7 @@ export const AttrsType: Record = { [Attrs.HP_MAX]: BType.VALUE, // 最大生命值 - 数值型 [Attrs.MP_MAX]: BType.VALUE, // 最大魔法值 - 数值型 [Attrs.SHIELD_MAX]: BType.VALUE, // 最大护盾值 - 数值型 - [Attrs.HP_REGEN]: BType.VALUE, // 生命回复 - 数值型 + [Attrs.HP_REGEN]: BType.RATIO, // 生命回复 - 百分比型 [Attrs.MP_REGEN]: BType.VALUE, // 魔法回复 - 数值型 [Attrs.LUCK]: BType.VALUE, // 幸运 - 数值型 diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 1b1205b7..057597b3 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -88,13 +88,8 @@ export const getPreAttr = (uuid:number)=>{ let def=HeroInfo[uuid].def/HeroConf.MAX_DEF return {hp:hp,mp:mp,ap:ap,def:def} } -export enum HeroUpSet { - MP=5, - HP=30, - LVMP=10, - LVHP=30, - LVATK=5, - LVDEF=1, +export enum HRegen { + HP=0.5 } /** diff --git a/assets/script/game/hero/HeroAttrsSystem.ts b/assets/script/game/hero/HeroAttrsSystem.ts index a51d52d5..2cd4597e 100644 --- a/assets/script/game/hero/HeroAttrsSystem.ts +++ b/assets/script/game/hero/HeroAttrsSystem.ts @@ -2,7 +2,7 @@ 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 } from "../common/config/HeroAttrs"; -import { HeroUpSet } from "../common/config/heroSet"; +import { HRegen } from "../common/config/heroSet"; import { HeroSkillsComp } from "./HeroSkills"; import { HeroAttrsComp } from "./HeroAttrsComp"; import { HeroViewComp } from "./HeroViewComp"; @@ -89,14 +89,13 @@ export class HeroAttrSystem extends ecs.ComblockSystem const hpRegen = model.Attrs[Attrs.HP_REGEN] || 0; const mpRegen = model.Attrs[Attrs.MP_REGEN] || 0; - model.mp += HeroUpSet.MP + mpRegen; - // model.hp += HeroUpSet.HP + hpRegen; - // model.add_hp(HeroUpSet.HP + hpRegen, true); + // model.hp += HRegen.HP + hpRegen; + // model.add_hp(HRegen.HP + hpRegen, true); // 回血逻辑 + 视图表现 - const totalHpRegen = HeroUpSet.HP + hpRegen; + const totalHpRegen = HRegen.HP + hpRegen; if (totalHpRegen > 0) { - model.add_hp(totalHpRegen, true); + model.add_hp(totalHpRegen, false); // 触发视图层回血特效 const view = e.get(HeroViewComp); if (view) { @@ -105,7 +104,7 @@ export class HeroAttrSystem extends ecs.ComblockSystem } else if (totalHpRegen < 0) { // 如果是扣血(虽然叫 regen),走正常的扣血逻辑? // 暂时按原样处理,只处理正向回血的特效 - model.add_hp(totalHpRegen, true); + model.add_hp(totalHpRegen, false); } }