Add golemancy system, combination skills, and UI redesigns
All checks were successful
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 3m17s
All checks were successful
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 3m17s
- Remove scroll crafting skill (no consumables in idle game) - Add golem types (Earth, Metal, Crystal) with variants (Lava, Mud, Forge, Storm) - Implement golemancy state in store with summoning/drain mechanics - Add combination skills requiring level 5+ in two attunements: - Enchanter+Fabricator: Enchanted Golems, Capacity Overflow - Invoker+Fabricator: Pact-Bonded Golems, Guardian Infusion - Invoker+Enchanter: Pact Enchantments, Elemental Resonance - Redesign CraftingTab with sub-tabs for Enchanter/Fabricator - Redesign SpireTab to show summoned golems and DPS contribution - Redesign StatsTab with attunement-specific stats sections - Update documentation (README.md, AGENTS.md)
This commit is contained in:
@@ -9,7 +9,7 @@ import { Separator } from '@/components/ui/separator';
|
||||
import { TooltipProvider } from '@/components/ui/tooltip';
|
||||
import { Swords, BookOpen, ChevronUp, ChevronDown, RotateCcw, X } from 'lucide-react';
|
||||
import type { GameStore } from '@/lib/game/types';
|
||||
import { ELEMENTS, GUARDIANS, SPELLS_DEF, SKILLS_DEF } from '@/lib/game/constants';
|
||||
import { ELEMENTS, GUARDIANS, SPELLS_DEF, SKILLS_DEF, GOLEM_DEFS, GOLEM_VARIANTS } from '@/lib/game/constants';
|
||||
import { fmt, fmtDec, getFloorElement, canAffordSpellCost } from '@/lib/game/store';
|
||||
import { getActiveEquipmentSpells, getTotalDPS } from '@/lib/game/computed-stats';
|
||||
import { formatSpellCost, getSpellCostColor, formatStudyTime } from '@/lib/game/formatting';
|
||||
@@ -36,7 +36,9 @@ export function SpireTab({ store }: SpireTabProps) {
|
||||
|
||||
// Get upgrade effects and DPS
|
||||
const upgradeEffects = getUnifiedEffects(store);
|
||||
const totalDPS = getTotalDPS(store, upgradeEffects, floorElem);
|
||||
const spellDPS = getTotalDPS(store, upgradeEffects, floorElem);
|
||||
const golemDPS = store.getActiveGolemDPS();
|
||||
const totalDPS = spellDPS + golemDPS;
|
||||
const studySpeedMult = 1; // Base study speed
|
||||
|
||||
const canCastSpell = (spellId: string): boolean => {
|
||||
@@ -45,6 +47,19 @@ export function SpireTab({ store }: SpireTabProps) {
|
||||
return canAffordSpellCost(spell.cost, store.rawMana, store.elements);
|
||||
};
|
||||
|
||||
// Helper to get golem element color
|
||||
const getGolemElementColor = (element: string): string => {
|
||||
return ELEMENTS[element]?.color || '#F4A261'; // Default to earth color
|
||||
};
|
||||
|
||||
// Helper to get golem element symbol
|
||||
const getGolemElementSymbol = (element: string): string => {
|
||||
return ELEMENTS[element]?.sym || '⛰️';
|
||||
};
|
||||
|
||||
// Get active golems on current floor
|
||||
const activeGolemsOnFloor = store.activeGolems.filter(g => g.currentFloor === store.currentFloor);
|
||||
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
@@ -87,7 +102,18 @@ export function SpireTab({ store }: SpireTabProps) {
|
||||
</div>
|
||||
<div className="flex justify-between text-xs text-gray-400 game-mono">
|
||||
<span>{fmt(store.floorHP)} / {fmt(store.floorMaxHP)} HP</span>
|
||||
<span>DPS: {store.currentAction === 'climb' && activeEquipmentSpells.length > 0 ? fmtDec(totalDPS) : '—'}</span>
|
||||
<span>
|
||||
{store.currentAction === 'climb' && (activeEquipmentSpells.length > 0 || activeGolemsOnFloor.length > 0) ? (
|
||||
<span>
|
||||
DPS: {fmtDec(totalDPS)}
|
||||
{activeGolemsOnFloor.length > 0 && (
|
||||
<span className="text-gray-500 ml-1">
|
||||
(Spell: {fmtDec(spellDPS)} | Golem: {fmtDec(golemDPS)})
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
) : '—'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -128,6 +154,116 @@ export function SpireTab({ store }: SpireTabProps) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Active Golems Card */}
|
||||
<Card className="bg-gray-900/80 border-gray-700" style={{ borderColor: activeGolemsOnFloor.length > 0 ? '#F4A26150' : undefined }}>
|
||||
<CardHeader className="pb-2">
|
||||
<CardTitle className="game-panel-title text-xs flex items-center gap-2" style={{ color: '#F4A261' }}>
|
||||
<span>🗿 Active Golems</span>
|
||||
{activeGolemsOnFloor.length > 0 && (
|
||||
<Badge className="bg-amber-900/50 text-amber-300 border-amber-600">
|
||||
{activeGolemsOnFloor.length}
|
||||
</Badge>
|
||||
)}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
{activeGolemsOnFloor.length > 0 ? (
|
||||
<>
|
||||
<ScrollArea className="max-h-48">
|
||||
<div className="space-y-2 pr-2">
|
||||
{activeGolemsOnFloor.map((golem, index) => {
|
||||
const golemDef = GOLEM_DEFS[golem.golemId];
|
||||
const variantDef = golem.variant ? GOLEM_VARIANTS[golem.variant] : null;
|
||||
const elementColor = getGolemElementColor(golemDef?.element || 'earth');
|
||||
const elementSymbol = getGolemElementSymbol(golemDef?.element || 'earth');
|
||||
|
||||
// Calculate golem DPS
|
||||
let golemSingleDPS = golemDef?.baseDamage || 0;
|
||||
if (variantDef) {
|
||||
golemSingleDPS *= variantDef.damageMultiplier;
|
||||
}
|
||||
if (store.skills.golemancyMaster === 1) {
|
||||
golemSingleDPS *= 1.5;
|
||||
}
|
||||
if (store.skills.pactBondedGolems === 1) {
|
||||
golemSingleDPS *= 1 + (store.signedPacts.length * 0.1);
|
||||
}
|
||||
if (store.skills.guardianInfusion === 1 && GUARDIANS[store.currentFloor]) {
|
||||
golemSingleDPS *= 1.25;
|
||||
}
|
||||
golemSingleDPS *= golemDef?.attackSpeed || 1;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={`${golem.golemId}-${index}`}
|
||||
className="p-2 rounded border bg-gray-800/30"
|
||||
style={{ borderColor: `${elementColor}50` }}
|
||||
>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<span style={{ color: elementColor }}>{elementSymbol}</span>
|
||||
<span className="text-sm font-semibold game-panel-title" style={{ color: elementColor }}>
|
||||
{variantDef?.name || golemDef?.name || 'Unknown Golem'}
|
||||
</span>
|
||||
{golem.variant && !variantDef && (
|
||||
<span className="text-xs text-gray-500">({golem.variant})</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="text-xs text-gray-400">
|
||||
{fmtDec(golemSingleDPS)} DPS
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* HP Bar */}
|
||||
<div className="space-y-0.5 mb-1">
|
||||
<div className="h-2 bg-gray-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full rounded-full transition-all duration-300"
|
||||
style={{
|
||||
width: `${Math.max(0, (golem.currentHP / golem.maxHP) * 100)}%`,
|
||||
background: `linear-gradient(90deg, ${elementColor}99, ${elementColor})`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex justify-between text-xs text-gray-500 game-mono">
|
||||
<span>{fmt(golem.currentHP)} / {fmt(golem.maxHP)} HP</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Remaining Floors */}
|
||||
<div className="flex items-center justify-between text-xs text-gray-400">
|
||||
<span className="flex items-center gap-1">
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
{golem.remainingFloors} floor{golem.remainingFloors !== 1 ? 's' : ''} remaining
|
||||
</span>
|
||||
<span className="text-gray-500">
|
||||
{fmt(golem.damageDealt)} total dmg
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
{/* Total Golem DPS Summary */}
|
||||
<Separator className="bg-gray-700" />
|
||||
<div className="flex items-center justify-between text-sm">
|
||||
<span className="text-gray-400">Total Golem DPS</span>
|
||||
<span className="font-semibold game-mono" style={{ color: '#F4A261' }}>
|
||||
{fmtDec(golemDPS)}
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="text-gray-500 text-sm py-4 text-center">
|
||||
<p className="mb-2">No golems summoned.</p>
|
||||
<p className="text-xs text-gray-600">Visit the Crafting tab to summon golems.</p>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Active Spells Card - Shows all spells from equipped weapons */}
|
||||
<Card className="bg-gray-900/80 border-gray-700">
|
||||
<CardHeader className="pb-2">
|
||||
@@ -161,7 +297,7 @@ export function SpireTab({ store }: SpireTabProps) {
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-xs text-gray-400 game-mono mb-1">
|
||||
⚔️ {fmt(totalDPS)} DPS •
|
||||
⚔️ {fmt(spellDPS)} DPS •
|
||||
<span style={{ color: getSpellCostColor(spellDef.cost) }}>
|
||||
{' '}{formatSpellCost(spellDef.cost)}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user