Beispiel #1
0
    def played(self, user):
        revealed = commonuse.CardsHolder()
        trasheds = commonuse.CardsHolder()

        self.players_reveal_two_cards(user, revealed, trasheds)
        self.what_treasures_gain(user, trasheds)
        user.trashcard(trasheds)
Beispiel #2
0
    def revealed_until_open_two_treasure(self, user):
        tmp_treasure = commonuse.CardsHolder()
        tmp_not_treasure = commonuse.CardsHolder()

        while tmp_treasure.counting() < 2:
            if user.is_deck_empty() and user.is_dispile_empty():
                break
            tmp = user.reveal_from_deck(1)
            tmp = tmp[0]
            if tmp.is_treasure():
                tmp_treasure.add_cards(tmp)
            else:
                tmp_not_treasure.add_cards(tmp)
        return [tmp_treasure, tmp_not_treasure]
Beispiel #3
0
 def reveal_from_deck(self, number):
     revealed_card = commonuse.CardsHolder()
     if number > self.deck_count() and not self.is_dispile_empty(): #デッキの枚数が足りず、かつ捨て札があるとき
         number -= self.deck_count()
         revealed_card.add_cards(self.reveal_from_deck(self.deck_count()))
         self.dispile_to_deck()
     revealed_card.add_cards(self.pop_from_decktop(number))
     return revealed_card.list
Beispiel #4
0
 def choice_trashed_under_4(self, user):
     choices = commonuse.CardsHolder()
     for i in range(4):
         print("廃棄するカードを選んでください")
         trashed = user.pop_from_hand()
         if trashed == -1:
             break
         choices.add_cards(trashed)
     return choices
Beispiel #5
0
 def choice_discard(self, user):
     choices = commonuse.CardsHolder()
     while True:
         print("捨て札にするカードを選んでください")
         discarded = user.pop_from_hand()
         if discarded == -1:
             break
         choices.add_cards(discarded)
     return choices
Beispiel #6
0
 def played(self, user):
     tmp_action = commonuse.CardsHolder()
     while True:
         if user.is_deck_empty() and user.is_dispile_empty():
             break
         if user.hand_count() >= 7:
             break
         tmp = user.reveal_from_deck(1)
         tmp = tmp[0]
         if tmp.is_action():
             self.is_action_add_hand(user, tmp, tmp_action)
         else:
             user.add_hand(tmp)
     user.add_dispile(tmp_action)
Beispiel #7
0
 def attacked(self, user):
     cards = commonuse.CardsHolder([c for c in self.hand.list if c.attack_reactable()])
     
     while True:
         if cards.is_empty():
             return
         
         cards.print_cardlist()
         print("どのリアクションカードを使用しますか")
         answer = int(input())
         if answer == -1:
             return
     
         card_react = cards.pickup(answer)
         card_react.reacted(user)
Beispiel #8
0
 def __init__(self):
     self.deck = commonuse.CardsHolder() #デッキ 下から上へ
     self.hand = commonuse.CardsHolder() #手札 左から右へ
     self.dispile = commonuse.CardsHolder() #捨て札の山 下から上へ
     self.playarea = commonuse.CardsHolder() #各プレイヤーの場 左から右へ