refactor(英雄属性): 重构生命回复机制并调整相关配置
- 将 HeroUpSet 枚举重命名为 HRegen 并简化其内容,仅保留 HP 回复基础值 - 将 HP_REGEN 属性类型从 VALUE 改为 RATIO,使其作为百分比加成 - 移除魔法回复的固定加成,仅保留属性提供的回复值 - 调整 add_hp 方法的调用参数,移除强制显示伤害数字的标志
This commit is contained in:
@@ -133,7 +133,7 @@ export const AttrsType: Record<Attrs, BType> = {
|
|||||||
[Attrs.HP_MAX]: BType.VALUE, // 最大生命值 - 数值型
|
[Attrs.HP_MAX]: BType.VALUE, // 最大生命值 - 数值型
|
||||||
[Attrs.MP_MAX]: BType.VALUE, // 最大魔法值 - 数值型
|
[Attrs.MP_MAX]: BType.VALUE, // 最大魔法值 - 数值型
|
||||||
[Attrs.SHIELD_MAX]: BType.VALUE, // 最大护盾值 - 数值型
|
[Attrs.SHIELD_MAX]: BType.VALUE, // 最大护盾值 - 数值型
|
||||||
[Attrs.HP_REGEN]: BType.VALUE, // 生命回复 - 数值型
|
[Attrs.HP_REGEN]: BType.RATIO, // 生命回复 - 百分比型
|
||||||
[Attrs.MP_REGEN]: BType.VALUE, // 魔法回复 - 数值型
|
[Attrs.MP_REGEN]: BType.VALUE, // 魔法回复 - 数值型
|
||||||
[Attrs.LUCK]: BType.VALUE, // 幸运 - 数值型
|
[Attrs.LUCK]: BType.VALUE, // 幸运 - 数值型
|
||||||
|
|
||||||
|
|||||||
@@ -88,13 +88,8 @@ export const getPreAttr = (uuid:number)=>{
|
|||||||
let def=HeroInfo[uuid].def/HeroConf.MAX_DEF
|
let def=HeroInfo[uuid].def/HeroConf.MAX_DEF
|
||||||
return {hp:hp,mp:mp,ap:ap,def:def}
|
return {hp:hp,mp:mp,ap:ap,def:def}
|
||||||
}
|
}
|
||||||
export enum HeroUpSet {
|
export enum HRegen {
|
||||||
MP=5,
|
HP=0.5
|
||||||
HP=30,
|
|
||||||
LVMP=10,
|
|
||||||
LVHP=30,
|
|
||||||
LVATK=5,
|
|
||||||
LVDEF=1,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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 { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { Attrs } from "../common/config/HeroAttrs";
|
import { Attrs } from "../common/config/HeroAttrs";
|
||||||
import { HeroUpSet } from "../common/config/heroSet";
|
import { HRegen } from "../common/config/heroSet";
|
||||||
import { HeroSkillsComp } from "./HeroSkills";
|
import { HeroSkillsComp } from "./HeroSkills";
|
||||||
import { HeroAttrsComp } from "./HeroAttrsComp";
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
import { HeroViewComp } from "./HeroViewComp";
|
import { HeroViewComp } from "./HeroViewComp";
|
||||||
@@ -89,14 +89,13 @@ export class HeroAttrSystem extends ecs.ComblockSystem
|
|||||||
const hpRegen = model.Attrs[Attrs.HP_REGEN] || 0;
|
const hpRegen = model.Attrs[Attrs.HP_REGEN] || 0;
|
||||||
const mpRegen = model.Attrs[Attrs.MP_REGEN] || 0;
|
const mpRegen = model.Attrs[Attrs.MP_REGEN] || 0;
|
||||||
|
|
||||||
model.mp += HeroUpSet.MP + mpRegen;
|
// model.hp += HRegen.HP + hpRegen;
|
||||||
// model.hp += HeroUpSet.HP + hpRegen;
|
// model.add_hp(HRegen.HP + hpRegen, true);
|
||||||
// model.add_hp(HeroUpSet.HP + hpRegen, true);
|
|
||||||
|
|
||||||
// 回血逻辑 + 视图表现
|
// 回血逻辑 + 视图表现
|
||||||
const totalHpRegen = HeroUpSet.HP + hpRegen;
|
const totalHpRegen = HRegen.HP + hpRegen;
|
||||||
if (totalHpRegen > 0) {
|
if (totalHpRegen > 0) {
|
||||||
model.add_hp(totalHpRegen, true);
|
model.add_hp(totalHpRegen, false);
|
||||||
// 触发视图层回血特效
|
// 触发视图层回血特效
|
||||||
const view = e.get(HeroViewComp);
|
const view = e.get(HeroViewComp);
|
||||||
if (view) {
|
if (view) {
|
||||||
@@ -105,7 +104,7 @@ export class HeroAttrSystem extends ecs.ComblockSystem
|
|||||||
} else if (totalHpRegen < 0) {
|
} else if (totalHpRegen < 0) {
|
||||||
// 如果是扣血(虽然叫 regen),走正常的扣血逻辑?
|
// 如果是扣血(虽然叫 regen),走正常的扣血逻辑?
|
||||||
// 暂时按原样处理,只处理正向回血的特效
|
// 暂时按原样处理,只处理正向回血的特效
|
||||||
model.add_hp(totalHpRegen, true);
|
model.add_hp(totalHpRegen, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user