# Development Summary - 2026-01-31

## Current Session Work (Latest)

### Rotburn as Shrine Fuel Feature
Added ability to use MAGMA_STONE (Rotburn) as fuel for the shrine brazier.

**Problem:** Players accumulate excess Rotburn late-game via the "MutatedDropRotburn" tarot card but have limited uses for it. Vanilla MAGMA_STONE has fuel weight 14700 (designed for DLC Furnace), which would instantly max out the shrine.

**Solution:**
- Postfix patch on `BuildingShrine.Start()` adds MAGMA_STONE to fuel list when enabled
- Prefix/Postfix patches on `Interaction_AddFuel.AddFuel()` override fuel weight for shrines only

**Files Created:**
- `CultOfQoL/Patches/Structures/ShrineFuelPatches.cs`

**Files Modified:**
- `CultOfQoL/Configs.cs` - Added EnableRotburnAsShrineFuel, RotburnShrineFuelWeight, EnableShrineWarmth
- `CultOfQoL/Plugin.cs` - Added config bindings in Structures section

**Config Options:**
- "Rotburn as Shrine Fuel" (bool, default: false)
- "Rotburn Fuel Weight" (int, default: 13, same as LOG)
- "Shrine Provides Warmth" (bool, default: true)

### Shrine Warmth Fix
Discovered vanilla bug: `StructureManager.GetBuildingWarmth()` defines 20 warmth for fueled shrines, but `WarmthBar.WarmthNormalized` only reads from DLC Furnace, so shrine warmth was never applied.

**Solution:** Postfix patch on `WarmthBar.WarmthNormalized` getter adds 20% warmth when any shrine is fully fueled.

### Magnet Range Multiplier Rounding Fix
Fixed broken rounding in `MagnetRangeMultiplier.SettingChanged`:
- **Before:** `MagnetRangeMultiplier.Value * 4f / 4f` (does nothing)
- **After:** `Mathf.Round(MagnetRangeMultiplier.Value * 4) / 4` (proper 0.25 increments)

---

### Knucklebones Animation Speed-Up Feature
Added configurable speed multiplier for Knucklebones minigame animations.

**Problem:** Knucklebones uses `WaitForSecondsRealtime` and DOTween with `SetUpdate(true)`, making it immune to standard `Time.timeScale` manipulation.

**Solution:** Created an enumerator wrapper that intercepts coroutine yields and scales `WaitForSecondsRealtime.m_Seconds` field by the multiplier. For `unscaledDeltaTime` loops, advances the enumerator multiple times per frame.

**Files Created:**
- `CultOfQoL/Patches/Gameplay/KnucklebonesSpeedPatches.cs` - All Harmony patches

**Files Modified:**
- `CultOfQoL/Configs.cs` - Added `KnucklebonesSpeedMultiplier` property
- `CultOfQoL/Core/ConfigCache.cs` - Added cache key
- `CultOfQoL/Plugin.cs` - Added section constant and config binding (1x-5x slider)
- `Thunderstore/cult/CHANGELOG.md` - Added changelog entry
- `Thunderstore/cult/README.md` - Added feature to Game Speed section

**Patched Methods:**
- `KBGameScreen.DoGameLoop/PerformTurn/DoShowAnimation/DoHideAnimation/DoEndGame`
- `KBPlayerBase.FinishTubSelection`, `KBOpponent.FinishTubSelection`
- `Dice.RollRoutine/GoToLocationRoutine/ShakeRoutine/ScaleRoutine`
- `KBDiceTub.AddDice/CheckDice`

**Config Location:** "── Knucklebones ──" section with slider from 1.0 to 5.0 (0.25 increments)

---

## Earlier Session Work

### 1. Documentation Overhaul
Comprehensive review and update of README.md and nexusmods_description.txt:

**Added missing features:**
- Mass sin extract
- Collect all god tears at once
- Unlock all weather types (including snow)
- Wolf traps can fill AND collect (was just "fill")

**Fixed terminology:**
- "Wood silos" → "Lumber stations"
- "Stone silos" → "Mining stations"
- "Offering shrines generate webs, silks, and crystals" → "Offering shrines can generate spider webs and crystals"

**Removed non-existent features:**
- "Customise notification scale"
- "Eat food directly from follower kitchens"

