Files
pixelheros/assets/script/game/common/config/SkillSet.ts
panw d2fbac11cd feat(技能): 为技能配置添加额外属性字段并应用到技能实例
在 SkillConfig 接口中新增暴击率、冰冻概率等六个可选属性字段,用于技能配置时提供额外加成。
在 Skill 类中,读取这些配置字段并累加到施法者基础属性上,影响技能的实际效果。
2026-03-18 10:13:50 +08:00

388 lines
18 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ========== 从 HeroAttrs.ts 导入属性相关定义 ==========
import { Attrs,BType } from "./HeroAttrs";
export enum HSSet {
atk = 0, // 普通攻击
skill = 1, // 一般技能
max = 2, // 必杀技
}
export enum TGroup {
Self = 0, // 自身
Ally = 1, // 所有敌人
Team = 2, // 所有友方
Enemy = 3, // 敌方单位
All = 4 // 所有单位
}
export enum TType {
/** 前排目标(最靠近敌方阵营的单位) */
Frontline = 1, // 最前排单位
/** 后排目标(离敌方阵营最远的单位) */
Backline = 2, // 最后排单位
/** 生命值最低的目标 */
LowestHP = 3, // 最低生命值
/** 生命值最高的目标 */
HighestHP = 4, // 最高生命值
/** 攻击力最高的目标 */
HighestAP = 9, // 最高攻击力
/** 近战职业目标 */
Melee =5, // 近战职业
/** 远程职业目标 */
Ranged =6, // 远程职业
/** 辅助职业目标 */
SupportClass =7, // 辅助职业
/** 随机目标 */
Random =8 // 随机目标
}
export enum DTType {
single = 0,
range = 1,
}
export enum SkillKind {
Damage = 0,
Heal = 1,
Shield = 2,
Support = 3
}
export enum BuffRunType {
Permanent = 0,
Timed = 1,
Interval = 2
}
//受伤动画名称
export enum AtkedName {
atked = "atked",
ice = "atked_ice",
fire = "atked_fire",
wind = "atked_wind",
crit = "atked_crit",
}
export enum RType {
linear = 0, //直线
bezier = 1, //贝塞尔
fixed = 2, //固定起点
fixedEnd = 3, //固定终点
}
//EType 只负责动画什么时候结束,碰撞体什么时候消失不管,但是消失前一定要关闭碰撞体
export enum EType {
animationEnd = 0, //碰撞够也不消失,动画结束才消失
timeEnd = 1, //碰撞够也不消失,时间到才消失
distanceEnd = 2, //碰撞够也不消失,距离到才消失
collision = 3, //碰撞次数够就消失
}
//debuff类型
/*
=== 技能配置系统使用说明 ===
1. 基础属性:
- uuid: 技能唯一ID
- name: 技能名称
- sp_name: 特效名称
- AtkedName: 攻击类型
- path: 图片资源路径
2. 目标和效果:
- TGroup: 目标群体 (敌方、友方等)
- SType: 技能类型 (伤害、治疗、护盾等)
3. 执行参数:
- act: 角色执行的动画
- DTType: 伤害类型 (单体、范围)
- EType: 结束条件
- fname: 特效文件名
- with: 暂时无用
4. 数值参数:
- ap: 攻击力百分比
- cd: 冷却时间
- hit_count: 可命中次数
- t_num: 目标数量
- hitcd: 持续伤害的伤害间隔
- speed: 移动速度
- cost: 消耗值
*/
export enum DType {
ATK= 0, // 物理
ICE=1, // 冰元素
FIRE=2, // 火元素
WIND=3, // 风元素
}
export const HeroSkillList = [6001,6001,6001,6001,6001,6001]
// Debuff配置接口
export interface BuffConf {
uuid:number; // Buff唯一ID
name?:string; // Buff名称
icon?:string; // Buff图标
buff:Attrs;
BType:BType
value:number; // 效果值
time:number; // 持续时间
chance:number; // 触发概率
info?:string; // 描述
isDebuff?:boolean; // 是否为负面效果
runType?:BuffRunType;
interval?:number;
}
interface IReady {
uuid:number,
loop: boolean,
SkillTime: number,// 技能控制存续时间时间
ReadyTime: number,// 技能前摇时间
RType: number, //技能运行类型 0-线性 1-贝塞尔 2-开始位置固定 3-目标位置固定
ready_y: number,
path:string,
}
interface IEndAnm {
uuid:number,
path:string,
loop:boolean,
time:number,
}
// 技能配置接口 - 按照6001格式排列
export interface SkillConfig {
uuid:number, // 技能唯一ID
name:string, // 技能名称
sp_name:string, // 特效名称
icon:string, // 图标ID
TGroup:TGroup, // 目标群体(敌方/友方/自身等)
TType:TType, // 目标类型
act:string, // 角色执行的动画
DTType:DTType, // 伤害类型(单体/范围)
ap:number, // 攻击百分比(角色攻击力)
hit_count:number, // 可命中次数
hitcd:number, // 持续伤害的伤害间隔(秒)
speed:number, // 移动速度
with:number, // 宽度(暂时无用)
ready:number, // 前摇时间
readyAnm:string, // 前摇动画名称
endAnm:string, // 结束动画名称
EAnm:number, // 结束动画ID
DAnm:number, // 命中后动画ID
RType:RType, // 技能运行类型(直线/贝塞尔/固定起点/固定终点)
EType:EType, // 结束条件(动画结束/时间结束/距离结束/碰撞/次数结束)
time?:number, // timeEnd 持续时间(秒)
kind?:SkillKind, // 主效果类型
crt?:number, // 额外暴击率
frz?:number, // 额外冰冻概率
stn?:number, // 额外眩晕概率
bck?:number, // 额外击退概率
slw?:number, // 额外减速概率
pct?:number, // 额外穿刺次数
buffs:number[], // 对施法者的buff配置列表(Buff UUID 列表)
debuffs:number[], // 对目标的debuff配置列表(Buff UUID 列表)
call_hero?:number, // 召唤技能召唤英雄id(可选)
info:string, // 技能描述
}
export const SkillSet: Record<number, SkillConfig> = {
// ========== 基础攻击 ========== 6001-6099
6001: {
uuid:6001,name:"空挥",sp_name:"atk_s1",icon:"1026",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
buffs:[],debuffs:[],info:"对前方目标造成100%攻击的伤害",
},
6002: {
uuid:6002,name:"电击",sp_name:"atk_s4",icon:"1173",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"max",DTType:DTType.single,
ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方目标造成150%攻击的伤害",
},
6003: {
uuid:6003,name:"闪击",sp_name:"atk_s3",icon:"1173",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"max",DTType:DTType.single,
ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
buffs:[],debuffs:[],info:"对前方目标造成150%攻击的伤害",
},
6004: {
uuid:6004,name:"火焰击",sp_name:"atk_f2",icon:"1173",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"max",DTType:DTType.single,
ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
buffs:[],debuffs:[],info:"对前方目标造成150%攻击的伤害",
},
6005: {
uuid:6005,name:"蓝箭",sp_name:"arrow_blue",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6006: {
uuid:6006,name:"绿箭",sp_name:"arrow_green",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6007: {
uuid:6007,name:"红箭",sp_name:"arrow_red",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6008: {
uuid:6008,name:"光箭",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.animationEnd,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6009: {
uuid:6009,name:"冰球",sp_name:"ball_ice",icon:"1126",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:2,hitcd:0.3,speed:720,with:90,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6010: {
uuid:6010,name:"冰锥",sp_name:"ball_forst",icon:"1126",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:2,hitcd:0.3,speed:720,with:90,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6011: {
uuid:6011,name:"火球",sp_name:"ball_fire",icon:"1126",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:2,hitcd:0.3,speed:720,with:90,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6012: {
uuid:6012,name:"光波",sp_name:"ball_guang",icon:"1126",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:2,hitcd:0.3,speed:720,with:90,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6013: {
uuid:6013,name:"半月波",sp_name:"ball_light",icon:"1126",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:2,hitcd:0.3,speed:720,with:90,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
6014: {
uuid:6014,name:"月波",sp_name:"ball_gquan",icon:"1126",TGroup:TGroup.Enemy,TType:TType.Frontline,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:100,hit_count:2,hitcd:0.3,speed:720,with:90,
ready:0,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision,
buffs:[],debuffs:[],info:"对前方单个目标造成100%攻击的伤害",
},
//============================= ====== 基础buff ====== ========================== 6100-6199
6100:{
uuid:6100,name:"魔法盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,TType:TType.LowestHP,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:30,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
kind:SkillKind.Shield,buffs:[],debuffs:[],info:"获得30%最大生命值的护盾,持续60秒",
},
6101: {
uuid:6101,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Self,TType:TType.LowestHP,readyAnm:"",endAnm:"",act:"atk",DTType:DTType.single,
ap:30,hit_count:1,hitcd:0.2,speed:720,with:0,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
kind:SkillKind.Heal,buffs:[],debuffs:[],info:"治疗自己,回复30%最大生命值",
},
// ========== 怪物基础技能 ========== 6200-6299
6201: {
uuid:6201, name:"怪物近战", sp_name:"atk_s1", icon:"3036",
TGroup:TGroup.Enemy, TType:TType.Frontline, readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,
ap:100, hit_count:1, hitcd:0.2, speed:0, with:0, // 怪物近战特殊距离
ready:0, EAnm:0, DAnm:9001, RType:RType.fixed, EType:EType.animationEnd,
buffs:[], debuffs:[], info:"怪物基础近战攻击",
},
6203: {
uuid:6203, name:"怪物射击", sp_name:"arrow_1", icon:"3039",
TGroup:TGroup.Enemy, TType:TType.Frontline, readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,
ap:80, hit_count:1, hitcd:0.2, speed:800, with:0, // 怪物远程特殊距离
ready:0, EAnm:0, DAnm:9001, RType:RType.linear, EType:EType.collision,
buffs:[], debuffs:[], info:"怪物基础远程攻击",
},
};
export const SkillReadyConf: Record<number, IReady> = {
0:{uuid:0,loop:false,SkillTime:0,ReadyTime:0,RType:0,ready_y:0,path:""}, // 无前摇
8001:{uuid:8001,loop:false,SkillTime:0,ReadyTime:0,RType:0,ready_y:0,path:"fire1"},
};
//技能结束动画EAnm 和集中后动画DAnm, 共用设定数组
export const EAnmConf: Record<number, IEndAnm> = {
0:{uuid:0,path:"",loop:false,time:0}, // 无结束动画
9001:{uuid:9001,path:"atked",loop:false,time:0},
};
export const CanSelectSkills: Record<number, number[]> = {
1: [6002],
2: [6004],
3: [6003],
4: [6100],
// 默认
99: [6002, 6004, 6003, 6100]
};
// ==================== 预定义 Buff 列表 ====================
// 使用 ID 作为 Key方便在技能配置中引用或作为模板
export const BuffsList: Record<number, BuffConf> = {
// ========== 攻击类增益 ========== 10001 - 10099
// 攻击力提升 (固定值)
10001: { uuid: 10001, name: "攻击提升", icon: "10001", buff: Attrs.ap, BType: BType.VALUE, value: 10, time: 5, chance: 1, info: "攻击力+10" },
10002: { uuid: 10002, name: "攻击提升", icon: "10002", buff: Attrs.ap, BType: BType.VALUE, value: 50, time: 5, chance: 1, info: "攻击力+50" },
// 攻击力提升 (百分比)
10011: { uuid: 10011, name: "攻击提升", icon: "10011", buff: Attrs.ap, BType: BType.RATIO, value: 10, time: 5, chance: 1, info: "攻击力+10%" },
10012: { uuid: 10012, name: "攻击提升", icon: "10012", buff: Attrs.ap, BType: BType.RATIO, value: 20, time: 10, chance: 1, info: "攻击力+20%" },
// 暴击率提升 (固定值)
10021: { uuid: 10021, name: "暴击提升", icon: "10021", buff: Attrs.critical, BType: BType.VALUE, value: 10, time: 5, chance: 1, info: "暴击率+10%" },
10022: { uuid: 10022, name: "暴击提升", icon: "10022", buff: Attrs.critical, BType: BType.VALUE, value: 20, time: 5, chance: 1, info: "暴击率+20%" },
// 暴击伤害提升
10031: { uuid: 10031, name: "爆伤提升", icon: "10031", buff: Attrs.critical_dmg, BType: BType.VALUE, value: 50, time: 5, chance: 1, info: "暴击伤害+50%" },
// 穿刺次数提升
10041: { uuid: 10041, name: "穿刺提升", icon: "10041", buff: Attrs.puncture, BType: BType.VALUE, value: 1, time: 10, chance: 1, info: "穿刺次数+1" },
// ========== 生存类增益 ========== 10100 - 10199
// 生命值上限提升 (百分比)
10101: { uuid: 10101, name: "生命上限提升", icon: "10101", buff: Attrs.hp_max, BType: BType.RATIO, value: 20, time: 10, chance: 1, info: "生命上限+20%" },
// 移动速度提升 (固定值)
10111: { uuid: 10111, name: "移速提升", icon: "10111", buff: Attrs.speed, BType: BType.VALUE, value: 50, time: 5, chance: 1, info: "移速+50" },
10112: { uuid: 10112, name: "移速提升", icon: "10112", buff: Attrs.speed, BType: BType.VALUE, value: 100, time: 5, chance: 1, info: "移速+100" },
// 护盾 (固定值)
10121: { uuid: 10121, name: "护盾", icon: "10121", buff: Attrs.shield, BType: BType.VALUE, value: 100, time: 10, chance: 1, info: "护盾+100" },
// ========== 治疗与护盾 (转换自原 SType) ========== 10300 - 10399
// 治疗 (基于攻击力百分比)
10301: { uuid: 10301, name: "治疗", icon: "1292", buff: Attrs.hp, BType: BType.RATIO, value: 30, time: 0, chance: 1, runType: BuffRunType.Permanent, info: "回复30%最大生命值" },
// 护盾 (基于攻击力百分比)
10302: { uuid: 10302, name: "护盾", icon: "1255", buff: Attrs.shield, BType: BType.RATIO, value: 30, time: 0, chance: 1, runType: BuffRunType.Permanent, info: "获得30%最大生命值护盾" },
10311: { uuid: 10311, name: "持续治疗", icon: "1292", buff: Attrs.hp, BType: BType.RATIO, value: 5, time: 5, interval: 1, chance: 1, runType: BuffRunType.Interval, info: "每秒回复5%最大生命值持续5秒" },
10312: { uuid: 10312, name: "流血", icon: "10211", buff: Attrs.hp, BType: BType.RATIO, value: -4, time: 5, interval: 1, chance: 1, isDebuff: true, runType: BuffRunType.Interval, info: "每秒损失4%最大生命值持续5秒" },
// ========== 减益类 Buff (属性降低) ========== 10200 - 10299
// 减速 (移动速度降低)
10201: { uuid: 10201, name: "减速", icon: "10201", buff: Attrs.speed, BType: BType.VALUE, value: -50, time: 3, chance: 1, info: "移速-50", isDebuff: true },
// 虚弱 (攻击力降低)
10211: { uuid: 10211, name: "虚弱", icon: "10211", buff: Attrs.ap, BType: BType.RATIO, value: -20, time: 5, chance: 1, info: "攻击力-20%", isDebuff: true },
// ========== 状态控制类 (Debuff) ========== 20000 - 20099
// 冰冻
20001: { uuid: 20001, name: "冰冻", icon: "20001", buff: Attrs.IN_FROST, BType: BType.BOOLEAN, value: 1, time: 1, chance: 1, info: "冰冻1秒", isDebuff: true },
20002: { uuid: 20002, name: "冰冻", icon: "20002", buff: Attrs.IN_FROST, BType: BType.BOOLEAN, value: 1, time: 2, chance: 1, info: "冰冻2秒", isDebuff: true },
// 眩晕
20011: { uuid: 20011, name: "眩晕", icon: "20011", buff: Attrs.IN_STUN, BType: BType.BOOLEAN, value: 1, time: 1, chance: 1, info: "眩晕1秒", isDebuff: true },
20012: { uuid: 20012, name: "眩晕", icon: "20012", buff: Attrs.IN_STUN, BType: BType.BOOLEAN, value: 1, time: 2, chance: 1, info: "眩晕2秒", isDebuff: true },
};