Ricochet wrote:the
Thundering Wurm on the web editor wasnt working, so i came up with this
- Code: Select all
@triggered(txt=text[0])
def ability():
def effects(controller, source):
target = yield NoTarget()
if controller.you_may("discard a land card"):
card = controller.choose_from(controller.hand.get(), 1, cardtype=isLandCard)
controller.discard(card)
else: source.destroy()
yield
return EnterTrigger("battlefield", source_match), effects
abilities.add(ability)
or
- Code: Select all
@triggered(txt=text[0])
def ability():
def effects(controller, source):
target = yield NoTarget()
if controller.you_may("discard a land card"):
card = controller.choose_from(controller.hand.get(), 1, cardtype=isLandCard)
controller.discard(card)
else: controller.sacrifice(source)
yield
return EnterTrigger("battlefield", source_match), effects
abilities.add(ability)
i dont know wich has got the right rules for this card(destroy or sacrifice), so any1 with access to the web editor(and who knows wich one is the right version) would please make the change...
Actually, Mat's solution was an elegant implementation that was merely missing four letters ("Card", BTW). But good for you to notice it wasn't working; at least
somebody's testing cards.
Technically, I suppose, Mat's solution is incorrect because it's not actually paying a cost, which could theoretically come back to bite us in the ass, but I can't think of anything that could care about a cost paid in the middle of a triggered ability's activation. Usually, abilities just care about costs paid to cast spells or activate abilities.
Ricochet wrote:and now a working
Balduvian Horde- Code: Select all
name = 'Balduvian Horde'
cost = '2RR'
types = Creature
subtypes = Human, Barbarian
power = 5
toughness = 5
text = ['When ~ enters the battlefield, sacrifice it unless you discard a card at random.']
#################################
@triggered(txt=text[0])
def ability():
def effects(controller, source):
target = yield NoTarget()
import random
if controller.you_may("discard a card at random"):
[controller.discard(card) for card in random.sample(controller.hand, 1)]
else: controller.sacrifice(source)
yield
return EnterTrigger("battlefield", source_match), effects
abilities.add(ability)
--------------- Balduvian Horde
Actually, that doesn't quite work. If you choose to discard a card but have no cards in your hand, under your implementation,
Balduvian Horde would live, despite the fact that it needs to be sacrificed in that case. Also, your use of list comprehension and random.sample is redundant when you're only picking one card.
Here is how the card should look.
But thank you for testing cards and coming up with code; if you want access to the web editor, PM me your email address.