2018-01-10 14:10:20 -05:00
|
|
|
from card.basic.card_action import Action
|
2017-12-27 14:17:04 -06:00
|
|
|
|
|
|
|
|
|
2018-01-10 14:10:20 -05:00
|
|
|
class Merchant(Action):
|
2017-12-27 14:17:04 -06:00
|
|
|
def effect(self):
|
|
|
|
|
silver_card_index = self._Card__owner.get_hand().get_index_of_card_by_name("Silver")
|
|
|
|
|
if silver_card_index >= 0:
|
2017-12-30 22:33:43 -06:00
|
|
|
yes_no = self.__get_Merchant_input("'Y' if you'd like to play a silver card and gain an extra coin: ")
|
2017-12-27 14:17:04 -06:00
|
|
|
|
|
|
|
|
if yes_no:
|
|
|
|
|
self._Card__owner.get_hand().transfer_card_by_card(
|
|
|
|
|
self._Card__owner.get_hand().get_card(silver_card_index), self._Card__owner.get_discard())
|
|
|
|
|
self._Card__owner.add_purchase_power(3)
|
2017-12-30 22:33:43 -06:00
|
|
|
|
|
|
|
|
def __get_Merchant_input(self, message):
|
2018-01-05 21:33:36 -06:00
|
|
|
return self.__Card_owner.get_general_input("Player " + str(self._Card__owner.get_player_index()) + ", " +
|
|
|
|
|
message, str)
|