**Updated language:**
- Changed "Disable X" → positive framing (Hide/Toggle/Exclude/Mute)
- Clarified speed increment description

### 2. Dependency Change
Switched from BepInEx ConfigurationManager to ConfigurationManagerEnhanced:
- `CultOfQoL/Plugin.cs`: `[BepInDependency("com.p1xel8ted.configurationmanagerenhanced", "1.0")]`
- `Thunderstore/cult/manifest.json`: `p1xel8ted-ConfigurationManagerEnhanced-1.0.0`
- Updated installation instructions in README and Nexus description

### 3. Customisable Tarot Luck Multiplier
Replaced fixed "3x Tarot Luck" toggle with adjustable slider:
- **Range:** 1.0x to 5.0x (in 0.5 increments)
- **Default:** 2.0x (balanced between vanilla and old 3x)
- Setting appears as child of "Increase Tarot Luck" toggle with `└` indent
- Files: `Configs.cs`, `Plugin.cs`, `TarotCardPatches.cs`

### 4. Changelog Updates
- Added entries for config reorganization and setting renames
- Fixed typo: "configurableconfigurable" → "configurable" (in 2.3.0)
- Added tarot luck multiplier change

## Earlier Session Work

### Config Order and Subsetting Indentation Fixes
Fixed Order values and added `└` indents for child settings:
- **PlayerSection**: Fixed BaseDamageMultiplier Order conflict (5→4)
- **StructureSection**: Added └ indent to SpiderWebsPerLogs and CrystalShardsPerStone
- **GameSpeedSection**: Added └ indent to all keybinding children
- **AnimalsSection**: Added └ indent to AnimalOldAgeDeathThreshold
- **LootSection**: Fixed Order conflicts, added └ indent to MagnetRangeMultiplier

### Config Section Formatting
- Changed section names from numbered prefixes (`01. General`) to box-drawing format (`── General ──`)
- Reordered all config bindings in code for alphabetical category order
- Order: General first, then alphabetical A-Z, then Fixes and Reset All Settings at end

### Config Setting Renames (Eliminating Double-Negatives)

| Old Name | New Name |
|----------|----------|
| Disable Animal Old Age Death | Immortal Farm Animals |
| Disable Fishing Mini-Game | Easy Fishing |
| Disable Ads | Hide Ads |
| Disable All Notifications | Hide All Notifications |
| Disable Run Speed In Dungeons | Exclude Dungeons |
| Disable Run Speed In Combat | Exclude Combat |
| Disable Propaganda Speaker Audio | Mute Propaganda Speakers |

### Shrine Devotion Bug Fix
- Fixed "Collect Shrine Devotion Instantly" only collecting ~11-12 souls out of 120
- Root cause: `PlayerFarming.GetSoul(int delta)` ignores the delta parameter
- Solution: Loop `GetSoul(1)` for each soul instead of calling `GetSoul(directSouls)`

### Ritual Cost Multiplier Feature
- Added new config `RitualCostMultiplier` (0.5x to 4x range)
- Patches `UpgradeSystem.GetCost()` to scale ritual material costs
- Excludes FOLLOWERS, DOCTRINE_STONE, DISCIPLE_POINTS from multiplier

## Commits Made
1. `283c742f` - CultOfQoL: Update docs and switch to ConfigurationManagerEnhanced
2. `9df507ec` - CultOfQoL: Add customisable tarot luck multiplier

## Files Modified
- `CultOfQoL/Plugin.cs` - Dependency change, tarot luck config
- `CultOfQoL/Configs.cs` - Added TarotLuckMultiplier property
- `CultOfQoL/Patches/Gameplay/TarotCardPatches.cs` - Use config value
- `Thunderstore/cult/README.md` - Full documentation update
- `Thunderstore/cult/nexusmods_description.txt` - Full documentation update
- `Thunderstore/cult/CHANGELOG.md` - Added entries
- `Thunderstore/cult/manifest.json` - ConfigurationManagerEnhanced dependency

## Build Status
All changes verified with successful Release builds.

## Notes
- Silk thread is NOT produced by the mod - it's already in vanilla game's `SinOfferings` list (Sins of the Flesh DLC)
- User confirmed lag issue was caused by "immortal follower mod", not TraitControl
