Add Wild Draw Four challenge mechanic and bot bluffing

- When a WD4 is played, the victim can challenge or accept
- Challenge succeeds if the WD4 player had a card matching the
  previous color — they draw 4 instead
- Challenge fails: victim draws 6 (4 + 2 penalty)
- Bot as victim: challenges probabilistically based on opponent
  hand size (10-70% chance, more cards = more likely to challenge)
- Bot as player: 20% chance to illegally play WD4 when it has
  matching color cards, making challenges meaningful against it
- Auto-play defaults to accepting (safe option)
- Challenge phase integrates with existing turn timer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-03-19 22:18:30 -07:00
parent b9237181b1
commit 20332d69d6
2 changed files with 217 additions and 21 deletions

View File

@@ -1030,6 +1030,13 @@ func botPickNormal(hand []unoCard, topColor unoColor, playable []int, opponentMi
}
}
// Sometimes play WD4 even when we have other options (20% chance)
// This makes the challenge mechanic meaningful against the bot.
if len(wd4s) > 0 && (len(actions) > 0 || len(numbers) > 0) && rand.IntN(5) == 0 {
idx := wd4s[0]
return hand[idx], idx
}
// Save WD4 unless opponent is close to winning
if opponentMinCards > 3 {
if len(actions) > 0 {