From 5585149b1235af8d1c8b2e6978674eb6f19ed560 Mon Sep 17 00:00:00 2001 From: pan Date: Wed, 19 Aug 2026 16:40:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E9=BA=BB=E7=97=B9?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=9C=BA=E5=88=B6=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=87=BB=E6=99=95=E4=B8=8E=E6=8A=80=E8=83=BDCD=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增麻痹控制相关属性、buff配置与逻辑实现 2. 调整击晕时长与CD削减机制,优化技能CD更新逻辑 3. 修正多个技能预制件的参数与动画配置 4. 扩展控制类型检测与游戏配置项 --- assets/resources/game/skill/anm/atk/fb-7.anim | 29 +++++++---- assets/resources/game/skill/atk/fb-7.prefab | 14 +++--- assets/resources/game/skill/atk/maxm3.prefab | 14 +++--- assets/resources/game/skill/atk/range2.prefab | 6 ++- assets/resources/game/skill/atk/range3.prefab | 6 ++- assets/script/game/common/config/BuffSet.ts | 25 ++++++++-- assets/script/game/common/config/GameSet.ts | 8 ++- assets/script/game/common/config/HeroAttrs.ts | 1 + assets/script/game/hero/BuffManager.ts | 2 +- assets/script/game/hero/HeroAttrsComp.ts | 49 +++++++++++++------ assets/script/game/hero/SCastSystem.ts | 4 +- 11 files changed, 109 insertions(+), 49 deletions(-) diff --git a/assets/resources/game/skill/anm/atk/fb-7.anim b/assets/resources/game/skill/anm/atk/fb-7.anim index c8c81748..586f6da6 100644 --- a/assets/resources/game/skill/anm/atk/fb-7.anim +++ b/assets/resources/game/skill/anm/atk/fb-7.anim @@ -7,11 +7,11 @@ "embeddedPlayerGroups": [] }, "_native": "", - "sample": 24, + "sample": 20, "speed": 1, "wrapMode": 1, "enableTrsBlending": false, - "_duration": 0.2916666666666667, + "_duration": 0.35, "_hash": 500763545, "_tracks": [ { @@ -19,7 +19,18 @@ } ], "_exoticAnimation": null, - "_events": [], + "_events": [ + { + "frame": 0.15, + "func": "", + "params": [] + }, + { + "frame": 0.15, + "func": "atk", + "params": [] + } + ], "_embeddedPlayers": [], "_additiveSettings": { "__id__": 7 @@ -69,12 +80,12 @@ "__type__": "cc.ObjectCurve", "_times": [ 0, - 0.041666666666666664, - 0.08333333333333333, - 0.125, - 0.16666666666666666, - 0.20833333333333334, - 0.25 + 0.05, + 0.1, + 0.15, + 0.2, + 0.25, + 0.3 ], "_values": [ { diff --git a/assets/resources/game/skill/atk/fb-7.prefab b/assets/resources/game/skill/atk/fb-7.prefab index 7c8ffecd..cf239b82 100644 --- a/assets/resources/game/skill/atk/fb-7.prefab +++ b/assets/resources/game/skill/atk/fb-7.prefab @@ -96,7 +96,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 0, + "y": -55, "z": 0 }, "_lrot": { @@ -137,7 +137,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 65, - "height": 600 + "height": 330 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -178,7 +178,7 @@ }, "_type": 0, "_fillType": 0, - "_sizeMode": 0, + "_sizeMode": 1, "_fillCenter": { "__type__": "cc.Vec2", "x": 0, @@ -251,10 +251,10 @@ "__prefab": { "__id__": 11 }, - "atk_x": 20, - "atk_y": 20, + "atk_x": 0, + "atk_y": 0, "runType": 3, - "endType": 2, + "endType": 0, "speed": 720, "time": 0, "distance": 0, @@ -323,7 +323,7 @@ "_offset": { "__type__": "cc.Vec2", "x": 0, - "y": 0 + "y": 50 }, "_size": { "__type__": "cc.Size", diff --git a/assets/resources/game/skill/atk/maxm3.prefab b/assets/resources/game/skill/atk/maxm3.prefab index 10f42182..72599958 100644 --- a/assets/resources/game/skill/atk/maxm3.prefab +++ b/assets/resources/game/skill/atk/maxm3.prefab @@ -96,7 +96,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 0, + "y": -30, "z": 0 }, "_lrot": { @@ -108,7 +108,7 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, + "x": 0.9, "y": 1, "z": 1 }, @@ -137,7 +137,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 65, - "height": 600 + "height": 330 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -178,7 +178,7 @@ }, "_type": 0, "_fillType": 0, - "_sizeMode": 0, + "_sizeMode": 1, "_fillCenter": { "__type__": "cc.Vec2", "x": 0, @@ -251,10 +251,10 @@ "__prefab": { "__id__": 11 }, - "atk_x": 20, - "atk_y": 20, + "atk_x": 0, + "atk_y": 0, "runType": 3, - "endType": 2, + "endType": 0, "speed": 720, "time": 0, "distance": 0, diff --git a/assets/resources/game/skill/atk/range2.prefab b/assets/resources/game/skill/atk/range2.prefab index e286ef12..8764f2bb 100644 --- a/assets/resources/game/skill/atk/range2.prefab +++ b/assets/resources/game/skill/atk/range2.prefab @@ -761,13 +761,17 @@ "__prefab": { "__id__": 33 }, - "atk_x": 20, + "atk_x": 60, "atk_y": 40, "runType": 2, "endType": 0, "speed": 720, "time": 0, "distance": 0, + "forceStartX": -1, + "forceStartY": -1, + "summon_count": 1, + "height_offset": 0, "_id": "" }, { diff --git a/assets/resources/game/skill/atk/range3.prefab b/assets/resources/game/skill/atk/range3.prefab index dacbe60e..bbd2d9d0 100644 --- a/assets/resources/game/skill/atk/range3.prefab +++ b/assets/resources/game/skill/atk/range3.prefab @@ -2120,8 +2120,8 @@ "__prefab": { "__id__": 97 }, - "atk_x": 20, - "atk_y": 40, + "atk_x": 0, + "atk_y": 10, "runType": 2, "endType": 0, "speed": 720, @@ -2129,6 +2129,8 @@ "distance": 0, "forceStartX": 0, "forceStartY": -1, + "summon_count": 1, + "height_offset": 0, "_id": "" }, { diff --git a/assets/script/game/common/config/BuffSet.ts b/assets/script/game/common/config/BuffSet.ts index 02b8de42..2fde4218 100644 --- a/assets/script/game/common/config/BuffSet.ts +++ b/assets/script/game/common/config/BuffSet.ts @@ -59,6 +59,7 @@ export const DEBUFF_ICON_MAP: Record = { 7006: DebuffIcon.AttackDebuff, // 减攻 7007: DebuffIcon.Blood, // 出血 7008: DebuffIcon.Penetration, // 破甲 + 7025: DebuffIcon.LightningDamag, // 麻痹(雷系图标,注意 prefab 原始拼写少个 e) }; /** 易伤 buff 的 id(HeroAtkSystem 结算时按此 id 汇总易伤值) */ @@ -79,7 +80,7 @@ export interface BuffConfig { modifiers?: BuffModifier[]; tick?: BuffTickEffect; is_control?: boolean; - control_kind?: 'frost' | 'stun' | 'none'; + control_kind?: 'frost' | 'stun' | 'paralyze' | 'none'; info: string; } @@ -107,12 +108,12 @@ export const BuffList: Record = { is_control: true, control_kind: 'frost', info: "冰冻目标,无法行动", }, - // 击晕(控制) + // 击晕(短控:施加瞬间技能 CD 削减 20%,持续期间 CD 停止增长) 7004: { id: 7004, name: "击晕", icon: "Stat_Stun", - category: BuffCategory.Control, duration: 2, max_stack: 1, + category: BuffCategory.Control, duration: 1, max_stack: 1, is_control: true, control_kind: 'stun', - info: "击晕目标,无法行动", + info: "击晕目标 1 秒,无法行动,技能 CD 削减 20% 并停止增长", }, // 中毒(纯伤害 DoT,可叠层) 7005: { @@ -242,4 +243,20 @@ export const BuffList: Record = { modifiers: [{ attr: Attrs.defense, op: ModOp.PercentAdd, value: 100 }], info: "防御提升 100,持续 5 秒", }, + + // ==================== 控制 / 麻痹系 ==================== + // 麻痹(控制:技能 CD 增长减速 50%,可被麻痹强化 buff 提升,累计达 100% 则停止增长) + 7025: { + id: 7025, name: "麻痹", icon: "Stat_LightningDamag", + category: BuffCategory.Control, duration: 5, max_stack: 1, + is_control: true, control_kind: 'paralyze', + info: "麻痹目标,技能 CD 增长减慢 50%,持续 5 秒", + }, + // 麻痹强化(提升麻痹对技能 CD 的减速量,与麻痹基础减速按百分点叠加) + 7026: { + id: 7026, name: "麻痹强化", icon: "Stat_LightningDamag", + category: BuffCategory.Buff, duration: 5, max_stack: 1, + modifiers: [{ attr: Attrs.paralyze_power, op: ModOp.PercentAdd, value: 30 }], + info: "麻痹对技能 CD 的减速量额外提升 30%,持续 5 秒", + }, }; diff --git a/assets/script/game/common/config/GameSet.ts b/assets/script/game/common/config/GameSet.ts index 73e3882c..5a8f2cb6 100644 --- a/assets/script/game/common/config/GameSet.ts +++ b/assets/script/game/common/config/GameSet.ts @@ -40,7 +40,13 @@ export enum FightSet { BACK_RANG = 20,//后退范围 FiIGHT_TIME = 30,//战斗时间 FROST_TIME = 3,//冰冻时间 - STUN_TIME = 2,//击晕时间 + STUN_TIME = 1,//击晕时间(短控:施加瞬间 CD 削减,期间 CD 停止增长) + /** 麻痹持续时间(秒) */ + PARALYZE_TIME = 5, + /** 麻痹对技能 CD 增长的基础减速量(百分点,可被麻痹强化 buff 提升,达 100 则停止增长) */ + PARALYZE_CD_SLOW = 50, + /** 击晕施加瞬间的技能 CD 削减量(百分点,20 表示 ccd × 0.8) */ + STUN_CD_CUT = 20, SKILL_CAST_DELAY = 0.15, /** 多发/召唤技能每次实例化之间的间隔(秒),首个立即执行 */ SUMMON_INTERVAL = 0.12, diff --git a/assets/script/game/common/config/HeroAttrs.ts b/assets/script/game/common/config/HeroAttrs.ts index d2372612..b80fd213 100644 --- a/assets/script/game/common/config/HeroAttrs.ts +++ b/assets/script/game/common/config/HeroAttrs.ts @@ -40,6 +40,7 @@ export enum Attrs { puncture_dmg_bonus = "puncture_dmg_bonus", // 穿透后伤害增量(百分点;最终穿透系数 = PUNCTURE_DMG_RATIO * (1 + bonus/100)) wfuny = "wfuny", // 风怒 vulnerable_res = "vulnerable_res", // 易伤抗性(百分比减免易伤附加伤害) + paralyze_power = "paralyze_power", // 麻痹强化(百分点;提升麻痹对技能 CD 的减速量,累计达 100 则 CD 停止增长) } /** diff --git a/assets/script/game/hero/BuffManager.ts b/assets/script/game/hero/BuffManager.ts index 0ba00c4c..02eed424 100644 --- a/assets/script/game/hero/BuffManager.ts +++ b/assets/script/game/hero/BuffManager.ts @@ -110,7 +110,7 @@ class BuffManagerImpl { * 判断目标是否处于指定类型的控制状态下。 * 唯一判定来源:BuffComp 中是否存在对应 control_kind 的活跃控制 buff。 */ - hasControl(target: ecs.Entity, kind: 'frost' | 'stun'): boolean { + hasControl(target: ecs.Entity, kind: 'frost' | 'stun' | 'paralyze'): boolean { if (!target.has(BuffComp)) return false; const buffComp = target.get(BuffComp); for (const [buffId, layers] of buffComp.buffs) { diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index e7c73034..6d60d87d 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -13,6 +13,7 @@ import { buffManager } from "./BuffManager"; /** 控制类 buff 配置 id(对应 BuffList) */ const BUFF_ID_FROST = 7003; const BUFF_ID_STUN = 7004; +const BUFF_ID_PARALYZE = 7025; @ecs.register('HeroAttrs') export class HeroAttrsComp extends ecs.Comp { public debugMode: boolean = false; @@ -197,33 +198,39 @@ export class HeroAttrsComp extends ecs.Comp { buffManager.applyBuff(this.ent, BUFF_ID_FROST, 0, 0, { duration: FightSet.FROST_TIME * time }); } - /** 施加击晕:委托 buffManager 写入 BuffComp,并清零技能 CD */ + /** 施加击晕:委托 buffManager 写入 BuffComp,并削减技能 CD(持续期间 CD 停止增长) */ toStun(time: number = 1) { if (!this.ent) return; buffManager.applyBuff(this.ent, BUFF_ID_STUN, 0, 0, { duration: FightSet.STUN_TIME * time }); - // 击晕时 CD 清零 + // 击晕瞬间技能 CD 削减 STUN_CD_CUT%(保留剩余进度,不再清零) + const cutRate = 1 - FightSet.STUN_CD_CUT / 100; for (const key in this.skills) { const skill = this.skills[key]; if (skill) { - skill.ccd = 0; + skill.ccd = Math.max(0, skill.ccd * cutRate); } } } - updateCD(dt: number) { - // 如果处于冰冻状态,则技能 CD 暂停刷新 - if (this.isFrost()) return; + /** 施加麻痹:委托 buffManager 写入 BuffComp,麻痹期间技能 CD 增长减速 */ + toParalyze(time: number = 1) { + if (!this.ent) return; + buffManager.applyBuff(this.ent, BUFF_ID_PARALYZE, 0, 0, { duration: FightSet.PARALYZE_TIME * time }); + } - // 如果处于击晕状态,则技能 CD 暂停刷新(且保持清零状态) - if (this.isStun()) { - for (const key in this.skills) { - const skill = this.skills[key]; - if (skill) { - skill.ccd = 0; - } - } - return; + updateCD(dt: number) { + // 冰冻不影响 CD 值:冰冻状态下技能 CD 照常增长 + + // 击晕:CD 已在施加瞬间削减,击晕期间停止增长 + if (this.isStun()) return; + + // 麻痹:CD 增长减速 = 基础减速 + 麻痹强化;累计达 100% 则停止增长 + let cdRate = 1; + if (this.isParalyze()) { + const slowPct = Math.min(100, FightSet.PARALYZE_CD_SLOW + this.getFinalParalyzePower()); + cdRate = 1 - slowPct / 100; + if (cdRate <= 0) return; } for (const key in this.skills) { @@ -238,7 +245,7 @@ export class HeroAttrsComp extends ecs.Comp { skill.ccd = actualCd; continue; } - skill.ccd = Math.min(actualCd, skill.ccd + dt); + skill.ccd = Math.min(actualCd, skill.ccd + dt * cdRate); } } /** 是否处于冰冻状态(统一走 BuffComp 判定) */ @@ -249,6 +256,10 @@ export class HeroAttrsComp extends ecs.Comp { isStun(): boolean { return !!this.ent && buffManager.hasControl(this.ent, 'stun'); } + /** 是否处于麻痹状态(统一走 BuffComp 判定) */ + isParalyze(): boolean { + return !!this.ent && buffManager.hasControl(this.ent, 'paralyze'); + } getSkillLevel(skillId: number): number { if (!skillId) return 0; return this.skills[skillId]?.lv ?? 0; @@ -518,6 +529,12 @@ export class HeroAttrsComp extends ecs.Comp { return this.vulnerable_res + mods.flatSum + mods.pctSum; } + /** 最终麻痹强化 = 限时修饰(加法模型),提升麻痹对技能 CD 的减速量(百分点) */ + public getFinalParalyzePower(): number { + const mods = this.aggregateTimedMods(Attrs.paralyze_power); + return mods.flatSum + mods.pctSum; + } + /** 最终防御值 = 基础 + 限时修饰(加法模型),供除法递减减伤公式使用 */ public getFinalDefense(): number { const mods = this.aggregateTimedMods(Attrs.defense); diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 4c504beb..af809d37 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -250,9 +250,11 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const heroView = e.get(HeroViewComp); if (!heroAttrs || !heroView || !heroView.node) return; if (this.isOutOfBattleBounds(heroView.node.position.x)) return; - if (heroAttrs.is_dead || heroAttrs.is_reviving || heroAttrs.isFrost()) return; + if (heroAttrs.is_dead || heroAttrs.is_reviving) return; + // 冰冻不影响 CD 值:冰冻/击晕期间 CD 照常刷新(击晕内部停涨),但不允许施法 heroAttrs.updateCD(this.dt); heroView.cd_show(); + if (heroAttrs.isFrost() || heroAttrs.isStun()) return; const castPlan = this.pickCastSkill(heroAttrs, heroView); if (!this.hasCastTarget(castPlan)) return;