From bf799a84fe829881a306ba098ea3cc160ae4c726 Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 15 Apr 2026 16:20:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E5=87=BB=E9=80=80=E7=9B=B8=E5=85=B3=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=92=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 HeroAttrsComp 中的 back_chance 属性及相关配置,清理 SCastSystem、Skill 和 HeroAtkSystem 中击退概率的计算与判定逻辑,简化攻击效果处理流程。 --- assets/script/game/common/config/HeroAttrs.ts | 2 -- assets/script/game/common/config/heros.md | 10 ++++++++++ assets/script/game/hero/HeroAtkSystem.ts | 7 +++---- assets/script/game/hero/HeroAttrsComp.ts | 2 -- assets/script/game/hero/SCastSystem.ts | 1 - assets/script/game/skill/Skill.ts | 2 -- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/assets/script/game/common/config/HeroAttrs.ts b/assets/script/game/common/config/HeroAttrs.ts index 0833323f..de27d220 100644 --- a/assets/script/game/common/config/HeroAttrs.ts +++ b/assets/script/game/common/config/HeroAttrs.ts @@ -26,7 +26,6 @@ export enum Attrs { // ==================== 特殊效果属性 ==================== freeze_chance = "freeze_chance", // 冰冻概率 - back_chance = "back_chance", // 击退概率 // ==================== 增益效果属性 ==================== revive_count = "revive_count", // 复活次数 revive_time = "revive_time", // 复活时间 @@ -47,7 +46,6 @@ export interface GameScoreStats { crt_count: number; // 暴击次数 wf_count: number; // 风怒次数 dod_count: number; // 闪避次数 - back_count: number; // 击退次数 stun_count: number; // 击晕次数 freeze_count: number; // 冰冻次数 diff --git a/assets/script/game/common/config/heros.md b/assets/script/game/common/config/heros.md index bfca792c..07696ea2 100644 --- a/assets/script/game/common/config/heros.md +++ b/assets/script/game/common/config/heros.md @@ -1 +1,11 @@ 盾战:获得护盾,抵御3次攻击, + +攻击类型: +普通: 水球、近战无 +暴击: 火球 +穿刺: 旋风 +可叠加类型: +双击(风怒)概率 + + +群攻:不限 \ No newline at end of file diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index ddbd1095..9e3a6e56 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -171,13 +171,12 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd mLogger.log(this.debugMode, 'HeroAtkSystem', ` 英雄${TAttrsComp.hero_name} (uuid: ${TAttrsComp.hero_uuid}) 受到 eid:${casterEid} 的 伤害 ${damage},${isCrit?"暴击":"普通"}攻击,技能ID ${damageEvent.s_uuid}`); - // 击退和冰冻判定 - const isBack = this.checkChance((damageEvent.Attrs[Attrs.back_chance] || 0)); + // 冰冻判定 const freezeChance = damageEvent.Attrs[Attrs.freeze_chance] || 0; const isFrost = !TAttrsComp.isFrost() && this.checkChance(freezeChance); - // ✅ 触发视图层表现(伤害数字、受击动画、后退,冰冻) + // ✅ 触发视图层表现(伤害数字、受击动画、冰冻) if (targetView) { - targetView.do_atked(damage, isCrit, damageEvent.s_uuid, isBack); + targetView.do_atked(damage, isCrit, damageEvent.s_uuid, false); targetView.playEnd(skillConf.endAnm); if (isFrost) { TAttrsComp.toFrost(); diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 5b04ca7b..dbe7b3c1 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -30,7 +30,6 @@ export class HeroAttrsComp extends ecs.Comp { // ==================== 特殊属性 ==================== critical: number = 0; // 暴击率 freeze_chance: number = 0; // 冰冻概率 - back_chance: number = 0; // 击退概率 puncture: number = 0; // 穿刺次数 wfuny: number = 0; // 风怒 @@ -232,7 +231,6 @@ export class HeroAttrsComp extends ecs.Comp { this.skills = {}; this.critical = 0; this.freeze_chance = 0; - this.back_chance = 0; this.revive_count = 0; this.revive_time = 0; this.invincible_time = 0; diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index d04e4ec9..45ae65ba 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -105,7 +105,6 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate mockAttrs.ap = highestAp; mockAttrs.critical = 0; mockAttrs.freeze_chance = 0; - mockAttrs.back_chance = 0; mockAttrs.puncture = 0; mockAttrs.fac = FacSet.HERO; diff --git a/assets/script/game/skill/Skill.ts b/assets/script/game/skill/Skill.ts index b7069999..567b48b8 100644 --- a/assets/script/game/skill/Skill.ts +++ b/assets/script/game/skill/Skill.ts @@ -210,13 +210,11 @@ export class Skill extends ecs.Entity { const SUp=SkillUpList[s_uuid] ? SkillUpList[s_uuid]:SkillUpList[1001]; const sCrt = (config.crt ?? 0)+(SUp.crt*skill_lv); const sFrz = (config.frz ?? 0)+(SUp.frz*skill_lv); - const sBck = (config.bck ?? 0)+(SUp.bck*skill_lv); const sAp =config.ap+(SUp.ap*skill_lv); const sHit=config.hit_count+(SUp.hit_count*skill_lv) + cAttrsComp.puncture sDataCom.Attrs[Attrs.ap] = Math.floor(cAttrsComp.ap*sAp/100); //技能的ap是百分值 需要/100 而且需要再最终计算总ap时再/100,不然会出现ap为90%变0 sDataCom.Attrs[Attrs.critical] = cAttrsComp.critical + sCrt; sDataCom.Attrs[Attrs.freeze_chance] = cAttrsComp.freeze_chance + sFrz; - sDataCom.Attrs[Attrs.back_chance] = cAttrsComp.back_chance + sBck; sDataCom.s_uuid=s_uuid sDataCom.skill_lv = Math.max(0, skill_lv); sDataCom.fac=cAttrsComp.fac