diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index d919b7de..1b1205b7 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -97,6 +97,22 @@ export enum HeroUpSet { LVDEF=1, } +/** + * 不同职业升级属性加成配置 + * 战士:高血量成长,低攻击成长 + * 远程:低血量成长,高攻击成长 + * 法师:低血量成长,高攻击成长 + * 辅助:中血量成长,中攻击成长 + * 刺客:极低血量成长,极高攻击成长 + */ +export const JobUpConf: Record = { + [HType.warrior]: { hp: 50, ap: 3, def: 3 }, + [HType.remote]: { hp: 25, ap: 7, def: 1 }, + [HType.mage]: { hp: 20, ap: 8, def: 1 }, + [HType.support]: { hp: 35, ap: 4, def: 2 }, + [HType.assassin]: { hp: 18, ap: 9, def: 0 }, +}; + /** * 英雄/怪物基础信息接口 */ diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 3b2485ba..3ca96266 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -3,7 +3,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O import { GameEvent } from "../common/config/GameEvent"; import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs"; import { BuffConf, SkillRange } from "../common/config/SkillSet"; -import { HeroInfo, AttrSet } from "../common/config/heroSet"; +import { HeroInfo, AttrSet, HType, JobUpConf } from "../common/config/heroSet"; import { HeroSkillsComp } from "./HeroSkills"; import { smc } from "../common/SingletonModuleComp"; import { AttrCards, PotionCards } from "../common/config/AttrSet"; @@ -149,10 +149,12 @@ export class HeroAttrsComp extends ecs.Comp { mLogger.log(this.debugMode, 'HeroAttrs', `[HeroAttrs] 英雄升级处理: Lv.${this.lv} -> Lv.${newLv}`); this.lv = newLv; - // === 属性成长逻辑 (示例: 固定数值成长) === - const hpGrow = 10; - const apGrow = 2; - const defGrow = 1; + // === 属性成长逻辑 === + // 根据职业获取成长属性 + const jobConf = JobUpConf[this.type as HType] || { hp: 30, ap: 5, def: 1 }; + const hpGrow = jobConf.hp; + const apGrow = jobConf.ap; + const defGrow = jobConf.def; this.base_hp += hpGrow; this.base_ap += apGrow;