From ad6eb3ebc9294520c87edd43bcab6e8e2422e677 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sat, 6 Jan 2018 08:39:06 -0600 Subject: [PATCH] Add files via upload --- game.py | 4 ++-- player/bots/pure_big_money.py | 4 ++-- player/player.py | 11 +++++++---- table/table.py | 2 ++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/game.py b/game.py index b2848e8..8794d6c 100644 --- a/game.py +++ b/game.py @@ -107,8 +107,8 @@ def get_card_info(): def get_starting_deck(): - return [["Copper", 7], ["Estate", 3]] - # return [["Market", 2], ["Merchant", 2], ["Smithy", 2], ["Village", 2], ["Moat", 2]] + # return [["Copper", 7], ["Estate", 3]] + return [["Market", 2], ["Merchant", 2], ["Smithy", 2], ["Village", 2], ["Moat", 2]] # return [["Militia", 4], ["Cellar", 3], ["Moat", 3]] # return [["Silver", 7], ["Merchant", 3]] # return [["Copper", 4], ["Mine", 2], ["Remodel", 2], ["Workshop", 2]] diff --git a/player/bots/pure_big_money.py b/player/bots/pure_big_money.py index 182cc02..e04b83e 100644 --- a/player/bots/pure_big_money.py +++ b/player/bots/pure_big_money.py @@ -1,6 +1,6 @@ from player.player import Player from card.card import Card - +#name943meats23jet class Pure_Big_Money(Player): def take_action(self): @@ -34,7 +34,7 @@ class Pure_Big_Money(Player): return choice #This will pick either the first or the first least effective purchasing card as this bot doesn't care about that - def militia_input(self, message): + def militia_input(self, message, target_type): choice = self.__get_first_non_Treasure() min_coin = self.get_hand().get_supply()[choice].get_purchase_power() diff --git a/player/player.py b/player/player.py index 116e71a..7328b9d 100644 --- a/player/player.py +++ b/player/player.py @@ -8,7 +8,7 @@ from random import randint class Player: def __init__(self, table): - self.__std_chances = 2 + self.__std_chances = 3 self.__deck = Deck() self.__discard = Discard() self.__hand = Hand() @@ -136,11 +136,13 @@ class Player: print("You have elected to forfeit any remaining plays.") self.__buys = 0 elif pile_index >= self.__table.get_pile_count(): - print("Acceptable inputs range from 0 to " + str(self.__table.get_pile_count() - 1) + ". Try again.") + print("Acceptable inputs range from 0 to " + str(self.__table.get_pile_count() - 1) + ".") chances -= 1 + print("You have " + str(chances) + " chances left to input correctly.") elif self.__table.get_pile(pile_index).get_card_group().get_cost() > self.__purchase_power: - print("You do not have enough coin. Try again.") + print("You do not have enough coin.") chances -= 1 + print("You have " + str(chances) + " chances left to input correctly.") else: self.__buys -= 1 self.__purchase_power -= self.__table.get_pile(pile_index).get_card_group().get_cost() @@ -149,6 +151,7 @@ class Player: str(self.__purchase_power) + " coin(s) and " + str(self.__buys) + " buy(s) following purchase.") self.__table.get_pile(pile_index).transfer_top_card(self.__discard) self.claim_top_card(self.__discard) + chances = self.get_std_chances() def take_turn(self): self.__turn_setup() @@ -243,7 +246,7 @@ class Player: print("Coin: " + str(self.__purchase_power)) self.print_hand() self.__print_discard() - # self.__print_deck() + print("") def __turn_setup(self): self.__actions.int = 1 diff --git a/table/table.py b/table/table.py index a26f13b..4a78636 100644 --- a/table/table.py +++ b/table/table.py @@ -81,5 +81,7 @@ class Table: print(str(index) + ": " + s.identify()) index += 1 + print("") + def __str__(self): return "A table with " + str(len(self.__pile)) + " card piles and " + str(len(self.__player)) + " players."