Set up project structure with: - .NET Standard 2.1 project targeting Duckov modding API - ModBehaviour entry point with card set loading system - Harmony patching infrastructure (depends on HarmonyLoadMod) - Pipe-separated card definition format for user-generated content - Example card set and documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3.1 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
A Unity mod for Escape from Duckov that adds a customizable trading card system with storage solutions. The framework supports user-generated content through simple pipe-separated text files, allowing non-programmers to add their own card sets.
Build Commands
# Build the mod
dotnet build
# Build release version
dotnet build -c Release
# Output location: bin/Debug/netstandard2.1/TradingCardMod.dll
Important: Before building, update DuckovPath in TradingCardMod.csproj (line 10) to your actual game installation path.
Architecture
Mod Loading System
The game loads mods from Duckov_Data/Mods/. Each mod requires:
- A DLL with namespace matching
info.ini'snamefield - A
ModBehaviourclass inheriting fromDuckov.Modding.ModBehaviour - The
info.iniandpreview.pngfiles
Key Classes
-
ModBehaviour(src/ModBehaviour.cs): Main entry point. Inherits fromDuckov.Modding.ModBehaviour(which extendsMonoBehaviour). Handles card set loading inStart()and cleanup inOnDestroy(). -
Patches(src/Patches.cs): Harmony patch definitions. UsesHarmonyLibfor runtime method patching. Patches are applied inStart()and removed inOnDestroy(). -
TradingCard: Data class representing card properties. ContainsGenerateTypeID()for creating unique item IDs (100000+ range to avoid game conflicts).
Dependencies
- HarmonyLoadMod (Workshop ID: 3589088839): Required mod dependency providing Harmony 2.4.1. Referenced at build time but not bundled to avoid version conflicts.
Card Definition Format
Cards are defined in CardSets/{SetName}/cards.txt using pipe-separated values:
CardName | SetName | SetNumber | ImageFile | Rarity | Weight | Value
Images go in CardSets/{SetName}/images/.
Game API Reference
Key namespaces and APIs from the game:
ItemStatsSystem.ItemAssetsCollection.AddDynamicEntry(Item prefab)- Register custom itemsItemStatsSystem.ItemAssetsCollection.RemoveDynamicEntry(Item prefab)- Remove on unloadSodaCraft.Localizations.LocalizationManager.SetOverrideText(string key, string value)- LocalizationItemStatsSystem.ItemUtilities.SendToPlayer(Item item)- Give items to player
Development Notes
- Target framework: .NET Standard 2.1
- C# language version: 8.0
- All logging uses
Debug.Log()with[TradingCardMod]prefix - Custom items need unique TypeIDs to avoid conflicts with base game and other mods
Testing
- Copy build output to
{GamePath}/Duckov_Data/Mods/TradingCardMod/ - Include:
TradingCardMod.dll,info.ini,preview.png,CardSets/folder - Launch game and enable mod in Mods menu
- Check game logs for
[TradingCardMod]messages
TODO Items in Code
The following features need implementation (marked with TODO comments):
RegisterCardWithGame()- Create Unity prefabs and register with ItemAssetsCollection- Item cleanup in
OnDestroy()- Remove registered items on mod unload TradingCard.ItemPrefabproperty - Store Unity prefab reference