feat(card-frames): 보상 등급 가중 추첨 70/25/5 (Lua + JS 미러 rarityForRoll·경계 테스트)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 23:40:58 +09:00
parent 35dfcbaffe
commit aaa68ebe07
3 changed files with 29 additions and 2 deletions

View File

@@ -29,6 +29,13 @@ export function shuffle(arr, rng) {
// 공격 피해 공식 — Lua CalcPlayerAttack(힘·약화) + DealDamageToTarget(취약)과 동기화.
// floor((base + str) * (weak>0 ? 0.75 : 1)) → floor(... * (vulnOnTarget>0 ? 1.5 : 1))
// 보상 카드 등급 추첨 (Lua OfferReward 미러) — roll ∈ 1..100, normal 70 / unique 25 / legend 5
export function rarityForRoll(roll) {
if (roll > 95) return 'legend';
if (roll > 70) return 'unique';
return 'normal';
}
export function calcAttack(base, str, weak, vulnOnTarget) {
let dmg = base + str;
if (weak > 0) dmg = Math.floor(dmg * 0.75);