refactor: Redesign Invoker disciplines for pact bonuses and guardian boons
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s

- Replace generic spell-casting/void-manipulation with pact-focused disciplines
- Add Pact Attunement (light): reduces pact signing time, boosts pact affinity
- Add Guardian's Boon (dark): amplifies all guardian unique perks
- Add pactAffinityBonus and guardianBoonMultiplier stat keys to effect system
- Apply pactAffinityBonus in pact signing time calculation (gameStore)
- Scale guardian boon values by guardianBoonMultiplier (combat-utils)
- Guard Invoker discipline activation behind signedPacts.length > 0
- Add 'Signed guardian pact' prerequisite display in discipline-math
This commit is contained in:
2026-05-26 21:43:46 +02:00
parent 02600754e7
commit 1aea72c013
10 changed files with 108 additions and 50 deletions
+51 -28
View File
@@ -1,59 +1,82 @@
// ─── Invoker Discipline Files ─────────────────────────────────────────────────
// Attunement-focused disciplines for Invoker role
// The Invoker forms pacts with guardians and channels their elemental boons.
import { DisciplinesAttunementType } from '../../types/disciplines';
import type { DisciplineDefinition } from '../../types/disciplines';
export const invokerDisciplines: DisciplineDefinition[] = [
{
id: 'spell-casting',
name: 'Spell Casting',
id: 'pact-attunement',
name: 'Pact Attunement',
attunement: DisciplinesAttunementType.INVOKER,
manaType: 'light',
baseCost: 10,
description: 'Improve spell power and effectiveness.',
statBonus: { stat: 'baseDamageBonus', baseValue: 6, label: 'Base Damage' },
difficultyFactor: 130,
scalingFactor: 65,
drainBase: 3,
baseCost: 12,
description:
'Deepen your bond with guardian spirits. Reduces pact signing time and amplifies pact power.',
statBonus: { stat: 'pactAffinityBonus', baseValue: 0.05, label: 'Pact Affinity' },
difficultyFactor: 150,
scalingFactor: 80,
drainBase: 4,
requires: ['signed_pact'],
perks: [
{
id: 'spell-1',
id: 'pact-affinity-scaling',
type: 'once',
threshold: 200,
threshold: 100,
value: 0,
description: '+10 Base Damage',
bonus: { stat: 'baseDamageBonus', amount: 10 },
description: 'Unlock pact affinity scaling — pact bonuses grow with XP.',
},
{
id: 'spell-2',
id: 'pact-affinity-infinite',
type: 'infinite',
threshold: 400,
value: 30,
description: 'Every 300 XP: +5 Base Damage',
bonus: { stat: 'baseDamageBonus', amount: 5 },
threshold: 200,
value: 100,
description: 'Every 100 XP: +5% pact affinity',
bonus: { stat: 'pactAffinityBonus', amount: 0.05 },
},
{
id: 'pact-power-boost',
type: 'capped',
threshold: 500,
value: 200,
maxTier: 5,
description: 'Every 200 XP: +3% guardian pact boon strength (max +15%)',
bonus: { stat: 'guardianBoonMultiplier', amount: 0.03 },
},
],
},
{
id: 'void-manipulation',
name: 'Void Manipulation',
id: 'guardians-boon',
name: "Guardian's Boon",
attunement: DisciplinesAttunementType.INVOKER,
manaType: 'void',
baseCost: 15,
description: 'Master the exotic void mana for devastating effects.',
statBonus: { stat: 'baseDamageMultiplier', baseValue: 0.15, label: 'Base Damage Multiplier' },
manaType: 'dark',
baseCost: 18,
description:
'Channel the unique blessings of every guardian you have bonded with. Amplifies all guardian unique perks.',
statBonus: { stat: 'guardianBoonMultiplier', baseValue: 0.10, label: 'Guardian Boon Power' },
difficultyFactor: 200,
scalingFactor: 100,
drainBase: 7,
drainBase: 6,
requires: ['signed_pact'],
perks: [
{
id: 'void-1',
id: 'boon-1',
type: 'once',
threshold: 300,
threshold: 100,
value: 0,
description: 'Unlock void damage multiplier',
description: 'Active guardian boons gain +10% effectiveness',
bonus: { stat: 'guardianBoonMultiplier', amount: 0.10 },
},
{
id: 'boon-2',
type: 'capped',
threshold: 200,
value: 350,
maxTier: 5,
description: 'Every 350 XP: +5% guardian boon effectiveness (max +25%)',
bonus: { stat: 'guardianBoonMultiplier', amount: 0.05 },
},
],
},
];
];
+14
View File
@@ -73,6 +73,18 @@ export interface UnifiedEffects extends ComputedEffects {
disciplineBonuses: Record<string, number>;
disciplineMultipliers: Record<string, number>;
disciplineSpecials: Set<string>;
/**
* Total pact affinity bonus from disciplines and prestige upgrades.
* Reduces pact signing time: effectiveTime = baseTime * (1 - pactAffinityBonus).
* Capped at 0.9 to prevent zero/negative times.
*/
pactAffinityBonus: number;
/**
* Total guardian boon multiplier from disciplines.
* Scales the effectiveness of all guardian unique perks.
* 1.0 = base, 1.15 = +15%, etc.
*/
guardianBoonMultiplier: number;
}
export function computeAllEffects(
@@ -128,6 +140,8 @@ export function computeAllEffects(
disciplineBonuses: disciplineEffects.bonuses,
disciplineMultipliers: disciplineEffects.multipliers,
disciplineSpecials: disciplineEffects.specials,
pactAffinityBonus: Math.min(0.9, disciplineEffects.bonuses.pactAffinityBonus || 0),
guardianBoonMultiplier: 1 + (disciplineEffects.bonuses.guardianBoonMultiplier || 0),
};
if (equipmentEffects.bonuses.critChance) {
@@ -23,6 +23,8 @@ const KNOWN_BONUS_STATS = new Set([
'baseDamageBonus',
'elementCapBonus',
'meditationCapBonus',
'pactAffinityBonus',
'guardianBoonMultiplier',
]);
export interface DisciplineEffectsResult {
+7 -1
View File
@@ -46,7 +46,7 @@ export interface DisciplineStoreState {
}
export interface DisciplineStoreActions {
activate: (id: string, gameState?: { elements?: Record<string, ElementState> }) => void;
activate: (id: string, gameState?: { elements?: Record<string, ElementState>; signedPacts?: number[] }) => void;
deactivate: (id: string) => void;
processTick: (mana: { rawMana: number; elements: Record<string, ElementState> }) => {
rawMana: number;
@@ -90,6 +90,12 @@ export const useDisciplineStore = create<DisciplineStore>()(
if (nonPaused >= s.concurrentLimit) return s;
if (!canProceedDiscipline(def, existing, gameState)) return s;
// Invoker disciplines require at least one signed guardian pact
if (def.attunement === 'invoker') {
const signedPacts = gameState?.signedPacts || [];
if (signedPacts.length === 0) return s;
}
// Check discipline prerequisites (requires field → discipline XP)
const prereqCheck = checkDisciplinePrerequisites(def, s.disciplines, ALL_DISCIPLINES);
if (!prereqCheck.canProceed) return s;
+4 -4
View File
@@ -223,11 +223,11 @@ export const useGameStore = create<GameCoordinatorStore>()(
if (ctx.prestige.pactRitualFloor !== null) {
const guardian = getGuardianForFloor(ctx.prestige.pactRitualFloor);
if (guardian) {
const pactAffinityBonus = 1 - (ctx.prestige.prestigeUpgrades.pactAffinity || 0) * 0.1;
const requiredTime = guardian.pactTime * pactAffinityBonus;
const newProgress = ctx.prestige.pactRitualProgress + HOURS_PER_TICK;
const pactAffinity = Math.min(0.9,
(ctx.prestige.prestigeUpgrades.pactAffinity || 0) * 0.1 + (disciplineEffects.bonuses.pactAffinityBonus || 0));
const requiredTime = guardian.pactTime * (1 - pactAffinity);
if (newProgress >= requiredTime) {
if (ctx.prestige.pactRitualProgress + HOURS_PER_TICK >= requiredTime) {
addLog(`📜 Pact signed with ${guardian.name}! You have gained their boons.`);
// Unlock mana types granted by this guardian
+17 -13
View File
@@ -71,7 +71,10 @@ export interface BoonBonuses {
}
// Helper to calculate total boon bonuses from signed pacts
export function getBoonBonuses(signedPacts: number[]): BoonBonuses {
export function getBoonBonuses(
signedPacts: number[],
guardianBoonMultiplier: number = 1.0,
): BoonBonuses {
const bonuses: BoonBonuses = {
maxMana: 0,
manaRegen: 0,
@@ -92,42 +95,43 @@ export function getBoonBonuses(signedPacts: number[]): BoonBonuses {
if (!guardian) continue;
for (const boon of guardian.boons) {
let value = boon.value * guardianBoonMultiplier;
switch (boon.type) {
case 'maxMana':
bonuses.maxMana += boon.value;
bonuses.maxMana += value;
break;
case 'manaRegen':
bonuses.manaRegen += boon.value;
bonuses.manaRegen += value;
break;
case 'castingSpeed':
bonuses.castingSpeed += boon.value;
bonuses.castingSpeed += value;
break;
case 'elementalDamage':
bonuses.elementalDamage += boon.value;
bonuses.elementalDamage += value;
break;
case 'rawDamage':
bonuses.rawDamage += boon.value;
bonuses.rawDamage += value;
break;
case 'critChance':
bonuses.critChance += boon.value;
bonuses.critChance += value;
break;
case 'critDamage':
bonuses.critDamage += boon.value;
bonuses.critDamage += value;
break;
case 'spellEfficiency':
bonuses.spellEfficiency += boon.value;
bonuses.spellEfficiency += value;
break;
case 'manaGain':
bonuses.manaGain += boon.value;
bonuses.manaGain += value;
break;
case 'insightGain':
bonuses.insightGain += boon.value;
bonuses.insightGain += value;
break;
case 'studySpeed':
bonuses.studySpeed += boon.value;
bonuses.studySpeed += value;
break;
case 'prestigeInsight':
bonuses.prestigeInsight += boon.value;
bonuses.prestigeInsight += value;
break;
}
}
+6
View File
@@ -125,6 +125,12 @@ export function checkDisciplinePrerequisites(
const missingPrereqs: string[] = [];
for (const reqId of discipline.requires) {
// Special case: 'signed_pact' requires at least one guardian pact
if (reqId === 'signed_pact') {
missingPrereqs.push('Signed guardian pact');
continue;
}
// Check if this is a discipline prerequisite (exists in definitions)
const reqDef = allDefinitions.find((d) => d.id === reqId);
if (reqDef) {