aether-shards/.cursor/rules/logic/RULE.md

24 lines
928 B
Markdown
Raw Normal View History

---
description: Standards for gameplay logic, AI, and Effect processing.
globs: src/systems/*.js, src/managers/*.js**
---
# **Logic Systems Standards**
## **Effect Processor**
- **The Rulebook:** All game state mutations (Damage, Move, Spawn) **MUST** go through EffectProcessor.process().
- **Statelessness:** The processor should not hold state. It acts on the Unit and Grid passed to it.
- **Schema:** Effects must adhere to the EffectDefinition interface (Type \+ Params).
## **AI Controller**
- **Pattern:** Utility-Based Decision Making.
- **Execution:** AI does not cheat. It must use the same Pathfinding and SkillManager checks as the player.
- **Archetypes:** Logic must be driven by AIBehaviorProfile (e.g., Bruiser vs Kiter).
## **Unit Manager**
- **Role:** Single Source of Truth for "Who is alive?".
- **Queries:** Use getUnitsInRange() for spatial lookups. Do not iterate the Grid manually to find units.