Skip to content

Commit

Permalink
Joker activation revamp, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
imisaacwu committed Sep 15, 2024
1 parent 9ca1133 commit c4bbadb
Show file tree
Hide file tree
Showing 21 changed files with 511 additions and 223 deletions.
28 changes: 24 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { InfoPanel } from './components/InfoPanel'
import { Joker } from './components/Joker'
import { Round } from './components/Round'
import { Shop } from './components/Shop'
import { Blinds } from './Constants'
import { Blinds, DeckType } from './Constants'
import { gameReducer, GameStateContext, initialGameState } from './GameState'
import { cardSnap } from './Utilities'
import { MainMenu } from './components/MainMenu'
Expand Down Expand Up @@ -45,7 +45,13 @@ export default function App() {

const currBlindType = game.blind.curr === 'small' ? Blinds[0] : game.blind.curr === 'big' ? Blinds[1] : game.blind.boss

const reward = currBlindType.reward + game.stats.hands + Math.min(Math.floor(game.stats.money / 5), 5)
let reward = currBlindType.reward
if(game.stats.deck === DeckType.Green) {
reward += 2 * game.stats.hands + game.stats.discards
} else {
reward += game.stats.hands + Math.min(Math.floor(game.stats.money / 5), 5)
}


return (
<GameStateContext.Provider value={{ state: game, dispatch }}>
Expand Down Expand Up @@ -111,14 +117,28 @@ export default function App() {
}}>{`Cash Out: $${reward}`}</div>
<Blind type='post' blind={currBlindType} />
<div id='post-dots'>{'. '.repeat(49)}</div>
{game.stats.hands > 0 &&
{game.stats.deck !== DeckType.Green && game.stats.hands > 0 &&
<div id='remaining-hands' className='extra-reward'>
<div className='num-extra'>{game.stats.hands}</div>
<div className='extra-reward-text'>{'Remaining Hands \[$1 each\]'}</div>
<div className='reward'>{'$'.repeat(game.stats.hands)}</div>
</div>
}
{game.stats.money > 4 &&
{game.stats.deck === DeckType.Green && game.stats.hands > 0 &&
<div id='remaining-hands' className='extra-reward'>
<div className='num-extra'>{game.stats.hands}</div>
<div className='extra-reward-text'>{'Remaining Hands \[$2 each\]'}</div>
<div className='reward'>{'$'.repeat(2 * game.stats.hands)}</div>
</div>
}
{game.stats.deck === DeckType.Green && game.stats.discards > 0 &&
<div id='remaining-hands' className='extra-reward'>
<div className='num-extra'>{game.stats.discards}</div>
<div className='extra-reward-text'>{'Remaining Discards \[$1 each\]'}</div>
<div className='reward'>{'$'.repeat(game.stats.discards)}</div>
</div>
}
{game.stats.deck !== DeckType.Green && game.stats.money > 4 &&
<div id='interest' className='extra-reward'>
<div className='num-extra'>{Math.min(Math.floor(game.stats.money / 5), 5)}</div>
<div className='extra-reward-text'>{'1 interest per $5 \[5 max\]'}</div>
Expand Down
31 changes: 24 additions & 7 deletions src/Constants.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
export enum DeckType { Abandoned, Anaglyph, Black, Blue, Challenge, Checkered, Erratic, Ghost, Green, Magic, Nebula, Painted, Plasma, Red, Yellow, Zodiac }
export enum DeckType {
Abandoned,
// Anaglyph,
Black,
Blue,
// Challenge,
Checkered,
Erratic,
Ghost,
Green,
// Magic,
// Nebula,
Painted,
// Plasma,
Red,
Yellow,
// Zodiac
}

export const deckInfo: {[D in keyof typeof DeckType]: string} = {
Abandoned: 'Start run with\n no/ {orange}Face Cards\n in your deck',
Anaglyph: '',
// Anaglyph: '',
Black: '{orange}+1/ Joker slot\n {blue}-1/ hand\n every round',
Blue: '{blue}+1/ hand\n every round',
Challenge: '',
// Challenge: '',
Checkered: 'Start run with\n {orange}26/ {dark-purple}Spades/ and\n {orange}26/ {red}Hearts/ in deck',
Erratic: 'All Ranks and\n Suits in deck\n are randomized',
Ghost: '{indigo}Spectral/ cards may\n appear in the shop,\n start with a/ {indigo}Hex/ card',
Green: 'At end of each Round:\n {yellow}$2/ {small black}per remaining/ {blue}Hand\n {yellow}$1/ {small black}per remaining/ {red}Discard\n Earn no/ {orange}Interest',
Magic: 'Start run with the\n {purple}Crystal Ball/ voucher\n and/ {orange}2/ copies\n of/ {purple}The Fool',
Nebula: 'Start run with the\n {aqua}Telescope/ voucher\n {red}-1/ consumable slot',
// Magic: 'Start run with the\n {purple}Crystal Ball/ voucher\n and/ {orange}2/ copies\n of/ {purple}The Fool',
// Nebula: 'Start run with the\n {aqua}Telescope/ voucher\n {red}-1/ consumable slot',
Painted: '{orange}+2/ Hand Size,\n {orange}-1/ Joker Slot',
Plasma: '',
// Plasma: '',
Red: '{red}+1/ discard\n every round',
Yellow: 'Start with\n extra/ {yellow}$10',
Zodiac: 'Start run with\n {purple}Tarot Merchant/,\n {aqua}Planet Merchant/,\n and {orange}Overstock'
// Zodiac: 'Start run with\n {purple}Tarot Merchant/,\n {aqua}Planet Merchant/,\n and {orange}Overstock'
}

export enum Suit { Spades, Hearts, Clubs, Diamonds }
Expand Down
Loading

0 comments on commit c4bbadb

Please sign in to comment.