mirror of
https://github.com/neogeek23/Dominion-Strategy-Simulator.git
synced 2026-02-04 02:58:16 +00:00
Add files via upload
This commit is contained in:
parent
5c57b35472
commit
f787d2bad7
@ -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):
|
||||||
@ -69,4 +69,4 @@ class Card:
|
|||||||
counter = 0
|
counter = 0
|
||||||
for c in card:
|
for c in card:
|
||||||
print(str(counter) + ": " + c.identify())
|
print(str(counter) + ": " + c.identify())
|
||||||
counter += 1
|
counter += 1
|
||||||
@ -1,4 +1,4 @@
|
|||||||
from card import Card
|
from card.card import Card
|
||||||
|
|
||||||
|
|
||||||
class Cellar(Card):
|
class Cellar(Card):
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from card import Card
|
from card.card import Card
|
||||||
|
|
||||||
|
|
||||||
class Merchant(Card):
|
class Merchant(Card):
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from card import Card
|
from card.card import Card
|
||||||
|
|
||||||
|
|
||||||
class Moat(Card):
|
class Moat(Card):
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from trash_gain_card import TrashGainEffectCard
|
from card.trash_gain_card import TrashGainEffectCard
|
||||||
|
|
||||||
|
|
||||||
class Remodel(TrashGainEffectCard):
|
class Remodel(TrashGainEffectCard):
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from card import Card
|
from card.card import Card
|
||||||
|
|
||||||
|
|
||||||
class TrashGainEffectCard(Card):
|
class TrashGainEffectCard(Card):
|
||||||
|
|||||||
18
game.py
18
game.py
@ -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():
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from supply import Supply
|
from table.supply import Supply
|
||||||
from random import shuffle
|
from random import shuffle
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from supply import Supply
|
from table.supply import Supply
|
||||||
|
|
||||||
|
|
||||||
class Discard(Supply):
|
class Discard(Supply):
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from supply import Supply
|
from table.supply import Supply
|
||||||
|
|
||||||
|
|
||||||
class Hand(Supply):
|
class Hand(Supply):
|
||||||
@ -39,4 +39,4 @@ class Hand(Supply):
|
|||||||
current_type = c.get_type()
|
current_type = c.get_type()
|
||||||
if not current_type in unique_type:
|
if not current_type in unique_type:
|
||||||
unique_type.append(current_type)
|
unique_type.append(current_type)
|
||||||
return unique_type
|
return unique_type
|
||||||
@ -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:
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from pile import Pile
|
from table.pile import Pile
|
||||||
|
|
||||||
|
|
||||||
class Trash(Pile):
|
class Trash(Pile):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user