diff --git a/game-server/app/servers/guild/handler/guildBossHandler.ts b/game-server/app/servers/guild/handler/guildBossHandler.ts index ab3266acb..fd1798236 100644 --- a/game-server/app/servers/guild/handler/guildBossHandler.ts +++ b/game-server/app/servers/guild/handler/guildBossHandler.ts @@ -158,6 +158,10 @@ export class GuildHandler { if (!flag) { return resResult(STATUS.REDLOCK_ERR); } + if(damage < 0) { + return resResult(STATUS.WRONG_PARMS); + } + //记录伤害 let bossInstance = await BossInstanceModel.updateBossHp(bossCode, damage, roleId); if(!bossInstance) { // 如果已经被扣成负的了 diff --git a/game-server/app/services/guildBossService.ts b/game-server/app/services/guildBossService.ts index 00323daa1..e0ebb22aa 100644 --- a/game-server/app/services/guildBossService.ts +++ b/game-server/app/services/guildBossService.ts @@ -216,11 +216,13 @@ export async function getBossHp(serverId: number, guildCode: string, dicBossBase } let subCe = getBossSubAttrCe(dicWar.secondAttrLevel, bossLv) console.log(`getBossHp activeCe ${activeCe} subCe ${subCe}`); - let B = (activeCe - subCe)/6/GUILDACTIVITY.GATEACTIVITY_ENEMYCE; - if(B <= 0) B = 1; - console.log(`getBossHp B ${B}`); + let B = (activeCe/6 - subCe)/GUILDACTIVITY.GATEACTIVITY_ENEMYCE; let bossBaseHp = B * hp; let bossHp = Math.floor(bossBaseHp * bossHpRatio); - if(bossHp <= 0) bossHp = minBossHp; + if(B < 1) { + B = 1; + bossHp = minBossHp; + } + console.log(`getBossHp B ${B}`); return { ratio: B, bossHp }; } \ No newline at end of file