Fix deck length calculation for environment decks

This commit is contained in:
Adam Goldsmith 2017-08-11 21:34:35 -04:00
parent a1e5b21189
commit 4a9e3db726
1 changed files with 5 additions and 3 deletions

View File

@ -102,15 +102,17 @@ def makeDoubleSidedFace(outSVG, cardsPerRow, cardNum, deckType, cardFile,
def makeCards(deckJson, outfile, outdir, host):
# number of cards in x and y direction
cardsPerRow = math.ceil(math.sqrt(len(deckJson['deck']) + len(deckJson['character']) * 2))
deckType = deckJson["type"]
if deckType in ["hero", "villain"]:
cardsPerRow = math.ceil(math.sqrt(len(deckJson['deck']) + len(deckJson['character']) * 2))
else:
cardsPerRow = math.ceil(math.sqrt(len(deckJson['deck']) * 2))
outSVG = etree.ElementTree(
etree.Element('svg', attrib={'width': str(cardsPerRow * CARD_WIDTH) + "pt",
'height': str(cardsPerRow * CARD_HEIGHT) + "pt",
'version': "1.2",
'xmlns': "http://www.w3.org/2000/svg"}))
deckType = deckJson["type"]
with open(bundle_dir + "/templates/deck.json") as f:
outJson = json.load(f)
outJson['ObjectStates'][0]['CustomDeck']['1'].update(