예제 #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
예제 #2
0
    def apply_action(self):
        g = Game.getgame()
        src, tgt = self.source, self.target
        g.process_action(DropCards(src, tgt, [self.card]))
        if self.do_damage:
            g.process_action(Damage(src, tgt, 1))

        return True
예제 #3
0
 def apply_action(self):
     g = Game.getgame()
     source, target = self.source, self.target
     use_action = basic.UseAttack(target)
     if not g.process_action(use_action):
         g.process_action(Damage(source, target, amount=1))
         return True
     else:
         return False
예제 #4
0
    def apply_action(self):
        src = self.source
        tgt = self.target
        g = Game.getgame()

        g.process_action(LifeLost(src, src))
        g.process_action(Damage(src, tgt))

        return True
예제 #5
0
    def apply_action(self):
        g = Game.getgame()
        src, tgt = self.source, self.target

        if tgt.has_skill(MaidenCostumeSkill):
            g.process_action(Damage(src, tgt))

        else:
            return super(MaidenCostumeEffect, self).apply_action()

        return True
예제 #6
0
    def apply_action(self):
        attacker, victim = self.target_list
        src = self.source
        g = Game.getgame()
        tags = self.source.tags
        tags['darkness_tag'] = tags['turn_count']

        cards = user_choose_cards(self, attacker, ('cards', 'showncards'))
        if cards:
            c = cards[0]
            g.process_action(LaunchCard(attacker, [victim], c))
        else:
            g.process_action(Damage(src, attacker, 1))

        return True
예제 #7
0
    def apply_action(self):
        g = Game.getgame()
        source = self.source
        target = self.target

        s, t = source, target
        while True:
            if t.dead: break
            if not g.process_action(basic.UseAttack(t)): break
            s, t = t, s

        if not t.dead:
            g.process_action(Damage(s, t, amount=1))

        self.winner = s

        return True
예제 #8
0
 def apply_action(self):
     g = Game.getgame()
     g.process_action(Damage(self.source, self.target))
     return True
예제 #9
0
파일: alice.py 프로젝트: yuzishui/thbattle
 def apply_action(self):
     tgt, n = self.target, self.amount
     return Game.getgame().process_action(Damage(None, tgt, n))
예제 #10
0
    def fatetell_action(self, ft):
        if ft.succeeded:
            Game.getgame().process_action(Damage(self.source, self.target))

        return True