Files
pixelheros/assets/script/game/map/RogueConfig.ts
panw eb106c1b60 feat(地图): 新增波次怪物占位配置系统
- 引入 WaveSlotConfig 和 DefaultWaveSlot 配置,支持每波怪物类型和数量自定义
- 替换硬编码的槽位数量,根据配置动态计算槽位总数和类型分布
- 重构怪物分配逻辑,依据怪物类型匹配配置槽位类型
2026-04-03 16:34:29 +08:00

73 lines
2.1 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.
export enum UpType {
AP1_HP1 = 0, //平衡
HP2 = 1, //强hp
AP2 = 2 //强ap
}
// 普通关卡成长值:第一项为攻击力成长,第二项为血量成长
export const StageGrow = {
[UpType.AP1_HP1]: [4,10], // 平衡型攻4 血10
[UpType.HP2]: [2,20], // 强HP型攻2 血20
[UpType.AP2]: [8,0], // 强AP型攻8 血0
}
// Boss关卡成长值同上数值更高
export const StageBossGrow = {
[UpType.AP1_HP1]: [3,16], // 平衡型攻3 血16
[UpType.HP2]: [1,24], // 强HP型攻1 血24
[UpType.AP2]: [10,4], // 强AP型攻10 血4
}
export const MonType = {
Melee: 0, // 近战高功
Long: 1, // 高速贴近
Support: 2, // 支持怪
MeleeBoss: 3, // boss怪
LongBoss: 4, // boss怪
}
export const MonList = {
[MonType.Melee]: [6001,6003], // 近战高功
[MonType.Long]: [6002], // 高速贴近
[MonType.Support]: [6002], // 高血皮厚
[MonType.MeleeBoss]:[6006,6104,6015], // 射手
[MonType.LongBoss]:[6005], // 远程魔法
}
export const BossList = [6006,6104,6015]
export const SpawnPowerBias = 1
export interface IWaveSlot {
type: number; // 对应 MonType
count: number;
}
// 每波怪物占位数量配置:数组顺序即为占位从左到右的排列顺序
export const WaveSlotConfig: { [wave: number]: IWaveSlot[] } = {
1: [
{ type: MonType.Melee, count: 2 },
{ type: MonType.Long, count: 2 }
],
2: [
{ type: MonType.Melee, count: 2 },
{ type: MonType.Long, count: 3 },
{ type: MonType.Support, count: 1 }
],
3: [
{ type: MonType.Melee, count: 3 },
{ type: MonType.MeleeBoss, count: 1 },
{ type: MonType.Long, count: 2 }
],
4: [
{ type: MonType.Melee, count: 2 },
{ type: MonType.Long, count: 2 },
{ type: MonType.Support, count: 1 },
{ type: MonType.LongBoss, count: 1 }
],
}
// 默认占位配置 (如果在 WaveSlotConfig 中找不到波次,则使用此配置)
export const DefaultWaveSlot: IWaveSlot[] = [
{ type: MonType.Melee, count: 3 },
{ type: MonType.Long, count: 3 }
]