import { v3 } from "cc" import { BoxSet, FacSet } from "./GameSet" import { smc } from "../SingletonModuleComp" export enum AttrSet { ATTR_MAX = 85, } export enum HType { Melee = 0, Mid = 1, Long = 2, } export const HTypeName ={ 0:"近战", 1:"中程", 2:"远程", } //fac:FacSet.HERO export const getHeroList = ()=>{ const filteredHeros = Object.values(HeroInfo).filter(item=>{ const facMatch = item.fac === FacSet.HERO; return facMatch; }); // 根据smc.heros中的数据分离拥有和未拥有的英雄 // smc.heros是一个包含英雄ID的数组,如[5001, 5002] const ownedHeros = filteredHeros.filter(item => smc.heros.includes(item.uuid)); const unownedHeros = filteredHeros.filter(item => !smc.heros.includes(item.uuid)); // 合并列表:拥有的在前,未拥有的在后 return [...ownedHeros, ...unownedHeros].map(item => item.uuid); } //fac:FacSet.MON export const getMonList = ()=>{ return Object.values(HeroInfo).filter(item=>{ const facMatch = item.fac === FacSet.MON; return facMatch ; }).map(item=>item.uuid) } 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]: 0, [HType.Mid]: 100, [HType.Long]: 180, } as const; export const HeroDisVal: Record = { [HType.Melee]: 150, [HType.Mid]: 400, [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 const MonSet = { 0:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 1:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, 2:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 3:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, 4:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 5:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, 6:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 7:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, 8:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 9:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, 10:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 11:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, } 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 enum HeroConf{ COST=0, MAX_HP=500, MAX_MP=100, MAX_AP=200, MAX_DEF=100, } export const getPreAttr = (uuid:number)=>{ let hp=HeroInfo[uuid].hp/HeroConf.MAX_HP let ap=HeroInfo[uuid].ap/HeroConf.MAX_AP return {hp:hp,ap:ap,} } export enum HRegen { HP=0.5 } /** * 不同职业升级属性加成配置 * 战士:高血量成长,低攻击成长 * 远程:低血量成长,高攻击成长 * 法师:低血量成长,高攻击成长 * 辅助:中血量成长,中攻击成长 * 刺客:极低血量成长,极高攻击成长 */ export const JobUpConf: Record = { [HType.Melee]: { hp: 50, ap: 5, def: 2 }, [HType.Mid]: { hp: 30, ap: 6, def: 1 }, [HType.Long]: { hp: 25, ap: 7, def: 1 }, }; /** * 英雄/怪物基础信息接口 */ export interface heroInfo { uuid: number; // 唯一标识(英雄5000段,怪物5200段) name: string; // 显示名称 icon: string; // 图标名称(对应美术资源名) path: string; // 资源路径(对应美术资源名) fac: FacSet; // 阵营(FacSet.HERO 或 FacSet.MON) kind: number; // 未使用 as: number; // 攻击间隔(越小越快) ss:number; // 技能间隔 type: HType; // 攻击定位(近战/中程/远程) lv: number; // 初始等级 hp: number; // 生命值上限 ap: number; // 攻击力 // dis: number; // 攻击距离(像素) speed: number; // 移动速度(像素/秒) skills: number[]; // 携带技能ID列表 info: string; // 描述文案 } export const CanSelectHeros: Record = { 1: [5001, 5002], 2: [5003], 3: [5004], 4: [5005], 5: [5006], 6: [5007], // 默认全开(或根据需要留空) 99: [5001, 5002, 5003, 5004, 5005, 5006, 5007] }; export const HeroInfo: Record = { // ========== 英雄角色 ========== 5001:{uuid:5001,name:"盾战士",icon:"1001",path:"hk1", fac:FacSet.HERO, kind:1,as:1,ss:5, type:HType.Melee,lv:1,hp:300,ap:25,speed:120,skills:[6001,6004],info:"盾战士"}, 5002:{uuid:5002,name:"奥术法师",icon:"1001",path:"hm2", fac:FacSet.HERO, kind:2,as:1,ss:5, type:HType.Long,lv:1,hp:150,ap:40,speed:95,skills:[6003,6101],info:"奥术法师"}, 5003:{uuid:5003,name:"射手",icon:"1001",path:"ha1", fac:FacSet.HERO, kind:2,as:1,ss:5, type:HType.Long,lv:1,hp:180,ap:30,speed:140,skills:[6005,6008],info:"射手"}, 5005:{uuid:5005,name:"牧师",icon:"1001",path:"hh1", fac:FacSet.HERO, kind:2,as:1,ss:5, type:HType.Long,lv:1,hp:160,ap:25,speed:100,skills:[6003,6100],info:"牧师"}, 5004:{uuid:5004,name:"火焰法师",icon:"1001",path:"hm1", fac:FacSet.HERO, kind:2,as:1,ss:5, type:HType.Long,lv:1,hp:150,ap:45,speed:90,skills:[6003,6101],info:"火焰法师"}, 5006:{uuid:5006,name:"召唤法师",icon:"1001",path:"hz1", fac:FacSet.HERO, kind:2,as:1,ss:5, type:HType.Long,lv:1,hp:200,ap:20,speed:105,skills:[6003,6101],info:"召唤法师"}, 5007:{uuid:5007,name:"刺客",icon:"1001",path:"hc1", fac:FacSet.HERO, kind:1,as:1,ss:5, type:HType.Melee,lv:1,hp:140,ap:50,speed:180,skills:[6001,6004],info:"刺客"}, // 1. 基础近战型 5201:{uuid:5201,name:"兽人战士",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:3.0,ss:10, type:HType.Melee,lv:1,hp:60,ap:8,speed:180,skills:[6001,6003],info:"标准炮灰:确保英雄能完成3次普攻积累天赋计数"}, // 2. 快速突击型 5301:{uuid:5301,name:"兽人斥候",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:1.2,ss:10, type:HType.Melee,lv:1,hp:40,ap:12,speed:400,skills:[6001,6003],info:"快速突击:极高移速贴脸,检测护盾(7102)刷新率"}, // 3. 重型坦克型 5401:{uuid:5401,name:"兽人卫士",icon:"1001",path:"mo3", fac:FacSet.MON, kind:1,as:5.0,ss:10, type:HType.Melee,lv:1,hp:200,ap:15,speed:60,skills:[6001,6003],info:"重型坦克:数值墙,检测玩家破甲(7008)与持续输出"}, // 4. 远程骚扰型 5501:{uuid:5501,name:"兽人射手",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:3.0,ss:10, type:HType.Long,lv:1,hp:50,ap:10,speed:90,skills:[6001,6003],info:"远程骚扰:跨屏打击,迫使阵地分散或移动英雄"}, // 5. 特殊机制型 5601:{uuid:5601,name:"兽人自爆兵",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:3.0,ss:10, type:HType.Melee,lv:1,hp:80,ap:200,speed:220,skills:[6001,6003],info:"特殊机制:极端伤害,漏怪即秒杀,检测减伤(7103)"}, 5602:{uuid:5602,name:"兽人召唤师",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:3.0,ss:10, type:HType.Melee,lv:1,hp:150,ap:10,speed:100,skills:[6001,6003],info:"战术目标:持续召唤小怪,检测英雄大招清场频率"}, 5603:{uuid:5603,name:"兽人祭司",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:3.0,ss:10, type:HType.Melee,lv:1,hp:150,ap:10,speed:105,skills:[6001,6003],info:"战术目标:为怪群回血,检测玩家沉默(7006)覆盖率"}, 5604:{uuid:5604,name:"兽人图腾师",icon:"1001",path:"mo1", fac:FacSet.MON, kind:1,as:3.0,ss:10, type:HType.Melee,lv:1,hp:150,ap:10,speed:110,skills:[6001,6003],info:"战术目标:提供加速光环,改变怪群推进节奏"}, // 6. 精英/BOSS型 5701:{uuid:5701,name:"兽人首领(BOSS)",icon:"1001",path:"mo4", fac:FacSet.MON, kind:1,as:2.5,ss:10, type:HType.Melee,lv:3,hp:2000,ap:60,speed:120,skills:[6002,6004],info:"终极考验:极高HP,检测大招重置与辐射协同输出"}, };