forked from rDrama/rDrama
Adds some bug fixes QoL changes to the blackjack game. (#203)
Updates the wager text to show the wager for both hands instead of the original wager since splitting doubles the bet. Adds the ability to split face cards/ten which is allowed in the rules most casinos (it's also universally terrible so idk why anyone would actually split 10s). Adds the ability to double down on 9 as requested by annoyingthegoyim, probably increases EV a very small amount but not really noticeable since 9 is a pretty rare opening hand (and worse than double down on 10 or 11). Moves the split button to after hit/stay since some users complained about splitting by accident due to button placement Co-authored-by: Chuck <dude@bussy.com> Reviewed-on: rDrama/rDrama#203 Co-authored-by: top <top@noreply.fsdfsd.net> Co-committed-by: top <top@noreply.fsdfsd.net>master
parent
8a1243dd35
commit
24eafc85d8
|
@ -171,7 +171,7 @@ function updateBlackjackTable(state) {
|
||||||
|
|
||||||
|
|
||||||
if (state.status === 'PLAYING' || (state.has_player_split && state.status_split === 'PLAYING')) {
|
if (state.status === 'PLAYING' || (state.has_player_split && state.status_split === 'PLAYING')) {
|
||||||
updateResult(`${state.wager.amount} ${currency} are at stake`, "success");
|
updateResult(`${state.has_player_split ? state.wager.amount * 2 : state.wager.amount} ${currency} are at stake`, "success");
|
||||||
} else {
|
} else {
|
||||||
enableWager();
|
enableWager();
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,12 +269,12 @@ def can_double_down(state):
|
||||||
player = state['player']
|
player = state['player']
|
||||||
player_hand_value = get_value_of_hand(player)
|
player_hand_value = get_value_of_hand(player)
|
||||||
player_never_hit = len(player) == 2
|
player_never_hit = len(player) == 2
|
||||||
return not state['has_player_split'] and player_hand_value in (10, 11) and player_never_hit
|
return not state['has_player_split'] and player_hand_value in (9, 10, 11) and player_never_hit
|
||||||
|
|
||||||
def can_split(state):
|
def can_split(state):
|
||||||
player = state['player']
|
player = state['player']
|
||||||
player_never_hit = len(player) == 2
|
player_never_hit = len(player) == 2
|
||||||
hand_can_split = player[0][0] == player[1][0]
|
hand_can_split = player[0][1] == player[1][1]
|
||||||
player_has_split = state['has_player_split']
|
player_has_split = state['has_player_split']
|
||||||
return hand_can_split and player_never_hit and not player_has_split
|
return hand_can_split and player_never_hit and not player_has_split
|
||||||
|
|
||||||
|
|
|
@ -15,17 +15,16 @@
|
||||||
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" id="twentyone-DEAL" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="deal()">Deal</button>
|
<button type="button" id="twentyone-DEAL" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="deal()">Deal</button>
|
||||||
<button type="button" id="twentyone-SPLIT" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="split()"
|
|
||||||
style="display: none">Split</button>
|
|
||||||
<button type="button" id="twentyone-HIT" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="hit()" style="display: none">Hit</button>
|
<button type="button" id="twentyone-HIT" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="hit()" style="display: none">Hit</button>
|
||||||
<button type="button" id="twentyone-STAY" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="stay()"
|
<button type="button" id="twentyone-STAY" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="stay()"
|
||||||
style="display: none">Stay</button>
|
style="display: none">Stay</button>
|
||||||
|
<button type="button" id="twentyone-SPLIT" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="split()"
|
||||||
|
style="display: none">Split</button>
|
||||||
<button type="button" id="twentyone-DOUBLE_DOWN" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="doubleDown()"
|
<button type="button" id="twentyone-DOUBLE_DOWN" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="doubleDown()"
|
||||||
style="display: none">Double Down</button>
|
style="display: none">Double Down</button>
|
||||||
<button type="button" id="twentyone-BUY_INSURANCE" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="buyInsurance()"
|
<button type="button" id="twentyone-BUY_INSURANCE" class="btn btn-primary twentyone-btn" data-nonce="{{g.nonce}}" data-onclick="buyInsurance()"
|
||||||
style="display: none">Buy
|
style="display: none">Buy
|
||||||
Insurance</button>
|
Insurance</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="twentyone-SPLIT_ACTIONS" class="btn-group" style="display: none;">
|
<div id="twentyone-SPLIT_ACTIONS" class="btn-group" style="display: none;">
|
||||||
|
|
Loading…
Reference in New Issue