刷怪完成
This commit is contained in:
@@ -90,27 +90,11 @@ export enum FightSet {
|
|||||||
export const MissionData = {
|
export const MissionData = {
|
||||||
gold:1000,//金币
|
gold:1000,//金币
|
||||||
score:0,//分数
|
score:0,//分数
|
||||||
refrsh_time:5, //刷新时间
|
current_wave:1,
|
||||||
refresh_gold:1,//刷新金币
|
|
||||||
call_gold:0,//召唤金币
|
|
||||||
add_gold:1,//金币增加
|
|
||||||
lucky_gold:1,//幸运金币
|
|
||||||
change_gold:0,//金币变化
|
|
||||||
back_gold:1,//返还金币
|
|
||||||
buff_back_gold:0,//额外返还金币
|
|
||||||
buff_add_gold:0,//额外增加金币
|
|
||||||
buff_refrsh_time:0,//额外刷新时间
|
|
||||||
buff_refresh_gold:0,//额外发现所需的金币
|
|
||||||
current_wave:0,
|
|
||||||
mon_num:0,//怪物数量
|
mon_num:0,//怪物数量
|
||||||
wave_time_num:0,//波次时间
|
wave_time_num:0,//波次时间
|
||||||
in_fight:false,
|
in_fight:false,
|
||||||
fight_time:0,//战斗时间
|
fight_time:0,//战斗时间
|
||||||
equip_stone:0,//装备石
|
|
||||||
equip_stone_max:10,//装备石最大数量
|
|
||||||
skill_stone:0,//技能石
|
|
||||||
skill_stone_max:10,//技能石最大数量
|
|
||||||
refresh_count:5,//刷新次
|
|
||||||
}
|
}
|
||||||
export const HeroUI = {
|
export const HeroUI = {
|
||||||
uuid:0,
|
uuid:0,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { v3 } from "cc"
|
import { v3 } from "cc"
|
||||||
|
import { FacSet } from "./BoxSet"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* kind :1:烈焰 2:寒冰 3:自然 4:暗影 5:神圣
|
* kind :1:烈焰 2:寒冰 3:自然 4:暗影 5:神圣
|
||||||
@@ -27,32 +28,23 @@ export enum HType {
|
|||||||
remote = 1,
|
remote = 1,
|
||||||
mage = 2,
|
mage = 2,
|
||||||
}
|
}
|
||||||
|
//fac:FacSet.HERO
|
||||||
export const getHeroList = ()=>{
|
export const getHeroList = (quality:number)=>{
|
||||||
return Masters
|
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)=>{
|
||||||
|
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 getHeroListByCalled = (count:number,called:any[])=>{
|
|
||||||
let list=Masters
|
|
||||||
if(called.length==3){
|
|
||||||
list=called.map((item:any)=>item.uuid)
|
|
||||||
}
|
|
||||||
// 确保请求数量不超过可用卡牌数量
|
|
||||||
count = Math.min(count, list.length);
|
|
||||||
|
|
||||||
// 打乱数组顺序
|
|
||||||
const shuffled = [...list].sort(() => Math.random() - 0.5);
|
|
||||||
|
|
||||||
// 返回指定数量的卡牌
|
|
||||||
return shuffled.slice(0, count).map(uuid => ({
|
|
||||||
uuid
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
export const HeroList = [5021,5022,5023,5024,5025,5026,5027,5028]
|
|
||||||
export const MonList = [5201,5202,5203,5204,5205,5206,5219,5220,5221,5222,5223,5224,5225,5226,5227]
|
|
||||||
export const Masters = [5001,5002,5005,5008,5009,5010,5011]
|
|
||||||
|
|
||||||
export const HeroPos={
|
export const HeroPos={
|
||||||
0:{pos:v3(-290,0,0)},
|
0:{pos:v3(-290,0,0)},
|
||||||
@@ -73,193 +65,17 @@ export const MonSet = {
|
|||||||
3:{pos:v3(340,0,0)},
|
3:{pos:v3(340,0,0)},
|
||||||
4:{pos:v3(400,0,0)},
|
4:{pos:v3(400,0,0)},
|
||||||
5:{pos:v3(460,0,0)},
|
5:{pos:v3(460,0,0)},
|
||||||
6:{pos:v3(520,0,0)},
|
|
||||||
7:{pos:v3(440,0,0)},
|
|
||||||
8:{pos:v3(480,0,0)},
|
|
||||||
9:{pos:v3(520,0,0)},
|
|
||||||
10:{pos:v3(560,0,0)},
|
|
||||||
11:{pos:v3(830,0,0)},
|
|
||||||
12:{pos:v3(870,0,0)},
|
|
||||||
13:{pos:v3(910,0,0)},
|
|
||||||
14:{pos:v3(950,0,0)},
|
|
||||||
15:{pos:v3(990,0,0)},
|
|
||||||
16:{pos:v3(1030,0,0)},
|
|
||||||
17:{pos:v3(1070,0,0)},
|
|
||||||
18:{pos:v3(1110,0,0)},
|
|
||||||
19:{pos:v3(1150,0,0)},
|
|
||||||
20:{pos:v3(1190,0,0)},
|
|
||||||
21:{pos:v3(1230,0,0)},
|
|
||||||
22:{pos:v3(1270,0,0)},
|
|
||||||
23:{pos:v3(1310,0,0)},
|
|
||||||
24:{pos:v3(1350,0,0)},
|
|
||||||
25:{pos:v3(1390,0,0)},
|
|
||||||
26:{pos:v3(1430,0,0)},
|
|
||||||
27:{pos:v3(1470,0,0)},
|
|
||||||
28:{pos:v3(1510,0,0)},
|
|
||||||
29:{pos:v3(1550,0,0)},
|
|
||||||
30:{pos:v3(1590,0,0)},
|
|
||||||
31:{pos:v3(1630,0,0)},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 经验值计算函数 - 复杂递增规律
|
|
||||||
// 基础经验值:100
|
|
||||||
// 递增值:每级递增10,且递增值本身也会递增
|
|
||||||
// 公式:基础经验值 + 递增值累加
|
|
||||||
// 递增值规律:第1级递增值=10,第2级递增值=20,第3级递增值=30...
|
|
||||||
export const getUpExp = (currentLevel: number): number => {
|
|
||||||
const baseExp = 100; // 基础经验值
|
|
||||||
let totalIncrement = 0;
|
|
||||||
|
|
||||||
// 计算从1级到当前等级的递增值累加
|
|
||||||
for (let level = 1; level < currentLevel; level++) {
|
|
||||||
totalIncrement += level * 10; // 每级的递增值 = 等级 * 10
|
|
||||||
}
|
|
||||||
|
|
||||||
return baseExp + totalIncrement;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取从当前等级升级到目标等级所需的总经验值
|
|
||||||
export const getTotalUpExp = (currentLevel: number, targetLevel: number): number => {
|
|
||||||
let totalExp = 0;
|
|
||||||
for (let level = currentLevel; level < targetLevel; level++) {
|
|
||||||
totalExp += getUpExp(level);
|
|
||||||
}
|
|
||||||
return totalExp;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 简化的升级属性增长计算
|
|
||||||
// 基于 HType 的攻击力增长配置
|
|
||||||
export const ApGrowthByType = {
|
|
||||||
[HType.warrior]: (baseAp: number) => Math.floor(baseAp * 0.05) + 3, // 战士:+5% + 3
|
|
||||||
[HType.remote]: (baseAp: number) => Math.floor(baseAp * 0.10) + 2, // 远程:+10% + 2
|
|
||||||
[HType.mage]: (baseAp: number) => Math.floor(baseAp * 0.15) + 1, // 法师:+15% + 1
|
|
||||||
};
|
|
||||||
|
|
||||||
// 基于 HType 的HP增长配置
|
|
||||||
export const HpGrowthByType = {
|
|
||||||
[HType.warrior]: (baseHp: number) => Math.floor(baseHp * 0.08) + 10, // 战士:+8% + 10
|
|
||||||
[HType.remote]: (baseHp: number) => Math.floor(baseHp * 0.05) + 5, // 远程:+5% + 5
|
|
||||||
[HType.mage]: (baseHp: number) => Math.floor(baseHp * 0.03) + 3, // 法师:+3% + 3
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取从1级升级到2级增加的攻击力
|
|
||||||
export const getUpAp = (heroId: number): number => {
|
|
||||||
const heroInfo = HeroInfo[heroId];
|
|
||||||
if (!heroInfo) {
|
|
||||||
console.warn(`[getUpAp] 英雄 ${heroId} 不存在`);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseAp = heroInfo.ap;
|
|
||||||
const heroType = heroInfo.type;
|
|
||||||
const growthFunction = ApGrowthByType[heroType] || ApGrowthByType[HType.warrior];
|
|
||||||
return growthFunction(baseAp);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取从1级升级到2级增加的HP
|
|
||||||
export const getUpHp = (heroId: number): number => {
|
|
||||||
const heroInfo = HeroInfo[heroId];
|
|
||||||
if (!heroInfo) {
|
|
||||||
console.warn(`[getUpHp] 英雄 ${heroId} 不存在`);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseHp = heroInfo.hp;
|
|
||||||
const heroType = heroInfo.type;
|
|
||||||
const growthFunction = HpGrowthByType[heroType] || HpGrowthByType[HType.warrior];
|
|
||||||
return growthFunction(baseHp);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取英雄在指定等级的总攻击力
|
|
||||||
export const getHeroTotalAp = (heroId: number, level: number): number => {
|
|
||||||
const heroInfo = HeroInfo[heroId];
|
|
||||||
if (!heroInfo) {
|
|
||||||
console.warn(`[getHeroTotalAp] 英雄 ${heroId} 不存在`);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseAp = heroInfo.ap;
|
|
||||||
const heroType = heroInfo.type;
|
|
||||||
const growthFunction = ApGrowthByType[heroType] || ApGrowthByType[HType.warrior];
|
|
||||||
const levelUpAp = growthFunction(baseAp);
|
|
||||||
return baseAp + levelUpAp;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取英雄在指定等级的总HP
|
|
||||||
export const getHeroTotalHp = (heroId: number, level: number): number => {
|
|
||||||
const heroInfo = HeroInfo[heroId];
|
|
||||||
if (!heroInfo) {
|
|
||||||
console.warn(`[getHeroTotalHp] 英雄 ${heroId} 不存在`);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseHp = heroInfo.hp;
|
|
||||||
const heroType = heroInfo.type;
|
|
||||||
const growthFunction = HpGrowthByType[heroType] || HpGrowthByType[HType.warrior];
|
|
||||||
const levelUpHp = growthFunction(baseHp);
|
|
||||||
return baseHp + levelUpHp;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取从当前等级升级到目标等级增加的攻击力
|
|
||||||
export const getApIncrease = (heroId: number, currentLevel: number, targetLevel: number): number => {
|
|
||||||
const heroInfo = HeroInfo[heroId];
|
|
||||||
if (!heroInfo) {
|
|
||||||
console.warn(`[getApIncrease] 英雄 ${heroId} 不存在`);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseAp = heroInfo.ap;
|
|
||||||
const heroType = heroInfo.type;
|
|
||||||
const growthFunction = ApGrowthByType[heroType] || ApGrowthByType[HType.warrior];
|
|
||||||
return growthFunction(baseAp);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取从当前等级升级到目标等级增加的HP
|
|
||||||
export const getHpIncrease = (heroId: number, currentLevel: number, targetLevel: number): number => {
|
|
||||||
const heroInfo = HeroInfo[heroId];
|
|
||||||
if (!heroInfo) {
|
|
||||||
console.warn(`[getHpIncrease] 英雄 ${heroId} 不存在`);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseHp = heroInfo.hp;
|
|
||||||
const heroType = heroInfo.type;
|
|
||||||
const growthFunction = HpGrowthByType[heroType] || HpGrowthByType[HType.warrior];
|
|
||||||
return growthFunction(baseHp);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取升级后的完整属性信息
|
|
||||||
export const getLevelUpStats = (heroId: number, currentLevel: number, targetLevel: number) => {
|
|
||||||
return {
|
|
||||||
apIncrease: getApIncrease(heroId, currentLevel, targetLevel),
|
|
||||||
hpIncrease: getHpIncrease(heroId, currentLevel, targetLevel),
|
|
||||||
newTotalAp: getHeroTotalAp(heroId, targetLevel),
|
|
||||||
newTotalHp: getHeroTotalHp(heroId, targetLevel)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// 根据英雄类型获取增长模式描述
|
|
||||||
export const getGrowthModeDescription = (heroType: HType): string => {
|
|
||||||
switch (heroType) {
|
|
||||||
case HType.warrior:
|
|
||||||
return "战士型:AP固定增长为主(每级+3,+5%),HP高增长(每级+10,+8%)";
|
|
||||||
case HType.remote:
|
|
||||||
return "远程型:AP平衡增长(每级+2,+10%),HP中等增长(每级+5,+5%)";
|
|
||||||
case HType.mage:
|
|
||||||
return "法师型:AP百分比增长为主(每级+1,+15%),HP低增长(每级+3,+3%)";
|
|
||||||
default:
|
|
||||||
return "未知类型";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const HeroInfo = {
|
export const HeroInfo = {
|
||||||
|
|
||||||
//主将
|
//主将
|
||||||
5001:{uuid:5001,name:"火焰骑士",path:"hk1", quality:HQuality.BLUE,lv:1,kind:1,
|
5001:{uuid:5001,name:"火焰骑士",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,6020],
|
type:HType.warrior,hp:100,ap:15,dis:100,cd:1,speed:150,skills:[6011,6020],
|
||||||
buff:[],info:"剑类专精,穿刺伤害额外+10%"},
|
buff:[],info:"剑类专精,穿刺伤害额外+10%"},
|
||||||
|
|
||||||
5002:{uuid:5002,name:"hk1",path:"hk1", quality:HQuality.BLUE,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:100,ap:15,dis:100,cd:1,speed:150,skills:[6011,6004],
|
||||||
buff:[],info:"斧类专精,风怒概率增加10%"},
|
buff:[],info:"斧类专精,风怒概率增加10%"},
|
||||||
|
|
||||||
@@ -271,93 +87,93 @@ export const HeroInfo = {
|
|||||||
// type:HType.warrior,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6010,6021,6001],
|
// type:HType.warrior,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6010,6021,6001],
|
||||||
// buff:[],info:"刀类专精,易伤效果额外持续1次"},
|
// buff:[],info:"刀类专精,易伤效果额外持续1次"},
|
||||||
|
|
||||||
5005:{uuid:5005,name:"ha1",path:"ha1", quality:HQuality.BLUE,lv:1,kind:2,
|
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],
|
type:HType.remote,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6025,6031],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
|
|
||||||
5007:{uuid:5007,name:"mh1",path:"hmh1", quality:HQuality.BLUE,lv:1,kind:2,
|
5007:{uuid:5007,name:"mh1",path:"hmh1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
|
||||||
type:HType.mage,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6002,6002],
|
type:HType.mage,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6002,6002],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
5008:{uuid:5008,name:"mf1",path:"hmf1", quality:HQuality.BLUE,lv:1,kind:2,
|
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],
|
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:100,skills:[6022,6029],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
5009:{uuid:5009,name:"风暴精灵",path:"hk1", quality:HQuality.BLUE,lv:1,kind:2,
|
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],
|
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:100,skills:[6002,6002],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
5010:{uuid:5010,name:"战争祭祀",path:"hk1", quality:HQuality.BLUE,lv:1,kind:2,
|
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],
|
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:100,skills:[6024,6002],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
5011:{uuid:5011,name:"ha2",path:"ha2", quality:HQuality.BLUE,lv:1,kind:2,
|
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],
|
type:HType.remote,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6003,6003],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//怪物
|
//怪物
|
||||||
5201:{uuid:5201,name:"兽人战士",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5202:{uuid:5202,name:"兽人刺客",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.remote,hp:20,ap:5,dis:350,cd:1,speed:100,skills:[6008],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5203:{uuid:5203,name:"兽人护卫",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5204:{uuid:5204,name:"石卫", path:"mo1",quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.mage,hp:18,ap:5,dis:90,cd:2.5,speed:100,skills:[6010],
|
||||||
buff:[],info:"法师怪物-高伤害脆弱"},
|
buff:[],info:"法师怪物-高伤害脆弱"},
|
||||||
|
|
||||||
5205:{uuid:5205,name:"土卫", path:"mo1",quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.mage,hp:18,ap:5,dis:90,cd:2.5,speed:100,skills:[6010],
|
||||||
buff:[],info:"法师怪物-高伤害脆弱"},
|
buff:[],info:"法师怪物-高伤害脆弱"},
|
||||||
|
|
||||||
5206:{uuid:5206,name:"树卫", path:"mo1",quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.mage,hp:18,ap:5,dis:90,cd:2.5,speed:100,skills:[6010],
|
||||||
buff:[],info:"法师怪物-高伤害脆弱"},
|
buff:[],info:"法师怪物-高伤害脆弱"},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
5219:{uuid:5219,name:"牛头战士",path:"mo1", quality:HQuality.GREEN,lv:2,kind:1,
|
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],
|
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5220:{uuid:5220,name:"牛头战士",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5221:{uuid:5221,name:"牛头战士",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.remote,hp:20,ap:5,dis:350,cd:1.5,speed:100,skills:[6008],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5222:{uuid:5222,name:"独眼巨人",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5223:{uuid:5223,name:"独眼巨人",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:25,ap:5,dis:90,cd:2,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5224:{uuid:5224,name:"独眼巨人",path:"mo1", quality:HQuality.GREEN,lv:1,kind:1,
|
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],
|
type:HType.remote,hp:20,ap:5,dis:350,cd:1.5,speed:100,skills:[6010],
|
||||||
buff:[],info:"普通怪物-战士型"},
|
buff:[],info:"普通怪物-战士型"},
|
||||||
|
|
||||||
5225:{uuid:5225,name:"精英独眼",path:"mo1", quality:HQuality.BLUE,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:45,ap:12,dis:300,cd:2,speed:100,skills:[6006],
|
||||||
buff:[],info:"精英怪物-战士型"},
|
buff:[],info:"精英怪物-战士型"},
|
||||||
|
|
||||||
5226:{uuid:5226,name:"精英牛头",path:"mo1", quality:HQuality.BLUE,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:45,ap:12,dis:300,cd:2,speed:100,skills:[6007],
|
||||||
buff:[],info:"精英怪物-战士型"},
|
buff:[],info:"精英怪物-战士型"},
|
||||||
|
|
||||||
5227:{uuid:5227,name:"精英兽人",path:"mo1", quality:HQuality.BLUE,lv:1,kind:1,
|
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],
|
type:HType.warrior,hp:45,ap:12,dis:300,cd:2,speed:100,skills:[6008],
|
||||||
buff:[],info:"精英怪物-战士型"},
|
buff:[],info:"精英怪物-战士型"},
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ export class Hero extends ecs.Entity {
|
|||||||
hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
|
hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
|
||||||
hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hero.hp+info.hp
|
hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hero.hp+info.hp
|
||||||
hv.Attrs[BuffAttr.AP]=hv.ap=hero.ap+info.ap;
|
hv.Attrs[BuffAttr.AP]=hv.ap=hero.ap+info.ap;
|
||||||
hv.Attrs[BuffAttr.DEF]=hv.def=hero.def+info.def;
|
|
||||||
hero.buff.forEach((buff:any)=>{
|
hero.buff.forEach((buff:any)=>{
|
||||||
hv.apply_buff(buff.type,buff.value)
|
hv.apply_buff(buff.type,buff.value)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ import { oops } from "db://oops-framework/core/Oops";
|
|||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { EquipSpecialAttr } from "../common/config/Equips";
|
import { EquipSpecialAttr } from "../common/config/Equips";
|
||||||
import { FightSet, getExpDrops, getStoneDrops, TooltipTypes } from "../common/config/Mission";
|
import { FightSet, getExpDrops, getStoneDrops, TooltipTypes } from "../common/config/Mission";
|
||||||
import { getApIncrease, getHpIncrease, getUpExp, HeroInfo, HeroPos } from "../common/config/heroSet";
|
|
||||||
import { FriendModelComp } from "./FriendModel";
|
|
||||||
import { MasterModelComp } from "./MasterModel";
|
|
||||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||||
import { EnhancementType } from "../common/config/LevelUp";
|
import { EnhancementType } from "../common/config/LevelUp";
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
@@ -136,6 +133,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
start () {
|
start () {
|
||||||
this.as.idle()
|
this.as.idle()
|
||||||
this.BUFFCOMP=this.node.getComponent(BuffComp);
|
this.BUFFCOMP=this.node.getComponent(BuffComp);
|
||||||
|
console.log("[HeroViewComp]:heroview"+this.hero_name,this.Attrs)
|
||||||
/** 方向 */
|
/** 方向 */
|
||||||
this.node.setScale(this.scale,1);
|
this.node.setScale(this.scale,1);
|
||||||
this.node.getChildByName("top").setScale(this.scale,1);
|
this.node.getChildByName("top").setScale(this.scale,1);
|
||||||
@@ -420,6 +418,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
if(is_crit) {
|
if(is_crit) {
|
||||||
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100))
|
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100))
|
||||||
}
|
}
|
||||||
|
console.log(this.hero_name+"[HeroViewComp]:heroview :damage|hp|hp_max",damage,this.hp,this.Attrs[BuffAttr.HP_MAX])
|
||||||
this.hp -= damage;
|
this.hp -= damage;
|
||||||
|
|
||||||
if(this.hp <= 0) {
|
if(this.hp <= 0) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export class Monster extends ecs.Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 加载角色 */
|
/** 加载角色 */
|
||||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,lv:number=1,rogueBuffData?: any[], rogueHp?: number, rogueAttack?: number) {
|
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,lv:number=1,enhancement?: any, stageMultipliers?: any) {
|
||||||
scale=-1
|
scale=-1
|
||||||
let box_group=BoxSet.MONSTER
|
let box_group=BoxSet.MONSTER
|
||||||
console.log("mon load",uuid)
|
console.log("mon load",uuid)
|
||||||
@@ -45,7 +45,7 @@ export class Monster extends ecs.Entity {
|
|||||||
const collider = node.getComponent(BoxCollider2D);
|
const collider = node.getComponent(BoxCollider2D);
|
||||||
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体
|
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体
|
||||||
node.setPosition(pos)
|
node.setPosition(pos)
|
||||||
this.hero_init(uuid,node,scale,box_group,is_boss,is_call,lv,rogueBuffData,rogueHp,rogueAttack)
|
this.hero_init(uuid,node,scale,box_group,is_boss,is_call,lv,enhancement,stageMultipliers)
|
||||||
oops.message.dispatchEvent("monster_load",this)
|
oops.message.dispatchEvent("monster_load",this)
|
||||||
|
|
||||||
// 初始化移动参数
|
// 初始化移动参数
|
||||||
@@ -60,7 +60,7 @@ export class Monster extends ecs.Entity {
|
|||||||
node.parent = scene.entityLayer!.node!
|
node.parent = scene.entityLayer!.node!
|
||||||
node.setPosition(pos)
|
node.setPosition(pos)
|
||||||
}
|
}
|
||||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,lv:number=1,rogueBuffData?: any[], rogueHp?: number, rogueAttack?: number) {
|
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,lv:number=1,enhancement?: any, stageMultipliers?: any) {
|
||||||
var hv = node.getComponent(HeroViewComp)!;
|
var hv = node.getComponent(HeroViewComp)!;
|
||||||
hv.hide_info()
|
hv.hide_info()
|
||||||
// console.log("hero_init",buff)
|
// console.log("hero_init",buff)
|
||||||
@@ -79,30 +79,26 @@ export class Monster extends ecs.Entity {
|
|||||||
// 初始化Attrs属性系统,参考Hero.ts的实现
|
// 初始化Attrs属性系统,参考Hero.ts的实现
|
||||||
hv.Attrs = getBuffNum();
|
hv.Attrs = getBuffNum();
|
||||||
|
|
||||||
// 肉鸽模式使用固定数值,否则使用等级计算
|
// 计算基础属性(使用关卡倍数)
|
||||||
if (rogueHp !== undefined && rogueAttack !== undefined) {
|
const baseHp = hero.hp;
|
||||||
// 肉鸽模式:使用固定数值
|
const baseAp = hero.ap;
|
||||||
hv.hp = hv.hp_max = rogueHp;
|
|
||||||
hv.ap = rogueAttack;
|
// 应用关卡倍数
|
||||||
hv.ap_base = rogueAttack;
|
let finalHp = baseHp;
|
||||||
console.log(`[Monster-Rogue]: 怪物${hero.name} - 固定HP:${rogueHp}, 固定AP:${rogueAttack}`);
|
let finalAp = baseAp;
|
||||||
|
|
||||||
|
if (stageMultipliers) {
|
||||||
|
finalHp = Math.floor(baseHp * stageMultipliers.hp);
|
||||||
|
finalAp = Math.floor(baseAp * stageMultipliers.attack);
|
||||||
|
console.log(`[Monster]: 怪物${hero.name} 关卡倍数 - HP: ${baseHp} x ${stageMultipliers.hp.toFixed(2)} = ${finalHp}, AP: ${baseAp} x ${stageMultipliers.attack.toFixed(2)} = ${finalAp}`);
|
||||||
} else {
|
} else {
|
||||||
// 普通模式:根据Design.md设计文档计算怪物等级属性
|
console.log(`[Monster]: 怪物${hero.name} 使用基础属性 - HP: ${finalHp}, AP: ${finalAp}`);
|
||||||
const baseHp = hero.hp;
|
|
||||||
const baseAp = hero.ap;
|
|
||||||
|
|
||||||
// 怪物属性随等级增长 (根据Design.md中的公式)
|
|
||||||
// HP增长: Math.floor(baseHp * (1 + (level-1) * 0.3))
|
|
||||||
// AP增长: Math.floor(baseAp * (1 + (level-1) * 0.25))
|
|
||||||
const levelHp = Math.floor(baseHp * (1 + (lv - 1) * 0.5));
|
|
||||||
const levelAp = Math.floor(baseAp * (1 + (lv - 1) * 0.1));
|
|
||||||
|
|
||||||
hv.hp = hv.hp_max = levelHp;
|
|
||||||
hv.ap = levelAp;
|
|
||||||
hv.ap_base = levelAp;
|
|
||||||
console.log(`[Monster]: 怪物${hero.name}(等级${lv}) - 基础HP:${baseHp}->等级HP:${levelHp}, 基础AP:${baseAp}->等级AP:${levelAp}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hv.hp = hv.hp_max = finalHp;
|
||||||
|
hv.ap = finalAp;
|
||||||
|
hv.ap_base = finalAp;
|
||||||
|
|
||||||
// 设置基础属性到Attrs系统
|
// 设置基础属性到Attrs系统
|
||||||
hv.Attrs[BuffAttr.SPEED] = hv.speed = hv.speed_base = hero.speed;
|
hv.Attrs[BuffAttr.SPEED] = hv.speed = hv.speed_base = hero.speed;
|
||||||
hv.Attrs[BuffAttr.DIS] = hv.dis = hero.dis;
|
hv.Attrs[BuffAttr.DIS] = hv.dis = hero.dis;
|
||||||
@@ -116,11 +112,11 @@ export class Monster extends ecs.Entity {
|
|||||||
hv.apply_buff(buff.type, buff.value);
|
hv.apply_buff(buff.type, buff.value);
|
||||||
})
|
})
|
||||||
|
|
||||||
// 处理肉鸽模式的词条Buff
|
// 处理肉鸽模式的增强属性
|
||||||
if (rogueBuffData && rogueBuffData.length > 0) {
|
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
||||||
console.log(`[Monster]: 怪物${hero.name}应用肉鸽词条:`, rogueBuffData);
|
console.log(`[Monster]: 怪物${hero.name}应用增强属性:`, enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
||||||
rogueBuffData.forEach((buff:any)=>{
|
enhancement.buffList.forEach((buff:any)=>{
|
||||||
hv.apply_buff(buff.type, buff.value);
|
hv.apply_buff(buff.buffType, buff.value);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,14 @@ import { smc } from "../common/SingletonModuleComp";
|
|||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
// 导入肉鸽配置
|
// 导入肉鸽配置
|
||||||
import { getRogueWaveConfig, RogueConfig, RogueWaveType, AffixCountConfig, MonsterAffixConfig } from "./RogueConfig";
|
import {
|
||||||
|
generateStageConfig,
|
||||||
|
getStageMonsterConfigs,
|
||||||
|
getStageAllMultipliers,
|
||||||
|
MonsterType,
|
||||||
|
StageType,
|
||||||
|
getStageType
|
||||||
|
} from "./RogueConfig";
|
||||||
import { MonModelComp } from "../hero/MonModelComp";
|
import { MonModelComp } from "../hero/MonModelComp";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
@@ -18,16 +25,14 @@ const { ccclass, property } = _decorator;
|
|||||||
/** 视图层对象 */
|
/** 视图层对象 */
|
||||||
@ccclass('MissionMonCompComp')
|
@ccclass('MissionMonCompComp')
|
||||||
@ecs.register('MissionMonComp', false)
|
@ecs.register('MissionMonComp', false)
|
||||||
export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩展支持词条
|
export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使用新的RogueConfig格式
|
||||||
private monsterQueue: Array<{
|
private monsterQueue: Array<{
|
||||||
uuid: number,
|
uuid: number,
|
||||||
position: number,
|
position: number,
|
||||||
isBoss: boolean,
|
type: MonsterType,
|
||||||
level: number,
|
level: number,
|
||||||
affixes?: any[],
|
enhancement?: any, // 增强属性配置
|
||||||
buffData?: any[], // 使用BuffAttr格式的buff数据
|
stageMultipliers?: any // 关卡倍数配置
|
||||||
rogueHp?: number, // 肉鸽固定血量
|
|
||||||
rogueAttack?: number // 肉鸽固定攻击力
|
|
||||||
}> = [];
|
}> = [];
|
||||||
private isSpawning: boolean = false;// 是否正在生成怪物
|
private isSpawning: boolean = false;// 是否正在生成怪物
|
||||||
private spawnInterval: number = 0.1; // 每个怪物生成间隔时间
|
private spawnInterval: number = 0.1; // 每个怪物生成间隔时间
|
||||||
@@ -49,7 +54,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩
|
|||||||
}
|
}
|
||||||
|
|
||||||
fight_ready(){
|
fight_ready(){
|
||||||
console.log("[MissionMonComp]:fight_ready")
|
// console.log("[MissionMonComp]:fight_ready")
|
||||||
this.do_mon_wave()
|
this.do_mon_wave()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +73,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩
|
|||||||
this.isPausing = false;
|
this.isPausing = false;
|
||||||
this.spawnCount = 0;
|
this.spawnCount = 0;
|
||||||
this.spawnTimer = 0;
|
this.spawnTimer = 0;
|
||||||
console.log("[MissionMonComp]: 暂停结束,继续召唤怪物");
|
// console.log("[MissionMonComp]: 暂停结束,继续召唤怪物");
|
||||||
}
|
}
|
||||||
return; // 暂停期间不召唤怪物
|
return; // 暂停期间不召唤怪物
|
||||||
}
|
}
|
||||||
@@ -82,7 +87,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩
|
|||||||
if (this.spawnCount >= 5) {
|
if (this.spawnCount >= 5) {
|
||||||
this.isPausing = true;
|
this.isPausing = true;
|
||||||
this.spawnTimer = 0; // 重置计时器用于暂停计时
|
this.spawnTimer = 0; // 重置计时器用于暂停计时
|
||||||
console.log("[MissionMonComp]: 已召唤5只怪物,开始暂停5秒");
|
// console.log("[MissionMonComp]: 已召唤5只怪物,开始暂停5秒");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,125 +95,101 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩
|
|||||||
|
|
||||||
|
|
||||||
do_mon_wave(){
|
do_mon_wave(){
|
||||||
console.log("[MissionMonComp]:怪物登场,当前波次 :",smc.vmdata.mission_data.current_wave)
|
// console.log("[MissionMonComp]:怪物登场,当前关卡 :",smc.vmdata.mission_data.current_wave)
|
||||||
// 重置召唤相关状态
|
// 重置召唤相关状态
|
||||||
this.spawnCount = 0;
|
this.spawnCount = 0;
|
||||||
this.isPausing = false;
|
this.isPausing = false;
|
||||||
this.spawnTimer = 0;
|
this.spawnTimer = 0;
|
||||||
|
|
||||||
const currentWave = smc.vmdata.mission_data.current_wave;
|
const currentStage = smc.vmdata.mission_data.current_wave;
|
||||||
// 使用肉鸽模式配置
|
// 使用新的肉鸽关卡配置
|
||||||
const rogueWaveConfig = getRogueWaveConfig(currentWave);
|
const stageType = getStageType(currentStage);
|
||||||
console.log(`[MissionMonComp]:肉鸽模式第${currentWave}波配置:`, rogueWaveConfig.description);
|
const monsterConfigs = getStageMonsterConfigs(currentStage);
|
||||||
this.generateRogueMonstersFromConfig(rogueWaveConfig);
|
console.log(`[MissionMonComp]:第${currentStage}关 - ${stageType}类型,怪物数量: ${monsterConfigs.length}`);
|
||||||
|
this.generateMonstersFromStageConfig(monsterConfigs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据肉鸽配置生成怪物(肉鸽模式)
|
// 根据新的关卡配置生成怪物
|
||||||
private generateRogueMonstersFromConfig(rogueWaveConfig: any) {
|
private generateMonstersFromStageConfig(monsterConfigs: any[]) {
|
||||||
const { monsters, waveType } = rogueWaveConfig;
|
const currentStage = smc.vmdata.mission_data.current_wave;
|
||||||
const currentWave = smc.vmdata.mission_data.current_wave;
|
|
||||||
const monsterLevel = RogueConfig.getMonsterLevel(currentWave);
|
|
||||||
smc.vmdata.mission_data.mon_num=monsters.reduce((total: number, group: any) => total + group.count, 0);
|
|
||||||
// 固定9波模式,所有波次都是战斗波次
|
|
||||||
console.log(`[MissionMonComp]:第${currentWave}波 - ${waveType}战斗波次`);
|
|
||||||
|
|
||||||
if (!monsters || monsters.length === 0) {
|
// 设置怪物总数
|
||||||
console.warn(`[MissionMonComp]:肉鸽波次配置中没有怪物信息`);
|
smc.vmdata.mission_data.mon_num = monsterConfigs.length;
|
||||||
|
|
||||||
|
if (!monsterConfigs || monsterConfigs.length === 0) {
|
||||||
|
console.warn(`[MissionMonComp]:关卡${currentStage}配置中没有怪物信息`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
monsters.forEach((monsterGroup: any) => {
|
// 为每个怪物配置生成怪物
|
||||||
const { uuid, count, affixes, enhancedStats, buffData, isBoss, rogueHp, rogueAttack } = monsterGroup;
|
monsterConfigs.forEach((monsterConfig: any, index: number) => {
|
||||||
|
const { uuid, type, enhancement, stageMultipliers } = monsterConfig;
|
||||||
|
|
||||||
// 为每个怪物组生成指定数量的怪物
|
// 位置循环使用 (0-4)
|
||||||
for (let i = 0; i < count; i++) {
|
const position = index % 5;
|
||||||
// 位置循环使用 (0-9),如果怪物数量超过10个位置,则循环使用
|
|
||||||
const position = i % 5;
|
this.addToStageSpawnQueue(
|
||||||
this.addToSpawnQueueWithAffixes(
|
uuid,
|
||||||
uuid,
|
position,
|
||||||
position,
|
type,
|
||||||
isBoss || false,
|
1, // 默认等级1
|
||||||
monsterLevel,
|
enhancement,
|
||||||
affixes,
|
stageMultipliers
|
||||||
buffData, // 现在传递buffData而不是enhancedStats和specialEffects
|
);
|
||||||
rogueHp, // 传递固定血量
|
|
||||||
rogueAttack // 传递固定攻击力
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const totalMonsters = monsters.reduce((total: number, group: any) => total + group.count, 0);
|
console.log(`[MissionMonComp]:关卡${currentStage}将生成 ${monsterConfigs.length} 只怪物`);
|
||||||
console.log(`[MissionMonComp]:肉鸽模式本波次将生成 ${totalMonsters} 只怪物,等级: ${monsterLevel}`);
|
|
||||||
|
|
||||||
// 输出词条信息
|
// 输出增强属性信息
|
||||||
monsters.forEach((monsterGroup: any) => {
|
monsterConfigs.forEach((monsterConfig: any) => {
|
||||||
if (monsterGroup.buffData && monsterGroup.buffData.length > 0) {
|
if (monsterConfig.enhancement && monsterConfig.enhancement.buffList.length > 0) {
|
||||||
console.log(`[MissionMonComp]:怪物 ${monsterGroup.uuid} 拥有词条:`, monsterGroup.buffData);
|
console.log(`[MissionMonComp]:怪物 ${monsterConfig.uuid} (${monsterConfig.type}) 拥有增强属性:`,
|
||||||
// 输出词条名称
|
monsterConfig.enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
||||||
monsterGroup.buffData.forEach((buff: any) => {
|
|
||||||
const config = MonsterAffixConfig[buff.buff_type];
|
|
||||||
if (config) {
|
|
||||||
console.log(`[MissionMonComp]: - ${config.name}: ${config.description}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增:添加到刷怪队列 - 增加level参数(普通模式)
|
// 添加到关卡刷怪队列 - 使用新的配置格式
|
||||||
private addToSpawnQueue(uuid: number, position: number, isBoss: boolean = false, level: number = 1) {
|
private addToStageSpawnQueue(
|
||||||
this.monsterQueue.push({
|
|
||||||
uuid: uuid,
|
|
||||||
position: position,
|
|
||||||
isBoss: isBoss,
|
|
||||||
level: level
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增:添加到刷怪队列 - 支持词条(肉鸽模式)
|
|
||||||
private addToSpawnQueueWithAffixes(
|
|
||||||
uuid: number,
|
uuid: number,
|
||||||
position: number,
|
position: number,
|
||||||
isBoss: boolean = false,
|
type: MonsterType,
|
||||||
level: number = 1,
|
level: number = 1,
|
||||||
affixes?: any[],
|
enhancement?: any,
|
||||||
buffData?: any[],
|
stageMultipliers?: any
|
||||||
rogueHp?: number,
|
|
||||||
rogueAttack?: number
|
|
||||||
) {
|
) {
|
||||||
this.monsterQueue.push({
|
this.monsterQueue.push({
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
position: position,
|
position: position,
|
||||||
isBoss: isBoss,
|
type: type,
|
||||||
level: level,
|
level: level,
|
||||||
affixes: affixes,
|
enhancement: enhancement,
|
||||||
buffData: buffData,
|
stageMultipliers: stageMultipliers
|
||||||
rogueHp: rogueHp,
|
|
||||||
rogueAttack: rogueAttack
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增:从队列中生成下一个怪物 - 传递词条参数
|
// 从队列中生成下一个怪物 - 使用新的配置格式
|
||||||
private spawnNextMonster() {
|
private spawnNextMonster() {
|
||||||
if (this.monsterQueue.length === 0) return;
|
if (this.monsterQueue.length === 0) return;
|
||||||
|
|
||||||
const monsterData = this.monsterQueue.shift();
|
const monsterData = this.monsterQueue.shift();
|
||||||
if (monsterData) {
|
if (monsterData) {
|
||||||
|
const isBoss = monsterData.type === MonsterType.BOSS;
|
||||||
|
|
||||||
this.addMonster(
|
this.addMonster(
|
||||||
monsterData.uuid,
|
monsterData.uuid,
|
||||||
monsterData.position,
|
monsterData.position,
|
||||||
monsterData.isBoss,
|
isBoss,
|
||||||
false,
|
false,
|
||||||
monsterData.level,
|
monsterData.level,
|
||||||
monsterData.buffData,
|
monsterData.enhancement,
|
||||||
monsterData.rogueHp,
|
monsterData.stageMultipliers
|
||||||
monsterData.rogueAttack
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// 增加召唤计数
|
// 增加召唤计数
|
||||||
this.spawnCount++;
|
this.spawnCount++;
|
||||||
console.log(`[MissionMonComp]: 召唤第${this.spawnCount}只怪物,剩余队列: ${this.monsterQueue.length}`);
|
console.log(`[MissionMonComp]: 召唤第${this.spawnCount}只${monsterData.type}怪物,剩余队列: ${this.monsterQueue.length}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,25 +199,25 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩
|
|||||||
is_boss: boolean = false,
|
is_boss: boolean = false,
|
||||||
is_call: boolean = false,
|
is_call: boolean = false,
|
||||||
lv: number = 1,
|
lv: number = 1,
|
||||||
buffData?: any[],
|
enhancement?: any,
|
||||||
rogueHp?: number,
|
stageMultipliers?: any
|
||||||
rogueAttack?: number
|
|
||||||
) {
|
) {
|
||||||
let mon = ecs.getEntity<Monster>(Monster);
|
let mon = ecs.getEntity<Monster>(Monster);
|
||||||
let scale = -1;
|
let scale = -1;
|
||||||
let pos: Vec3 = v3(MonSet[i].pos);
|
let pos: Vec3 = v3(MonSet[i].pos);
|
||||||
|
|
||||||
// 生成怪物,传递词条buff数据和肉鸽固定数值
|
// 生成怪物,传递增强属性和关卡倍数
|
||||||
mon.load(pos, scale, uuid, is_boss, is_call, lv, buffData, rogueHp, rogueAttack);
|
mon.load(pos, scale, uuid, is_boss, is_call, lv, enhancement, stageMultipliers);
|
||||||
|
|
||||||
// 如果有词条buff数据,记录到控制台
|
// 如果有增强属性,记录到控制台
|
||||||
if (buffData && buffData.length > 0) {
|
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
||||||
console.log(`[MissionMonComp]: 怪物 ${uuid} 获得肉鸽词条Buff:`, buffData);
|
console.log(`[MissionMonComp]: 怪物 ${uuid} 获得增强属性:`,
|
||||||
|
enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有肉鸽固定数值,记录到控制台
|
// 如果有关卡倍数,记录到控制台
|
||||||
if (rogueHp !== undefined && rogueAttack !== undefined) {
|
if (stageMultipliers) {
|
||||||
console.log(`[MissionMonComp]: 怪物 ${uuid} 使用肉鸽固定数值 - HP: ${rogueHp}, 攻击: ${rogueAttack}`);
|
console.log(`[MissionMonComp]: 怪物 ${uuid} 关卡倍数 - HP: x${stageMultipliers.hp.toFixed(2)}, 攻击: x${stageMultipliers.attack.toFixed(2)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user