Manual Card Fix

This commit is contained in:
tritoch 2017-06-01 12:29:33 -05:00
parent 60ee41668b
commit 5c305b27d7
3 changed files with 12 additions and 6 deletions

View File

@ -50,6 +50,7 @@
"rarity": "",
"type": "",
"url": "",
"text": "",
"loyalty": "",
"cmc": 0,
"layout": "",
@ -65,6 +66,7 @@
"rarity": "Mythic Rare",
"type": "Planeswalker - Bolas",
"url": "https://i.imgur.com/DTNXG2z.png",
"text": "+2: Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.\n+1: Each opponent exiles two cards from his or her hand.\n-4: Nicol Bolas, God-Pharaoh deals 7 damage to target opponent or creature an opponent controls.\n-12: Exile each nonland permanent your opponents control.",
"loyalty": "7",
"cmc": 7
},
@ -75,6 +77,7 @@
"rarity": "Rare",
"type": "Sorcery",
"url": "https://i.imgur.com/HOjh3pE.png",
"text": "Destroy all creatures. Lands you control don't untap during your next untap step.",
"cmc": 3
},
{
@ -84,6 +87,7 @@
"rarity": "Mythic Rare",
"type": "Planeswalker - Samut",
"url": "https://i.imgur.com/4tRYs5z.png",
"text": "+1: Up to one target creature gains double strike until end of turn.\n-2: Samut, the Tested deals 2 damage divided as you choose among one or two target creatures and/or players.\n-7: Search your library for up to two creature and/or planeswalker cards, put them onto the battlefield, then shuffle your library.",
"loyalty": "4",
"cmc": 4
}

View File

@ -86,4 +86,4 @@ if __name__ == '__main__':
save_masterpieces(masterpieces)
save_errorlog(errorlog)
save_allsets(AllSets)
#save_setjson(mtgs)
save_setjson(mtgs)

View File

@ -280,7 +280,7 @@ def correct_cards(mtgjson, manual_cards=[], card_corrections=[], delete_cards=[]
card['colorIdentity'] = [letter]
if 'colors' in card:
if not colorMap[letter] in card['colors']:
card['colors'] += colorMap[letter]
card['colors'].append(colorMap[letter])
else:
card['colors'] = [colorMap[letter]]
if 'text' in card:
@ -823,7 +823,7 @@ def write_xml(mtgjson, setname, setlongname, setreleasedate, split_cards=[]):
cardsxml.write("<name>" + name.encode('utf-8') + "</name>\n")
cardsxml.write('<set rarity="' + card['rarity'] + '" picURL="' + card["url"] + '">' + setname + '</set>\n')
cardsxml.write("<manacost>" + manacost.encode('utf-8') + "</manacost>\n")
cardsxml.write("<cmc>" + cardcmc + "</cmc>")
cardsxml.write("<cmc>" + cardcmc + "</cmc>\n")
if card.has_key('colors'):
colorTranslate = {
"White": "W",
@ -833,14 +833,16 @@ def write_xml(mtgjson, setname, setlongname, setreleasedate, split_cards=[]):
"Green": "G"
}
for color in card['colors']:
cardsxml.write('<color>' + colorTranslate[color] + '</color>')
#if color in colorTranslate:
# color = colorTranslate[color]
cardsxml.write('<color>' + colorTranslate[color] + '</color>\n')
if name + ' enters the battlefield tapped' in text:
cardsxml.write("<cipt>1</cipt>")
cardsxml.write("<cipt>1</cipt>\n")
cardsxml.write("<type>" + cardtype.encode('utf-8') + "</type>\n")
if pt:
cardsxml.write("<pt>" + pt + "</pt>\n")
if card.has_key('loyalty'):
cardsxml.write("<loyalty>" + str(card['loyalty']) + "</loyalty>")
cardsxml.write("<loyalty>" + str(card['loyalty']) + "</loyalty>\n")
cardsxml.write("<tablerow>" + tablerow + "</tablerow>\n")
cardsxml.write("<text>" + text.encode('utf-8') + "</text>\n")
if related: