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 && -
- {`+${rankChips[Rank[rank] as keyof typeof rankChips]}`} -
- } ) } \ No newline at end of file diff --git a/src/components/Consumable.tsx b/src/components/Consumable.tsx index aca1701..a6a0324 100644 --- a/src/components/Consumable.tsx +++ b/src/components/Consumable.tsx @@ -156,7 +156,6 @@ export const Consumable = ({ selected = false, consumable: cons, ...props }: Con `${selected ? ' selected' : ''}` + `${props.shopMode ? ' shopping' : ''}` } - > { if(props.shopMode) { @@ -164,7 +163,7 @@ export const Consumable = ({ selected = false, consumable: cons, ...props }: Con } else { dispatch({type: 'select', payload: {card: game.cards.consumables.find(c => c.id === props.id)}}) } - }} onMouseDown={mouseDown} /> + }} onMouseDown={props.shopMode ? () => {} : mouseDown} /> {props.shopMode &&
@@ -193,7 +192,7 @@ export const Consumable = ({ selected = false, consumable: cons, ...props }: Con if(game.stats.money >= price) { dispatch({type: 'stat', payload: {stat: 'money', amount: -price}}) dispatch({type: 'shop-remove', payload: {card: {selected, consumable: cons, ...props}}}) - useConsumable(game, dispatch, cons) + useConsumable(game, dispatch, cons, true) } }}>
BUY
diff --git a/src/components/Joker.tsx b/src/components/Joker.tsx index c13e924..2bdb875 100644 --- a/src/components/Joker.tsx +++ b/src/components/Joker.tsx @@ -124,7 +124,7 @@ export const Joker = ({id, joker, edition, selected = false, ...props}: JokerIns } else { dispatch({type: 'select', payload: {card: self}}) } - }} onMouseDown={mouseDown} /> + }} onMouseDown={props.shopMode ? () => {} : mouseDown} /> {props.debuffed && } {!props.flipped &&
diff --git a/src/components/JokerInfo.ts b/src/components/JokerInfo.ts index 0a7c529..3b115f4 100644 --- a/src/components/JokerInfo.ts +++ b/src/components/JokerInfo.ts @@ -32,8 +32,103 @@ export const Jokers: JokerType[] = [ cost: 2, rarity: 'Common', activation: [Activation.Independent] - }, - { + }, { + name: 'Greedy Joker', + description: 'Played cards with \n{orange}Diamond/ suit give \n{red}+3/ Mult when scored', + cost: 5, + rarity: 'Common', + activation: [Activation.OnScored] + }, { + name: 'Lusty Joker', + description: 'Played cards with \n{red}Heart/ suit give \n{red}+3/ Mult when scored', + cost: 5, + rarity: 'Common', + activation: [Activation.OnScored] + }, { + name: 'Wrathful Joker', + description: 'Played cards with \n{dark-purple}Spade/ suit give \n{red}+3/ Mult when scored', + cost: 5, + rarity: 'Common', + activation: [Activation.OnScored] + }, { + name: 'Gluttonous Joker', + description: 'Played cards with \n{blue}Club/ suit give \n{red}+3/ Mult when scored', + cost: 5, + rarity: 'Common', + activation: [Activation.OnScored] + }, { + name: 'Jolly Joker', + description: '{red}+8/ Mult if played hand\n contains a /{orange}Pair', + cost: 3, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Zany Joker', + description: '{red}+12/ Mult if played\n hand contains a\n {orange}Three of a Kind', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Mad Joker', + description: '{red}+10/ Mult if played\nhand contains a\n {orange}Two Pair', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Crazy Joker', + description: '{red}+12/ Mult if played\nhand contains a\n {orange}Straight', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Droll Joker', + description: '{red}+10/ Mult if played\nhand contains a\n {orange}Flush', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Sly Joker', + description: '{blue}+50/ Chips if played\n hand contains a\n{orange}Pair', + cost: 3, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Wily Joker', + description: '{blue}+100/ Chips if played\n hand contains a\n{orange}Three of a Kind', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Clever Joker', + description: '{blue}+80/ Chips if played\n hand contains a\n{orange}Two Pair', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Devious Joker', + description: '{blue}+100/ Chips if played\n hand contains a\n{orange}Straight', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Crafty Joker', + description: '{blue}+80/ Chips if played\n hand contains a\n{orange}Flush', + cost: 4, + rarity: 'Common', + activation: [Activation.Independent] + }, { + name: 'Half Joker', + description: '{red}+20/ Mult if played\n hand contains /{orange}3\n or fewer cards', + cost: 5, + rarity: 'Common', + activation: [Activation.Independent] + } + + + + + + ,{ name: 'Baseball Card', description: '{green}Uncommon/Jokers each\ngive/{red-invert}X1.5/Mult', cost: 8, diff --git a/src/components/UseConsumable.ts b/src/components/UseConsumable.ts index 2650465..7fffc3a 100644 --- a/src/components/UseConsumable.ts +++ b/src/components/UseConsumable.ts @@ -7,7 +7,7 @@ const suits = Object.keys(Suit).filter(k => isNaN(Number(k))).map(s => s as keyo const ranks = Object.keys(Rank).filter(r => isNaN(Number(r))).map(r => r as keyof typeof Rank) const enhancements = Object.keys(Enhancement).filter(e => isNaN(Number(e))).map(e => e as keyof typeof Enhancement) -export const useConsumable = (game: GameState, dispatch: React.Dispatch, consumable: ConsumableType) => { +export const useConsumable = (game: GameState, dispatch: React.Dispatch, consumable: ConsumableType, instant?: boolean) => { if(game.cards.submitted.length === 0) { if(consumable.type === 'Planet') { levelHand({hand: consumable.hand!}) @@ -191,7 +191,9 @@ export const useConsumable = (game: GameState, dispatch: React.Dispatch - for(let i = 0; i < Math.min(2, game.stats.consumableSize - game.cards.consumables.length + 1); i++) { + let n = Math.min(2, game.stats.consumableSize - game.cards.consumables.length) + if(game.cards.consumables.find(c => c.consumable.name === 'The Emperor')) { n++ } + for(let i = 0; i < n; i++) { tarot = validTarots[Math.floor(Random.next() * validTarots.length)] dispatch({type: 'addCard', payload: {card: tarot}}) validTarots = validTarots.filter(c => c.name !== tarot.name) @@ -290,6 +292,6 @@ export const useConsumable = (game: GameState, dispatch: React.Dispatch