Parsing Cards rules

wololo

Been followin' the console hacking scene since 2006, I'm an old guy so get off my lawn!

You may also like...

Hey, reader. The ads below are not "inappropriate", they are computer-generated "popular topics on the web". Data doesn't lie. Don't blame me, blame mankind.

2 Responses

  1. Jonathan says:

    ^.^ start again huh? Sounds good to me, no joke~

  2. Incantus says:

    Hey Wololo,

    Your version of the Incantus card code is a bit out of date, though. This is how Mogg Fanatic would look now:

    #################################
    name = ‘Mogg Fanatic’
    types = characteristic(‘Creature’)
    supertypes = characteristic()
    subtypes = characteristic(‘Goblin’)
    cost = ‘R’
    color = characteristic(‘R’)
    power = 1
    toughness = 1
    text = ['Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.']

    @activated(txt=text[0])
    def ability():
    def effects(controller, source):
    cost = yield SacrificeCost()
    target = yield Target(isCreatureOrPlayer)
    source.deal_damage(target, 1)
    yield
    return effects
    abilities.add(ability)
    #################################

    A little more readable. I considered doing a dual approach, but then I figured it wasn’t much more difficult to do the above, and practicing on easy cards would make it easier for somebody to try their hand on more difficult cards. In addition, I have a parser that will generate a template card based on the oracle text, so you pretty much just have to fill in the code for each ability. For example, with your approach, it’s probably impossible to do a card where the latter part of the ability refers to the previous part (like Swords to Plowshares)

    But I agree that your hybrid approach is probably the best way when using a language like C++ or Java.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>