def handle(self, evt_type, act): if evt_type == 'action_before' and isinstance( act, BaseAttack) and not marked(act, 'freaking_power'): src = act.source if not src.has_skill(FreakingPower): return act if not user_input([src], ChooseOptionInputlet(self, (False, True))): return act tgt = act.target Game.getgame().process_action(FreakingPowerAction(act)) elif evt_type == 'action_after' and isinstance(act, Damage): g = Game.getgame() if act.cancelled: return act pact = g.action_stack[-1] if not marked(pact, 'freaking_power'): return act src, tgt = pact.source, act.target if tgt.dead: return act catnames = ('cards', 'showncards', 'equips') card = user_input([src], ChoosePeerCardInputlet(self, tgt, catnames)) if card: g.players.exclude(tgt).reveal(card) g.process_action(DropCards(src, tgt, [card])) return act
def handle(self, evt_type, act): if evt_type == 'action_before' and isinstance(act, DropCards): src, tgt = act.source, act.target if not tgt.has_skill(DollBlast): return act if not src or src is tgt or not (src.cards or src.showncards or src.equips): return act if not any(c.resides_in.type == 'equips' for c in act.cards): return act mark(act, 'doll_blast') elif evt_type == 'action_after' and isinstance(act, DropCards) and marked(act, 'doll_blast'): self.fire(act.target, act.source, act.cards) return act