From ab8bb01deeabd0f3890c029f667dc4e0b60cd5c1 Mon Sep 17 00:00:00 2001 From: walkpan Date: Tue, 18 Nov 2025 13:44:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=85=8D=E7=BD=AE):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E8=8B=B1=E9=9B=84=E5=B1=9E=E6=80=A7=E5=92=8C=E5=A4=A9?= =?UTF-8?q?=E8=B5=8B=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将HeroAttrs中的KNOCKBACK和CHAIN_CHANCE重命名为BACK_CHANCE和SILENCE_CHANCE以保持命名一致性 - 简化TalSet.ts中的天赋配置接口,移除冗余字段并优化结构 - 添加新的天赋配置示例 --- assets/script/game/common/config/HeroAttrs.ts | 8 ++-- assets/script/game/common/config/TalSet.ts | 40 ++++++++----------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/assets/script/game/common/config/HeroAttrs.ts b/assets/script/game/common/config/HeroAttrs.ts index a5a50df0..818022b5 100644 --- a/assets/script/game/common/config/HeroAttrs.ts +++ b/assets/script/game/common/config/HeroAttrs.ts @@ -87,10 +87,10 @@ export enum Attrs { FREEZE_CHANCE = 52, // 冰冻概率 BURN_CHANCE = 53, // 燃烧概率 STUN_CHANCE = 54, // 眩晕概率 - KNOCKBACK = 55, // 击退概率 + BACK_CHANCE = 55, // 击退概率 SLOW_CHANCE = 56, // 减速概率 POISON_CHANCE = 57, // 中毒概率 - CHAIN_CHANCE = 58, // 连锁概率 + SILENCE_CHANCE = 58, // 沉默概率 EXPLOSION_CHANCE = 59, // 爆炸概率 // ========== 增益效果属性 (60-69) ========== @@ -199,10 +199,10 @@ export const AttrsType: Record = { [Attrs.FREEZE_CHANCE]: BType.RATIO, // 冰冻概率 - 百分比型 [Attrs.BURN_CHANCE]: BType.RATIO, // 燃烧概率 - 百分比型 [Attrs.STUN_CHANCE]: BType.RATIO, // 眩晕概率 - 百分比型 - [Attrs.KNOCKBACK]: BType.RATIO, // 击退 - 百分比型 + [Attrs.BACK_CHANCE]: BType.RATIO, // 击退概率 - 百分比型 [Attrs.SLOW_CHANCE]: BType.RATIO, // 减速概率 - 百分比型 [Attrs.POISON_CHANCE]: BType.RATIO, // 中毒概率 - 百分比型 - [Attrs.CHAIN_CHANCE]: BType.RATIO, // 连锁概率 - 百分比型 + [Attrs.SILENCE_CHANCE]: BType.RATIO, // 沉默概率 - 百分比型 [Attrs.EXPLOSION_CHANCE]: BType.RATIO, // 爆炸概率 - 百分比型 // ========== 增益效果属性(百分比型) ========== diff --git a/assets/script/game/common/config/TalSet.ts b/assets/script/game/common/config/TalSet.ts index e3c32ad7..bd4a86eb 100644 --- a/assets/script/game/common/config/TalSet.ts +++ b/assets/script/game/common/config/TalSet.ts @@ -1,13 +1,5 @@ -/** - * 天赋系统配置文件 - * 支持定义英雄的特殊能力或特性 - */ - -import * as exp from "constants"; -import { Attrs, BType } from "./HeroAttrs"; -import { SkillSet } from "./SkillSet"; - -// ========== 枚举定义 ========== +import { count } from "console"; +import { Attrs } from "./HeroAttrs"; /** * 天赋类型枚举,也是触发条件 @@ -50,11 +42,18 @@ export enum TalEffet { N_SKILL=5, // 下n次技能攻击 需要特殊处理 } -export enum TalTager { +export enum TalTarget { SELF = 1, // 自己触发 ENEMY = 2, // 敌人触发 } +export enum TalAttrs { + FREEZE_CHANCE=Attrs.FREEZE_CHANCE, // 冰冻概率 + STUN_CHANCE=Attrs.STUN_CHANCE, // 冰冻概率 + BACK_CHANCE=Attrs.BACK_CHANCE, // 击退概率 + SILENCE_CHANCE=Attrs.SILENCE_CHANCE, // 沉默概率 + CRITICAL=Attrs.CRITICAL, // 暴击率 +} /** * 天赋配置接口 * 定义一个完整的天赋效果 @@ -63,18 +62,13 @@ export enum TalTager { export interface ItalConf { uuid: number; // 天赋ID name: string; // 天赋名称 - desc: string; // 天赋描述(说明触发条件和效果) type: TalType; - triggerType: TalEType; // 触发效果类型 - chance: number; // 触发概率,默认100,`0-100`之间的数字 - t_value: number; // 触发的阈值(如5级触发一次, 5次攻击触发一次,初始触发) - e_value: number; // 触发的效果值(如增加10%攻击力, 触发的技能uuid,增加1个技能uuid) - e_name: number; // 触发的特殊值,如具体属性类型, 0表示没有特定值,对应Attrs枚举 - e_type: BType; // 效果类型, 主要针对属性修改,是百分比还是固定值 - e_scaling: number; // 效果随等级缩放系数,默认1, 0.5表示效果随等级减半 - e_count: number; // 触发效果的累计次数(如触发2次技能实现召唤2个召唤物) - stackable?: boolean; // 是否可堆叠效果(默认true) - maxStack?: number; // 最大堆叠次数(不设置表示无限制) + target: TalTarget; + effet: TalEffet; + value: number; // 触发的效果值(如增加10%攻击力, 触发的技能uuid,增加1个技能uuid) + attrs:TalAttrs //触发的 + Trigger:number //触发值 + desc: string; // 天赋描述(说明触发条件和效果) } // ========== 天赋配置表 ========== @@ -94,7 +88,7 @@ export interface ItalConf { * 4. 技能触发类:当特定条件满足时自动触发指定技能 */ export const talConf: Record = { - + 7001:{uuid:7001,name:"风怒",type:TalType.ATK_3,target:TalTarget.ENEMY,effet:TalEffet.DMG,value:150,Trigger:3,desc:"普通攻击3次后, 给于目标150%的伤害"}, };