diff --git a/assets/script/game/common/config/GameSet.ts b/assets/script/game/common/config/GameSet.ts index 6ed69ae6..8ee83673 100644 --- a/assets/script/game/common/config/GameSet.ts +++ b/assets/script/game/common/config/GameSet.ts @@ -37,6 +37,7 @@ export enum FightSet { CSKILL_START_X=-340, CSKILL_START_Y=30, SHIELD_MAX=5, + WAVE_HEAL_RATE=0.7, // 回合结束时所有英雄恢复最大生命值的比例 } export enum IndexSet { diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 2656f434..5bf8a4a8 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -493,8 +493,8 @@ export class MissionComp extends CCComp { const view = entity.get(HeroViewComp); if (!attrs || !view || attrs.fac !== FacSet.HERO) return; - // 计算恢复量:70% 的最大生命值 - const healAmount = Math.floor(attrs.hp_max * 0.7); + // 计算恢复量:基于配置的百分比(如 70%)的最大生命值 + const healAmount = Math.floor(attrs.hp_max * FightSet.WAVE_HEAL_RATE); // 应用恢复量,不超过最大生命值 attrs.hp = Math.min(attrs.hp_max, attrs.hp + healAmount);