Fix Spire Mode floor rendering and swarm floors (Tasks 5 & 6)
- Added enemy naming system with getEnemyName() function - Updated EnemyState type to include name field - Updated generateSwarmEnemies() and generateFloorState() to assign enemy names - Fixed SpireTab.tsx (both versions) to display: - Floor type (Combat/Swarm/Speed/Guardian/Puzzle) with icons - Named enemies based on element and floor tier - Special floor properties (armor %, dodge chance) - Multiple enemies for swarm floors with individual HP bars - Added ROOM_TYPE_LABELS to constants for display - Verified floor type generation logic works correctly - Build succeeds with npm run build
This commit is contained in:
@@ -17,7 +17,7 @@ export function LabTab({ store }: LabTabProps) {
|
||||
// Render elemental mana grid - only show elements with current > 0
|
||||
const renderElementsGrid = () => (
|
||||
<div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 gap-2">
|
||||
{Object.entries(store.elements)
|
||||
{Object.entries(store.elements || {})
|
||||
.filter(([, state]) => state.unlocked && state.current > 0)
|
||||
.map(([id, state]) => {
|
||||
const def = ELEMENTS[id];
|
||||
@@ -41,7 +41,7 @@ export function LabTab({ store }: LabTabProps) {
|
||||
const renderCompositeCrafting = () => {
|
||||
const compositeElements = Object.entries(ELEMENTS)
|
||||
.filter(([, def]) => def.recipe)
|
||||
.filter(([id]) => store.elements[id]?.unlocked);
|
||||
.filter(([id]) => (store.elements || {})[id]?.unlocked);
|
||||
|
||||
if (compositeElements.length === 0) return null;
|
||||
|
||||
@@ -53,7 +53,7 @@ export function LabTab({ store }: LabTabProps) {
|
||||
<div className="space-y-2">
|
||||
{compositeElements.map(([id, def]) => {
|
||||
const recipe = def.recipe || [];
|
||||
const canCraft = recipe.every(r => (store.elements[r]?.current || 0) >= 1);
|
||||
const canCraft = recipe.every(r => ((store.elements || {})[r]?.current || 0) >= 1);
|
||||
const craftBonus = 1 + (store.skills.elemCrafting || 0) * 0.25;
|
||||
const output = Math.floor(craftBonus);
|
||||
|
||||
@@ -87,7 +87,7 @@ export function LabTab({ store }: LabTabProps) {
|
||||
};
|
||||
|
||||
// Check if there are any unlocked elements with current > 0
|
||||
const hasUnlockedElements = Object.values(store.elements).some(e => e.unlocked && e.current > 0);
|
||||
const hasUnlockedElements = Object.values(store.elements || {}).some(e => e.unlocked && e.current > 0);
|
||||
|
||||
if (!hasUnlockedElements) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user