Remove detailed reflection patterns (belong in code comments), project status tracking, completed features list, and implementation approach docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.5 KiB
2.5 KiB
EfD Trading Card Mod
Unity mod for Escape from Duckov adding a customizable trading card system with storage.
Commands
dotnet build TradingCardMod.csproj # Build (debug)
dotnet build TradingCardMod.csproj -c Release # Build (release)
dotnet test TradingCardMod.Tests.csproj # Run tests
./deploy.sh # Build + deploy to game
./deploy.sh --release # Deploy release build
./remove.sh # Remove mod from game
Before building: Update DuckovPath in TradingCardMod.csproj (line 10) to your game path.
Project Skills
/build— Build and deploy locally for testing/deploy— Build Release and stage for Steam Workshop upload
Architecture
- Clone + Reflection: Clone game items as templates (base ID 135), set private fields via reflection
- Custom tags: Clone existing ScriptableObject tags. Parent tag pattern for slot filtering (Unity requireTags uses AND logic)
- TypeIDs: 100000+ range to avoid game/mod conflicts
- Cost struct reflection: Cost is a value type — must box before reflection, then unbox (see
DisassemblyHelper.cs)
Key Classes
| Class | Role |
|---|---|
ModBehaviour |
Entry point, card set loading/cleanup |
Patches |
Harmony runtime method patches |
CardParser |
Pipe-separated card file parser (pure C#, fully tested) |
PackUsageBehavior |
Card pack opening with gacha-style rarity weights |
StorageHelper |
Multi-tag slot filtering for hierarchical storage |
DisassemblyHelper |
Runtime disassembly formulas via reflection |
Dependencies
- HarmonyLoadMod (Workshop 3589088839): Required — provides Harmony 2.4.1
- ModConfig (Workshop 3592433938): Optional — enhances card descriptions in inventory
Card Sets
Cards defined in CardSets/{SetName}/cards.txt:
CardName | SetName | SetNumber | ImageFile | Rarity | Weight | Value | Description (optional)
Images in CardSets/{SetName}/images/. Prefix folder with _ to disable loading.
Storage System
- Binder Sheet (9 slots): Holds trading cards only
- Card Binder (12 slots): Holds cards OR binder sheets (nested storage)
Dev Notes
- Target: .NET Standard 2.1, C# 8.0
- Logging:
Debug.Log()with[TradingCardMod]prefix - Log file:
/mnt/NV2/SteamLibrary/steamapps/compatdata/3167020/pfx/drive_c/users/steamuser/AppData/LocalLow/TeamSoda/Duckov/Player.log - Research:
.claude/scratchpad/decompiled/,.claude/scratchpad/item-system-analysis.md