Exemplo n.º 1
0
    def handle(self, evt_type, act):
        if evt_type == 'action_after' and isinstance(act, PrepareStage):
            src = act.target
            if not src.has_skill(LunaDial):
                return act

            PlayerTurn.get_current(src).pending_stages.insert(0, LunaDialActionStage)

        return act
Exemplo n.º 2
0
    def fatetell_action(self, ft):
        if ft.succeeded:
            turn = PlayerTurn.get_current(self.target)
            try:
                turn.pending_stages.remove(DrawCardStage)
            except Exception:
                pass

            return True

        return False
Exemplo n.º 3
0
    def apply_action(self):
        tgt = self.target
        ActionStage.force_break()
        turn = PlayerTurn.get_current(tgt)
        try:
            turn.pending_stages.remove(DropCardStage)
            turn.pending_stages.remove(FinalizeStage)
        except Exception:
            pass

        return True
Exemplo n.º 4
0
    def apply_action(self):
        src = self.source

        g = Game.getgame()
        g.process_action(DrawCards(src, 1))

        turn = PlayerTurn.get_current(src)
        try:
            turn.pending_stages.remove(DropCardStage)
        except Exception:
            pass

        return True
Exemplo n.º 5
0
    def apply_action(self):
        src = self.source

        g = Game.getgame()
        g.process_action(DrawCards(src, 1))

        turn = PlayerTurn.get_current(src)
        try:
            turn.pending_stages.remove(DropCardStage)
        except Exception:
            pass

        return True
Exemplo n.º 6
0
    def handle(self, evt_type, arg):
        if evt_type == 'card_migration':
            act, cards, _from, to, _ = arg
            if isinstance(act, (DistributeCards, DrawCardStage)):
                return arg

            if to is None or not to.owner:
                return arg

            if to.type not in ('cards', 'showncards', 'equips'):
                return arg

            if _from is not None and _from.owner is to.owner:
                return arg

            g = Game.getgame()
            a, b = g.players

            if not a.has_skill(SanaeFaithKOF):
                a, b = b, a

            if not a.has_skill(SanaeFaithKOF):
                return arg

            if b is not to.owner:
                return arg

            turn = PlayerTurn.get_current()
            if not turn:
                return arg

            stage = turn.current_stage
            if stage.target is not b or not isinstance(stage, ActionStage):
                return arg

            g = Game.getgame()

            g.process_action(SanaeFaithKOFDrawCards(a, 1))

        return arg
Exemplo n.º 7
0
    def handle(self, evt_type, arg):
        if evt_type == 'card_migration':
            act, cards, _from, to, _ = arg
            if isinstance(act, (DistributeCards, DrawCardStage)):
                return arg

            if to is None or not to.owner:
                return arg

            if to.type not in ('cards', 'showncards', 'equips'):
                return arg

            if _from is not None and _from.owner is to.owner:
                return arg

            g = Game.getgame()
            a, b = g.players

            if not a.has_skill(SanaeFaithKOF):
                a, b = b, a

            if not a.has_skill(SanaeFaithKOF):
                return arg

            if b is not to.owner:
                return arg

            turn = PlayerTurn.get_current()
            if not turn:
                return arg

            stage = turn.current_stage
            if stage.target is not b or not isinstance(stage, ActionStage):
                return arg

            g = Game.getgame()

            g.process_action(SanaeFaithKOFDrawCards(a, 1))

        return arg