Files
Mana-Loop/src/lib/game/data/disciplines/elemental-regen-advanced.ts
T
n8n-gitea 26639746e9
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
discipline: elemental revamp - rename, lock, merge tabs, add missing, dedupe
2026-05-28 13:15:14 +02:00

153 lines
5.1 KiB
TypeScript

// ─── Elemental Conversion Disciplines (Composite + Exotic) ──────────────────────
// Conversion disciplines for composite and exotic mana types.
// All are BASE attunement so they are available to every role once the element is unlocked.
import { DisciplinesAttunementType } from '../../types/disciplines';
import type { DisciplineDefinition } from '../../types/disciplines';
interface AdvancedConversionConfig {
id: string;
name: string;
manaType: DisciplineDefinition['manaType'];
cost: number;
description: string;
conversionRate: number;
difficultyFactor: number;
scalingFactor: number;
drainBase: number;
sourceManaTypes: DisciplineDefinition['manaType'][];
customOnceDescription?: string;
customOnceAmount?: number;
customInfiniteDescription?: string;
customInfiniteAmount?: number;
infiniteThreshold?: number;
}
function createAdvancedConversionDiscipline(cfg: AdvancedConversionConfig): DisciplineDefinition {
const nameLower = cfg.name.toLowerCase();
const onceDesc = cfg.customOnceDescription ?? `+${cfg.conversionRate} ${cfg.name} Conversion/sec`;
const onceAmt = cfg.customOnceAmount ?? cfg.conversionRate;
const infDesc = cfg.customInfiniteDescription ?? `Every 100 XP: +${cfg.conversionRate * 0.5} ${cfg.name} Conversion/sec`;
const infAmt = cfg.customInfiniteAmount ?? cfg.conversionRate * 0.5;
const infThreshold = cfg.infiniteThreshold ?? 400;
return {
id: cfg.id,
name: `${cfg.name} Mana Conversion Speed`,
attunement: DisciplinesAttunementType.BASE,
manaType: cfg.manaType,
baseCost: cfg.cost,
description: cfg.description,
statBonus: {
stat: `conversion_${cfg.manaType}` as DisciplineDefinition['statBonus']['stat'],
baseValue: cfg.conversionRate,
label: `${cfg.name} Conversion/sec`,
},
difficultyFactor: cfg.difficultyFactor,
scalingFactor: cfg.scalingFactor,
drainBase: cfg.drainBase,
conversionRate: cfg.conversionRate,
sourceManaTypes: cfg.sourceManaTypes,
requires: [cfg.manaType],
perks: [
{
id: `${cfg.id}-1`,
type: 'once',
threshold: 150,
value: 0,
description: onceDesc,
bonus: { stat: `conversion_${cfg.manaType}`, amount: onceAmt },
},
{
id: `${cfg.id}-inf`,
type: 'infinite',
threshold: infThreshold,
value: 100,
description: infDesc,
bonus: { stat: `conversion_${cfg.manaType}`, amount: infAmt },
},
],
};
}
export const elementalRegenAdvancedDisciplines: DisciplineDefinition[] = [
// ── Composite Elements ─────────────────────────────────────────────────────
createAdvancedConversionDiscipline({
id: 'regen-metal',
name: 'Metal',
manaType: 'metal',
cost: 12,
description: 'Convert raw mana + fire mana + earth mana into metal mana over time.',
conversionRate: 0.35,
difficultyFactor: 160,
scalingFactor: 80,
drainBase: 2,
sourceManaTypes: ['raw', 'fire', 'earth'],
}),
createAdvancedConversionDiscipline({
id: 'regen-sand',
name: 'Sand',
manaType: 'sand',
cost: 12,
description: 'Convert raw mana + earth mana + water mana into sand mana over time.',
conversionRate: 0.35,
difficultyFactor: 160,
scalingFactor: 80,
drainBase: 2,
sourceManaTypes: ['raw', 'earth', 'water'],
}),
createAdvancedConversionDiscipline({
id: 'regen-lightning',
name: 'Lightning',
manaType: 'lightning',
cost: 12,
description: 'Convert raw mana + fire mana + air mana into lightning mana over time.',
conversionRate: 0.35,
difficultyFactor: 160,
scalingFactor: 80,
drainBase: 2,
sourceManaTypes: ['raw', 'fire', 'air'],
}),
// ── Exotic Elements ────────────────────────────────────────────────────────
createAdvancedConversionDiscipline({
id: 'regen-crystal',
name: 'Crystal',
manaType: 'crystal',
cost: 18,
description: 'Convert raw mana + sand mana + light mana into crystal mana over time.',
conversionRate: 0.25,
difficultyFactor: 220,
scalingFactor: 110,
drainBase: 3,
sourceManaTypes: ['raw', 'sand', 'light'],
infiniteThreshold: 500,
}),
createAdvancedConversionDiscipline({
id: 'regen-stellar',
name: 'Stellar',
manaType: 'stellar',
cost: 18,
description: 'Convert raw mana + fire mana + light mana into stellar mana over time.',
conversionRate: 0.25,
difficultyFactor: 220,
scalingFactor: 110,
drainBase: 3,
sourceManaTypes: ['raw', 'fire', 'light'],
infiniteThreshold: 500,
}),
createAdvancedConversionDiscipline({
id: 'regen-void',
name: 'Void',
manaType: 'void',
cost: 18,
description: 'Convert raw mana + dark mana + death mana into void mana over time.',
conversionRate: 0.25,
difficultyFactor: 220,
scalingFactor: 110,
drainBase: 3,
sourceManaTypes: ['raw', 'dark', 'death'],
infiniteThreshold: 500,
}),
];