🐞 fix(稷下学宫): 修复圣物效果2009

This commit is contained in:
zhangxk
2023-09-13 21:13:39 +08:00
parent 22f84624da
commit 2860a89075
2 changed files with 6 additions and 5 deletions

View File

@@ -426,7 +426,7 @@ export class RougeHandler {
const dbCharaMap = dbCharas.reduce((result, cur) => { result.set(cur.charaCode, { ...cur }); return result; }, new Map<string, RougelikeCharaType>());
let isAp: boolean = false, isRound: boolean = false, arrAuthorType: number[] = [];
let isAp: boolean = false, isRound: boolean = false, arrAuthorType: number[] = [], isHpZero = false;
for (let obj of rougeDamage) {
if (obj.isAp) isAp = true;
if (obj.isRound) isRound = true;
@@ -439,6 +439,7 @@ export class RougeHandler {
const passiveCardData = gameData.rougePassiveCard.get(cardId);
if (nodeType == ROUGE_LIKE_NODE_TYPE.BOSS && passiveCardData && passiveCardData.authorType) arrAuthorType.push(passiveCardData.authorType);
}
if (!obj.hp || obj.hp == 0) isHpZero = true;
}
await updateChalleng(dbRecord, roleId, sid, gameCode, layer, rougeDamage, isAp, isRound);
@@ -446,7 +447,7 @@ export class RougeHandler {
let recoveryHp = false;
if (status != 0 && nodeType != ROUGE_LIKE_NODE_TYPE.BOSS) {
if (status != 1 && nodeType != ROUGE_LIKE_NODE_TYPE.BOSS && isHpZero) {
recoveryHp = await getNoBossRecoveryHp(roleId, gameCode);
if (recoveryHp) status = 1;
}
@@ -466,7 +467,7 @@ export class RougeHandler {
if (!chara) return resResult(STATUS.BATTLE_ABNORMAL)
if (chara.maxHp < hp) hp = chara.maxHp;
if (recoveryHp) hp = chara.maxHp;
if (recoveryHp && hp == 0) hp = chara.maxHp;
if (hpRatio > 0) hp = Math.min(Math.floor(hp + (chara.maxHp * hpRatio / 100)), chara.maxHp);
if ((recoveryNum--) > 0 && hp == 0) { hp = chara.maxHp; }

View File

@@ -469,10 +469,10 @@ export async function getNoBossRecoveryHp(roleId: string, gameCode: string) {
for (const { effectParam, cardCode } of newEffect) {
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
return true;
}
return true; // 拿到true 将所有学员更新和hp=maxHp
return false; // 拿到true 将所有学员更新和hp=maxHp
}
// 战斗胜利后若有学员死亡则满血复活X名死亡学员 2010