Files
pixelheros/assets/script/game/common/config/heroSet.ts
walkpan 1f4ab6a98a feat(怪物配置): 重构怪物属性与配置,添加新类型和属性
- 在HeroAttrs.ts中添加BOOLEAN类型和LUCK属性
- 新增怪物特殊属性:攻击/伤害触发计数重置和自爆怪
- 重构heroSet.ts中的怪物配置,简化类型并调整数值
- 新增兽人系列怪物配置,优化怪物类型分布和战斗体验
2026-01-01 22:45:32 +08:00

204 lines
8.5 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"
import { smc } from "../SingletonModuleComp"
import { BuffConf } from "./SkillSet"
export enum AttrSet {
ATTR_MAX = 85,
}
export enum HType {
warrior = 0,
remote = 1,
mage = 2,
support = 3,
assassin = 4,
}
export const HTypeName ={
0:"战士",
1:"远程",
2:"法师",
3:"辅助",
4:"刺客",
}
//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(-240,BoxSet.GAME_LINE,0)},
1:{pos:v3(0,BoxSet.GAME_LINE,0)},
2:{pos:v3(0,BoxSet.GAME_LINE,0)},
}
export const MonSet = {
0:{pos:v3(240,BoxSet.GAME_LINE+10,0)},
1:{pos:v3(240,BoxSet.GAME_LINE-10,0)},
2:{pos:v3(300,BoxSet.GAME_LINE+10,0)},
3:{pos:v3(300,BoxSet.GAME_LINE-10,0)},
4:{pos:v3(320,BoxSet.GAME_LINE+10,0)},
5:{pos:v3(320,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(400,BoxSet.GAME_LINE+10,0)},
9:{pos:v3(400,BoxSet.GAME_LINE-10,0)},
10:{pos:v3(440,BoxSet.GAME_LINE+10,0)},
11:{pos:v3(440,BoxSet.GAME_LINE-10,0)},
}
export enum MonStart {
SLINE_1=130, //上线y
SLINE_2=110, //下线y
START_X=240, //x起始点
START_I=60, //x轴间隔
}
export enum HeroConf{
COST=1500,
MAX_HP=200,
MAX_MP=200,
MAX_AP=20,
MAX_DEF=20,
}
export const getPreAttr = (uuid:number)=>{
let hp=HeroInfo[uuid].hp/HeroConf.MAX_HP
let mp=HeroInfo[uuid].mp/HeroConf.MAX_MP
let ap=HeroInfo[uuid].ap/HeroConf.MAX_AP
let def=HeroInfo[uuid].def/HeroConf.MAX_DEF
return {hp:hp,mp:mp,ap:ap,def:def}
}
export enum HeroUpSet {
MP=5,
HP=10,
LVMP=100,
LVHP=100,
LVATK=10,
LVDEF=5,
}
/**
* 英雄/怪物基础信息接口
*/
export interface heroInfo {
uuid: number; // 唯一标识英雄5000段怪物5200段
name: string; // 显示名称
path: string; // 资源路径(对应美术资源名)
fac: FacSet; // 阵营FacSet.HERO 或 FacSet.MON
kind: number; // 未使用
as: number; // 攻击速度系数(越小越快)
type: HType; // 职业定位(战士/远程/法师/辅助/刺客)
lv: number; // 初始等级
hp: number; // 生命值上限
mp: number; // 法力值上限
ap: number; // 攻击力
def: number; // 防御(伤害减免)
dis: number; // 攻击距离(像素)
speed: number; // 移动速度(像素/秒)
skills: number[]; // 携带技能ID列表
buff: BuffConf[]; // 自带buff配置通常为空由技能动态添加
tal: number[]; // 天赋ID列表
info: string; // 描述文案
}
export const HeroInfo: Record<number, heroInfo> = {
// ========== 英雄角色 ==========
// 刘邦 - 领导型战士(善于用人,知人善任)
5001:{uuid:5001,name:"刘邦",path:"hk1", fac:FacSet.HERO, kind:1,as:1.5,
type:HType.warrior,lv:1,hp:200,mp:200,def:9,ap:15,dis:100,speed:120,skills:[6001,6100,6101,6102],
buff:[],tal:[],info:"楚汉争霸领袖,领导统御型战士"},
// 荆轲 - 刺客(敏捷型,高速度和暴击率)
5002:{uuid:5002,name:"荆轲",path:"hc1", fac:FacSet.HERO, kind:1,as:1.5,
type:HType.assassin,lv:1,hp:80,mp:60,def:3,ap:22,dis:120,speed:180,skills:[6002,6001],
buff:[],tal:[],info:"战国刺客,刺杀专精敏捷型刺客"},
// 赵武灵王 - 远程射手(胡服骑射,机动型高移动速度和远程攻击)
5005:{uuid:5005,name:"赵武灵王",path:"ha1", fac:FacSet.HERO, kind:2,as:1.5,
type:HType.remote,lv:1,hp:100,mp:80,def:6,ap:18,dis:450,speed:140,skills:[6002,6001],
buff:[],tal:[],info:"胡服骑射改革者,机动型高远程输出"},
// 张良 - 智谋法师(运筹帷幄,智谋型法师)
5007:{uuid:5007,name:"张良",path:"hh1", fac:FacSet.HERO, kind:2,as:1.5,
type:HType.mage,lv:1,hp:88,mp:135,def:5,ap:15,dis:350,speed:100,skills:[6002,6001],
buff:[],tal:[],info:"运筹帷幄谋士,智谋型法师"},
// 屈原 - 元素法师(离骚诗韵,元素型高魔法输出)
5008:{uuid:5008,name:"屈原",path:"hm1", fac:FacSet.HERO, kind:2,as:1.5,
type:HType.mage,lv:1,hp:85,mp:140,def:4,ap:16,dis:400,speed:90,skills:[6002,6001],
buff:[],tal:[],info:"离骚诗韵,元素型高魔法输出"},
// 孙膑 - 谋略法师(兵法谋略,谋略型法师)
5009:{uuid:5009,name:"孙膑",path:"hm2", fac:FacSet.HERO, kind:2,as:1.5,
type:HType.mage,lv:1,hp:92,mp:135,def:6,ap:14,dis:420,speed:95,skills:[6002,6001],
buff:[],tal:[],info:"兵法谋略,谋略型法师"},
// 萧何 - 后勤辅助(后勤保障,后勤型辅助)
5010:{uuid:5010,name:"萧何",path:"hz1", fac:FacSet.HERO, kind:2,as:1.5,
type:HType.support,lv:1,hp:115,mp:145,def:10,ap:8,dis:380,speed:105,skills:[6002,6001],
buff:[],tal:[],info:"后勤保障,后勤型辅助"},
// 1. 基础近战型
5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.warrior,lv:1,hp:15,mp:100,def:0,ap:5,dis:50,speed:200,skills:[6201],
buff:[],tal:[],info:"标准炮灰,用于积攒玩家天赋计数"},
// 2. 快速突击型
5301:{uuid:5203,name:"兽人斥候",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.assassin,lv:1,hp:25,mp:100,def:0,ap:8,dis:50,speed:350,skills:[6201],
buff:[],tal:[],info:"速度极快,快速切入,给玩家压迫感"},
// 3. 重型坦克型
5401:{uuid:5401,name:"兽人卫士",path:"mo1", fac:FacSet.MON, kind:1,as:5,
type:HType.warrior,lv:1,hp:160,mp:100,def:0,ap:12,dis:90,speed:80,skills:[6005],
buff:[],tal:[],info:"重型坦克型:缓慢逼近,高血量,中等伤害"},
// 4. 远程骚扰型
5501:{uuid:5501,name:"兽人射手",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.remote,lv:1,hp:35,mp:100,def:0,ap:10,dis:600,speed:80,skills:[6203],
buff:[],tal:[],info:"远程单位,在远处进行骚扰攻击"},
// 5. 特殊机制型
5601:{uuid:5601,name:"兽人自爆兵",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.assassin,lv:1,hp:30,mp:100,def:0,ap:150,dis:50,speed:130,skills:[6201],
buff:[],tal:[],info:"高额自爆伤害,检测玩家的护盾与减伤天赋"},
// 召唤师:持续召唤小怪(后续可在技能系统中实现 SType.zhaohuan
5602:{uuid:5602,name:"兽人召唤师",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.mage,lv:1,hp:60,mp:160,def:0,ap:8,dis:380,speed:100,skills:[6005],
buff:[],tal:[],info:"远程召唤/治疗,不解决他怪物群会无限回血"},
// 治疗者:为周围怪物回血(此处以提升治疗效果和生命回复为基础被动)
5603:{uuid:5603,name:"兽人祭司",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.support,lv:1,hp:60,mp:160,def:0,ap:6,dis:90,speed:105,skills:[6005],
buff:[],tal:[],info:"远程召唤/治疗,不解决他怪物群会无限回血"},
// 光环怪为周围怪物提供增益此处以Buff效果提升与移动速度提升为基础被动
// Attrs.BUFF_UP=60 (RATIO=1)Attrs.SPEED=63 (RATIO=1)
5604:{uuid:5604,name:"兽人图腾师",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.support,lv:1,hp:60,mp:140,def:0,ap:7,dis:90,speed:110,skills:[6005],
buff:[],tal:[],info:"特殊机制:为周围怪物提供增益光环,加速与增益效果强化"},
// 6. 精英/BOSS型
5701:{uuid:5701,name:"兽人首领(精英)",path:"mo1", fac:FacSet.MON, kind:1,as:3,
type:HType.warrior,lv:3,hp:10000,mp:100,def:0,ap:20,dis:100,speed:110,skills:[6005],
buff:[],tal:[],info:"初级boos自带护盾天赋与英雄进行辐射对抗"},
};