diff --git a/src/GameState.ts b/src/GameState.ts index 8a16f82..52249f6 100644 --- a/src/GameState.ts +++ b/src/GameState.ts @@ -137,7 +137,7 @@ export const initialGameState: GameState = { }, blind: { - curr: 'boss', + curr: 'small', boss: boss_roll(1), base: ante_base(1) }, @@ -501,6 +501,30 @@ export const gameReducer = (state: GameState, action: GameAction): GameState => state.jokers.filter(j => j.joker.activation.includes(Activation.OnScored) && !j.debuffed).forEach(j => { switch(j.joker.name) { + case 'Greedy Joker': + if(c.suit === Suit.Diamonds) { + mult += 3 + next.scoreLog.push({name: 'Greedy Joker', mult: 3, mult_type: '+'}) + } + break + case 'Lusty Joker': + if(c.suit === Suit.Hearts) { + mult += 3 + next.scoreLog.push({name: 'Lusty Joker', mult: 3, mult_type: '+'}) + } + break + case 'Wrathful Joker': + if(c.suit === Suit.Spades) { + mult += 3 + next.scoreLog.push({name: 'Wrathful Joker', mult: 3, mult_type: '+'}) + } + break + case 'Gluttonous Joker': + if(c.suit === Suit.Clubs) { + mult += 3 + next.scoreLog.push({name: 'Gluttonous Joker', mult: 3, mult_type: '+'}) + } + break case 'Triboulet': if([Rank.King, Rank.Queen].includes(c.rank)) { mult *= 2 @@ -573,12 +597,79 @@ export const gameReducer = (state: GameState, action: GameAction): GameState => } }) + ranks = ranks.sort((a, b) => b - a) state.jokers.filter(j => j.joker.activation.includes(Activation.Independent) && !j.debuffed).forEach(j => { switch(j.joker.name) { case 'Joker': mult += 4; next.scoreLog.push({name: 'Joker', mult: 4, mult_type: '+'}) break + case 'Jolly Joker': + if(ranks[0] >= 2) { + mult += 8; + next.scoreLog.push({name: 'Jolly Joker', mult: 8, mult_type: '+'}) + } + break + case 'Zany Joker': + if(ranks[0] >= 3) { + mult += 12; + next.scoreLog.push({name: 'Zany Joker', mult: 12, mult_type: '+'}) + } + break + case 'Mad Joker': + if(ranks[0] >= 2 && ranks[1] >= 2) { + mult += 10; + next.scoreLog.push({name: 'Mad Joker', mult: 10, mult_type: '+'}) + } + break + case 'Crazy Joker': + if(hand.match(/.*STRAIGHT.*/)) { + mult += 12; + next.scoreLog.push({name: 'Crazy Joker', mult: 12, mult_type: '+'}) + } + break + case 'Droll Joker': + if(hand.match(/.*FLUSH.*/)) { + mult += 10; + next.scoreLog.push({name: 'Droll Joker', mult: 10, mult_type: '+'}) + } + break + case 'Sly Joker': + if(ranks[0] >= 2) { + chips += 50; + next.scoreLog.push({name: 'Sly Joker', chips: 50}) + } + break + case 'Wily Joker': + if(ranks[0] >= 3) { + chips += 100; + next.scoreLog.push({name: 'Wily Joker', chips: 100}) + } + break + case 'Clever Joker': + if(ranks[0] >= 2 && ranks[1] >= 2) { + chips += 80; + next.scoreLog.push({name: 'Clever Joker', chips: 80}) + } + break + case 'Devious Joker': + if(hand.match(/.*STRAIGHT.*/)) { + chips += 100; + next.scoreLog.push({name: 'Devious Joker', chips: 100}) + } + break + case 'Crafty Joker': + if(hand.match(/.*FLUSH.*/)) { + chips += 80; + next.scoreLog.push({name: 'Crafty Joker', chips: 80}) + } + break + case 'Half Joker': + if(state.cards.selected.length <= 3) { + mult += 20; + next.scoreLog.push({name: 'Half Joker', mult: 20, mult_type: '+'}) + } + break } if(baseball && j.joker.rarity === 'Uncommon') { mult *= 1.5 diff --git a/src/Utilities.ts b/src/Utilities.ts index 166135e..2e8cb99 100644 --- a/src/Utilities.ts +++ b/src/Utilities.ts @@ -44,24 +44,22 @@ const getPokerHand = (cards: CardInfo[]): keyof typeof HandType => { // xxSAKQJT 98765432 const straights = [0x100F, 0x1F, 0x3E, 0x7C, 0xF8, 0x1F0, 0x3E0, 0x7C0, 0xF80, 0x1F00] const hand = cards.reduce((total, c) => total | (1 << c.rank), 0) + let min_rank: keyof typeof HandType = 'NONE' - // [2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A, Stone] - let ranks: number[] = new Array(14).fill(0), suits: number[] = new Array(4).fill(0) + // [2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A] + let ranks: number[] = new Array(13).fill(0), suits: number[] = new Array(4).fill(0) cards.forEach(c => { if(c.enhancement !== undefined && c.enhancement === Enhancement.Stone) { - ranks[13]++; + min_rank = 'HIGH_CARD' } else { ranks[c.rank]++ suits[c.suit]++ } }) + ranks = ranks.filter(r => r !== 0).sort((a, b) => b - a) suits = suits.filter(s => s !== 0).sort((a, b) => b - a) - if(ranks.length === 1 && hand === 0x3000) { - return 'HIGH_CARD' - } - if(suits[0] === 5) { if(ranks[0] === 5) return 'FLUSH_FIVE' if(straights.includes(hand)) return 'STRAIGHT_FLUSH' @@ -77,7 +75,7 @@ const getPokerHand = (cards: CardInfo[]): keyof typeof HandType => { case 1: return straights.includes(hand) ? 'STRAIGHT' : 'HIGH_CARD' } - return 'NONE' + return min_rank } export const shuffle = (cards: any[]) => { diff --git a/src/assets/jokers/Common/Clever_Joker.png b/src/assets/jokers/Common/Clever_Joker.png new file mode 100644 index 0000000..8884f82 Binary files /dev/null and b/src/assets/jokers/Common/Clever_Joker.png differ diff --git a/src/assets/jokers/Common/Crafty_Joker.png b/src/assets/jokers/Common/Crafty_Joker.png new file mode 100644 index 0000000..44cb10c Binary files /dev/null and b/src/assets/jokers/Common/Crafty_Joker.png differ diff --git a/src/assets/jokers/Common/Crazy_Joker.png b/src/assets/jokers/Common/Crazy_Joker.png new file mode 100644 index 0000000..4ccf79f Binary files /dev/null and b/src/assets/jokers/Common/Crazy_Joker.png differ diff --git a/src/assets/jokers/Common/Devious_Joker.png b/src/assets/jokers/Common/Devious_Joker.png new file mode 100644 index 0000000..948d162 Binary files /dev/null and b/src/assets/jokers/Common/Devious_Joker.png differ diff --git a/src/assets/jokers/Common/Droll_Joker.png b/src/assets/jokers/Common/Droll_Joker.png new file mode 100644 index 0000000..53d2d09 Binary files /dev/null and b/src/assets/jokers/Common/Droll_Joker.png differ diff --git a/src/assets/jokers/Common/Gluttonous_Joker.png b/src/assets/jokers/Common/Gluttonous_Joker.png new file mode 100644 index 0000000..b84a6e1 Binary files /dev/null and b/src/assets/jokers/Common/Gluttonous_Joker.png differ diff --git a/src/assets/jokers/Common/Greedy_Joker.png b/src/assets/jokers/Common/Greedy_Joker.png new file mode 100644 index 0000000..c38f868 Binary files /dev/null and b/src/assets/jokers/Common/Greedy_Joker.png differ diff --git a/src/assets/jokers/Common/Half_Joker.png b/src/assets/jokers/Common/Half_Joker.png new file mode 100644 index 0000000..727226d Binary files /dev/null and b/src/assets/jokers/Common/Half_Joker.png differ diff --git a/src/assets/jokers/Common/Jolly_Joker.png b/src/assets/jokers/Common/Jolly_Joker.png new file mode 100644 index 0000000..99e6bec Binary files /dev/null and b/src/assets/jokers/Common/Jolly_Joker.png differ diff --git a/src/assets/jokers/Common/Lusty_Joker.png b/src/assets/jokers/Common/Lusty_Joker.png new file mode 100644 index 0000000..aecf65c Binary files /dev/null and b/src/assets/jokers/Common/Lusty_Joker.png differ diff --git a/src/assets/jokers/Common/Mad_Joker.png b/src/assets/jokers/Common/Mad_Joker.png new file mode 100644 index 0000000..2a96509 Binary files /dev/null and b/src/assets/jokers/Common/Mad_Joker.png differ diff --git a/src/assets/jokers/Common/Sly_Joker.png b/src/assets/jokers/Common/Sly_Joker.png new file mode 100644 index 0000000..a1fb6ef Binary files /dev/null and b/src/assets/jokers/Common/Sly_Joker.png differ diff --git a/src/assets/jokers/Common/Wily_Joker.png b/src/assets/jokers/Common/Wily_Joker.png new file mode 100644 index 0000000..92e031d Binary files /dev/null and b/src/assets/jokers/Common/Wily_Joker.png differ diff --git a/src/assets/jokers/Common/Wrathful_Joker.png b/src/assets/jokers/Common/Wrathful_Joker.png new file mode 100644 index 0000000..7ef19ca Binary files /dev/null and b/src/assets/jokers/Common/Wrathful_Joker.png differ diff --git a/src/assets/jokers/Common/Zany_Joker.png b/src/assets/jokers/Common/Zany_Joker.png new file mode 100644 index 0000000..045e4b9 Binary files /dev/null and b/src/assets/jokers/Common/Zany_Joker.png differ diff --git a/src/components/Card.css b/src/components/Card.css index e764356..2e1c4b9 100644 --- a/src/components/Card.css +++ b/src/components/Card.css @@ -242,10 +242,4 @@ .tag-description div div { width: max-content; -} - -#playing-card-scored-popup { - position: absolute; - top: -48px; - background-color: var(--blue); } \ No newline at end of file diff --git a/src/components/Card.tsx b/src/components/Card.tsx index d0b02e1..44c429c 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -211,11 +211,6 @@ export const Card = ({ } - {submitted && scored && !debuffed && -