# Developer Mode - Testing Guide

## Overview
Developer mode allows you to test Hearthside Secrets with only 2 players (host + 1 other player) instead of the normal minimum of 5 players.

---

## How to Enable Developer Mode

### Method 1: Edit GameController.lua (Permanent)
1. Open `core/GameController.lua`
2. Find line 22: `local DEV_MODE = false`
3. Change to: `local DEV_MODE = true`
4. Reload the addon (`/reload`)

### Method 2: Runtime Command (Temporary)
```lua
-- In WoW chat, type:
/run GS.HS.Core.GameController:SetDevMode(true)
```

To disable:
```lua
/run GS.HS.Core.GameController:SetDevMode(false)
```

---

## What Developer Mode Does

### Player Count
- **Normal Mode**: Requires 5-10 players
- **Dev Mode**: Allows 2-10 players

### Role Assignment
- Works with as few as 2 players
- Always includes at least 1 guilty role
- Randomly selects remaining roles from the variant

### Game Flow
- All phases work normally
- Investigation, accusation, and reveal function as expected
- Win conditions apply (guilty can win by evading detection)

---

## Testing Scenarios

### 2-Player Test
**Setup**:
- Host (Player 1)
- One other player (Player 2)

**Possible Outcomes**:
1. **Player 1 is guilty** → Player 2 must find them
2. **Player 2 is guilty** → Player 1 must find them

**Example**:
```
Player 1: The Thief (GUILTY)
Player 2: The Witness (NEUTRAL)

Investigation: Both visit locations, discover clues
Accusation: Player 2 accuses Player 1
Reveal: Player 2 wins if correct, Player 1 wins if evades
```

---

## Important Notes

### ⚠️ Limitations
- With only 2 players, social deduction is minimal
- Limited clue sharing opportunities
- Less strategic depth than full games

### ✅ Good For Testing
- Game flow and phase transitions
- UI elements and narration
- Win condition logic
- Image display
- Timer functionality
- Network synchronization

### ❌ Not Good For Testing
- Social dynamics
- Clue sharing strategies
- Multiple accusation scenarios
- Complex deduction gameplay

---

## Recommended Testing Flow

### Quick Test (2 players)
1. Enable dev mode
2. Host starts game
3. Both players receive roles
4. Skip through phases quickly
5. Test win conditions

### Full Test (5+ players)
1. Disable dev mode
2. Gather full group
3. Play complete game
4. Test all social mechanics

---

## Disabling Developer Mode

### Method 1: Edit GameController.lua
1. Open `core/GameController.lua`
2. Find line 22: `local DEV_MODE = true`
3. Change to: `local DEV_MODE = false`
4. Reload the addon (`/reload`)

### Method 2: Runtime Command
```lua
/run GS.HS.Core.GameController:SetDevMode(false)
```

---

## Console Commands

### Check Current Mode
```lua
/run print("Dev Mode:", GS.HS.Core.GameController.devMode)
```

### Enable Dev Mode
```lua
/run GS.HS.Core.GameController:SetDevMode(true)
```

### Disable Dev Mode
```lua
/run GS.HS.Core.GameController:SetDevMode(false)
```

---

## Example Testing Session

```
1. Enable dev mode
   /run GS.HS.Core.GameController:SetDevMode(true)

2. Start game with 2 players
   - Host clicks "Start Game"
   - Variant selected randomly
   - 2 roles assigned

3. Test phases
   - GATHERING: Read roles (60s)
   - INVESTIGATION: Visit locations (5min)
   - ACCUSATION: Make accusations (2min)
   - REVEAL: See results

4. Verify outcomes
   - Check winner determination
   - Verify correct images shown
   - Test narration text

5. Disable dev mode when done
   /run GS.HS.Core.GameController:SetDevMode(false)
```

---

## Troubleshooting

### "Not enough players" error
- Verify dev mode is enabled
- Check: `/run print(GS.HS.Core.GameController.devMode)`
- Should return `true`

### Dev mode not persisting
- You're using runtime command (temporary)
- Edit GameController.lua for permanent change

### Want to test with 3-4 players
- Dev mode allows 2-10 players
- Any count in that range works

---

**Remember: Developer mode is for testing only. Disable it for production/live games!**
