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

Feature/disallow immediate dev cards #292

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

zarns
Copy link
Contributor

@zarns zarns commented Nov 12, 2024

Players should be able to,

  • Play any development cards before rolling
  • Play development cards they purchased on previous turns
    Players should not be able to,
  • Play dev cards purchased on the same turn (excluding victory points)
  • Play more than one dev card (of any type excluding victory points) in a turn

closes #149

Copy link

netlify bot commented Nov 12, 2024

👷 Deploy request for catanatron-staging pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c879d38

@zarns zarns force-pushed the feature/disallow_immediate_dev_cards branch from ca7e46b to c879d38 Compare November 12, 2024 19:22
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11804258308

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 95.981%

Totals Coverage Status
Change from base Build 10864300657: 0.009%
Covered Lines: 1385
Relevant Lines: 1443

💛 - Coveralls

@zarns
Copy link
Contributor Author

zarns commented Nov 12, 2024

Info on performance implications:

  • catanatron-play -n 1000
    • before: 43.4 sec
    • after: 44.1 sec
  • catanatron-play --players=AB,R,W --num=100
    • before: 309.36 sec
    • after: 295.7 sec

Copy link
Owner

@bcollazo bcollazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for this! 🔥 🔥 🚀

const key = playerKey(gameState, gameState.current_color);
const isRoll =
gameState.current_prompt === "PLAY_TURN" &&
!gameState.player_state[`${key}_HAS_ROLLED`];
const isDiscard = gameState.current_prompt === "DISCARD";
const isMoveRobber = gameState.current_prompt === "MOVE_ROBBER";
const isPlayingDevCard = isPlayingMonopoly || isPlayingYearOfPlenty || isRoadBuilding;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@bcollazo bcollazo merged commit 6f16b7d into bcollazo:master Nov 16, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[React][UI] Disallow player to play development in the same turn it was bought
3 participants