feat: scale guardian pact cost with HP, power, and armor
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s

This commit is contained in:
2026-05-29 15:00:50 +02:00
parent e0e7beb495
commit 86c80a25ca
5 changed files with 922 additions and 454 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# Circular Dependencies
Generated: 2026-05-28T19:24:11.154Z
Generated: 2026-05-29T12:54:57.998Z
No circular dependencies found. ✅
+5 -1
View File
@@ -1,6 +1,6 @@
{
"_meta": {
"generated": "2026-05-28T19:24:09.393Z",
"generated": "2026-05-29T12:54:56.259Z",
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
},
@@ -492,6 +492,7 @@
],
"stores/crafting-initial-state.ts": [
"crafting-utils.ts",
"stores/craftingStore.types.ts",
"types.ts"
],
"stores/craftingStore.ts": [
@@ -535,7 +536,10 @@
],
"stores/gameActions.ts": [
"effects/discipline-effects.ts",
"stores/attunementStore.ts",
"stores/combatStore.ts",
"stores/craftingStore.ts",
"stores/discipline-slice.ts",
"stores/gameStore.types.ts",
"stores/manaStore.ts",
"stores/prestigeStore.ts",
+895 -436
View File
File diff suppressed because it is too large Load Diff
+19 -14
View File
@@ -17,6 +17,11 @@ function hp(floor: number): number {
return Math.floor(base * Math.pow(floor / 10, exponent));
}
// Helper: pact cost scales with guardian HP, power, and armor
function pactCost(hpVal: number, power: number, armor: number): number {
return Math.floor(hpVal * 0.3 + power * 5 + hpVal * armor * 0.5);
}
// ─── Base Elements (Floors 1070) ────────────────────────────────────────────
const BASE_GUARDIANS: Record<number, GuardianDef> = {
@@ -28,7 +33,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 5, desc: '+5% Fire damage' },
{ type: 'maxMana', value: 50, desc: '+50 max mana' },
],
pactCost: 500, pactTime: 2,
pactCost: pactCost(hp(10), 50, 0.10), pactTime: 2,
uniquePerk: 'Fire spells cast 10% faster',
power: 50,
effects: [{ type: 'burn', value: 0.1 }],
@@ -43,7 +48,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 5, desc: '+5% Water damage' },
{ type: 'manaRegen', value: 0.5, desc: '+0.5 mana regen' },
],
pactCost: 1000, pactTime: 4,
pactCost: pactCost(hp(20), 150, 0.15), pactTime: 4,
uniquePerk: 'Water spells deal +15% damage',
power: 150,
effects: [{ type: 'armor_pierce', value: 0.15 }],
@@ -58,7 +63,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 5, desc: '+5% Air damage' },
{ type: 'castingSpeed', value: 5, desc: '+5% casting speed' },
],
pactCost: 2000, pactTime: 6,
pactCost: pactCost(hp(30), 300, 0.18), pactTime: 6,
uniquePerk: 'Air spells have 15% crit chance',
power: 300,
effects: [{ type: 'cast_speed', value: 0.05 }],
@@ -73,7 +78,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 5, desc: '+5% Earth damage' },
{ type: 'maxMana', value: 100, desc: '+100 max mana' },
],
pactCost: 4000, pactTime: 8,
pactCost: pactCost(hp(40), 500, 0.25), pactTime: 8,
uniquePerk: 'Earth spells deal +25% damage to guardians',
power: 500,
effects: [{ type: 'armor_pierce', value: 0.2 }],
@@ -88,7 +93,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 10, desc: '+10% Light damage' },
{ type: 'insightGain', value: 10, desc: '+10% insight gain' },
],
pactCost: 8000, pactTime: 10,
pactCost: pactCost(hp(50), 800, 0.20), pactTime: 10,
uniquePerk: 'Light spells reveal enemy weaknesses (+20% damage)',
power: 800,
effects: [{ type: 'crit_chance', value: 0.1 }],
@@ -103,7 +108,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 10, desc: '+10% Dark damage' },
{ type: 'critDamage', value: 15, desc: '+15% crit damage' },
],
pactCost: 15000, pactTime: 12,
pactCost: pactCost(hp(60), 1200, 0.22), pactTime: 12,
uniquePerk: 'Dark spells deal +25% damage to armored enemies',
power: 1200,
effects: [{ type: 'crit_damage', value: 0.15 }],
@@ -118,7 +123,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 10, desc: '+10% Death damage' },
{ type: 'rawDamage', value: 10, desc: '+10% raw damage' },
],
pactCost: 25000, pactTime: 14,
pactCost: pactCost(hp(70), 2500, 0.25), pactTime: 14,
uniquePerk: 'Death spells execute enemies below 20% HP',
power: 2500,
effects: [{ type: 'raw_damage', value: 0.1 }],
@@ -135,7 +140,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'maxMana', value: 150, desc: '+150 max mana' },
{ type: 'manaRegen', value: 1.0, desc: '+1.0 mana regen' },
],
pactCost: 35000, pactTime: 16,
pactCost: pactCost(hp(80), 3500, 0.20), pactTime: 16,
uniquePerk: 'Transference spells have 25% reduced cost',
power: 3500,
effects: [{ type: 'cost_reduction', value: 0.25 }],
@@ -152,7 +157,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 15, desc: '+15% Metal damage' },
{ type: 'maxMana', value: 150, desc: '+150 max mana' },
],
pactCost: 60000, pactTime: 18,
pactCost: pactCost(hp(90), 6000, 0.30), pactTime: 18,
uniquePerk: 'Metal spells pierce 20% armor',
power: 6000,
effects: [{ type: 'armor_pierce', value: 0.2 }],
@@ -167,7 +172,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 15, desc: '+15% Sand damage' },
{ type: 'manaRegen', value: 1.5, desc: '+1.5 mana regen' },
],
pactCost: 80000, pactTime: 20,
pactCost: pactCost(hp(100), 8000, 0.25), pactTime: 20,
uniquePerk: 'Sand spells slow enemies by 25%',
power: 8000,
effects: [{ type: 'slow', value: 0.25 }],
@@ -182,7 +187,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 15, desc: '+15% Lightning damage' },
{ type: 'castingSpeed', value: 15, desc: '+15% casting speed' },
],
pactCost: 100000, pactTime: 22,
pactCost: pactCost(hp(110), 10000, 0.22), pactTime: 22,
uniquePerk: 'Lightning spells chain to 2 additional targets',
power: 10000,
effects: [{ type: 'chain', value: 2 }],
@@ -200,7 +205,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'maxMana', value: 300, desc: '+300 max mana' },
{ type: 'manaRegen', value: 2, desc: '+2 mana regen' },
],
pactCost: 150000, pactTime: 26,
pactCost: pactCost(hp(120), 15000, 0.35), pactTime: 26,
uniquePerk: 'Crystal spells reflect 15% damage back to attackers',
power: 15000,
effects: [{ type: 'reflect', value: 0.15 }],
@@ -215,7 +220,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'elementalDamage', value: 25, desc: '+25% Stellar damage' },
{ type: 'insightGain', value: 20, desc: '+20% insight gain' },
],
pactCost: 200000, pactTime: 30,
pactCost: pactCost(hp(130), 20000, 0.30), pactTime: 30,
uniquePerk: 'Stellar spells deal +30% damage at night',
power: 20000,
effects: [{ type: 'night_bonus', value: 0.3 }],
@@ -231,7 +236,7 @@ const BASE_GUARDIANS: Record<number, GuardianDef> = {
{ type: 'rawDamage', value: 15, desc: '+15% raw damage' },
{ type: 'maxMana', value: 400, desc: '+400 max mana' },
],
pactCost: 300000, pactTime: 34,
pactCost: pactCost(hp(140), 30000, 0.35), pactTime: 34,
uniquePerk: 'Void spells ignore 40% of all resistances',
power: 30000,
effects: [{ type: 'resist_ignore', value: 0.4 }],
+2 -2
View File
@@ -93,7 +93,7 @@ export function getComboGuardian(floor: number): GuardianDef {
{ type: 'elementalDamage', value: 10, desc: `+10% ${el1} damage` },
{ type: 'elementalDamage', value: 10, desc: `+10% ${el2} damage` },
],
pactCost: Math.floor(hp * 0.5),
pactCost: Math.floor(hp * 0.3 + Math.floor(hp * 0.5) * 5 + hp * armor * 0.5),
pactTime: 20 + Math.floor((floor - 150) / 10),
uniquePerk: `Dual-aspect: ${el1} and ${el2} spells gain +20% effectiveness`,
power: Math.floor(hp * 0.5),
@@ -101,7 +101,7 @@ export function getComboGuardian(floor: number): GuardianDef {
{ type: `${el1}_boost`, value: 0.2 },
{ type: `${el2}_boost`, value: 0.2 },
],
signingCost: { mana: Math.floor(hp * 0.5), time: 20 + Math.floor((floor - 150) / 10) },
signingCost: { mana: Math.floor(hp * 0.3 + Math.floor(hp * 0.5) * 5 + hp * armor * 0.5), time: 20 + Math.floor((floor - 150) / 10) },
unlocksMana: [el1, el2],
damageMultiplier: 3.0 + (floor - 150) * 0.02,
insightMultiplier: 2.5 + (floor - 150) * 0.01,