def main():
    for (card, filepath) in iter_cards():
        if 'set' not in card:
            if 'witchwood' in filepath:
                card['set'] = 'WITCHWOOD'
        if 'race' in card:
            if card['race'] == 'MECHANICAL':
                card['race'] = 'MECH'
        if 'id' in card:
            del card['id']
        fixed_card = fix_dict(card)
        if 'fileFormatVersion' not in fixed_card:
            fixed_card['fileFormatVersion'] = 1

        write_card(fixed_card, filepath)
Ejemplo n.º 2
0
def main():
    print '### Wild Sands of Time'
    print '# Class: Warlock'
    print '# Format: Wild'
    cards = []
    i = 0
    for (card, path) in iter_cards():
        if 'the_sands_of_time' in path:
            if i >= 30:
                break

            if not card[u'collectible']:
                continue

            print '# (' + str(
                card[u'baseManaCost']) + ') ' + '1x ' + card[u'name']
            i += 1
Ejemplo n.º 3
0
def main():
    for (card, filepath) in iter_cards():
        fixed_card = fix_dict(card)
        if u'fileFormatVersion' not in fixed_card:
            fixed_card[u'fileFormatVersion'] = 1
        write_card(fixed_card, filepath)
Ejemplo n.º 4
0
import utils

if __name__ == '__main__':
    for (card, card_path) in utils.iter_cards():
        for (component, parent, key, inherits) in utils.walk_card(card):
            # Check for accidental use of HP bonus instead of armor bonus
            if ('class' in component and component['class'] == 'BuffSpell'
                    and 'hpBonus' in component and 'target' in inherits
                    and inherits['target'] == 'FRIENDLY_HERO'):
                print 'Probable hpBonus instead of armorBonus issue in ' + str(
                    card['name'])
Ejemplo n.º 5
0
import utils
from cardformatter import fix_dict

if __name__ == '__main__':
    for (card, filepath) in utils.iter_cards():
        card_type = card['type']
        if card_type == 'MINION' or card_type == 'WEAPON' or card_type == 'HERO':
            if 'options' in card:
                card['chooseOneBattlecries'] = card['options']
                del card['options']
            if 'bothOptions' in card:
                card['chooseBothBattlecry'] = card['bothOptions']
                del card['bothOptions']
        if card_type == 'SPELL' or card_type == 'CHOOSE_ONE' or card_type == 'HERO_POWER':
            if 'options' in card:
                card['chooseOneCardIds'] = card['options']
                del card['options']
            if 'bothOptions' in card:
                card['chooseBothCardId'] = card['bothOptions']
                del card['bothOptions']
        if card_type == 'SPELL':
            if 'trigger' in card:
                card['secret'] = card['trigger']
                del card['trigger']
        fixed_card = fix_dict(card)
        utils.write_card(fixed_card, filepath)