Beispiel #1
0
    def apply_action(self):
        src = self.source
        tgt = self.target
        options = (
            Card.SPADE,
            Card.HEART,
            Card.CLUB,
            Card.DIAMOND,
        )

        card = self.associated_card
        detach_cards([card])
        suit = user_input([tgt], ChooseOptionInputlet(self, options))

        src.tags['surprise_tag'] = src.tags['turn_count']
        assert card

        g = Game.getgame()
        g.players.reveal(card.associated_cards)
        migrate_cards([card], tgt.showncards, unwrap=True)

        if card.suit != suit:
            g.process_action(Damage(src, tgt))
            rst = True
        else:
            rst = False

        return rst
Beispiel #2
0
    def apply_action(self):
        src = self.source
        tgt = self.target
        options = (
            Card.SPADE, Card.HEART,
            Card.CLUB, Card.DIAMOND,
        )

        card = self.associated_card
        detach_cards([card])
        suit = user_input([tgt], ChooseOptionInputlet(self, options))

        src.tags['surprise_tag'] = src.tags['turn_count']
        assert card

        g = Game.getgame()
        g.players.reveal(card.associated_cards)
        migrate_cards([card], tgt.showncards, unwrap=True)

        if card.suit != suit:
            g.process_action(Damage(src, tgt))
            rst = True
        else:
            rst = False

        return rst
Beispiel #3
0
 def prepare(self):
     tl = self.target_list
     g = Game.getgame()
     cards = g.deck.getcards(len(tl))
     g.players.reveal(cards)
     detach_cards(cards)
     trans = InputTransaction('HarvestChoose', g.players, cards=cards)
     trans.begin()
     self.cards = cards
     self.trans = trans
Beispiel #4
0
    def apply_action(self):
        g = Game.getgame()
        c = self.card
        ft = self.ft
        g.players.exclude(self.source).reveal(c)
        with MigrateCardsTransaction(self) as trans:
            migrate_cards([ft.card], g.deck.droppedcards, unwrap=True, trans=trans, is_bh=True)
            detach_cards([c], trans=trans)
            self.ft.set_card(c, self)

        return True
Beispiel #5
0
    def apply_action(self):
        g = Game.getgame()
        c = self.card
        ft = self.ft
        src = self.source
        g.players.exclude(src).reveal(c)
        with MigrateCardsTransaction(self) as trans:
            migrate_cards([ft.card], src.cards, unwrap=True, trans=trans, is_bh=True)
            detach_cards([c], trans=trans)
            self.ft.set_card(c, self)

        return True
Beispiel #6
0
    def apply_action(self):
        ft = self.ftact
        tgt = ft.target

        from .definition import YinYangOrbCard
        for e in tgt.equips:
            if e.is_card(YinYangOrbCard):
                with MigrateCardsTransaction(self) as trans:
                    migrate_cards([ft.card], tgt.cards, unwrap=True, trans=trans, is_bh=True)
                    detach_cards([e], trans=trans)
                self.card = e
                ft.set_card(e, self)

                break
        else:
            raise GameError('Player has YinYangOrb skill but no equip!')

        return True
Beispiel #7
0
    def apply_action(self):
        ft = self.ftact
        tgt = ft.target

        from .definition import YinYangOrbCard
        for e in tgt.equips:
            if e.is_card(YinYangOrbCard):
                with MigrateCardsTransaction(self) as trans:
                    migrate_cards([ft.card], tgt.cards, unwrap=True, trans=trans, is_bh=True)
                    detach_cards([e], trans=trans)
                    self.card = e
                    ft.set_card(e, self)

                break
        else:
            raise GameError('Player has YinYangOrb skill but no equip!')

        return True
Beispiel #8
0
 def apply_action(self):
     detach_cards(self.cards)
     assert self.cards[0].detached
     migrate_cards(self.cards, self.source.cards, is_bh=True, unwrap=True)
     return True
Beispiel #9
0
 def apply_action(self):
     detach_cards(self.cards)
     migrate_cards(self.cards, self.source.cards, unwrap=True)
     return True