示例#1
0
 def effects(card):
     card.kicked = kicked()
     yield (
         do_override(card, "_get_additional_costs",
                     lambda self: KickerCost(cost)),
         do_override(
             card, "modifyNewRole",
             lambda self, new, zone: setattr(new, "kicked", self.kicked)))
示例#2
0
 def effects(card):
     card.kicked = kicked()
     #yield (do_override(card, "_get_additional_costs", lambda self: KickerCost(cost)),
     #      do_override(card, "modifyNewRole", lambda self, new, zone: setattr(new, "kicked", self.kicked)))
     def modifyNewRole(self, new, zone):
         if str(zone) == "battlefield":
             setattr(new, "kicked", self.kicked)
     yield (do_override(card, "_get_additional_costs", lambda self: KickerCost(cost)),
           do_override(card, "modifyNewRole", modifyNewRole))
def detain(controller, card):
    do_until(
        combine(
            do_override(card, "canAttack", lambda self: False),
            do_override(card, "canBlock", lambda self: False),
            do_override(ActivatedAbility, "playable", lambda self: not self.source == card),
        ),
        NewTurnEvent(),
        lambda player: player == controller,
    )
示例#4
0
def doesnt_untap_your_next_untap_step(target):
    # This is different than doesnt_untap_controllers_next_untap_step because it specifies
    # YOU, not controller
    # So we don't set it up until the start of your turn, after which it will expire
    controller = target.controller # save the current controller
    def canUntap(self):
        canUntap.expire()
        return False
    do_when(lambda: do_override(target, "canUntapDuringUntapStep", canUntap), UntapStepEvent(), lambda player: player==controller)
示例#5
0
def doesnt_untap_your_next_untap_step(target):
    # This is different than doesnt_untap_controllers_next_untap_step because it specifies
    # YOU, not controller
    # So we don't set it up until the start of your turn, after which it will expire
    controller = target.controller # save the current controller
    def canUntap(self):
        canUntap.expire()
        return False
    do_when(lambda: do_override(target, "canUntapDuringUntapStep", canUntap), UntapStepEvent(), lambda player: player==controller)
示例#6
0
 def move_to(self, zone, position="top"):
     # Now move to the battlefield
     if before(self):
         perm = self.move_to(zone, position)
         # At this point the card hasn't actually moved (it will on the next timestep event), so we can modify it's enteringZone function. This basically relies on the fact that entering battlefield is batched and done on the timestep.
         if not perm == self: # We weren't prevented from moving
             remove_entering = do_override(perm, "modifyEntering", lambda self: during(self))
         return perm
     else:
         # Don't actually move the card
         return self
示例#7
0
 def effects(card):
     yield do_override(card, "_get_additional_costs", lambda self: cost)
示例#8
0
 def effects(card):
     yield do_override(card, "_get_alternative_costs", lambda self: [cost])
示例#9
0
def optionally_untap(target):
    return do_override(target, "canUntapDuringUntapStep", 
            lambda self: self.canUntap() and self.controller.getIntention("Untap %s"%self))
示例#10
0
 def effects(source):
     source.evoked = False
     yield (do_override(source, "_get_alternative_costs", lambda self: [EvokeCost(cost)]),
           do_override(source, "modifyNewRole", lambda self, new, zone: setattr(new, "evoked",self.evoked)))
示例#11
0
def doesnt_untap_controllers_next_untap_step(target):
    def canUntap(self):
        canUntap.expire()
        return False
    do_override(target, "canUntapDuringUntapStep", canUntap)
示例#12
0
def unblockable(target):
    def canBeBlocked(self): return False
    return do_override(target, "canBeBlocked", canBeBlocked)
 def effects_2(source):
     yield do_override(source, "canBlock", lambda self: False)
示例#14
0
 def protection_effect(target):
     yield combine(prevent_damage(target, -1, txt="Protection effect", condition=prevent_condition),
                   do_override(target, "canBeAttachedBy", canBeAttachedBy),
                   do_override(target, "canBeBlockedBy", canBeBlockedBy),
                   do_override(target, "canBeTargetedBy", canBeTargetedBy))
示例#15
0
def doesnt_untap_controllers_next_untap_step(target):
    def canUntap(self):
        canUntap.expire()
        return False
    do_override(target, "canUntapDuringUntapStep", canUntap)
示例#16
0
def optionally_untap(target):
    return do_override(target, "canUntapDuringUntapStep", 
            lambda self: self.canUntap() and self.controller.getIntention("Untap %s"%self))
示例#17
0
 def effects(source):
     yield do_override(source, "_playable_timing", timing)
示例#18
0
def indestructible(target):
    def shouldDestroy(self): return False
    def destroy(self, regenerate=True): return False
    return combine(do_override(target, "shouldDestroy", shouldDestroy), do_override(target, "destroy", destroy))
示例#19
0
 def effects(target):
     yield combine(*[do_override(target, func_name, mk_override(cond)) for func_name, cond in [("canBeAttachedBy", lambda o: not o==aura and condition(o)), ("canBeBlockedBy", condition), ("canBeTargetedBy", condition)]]+[prevent_damage(target, -1, txt="Protection effect", condition=prevent_condition)])
示例#20
0
def indestructible(target):
    def shouldDestroy(self): return False
    def destroy(self, regenerate=True): return False
    return combine(do_override(target, "shouldDestroy", shouldDestroy), do_override(target, "destroy", destroy))
示例#21
0
 def shadow_effects(source):
     yield do_override(source, "canBeBlockedBy", canBeBlockedBy), do_override(source, "canBlockAttacker", canBlockAttacker)
示例#22
0
 def effects(card):
     card.kicked = kicked()
     yield (do_override(card, "_get_additional_costs", lambda self: KickerCost(cost)),
           do_override(card, "modifyNewRole", lambda self, new, zone: setattr(new, "kicked", self.kicked)))