def fading_2(controller, source, player): target = yield NoTarget() if source.num_counters("fade") > 0: source.remove_counters("fade") else: controller.sacrifice(source) yield
def effects(controller, source): yield cost yield NoTarget() source = source.move_to(controller.battlefield) yield source.abilities.add(haste()) # Exile at end of turn @source.delayed def ability(): def condition(source): return str(source.zone) == "battlefield" def effects(controller, source): '''Exile this from the game at end of turn''' yield NoTarget() source.move_to("exile") yield return PhaseTrigger(EndTurnStepEvent(), condition), effects # Exile if it leaves play leave_battlefield_condition = lambda self, zone, position="top": str( self.zone) == "battlefield" def move_to(self, zone, position="top"): return self.move_to("exile") until_end_of_turn( do_replace(source, "move_to", move_to, condition=leave_battlefield_condition, msg="%s - exile from game" % source.name)) yield
def effects(controller, source): target = yield NoTarget() if controller.you_may_pay(source, cost): source.move_to("hand") else: source.move_to("exile") yield
def graft_2(controller, source, card): yield NoTarget() if source.num_counters("+1+1") > 0: if controller.you_may("move a +1/+1 counter from %s to %s" % (source, card)): source.remove_counters(PowerToughnessCounter(1, 1)) card.add_counters(PowerToughnessCounter(1, 1)) yield
def effects(controller, source): yield cost + DiscardCost() target = yield NoTarget() CMC = source.converted_mana_cost for card in controller.choose_from_zone(number=1, cardtype=isCard.with_condition(lambda c: c.converted_mana_cost == CMC), zone="library", action="card with converted mana cost %s to put into your hand"%CMC, required=False): controller.reveal_cards(card) card.move_to("hand") yield
def effects(controller, source): yield cost + CycleDiscard() yield NoTarget() for card in controller.choose_from_zone(number=1, cardtype=match, zone="library", action="put into your hand"): controller.reveal_cards(card) card.move_to("hand") yield
def persist_effect(controller, source, card, newcard): yield NoTarget() if condition(source, card): expire = CiP( newcard, enterWithCounters, txt='%s - enter the battlefield with a -1/-1 counter' % newcard) # Now move to the battlefield newcard.move_to("battlefield") expire() yield
def cascade_effects(source, controller, spell): target = yield NoTarget() cmc = source.converted_mana_cost exiled = [] for card in controller.library: exile = card.move_to("exile") exiled.append(exile) if not exile.types == Land and exile.converted_mana_cost < cmc: break yield if exiled: controller.reveal_cards(exiled) exile = exiled[-1] if controller.you_may("cast %s without paying its mana cost?" % exile): exiled.remove(exile) exile.play_without_mana_cost(controller) # move exiled cards back to bottom of library in random order shuffle(exiled) for card in exiled: card.move_to("library", position='bottom') yield yield
def effects(self, controller, source): yield source.cost yield NoTarget() yield
def effects(controller, source): yield cost + CycleDiscard() yield NoTarget() controller.draw() yield
def effects(controller, source): payment = yield TapCost() yield NoTarget() controller.add_mana(color) yield
def effects(controller, source): '''Exile this from the game at end of turn''' yield NoTarget() source.move_to("exile") yield
def effects(controller, source, attackers): yield NoTarget() until_end_of_turn(attackers[0].augment_power_toughness(1, 1)) yield
def effects(controller, source): yield NoTarget() value = int(value) until_end_of_turn(source.augment_power_toughness(value, value)) yield
def effects(controller, source, player): yield NoTarget() source._echo_controller = None if not controller.you_may_pay(source, cost): controller.sacrifice(source) yield
def effects(controller, source): '''Draw a card at the beginning of the next turn's upkeep''' target = yield NoTarget() controller.draw(1) yield