2.1 KiB
2.1 KiB
High Velocity UX & Strict Engine (Part 2)
Status: Completed
Objectives
- Implement "Manual Mana Engine" allowing players to add mana to their pool via interaction.
- Implement "Strict Combat Engine" supporting
DECLARE_ATTACKERSandDECLARE_BLOCKERSphases and validation. - Implement "High Velocity UX" with Swipe-to-Tap and Swipe-to-Attack gestures.
- Enhance
GameViewwith Mana Pool display and visual feedback for combat declarations. - Contextualize
SmartButtonto handle complex actions like declaring specific attackers.
Implementation Details
Backend (Rules Engine)
- Mana System: Added
addManamethod toRulesEngineandmanaPooltoPlayerState. ImplementedemptyManaPoolslogic on step transition. - Combat Logic: Implemented
declareAttackers(checking summoning sickness, tapping, setting attacking target) anddeclareBlockerslogic. - Action Handling: Updated
GameManagerto handleADD_MANAand auto-generate mana when tapping Basic Lands viaTAP_CARDaction (legacy compatibility wrapper).
Frontend (GameView)
- Mana Pool UI: Added a compact Mana Pool display in the player life area, showing WUBRGC counts.
- Gesture Manager Upgrade: Enhanced
GestureManagerto detect swipe direction:- Slash (Horizontal): Tap Card.
- Thrust (Vertical Up): Attack (if in combat step).
- Thrust (Vertical Down): Cancel Attack.
- Combat Visuals: Implemented
proposedAttackerslocal state. Cards proposed to attack are visually lifted (translateY(-40px)) and glow red (box-shadow,ring). - Smart Button: Updated to accept
contextData. Indeclare_attackersstep, it displays "Attack with N" and sends the list of proposed attackers.
Type Synchronization
- Synced
CardInstance(Client) withCardObject(Server) to includeattackingandblockingfields.
Next Steps
- Verify Multiplayer Sync (Socket events are already in place).
- Implement "Blocking" UI (similar to Attacking but for defenders).
- Implement "Order Blockers" / "Damage Assignment" if strict compliance is enforced (currently simplified to auto-damage).