Skip to content

Commit

Permalink
dont allow boost if a boost exists
Browse files Browse the repository at this point in the history
  • Loading branch information
JollyGrin committed Mar 30, 2024
1 parent 93cf3bb commit 8f3f438
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/DeckPool/PoolFns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,25 +183,26 @@ export const commitCard = (pool: PoolType, cardIndex: number): PoolType => {

export const boostCard = (pool: PoolType, cardIndex: number): PoolType => {
if (!pool?.hand) return pool;
if (pool.commit.boost) return pool;
pool.commit.boost = pool.hand[cardIndex];
pool.hand.splice(cardIndex, 1);
return pool;
};

export const cancelBoost = (pool: PoolType): PoolType => {
if (!pool?.commit.boost) return pool;
pool.hand.push(pool.commit.boost);
pool.hand.unshift(pool.commit.boost);
pool.commit.boost = null;
return pool;
};

export const discardCommit = (pool: PoolType): PoolType => {
if (!pool.commit.main) return pool;
pool.discard.push(pool.commit.main);
pool.discard.unshift(pool.commit.main);
pool.commit.main = null;

if (pool.commit.boost) {
pool.discard.push(pool.commit.boost);
pool.discard.unshift(pool.commit.boost);
pool.commit.boost = null;
}

Expand Down

0 comments on commit 8f3f438

Please sign in to comment.