4.4 KiB
4.4 KiB
Card System Implementation Plan
Current Implementation Analysis
Data Layer
-
CardData.cs:
- Represents an instance of a card in the player's collection
- Contains unique ID, rarity, and copies owned
- Has a reference to its CardDefinition for display information
- Includes methods for rarity upgrades when collecting duplicates
- Well-structured with proper serialization support
-
CardDefinition.cs:
- ScriptableObject template for creating card instances
- Contains basic info (name, description), visuals, and collection data
- Provides helper methods like CreateCardData() and GetBackgroundColor()
- Supports different zones (AppleHills, Quarry, Forest, Mountain, Beach)
-
CardSystemManager.cs:
- Singleton manager for the card system
- Manages available card definitions and player inventory
- Includes event callbacks for booster packs and card collection
- Implements functionality for adding and opening booster packs
-
CardInventory.cs:
- Fully implemented management of the player's card collection
- Includes methods for adding cards and tracking booster packs
- Provides filtering methods for different card types
- Supports card lookup by various properties (zone, rarity)
-
CardVisualConfig.cs:
- ScriptableObject for configuring the visual appearance of cards
- Maps rarities to colors and zones to colors/shapes
- Uses dictionary lookups for efficient access
UI Layer
-
CardUIElement.cs:
- Handles displaying a single card in the UI
- Updates visuals based on card data (rarity, zone)
- References UI elements like card name text, images, frames, etc.
-
UIPageController.cs:
- Manages UI page transitions with a stack-based navigation system
- Provides methods for pushing, popping, and clearing the page stack
- Uses events to notify when pages change
-
UI Page Components:
- CardMenuPage.cs: Main menu for card system navigation
- AlbumViewPage.cs: Simplified implementation that shows filtered cards in grid
- BoosterOpeningPage.cs: Interactive card reveal experience
- CardAlbumUI.cs: Main controller for the card system UI
- UIPage.cs: Base class for common page functionality
Implementation Status
Completed
-
Complete CardInventory Implementation:
- Full implementation with methods to manage the player's card collection
- Filtering, sorting, and organization features
- Integration with CardSystemManager
-
Booster Pack Generation:
- Logic to generate random booster packs with appropriate rarity distribution
- Methods for awarding booster packs to the player
- Events for notifying UI when booster packs are obtained
-
Card Collection UI:
- Simplified album browsing UI with filtering and sorting options
- Removed unnecessary card stack and slot system
- Updated AlbumViewPage to use TextMeshPro components
-
Booster Pack Opening UI (In Progress):
- Implemented interactive card reveal system
- Added card back prefabs for clickable reveal experience
- Created flip animations and particle effects for card reveals
- Updated to support revealing three cards individually
Still Needed
-
Booster Opening UI Refinement:
- Fine-tune animation timings and transitions
- Implement custom card back designs
- Add more visual/audio feedback for different rarities
-
Save/Load System:
- Implement persistence for the player's card collection
- Add autosave functionality for cards and booster packs
-
Card Collection Statistics:
- Add UI for tracking collection completion
- Implement achievements for collecting sets
Next Steps
1. Complete the Booster Opening Experience
- Create proper card back prefab with appropriate design
- Test and refine the card reveal animations
- Ensure particle effects and sounds play correctly
2. Add Save/Load System
- Implement JSON serialization for CardInventory
- Add autosave triggers after obtaining new cards
- Create save/load methods in CardSystemManager
3. Polish the Overall Experience
- Add transition animations between pages
- Improve visual feedback for obtaining new cards
- Implement collection statistics display
4. Additional Features (Optional)
- Special collection bonuses for completing sets
- Card trading system with NPCs
- Card usage mechanics beyond collection