This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Luminous character skill simulator for MapleStory, built with React, TypeScript, and Vite. It uses an Entity-Component-System (ECS) architecture to simulate complex game mechanics including skill rotations, damage calculations, buff management, and gauge systems.
npm install # Install dependencies
npm run dev # Start development server (http://localhost:5173)
npm run build # Type check + production build
npm run preview # Preview production build
npm run lint # Run ESLintSince there's no dedicated type check command, use the build command which includes TypeScript checking:
npm run build # Runs tsc -b && vite buildThe core game logic uses ECS architecture located in /src/ecs/:
- Entities: Basic game objects with unique IDs (player, enemy, summons)
- Components: Data containers attached to entities
StatsComponent: Character stats (STR, INT, damage%, etc.)SkillComponent: Individual skill instances with cooldownsBuffComponent: Active buffs with durationsDamageComponent: Damage calculation dataGaugeComponent: Light/Dark gauge stateStateComponent: Luminous equilibrium statesSummonComponent: Summon entities
- Systems: Logic processors that operate on components
TimeSystem: Manages game time and delta updatesSkillSystem: Handles skill activation and cooldownsBuffSystem: Manages buff durations and effectsDamageSystem: Calculates and applies damageGaugeSystem: Manages light/dark gauge mechanicsStateSystem: Handles Luminous state transitions
- World: Central manager orchestrating all ECS elements
ECSProvider: Context provider wrapping the app with ECS World access- Custom hooks in
/src/hooks/:useECS(): Access World instanceuseComponent(): Subscribe to component changesuseQuery(): Query entities by component typesuseSkillActions(): High-level skill usage APIuseLuminousCharacter(): Character-specific logic
Four main panels in /src/components/:
- SettingsPanel: Character stats and simulation configuration
- AutoSimulationPanel: Automated skill rotation strategies
- ManualPracticePanel: Real-time skill practice with key bindings
- ResultsPanel: Damage charts, logs, and skill breakdowns
/src/data/skills.ts: All Luminous skill definitions with damage formulas/src/data/types/: TypeScript types for skills and characters/src/ecs/core/World.ts: Core ECS world implementation/src/hooks/ECSProvider.tsx: React-ECS bridge/src/utils/: Game mechanics utilities (cooldowns, buffs, server lag)
- LIGHT: Light skills only
- DARK: Dark skills only
- EQUILIBRIUM: Both light and dark skills available
Light/Dark gauge fills based on skill usage, triggering state transitions when reaching thresholds.
Skills can be enhanced at 5th and 6th job levels, modifying damage and effects.
- StatsComponent: Character stats (INT, damage%, boss damage%, final damage%, etc.)
- SkillComponent: Skills with cooldowns and availability states
- DamageComponent: Damage accumulation and history tracking
- BuffComponent: Active buff management with durations
- StateComponent: Luminous state tracking (LIGHT/DARK/EQUILIBRIUM)
- GaugeComponent: Light/Dark gauge values and thresholds
- SummonComponent: Summon entity data
- LearnedSkillsComponent: Learned skill levels and enhancements
-
Get Enhanced Skill Data
- Apply 5th job reinforcement (damage multiplier)
- Apply 6th job mastery (skill override)
- Handle dynamic skills based on current state
-
Calculate Additional Hits
- Same element: 0.5x additional hits
- Equilibrium skills: 1.0x additional hits
- Mixed element: No additional hits
-
Apply All Multipliers
- Base damage %
- Damage increase % (from buffs)
- Boss damage %
- Final damage %
- Critical rate/damage
- Mastery range
-
Apply Enemy Defense Reduction
- Level penalty
- Defense reduction (with ignore defense %)
- Elemental resistance (with ignore elemental resist %)
-
Calculate Final Damage
Final Damage = Base × All Multipliers × Hit Count × Enemy Reduction
- Skill IDs:
{skill}_reinforce(e.g.,reflection_reinforce) - Effect: 2% damage increase per level (max level 60)
- Applied as damage multiplier in DamageSystem
- Skill IDs:
{skill}_mastery(e.g.,reflection_mastery) - Effect: Override skill damage values and other properties
- May affect other skills (e.g., reflection VI increases absolute kill damage)
- Applied via skill_override in getEnhancedSkillData()
Skills that change based on Luminous state:
- Twilight Nova: Different damage/hitcount per state
- Punishing Resonator: Different damage per state
- Use
getDynamicProperties()to get state-specific values
- ECSProvider: Initializes World and all Systems
- useECS: Access to World instance and step function
- useComponent: Subscribe to component changes with React state updates
- useQuery: Query entities by component types
- useSkillActions: High-level skill usage API (requires entity and enemyEntity)
- useLuminousCharacter: Character-specific state management (creates both player and enemy entities)
The simulation uses a global enemy entity approach:
- Created in
useLuminousCharacteralongside the player entity - Enemy has EnemyStatsComponent with level, defense, and resistances
- Default enemy: Level 285, 1200 defense, no elemental resistances
- Both entities are cleaned up when the character hook unmounts
- Equilibrium Delay State: Not implemented (README mentions "이퀼리브리엄 유예" state)
- Memorize Logic: Missing gauge reset and 17-second duration without buff extension
- 30ms Tick System: Currently uses variable deltaTime instead of fixed 30ms ticks
- Server Lag Simulation: Mentioned in README but not fully implemented
- Gauge Charging Rules: Complex state-dependent charging rules need verification