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

947 B

description globs alwaysApply
Standards for gameplay logic, AI, and Effect processing. src/systems/*.js, src/managers/*.js** false

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.