Files
pixelheros/assets/script/game/common/config/heroSet.ts
walkpan 3e84566f94 refactor(hero&monster): 统一使用dis字段获取攻击距离
移除HeroDisVal映射表,改为直接从实体组件读取配置的dis属性作为攻击距离,同时补全所有英雄和怪物配置中的dis字段
2026-05-18 09:29:22 +08:00

243 lines
13 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.
import { v3 } from "cc"
import { BoxSet, FacSet } from "./GameSet"
export enum HType {
Melee = 0,
Mid = 1,
Long = 2,
}
export const HTypeName ={
0:"近战",
1:"中程",
2:"远程",
}
/**
* 英雄攻击速度分级配置 (数值为攻击间隔cd越小越快)
*/
export enum AtkSpeedLv {
VeryFast1 = 1, VeryFast2 = 2,
Fast1 = 3, Fast2 = 4,
Normal1 = 5, Normal2 = 6,
Slow1 = 7, Slow2 = 8,
VerySlow1 = 9, VerySlow2 = 10,
}
export const AtkSpeedSet = {
[AtkSpeedLv.VeryFast1]: { name: "极速+", cd: 0.15 },
[AtkSpeedLv.VeryFast2]: { name: "极速", cd: 0.30 },
[AtkSpeedLv.Fast1]: { name: "快速+", cd: 0.50 },
[AtkSpeedLv.Fast2]: { name: "快速", cd: 0.70 },
[AtkSpeedLv.Normal1]: { name: "普通+", cd: 0.90 },
[AtkSpeedLv.Normal2]: { name: "普通", cd: 1.10 },
[AtkSpeedLv.Slow1]: { name: "慢+", cd: 1.50 },
[AtkSpeedLv.Slow2]: { name: "慢", cd: 1.80 },
[AtkSpeedLv.VerySlow1]: { name: "很慢+", cd: 2.30 },
[AtkSpeedLv.VerySlow2]: { name: "很慢", cd: 2.80 },
};
export const HeroPos={
0:{pos:v3(-320,BoxSet.GAME_LINE,0)},
1:{pos:v3(0,BoxSet.GAME_LINE,0)},
2:{pos:v3(0,BoxSet.GAME_LINE,0)},
}
export const FormationPointX = {
[HType.Melee]: -20,
[HType.Mid]: 100,
[HType.Long]: 100,
} as const;
export const HeroDisVal: Record<HType.Melee | HType.Mid | HType.Long, number> = {
[HType.Melee]: 120,
[HType.Mid]: 720,
[HType.Long]: 720,
}
export const resolveFormationTargetX = (fac: FacSet, type: HType): number => {
const resolvedRangeType = type as HType.Melee | HType.Mid | HType.Long;
const side = fac === FacSet.MON ? 1 : -1;
return FormationPointX[resolvedRangeType] * side;
}
export enum MonStart {
SLINE_1=140, //上线y
SLINE_2=100, //下线y
SLINE_3=180, //下线y
SLINE_4=60, //y起始点
START_X=320, //x起始点
START_I=90, //x轴间隔
}
/**
* 英雄/怪物基础信息接口
*/
export interface heroInfo {
uuid: number; // 唯一标识英雄5000段,怪物5200段
name: string; // 显示名称
icon?: string; // 图标名称(对应美术资源名)
path: string; // 资源路径(对应美术资源名)
fac: FacSet; // 阵营FacSet.HERO 或 FacSet.MON
kind?: number; // 未使用
lv: number; // 英雄等级
cards_lv?: number; // 卡片等级
type: HType; // 攻击定位(近战/中程/远程)
hp: number; // 生命值上限
ap: number; // 攻击力
call?:number[]; // 召唤后触发的技能uuid列表
dead?:number[]; // 死亡后触发的技能uuid列表
fstart?:number[]; // 战斗开始时释放的技能uuid列表
fend?:number[]; // 战斗结束时释放的技能uuid列表
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: 触发所需的受击次数
revive?:{s_uuid:number,r_num:number,upr:number};
dis: number; // 攻击距离(像素)
speed: number; // 移动速度(像素/秒)
skills: Record<number, HSkillInfo> ; // 携带技能ID列表
info: string; // 描述文案
}
/**
* 英雄/怪物基础信息接口
*/
export interface HSkillInfo {
uuid: number; // 唯一标识英雄5000段,怪物5200段
lv:number; // 技能等级
cd:number; // 技能cd
ccd:number; // 占位当前cd用于cd计时
}
/*
*=============英雄配置列表================
* 英雄规则设定
* 设定中的英雄都是1级,最高可以升级到3级不在列表内提现,升级在游戏内进行)
* skills[0]是普通攻击技能
* skills[1]是等级1时的技能,skills[2]是等级2时的技能,skills[3]是等级3时的技能,最多3级
*
* 属性基准(cards_lv:1,lv:1) SPEED:800, AP:30 | HP:300 | skills[0].cd = 1.0 (普通)
* 坦克(cards_lv:1,lv:1) SPEED:800, AP:25 | HP:450 | skills[0].cd = 2.3 或 2.8 (很慢+/很慢) - 突出沉重感与承伤定位
* 近战dps(cards_lv:1,lv:1) SPEED:800, AP:50 | HP:250 | skills[0].cd = 0.3 或 0.5 (极速/快速+) - 强化割草连击爽感
* 远程dps(cards_lv:1,lv:1) SPEED:800, AP:60 | HP:150 | skills[0].cd = 0.7 或 0.9 (快速/普通+) - 稳定持续的物理输出节奏
*远程法dps(cards_lv:1,lv:1) SPEED:800, AP:60 | HP:150 | skills[0].cd = 1.5 或 1.8 (慢+/慢) - 强调施法前摇与单发爆发
* 远程辅助(cards_lv:1,lv:1) SPEED:800, AP:20 | HP:150 | skills[0].cd = 1.1 (普通) - 贴近基准,动作不急不躁,侧重技能
*/
export const HeroInfo: Record<number, heroInfo> = {
// ========== 近战英雄 ==========
5001:{uuid:5001,name:"见习战士",path:"hk2", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:150,ap:25,speed:800,atking:[{s_uuid:6301,t_num:2}],
skills:{6001:{uuid:6001,lv:1,cd:1.5,ccd:0}},info:"近战,魔法盾 坦克"},
5002:{uuid:5002,name:"盾骑士",path:"hk1", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Melee,dis:120,hp:150,ap:75,speed:800,atked:[{s_uuid:6301,t_num:2}],
skills:{6001:{uuid:6001,lv:1,cd:1.5,ccd:0}},info:"近战,群体护盾 坦克"},
5003:{uuid:5003,name:"战士3",path:"hk3", fac:FacSet.HERO,cards_lv:2,lv:1,type:HType.Melee,dis:120,hp:100,ap:100,speed:800,
skills:{6001:{uuid:6001,lv:1,cd:1.5,ccd:0}},info:"近战,闪击 近战dps"},
5004:{uuid:5004,name:"战士4",path:"hk4", fac:FacSet.HERO,cards_lv:4,lv:1,type:HType.Melee,dis:120,hp:100,ap:200,speed:800,
skills:{6001:{uuid:6001,lv:1,cd:0.7,ccd:0}},info:"近战,火焰击 近战dps"},
5005:{uuid:5005,name:"战士5",path:"hk5", fac:FacSet.HERO,cards_lv:4,lv:1,type:HType.Melee,dis:120,hp:100,ap:200,speed:800,
skills:{6001:{uuid:6001,lv:1,cd:1.5,ccd:0}},info:"治疗近战,火焰击 近战dps"},
// ========== 法师英雄 ==========
5101:{uuid:5101,name:"奥术法师",path:"hm2", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:150,ap:60,speed:800,revive:{s_uuid:6501,r_num:1,upr:0.5},
skills:{6201:{uuid:6007,lv:1,cd:1,ccd:0}},info:"冰球,冰锥 远法dps"},
5102:{uuid:5102,name:"火焰法师",path:"hm1", fac:FacSet.HERO,cards_lv:2,lv:1,type:HType.Long,dis:720,hp:130,ap:120,speed:800,
skills:{6203:{uuid:6002,lv:1,cd:1,ccd:0}},info:"火击,火球 远法dps"},
5103:{uuid:5103,name:"冰法法师",path:"hm3", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Long,dis:720,hp:145,ap:180,speed:800,
skills:{6201:{uuid:6002,lv:1,cd:1,ccd:0}},info:"冰击,冰锥 远法dps"},
5104:{uuid:5104,name:"寒霜术士",path:"hm5", fac:FacSet.HERO,cards_lv:4,lv:1,type:HType.Long,dis:720,hp:160,ap:240,speed:800,
skills:{6201:{uuid:66002201,lv:1,cd:1,ccd:0}},info:"冰锥,冰刺 远法dps"},
5105:{uuid:5105,name:"炎爆法师",path:"hm4", fac:FacSet.HERO,cards_lv:5,lv:1,type:HType.Long,dis:720,hp:175,ap:300,speed:800,
skills:{6203:{uuid:6002,lv:1,cd:1,ccd:0}},info:"火球,陨石术 远法dps" },
// ========== 远程英雄 ==========
5201:{uuid:5201,name:"射手",path:"ha1", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:115,ap:60,speed:800,
skills:{6101:{uuid:6005,lv:1,cd:0.9,ccd:0}},info:"普通射击,暴射 远dps"},
5202:{uuid:5202,name:"游侠2",path:"ha2", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Long,dis:720,hp:145,ap:180,speed:800,
skills:{6011:{uuid:6005,lv:1,cd:0.9,ccd:0}},info:"暴射,光箭 远dps"},
5203:{uuid:5203,name:"游侠3",path:"ha3", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Long,dis:720,hp:145,ap:180,speed:800,
skills:{6011:{uuid:6005,lv:1,cd:0.9,ccd:0}},info:"暴射,光箭 远dps"},
5204:{uuid:5204,name:"游侠4",path:"ha4", fac:FacSet.HERO,cards_lv:3,lv:1,type:HType.Long,dis:720,hp:145,ap:180,speed:800,
skills:{6011:{uuid:6005,lv:1,cd:0.9,ccd:0}},info:"暴射,光箭 远dps"},
// ========== 辅助英雄 ==========
5301:{uuid:5301,name:"牧师",path:"hh1", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:115,ap:50,speed:800,atking:[{s_uuid:6302,t_num:2}],
skills:{6202:{uuid:6004,lv:1,cd:1.2,ccd:0}},info:"冰锥1,治疗 远辅助" },
5302:{uuid:5302,name:"医师",path:"hh2", fac:FacSet.HERO,cards_lv:2,lv:1,type:HType.Long,dis:720,hp:130,ap:50,speed:800,atking:[{s_uuid:6304,t_num:2}],
skills:{6202:{uuid:6004,lv:1,cd:1.2,ccd:0}},info:"冰锥1,群体治疗 远辅助"},
// ========== 辅助英雄 ==========
5401:{uuid:5401,name:"刺客1",path:"hc1", fac:FacSet.HERO,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:115,ap:50,speed:800,atking:[{s_uuid:6302,t_num:2}],
skills:{6202:{uuid:6004,lv:1,cd:1.2,ccd:0}},info:"冰锥1,治疗 远辅助" },
5402:{uuid:5402,name:"刺客2",path:"hc2", fac:FacSet.HERO,cards_lv:2,lv:1,type:HType.Long,dis:720,hp:130,ap:50,speed:800,atking:[{s_uuid:6304,t_num:2}],
skills:{6202:{uuid:6004,lv:1,cd:1.2,ccd:0}},info:"冰锥1,群体治疗 远辅助"},
/*
*=============怪物配置列表================
* 基础近战型(lv:1) SPEED:800 |AP:12 | HP:360 | skills[0].cd=0.65
* 重型坦克型(lv:1) SPEED:800 |AP:30 | HP:1050 | skills[0].cd=2
* 远程dps(lv:1) SPEED:800 |AP:45 | HP:240 | skills[0].cd=1.5
* 远程辅助(lv:1) SPEED:800 |AP:20 | HP:240 | skills[0].cd=1
* 精英 (lv:1) SPEED:800 |AP:20 | HP:4500 | skills[0].cd=1
*/
//============== 兽人系列 ===============
// 近战型
6001:{uuid:6001,name:"兽人战士",path:"mo1", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:360,ap:12,speed:100,
skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""},
6002:{uuid:6002,name:"兽人斥候",path:"mo3", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:360,ap:12,speed:100,
skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""},
6003:{uuid:6003,name:"兽人卫士",path:"mo4", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:1050,ap:30,speed:100,
skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0}},info:""},
6004:{uuid:6004,name:"兽人射手",path:"mo2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:240,ap:45,speed:100,
skills:{6001:{uuid:6101,lv:1,cd:1.5,ccd:0}},info:""},
6005:{uuid:6005,name:"兽人法师",path:"mo5", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:240,ap:20,speed:100,
skills:{6001:{uuid:6203,lv:1,cd:1.5,ccd:0}},info:""},
6006:{uuid:6006,name:"兽人首领",path:"mo6", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:4500,ap:20,speed:100,
skills:{6002:{uuid:6002,lv:1,cd:2,ccd:0}},info:""},
//============== 亡灵系列 ===============
// 近战型
6101:{uuid:6101,name:"亡灵战士",path:"mud1", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:360,ap:12,speed:100,
skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""},
6103:{uuid:6103,name:"亡灵斥候",path:"mud3", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:360,ap:12,speed:100,
skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""},
6102:{uuid:6102,name:"亡灵射手",path:"mud2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:240,ap:45,speed:100,
skills:{6001:{uuid:6101,lv:1,cd:1.5,ccd:0}},info:""},
// 6105:{uuid:6105,name:"兽人法师",path:"mud5", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:240,ap:20,speed:100,
// skills:{6001:{uuid:6001,lv:1,cd:1,ccd:0},6003:{uuid:6003,lv:1,cd:10,ccd:0}},info:""},
// 6. 精英/BOSS型
6104:{uuid:6104,name:"亡灵法师",path:"mud4", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:1050,ap:30,speed:100,
skills:{6204:{uuid:6204,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""},
6105:{uuid:6105,name:"亡灵首领",path:"mud5", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:4500,ap:20,speed:100,
skills:{6002:{uuid:6002,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""},
//============== 特殊类型 (Bomber, Summoner, Assassin, Splitter) ===============
6201:{uuid:6201,name:"哥布林自爆兵",path:"mo2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:180,ap:80,speed:150,
skills:{6001:{uuid:6001,lv:1,cd:1,ccd:0}},info:"自爆兵"},
6202:{uuid:6202,name:"骷髅自爆兵",path:"mud2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:180,ap:80,speed:150,
skills:{6001:{uuid:6001,lv:1,cd:1,ccd:0}},info:"自爆兵"},
6203:{uuid:6203,name:"深渊召唤师",path:"hm2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,dis:720,hp:300,ap:15,speed:80,
skills:{6001:{uuid:6203,lv:1,cd:2,ccd:0}},info:"召唤师"},
6204:{uuid:6204,name:"暗影刺客",path:"hc1", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:270,ap:55,speed:200,
skills:{6001:{uuid:6001,lv:1,cd:0.5,ccd:0}},info:"刺客"},
6205:{uuid:6205,name:"分裂软泥",path:"mo1", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:120,hp:450,ap:20,speed:90,
skills:{6001:{uuid:6001,lv:1,cd:1,ccd:0}},info:"分裂怪"},
};
export const HeroList: number[] = [
5001, 5002, 5003, 5004, 5005,
5101, 5102, 5103, 5104, 5105,
5201, 5202,5203,5204,
5301, 5302,
5401, 5402,
];