사냥 처치 보상 추가
This commit is contained in:
@@ -159,6 +159,8 @@ export function simulateCombat(data, rng, stats) {
|
||||
let nextTurnAddCards = [];
|
||||
let turnAttackCardsPlayed = 0, turnDiscardedCards = 0;
|
||||
let cardsDrawnThisCombat = 0;
|
||||
let bonusRewardScreens = 0;
|
||||
let activeKillReward = 0;
|
||||
let energy = 0;
|
||||
const powers = [];
|
||||
const mob = monsters.map((m) => ({
|
||||
@@ -303,7 +305,10 @@ export function simulateCombat(data, rng, stats) {
|
||||
m2.hp = r2.hp; m2.block = r2.block;
|
||||
const attackPoison = powerFieldTotal('attackPoison');
|
||||
if (d2 > 0 && attackPoison > 0) m2.poison += attackPoison;
|
||||
if (m2.hp <= 0) m2.alive = false;
|
||||
if (m2.hp <= 0) {
|
||||
m2.alive = false;
|
||||
if (c.rewardOnKill) bonusRewardScreens += c.rewardOnKill;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dmg = target.vuln > 0 ? Math.floor(totalNv * 1.5) : totalNv;
|
||||
@@ -316,7 +321,10 @@ export function simulateCombat(data, rng, stats) {
|
||||
}
|
||||
const attackPoison = powerFieldTotal('attackPoison');
|
||||
if (dmg > 0 && attackPoison > 0) target.poison += attackPoison;
|
||||
if (target.hp <= 0) target.alive = false;
|
||||
if (target.hp <= 0) {
|
||||
target.alive = false;
|
||||
if (c.rewardOnKill) bonusRewardScreens += c.rewardOnKill;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c.block) blockGained = addBlock(c.block);
|
||||
@@ -338,6 +346,7 @@ export function simulateCombat(data, rng, stats) {
|
||||
if (c.selfVuln) pVuln += c.selfVuln;
|
||||
if (c.heal) pHp = Math.min(pHp + c.heal, PLAYER_HP);
|
||||
if (c.gainEnergy) energy += c.gainEnergy;
|
||||
activeKillReward = c.rewardOnKill || 0;
|
||||
if (c.intangible) pIntangible += c.intangible;
|
||||
queueNextTurnEffects(c);
|
||||
let drawnCards = [];
|
||||
@@ -464,7 +473,7 @@ export function simulateCombat(data, rng, stats) {
|
||||
if (c.exhaust === true || String(c.desc || '').includes('소멸.')) exhaust.push(id);
|
||||
else if (c.kind !== 'Power') discard.push(id);
|
||||
applyDiscardEffects(c);
|
||||
if (aliveList().length === 0) return { win: true, turns, playerHpRemaining: pHp };
|
||||
if (aliveList().length === 0) return { win: true, turns, playerHpRemaining: pHp, bonusRewardScreens };
|
||||
}
|
||||
// 화상(endTurnDamage) — 손패에 있으면 턴 종료 시 피해 (Lua EndPlayerTurn 동기화)
|
||||
let burn = 0;
|
||||
@@ -527,9 +536,9 @@ export function simulateCombat(data, rng, stats) {
|
||||
if (pHp <= 0) return { win: false, turns, playerHpRemaining: 0 };
|
||||
}
|
||||
// 독 사망 등 적 페이즈 중 전멸 처리 (Lua FinishEnemyTurn→CheckCombatEnd 동기화)
|
||||
if (!mob.some((m) => m.alive)) return { win: true, turns, playerHpRemaining: pHp };
|
||||
if (!mob.some((m) => m.alive)) return { win: true, turns, playerHpRemaining: pHp, bonusRewardScreens };
|
||||
}
|
||||
return { win: false, turns, playerHpRemaining: pHp, draw: true };
|
||||
return { win: false, turns, playerHpRemaining: pHp, draw: true, bonusRewardScreens };
|
||||
}
|
||||
|
||||
function mean(a) { return a.length ? a.reduce((s, x) => s + x, 0) / a.length : 0; }
|
||||
|
||||
Reference in New Issue
Block a user