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