skent259 / crapssim

Simulator for craps with various betting strategies
MIT License
28 stars 13 forks source link

Added a Fire bet #12

Closed amortization closed 2 years ago

amortization commented 2 years ago

I added a Fire bet. Most of the information for how the bet works was taken from https://gamboool.com/the-fire-bet-in-craps-odds-payouts-and-a-list-of-casinos-that-offer-it

Since Fire bets pay win but can still stay up on the table I needed to change how _update_bet worked to send a flag signaling whether a bet would come down or not. Previously, bets came down automatically if they won or lost which I don't believe is the case with a Fire bet.

Since I added the remove flag, I also removed the "push" status from the don't pass bet as a status on None is essentially a push, and we weren't consistent with using "push" in other places like when a PassLine pushes. I'd be in favor in the future of doing away with using None and just using "push" for a push and maybe "new" for when a bet is placed but no rolls have been completed (maybe making status an Enum.) Otherwise potentially returning a BetStatus object that holds the bet, the status name, the win amount and the remove flag? This way if we wanted to track a bet/tables history we would have a starting point. For now I just left it None since that is what all other bets were using.

Since Fire bets require a new shooter I added a new_shooter flag to the table which is based on whether a new shooter was up. I also removed the flags for can_be_placed_point_on and can_be_placed_point_off and replaced with a method to check whether the bet is allowed given the table and for the bets that relied on those flags I overrode the method for each. I also added tests to make sure that the method worked for existing bets that relied on the flags.

skent259 commented 2 years ago

Reference for some fire bet pay tables: https://wizardofodds.com/games/craps/side-bets/fire-bet/