Reject sub-$1 tavern bets and fix stale gambling payout dialogue - #128
Conversation
Tavern.changeBet only checked affordability, so a negative bet passed Player.canAfford (money >= negative amount is always true) and set currentBet to a negative number. gamble()'s `currentBet > 0` guard then silently treated it as no bet, contradicting the confirmed-bet prompt. Also interpolates DICE_WIN_MULTIPLIER into Old Tom's dialogue, which still described the old even-money payout instead of the actual 5x. Adds real-loop regression tests for gamble()'s loss and no-bet-placed paths and for getDrunk()'s money-loss branch. Closes #127 Closes #126 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Self-review rubric:
Note: at the start of this cycle the working tree had uncommitted, never-committed changes to |
Summary
Tavern.changeBetonly checked affordability, so a negative bet amount passedPlayer.canAfford(money >= negativeis always true) and setcurrentBetto a negative number.gamble()'scurrentBet > 0guard then silently treated this as "no bet", directly contradicting the "Current Bet: $-100" prompt the game had just shown. Now rejects any amount below $1 with an explicit message.DICE_WIN_MULTIPLIER(5x). Interpolated the constant so the dialogue can't drift from the payout again.Tavern.gamble()itself (loss path, no-bet-placed path) andTavern.getDrunk()'s money-loss branch, plus regression tests for both fixes above.Test plan
python3 -m compileall -q srcSDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest)src/location/tavern.py, rerantests/location/test_tavern.py, saw the new bet-rejection and dialogue tests fail, then restored and confirmed pass)Closes #127
Closes #126