Exemplo n.º 1
0
 def fading_2(controller, source, player):
     target = yield NoTarget()
     if source.num_counters("fade") > 0:
         source.remove_counters("fade")
     else:
         controller.sacrifice(source)
     yield
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
 def effects(controller, source):
     target = yield NoTarget()
     if controller.you_may_pay(source, cost):
         source.move_to("hand")
     else:
         source.move_to("exile")
     yield
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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
Exemplo n.º 9
0
 def effects(self, controller, source):
     yield source.cost
     yield NoTarget()
     yield
Exemplo n.º 10
0
 def effects(controller, source):
     yield cost + CycleDiscard()
     yield NoTarget()
     controller.draw()
     yield
Exemplo n.º 11
0
 def effects(controller, source):
     payment = yield TapCost()
     yield NoTarget()
     controller.add_mana(color)
     yield
Exemplo n.º 12
0
 def effects(controller, source):
     '''Exile this from the game at end of turn'''
     yield NoTarget()
     source.move_to("exile")
     yield
Exemplo n.º 13
0
 def effects(controller, source, attackers):
     yield NoTarget()
     until_end_of_turn(attackers[0].augment_power_toughness(1, 1))
     yield
Exemplo n.º 14
0
 def effects(controller, source):
     yield NoTarget()
     value = int(value)
     until_end_of_turn(source.augment_power_toughness(value, value))
     yield
Exemplo n.º 15
0
 def effects(controller, source, player):
     yield NoTarget()
     source._echo_controller = None
     if not controller.you_may_pay(source, cost):
         controller.sacrifice(source)
     yield
Exemplo n.º 16
0
 def effects(controller, source):
     '''Draw a card at the beginning of the next turn's upkeep'''
     target = yield NoTarget()
     controller.draw(1)
     yield