feat(英雄): 重构复活机制为动态配置

将固定的复活次数属性改为从英雄配置中动态计算。移除 `revive_count` 静态属性,新增 `revive` 数组用于存储复活配置(包含基础次数和等级成长),并添加 `revived_count` 记录已复活次数。在 `Hero` 和 `Monster` 的初始化中同步此属性,并在战斗系统中根据配置和英雄等级计算最大可复活次数。
This commit is contained in:
panw
2026-04-23 09:41:50 +08:00
parent 0676412a5a
commit b9f7a66fae
5 changed files with 19 additions and 6 deletions

View File

@@ -34,6 +34,7 @@ export class HeroAttrsComp extends ecs.Comp {
fend?: number[];
atking?: {s_uuid: number, t_num: number}[];
atked?: {s_uuid: number, t_num: number}[];
revive?: {s_uuid: number, r_num: number, upr: number}[];
// ==================== 特殊属性 ====================
critical: number = 0; // 暴击率
@@ -41,7 +42,7 @@ export class HeroAttrsComp extends ecs.Comp {
puncture: number = 0; // 穿刺次数
wfuny: number = 0; // 风怒
revive_count: number = 0; // 复活次数
revived_count: number = 0; // 复活次数
invincible_time: number = 0;// 无敌时间
@@ -244,9 +245,10 @@ export class HeroAttrsComp extends ecs.Comp {
this.fend = undefined;
this.atking = undefined;
this.atked = undefined;
this.revive = undefined;
this.critical = 0;
this.freeze_chance = 0;
this.revive_count = 0;
this.revived_count = 0;
this.invincible_time = 0;
this.puncture = 0;
this.wfuny = 0;