mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 00:52:40 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user