Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "early pick-up of pile" #3

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Of course to playtest the game you need to know the rules. Well, here they are:
- 10: Burns the pile including itself
- Player can play multiple cards of the same rank
- After every turn Player must take from deck until **hand** size is **3**
- Player takes whole pile if no card could be played into their **hand**
- Player can pick up the pile at any moment
- When a _hand_ is empty you move to the next one:
**hand** -> **face-up** -> **face-down**
- **face-down** cards are played _blindly_ and player must take the pile
Expand Down
8 changes: 1 addition & 7 deletions src/state/machines/zhithead.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,7 @@ export const zhitheadMachine = zhitheadModel.createMachine(
"takePile",
"switchTurns",
],
cond: (context) =>
context.currentTurn === "human" &&
(!_canPlay(
context.pile.at(-1)!,
context.pile.slice(0, -1)
) ||
!canCurrentPlayerPlayCard(context)),
cond: (context) => context.currentTurn === "human",
},
},
},
Expand Down