def handle(self, evt_type, act): if evt_type != 'action_before': return act if not isinstance(act, InstantSpellCardAction): return act if isinstance(act, Reject): # HACK return act if ForEach.is_group_effect(act): return act src = act.source tgt = act.target if not src or tgt is src: return act if not tgt.has_skill(ReversedScales): return act if not user_input([tgt], ChooseOptionInputlet(self, (False, True))): return act g = Game.getgame() g.process_action(ReversedScalesAction(tgt, act)) return act
def handle(self, evt_type, act): if evt_type == 'action_after' and isinstance(act, Damage): g = Game.getgame() pact = g.action_stack[-1] src, tgt = act.source, act.target if ForEach.is_group_effect(pact): return act if src is tgt: return act self.process(src, tgt) self.process(tgt, src) return act
def handle(self, evt_type, act): if evt_type == 'action_after' and isinstance(act, Damage): g = Game.getgame() pact = g.action_stack[-1] src, tgt = act.source, act.target if ForEach.is_group_effect(pact): return act if src is tgt: return act self.process(src, tgt) self.process(tgt, src) return act
def handle(self, evt_type, act): if evt_type == 'action_before' and ForEach.is_group_effect(act): g = Game.getgame() tgt = act.target if not tgt.has_skill(GodDescendant): return act opt = user_input([tgt], ChooseOptionInputlet(self, ('skip', 'draw', None))) if opt == 'skip': g.process_action(GodDescendantSkipAction(tgt, tgt, act)) elif opt == 'draw': g.process_action(GodDescendantDrawAction(tgt, tgt, act)) return act
def handle(self, evt_type, act): if evt_type == 'action_before' and ForEach.is_group_effect(act): tgt = act.target if not tgt.has_skill(Heterodoxy): return act g = Game.getgame() for a in reversed(g.action_stack): if isinstance(a, HeterodoxyAction): break else: return act if not user_input([tgt], ChooseOptionInputlet(self, (False, True))): return act act.cancelled = True g.process_action(HeterodoxySkipAction(tgt, tgt)) return act
def handle(self, evt_type, act): if evt_type == 'action_before' and ForEach.is_group_effect(act): tgt = act.target if not tgt.has_skill(Heterodoxy): return act g = Game.getgame() for a in reversed(g.action_stack): if isinstance(a, HeterodoxyAction): break else: return act if not user_input([tgt], ChooseOptionInputlet(self, (False, True))): return act act.cancelled = True g.process_action(HeterodoxySkipAction(tgt, tgt)) return act