Пример #1
0
    def apply_action(self):
        g = Game.getgame()
        src = self.source
        self.target_act.cancelled = True
        g.process_action(MaxLifeChange(src, src, -1))

        return True
Пример #2
0
    def apply_action(self):
        g = Game.getgame()
        src = self.source
        g.process_action(MaxLifeChange(src, src, 1))
        g.process_action(Heal(src, src, 1))

        return True
Пример #3
0
 def apply_action(self):
     tgt = self.target
     g = Game.getgame()
     g.process_action(MaxLifeChange(tgt, tgt, -1))
     tgt.skills.remove(KeineGuard)
     tgt.skills.append(Devour)
     return True
Пример #4
0
    def apply_action(self):
        src, tgt = self.source, self.target
        g = Game.getgame()
        g.process_action(MaxLifeChange(src, src, -1))
        if src.dead:
            return False

        g.process_action(Heal(src, tgt))

        try:
            src.skills.remove(KeineGuard)
        except ValueError:
            pass

        if tgt.life == min(p.life for p in g.players if not p.dead):
            src.skills.append(Devoted)
            src.tags['devoted'] = {
                'to': tgt
            }
            tgt.skills.append(Devoted)
            tgt.tags['devoted'] = {
                'to': src
            }

        return True
Пример #5
0
 def apply_action(self):
     tgt = self.target
     assert tgt.has_skill(RiverBehind)
     tgt.skills.remove(RiverBehind)
     tgt.skills.append(Taichi)
     g = Game.getgame()
     g.process_action(MaxLifeChange(tgt, tgt, -1))
     return True
Пример #6
0
    def apply_action(self):
        g = Game.getgame()
        tgt = self.target
        tgt.skills.remove(Returning)
        tgt.skills.append(FerryFee)
        g.process_action(MaxLifeChange(tgt, tgt, -1))

        return True
Пример #7
0
    def apply_action(self):
        g = Game.getgame()
        src = self.source
        g.process_action(MaxLifeChange(src, src, 1))
        g.process_action(Heal(src, src, 1))

        try:
            src.skills.remove(PerfectCherryBlossom)
        except Exception:
            pass

        return True
Пример #8
0
    def handle(self, evt_type, arg):
        if not evt_type == 'card_migration': return arg

        act, cards, _from, to, is_bh = arg

        from .definition import YoumuPhantomCard

        g = Game.getgame()

        if _from is not None and _from.type == 'equips' and not is_bh:
            for c in cards:
                if c.is_card(YoumuPhantomCard):
                    owner = _from.owner

                    g.process_action(MaxLifeChange(owner, owner, -1))
                    if not owner.dead:
                        g.process_action(YoumuPhantomHeal(owner, owner))

        if to is not None and to.type == 'equips':
            for c in cards:
                if c.is_card(YoumuPhantomCard):
                    g.process_action(MaxLifeChange(to.owner, to.owner, 1))

        return arg
Пример #9
0
    def apply_action(self):
        g = Game.getgame()
        src = self.source
        if src.life >= src.maxlife:
            choice = 'maxlife'
        elif user_input([src], ChooseOptionInputlet(
                self, ('life', 'maxlife'))) == 'maxlife':
            choice = 'maxlife'
        else:
            choice = 'life'

        if choice == 'life':
            g.process_action(Heal(src, src, 1))
        else:
            g.process_action(MaxLifeChange(src, src, 1))

        return True
Пример #10
0
    def apply_action(self):
        src, tgt = self.source, self.target
        g = Game.getgame()
        g.process_action(DrawCards(src, 1))

        assert tgt.life <= 0

        if not tgt.cards and not tgt.showncards:
            return True

        if src is tgt:
            return True

        if user_input([src], ChooseOptionInputlet(self, (False, True))):
            if g.process_action(Pindian(src, tgt)):
                g.process_action(MaxLifeChange(src, tgt, -tgt.maxlife + 1))
            else:
                g.process_action(Heal(src, tgt, -tgt.life + 1))

        return True