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

Add new game Zwanzigerrufen #995

Merged
merged 8 commits into from
Oct 31, 2021
Merged

Add new game Zwanzigerrufen #995

merged 8 commits into from
Oct 31, 2021

Conversation

tuxor1337
Copy link
Collaborator

@tuxor1337 tuxor1337 commented Oct 28, 2021

This adds an implementation of the eastern Austrian game Zwanzigerrufen which is a simplified version of Königrufen:

grafik

The new card pattern is a traditional Tarock pattern used in Austria since the early 19th century, hence it is public domain.

While implementing this game, I fixed #992 and some other card game-related UI stuff.

Checklist

@vdfdev
Copy link
Contributor

vdfdev commented Oct 29, 2021

Looks great! I had a busy day today so I will get to your PR tomorrow

Copy link
Collaborator Author

@tuxor1337 tuxor1337 left a comment

Choose a reason for hiding this comment

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

I added some comments in the code to clarify what happens in this PR.

const highest_bid = Math.max(...G.players.map((P) => P.bid));
const all_bids = [0, 1, 2, 3, 4];
const all_bids = [Contract.Pass, Contract.Small, Contract.Guard, Contract.GuardWithout, Contract.GuardAgainst];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Part of this PR just replaces plain numbers in frenchTarot by enums.

Copy link
Contributor

Choose a reason for hiding this comment

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

great, this is much better

"description": "Jogo de Cartas da Áustria Oriental",
"descriptionTag": "Jogue Zwanzigerrufen online!",
"instructions": {
"text": "Para uma descrição do jogo, por favor leia a página da Wikipedia: https://en.wikipedia.org/wiki/Zwanzigerrufen\n\nToda a arte usada nessa implementação é do baralho de cartas \"Industrie und Glück\" da primeira metade do século XIX e disponível no domínio público: https://en.wikipedia.org/wiki/Industrie_und_Gl%C3%BCck"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please check the portuguese translation, I just took some strings from other card games and used a translator for the rest.

Copy link
Contributor

Choose a reason for hiding this comment

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

pretty good job :)

Comment on lines +33 to +34
const Template = ({ color, value, pattern, ...rest }) => {
return <Card pattern={pattern} type={{ color: color, value: value }} {...rest} />;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The storybook template for the Card component now gives select and range controls to specify the CardColor and value of the card.

Comment on lines +104 to +106
[col, row] = cardBlank;
text = `CardColor.${CardColor[C.color]} is not available with the ${props.pattern} pattern.`;
text += ` Supported colors are: ${colors.map((c) => CardColor[c]).join(', ')}.`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unsupported combinations of CardColor and Pattern now cause the Card component to show a blank card with an error message string on it. This should only be relevant for the storybook page. In real games, this should never happen if the game is correctly implemented.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tuxor1337 is "color" the suit (club, hearts, spades, diamonds)? I noticed the name in my examination and thought it might be. Suggest we refactor that name but I defer to your choice; it might make the reuse better understood if we provide an alias to the common name (in English).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree that the terminology is mixed up. Most occurrences of "color" should be "suit". I'm sorry for this confusion which comes from my native language German, where the two words have the same meaning in the context of card games.

However, since this requires major changes to all of my card game implementations, I prepared a separate PR to address the issue for all card games and the shared card components at once. I will open that PR once this PR is merged.

Comment on lines +24 to +28
if (props.pattern == Pattern.Tarock) {
width_min = 60;
width_max = 90;
visible_ratio = 0.6;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the card hand that is "fanned out" so that cards overlap, the overlap of the cards does now depend on the specified card pattern. Since the (new) Tarock pattern doesn't have numbers/letters in the four corners, the overlap needs to be smaller so that a larger part of the graphics are visible.

Copy link
Collaborator

@cwatsonc cwatsonc Oct 29, 2021

Choose a reason for hiding this comment

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

In English (sorry for the ethnocentric reference) the tarot are referred to in their major, and minor, "arcana" don't know if your game is a reference to the traditional "oracle" (fortune teller cards)? The arcana in English translate roughly to Canes, Cups, Coins, Swords the Latin (Fr.?) Clubs, Hearts, Diamonds, Spades see this article maybe alias' would make this clearer.

Copy link
Collaborator Author

@tuxor1337 tuxor1337 Oct 29, 2021

Choose a reason for hiding this comment

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

In a card game context, the French suits Clubs, Hearts, Diamonds, Spades are much more common for card games in the Tarot/Tarock-family, see https://en.wikipedia.org/wiki/Tarot_card_games

Copy link
Collaborator

Choose a reason for hiding this comment

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

In a card game context, the French suits Clubs, Hearts, Diamonds, Spades are much more common for card games in the Tarot/Tarock-family, see https://en.wikipedia.org/wiki/Tarot_card_games

Understood. Does the typing support alias'? Perhaps we could support both. I've never played your game but the ref'd link above speaks to the common names in English, Latin, Fr. arcana (suits).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't understand your idea: Which alias would you like to have for which existing type?

@@ -4,7 +4,6 @@
bottom: 0;
left: 0;
right: 0;
margin: 15px 15px 0;
Copy link
Collaborator Author

@tuxor1337 tuxor1337 Oct 29, 2021

Choose a reason for hiding this comment

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

The arrangement of the player zones on the screen is still (and will definitely remain) subject to improvements from time to time. This is really hard for 4 and 5 player games since the layout should be responsive to support both small and large screens in both landscape and portrait mode.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have some ideas there... I'll be adding some suggestions if you're willing to consider them. The cardinal directions and the player positions should be relative so If I sit north the clockwise play would be north (self), east, south, west in four player games. I want to work on a table concept that allows the players to choose one of these four seats before entering a game -- this could be reused between ALL games as a way to arrange partnerships play order etc. I think showing the card top 1/3 is usually enough in standard playing cards to establish card identity so you can make a hand that is very compact. in each of the cardinal directions.

Copy link
Collaborator

@cwatsonc cwatsonc Oct 29, 2021

Choose a reason for hiding this comment

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

In contract bridge @vdfdev the most popular card game globally by far duplicate tournament play is organized in n-s/e-w partnerships. The hands are common to all partners played out in standardized rotations (I don't know these but my parents were life master players in the ACBL) and the round consists of 3 "hands" played out in identical sets of cards for each direction -- all permutations make up the tournament so each pair is awarded a score for each of the hands. This is adds to your LIFE MASTER score which makes you eligible for global rankings. In some countries they broadcast these finals annually to HUGE audiences ... If you want some traffic, I believe a good bridge teach/play/tournament facility will immediately show results. /$0.02

See this article on Duplicate Contract Bridge and variants

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe let's discuss this in a different context, e.g. in a GitHub issue or on discord.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe let's discuss this in a different context, e.g. in a GitHub issue or on discord.

added [UI/UX]Tournament Support

@vdfdev vdfdev merged commit 9abc1e6 into master Oct 31, 2021
@vdfdev vdfdev deleted the add_zwanzigerrufen branch October 31, 2021 00:54
@tuxor1337 tuxor1337 mentioned this pull request Oct 31, 2021
2 tasks
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.

Inconsistent card face when toggling between Pattern Types
3 participants