feat(skill): 支持技能参数自定义覆盖
本次修改实现同技能不同角色的差异化技能效果: 1. 新增SkillOverrides接口与mergeSkillParams工具函数,用于合并基础技能配置和角色覆盖参数 2. 更新英雄配置、属性组件、触发辅助系统与施法系统以适配该机制 3. 为盾骑士、医师添加示例差异化配置,验证功能可行性 4. 整理技能配置,删除冗余重复的旧技能条目 5. 新增技能重构设计计划文档,替换旧的迁移计划文档
This commit is contained in:
@@ -158,6 +158,31 @@ export interface SkillConfig {
|
||||
info:string, // 技能描述
|
||||
}
|
||||
|
||||
export interface SkillOverrides {
|
||||
TGroup?: TGroup;
|
||||
ap?: number;
|
||||
hit_count?: number;
|
||||
hitcd?: number;
|
||||
crt?: number;
|
||||
frz?: number;
|
||||
bck?: number;
|
||||
buffs?: BuffConf[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 将覆盖参数合并到基础技能配置中
|
||||
* @param config 基础技能配置
|
||||
* @param overrides 技能覆盖参数
|
||||
* @returns 合并后的新技能配置
|
||||
*/
|
||||
export function mergeSkillParams(config: SkillConfig, overrides?: SkillOverrides): SkillConfig {
|
||||
if (!overrides) return config;
|
||||
return {
|
||||
...config,
|
||||
...overrides
|
||||
};
|
||||
}
|
||||
|
||||
export const SkillUpList = {
|
||||
1001:{ap:0,hit_count:0,buff_ap:0,buff_hp:0,bck:0,frz:0,crt:0,num:0}
|
||||
}
|
||||
@@ -264,27 +289,12 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
6301:{
|
||||
uuid:6301,name:"护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_blue",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"为自己添加护盾,可抵挡3次伤害",
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"为伙伴/自己添加护盾,可抵挡3次伤害",
|
||||
},
|
||||
6302: {
|
||||
uuid:6302,name:"群体治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
|
||||
uuid:6302,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Heal,ap:300,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"为全体友方恢复攻击力300%的生命值",
|
||||
},
|
||||
6303:{
|
||||
uuid:6303,name:"强化护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_blue",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"为自己添加强化护盾,可抵挡3次伤害",
|
||||
},
|
||||
6304: {
|
||||
uuid:6304,name:"持续恢复",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Heal,ap:200,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"为全体友方持续恢复,共3次,每次恢复攻击力200%的生命值",
|
||||
},
|
||||
6305:{
|
||||
uuid:6305,name:"团队护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_blue",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Shield,ap:2,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"为全体友方添加护盾,每人可抵挡2次伤害,持续3次",
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"治疗伙伴/自己",
|
||||
},
|
||||
//==========================buff 技能=====================
|
||||
6401:{
|
||||
@@ -298,25 +308,10 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:20}],info:"全体友方最大生命值提升20点,持续1次",
|
||||
},
|
||||
6403:{
|
||||
uuid:6403,name:"全面强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
uuid:6403,name:"超能强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5},{buff:Attrs.hp_max,value:20}],info:"全体友方攻击力提升5点,最大生命值提升20点,持续1次",
|
||||
},
|
||||
6404:{
|
||||
uuid:6404,name:"持续攻击强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2}],info:"全体友方攻击力提升2点,持续3次",
|
||||
},
|
||||
6405:{
|
||||
uuid:6405,name:"持续生命强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:10}],info:"全体友方最大生命值提升10点,持续3次",
|
||||
},
|
||||
6406:{
|
||||
uuid:6406,name:"持续全面强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],info:"全体友方攻击力提升2点,最大生命值提升10点,持续3次",
|
||||
},
|
||||
6501:{
|
||||
uuid:6501,name:"复活",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_ap",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:50,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { v3 } from "cc"
|
||||
import { BoxSet, FacSet } from "./GameSet"
|
||||
import { SkillOverrides, TGroup } from "./SkillSet"
|
||||
|
||||
export enum HType {
|
||||
Melee = 0,
|
||||
@@ -87,27 +88,28 @@ export interface heroInfo {
|
||||
type: HType; // 攻击定位(近战/中程/远程)
|
||||
hp: number; // 生命值上限
|
||||
ap: number; // 攻击力
|
||||
call?:number[]; // 召唤后触发的技能uuid列表
|
||||
dead?:number[]; // 死亡后触发的技能uuid列表
|
||||
fstart?:number[]; // 战斗开始时释放的技能uuid列表
|
||||
fend?:number[]; // 战斗结束时释放的技能uuid列表
|
||||
call?:{s_uuid:number, t_num:number, overrides?: SkillOverrides}[]; // 召唤后触发的技能配置
|
||||
dead?:{s_uuid:number, t_num:number, overrides?: SkillOverrides}[]; // 死亡后触发的技能配置
|
||||
fstart?:{s_uuid:number, t_num:number, overrides?: SkillOverrides}[]; // 战斗开始时释放的技能配置
|
||||
fend?:{s_uuid:number, t_num:number, overrides?: SkillOverrides}[]; // 战斗结束时释放的技能配置
|
||||
field?:number[]; // 驻场技能uuid列表,英雄在场时对全局生效
|
||||
atking?:{s_uuid:number, t_num:number}[]; // 普通攻击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的普攻次数
|
||||
atked?:{s_uuid:number, t_num:number}[]; // 受击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的受击次数
|
||||
atking?:{s_uuid:number, t_num:number, overrides?: SkillOverrides}[]; // 普通攻击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的普攻次数
|
||||
atked?:{s_uuid:number, t_num:number, overrides?: SkillOverrides}[]; // 受击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的受击次数
|
||||
revive?:{s_uuid:number,r_num:number,upr:number}; // 复活技能配置,s_uuid: 技能id, r_num: 触发所需的复活次数, upr 等级对复活次数的影响
|
||||
dis?: number; // 攻击距离(像素)
|
||||
dis?: number; // 攻击距离(像素)
|
||||
speed?: number; // 移动速度(像素/秒)
|
||||
skills: Record<number, HSkillInfo> ; // 携带技能ID列表
|
||||
info: string; // 描述文案
|
||||
}
|
||||
/**
|
||||
* 英雄/怪物基础信息接口
|
||||
* 技能基础信息接口
|
||||
*/
|
||||
export interface HSkillInfo {
|
||||
uuid: number; // 唯一标识(英雄5000段,怪物5200段)
|
||||
uuid: number; // 唯一标识(技能6000段等)
|
||||
lv:number; // 技能等级
|
||||
cd:number; // 技能cd
|
||||
ccd:number; // 占位当前cd,用于cd计时
|
||||
overrides?: SkillOverrides; // 角色专属参数覆盖
|
||||
}
|
||||
/*
|
||||
*=============英雄配置列表================
|
||||
@@ -132,9 +134,9 @@ export interface HSkillInfo {
|
||||
export const HeroInfo: Record<number, heroInfo> = {
|
||||
// ========== 近战英雄 ==========
|
||||
5001:{uuid:5001,name:"见习战士",path:"hk2", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Melee,hp:150,ap:25,
|
||||
skills:{6002:{uuid:6002,lv:1,cd:1.5,ccd:0}},atking:[{s_uuid:6301,t_num:2}],info:" "},
|
||||
5002:{uuid:5002,name:"盾骑士",path:"hk1", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Melee,hp:150,ap:75,
|
||||
skills:{6002:{uuid:6002,lv:1,cd:1.5,ccd:0}},atked:[{s_uuid:6301,t_num:2}],info:" "},
|
||||
5002:{uuid:5002,name:"盾骑士",path:"hk1", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Melee,hp:150,ap:75,
|
||||
skills:{6002:{uuid:6002,lv:1,cd:1.5,ccd:0}},atked:[{s_uuid:6301,t_num:2,overrides:{TGroup:TGroup.Team,ap:2,hit_count:3}}],info:" "},
|
||||
5003:{uuid:5003,name:"战士3",path:"hk3", fac:FacSet.HERO,cards_lv:2,lv:1,type:HType.Melee,hp:100,ap:100,
|
||||
skills:{6002:{uuid:6002,lv:1,cd:1.5,ccd:0}},info:" "},
|
||||
5004:{uuid:5004,name:"战士4",path:"hk4", fac:FacSet.HERO,cards_lv:4,lv:1,type:HType.Melee,hp:100,ap:200,
|
||||
@@ -169,7 +171,7 @@ export const HeroInfo: Record<number, heroInfo> = {
|
||||
5301:{uuid:5301,name:"牧师",path:"hh1", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Long,hp:115,ap:50,
|
||||
skills:{6004:{uuid:6004,lv:1,cd:1.2,ccd:0}},atking:[{s_uuid:6302,t_num:2}],info:"" },
|
||||
5302:{uuid:5302,name:"医师",path:"hh2", fac:FacSet.HERO,cards_lv:2,lv:1,type:HType.Long,hp:130,ap:50,
|
||||
skills:{6004:{uuid:6004,lv:1,cd:1.2,ccd:0}}, atking:[{s_uuid:6304,t_num:2}],info:""},
|
||||
skills:{6004:{uuid:6004,lv:1,cd:1.2,ccd:0}}, atking:[{s_uuid:6302,t_num:2,overrides:{hit_count:3,ap:200}}],info:""},
|
||||
|
||||
// ========== 辅助英雄 ==========
|
||||
5401:{uuid:5401,name:"刺客1",path:"hc1", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Long,hp:115,ap:50,
|
||||
|
||||
Reference in New Issue
Block a user