Files
heros/assets/script/game/common/config/heroSet.ts
2025-08-14 17:10:36 +08:00

305 lines
11 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 { FacSet } from "./BoxSet"
/**
* kind 1:烈焰 2:寒冰 3:自然 4:暗影 5:神圣
**/
// export enum HeroKind {
// /**
// * 词条解释:
// * 烈焰:攻击带击退效果
// * 寒冰:攻击带速度效果
// * 自然:攻击偷取生命
// * 暗影:攻击偷取攻击
// * 神圣:攻击带2倍伤害
// * */
// fire = 1,
// water = 2,
// nature = 3,
// shadow = 4,
// holy = 5,
// }
/**
* 词条解释:
* 0:战士 1:远程 2:法师
* * */
export enum HType {
warrior = 0,
remote = 1,
mage = 2,
}
//fac:FacSet.HERO
export const getHeroList = (quality:number=0)=>{
return Object.values(HeroInfo).filter(item=>{
const facMatch = item.fac === FacSet.HERO;
const qualityMatch = quality === 0 || item.quality === quality;
return facMatch && qualityMatch;
}).map(item=>item.uuid)
}
//fac:FacSet.MON
export const getMonList = (quality:number=0)=>{
return Object.values(HeroInfo).filter(item=>{
const facMatch = item.fac === FacSet.MON;
const qualityMatch = quality === 0 || item.quality === quality;
return facMatch && qualityMatch;
}).map(item=>item.uuid)
}
export const HeroPos={
0:{pos:v3(-290,0,0)},
1:{pos:v3(0,0,0)},
2:{pos:v3(-100,0,0)},
}
export const HQuality = {
WHITE:1,
GREEN:2,
BLUE:3,
PURPLE:4,
ORANGE:5,
}
export const MonSet = {
0:{pos:v3(160,0,0)},
1:{pos:v3(220,0,0)},
2:{pos:v3(280,0,0)},
3:{pos:v3(340,0,0)},
4:{pos:v3(400,0,0)},
5:{pos:v3(460,0,0)},
}
export const HeroInfo = {
//主将
5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.warrior,hp:100,ap:15,dis:100,cd:1,speed:150,skills:[6011,6020],
buff:[],info:"剑类专精,穿刺伤害额外+10%"},
5002:{uuid:5002,name:"hk1",path:"hk1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:100,ap:15,dis:100,cd:1,speed:150,skills:[6011,6004],
buff:[],info:"斧类专精,风怒概率增加10%"},
// 5003:{uuid:5003,name:"碎颅.赫克托",path:"k4", quality:HQuality.BLUE,lv:1,kind:1,
// type:HType.warrior,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6010,6021,6001],
// buff:[],info:"锤类专精,暴击概率增加10%"},
// 5004:{uuid:5004,name:"裂伤.塔米拉",path:"k3", quality:HQuality.BLUE,lv:1,kind:1,
// type:HType.warrior,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6010,6021,6001],
// buff:[],info:"刀类专精,易伤效果额外持续1次"},
5005:{uuid:5005,name:"ha1",path:"ha1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
type:HType.remote,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6025,6031],
buff:[],info:"说明"},
5007:{uuid:5007,name:"mh1",path:"hmh1", fac:FacSet.HERO, quality:HQuality.PURPLE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6002,6002],
buff:[],info:"说明"},
5008:{uuid:5008,name:"mf1",path:"hmf1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:100,skills:[6022,6029],
buff:[],info:"说明"},
5009:{uuid:5009,name:"风暴精灵",path:"hk1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:100,skills:[6002,6002],
buff:[],info:"说明"},
5010:{uuid:5010,name:"战争祭祀",path:"hk1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:100,skills:[6024,6002],
buff:[],info:"说明"},
5011:{uuid:5011,name:"ha2",path:"ha2", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
type:HType.remote,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6003,6003],
buff:[],info:"说明"},
//怪物
5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.remote,hp:20,ap:5,dis:350,cd:1,speed:100,skills:[6008],
buff:[],info:"普通怪物-战士型"},
5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5204:{uuid:5204,name:"石卫", path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.mage,hp:18,ap:5,dis:90,cd:2.5,speed:100,skills:[6010],
buff:[],info:"法师怪物-高伤害脆弱"},
5205:{uuid:5205,name:"土卫", path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.mage,hp:18,ap:5,dis:90,cd:2.5,speed:100,skills:[6010],
buff:[],info:"法师怪物-高伤害脆弱"},
5206:{uuid:5206,name:"树卫", path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.mage,hp:18,ap:5,dis:90,cd:2.5,speed:100,skills:[6010],
buff:[],info:"法师怪物-高伤害脆弱"},
5219:{uuid:5219,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:2,kind:1,
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5220:{uuid:5220,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5221:{uuid:5221,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.remote,hp:20,ap:5,dis:350,cd:1.5,speed:100,skills:[6008],
buff:[],info:"普通怪物-战士型"},
5222:{uuid:5222,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5223:{uuid:5223,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5224:{uuid:5224,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:HQuality.GREEN,lv:1,kind:1,
type:HType.remote,hp:20,ap:5,dis:350,cd:1.5,speed:100,skills:[6010],
buff:[],info:"普通怪物-战士型"},
5225:{uuid:5225,name:"精英独眼",path:"mo1", fac:FacSet.MON, quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:45,ap:12,dis:300,cd:2,speed:100,skills:[6006],
buff:[],info:"精英怪物-战士型"},
5226:{uuid:5226,name:"精英牛头",path:"mo1", fac:FacSet.MON, quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:45,ap:12,dis:300,cd:2,speed:100,skills:[6007],
buff:[],info:"精英怪物-战士型"},
5227:{uuid:5227,name:"精英兽人",path:"mo1", fac:FacSet.MON, quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:45,ap:12,dis:300,cd:2,speed:100,skills:[6008],
buff:[],info:"精英怪物-战士型"},
};
// ==================== 怪物系列分类配置 ====================
// 怪物系列枚举
export enum MonsterSeriesType {
ORC = "ORC", // 兽人系列
CYCLOPS = "CYCLOPS", // 独眼系列
MINOTAUR = "MINOTAUR", // 牛头系列
NATURE = "NATURE", // 自然系列
}
// 怪物系列配置
export const MonsterSeriesConfig = {
// 兽人系列 (mor开头)
[MonsterSeriesType.ORC]: {
name: "兽人系列",
description: "来自荒野的兽人族群",
monsters: {
warrior: [5201, 5203], // 兽人战士、兽人护卫、精英兽人
remote: [5202, 5227], // 兽人刺客
mage: [] // 无法师
},
allMonsters: [5201, 5202, 5203, 5227]
},
// 独眼系列 (md开头)
[MonsterSeriesType.CYCLOPS]: {
name: "独眼系列",
description: "古老的独眼巨人族群",
monsters: {
warrior: [5222, 5223], // 独眼巨人x2、精英独眼
remote: [5224, 5225], // 独眼巨人(远程)
mage: [] // 无法师
},
allMonsters: [5222, 5223, 5224, 5225]
},
// 牛头系列 (mn开头)
[MonsterSeriesType.MINOTAUR]: {
name: "牛头系列",
description: "迷宫中的牛头怪族群",
monsters: {
warrior: [5219, 5220], // 牛头战士x2、精英牛头
remote: [5221, 5226], // 牛头战士(远程)
mage: [] // 无法师
},
allMonsters: [5219, 5220, 5221, 5226]
},
// 自然系列 (mgem开头)
[MonsterSeriesType.NATURE]: {
name: "自然系列",
description: "大地与自然的守护者",
monsters: {
warrior: [], // 无战士
remote: [], // 无远程
mage: [5204, 5205, 5206] // 石卫、土卫、树卫
},
allMonsters: [5204, 5205, 5206]
},
};
// 获取指定系列的怪物列表
export const getMonstersBySeries = (series: MonsterSeriesType, type?: keyof typeof HType): number[] => {
const seriesConfig = MonsterSeriesConfig[series];
if (!seriesConfig) {
console.warn(`[MonsterSeries]: 未找到系列 ${series}`);
return [];
}
if (type !== undefined) {
const typeKey = HType[type] === HType.warrior ? "warrior" :
HType[type] === HType.remote ? "remote" : "mage";
return seriesConfig.monsters[typeKey] || [];
}
return seriesConfig.allMonsters;
};
// 根据怪物UUID获取所属系列
export const getMonsterSeries = (uuid: number): MonsterSeriesType | null => {
for (const [seriesKey, config] of Object.entries(MonsterSeriesConfig)) {
if (config.allMonsters.includes(uuid)) {
return seriesKey as MonsterSeriesType;
}
}
return null;
};
// 获取系列信息
export const getSeriesInfo = (series: MonsterSeriesType) => {
return MonsterSeriesConfig[series] || null;
};
// 获取所有系列列表
export const getAllMonsterSeries = (): MonsterSeriesType[] => {
return Object.values(MonsterSeriesType);
};
// 按类型分组的怪物列表
export const MonstersByType = {
warrior: [5201, 5203, 5219, 5220, 5222, 5223, 5225, 5226, 5227], // 所有战士类型怪物
remote: [5202, 5221, 5224], // 所有远程类型怪物
mage: [5204, 5205, 5206,] // 所有法师类型怪物
};
// 随机从指定系列获取怪物
export const getRandomMonsterFromSeries = (series: MonsterSeriesType, type?: keyof typeof HType): number => {
const monsters = getMonstersBySeries(series, type);
if (monsters.length === 0) {
console.warn(`[MonsterSeries]: 系列 ${series} 中没有${type ? HType[type] : ''}类型怪物`);
return 5201; // 返回默认怪物
}
return monsters[Math.floor(Math.random() * monsters.length)];
};
// 随机选择一个系列
export const getRandomSeries = (): MonsterSeriesType => {
const allSeries = getAllMonsterSeries();
return allSeries[Math.floor(Math.random() * allSeries.length)];
};