### Events, Projects, and Ways in Python Source: https://context7.com/dwagon/pydominion/llms.txt Demonstrates the implementation of expansion mechanics like Events, Projects, and Ways using the 'dominion' library. This example shows an Event card that provides a one-time effect when purchased. ```python from dominion import Card, Event, Project, Way # Event: One-time purchasable effect class Event_Example(Event.Event): def __init__(self): Event.Event.__init__(self) self.base = Card.CardExpansion.ADVENTURES self.name = "Example Event" self.cost = 5 self.desc = "Gain a Gold." def special(self, game, player): """Event effect when purchased""" player.gain_card("Gold") player.output("Gained a Gold from event") ``` -------------------------------- ### Game Setup and Duration Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks handle game initialization and duration card effects. 'setup' is called once before the game starts after piles and players are set up. 'duration' is invoked for duration cards on the next turn. ```python def setup(game): # Any setup required before the game starts pass def duration(game, player): # Logic for duration cards on the next turn pass ``` -------------------------------- ### Create and Run a Dominion Game Programmatically Source: https://context7.com/dwagon/pydominion/llms.txt Initialize and control a Dominion game using the `Game` class API in Python. This allows for programmatic setup of game parameters such as player count, initial cards, excluded cards, expansions, and event/landmark inclusion, followed by starting and running the game loop. ```python from dominion import Game # Create a game with specific configuration game = Game.Game( numplayers=2, initcards=["Chapel", "Smithy", "Village", "Market", "Festival"], badcards=["Witch"], # Exclude these cards prosperity=True, # Use Colony/Platinum quiet=False, # Show game output num_events=1, # Include random events num_landmarks=1, # Include random landmarks ) # Start the game (sets up card piles, creates players, deals hands) game.start_game() # Run the game loop while not game.game_over: game.turn() # Get final scores scores = game.whoWon() # Output: {"Player 1": 42, "Player 2": 38} ``` -------------------------------- ### Running a Random Game with pydominion Source: https://github.com/dwagon/pydominion/blob/main/README.md This snippet shows how to initiate a random game of Dominion using the pydominion project's `rungame.py` script. It provides the basic command to start a game with default settings. An alternative command demonstrates how to specify a custom card set by referencing a file path, allowing for varied gameplay experiences. ```bash ./dominion/rungame.py ``` ```bash ./dominion/rungame.py --cardset ../cardset/ ``` -------------------------------- ### Define a Permanent Project Card in Python Source: https://context7.com/dwagon/pydominion/llms.txt This Python code defines a 'Project_Example' class that inherits from 'Project.Project'. It sets up a permanent project card with a specific cost and description, and implements a hook to grant an extra card at the start of the player's turn. ```python class Project_Example(Project.Project): def __init__(self): Project.Project.__init__(self) self.base = Card.CardExpansion.RENAISSANCE self.name = "Example Project" self.cost = 4 self.desc = "At the start of your turn, +1 Card" def hook_start_turn(self, game, player): """Called at the start of each turn if player has this project""" player.pickup_card() player.output(f"{self.name}: +1 Card") ``` -------------------------------- ### Write Unit Tests for Dominion Cards in Python Source: https://context7.com/dwagon/pydominion/llms.txt Provides an example of how to write unit tests for Dominion cards using Python's `unittest` module. It demonstrates setting up a test game, simulating card plays, and asserting expected outcomes. ```python import unittest from dominion import Game, Piles class Test_MyCard(unittest.TestCase): def setUp(self): # Create a test game with the card self.g = Game.TestGame( numplayers=1, initcards=["MyCard"] ) self.g.start_game() self.plr = self.g.player_list()[0] self.card = self.g.get_card_from_pile("MyCard") self.plr.add_card(self.card, Piles.HAND) def test_play(self): """Test playing the card""" # Set up test inputs for player choices self.plr.test_input = ["finish"] # Auto-select "finish" option hand_size_before = self.plr.piles[Piles.HAND].size() self.plr.play_card(self.card) hand_size_after = self.plr.piles[Piles.HAND].size() # Verify card is now in played pile self.assertIn(self.card, self.plr.piles[Piles.PLAYED]) # If card gives +2 cards, hand should increase by 1 # (played card removed, 2 cards drawn) self.assertEqual(hand_size_after, hand_size_before + 1) def test_trash_effect(self): """Test the trash effect""" self.plr.piles[Piles.HAND].set("Copper", "Estate") self.plr.add_card(self.card, Piles.HAND) # Auto-select Copper to trash self.plr.test_input = ["trash copper", "finish"] self.plr.play_card(self.card) # Copper should be in trash self.assertIn("Copper", [c.name for c in self.g.trash_pile]) # Run tests for a specific card # python dominion/cards/Card_MyCard.py if __name__ == "__main__": unittest.main() ``` -------------------------------- ### Phase Transition Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks are called at specific points during game phases. 'hook_pre_buy' fires before the buy phase, 'hook_end_buy_phase' at the end of the buy phase, and 'hook_cleanup' at the start of the cleanup phase for every played card. ```python def hook_pre_buy(game, player): # Logic before the buy phase pass def hook_end_buy_phase(game, player): # Logic at the end of the buy phase pass def hook_cleanup(game, player, card): # Logic at the start of the cleanup phase for a played card pass ``` -------------------------------- ### Turn and Game End Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks are triggered at the end or start of turns, or at the end of the game. 'hook_end_turn' is called at the end of a player's turn. 'hook_start_turn' is called at the start of a player's turn. 'hook_start_every_turn' is called at the start of every turn regardless of card state. 'hook_end_of_game' is called at the end of the game if registered. ```python def hook_end_turn(game, player): # Logic at the end of the player's turn pass def hook_start_turn(game, player): # Logic at the start of a player's turn pass def hook_start_every_turn(game, player): # Logic at the start of every turn pass def hook_end_of_game(game, player): # Logic at the end of the game pass ``` -------------------------------- ### Duration Cards in Python Source: https://context7.com/dwagon/pydominion/llms.txt Implements duration cards that have effects on future turns. This snippet uses the 'dominion' library and defines a 'duration' method that is called at the start of the player's next turn. It handles card effects and destination pile. ```python from dominion import Card, OptionKeys, Piles class Card_DurationExample(Card.Card): def __init__(self): Card.Card.__init__(self) self.cardtype = [Card.CardType.ACTION, Card.CardType.DURATION] self.name = "Duration Example" self.cost = 5 self.cards = 1 # +1 Card now self.actions = 1 # +1 Action now self.desc = "+1 Card, +1 Action. At the start of your next turn: +2 Cards, +1 Coin" def duration(self, game, player): """Called at the start of your next turn while card is in duration pile""" player.output(f"{self.name} duration effect: +2 Cards, +1 Coin") player.pickup_cards(2) player.coins += 1 # Return options for card handling after duration return { OptionKeys.DESTINATION: Piles.PLAYED # Move to played pile } ``` -------------------------------- ### Load and Use Cardsets in PyDominion (Python) Source: https://context7.com/dwagon/pydominion/llms.txt Demonstrates how to load predefined kingdom card combinations from text files (cardsets) in PyDominion. It shows how to read a cardset file programmatically and initialize a game with these cards. ```python # Cardset files are plain text with one card name per line # Example cardset file (cardset/Big_Money): """ # Comments start with # Gold Silver Copper Province Duchy Estate --prosperity # Enable Prosperity expansion """ # Run game with a cardset import subprocess result = subprocess.run( ["./dominion/rungame.py", "--cardset", "cardset/Basic_Intro"], capture_output=True ) # Or programmatically: from dominion import Game # Read cardset file cards = [] with open("cardset/Basic_Intro") as f: for line in f: line = line.strip() if line and not line.startswith("#"): if line.startswith("--"): continue # Skip options cards.append(line) game = Game.Game(numplayers=2, initcards=cards) game.start_game() ``` -------------------------------- ### Command-line Usage for pydominion Game Source: https://github.com/dwagon/pydominion/blob/main/README.md This snippet details the command-line interface for the `rungame.py` script in the pydominion project. It outlines the available arguments for configuring game parameters such as player count, card inclusion/exclusion, and game variants. This allows users to customize their Dominion game experience through text-based commands. ```bash usage: rungame.py [-h] [--numplayers NUMPLAYERS] [--card INITCARDS] [--bad BADCARDS] [--shelters SHELTERS] [--num_events NUM_EVENTS] [--events EVENTS] [--num_ways NUM_WAYS] [--ways WAYS] [--num_landmarks NUM_LANDMARKS] [--landmark LANDMARKS] [--num_projects NUM_PROJECTS] [--num_traits NUM_TRAITS] [--oldcards] [--project INIT_PROJECTS] [--ally ALLIES] [--trait TRAITS] [--cardset CARDSET] [--cardbase CARDBASE] [--card_path CARD_PATH] [--prosperity] [--bot] [--randobot RANDOBOT] [--quiet] Play dominion options: -h, --help show this help message and exit --numplayers NUMPLAYERS How many players --card INITCARDS Include card in lineup --bad BADCARDS Do not include card in lineup --shelters SHELTERS Allow shelters --num_events NUM_EVENTS Number of events to use --events EVENTS Include event --num_ways NUM_WAYS Number of ways to use --ways WAYS Include way --num_landmarks NUM_LANDMARKS Number of landmarks to use --landmark LANDMARKS Include landmark --num_projects NUM_PROJECTS Number of projects to use --num_traits NUM_TRAITS Number of traits to use --oldcards Use cards from retired versions --project INIT_PROJECTS Include project --ally ALLIES Include specific ally --trait TRAITS Include specific trait --cardset CARDSET File containing list of cards to use --card_path CARD_PATH Where to find card definitions --prosperity Use colonies and platinum coins --bot Bot Player --randobot RANDOBOT Number of Rando Bot Players --quiet Supress a lot of output ``` -------------------------------- ### Run Dominion Game from Command Line Source: https://context7.com/dwagon/pydominion/llms.txt Execute the Dominion game using the `rungame.py` script with various command-line arguments to customize game settings, player count, card selection, and expansions. Supports human players, AI bots, predefined card sets, and specific game mechanics. ```bash # Run a basic 2-player game with random kingdom cards ./dominion/rungame.py # Run with 3 players ./dominion/rungame.py --numplayers 3 # Include specific cards in the kingdom ./dominion/rungame.py --card Chapel --card Smithy --card Village # Play against a Big Money bot ./dominion/rungame.py --bot # Play with multiple random bot players (good for testing) ./dominion/rungame.py --randobot 4 --numplayers 4 # Use Prosperity expansion (Colonies and Platinum) ./dominion/rungame.py --prosperity # Include events and landmarks ./dominion/rungame.py --num_events 2 --num_landmarks 1 # Load a predefined cardset from file ./dominion/rungame.py --cardset cardset/Basic_Intro # Exclude specific cards from random selection ./dominion/rungame.py --bad Witch --bad Moat # Include retired/old card versions ./dominion/rungame.py --oldcards ``` -------------------------------- ### Enabling Bot Player in pydominion Source: https://github.com/dwagon/pydominion/blob/main/README.md This snippet demonstrates how to enable a bot player for the pydominion game. By appending the `--bot` argument to the `rungame.py` command, users can play against a simple bot that implements the 'big money' strategy. The description notes that this bot may occasionally have bugs. ```bash ./dominion/rungame.py --bot ``` -------------------------------- ### Define an Alternative Action Card Play Method (Way) in Python Source: https://context7.com/dwagon/pydominion/llms.txt This Python code defines a 'Way_Example' class that inherits from 'Way.Way'. It provides an alternative way to play action cards, offering a different effect (e.g., drawing more cards) and a custom message when used. ```python class Way_Example(Way.Way): def __init__(self): Way.Way.__init__(self) self.base = Card.CardExpansion.MENAGERIE self.name = "Way of the Example" self.desc = "Instead: +2 Cards" self.cards = 2 # Provides +2 cards when used def special_way(self, game, player, card): """Additional effect when playing a card as this Way""" player.output(f"Using {self.name} instead of {card.name}") return {} # Return options dict ``` -------------------------------- ### Run Automated Dominion Tests using Randobot (Bash) Source: https://context7.com/dwagon/pydominion/llms.txt This section details how to use the `run_randobot` script for automated testing of PyDominion. It covers running random simulations, testing specific cardsets or cards, and validating card definitions. ```bash # Run 100 random games to find bugs ./run_randobot 100 # Run all predefined cardsets ./run_randobot --cardsets # Test specific cards ./run_randobot 50 --card Chapel --card Witch # Keep successful test outputs ./run_randobot 20 --keep # Run unit tests python -m pytest tests/ # Run tests for a specific card python dominion/cards/Card_Chapel.py # Validate all card definitions without playing ./dominion/rungame.py --validate_only ``` -------------------------------- ### Player Interaction Methods in Python Source: https://context7.com/dwagon/pydominion/llms.txt Demonstrates how to use player methods for card effects, including drawing, trashing, discarding, gaining cards, and making choices. This snippet requires the 'dominion' library and utilizes Card and Piles modules. ```python from dominion import Card, Piles class Card_Interactive(Card.Card): def __init__(self): Card.Card.__init__(self) self.cardtype = Card.CardType.ACTION self.name = "Interactive" self.cost = 4 self.desc = "Demonstrates player interaction methods" def special(self, game, player): # Pick up cards from deck cards = player.pickup_cards(2) # Draw 2 cards into hand player.output(f"Drew: {', '.join(c.name for c in cards)}") # Trash cards from hand trashed = player.plr_trash_card( num=1, prompt="Trash a card", anynum=True # Can trash 0 to num cards ) # Discard cards from hand discarded = player.plr_discard_cards( num=2, prompt="Discard 2 cards" ) # Gain a card costing up to 5 gained = player.plr_gain_card( cost=5, modifier="less", # "less", "equal", or "greater" prompt="Gain a card costing up to 5" ) # Give player choices choice = player.plr_choose_options( "Choose an option:", ("+2 Cards", "cards"), ("+2 Coins", "coins"), ("Gain a Silver", "silver") ) if choice == "cards": player.pickup_cards(2) elif choice == "coins": player.coins += 2 elif choice == "silver": player.gain_card("Silver") # Select specific cards from hand selected = player.card_sel( num=1, cardsrc=Piles.HAND, prompt="Select a card", verbs=("Select", "Unselect") ) ``` -------------------------------- ### Define a Custom Dominion Card in Python Source: https://context7.com/dwagon/pydominion/llms.txt Create a new custom card for PyDominion by subclassing the `Card.Card` class and implementing the `__init__` method to define card properties like type, name, cost, and effects. The `special` method is used to define custom card logic, such as trashing cards from hand. ```python from dominion import Card, Game, Piles class Card_MyCard(Card.Card): def __init__(self): Card.Card.__init__(self) self.cardtype = Card.CardType.ACTION self.base = Card.CardExpansion.DOMINION self.name = "My Card" self.cost = 4 self.cards = 2 # +2 Cards self.actions = 1 # +1 Action self.buys = 0 # +0 Buys self.coin = 0 # +0 Coins self.desc = "+2 Cards, +1 Action. Trash a card from your hand." def special(self, game, player): """Custom card effect - trash a card from hand""" player.plr_trash_card( num=1, prompt="Trash a card from your hand" ) # Cards are automatically loaded from dominion/cards/ directory # File naming convention: Card_.py ``` -------------------------------- ### Define Card Types and Properties in Python Source: https://context7.com/dwagon/pydominion/llms.txt Implement cards with multiple types and various game mechanics by subclassing `Card.Card` and setting specific properties. This includes defining card types (ACTION, TREASURE, etc.), cost, coin value, actions, buys, victory points, and special properties like defense, purchasability, and debt cost. ```python from dominion import Card class Card_TreasureAction(Card.Card): def __init__(self): Card.Card.__init__(self) # Multiple card types self.cardtype = [Card.CardType.ACTION, Card.CardType.TREASURE] self.base = Card.CardExpansion.PROSPERITY self.name = "Treasure Action" self.cost = 5 self.coin = 2 # Produces 2 coins when played as treasure self.actions = 1 # +1 Action when played as action # Special properties self.defense = True # Card provides defense against attacks self.purchasable = True # Card can be bought (False for prizes) self.overpay = False # Supports overpaying mechanic self.potcost = False # Requires potion to buy self.debtcost = 0 # Debt cost component self.victory = 0 # Victory point value # Card types available: # ACTION, ATTACK, REACTION, TREASURE, VICTORY, DURATION, # RESERVE, NIGHT, FATE, DOOM, LOOTER, KNIGHT, CASTLE, # TRAVELLER, SPIRIT, ZOMBIE, HEIRLOOM, SHELTER, RUIN def isAction(self): return Card.CardType.ACTION in self.cardtype def isTreasure(self): return Card.CardType.TREASURE in self.cardtype ``` -------------------------------- ### Reserve and Play Action Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks manage interactions with the Reserve pile and the playing of action cards. 'hook_call_reserve' is called when a card is pulled from Reserve. 'hook_pre_play' is called before actions are played. 'hook_all_players_pre_play' is called before action cards are played by anyone, potentially skipping card benefits. 'hook_all_players_post_play' is called after action cards are played by anyone. 'hook_post_play' is called for every card after a card has been played. ```python def hook_call_reserve(game, player, card): # Logic when a card is pulled from Reserve pass def hook_pre_play(game, player, card): # Logic before actions are played pass def hook_all_players_pre_play(game, player, owner, card): # Logic before action cards are played by anyone # Returns {'skip_card': True} to skip benefits return None def hook_all_players_post_play(game, player, owner, card): # Logic after action cards are played by anyone pass def hook_post_play(game, player, card): # Logic after a card has been played pass ``` -------------------------------- ### Attack and Defense Mechanics in Python Source: https://context7.com/dwagon/pydominion/llms.txt Implements attack cards that affect other players and defense cards that can block attacks. Requires the 'dominion' library. Attack cards target players without defense, forcing discards, while defense cards trigger reaction hooks. ```python from dominion import Card, Piles class Card_AttackExample(Card.Card): def __init__(self): Card.Card.__init__(self) self.cardtype = [Card.CardType.ACTION, Card.CardType.ATTACK] self.name = "Attack Example" self.cost = 5 self.desc = "Each other player discards down to 3 cards." def special(self, game, player): # Get list of other players who don't have defense victims = player.attack_victims() for victim in victims: player.output(f"Attacking {victim.name}") victim.output(f"{player.name} attacks you!") # Force victim to discard down to 3 cards victim.plr_discard_down_to(3) class Card_DefenseExample(Card.Card): def __init__(self): Card.Card.__init__(self) self.cardtype = [Card.CardType.ACTION, Card.CardType.REACTION] self.name = "Defense Example" self.cost = 2 self.defense = True # This card provides defense self.desc = "Reveals to block attacks" def hook_under_attack(self, game, player, attacker): """Called when this player is under attack""" player.output(f"Using {self.name} to block attack from {attacker.name}") # Defense is automatic when card is in hand with defense=True ``` -------------------------------- ### Attack and Shuffle Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks manage interactions related to attacks and deck shuffling. 'hook_under_attack' is called if a player is under attack. 'hook_pre_shuffle' is called just before the deck is shuffled, and 'hook_post_shuffle' is called after the deck has been shuffled. ```python def hook_under_attack(game, player, attacker, card): # Logic when under attack pass def hook_pre_shuffle(game, player): # Logic just before the deck is shuffled pass def hook_post_shuffle(game, player): # Logic after the deck has been shuffled pass ``` -------------------------------- ### Card Purchase Availability Hook Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md The 'hook_allowed_to_buy' hook determines if a card can be purchased. It is called before any card is made available for purchase and should return True or False. ```python def hook_allowed_to_buy(game, player, card): # Logic to determine if card can be bought return True ``` -------------------------------- ### Card Purchase Notification Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks are related to the purchase of cards. 'hook_buy_card' is called after any card is purchased, 'hook_buy_this_card' after this specific card is purchased, and 'hook_all_players_buy_card' for duration pile cards when any player buys a card. ```python def hook_buy_card(game, player, card): # Logic after any card is purchased pass def hook_buy_this_card(game, player, card): # Logic after this specific card is purchased pass def hook_all_players_buy_card(game, player, owner, card): # Logic for duration pile cards when any player buys a card pass ``` -------------------------------- ### Card Value and Trashing Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks relate to a card's inherent value and its removal from the game. 'hook_coinvalue' defines how much a card is worth in terms of coins. 'hook_trash_this_card' is called just before this card is trashed, and 'hook_trash_card' is called for every card in hand just before a card is trashed. ```python def hook_coinvalue(game, player, card): # Returns the coin value of the card return 0 def hook_trash_this_card(game, player, card): # Logic just before this card is trashed pass def hook_trash_card(game, player, card_to_trash): # Logic for every card in hand just before a card is trashed pass ``` -------------------------------- ### Card Gain Notification Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks relate to cards being gained. 'hook_all_players_gain_card' is called for every card in everyone's hand when any player gains a card. 'hook_any_gain_card' is called for every card in the game when any player picks up a card. 'hook_gain_card' is triggered for every card in play when another card is gained, returning modifiers. 'hook_gain_this_card' is triggered when this specific card is gained. ```python def hook_all_players_gain_card(game, player, owner, card): # Logic for cards in everyone's hand when any player gains a card pass def hook_any_gain_card(game, player, card): # Logic for every card in the game when any player picks up a card pass def hook_gain_card(game, player, card): # Returns modifiers when another card is gained return {} def hook_gain_this_card(game, player, card): # Logic when this specific card is gained pass ``` -------------------------------- ### Card Reveal and Prophecy Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks are related to revealing cards. 'hook_reveal_this_card' is called when this specific card is revealed. 'hook_reveal_prophecy' is called when a prophecy is revealed. ```python def hook_reveal_this_card(game, player, card): # Logic when this card is revealed pass def hook_reveal_prophecy(game): # Logic when a prophecy is revealed pass ``` -------------------------------- ### Card Discard Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks are triggered when cards are discarded. 'hook_discard_this_card' is called when this specific card is discarded, 'hook_discard_any_card' when any card is discarded, and 'hook_way_discard_this_card' for cards played through a 'way'. ```python def hook_discard_this_card(game, player, card): # Logic when this card is discarded pass def hook_discard_any_card(game, player, card): # Logic when any card is discarded pass def hook_way_discard_this_card(game, player, card): # Logic when a card played through a 'way' is discarded pass ``` -------------------------------- ### Card Cost Modification Hooks Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md These hooks modify the cost of buying cards. 'hook_cardCost' applies to buying any other card, while 'hook_this_card_cost' modifies the cost of buying this specific card. ```python def hook_cardCost(game, player, card_to_buy): # Modifier to the cost of buying another card return 0 def hook_this_card_cost(game, player): # Modifier to the cost of buying this card return 0 ``` -------------------------------- ### Overpay Hook Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md The 'hook_overpay' hook is called when a player overpays for a card. ```python def hook_overpay(game, player, card, amount): # Logic when overpaying for a card pass ``` -------------------------------- ### Night Card Hook Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md The 'night' hook is specifically for cards that have effects during the night phase. It is called when the card is active during this phase. ```python def night(game, player): # Night-phase card logic here pass ``` -------------------------------- ### Card Spend Value Modification Hook Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md The 'hook_spend_value' hook modifies the coin value obtained when spending a card. It is invoked for every card played this turn and should return the delta value. ```python def hook_spend_value(game, player, card): # Returns the delta coin value for spending the card return 0 ``` -------------------------------- ### Special Card Effect Hook Source: https://github.com/dwagon/pydominion/blob/main/dominion/Hooks.md The 'special' hook is the primary function for defining unique card effects. It is called when a card is played during the action phase of the game. ```python def special(game, player): # Card-specific logic here pass ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.