From 4d0c8e5438e29f489dcc9ca2fa46028ac631411b Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 4 Feb 2026 15:45:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E8=8B=B1=E9=9B=84=E5=B1=9E=E6=80=A7):?= =?UTF-8?q?=20=E9=87=8D=E6=9E=84=E7=94=9F=E5=91=BD=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=E5=B9=B6=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 HeroUpSet 枚举重命名为 HRegen 并简化其内容,仅保留 HP 回复基础值 - 将 HP_REGEN 属性类型从 VALUE 改为 RATIO,使其作为百分比加成 - 移除魔法回复的固定加成,仅保留属性提供的回复值 - 调整 add_hp 方法的调用参数,移除强制显示伤害数字的标志 --- assets/script/game/common/config/HeroAttrs.ts | 2 +- assets/script/game/common/config/heroSet.ts | 9 ++------- assets/script/game/hero/HeroAttrsSystem.ts | 13 ++++++------- 3 files changed, 9 insertions(+), 15 deletions(-) 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); } }