Merge branch 'card' of git.eoxnet.com:pan/pixelheros into card

This commit is contained in:
walkpan
2026-04-22 22:31:38 +08:00
2 changed files with 3 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ export enum FightSet {
CSKILL_START_X=-340, CSKILL_START_X=-340,
CSKILL_START_Y=30, CSKILL_START_Y=30,
SHIELD_MAX=5, SHIELD_MAX=5,
WAVE_HEAL_RATE=0.7, // 回合结束时所有英雄恢复最大生命值的比例
} }
export enum IndexSet { export enum IndexSet {

View File

@@ -493,8 +493,8 @@ export class MissionComp extends CCComp {
const view = entity.get(HeroViewComp); const view = entity.get(HeroViewComp);
if (!attrs || !view || attrs.fac !== FacSet.HERO) return; if (!attrs || !view || attrs.fac !== FacSet.HERO) return;
// 计算恢复量70% 的最大生命值 // 计算恢复量:基于配置的百分比(如 70%的最大生命值
const healAmount = Math.floor(attrs.hp_max * 0.7); const healAmount = Math.floor(attrs.hp_max * FightSet.WAVE_HEAL_RATE);
// 应用恢复量,不超过最大生命值 // 应用恢复量,不超过最大生命值
attrs.hp = Math.min(attrs.hp_max, attrs.hp + healAmount); attrs.hp = Math.min(attrs.hp_max, attrs.hp + healAmount);