コード例 #1
0
def enchant(target_type, zone="battlefield", player=None):
    def effects(source):
        source.target_type = target_type
        source.target_zone = zone
        source.target_player = player
        source.attach_on_enter = None
        yield lambda: None
    return CardStaticAbility(effects, keyword="Enchant %s in %s"%(target_type, zone), zone="all")
コード例 #2
0
def kicker(cost):
    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)))

    return CardStaticAbility(effects, zone="stack", keyword="kicker")
コード例 #3
0
def retrace():
    '''Retrace appears on some instants and sorceries. It represents a static ability that functions while the card is in a player's graveyard. 'Retrace' means "You may play this card from your graveyard by discarding a land card as an additional cost to play it." '''
    def retrace_effects(card):
        def modifyNewRole(self, new, zone):
            if str(zone) == "stack":
                override(new, "_get_additional_costs",
                         lambda self: DiscardCost(cardtype=isLandCard))

        def play_from_graveyard(self):
            if self.controller.you_may("Play %s using retrace" % self):
                override(self, "modifyNewRole", modifyNewRole)
                return True
            else:
                return False

        yield override(card, "_playable_zone", play_from_graveyard)

    return CardStaticAbility(effects=retrace_effects,
                             zone="graveyard",
                             keyword="retrace")
コード例 #4
0
def prowl(prowl_cost):
    # You may play this for its prowl cost if you dealt combat damage to a player this turn with a [card subtypes]
    def prowl_effect(card):
        orig_spell = card.play_spell
        def play_prowl(controller, source):
            play = orig_spell.effect_generator(controller, source)
            cost = play.next()
            prowl_payed = False
            if prowl_tracker.check(source) and controller.you_may("play this spell for it's prowl cost (%s)"%prowl_cost):
                cost = prowl_cost
                prowl_payed = True
            payment = yield cost
            target = yield play.send(payment[:-1])
            play.send(target)
            if prowl_played:
                print "Prowl played!"
            yield
        # Set up a different way to play
        card.play_spell = orig_spell.__class__(play_prowl, limit=orig_spell.limit, txt=orig_spell.txt, keyword=orig_spell.keyword)
        def restore(): card.play_spell = orig_spell
        yield restore
    return CardStaticAbility(effects=prowl_effect, zone="all", txt="Prowl %s"%prowl_cost, keyword="prowl")
コード例 #5
0
def dredge(n):
    return CardStaticAbility(no_effects, keyword="dredge", zone="graveyard")
コード例 #6
0
def epic():
    return CardStaticAbility(no_effects, keyword="epic", zone="battlefield")
コード例 #7
0
def offering(subtype):
    return CardStaticAbility(no_effects,
                             keyword="offering",
                             zone="non-battlefield")
コード例 #8
0
def suspend(number):
    return CardStaticAbility(no_effects,
                             keyword="suspend",
                             zone="non-battlefield")
コード例 #9
0
def cumulative_upkeep(cost):
    return CardStaticAbility(no_effects,
                             keyword="cumulative upkeep",
                             zone="battlefield")
コード例 #10
0
def rampage(n):
    return CardStaticAbility(no_effects, keyword="rampage", zone="battlefield")
コード例 #11
0
def transfigure(n):
    return CardStaticAbility(no_effects,
                             keyword="transfigure",
                             zone="battlefield")
コード例 #12
0
def poisonous(n):
    return CardStaticAbility(no_effects,
                             keyword="poisonous",
                             zone="battlefield")
コード例 #13
0
def frenzy(n):
    return CardStaticAbility(no_effects, keyword="frenzy", zone="battlefield")
コード例 #14
0
def delve():
    return CardStaticAbility(no_effects, keyword="delve", zone="stack")
コード例 #15
0
def aura_swap(cost):
    return CardStaticAbility(no_effects,
                             keyword="aura swap",
                             zone="battlefield")
コード例 #16
0
def affinity(types):
    return CardStaticAbility(no_effects, keyword="affinity", zone="stack")
コード例 #17
0
def entwine(cost):
    return CardStaticAbility(no_effects, keyword="entwine", zone="stack")
コード例 #18
0
def phasing(n):
    return CardStaticAbility(no_effects, keyword="phasing", zone="battlefield")
コード例 #19
0
def splice(subtype, cost):
    return CardStaticAbility(no_effects, keyword="splice", zone="hand")
コード例 #20
0
def flashback(cost):
    return CardStaticAbility(no_effects,
                             keyword="flashback",
                             zone="battlefield")
コード例 #21
0
def ninjutsu(cost):
    return CardStaticAbility(no_effects, keyword="ninjutsu", zone="hand")
コード例 #22
0
def madness(cost):
    return CardStaticAbility(no_effects, keyword="madness", zone="battlefield")
コード例 #23
0
def convoke():
    return CardStaticAbility(no_effects, keyword="convoke", zone="stack")
コード例 #24
0
def morph(cost):
    return CardStaticAbility(no_effects, keyword="morph", zone="battlefield")
コード例 #25
0
def bloodthirst(n):
    return CardStaticAbility(no_effects,
                             keyword="bloodthirst",
                             zone="non-battlefield")
コード例 #26
0
def amplify(n):
    return CardStaticAbility(no_effects,
                             keyword="amplify",
                             zone="non-battlefield")
コード例 #27
0
ファイル: SpellAbility.py プロジェクト: trunghuynh/incantus
def additional_cost(cost, txt=''):
    if isinstance(cost, str): cost = ManaCost(cost)
    def effects(card):
        yield do_override(card, "_get_additional_costs", lambda self: cost)
    return CardStaticAbility(effects, zone="stack", txt=txt)
コード例 #28
0
def provoke():
    return CardStaticAbility(no_effects, keyword="provoke", zone="battlefield")
コード例 #29
0
def horsemanship():
    keyword = "horsemanship"
    return CardStaticAbility(effects=override_effect("canBeBlockedBy", lambda self, blocker: keyword in blocker.abilities), keyword=keyword)
コード例 #30
0
def storm():
    return CardStaticAbility(no_effects, keyword="storm", zone="stack")