军团:修复boss血量

This commit is contained in:
luying
2022-05-23 17:27:12 +08:00
parent c7a82b0738
commit 874caa7bed

View File

@@ -205,18 +205,19 @@ export async function getBossHp(serverId: number, guildCode: string, dicBossBase
let activeGuilds = serverRecord.activeGuilds||[];
let myGuild = activeGuilds.find(cur => cur.guildCode == guildCode);
let activeCe = 0;
let activeCe = 0, playerCnt = 0;
if(myGuild) {
let activePlayers = myGuild.players||[];
activePlayers.sort((a, b) => b.ce - a.ce);
for(let i = 0; i < 10; i++) {
if(!activePlayers[i]) break;
activeCe += activePlayers[i].topLineupCe;
playerCnt ++;
}
}
let subCe = getBossSubAttrCe(dicWar.secondAttrLevel, bossLv)
console.log(`getBossHp activeCe ${activeCe} subCe ${subCe}`);
let B = (activeCe/6 - subCe)/GUILDACTIVITY.GATEACTIVITY_ENEMYCE;
console.log(`getBossHp activeCe ${activeCe} playerCnt ${playerCnt} subCe ${subCe}`);
let B = (activeCe/playerCnt/6 - subCe)/GUILDACTIVITY.GATEACTIVITY_ENEMYCE;
let bossBaseHp = B * hp;
let bossHp = Math.floor(bossBaseHp * bossHpRatio);
if(B < 1) {