diff --git a/CLAUDE.md b/CLAUDE.md index 0e304cc..2fadd57 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,17 +77,25 @@ The game loads mods from `Duckov_Data/Mods/`. Each mod requires: - **`TagHelper`** (`src/TagHelper.cs`): Utilities for working with game tags, including creating custom tags. +- **`PackUsageBehavior`** (`src/PackUsageBehavior.cs`): Handles card pack opening mechanics. Implements gacha-style random card distribution based on rarity weights. + +- **`ModConfigApi`** (`src/ModConfigApi.cs`): Optional integration with ModConfig mod. Adds card set information (set name, card number, rarity) to item descriptions in inventory. + ### Dependencies - **HarmonyLoadMod** (Workshop ID: 3589088839): Required mod dependency providing Harmony 2.4.1. Referenced at build time but not bundled to avoid version conflicts. +- **ModConfig** (Workshop ID: 3592433938): Optional mod dependency. When installed, enhances card descriptions with set information in the inventory UI. + ### Card Definition Format Cards are defined in `CardSets/{SetName}/cards.txt` using pipe-separated values: ``` -CardName | SetName | SetNumber | ImageFile | Rarity | Weight | Value +CardName | SetName | SetNumber | ImageFile | Rarity | Weight | Value | Description (optional) ``` +The Description field is optional. If provided, it will be displayed in the item's in-game description/tooltip. + Images go in `CardSets/{SetName}/images/`. ## Game API Reference @@ -114,19 +122,23 @@ Key namespaces and APIs from the game: ## Current Project Status -**Phase:** 2 Complete - Core Card Framework ✅ -**Next Phase:** 3 - Storage System (Binders) +**Phase:** 3 Complete - Storage & Pack System ✅ +**Status:** Ready for first release candidate **Project Plan:** `.claude/scratchpad/PROJECT_PLAN.md` **Technical Analysis:** `.claude/scratchpad/item-system-analysis.md` ### Completed Features -- Cards load from `CardSets/*/cards.txt` files +- Cards load from `CardSets/*/cards.txt` files with optional descriptions - Custom PNG images display as item icons - Cards register as game items with proper TypeIDs - Custom "TradingCard" tag for filtering +- Card packs with gacha-style mechanics (weighted random distribution) +- Storage system with slot-based filtering (9-slot binders, 18-slot boxes) +- ModConfig integration for enhanced card info display (set name, number, rarity) - Debug spawn with F9 key (for testing) - Deploy/remove scripts for quick iteration +- Unit tests for parsing logic and pack system ### Implementation Approach: Clone + Reflection @@ -136,14 +148,13 @@ Based on analysis of the AdditionalCollectibles mod: 2. **Use reflection** to set private fields (typeID, weight, value, etc.) 3. **Create custom tags** by cloning existing ScriptableObject tags 4. **Load sprites** from user files in `CardSets/*/images/` +5. **Attach custom behaviors** for pack opening mechanics -### Next Implementation Steps +### Future Considerations -Phase 3 - Storage System: -1. Research existing storage items in game -2. Create binder item with Inventory component -3. Implement slot-based filtering for "TradingCard" tag -4. Create card box variant with higher capacity +- Investigate new ItemBuilder API (added in recent game update) as potential replacement for reflection-based approach +- Additional storage variants or customization options +- Binder sheets which hold cards are are held by binders ### Log File Location diff --git a/CardSets/ExampleSet/cards.txt b/CardSets/ExampleSet/cards.txt index fdb120f..9330b1b 100644 --- a/CardSets/ExampleSet/cards.txt +++ b/CardSets/ExampleSet/cards.txt @@ -14,8 +14,8 @@ # Add your own cards below! Just follow the format above. # Place corresponding images in the images/ subfolder. -Duck Hero | Example Set | 001 | duck_hero.png | Rare | 0.01 | 500 | The brave defender of all ponds -Golden Quacker | Example Set | 002 | golden_quacker.png | Ultra Rare | 0.01 | 12500 | A legendary duck made of pure gold -Pond Guardian | Example Set | 003 | pond_guardian.png | Uncommon | 0.01 | 100 -Bread Seeker | Example Set | 004 | bread_seeker.png | Common | 0.01 | 25 -Feathered Fury | Example Set | 005 | feathered_fury.png | Rare | 0.01 | 500 | Known for its fierce battle cry +Duck Hero | Example Set | 001 | duck_hero.png | Rare | 0.05 | 500 | The brave defender of all ponds +Golden Quacker | Example Set | 002 | golden_quacker.png | Ultra Rare | 0.05 | 12500 | A legendary duck made of pure gold +Pond Guardian | Example Set | 003 | pond_guardian.png | Uncommon | 0.05 | 100 +Bread Seeker | Example Set | 004 | bread_seeker.png | Common | 0.05 | 25 +Feathered Fury | Example Set | 005 | feathered_fury.png | Rare | 0.05 | 500 | Known for its fierce battle cry diff --git a/README.md b/README.md index a894f3a..660bc26 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ A customizable trading card system that lets you add your own card sets to the game. +## Features + +- **Custom Card Sets** - Create your own trading cards with custom artwork and stats +- **Card Packs** - Open randomized card packs with gacha-style rarity distribution +- **Storage System** - Organize your collection with 9-slot binders and 18-slot card boxes +- **User-Friendly Format** - Define cards using simple pipe-separated text files +- **ModConfig Integration** - Enhanced card info display when ModConfig is installed (optional) +- **No Programming Required** - Add new card sets without writing any code + ## Requirements **Required Mod Dependency:** @@ -9,12 +18,18 @@ A customizable trading card system that lets you add your own card sets to the g This mod requires the HarmonyLoadMod to be installed. It provides the Harmony library that many mods share to avoid version conflicts. +**Optional Mod Dependency:** +- [ModConfig](https://steamcommunity.com/sharedfiles/filedetails/?id=3592433938) - Subscribe on Steam Workshop + +ModConfig is optional but recommended. When installed, it adds card set information (set name, card number, rarity) to the item description in your inventory, making it easier to identify and organize your cards. + ## Installation 1. Subscribe to [HarmonyLib](https://steamcommunity.com/sharedfiles/filedetails/?id=3589088839) on Steam Workshop -2. Build the mod (see Development section) -3. Copy the `TradingCardMod` folder to your game's `Duckov_Data/Mods` directory -4. Launch the game and enable both HarmonyLib and this mod in the Mods menu +2. (Optional) Subscribe to [ModConfig](https://steamcommunity.com/sharedfiles/filedetails/?id=3592433938) for enhanced card descriptions +3. Build the mod (see Development section) +4. Copy the `TradingCardMod` folder to your game's `Duckov_Data/Mods` directory +5. Launch the game and enable the mods in the Mods menu (HarmonyLib is required, ModConfig is optional) ## Adding Card Sets @@ -29,13 +44,13 @@ This mod requires the HarmonyLoadMod to be installed. It provides the Harmony li Cards are defined in `cards.txt` using pipe-separated values: ``` -CardName | SetName | SetNumber | ImageFile | Rarity | Weight | Value +CardName | SetName | SetNumber | ImageFile | Rarity | Weight | Value | Description (optional) ``` Example: ``` -Blue Dragon | Fantasy Set | 001 | blue_dragon.png | Ultra Rare | 0.01 | 500 -Fire Sprite | Fantasy Set | 002 | fire_sprite.png | Rare | 0.01 | 100 +Blue Dragon | Fantasy Set | 001 | blue_dragon.png | Ultra Rare | 0.05 | 500| A majestic dragon with scales of sapphire blue. +Fire Sprite | Fantasy Set | 002 | fire_sprite.png | Rare | 0.05 | 100 ``` ### Field Descriptions @@ -47,14 +62,14 @@ Fire Sprite | Fantasy Set | 002 | fire_sprite.png | Rare | 0.01 | 100 | SetNumber | Number for sorting (as integer) | 001 | | ImageFile | Image filename in images/ folder | "blue_dragon.png" | | Rarity | Card rarity tier | Common, Uncommon, Rare, Ultra Rare | -| Weight | Physical weight in game units | 0.01 | +| Weight | Physical weight in game units | 0.05 | | Value | In-game currency value | 500 | +| Description | Optional flavor text for the card | "A majestic dragon..." | ### Image Requirements -- Place images in your card set's `images/` subfolder +- Place images in your cardset's `images/` subfolder - Recommended format: PNG -- Recommended size: 256x256 or similar aspect ratio ### Comments @@ -133,4 +148,4 @@ This mod is provided as-is for personal use. Do not distribute copyrighted card ## Credits -Built using the official Duckov modding framework. +Built using the official Duckov modding framework and building on the awesome work of the AdditionalCollectibles mod. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3b70426 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0-rc.1 \ No newline at end of file diff --git a/src/ModBehaviour.cs b/src/ModBehaviour.cs index b4b62bb..3694e44 100644 --- a/src/ModBehaviour.cs +++ b/src/ModBehaviour.cs @@ -314,8 +314,8 @@ namespace TradingCardMod "Card Binder", "A binder for storing and organizing trading cards. Holds 9 cards.", 9, - 0.5f, // weight - 500, // value + 1.5f, // weight + 7500, // value _tradingCardTag ); @@ -326,7 +326,7 @@ namespace TradingCardMod "A large box for bulk storage of trading cards. Holds 36 cards.", 36, 2.0f, // weight - 1500, // value + 37500, // value _tradingCardTag ); } @@ -539,29 +539,22 @@ namespace TradingCardMod // Set tags item.Tags.Clear(); - // Add Luxury tag (for selling at shops) Tag? luxuryTag = TagHelper.GetTargetTag("Luxury"); if (luxuryTag != null) { item.Tags.Add(luxuryTag); } - // ============================================================ - // TODO: REMOVE BEFORE RELEASE - TEST TAGS FOR LOOT SPAWNING - // These tags make cards appear frequently in loot for testing. - // Replace with appropriate tags (Collection, Misc, etc.) or - // implement proper loot table integration before shipping. - // ============================================================ - Tag? medicTag = TagHelper.GetTargetTag("Medic"); - if (medicTag != null) + Tag? miscTag = TagHelper.GetTargetTag("Misc"); + if (miscTag != null) { - item.Tags.Add(medicTag); + item.Tags.Add(miscTag); } - Tag? toolTag = TagHelper.GetTargetTag("Tool"); - if (toolTag != null) + Tag? collTag = TagHelper.GetTargetTag("Collection"); + if (collTag != null) { - item.Tags.Add(toolTag); + item.Tags.Add(collTag); } // ============================================================