[priority: critical] Guardian pact mana cost should scale with HP, power, and armor #200
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BUG: Pact mana cost doesn't scale with guardian difficulty
Bug Summary
Guardian pact costs are hardcoded arbitrary values that don't scale with guardian stats. Only combo guardians (floor 150+) derive cost from HP. User wants cost to scale with all relevant stats: HP, power, AND armor.
Current Behavior
File:
src/lib/game/data/guardian-data.ts- All pact costs are hardcoded round numbersFloor 10:
pactCost: 500vs HP: 5,000 / PWR: 50 / ARM: 10%Floor 20:
pactCost: 1,000vs HP: 11,486 / PWR: 150 / ARM: 15%Floor 140:
pactCost: 300,000vs HP: 578,096 / PWR: 30,000 / ARM: 35%No formula ties cost to stats
File:
src/lib/game/data/guardian-encounters.ts, line 96 - Only combo guardians use formula:pactCost: Math.floor(hp * 0.5)Required Fix
Create a formula that scales pact cost with HP, power, AND armor:
Suggested formula (balance as needed):
Apply this to ALL guardians, not just combo guardians.
Priority
CRITICAL - Required for guardian restructure and game balance
Starting work on guardian pact mana cost scaling. Will replace hardcoded pactCost values in guardian-data.ts with a formula that scales with HP, power, and armor, using the suggested formula from the issue as a starting point.
Fix applied and committed.
Changes Made
src/lib/game/data/guardian-data.tspactCost(hpVal, power, armor)helper function using the formula:pactCostvalues with calls to the formula, passing each guardian's actual HP, power, and armor values.src/lib/game/data/guardian-encounters.tsgetComboGuardian()to use the same formula for bothpactCostandsigningCost, replacing the oldMath.floor(hp * 0.5)which only scaled with HP.Sample Output (new costs)
All 896 tests passing. Pre-commit checks passed (file sizes, circular deps).
Issue resolved. Guardian pact costs now scale with HP, power, and armor using the formula
floor(hp * 0.3 + power * 5 + hp * armor * 0.5). Applied to all 14 static guardians and combo guardians. Commit:86c80a2.