Example #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
Example #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
Example #3
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
Example #4
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
Example #5
0
 def apply_action(self):
     g = Game.getgame()
     source, target = self.source, self.target
     rst = g.process_action(LaunchGraze(target))
     self1, rst = g.emit_event('attack_aftergraze', (self, not rst))
     assert self1 is self
     assert rst in (False, True)
     if rst:
         g.process_action(Damage(source, target, amount=self.damage))
         return True
     else:
         return False
Example #6
0
    def apply_action(self):
        g = Game.getgame()
        tgt = self.target
        if tgt.dead:
            return False

        cards = user_choose_cards(self, tgt, ('cards', 'showncards', 'equips'))

        if cards:
            g.process_action(DropCards(tgt, tgt, cards))
        else:
            g.process_action(Damage(None, tgt))

        return True
Example #7
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
Example #8
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
Example #9
0
    def apply_action(self):
        g = Game.getgame()
        source = self.source
        target = self.target

        d = (source, target)
        while True:
            d = (d[1], d[0])
            if d[1].has_skill(Nitoryuu):
                if not (g.process_action(UseAttack(d[0]))
                        and g.process_action(UseAttack(d[0]))):
                    break
            else:
                if not g.process_action(UseAttack(d[0])): break

        g.process_action(Damage(d[1], d[0], amount=1))
        return d[1] is source
Example #10
0
    def fatetell_action(self, ft):
        if ft.succeeded:
            Game.getgame().process_action(Damage(self.source, self.target))

        return True
Example #11
0
 def apply_action(self):
     g = Game.getgame()
     g.process_action(Damage(self.source, self.target, 99))
     return True
Example #12
0
 def apply_action(self):
     g = Game.getgame()
     src, tgt = self.source, self.target
     return g.process_action(Damage(src, tgt, 1))
Example #13
0
 def apply_action(self):
     g = Game.getgame()
     src, tgt = self.source, self.target
     tgt.tags['sadist_target'] = False
     g.process_action(Damage(src, tgt, 1))
     return True
Example #14
0
 def apply_action(self):
     g = Game.getgame()
     dmg = Damage(self.source, self.target, amount=self.damage)
     g.process_action(dmg)
     return True