feat(英雄属性): 扩展英雄属性组件以支持新游戏机制

新增攻击速度、技能速度、暴击、命中及多种特殊效果属性。
添加武器进化相关属性如穿刺和风怒。
在重置方法中初始化所有新增属性,确保状态一致性。
This commit is contained in:
panw
2026-03-11 18:08:01 +08:00
parent 350bbafcfb
commit 8663ae80e5

View File

@@ -36,6 +36,31 @@ export class HeroAttrsComp extends ecs.Comp {
shield: number = 0; // 当前护盾
shield_max: number = 0; // 最大护盾值
// ==================== 攻击属性 (补充) ====================
as: number = 0; // 攻击速度减少技能skills[0]CD
ss: number = 0; // 技能速度 (减少skills[0] 以外的cd)
// ==================== 暴击与命中属性 ====================
critical: number = 0; // 暴击率
critical_dmg: number = 0; // 暴击伤害
// ==================== 特殊效果属性 ====================
freeze_chance: number = 0; // 冰冻概率
stun_chance: number = 0; // 眩晕概率
back_chance: number = 0; // 击退概率
slow_chance: number = 0; // 减速概率
// ==================== 增益效果属性 ====================
revive_count: number = 0; // 复活次数
revive_time: number = 0; // 复活时间
invincible_time: number = 0;// 无敌时间
// ==================== 武器进化相关 ====================
puncture: number = 0; // 穿刺次数
puncture_dmg: number = 0; // 穿刺伤害
wfuny: number = 0; // 风怒
boom: boolean = false; // 自爆怪
// ==================== 脏标签标记 ====================
dirty_hp: boolean = false; // 血量变更标记
@@ -189,6 +214,24 @@ export class HeroAttrsComp extends ecs.Comp {
this.hp = 100;
this.shield = 0;
this.shield_max = 0;
// 重置新增属性
this.as = 0;
this.ss = 0;
this.critical = 0;
this.critical_dmg = 0;
this.freeze_chance = 0;
this.stun_chance = 0;
this.back_chance = 0;
this.slow_chance = 0;
this.revive_count = 0;
this.revive_time = 0;
this.invincible_time = 0;
this.puncture = 0;
this.puncture_dmg = 0;
this.wfuny = 0;
this.boom = false;
this.BUFFS = {};
this.DEBUFFS = {};
// 重置技能距离缓存
@@ -211,7 +254,6 @@ export class HeroAttrsComp extends ecs.Comp {
this.dirty_hp = false;
this.dirty_mp = false;
this.dirty_shield = false;
smc.updateHeroInfo(this);
}