# 5-Floor System - Quick Testing Guide

## 🎯 Critical Tests (Do These First)

### Test 1: Game Starts Correctly ✅
**Expected:**
- Title screen appears
- Click "Start Game"
- See Floor 1 combat or loot
- Check console for: `[INIT] Floor decks created:`

**Pass Criteria:** Game loads, 5 decks created

---

### Test 2: Floor 1 Gameplay
**Steps:**
1. Play through Floor 1 encounters (2 cards each)
2. Defeat robots
3. Watch console for `[RECYCLE]` messages
4. Complete floor or find elevator

**Expected Console Output:**
```
[RECYCLE] Robot-A (robot_weak) will be shuffled into next floor
[RECYCLE] Robot-B (robot_balanced) will be shuffled into next floor
[FLOOR] Floor 1 complete!
[FLOOR] Recycling 5 robots into Floor 2
[FLOOR] Floor 2 now has 15 cards
```

**Pass Criteria:** 
- Robots tracked
- Floor completion works
- Orb awarded

---

### Test 3: Elevator & Floor Progression
**Steps:**
1. Find elevator (should be in encounters 3-5 on Floor 1)
2. Click "Use Elevator"
3. Check you're on Floor 2
4. Verify Floor 2 has more cards

**Expected:**
- Message: "Arriving at Floor 2..."
- New encounter drawn
- Console: `[ELEVATOR] Moving to Floor 2`
- Floor 2 deck should have ~15 cards (10 base + ~5 recycled)

**Pass Criteria:**
- Floor progression works
- Recycled robots in Floor 2

---

### Test 4: Encounter Scaling
**Check encounter sizes:**
- Floor 1: 2 cards per encounter
- Floor 2: 2 cards per encounter  
- Floor 3: 3 cards per encounter
- Floor 4: 3 cards per encounter
- Floor 5: 4 cards per encounter

**Pass Criteria:** Encounter sizes match specification

---

### Test 5: Victory Condition
**Steps:**
1. Complete Floor 5 (or cheat by editing level in state)
2. Use elevator
3. Check victory screen

**Expected:**
- Message: "Victory! Completed all 5 floors with X orbs!"
- `gameComplete = true`
- Game ends

**Pass Criteria:** Victory triggers correctly

---

## 🔍 What to Watch in Console

### Good Signs ✅
```
[INIT] Floor decks created:
  Floor 1: 10 cards
  Floor 2: 10 cards
  Floor 3: 10 cards
  Floor 4: 10 cards
  Floor 5: 10 cards

[ENCOUNTER] Drawing 2 cards from Floor 1 (10 cards remaining)
[ENCOUNTER] Drew cards: ['robot_weak', 'medkit']

[RECYCLE] Robot-A (robot_weak) will be shuffled into next floor

[FLOOR] Floor 1 complete!
[FLOOR] Recycling 5 robots into Floor 2
[FLOOR] Floor 2 now has 15 cards

[ELEVATOR] Moving to Floor 2
[ENCOUNTER] Drawing 2 cards from Floor 2 (15 cards remaining)
```

### Bad Signs ❌
- `undefined` or `null` deck errors
- Floor deck not found
- Shuffle errors
- Level not incrementing
- Robots not being tracked

---

## 🐛 Common Issues & Fixes

### Issue: "Cannot read property 'length' of undefined"
**Cause:** floorDecks not initialized
**Fix:** Check `setup()` has `floorDecks: { 1: [], 2: [], 3: [], 4: [], 5: [] }`

### Issue: Floor 2 still has 10 cards
**Cause:** Robots not recycling
**Fix:** Check `completeFloor()` is being called and shuffle is working

### Issue: Elevator doesn't progress floors
**Cause:** `useElevator` not incrementing level
**Fix:** Check `G.level += 1` is happening

### Issue: Game doesn't end on Floor 5
**Cause:** Victory check not working
**Fix:** Check `if (G.level >= 5)` condition in `useElevator`

---

## 📊 Expected Deck Sizes by Floor

Based on average robot counts:

| Floor | Base Cards | Recycled | Total | Encounters |
|-------|-----------|----------|-------|------------|
| 1     | 10        | 0        | 10    | 5          |
| 2     | 10        | ~5       | ~15   | 7-8        |
| 3     | 10        | ~9       | ~19   | 6-7        |
| 4     | 10        | ~13      | ~23   | 7-8        |
| 5     | 10        | ~16      | ~26   | 6-7        |

**Note:** Actual numbers vary due to randomness!

---

## 🎮 Quick Play Test (5 Minutes)

1. **Start game** → See title, click Start
2. **Floor 1** → Play 2-3 encounters, check console
3. **Find elevator** → Use it
4. **Floor 2** → Verify more cards, harder encounters
5. **Check recycling** → Console should show robots added to Floor 2

If all 5 steps work → **SHIP IT!** ✅

---

## 🚨 Emergency Debugging

### Enable Extra Logging
Add to top of moves:
```javascript
console.log('[DEBUG] G.level:', G.level);
console.log('[DEBUG] Current deck:', G.floorDecks[G.level]);
console.log('[DEBUG] Defeated robots:', G.defeatedRobotsThisFloor);
```

### Check State in DevTools
Open React DevTools or browser console:
```javascript
// In console while game is running
G.floorDecks      // Should show 5 arrays
G.level           // Should be 1-5
G.defeatedRobotsThisFloor  // Should have robot IDs
G.orbsCollected   // Should show true/false for each floor
```

---

## ✨ Success Criteria

**Minimum Viable (MUST HAVE):**
- ✅ Game starts with 5 floors
- ✅ Robots recycle into next floor
- ✅ Elevator progresses floors
- ✅ Floor 5 triggers victory

**Nice to Have (IF TIME):**
- Floor indicator UI ("Floor 2/5")
- Deck size display ("15 cards")
- Better transition messages

---

## 🎉 Victory Checklist

When these all pass, the feature is DONE:

- [ ] Game initializes 5 floor decks
- [ ] Floor 1 plays correctly (2 card encounters)
- [ ] Robots are tracked when defeated
- [ ] Floor completion recycles robots
- [ ] Floor 2 has more cards than Floor 1
- [ ] Elevator advances to next floor
- [ ] Encounter size scales (2→3→4)
- [ ] Floor 5 completion triggers victory
- [ ] Restart works after victory/death

---

**Time to test: ~10 minutes**  
**If everything works: MERGE & SHIP! 🚀**

Good luck! You've got this! 💪

