diff --git a/SotMDeckBuilder.py b/SotMDeckBuilder.py index 364f689..8f9c345 100755 --- a/SotMDeckBuilder.py +++ b/SotMDeckBuilder.py @@ -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(