Add files via upload

This commit is contained in:
Brad Stein 2017-12-30 12:15:51 -06:00 committed by GitHub
parent 5c57b35472
commit f787d2bad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 38 additions and 38 deletions

View File

@ -31,11 +31,11 @@ class Card:
self.effect() self.effect()
def effect(self): def effect(self):
# This is here so that 'special' cards can override this function so that unique card effects can happen. # This is here so that 'special' card can override this function so that unique card effects can happen.
pass pass
def passive(self): def passive(self):
# This is here so that 'special' cards can override this function so that unique card passives can happen. # This is here so that 'special' card can override this function so that unique card passives can happen.
pass pass
def get_name(self): def get_name(self):

View File

@ -1,4 +1,4 @@
from card import Card from card.card import Card
class Cellar(Card): class Cellar(Card):

View File

@ -1,4 +1,4 @@
from card import Card from card.card import Card
class Merchant(Card): class Merchant(Card):

View File

@ -1,4 +1,4 @@
from card import Card from card.card import Card
from random import randint from random import randint
@ -8,7 +8,7 @@ class Militia(Card):
if self._Card__owner != player and not player.get_hand().blocks_attack(self.get_name()): if self._Card__owner != player and not player.get_hand().blocks_attack(self.get_name()):
player.print_hand() player.print_hand()
print("Player " + str(self._Card__owner.get_table().get_players().index(player)) + ", you MUST discard " print("Player " + str(self._Card__owner.get_table().get_players().index(player)) + ", you MUST discard "
"down to 3 cards.") "down to 3 card.")
self.__force_discard(self._Card__owner.get_std_chances(), player) self.__force_discard(self._Card__owner.get_std_chances(), player)
def __force_discard(self, chances, player): def __force_discard(self, chances, player):

View File

@ -1,5 +1,5 @@
from card import Card from card.card import Card
from trash_gain_card import TrashGainEffectCard from card.trash_gain_card import TrashGainEffectCard
class Mine(TrashGainEffectCard): class Mine(TrashGainEffectCard):

View File

@ -1,4 +1,4 @@
from card import Card from card.card import Card
class Moat(Card): class Moat(Card):

View File

@ -1,4 +1,4 @@
from trash_gain_card import TrashGainEffectCard from card.trash_gain_card import TrashGainEffectCard
class Remodel(TrashGainEffectCard): class Remodel(TrashGainEffectCard):

View File

@ -1,4 +1,4 @@
from card import Card from card.card import Card
class TrashGainEffectCard(Card): class TrashGainEffectCard(Card):

18
game.py
View File

@ -1,12 +1,12 @@
from table import Table from table.table import Table
from player import Player from player.player import Player
from card import Card from card.card import Card
from militia import Militia from card.militia import Militia
from moat import Moat from card.moat import Moat
from cellar import Cellar from card.cellar import Cellar
from merchant import Merchant from card.merchant import Merchant
from mine import Mine from card.mine import Mine
from remodel import Remodel from card.remodel import Remodel
def main(): def main():

View File

@ -1,4 +1,4 @@
from supply import Supply from table.supply import Supply
from random import shuffle from random import shuffle

View File

@ -1,4 +1,4 @@
from supply import Supply from table.supply import Supply
class Discard(Supply): class Discard(Supply):

View File

@ -1,4 +1,4 @@
from supply import Supply from table.supply import Supply
class Hand(Supply): class Hand(Supply):

View File

@ -1,8 +1,8 @@
from deck import Deck from player.deck import Deck
from discard import Discard from player.discard import Discard
from hand import Hand from player.hand import Hand
from card import Card from player.counter import Counter
from counter import Counter from card.card import Card
class Player: class Player:
@ -57,7 +57,7 @@ class Player:
elif lacking_cards == 1: elif lacking_cards == 1:
print("You are lacking " + str(lacking_cards) + " card. You cannot draw anymore.") print("You are lacking " + str(lacking_cards) + " card. You cannot draw anymore.")
else: else:
print("You are lacking " + str(lacking_cards) + " cards. You cannot draw anymore.") print("You are lacking " + str(lacking_cards) + " card. You cannot draw anymore.")
if spillover > 0: if spillover > 0:
for i in range(how_many - spillover): for i in range(how_many - spillover):
@ -116,7 +116,7 @@ class Player:
if counter is not None: if counter is not None:
counter.int = 0 counter.int = 0
else: else:
print("There are no more acceptable cards in hand, moving to next phase.") print("There are no more acceptable card in hand, moving to next phase.")
if counter is not None: if counter is not None:
counter.int = 0 counter.int = 0
@ -128,7 +128,7 @@ class Player:
def take_buy(self): def take_buy(self):
if self.__hand.contains_one_of([Card.CardType.Treasure]): if self.__hand.contains_one_of([Card.CardType.Treasure]):
print("\nPlease play all Treasure cards that you want to play.") print("\nPlease play all Treasure card that you want to play.")
play_another = Counter(self.__hand.get_card_type_count(Card.CardType.Treasure)) play_another = Counter(self.__hand.get_card_type_count(Card.CardType.Treasure))
while play_another.int > 0: while play_another.int > 0:

View File

@ -1,4 +1,4 @@
from supply import Supply from table.supply import Supply
class Pile(Supply): class Pile(Supply):
def get_card_group(self): def get_card_group(self):

View File

@ -1,5 +1,5 @@
from trash import Trash from table.trash import Trash
from pile import Pile from table.pile import Pile
class Table: class Table:
@ -52,7 +52,7 @@ class Table:
def play(self): def play(self):
turn = 0 turn = 0
# turn < 4 is for testing, otherwise endless as buying cards is not yet done # turn < 4 is for testing, otherwise endless as buying card is not yet done
while not self.are_there_any_empty_piles() and turn < 10: while not self.are_there_any_empty_piles() and turn < 10:
self.print() self.print()
self.__player[turn % len(self.__player)].take_turn() self.__player[turn % len(self.__player)].take_turn()

View File

@ -1,4 +1,4 @@
from pile import Pile from table.pile import Pile
class Trash(Pile): class Trash(Pile):