Add card counts and wrapper/slipcase features (#65)

This adds card counts and the option to print wrappers (aka slipcases).
It fixes issues #45, #47, and #48.
This commit is contained in:
Wendel Voigt 2016-07-06 17:16:06 -04:00 committed by Peter
parent 7b9e2361ae
commit 669fa4c7e6
9 changed files with 574 additions and 134 deletions

View File

@ -285,6 +285,7 @@
"extra": "60 Karten pro Spiel.",
"cost": "0",
"cardset": "Dominion",
"count": 60,
"types": [
"Treasure"
],
@ -296,6 +297,7 @@
"extra": "40 Karten pro Spiel",
"cost": "3",
"cardset": "Dominion",
"count": 40,
"types": [
"Treasure"
],
@ -307,6 +309,7 @@
"extra": "30 Karten pro Spiel",
"cost": "6",
"cardset": "Dominion",
"count": 30,
"types": [
"Treasure"
],
@ -318,6 +321,7 @@
"extra": "Flüche sind immer im Spiel.\n2 Spieler = 10 Flüche\n3 Spieler = 20 Flüche\n4Spieler = 30 Flüche\n5 Spieler = 40 Flüche\n6 Spieler = 50 Flüche",
"cost": "0",
"cardset": "Dominion",
"count": 30,
"types": [
"Curse"
],
@ -329,6 +333,7 @@
"extra": "8 Karten bei 2 Spielern. Bei 3 oder mehr Spielern alle 12 Karten.",
"cost": "2",
"cardset": "Dominion",
"count": 24,
"types": [
"Victory"
],
@ -645,6 +650,7 @@
"extra": "",
"cost": "0",
"cardset": "Intrige",
"count": 60,
"types": [
"Treasure"
],
@ -656,6 +662,7 @@
"extra": "",
"cost": "3",
"cardset": "Intrige",
"count": 40,
"types": [
"Treasure"
],
@ -667,6 +674,7 @@
"extra": "",
"cost": "6",
"cardset": "Intrige",
"count": 30,
"types": [
"Treasure"
],
@ -678,6 +686,7 @@
"extra": "",
"cost": "0",
"cardset": "Intrige",
"count": 30,
"types": [
"Curse"
],
@ -689,6 +698,7 @@
"extra": "",
"cost": "2",
"cardset": "Intrige",
"count": 24,
"types": [
"Victory"
],
@ -1167,6 +1177,7 @@
"extra": "",
"cost": "4",
"cardset": "Die Alchemisten",
"count": 16,
"types": [
"Treasure"
],
@ -2615,6 +2626,7 @@
"extra": "Einen LEHRER erhältst du nur, wenn du einen SCHÜLER eintauschst. Er kann in keine andere Karte eingetauscht werden. Wenn du den LEHRER ausspielst, lege ihn auf dein Wirtshaustableau. Zu Beginn deines Zuges darfst du den LEHRER von deinem Tableau aufrufen und in den Spielbereich legen. Wenn du das tust, legst du entweder den +1 Karte-, +1 Aktion-, +1 Kauf- oder + 1 Coins -Marker auf einen beliebigen Aktions-Vorratsstapel, auf dem du zu diesem Zeitpunkt keine weiteren eigenen Marker liegen hast. Immer wenn du eine Karte, die von diesem Stapel stammt, spielst, erhältst du zuerst (bevor die Anweisungen der Karte ausgeführt werden) den entsprechenden Bonus des Markers. Lege den LEHRER in der Aufräumphase ab.",
"cost": "6*",
"cardset": "Abenteuer",
"count": 5,
"types": [
"Action",
"Reserve"
@ -2676,6 +2688,7 @@
"extra": "Einen CHAMPION erhältst du nur, wenn du einen HELDEN eintauschst. Er kann in keine andere Karte eingetauscht werden. Wenn du den CHAMPION ausspielst, erhältst du + 1 Aktion. Der CHAMPION ist eine Dauerkarte. Er bleibt bis zum Spielende im Spiel. Immer wenn ein Mitspieler ab jetzt eine Angriffskarte ausspielt, bist du davon nicht betroffen (auch wenn du das möchtest). Für den Rest des Spiels erhältst du jedes Mal, wenn du eine Aktionskarte ausspielst, + 1 Aktion. Die Anweisung über der Trennlinie wird nur beim Ausspielen des CHAMPION ausgeführt.",
"cost": "6*",
"cardset": "Abenteuer",
"count": 5,
"types": [
"Action",
"Duration"

View File

@ -287,6 +287,7 @@
"extra": " 60 cards per game.",
"name": "Copper",
"potcost": 0,
"count": 60,
"types": [
"Treasure"
]
@ -298,6 +299,7 @@
"extra": " 40 cards per game.",
"name": "Silver",
"potcost": 0,
"count": 40,
"types": [
"Treasure"
]
@ -309,6 +311,7 @@
"extra": " 30 cards per game.",
"name": "Gold",
"potcost": 0,
"count": 30,
"types": [
"Treasure"
]
@ -320,6 +323,7 @@
"extra": " Curses are an available pile in the Supply regardless of what other cards are in the Supply. With 2 players, place 10 Curses in the Supply. With 3 players, place 20 Curses in the Supply. With 4 players, place 30 Curses in the Supply. With 5 players, place 40 Curses in the Supply. With 6 players, place 50 Curses in the Supply.",
"name": "Curse",
"potcost": 0,
"count": 30,
"types": [
"Curse"
]
@ -331,6 +335,7 @@
"extra": " Put 8 in the Supply in a game with two players. Put 12 in the Supply in a game with three or more players.",
"name": "Estate",
"potcost": 0,
"count": 24,
"types": [
"Victory"
]
@ -359,13 +364,14 @@
},
{
"cardset": "dominion",
"cost": "0",
"cost": "",
"description": "Pile of trash.",
"extra": "",
"name": "Trash",
"potcost": 0,
"count": 1,
"types": [
"Action"
"Trash"
]
},
{
@ -658,6 +664,7 @@
"extra": " 60 cards per game.",
"name": "Copper",
"potcost": 0,
"count": 60,
"types": [
"Treasure"
]
@ -669,6 +676,7 @@
"extra": " 40 cards per game.",
"name": "Silver",
"potcost": 0,
"count": 40,
"types": [
"Treasure"
]
@ -680,6 +688,7 @@
"extra": " 30 cards per game.",
"name": "Gold",
"potcost": 0,
"count": 30,
"types": [
"Treasure"
]
@ -702,6 +711,7 @@
"extra": " Put 8 in the Supply in a game with two players. Put 12 in the Supply in a game with three or more players.",
"name": "Estate",
"potcost": 0,
"count": 24,
"types": [
"Victory"
]
@ -730,13 +740,13 @@
},
{
"cardset": "intrigue",
"cost": "0",
"cost": "",
"description": "Pile of trash.",
"extra": "",
"name": "Trash",
"potcost": 0,
"types": [
"Action"
"Trash"
]
},
{
@ -1191,6 +1201,7 @@
"extra": " This is a basic Treasure card. It costs 4 Coins and produces Potion. It is not a Kingdom card. After you choose 10 Kingdom cards for the Supply, if any of them have Potion in the cost, add the Potion pile to the Supply. Also add the Potion pile if you are using the promotional card Black Market, and the Black Market deck includes at least one card with Potion in the cost. If you don't have any cards with Potion in the cost in the Supply or the Black Market deck, do not use the Potion pile in this game. When you have a Potion pile, put all 16 Potions in it, no matter how many players there are. In games using this pile, if the pile becomes empty, that will count towards the game ending condition.",
"name": "Potion",
"potcost": 0,
"count": 16,
"types": [
"Treasure"
]
@ -1579,6 +1590,7 @@
"extra": " 60 cards per game.",
"name": "Copper",
"potcost": 0,
"count": 60,
"types": [
"Treasure"
]
@ -1590,6 +1602,7 @@
"extra": " 40 cards per game.",
"name": "Silver",
"potcost": 0,
"count": 40,
"types": [
"Treasure"
]
@ -1601,6 +1614,7 @@
"extra": " 30 cards per game.",
"name": "Gold",
"potcost": 0,
"count": 30,
"types": [
"Treasure"
]
@ -1612,6 +1626,7 @@
"extra": " This is not a Kingdom card. You do not use it every game. It is a Treasure worth 5 coins. If only Kingdom cards from Prosperity are being used this game, then the Platinum and Colony piles are added to the Basic cards in the Supply for the game. If a mix of Kingdom cards from Prosperity and other sets are being used, then the inclusion of Platinum and Colony in the Supply should be determined randomly, based on the proportion of Prosperity and non-Prosperity cards in use. For example, choose a random Kingdom card being used - such as the first card dealt out from the Randomizer deck [this is equivalent to rolling a d10 or choosing a card at random after all 10 have been selected] - and if it is from Prosperity, add Platinum and Colony to the Supply. Platinum and Colony are not Kingdom cards; when those are included, there are 10 Kingdom cards, plus Copper, Silver, Gold, Platinum, Estate, Duchy, Province, Colony, and Curse, in the Supply. Use 8 Colonies for a 2-player game, or 12 Colonies for a game with 3 or more players. [Use all 12 Platinum regardless of the number of players. Platinum and Colony are meant to be used together and both or neither should be used, not one or the other.]",
"name": "Platinum",
"potcost": 0,
"count": 12,
"types": [
"Treasure"
]
@ -1623,6 +1638,7 @@
"extra": " This is a basic Treasure card. It costs 4 Coins and produces Potion. It is not a Kingdom card. After you choose 10 Kingdom cards for the Supply, if any of them have Potion in the cost, add the Potion pile to the Supply. Also add the Potion pile if you are using the promotional card Black Market, and the Black Market deck includes at least one card with Potion in the cost. If you don't have any cards with Potion in the cost in the Supply or the Black Market deck, do not use the Potion pile in this game. When you have a Potion pile, put all 16 Potions in it, no matter how many players there are. In games using this pile, if the pile becomes empty, that will count towards the game ending condition.",
"name": "Potion",
"potcost": 0,
"count": 16,
"types": [
"Treasure"
]
@ -1645,6 +1661,7 @@
"extra": " Put 8 in the Supply in a game with two players. Put 12 in the Supply in a game with three or more players.",
"name": "Estate",
"potcost": 0,
"count": 24,
"types": [
"Victory"
]
@ -1684,13 +1701,13 @@
},
{
"cardset": "base",
"cost": "0",
"cost": "",
"description": "Pile of trash.",
"extra": "",
"name": "Trash",
"potcost": 0,
"types": [
"Action"
"Trash"
]
},
{
@ -1908,8 +1925,9 @@
"extra": " Prizes are never in the supply. They can only be obtained via Tournament. When Tournament is one of the Kingdom cards, set out the pile of five Prizes at the start of the game. ",
"name": "Prizes",
"potcost": 0,
"count": 0,
"types": [
"Prize"
"Prizes"
]
},
{
@ -2234,6 +2252,7 @@
"extra": " This is never in the Supply; it can only be obtained via Bandit Camp, Marauder, and Pillage. When you play Spoils, you get +3 Coins to spend this turn, and return that copy of Spoils to its pile. You are not forced to play Treasures in your hand.",
"name": "Spoils",
"potcost": 0,
"count": 15,
"types": [
"Treasure"
]
@ -2380,6 +2399,7 @@
"extra": " Follow the instructions in order. First draw a card; then gain a Rats from the Supply, putting it into your discard pile; then trash a card from your hand that is not a Rats card. If there are no Rats cards left, you do not gain one. If you have no cards in your hand other than Rats, reveal your hand and you do not trash a card. If Rats is trashed, you draw a card. This happens whether it is your turn or another player's, and regardless of which player has the card that trashed Rats. There are 20 copies of Rats, rather than the usual 10; the pile starts with all 20, regardless of the number of players.",
"name": "Rats",
"potcost": 0,
"count": 20,
"types": [
"Action"
]
@ -2687,8 +2707,7 @@
"name": "Shelters",
"potcost": 0,
"types": [
"Action",
"Shelter"
"Shelters"
]
},
{
@ -2698,6 +2717,7 @@
"extra": " Mercenary: This card is not in the Supply; it can only be obtained via Urchin. When you play it, you may trash 2 cards from your hand. If you do, you draw two cards, get +2 Coins, and each other player discards down to 3 cards in hand. Players who already have 3 or fewer cards in hand do nothing. Players responding to this Attack with cards like Beggar must choose to do so before you decide whether or not to trash 2 cards from your hand. If you play this with only one card in hand, you may choose to trash that card, but then will fail the \"if you do\" and will not draw cards and so on. If the cards you trash do things when trashed, first trash them both, then choose what order to resolve the things they do when trashed. ",
"name": "Urchin / Mercenary",
"potcost": 0,
"count": 0,
"types": [
"Action"
]
@ -2709,6 +2729,7 @@
"extra": " Madman: This card is not in the Supply; it can only be obtained via Hermit. When you play it, you get +2 Actions, return it to the Madman pile if you can (this is not optional), and if you did return it, you draw a card per card in your hand. For example if you had three cards in hand after playing Madman, you would draw three cards. Normally, nothing will prevent you from returning Madman to the Madman pile, but you may fail to due to playing Madman twice via Procession, Throne Room (from Dominion), or King's Court (from Prosperity). So, for example, if you Procession a Madman, you will get +2 Actions, return Madman to the Madman pile, draw a card per card in your hand, get another +2 Actions, fail to return Madman and so not draw cards the second time, fail to trash Madman, and then gain an Action card costing exactly 1 Coin if you can. ",
"name": "Hermit / Madman",
"potcost": 0,
"count": 0,
"types": [
"Action"
]
@ -3257,6 +3278,7 @@
"extra": " Champion stays in play for the rest of the game once played. For the rest of the game, it provides you with an additional +1 Action each time you play an Action, which means you will always be able to play all of your Actions; and it protects you from all further Attacks played (whether you want the protection or not). Champion only protects you from Attacks played after it; for example it does not stop a previously played Swamp Hag from giving you Curses that turn. ",
"name": "Champion",
"potcost": 0,
"count": 5,
"types": [
"Action",
"Duration"
@ -3306,6 +3328,7 @@
"extra": " When you play this, put it on your Tavern mat. It stays on your mat until you call it at the start of one of your turns. If multiple things can happen at the start of your turn, you can do them in any order. When you call Teacher, it moves from the mat into play, and you choose your +1 Action, +1 Card, +1 Buy, or + 1 Coin token, and move it to an Action Supply pile that you have no tokens on. The token on the pile means that every time you play a card from that pile, you will get the corresponding bonus - if you put your +1 Action token on a pile, you will get an extra +1 Action when playing a card from that pile. See the Tokens section. This cannot put a token on a pile you have tokens on, including the tokens Teacher places as well as your - 2 Coin cost token and Trashing token. This can put a token on a pile that other players have tokens on. Other things can put tokens on a pile you put a token on with Teacher; it is just Teacher itself that cannot put a token on a pile you have a token on. It is okay if the pile has a token that does not belong to you or anyone, such as an Embargo token (from Seaside) or coin token for Trade Route (from Prosperity). It is okay if you have an Estate token on a card set aside from that pile. ",
"name": "Teacher",
"potcost": 0,
"count": 5,
"types": [
"Action",
"Reserve"
@ -3538,8 +3561,9 @@
"extra": "Events are not Kingdom cards. In a players Buy phase, when the player can buy a card, the player can buy an Event instead. Buying an Event means paying the cost indicated on the Event and then doing the effect of the Event. The Event just stays on the table, the player does not take it; there is no way for a player to gain one or end up with one in his deck. Buying an Event uses up a Buy; normally a player can either buy a card, or buy an Event. A player with two Buys, such as after playing Ranger, could buy two cards, or buy two Events, or buy a card and an Event (in either order). The same Event can be bought multiple times in a turn if the player has the Buys and available to do it. Some Events give +Buys and so let the player buy further cards/Events afterwards. Players cannot play further Treasures that turn after buying an Event. Buying an Event is not buying a card and so does not trigger cards like Swamp Hag or Goons (from Prosperity). Costs of Events are not affected by cards like Bridge Troll.",
"name": "Events",
"potcost": 0,
"count": 0,
"types": [
"Event"
"Events"
]
},
{
@ -3561,6 +3585,7 @@
"extra": "You can look through your discard pile even if you know there are no Settlers in it.",
"name": "Bustling Village",
"potcost": 0,
"count": 5,
"types":[
"Action"
]
@ -3583,6 +3608,7 @@
"extra": "Humble Castle and King's Castle count themselves. Small Castle gains you the top Castle, whichever one that is. Haunted Castle works whether you buy it or gain it some other way, provided that it is your turn. You can pick either option on Sprawling Castle regardless of how many Duchies and Estates are left in the piles. Grand Castle counts both Victory cards in play - such as an Opulent Castle - and Victory cards in your hand.",
"name": "Castles",
"potcost": 0,
"count": 12,
"types":[
"Victory",
"Castle"
@ -3595,6 +3621,7 @@
"extra": "If the card you trash is a treasure, each other player discards down to 3 cards in hand; if the card you trash costs 3 Coins or more, each other player gains a Curse; if it is both (e.g. Silver), both things happen; if it is neither, neither thing happens. If you have no cards in hand left to trash, neither thing happens.",
"name": "Catapult",
"potcost": 0,
"count": 5,
"types":[
"Action",
"Attack"
@ -3653,6 +3680,7 @@
"extra": "This counts Action cards in play, including Action cards played this turn, Duration cards in play from previous turns, and Reserve cards (from Dominion: Adventures) called into play this turn.",
"name": "Emporium",
"potcost": 0,
"count": 5,
"types":[
"Action"
]
@ -3664,6 +3692,7 @@
"extra": "Revealing a Plunder or Gold is optional. When you return Encampment to the Supply, it goes on top of its pile, potentially covering up a Plunder.",
"name": "Encampment",
"potcost": 0,
"count": 5,
"types":[
"Action"
]
@ -3713,6 +3742,7 @@
"name": "Fortune",
"potcost": 0,
"debtcost": 8,
"count": 5,
"types":[
"Treasure"
]
@ -3735,6 +3765,7 @@
"extra": "If there are no Gladiators in the Supply, you cannot trash one, but that does not stop you from getting the +1 Coin. If you have no cards in hand, the player to your left cannot reveal a copy of the card you revealed, so you will get the +1 Coin and trash a Gladiator.",
"name": "Gladiator",
"potcost": 0,
"count": 5,
"types":[
"Action"
]
@ -3793,6 +3824,7 @@
"extra": "Cards costing Debt do not cost 5 Coin or more unless they also have a Coin cost of 5 Coin or more. So Fortune does but City Quarter does not.",
"name": "Patrician",
"potcost": 0,
"count": 5,
"types":[
"Action"
]
@ -3804,6 +3836,7 @@
"extra": "This gives you a <VP> token every time you play it.",
"name": "Plunder",
"potcost": 0,
"count": 5,
"types":[
"Treasure"
]
@ -3815,6 +3848,7 @@
"extra": "If it is another player's turn, then it is not your Buy phase, so the Silver goes to your hand.",
"name": "Rocks",
"potcost": 0,
"count": 5,
"types":[
"Treasure"
]
@ -3837,6 +3871,7 @@
"extra": "You can look through your discard pile even if you know there is no Copper in it.",
"name": "Settlers",
"potcost": 0,
"count": 5,
"types":[
"Action"
]
@ -3883,8 +3918,9 @@
"extra": "",
"name": "Events",
"potcost": 0,
"count": 0,
"types":[
"Event"
"Events"
]
},
{
@ -4251,8 +4287,9 @@
"extra": "",
"name": "Landmarks",
"potcost": 0,
"count": 0,
"types":[
"Landmark"
"Landmarks"
]
},
{

View File

@ -205,6 +205,7 @@
"extra": " 60 cards per game.",
"name": "Copper",
"potcost": 0,
"count": 60,
"types": ["Treasure"]
}, {
"cardset": "dominion",
@ -213,6 +214,7 @@
"extra": " 40 cards per game.",
"name": "Silver",
"potcost": 0,
"count": 40,
"types": ["Treasure"]
}, {
"cardset": "dominion",
@ -221,6 +223,7 @@
"extra": " 30 cards per game.",
"name": "Gold",
"potcost": 0,
"count": 30,
"types": ["Treasure"]
}, {
"cardset": "dominion",
@ -229,6 +232,7 @@
"extra": " Curses are an available pile in the Supply regardless of what other cards are in the Supply. With 2 players, place 10 Curses in the Supply. With 3 players, place 20 Curses in the Supply. With 4 players, place 30 Curses in the Supply. With 5 players, place 40 Curses in the Supply. With 6 players, place 50 Curses in the Supply.",
"name": "Curse",
"potcost": 0,
"count": 30,
"types": ["Curse"]
}, {
"cardset": "dominion",
@ -237,6 +241,7 @@
"extra": " Put 8 in the Supply in a game with two players. Put 12 in the Supply in a game with three or more players.",
"name": "Estate",
"potcost": 0,
"count": 24,
"types": ["Victory"]
}, {
"cardset": "dominion",
@ -256,12 +261,13 @@
"types": ["Victory"]
}, {
"cardset": "dominion",
"cost": "0",
"cost": "",
"description": "Pile of trash.",
"extra": "",
"name": "Trash",
"potcost": 0,
"types": ["Action"]
"count": 1,
"types": ["Trash"]
}, {
"cardset": "l'intrigue",
"cost": "2",
@ -469,6 +475,7 @@
"extra": " 60 cards per game.",
"name": "Copper",
"potcost": 0,
"count": 60,
"types": ["Treasure"]
}, {
"cardset": "l'intrigue",
@ -477,6 +484,7 @@
"extra": " 40 cards per game.",
"name": "Silver",
"potcost": 0,
"count": 40,
"types": ["Treasure"]
}, {
"cardset": "l'intrigue",
@ -485,6 +493,7 @@
"extra": " 30 cards per game.",
"name": "Gold",
"potcost": 0,
"count": 30,
"types": ["Treasure"]
}, {
"cardset": "l'intrigue",
@ -493,6 +502,7 @@
"extra": " Curses are an available pile in the Supply regardless of what other cards are in the Supply. With 2 players, place 10 Curses in the Supply. With 3 players, place 20 Curses in the Supply. With 4 players, place 30 Curses in the Supply. With 5 players, place 40 Curses in the Supply. With 6 players, place 50 Curses in the Supply.",
"name": "Curse",
"potcost": 0,
"count": 30,
"types": ["Curse"]
}, {
"cardset": "l'intrigue",
@ -501,6 +511,7 @@
"extra": " Put 8 in the Supply in a game with two players. Put 12 in the Supply in a game with three or more players.",
"name": "Estate",
"potcost": 0,
"count": 24,
"types": ["Victory"]
}, {
"cardset": "l'intrigue",
@ -520,12 +531,13 @@
"types": ["Victory"]
}, {
"cardset": "l'intrigue",
"cost": "0",
"cost": "",
"description": "Pile of trash.",
"extra": "",
"name": "Trash",
"potcost": 0,
"types": ["Action"]
"count": 1,
"types": ["Trash"]
}, {
"cardset": "rivages",
"cost": "2",
@ -846,6 +858,7 @@
"extra": " This is a basic Treasure card. It costs 4 Coins and produces Potion. It is not a Kingdom card. After you choose 10 Kingdom cards for the Supply, if any of them have Potion in the cost, add the Potion pile to the Supply. Also add the Potion pile if you are using the promotional card Black Market, and the Black Market deck includes at least one card with Potion in the cost. If you don't have any cards with Potion in the cost in the Supply or the Black Market deck, do not use the Potion pile in this game. When you have a Potion pile, put all 16 Potions in it, no matter how many players there are. In games using this pile, if the pile becomes empty, that will count towards the game ending condition.",
"name": "Potion",
"potcost": 0,
"count": 16,
"types": ["Treasure"]
}, {
"cardset": "prosperité",
@ -1054,6 +1067,7 @@
"extra": " This is not a Kingdom card. You do not use it every game. It is a Treasure worth 5 coins. If only Kingdom cards from Prosperity are being used this game, then the Platinum and Colony piles are added to the Basic cards in the Supply for the game. If a mix of Kingdom cards from Prosperity and other sets are being used, then the inclusion of Platinum and Colony in the Supply should be determined randomly, based on the proportion of Prosperity and non-Prosperity cards in use. For example, choose a random Kingdom card being used - such as the first card dealt out from the Randomizer deck [this is equivalent to rolling a d10 or choosing a card at random after all 10 have been selected] - and if it is from Prosperity, add Platinum and Colony to the Supply. Platinum and Colony are not Kingdom cards; when those are included, there are 10 Kingdom cards, plus Copper, Silver, Gold, Platinum, Estate, Duchy, Province, Colony, and Curse, in the Supply. Use 8 Colonies for a 2-player game, or 12 Colonies for a game with 3 or more players. [Use all 12 Platinum regardless of the number of players. Platinum and Colony are meant to be used together and both or neither should be used, not one or the other.]",
"name": "Platinum",
"potcost": 0,
"count": 12,
"types": ["Treasure"]
}, {
"cardset": "prosperité",
@ -1118,6 +1132,7 @@
"extra": " 60 cards per game.",
"name": "Copper",
"potcost": 0,
"count": 60,
"types": ["Treasure"]
}, {
"cardset": "base",
@ -1126,6 +1141,7 @@
"extra": " 40 cards per game.",
"name": "Silver",
"potcost": 0,
"count": 40,
"types": ["Treasure"]
}, {
"cardset": "base",
@ -1134,6 +1150,7 @@
"extra": " 30 cards per game.",
"name": "Gold",
"potcost": 0,
"count": 30,
"types": ["Treasure"]
}, {
"cardset": "base",
@ -1142,6 +1159,7 @@
"extra": " This is not a Kingdom card. You do not use it every game. It is a Treasure worth 5 coins. If only Kingdom cards from Prosperity are being used this game, then the Platinum and Colony piles are added to the Basic cards in the Supply for the game. If a mix of Kingdom cards from Prosperity and other sets are being used, then the inclusion of Platinum and Colony in the Supply should be determined randomly, based on the proportion of Prosperity and non-Prosperity cards in use. For example, choose a random Kingdom card being used - such as the first card dealt out from the Randomizer deck [this is equivalent to rolling a d10 or choosing a card at random after all 10 have been selected] - and if it is from Prosperity, add Platinum and Colony to the Supply. Platinum and Colony are not Kingdom cards; when those are included, there are 10 Kingdom cards, plus Copper, Silver, Gold, Platinum, Estate, Duchy, Province, Colony, and Curse, in the Supply. Use 8 Colonies for a 2-player game, or 12 Colonies for a game with 3 or more players. [Use all 12 Platinum regardless of the number of players. Platinum and Colony are meant to be used together and both or neither should be used, not one or the other.]",
"name": "Platinum",
"potcost": 0,
"count": 12,
"types": ["Treasure"]
}, {
"cardset": "base",
@ -1150,6 +1168,7 @@
"extra": " This is a basic Treasure card. It costs 4 Coins and produces Potion. It is not a Kingdom card. After you choose 10 Kingdom cards for the Supply, if any of them have Potion in the cost, add the Potion pile to the Supply. Also add the Potion pile if you are using the promotional card Black Market, and the Black Market deck includes at least one card with Potion in the cost. If you don't have any cards with Potion in the cost in the Supply or the Black Market deck, do not use the Potion pile in this game. When you have a Potion pile, put all 16 Potions in it, no matter how many players there are. In games using this pile, if the pile becomes empty, that will count towards the game ending condition.",
"name": "Potion",
"potcost": 0,
"count": 16,
"types": ["Treasure"]
}, {
"cardset": "base",
@ -1158,6 +1177,7 @@
"extra": " Curses are an available pile in the Supply regardless of what other cards are in the Supply. With 2 players, place 10 Curses in the Supply. With 3 players, place 20 Curses in the Supply. With 4 players, place 30 Curses in the Supply. With 5 players, place 40 Curses in the Supply. With 6 players, place 50 Curses in the Supply.",
"name": "Curse",
"potcost": 0,
"count": 30,
"types": ["Curse"]
}, {
"cardset": "base",
@ -1166,6 +1186,7 @@
"extra": " Put 8 in the Supply in a game with two players. Put 12 in the Supply in a game with three or more players.",
"name": "Estate",
"potcost": 0,
"count": 24,
"types": ["Victory"]
}, {
"cardset": "base",
@ -1193,12 +1214,13 @@
"types": ["Victory"]
}, {
"cardset": "base",
"cost": "0",
"cost": "",
"description": "Pile of trash.",
"extra": "",
"name": "Trash",
"potcost": 0,
"types": ["Action"]
"count": 1,
"types": ["Trash"]
}, {
"cardset": "abondance",
"cost": "0*",
@ -1350,7 +1372,8 @@
"extra": " Prizes are never in the supply. They can only be obtained via Tournament. When Tournament is one of the Kingdom cards, set out the pile of five Prizes at the start of the game. ",
"name": "Prizes",
"potcost": 0,
"types": ["Prize"]
"count": 0,
"types": ["Prizes"]
}, {
"cardset": "l'arrière-pays",
"cost": "2",
@ -1582,6 +1605,7 @@
"extra": " This is never in the Supply; it can only be obtained via Bandit Camp, Marauder, and Pillage. When you play Spoils, you get +3 Coins to spend this turn, and return that copy of Spoils to its pile. You are not forced to play Treasures in your hand.",
"name": "Spoils",
"potcost": 0,
"count": 15,
"types": ["Treasure"]
}, {
"cardset": "age des ténèbres",
@ -1686,6 +1710,7 @@
"extra": " Follow the instructions in order. First draw a card; then gain a Rats from the Supply, putting it into your discard pile; then trash a card from your hand that is not a Rats card. If there are no Rats cards left, you do not gain one. If you have no cards in your hand other than Rats, reveal your hand and you do not trash a card. If Rats is trashed, you draw a card. This happens whether it is your turn or another player's, and regardless of which player has the card that trashed Rats. There are 20 copies of Rats, rather than the usual 10; the pile starts with all 20, regardless of the number of players.",
"name": "Rats",
"potcost": 0,
"count": 20,
"types": ["Action"]
}, {
"cardset": "age des ténèbres",
@ -1902,7 +1927,7 @@
"extra": " See Preparation. A shelter is never in the supply. Hovel: When you buy a Victory card, if Hovel is in your hand, you may trash the Hovel. A card with multiple types, one of which is Victory, is a Victory card. You do not get anything for trashing Hovel; you just get to get rid of it. Overgrown Estate: It is a Victory card despite being worth 0 Victory. If this is trashed, you draw a card, right then, even in the middle of resolving another card. For example, if you use Altar to trash Overgrown Estate, you first draw a card, then gain a card costing up to 5 Coins. This card does not give you a way to trash itself, it merely does something if you manage to trash it. Necropolis: This is an Action card; when you play it, you get +2 Actions. ",
"name": "Shelters",
"potcost": 0,
"types": ["Action", "Shelter"]
"types": ["Shelters"]
}, {
"cardset": "dark ages extras",
"cost": "3",
@ -1910,6 +1935,7 @@
"extra": " Mercenary: This card is not in the Supply; it can only be obtained via Urchin. When you play it, you may trash 2 cards from your hand. If you do, you draw two cards, get +2 Coins, and each other player discards down to 3 cards in hand. Players who already have 3 or fewer cards in hand do nothing. Players responding to this Attack with cards like Beggar must choose to do so before you decide whether or not to trash 2 cards from your hand. If you play this with only one card in hand, you may choose to trash that card, but then will fail the \"if you do\" and will not draw cards and so on. If the cards you trash do things when trashed, first trash them both, then choose what order to resolve the things they do when trashed. ",
"name": "Urchin / Mercenary",
"potcost": 0,
"count": 0,
"types": ["Action"]
}, {
"cardset": "dark ages extras",
@ -1918,6 +1944,7 @@
"extra": " Madman: This card is not in the Supply; it can only be obtained via Hermit. When you play it, you get +2 Actions, return it to the Madman pile if you can (this is not optional), and if you did return it, you draw a card per card in your hand. For example if you had three cards in hand after playing Madman, you would draw three cards. Normally, nothing will prevent you from returning Madman to the Madman pile, but you may fail to due to playing Madman twice via Procession, Throne Room (from Dominion), or King's Court (from Prosperity). So, for example, if you Procession a Madman, you will get +2 Actions, return Madman to the Madman pile, draw a card per card in your hand, get another +2 Actions, fail to return Madman and so not draw cards the second time, fail to trash Madman, and then gain an Action card costing exactly 1 Coin if you can. ",
"name": "Hermit / Madman",
"potcost": 0,
"count": 0,
"types": ["Action"]
}, {
"cardset": "guildes",
@ -2294,6 +2321,7 @@
"extra": " Champion stays in play for the rest of the game once played. For the rest of the game, it provides you with an additional +1 Action each time you play an Action, which means you will always be able to play all of your Actions; and it protects you from all further Attacks played (whether you want the protection or not). Champion only protects you from Attacks played after it; for example it does not stop a previously played Swamp Hag from giving you Curses that turn. ",
"name": "Championne",
"potcost": 0,
"count": 5,
"types": ["Action", "Duration"]
}, {
"cardset": "aventures",
@ -2326,6 +2354,7 @@
"extra": " When you play this, put it on your Tavern mat. It stays on your mat until you call it at the start of one of your turns. If multiple things can happen at the start of your turn, you can do them in any order. When you call Teacher, it moves from the mat into play, and you choose your +1 Action, +1 Card, +1 Buy, or + 1 Coin token, and move it to an Action Supply pile that you have no tokens on. The token on the pile means that every time you play a card from that pile, you will get the corresponding bonus - if you put your +1 Action token on a pile, you will get an extra +1 Action when playing a card from that pile. See the Tokens section. This cannot put a token on a pile you have tokens on, including the tokens Teacher places as well as your - 2 Coin cost token and Trashing token. This can put a token on a pile that other players have tokens on. Other things can put tokens on a pile you put a token on with Teacher; it is just Teacher itself that cannot put a token on a pile you have a token on. It is okay if the pile has a token that does not belong to you or anyone, such as an Embargo token (from Seaside) or coin token for Trade Route (from Prosperity). It is okay if you have an Estate token on a card set aside from that pile. ",
"name": "Maître",
"potcost": 0,
"count": 5,
"types": ["Action", "Reserve"]
}, {
"cardset": "aventures",
@ -2494,5 +2523,6 @@
"extra": "Events are not Kingdom cards. In a players Buy phase, when the player can buy a card, the player can buy an Event instead. Buying an Event means paying the cost indicated on the Event and then doing the effect of the Event. The Event just stays on the table, the player does not take it; there is no way for a player to gain one or end up with one in his deck. Buying an Event uses up a Buy; normally a player can either buy a card, or buy an Event. A player with two Buys, such as after playing Ranger, could buy two cards, or buy two Events, or buy a card and an Event (in either order). The same Event can be bought multiple times in a turn if the player has the Buys and available to do it. Some Events give +Buys and so let the player buy further cards/Events afterwards. Players cannot play further Treasures that turn after buying an Event. Buying an Event is not buying a card and so does not trigger cards like Swamp Hag or Goons (from Prosperity). Costs of Events are not affected by cards like Bridge Troll.",
"name": "Événements",
"potcost": 0,
"types": ["Event"]
"count": 0,
"types": ["Events"]
}]

View File

@ -287,6 +287,7 @@
"extra": " 60 carte per partita.",
"name": "Rame",
"potcost": 0,
"count": 60,
"types": [
"Treasure"
]
@ -298,6 +299,7 @@
"extra": " 40 carte per partita.",
"name": "Argento",
"potcost": 0,
"count": 40,
"types": [
"Treasure"
]
@ -309,6 +311,7 @@
"extra": " 30 carte per partita.",
"name": "Oro",
"potcost": 0,
"count": 30,
"types": [
"Treasure"
]
@ -320,6 +323,7 @@
"extra": " Le Maledizioni sono un mazzetto disponibile nella Riserva a prescindere di quali altre carte ci siano nella Riserva. Con 2 giocatori, piazzare 10 Maledizioni nella Riserva. Con 3 giocatori, piazzare 20 Maledizioni nella Riserva. Con 4 giocatori, piazzare 30 Maledizioni nella Riserva. Con 5 giocatori, piazzare 40 Maledizioni nella Riserva. Con 6 giocatori, piazzare 50 Maledizioni nella Riserva.",
"name": "Maledizione",
"potcost": 0,
"count": 30,
"types": [
"Curse"
]
@ -331,6 +335,7 @@
"extra": " Metti 8 carte nella Riserva in una partita con due giocatori. Mettine 12 nella Riserva in una partita con tre o più giocatori.",
"name": "Tenuta",
"potcost": 0,
"count": 24,
"types": [
"Victory"
]
@ -359,13 +364,14 @@
},
{
"cardset": "dominion",
"cost": "0",
"cost": "",
"description": "Pila delle carte eliminate.",
"extra": "",
"name": "Carte Eliminate",
"potcost": 0,
"count": 1,
"types": [
"Action"
"Trash"
]
},
{
@ -658,6 +664,7 @@
"extra": " 60 carte per partita.",
"name": "Rame",
"potcost": 0,
"count": 60,
"types": [
"Treasure"
]
@ -669,6 +676,7 @@
"extra": " 40 carte per partita.",
"name": "Argento",
"potcost": 0,
"count": 40,
"types": [
"Treasure"
]
@ -680,6 +688,7 @@
"extra": " 30 carte per partita.",
"name": "Oro",
"potcost": 0,
"count": 30,
"types": [
"Treasure"
]
@ -691,6 +700,7 @@
"extra": " Le Maledizioni sono un mazzetto disponibile nella Riserva a prescindere di quali altre carte ci siano nella Riserva. Con 2 giocatori, piazzare 10 Maledizioni nella Riserva. Con 3 giocatori, piazzare 20 Maledizioni nella Riserva. Con 4 giocatori, piazzare 30 Maledizioni nella Riserva. Con 5 giocatori, piazzare 40 Maledizioni nella Riserva. Con 6 giocatori, piazzare 50 Maledizioni nella Riserva.",
"name": "Maledizione",
"potcost": 0,
"count": 30,
"types": [
"Curse"
]
@ -702,6 +712,7 @@
"extra": " Metti 8 carte nella Riserva in una partita con due giocatori. Mettine 12 nella Riserva in una partita con tre o più giocatori.",
"name": "Tenuta",
"potcost": 0,
"count": 24,
"types": [
"Victory"
]
@ -730,13 +741,14 @@
},
{
"cardset": "intrigo",
"cost": "0",
"cost": "",
"description": "Pila delle carte eliminate.",
"extra": "",
"name": "Carte Eliminate",
"potcost": 0,
"count": 1,
"types": [
"Action"
"Trash"
]
},
{
@ -1180,6 +1192,7 @@
"extra": " Questa è una carta Tesoro base. Costa 4 Monete e produce una Pozione. Non è una carta Regno. Dopo che hai scelto 10 carte Regno per la Riserva, se qualsiasi di loro ha Pozioni nel costo aggiungi il mazzetto Pozione alla Riserva. Aggiungi il mazzetto Pozione se stai usando la carta promo Mercato Nero ed il suo mazzetto include almeno una carta con la Pozione nel costo. Se non hai carte con la Pozione nel costo nella Riserva o nel mazzetto del Mercato Nero, non usare il mazzetto Pozione in questa partita. Se hai un mazzetto Pozione, mettici tutte e 16 le Pozioni a prescindere dal numero di giocatori. In partite con questo mazzetto, se il mazzetto si svuota conta come uno dei tre che determinano il fine partita.",
"name": "Pozione",
"potcost": 0,
"count": 16,
"types": [
"Treasure"
]
@ -1480,6 +1493,7 @@
"extra": " Questa non è una carta Regno. Non la usi in ogni partita. E' un tesoro che vale 5 Monete. Se ci sono solo carte da Prosperità in questa partita, aggiungi i mazzetti Platino e Colonia alle carte base nella Riserva per la partita. Se è un mix di carte regno da Prosperità e da altri set, l'inclusione di Platino e Colonia va determinata casualmente, in base alla proporzione di carte Prosperità e non-Prosperità in uso. Per esempio, scegli una carta Regno a caso fra quelle usate (come la prima carta uscita di quelle scelte a caso, il che è equivalente a tirare 1d10 dopo che son state scelte tutte le carte) e se viene da Prosperità, aggiungi Platino e Colonia alla Riserva. Platino e Colonia non sono carte Regno; quando sono incluse, ci sono 10 carte Regno, più Rame, Argento, Oro, Platino, Tenuta, Ducato, Provincia, Colonia e Maledizione nella Riserva. Durante la preparazione, metti 12 Colonie nella Riserva per una partita con 3, 4, 5 o 6 giocatori, 8 nella Riserva per una partita a 2 giocatori. [Usa tutti e 12 i Platino a prescindere dal numero dei giocatori. Platino e Colonia si usano assieme, non una senza l'altra.]",
"name": "Platino",
"potcost": 0,
"count": 12,
"types": [
"Treasure"
]
@ -1558,6 +1572,7 @@
"extra": " 60 carte per partita.",
"name": "Rame",
"potcost": 0,
"count": 60,
"types": [
"Treasure"
]
@ -1569,6 +1584,7 @@
"extra": " 40 carte per partita.",
"name": "Argento",
"potcost": 0,
"count": 40,
"types": [
"Treasure"
]
@ -1580,6 +1596,7 @@
"extra": " 30 carte per partita.",
"name": "Oro",
"potcost": 0,
"count": 30,
"types": [
"Treasure"
]
@ -1591,6 +1608,7 @@
"extra": " Questa non è una carta Regno. Non la usi in ogni partita. E' un tesoro che vale 5 Monete. Se ci sono solo carte da Prosperità in questa partita, aggiungi i mazzetti Platino e Colonia alle carte base nella Riserva per la partita. Se è un mix di carte regno da Prosperità e da altri set, l'inclusione di Platino e Colonia va determinata casualmente, in base alla proporzione di carte Prosperità e non-Prosperità in uso. Per esempio, scegli una carta Regno a caso fra quelle usate (come la prima carta uscita di quelle scelte a caso, il che è equivalente a tirare 1d10 dopo che son state scelte tutte le carte) e se viene da Prosperità, aggiungi Platino e Colonia alla Riserva. Platino e Colonia non sono carte Regno; quando sono incluse, ci sono 10 carte Regno, più Rame, Argento, Oro, Platino, Tenuta, Ducato, Provincia, Colonia e Maledizione nella Riserva. Durante la preparazione, metti 12 Colonie nella Riserva per una partita con 3, 4, 5 o 6 giocatori, 8 nella Riserva per una partita a 2 giocatori. [Usa tutti e 12 i Platino a prescindere dal numero dei giocatori. Platino e Colonia si usano assieme, non una senza l'altra.]",
"name": "Platino",
"potcost": 0,
"count": 12,
"types": [
"Treasure"
]
@ -1602,6 +1620,7 @@
"extra": " Questa è una carta Tesoro base. Costa 4 Monete e produce una Pozione. Non è una carta Regno. Dopo che hai scelto 10 carte Regno per la Riserva, se qualsiasi di loro ha Pozioni nel costo aggiungi il mazzetto Pozione alla Riserva. Aggiungi il mazzetto Pozione se stai usando la carta promo Mercato Nero ed il suo mazzetto include almeno una carta con la Pozione nel costo. Se non hai carte con la Pozione nel costo nella Riserva o nel mazzetto del Mercato Nero, non usare il mazzetto Pozione in questa partita. Se hai un mazzetto Pozione, mettici tutte e 16 le Pozioni a prescindere dal numero di giocatori. In partite con questo mazzetto, se il mazzetto si svuota conta come uno dei tre che determinano il fine partita.",
"name": "Pozione",
"potcost": 0,
"count": 16,
"types": [
"Treasure"
]
@ -1613,6 +1632,7 @@
"extra": " Le Maledizioni sono un mazzetto disponibile nella Riserva a prescindere di quali altre carte ci siano nella Riserva. Con 2 giocatori, piazzare 10 Maledizioni nella Riserva. Con 3 giocatori, piazzare 20 Maledizioni nella Riserva. Con 4 giocatori, piazzare 30 Maledizioni nella Riserva. Con 5 giocatori, piazzare 40 Maledizioni nella Riserva. Con 6 giocatori, piazzare 50 Maledizioni nella Riserva.",
"name": "Maledizione",
"potcost": 0,
"count": 30,
"types": [
"Curse"
]
@ -1624,6 +1644,7 @@
"extra": " Metti 8 carte nella Riserva in una partita con due giocatori. Mettine 12 nella Riserva in una partita con tre o più giocatori.",
"name": "Tenuta",
"potcost": 0,
"count": 24,
"types": [
"Victory"
]
@ -1663,13 +1684,14 @@
},
{
"cardset": "base",
"cost": "0",
"cost": "",
"description": "Pila delle carte eliminate.",
"extra": "",
"name": "Carte Eliminate",
"potcost": 0,
"count": 1,
"types": [
"Action"
"Trash"
]
},
{
@ -2202,6 +2224,7 @@
"extra": " This is never in the Supply; it can only be obtained via Bandit Camp, Marauder, and Pillage. When you play Spoils, you get +3 Coins to spend this turn, and return that copy of Spoils to its pile. You are not forced to play Treasures in your hand.",
"name": "Spoils",
"potcost": 0,
"count": 15,
"types": [
"Treasure"
]
@ -2348,6 +2371,7 @@
"extra": " Follow the instructions in order. First draw a card; then gain a Rats from the Supply, putting it into your discard pile; then trash a card from your hand that is not a Rats card. If there are no Rats cards left, you do not gain one. If you have no cards in your hand other than Rats, reveal your hand and you do not trash a card. If Rats is trashed, you draw a card. This happens whether it is your turn or another player's, and regardless of which player has the card that trashed Rats. There are 20 copies of Rats, rather than the usual 10; the pile starts with all 20, regardless of the number of players.",
"name": "Rats",
"potcost": 0,
"count": 20,
"types": [
"Action"
]
@ -2655,8 +2679,7 @@
"name": "Shelters",
"potcost": 0,
"types": [
"Action",
"Shelter"
"Shelters"
]
},
{
@ -2666,6 +2689,7 @@
"extra": " This card is not in the Supply; it can only be obtained via Urchin. When you play it, you may trash 2 cards from your hand. If you do, you draw two cards, get +2 Coins, and each other player discards down to 3 cards in hand. Players who already have 3 or fewer cards in hand do nothing. Players responding to this Attack with cards like Beggar must choose to do so before you decide whether or not to trash 2 cards from your hand. If you play this with only one card in hand, you may choose to trash that card, but then will fail the \"if you do\" and will not draw cards and so on. If the cards you trash do things when trashed, first trash them both, then choose what order to resolve the things they do when trashed. ",
"name": "Urchin / Mercenary",
"potcost": 0,
"count": 0,
"types": [
"Action"
]
@ -2677,6 +2701,7 @@
"extra": " Madman: This card is not in the Supply; it can only be obtained via Hermit. When you play it, you get +2 Actions, return it to the Madman pile if you can (this is not optional), and if you did return it, you draw a card per card in your hand. For example if you had three cards in hand after playing Madman, you would draw three cards. Normally, nothing will prevent you from returning Madman to the Madman pile, but you may fail to due to playing Madman twice via Procession, Throne Room (from Dominion), or King's Court (from Prosperity). So, for example, if you Procession a Madman, you will get +2 Actions, return Madman to the Madman pile, draw a card per card in your hand, get another +2 Actions, fail to return Madman and so not draw cards the second time, fail to trash Madman, and then gain an Action card costing exactly 1 Coin if you can. ",
"name": "Hermit / Madman",
"potcost": 0,
"count": 0,
"types": [
"Action"
]

View File

@ -130,12 +130,44 @@ def parse_opts(argstring):
help="horizontal gap between dividers in centimeters")
parser.add_option("--vertical_gap", type=float, default=0.,
help="vertical gap between dividers in centimeters")
parser.add_option("--count", action="store_true", dest="count",
default=False, help="Display card count on body of the divider.")
parser.add_option("--wrapper", action="store_true", dest="wrapper",
help="Draw wrapper for cards instead of a divider for the cards")
parser.add_option("--thickness", type=float, default=2.0,
help="Thickness of a stack of 60 cards (Copper) in centimeters."
" Typically unsleeved cards are 2.0, thin sleeved cards are 2.4, and thick sleeved cards are 3.2."
" This is only valid with the --wrapper option."
" default:2.0")
parser.add_option("--sleeved_thick", action="store_true",
dest="sleeved_thick", help="same as --size=sleeved --thickness 3.2")
parser.add_option("--sleeved_thin", action="store_true",
dest="sleeved_thin", help="same as --size=sleeved --thickness 2.4")
parser.add_option("--notch_length", type=float, default=0.0,
help="Length of thumb notch on wrapper in centimeters."
" This can make it easier to remove the cards from the wrapper."
" This is only valid with the --wrapper option."
" default:0.0 (i.e., no notch on wrapper)")
parser.add_option("--notch", action="store_true",
dest="notch", help="same as --notch_length thickness 1.5")
options, args = parser.parse_args(argstring)
if not options.cost:
options.cost = ['tab']
if not options.set_icon:
options.set_icon = ['tab']
if options.sleeved_thick:
options.thickness = 3.2
options.sleeved = True
if options.sleeved_thin:
options.thickness = 2.4
options.sleeved = True
if options.notch:
options.notch_length = 1.5
return options, args
@ -273,12 +305,27 @@ def filter_sort_cards(cards, options):
with codecs.open(card_groups_file, 'r', 'utf-8') as cardgroup_file:
card_groups = json.load(cardgroup_file)
# pull out any cards which are a subcard, and rename the master card
new_cards = []
all_subcards = []
for subs in [card_groups[x]["subcards"] for x in card_groups]:
all_subcards += subs
new_cards = [] # holds the cards that are to be kept
all_subcards = [] # holds names of cards that will be removed
subcard_parent = {} # holds reverse map of subcard name to group name
subcard_count = {} # holds total card count of the subcards for a group
# Initialize each of the new card groups
for group in card_groups:
subcard_count[group] = 0
for subs in card_groups[group]["subcards"]:
all_subcards.append(subs) # add card names to the list for removal
subcard_parent[subs] = group # create the reverse mapping of subgroup to group
# go through the cards and add up the number of subgroup cards
for card in cards:
if card.name in all_subcards:
subcard_count[ subcard_parent[card.name] ] += card.getCardCount()
# fix up the group card holders count & name, and weed out the subgroup cards
for card in cards:
if card.name in card_groups.keys():
card.count += subcard_count[card.name]
card.name = card_groups[card.name]["new_name"]
elif card.name in all_subcards:
continue
@ -305,13 +352,54 @@ def filter_sort_cards(cards, options):
cards = filteredCards
if options.exclude_events:
cards = [card for card in cards if not card.isEvent() or card.name == 'Events']
filteredCards = []
count = 0
holder = False
for c in cards:
if c.isType('Events'): # Language Independant by using Type
holder = c
filteredCards.append(c)
elif c.isEvent():
count += c.getCardCount()
else:
filteredCards.append(c)
if holder and count > 0:
holder.setCardCount(count)
cards = filteredCards
if options.exclude_landmarks:
cards = [card for card in cards if not card.isLandmark() or card.name == 'Landmarks']
filteredCards = []
count = 0
holder = False
for c in cards:
if c.isType('Landmarks'): # Language Independant, use Type
holder = c
filteredCards.append(c)
elif c.isLandmark():
count += c.getCardCount()
else:
filteredCards.append(c)
if holder and count > 0:
holder.setCardCount(count)
cards = filteredCards
if options.exclude_prizes:
cards = [card for card in cards if not card.isPrize()]
filteredCards = []
count = 0
holder = False
for c in cards:
if c.isType('Prizes'): # Language Independant, use Type
holder = c
filteredCards.append(c)
elif c.isPrize():
count += c.getCardCount()
else:
filteredCards.append(c)
if holder and count > 0:
holder.setCardCount(count)
cards = filteredCards
if options.cardlist:
cardlist = set()
@ -330,7 +418,7 @@ def filter_sort_cards(cards, options):
c.cardset, []).append(c.name.strip())
for exp, names in cardnamesByExpansion.iteritems():
c = Card(
exp, exp, ("Expansion",), None, ' | '.join(sorted(names)))
exp, exp, ("Expansion",), None, ' | '.join(sorted(names)), count=len(names))
cards.append(c)
cards.sort(key=cardSorter)
@ -338,7 +426,7 @@ def filter_sort_cards(cards, options):
return cards
def calculate_layout(options):
def calculate_layout(options, cards=[]):
dominionCardWidth, dominionCardHeight = parse_cardsize(options.size, options.sleeved)
paperwidth, paperheight = parse_papersize(options.papersize)
@ -380,14 +468,29 @@ def calculate_layout(options):
verticalBorderSpace = options.vertical_gap * cm
dividerHeight = dividerBaseHeight + labelHeight
dividerWidthReserved = dividerWidth + horizontalBorderSpace
dividerHeightReserved = dividerHeight + verticalBorderSpace
if options.wrapper:
max_card_stack_height = max(c.getStackHeight(options.thickness) for c in cards)
dividerHeightReserved = (dividerHeightReserved * 2) + (max_card_stack_height * 2)
print "Max Card Stack Height: {:.2f}cm ".format(max_card_stack_height)
# Notch measurements
notch_height = 0.25 * cm # thumb notch height
notch_width1 = options.notch_length * cm # thumb notch width: top away from tab
notch_width2 = 0.00 * cm # thumb notch width: bottom on side of tab
add_opt(options, 'dividerWidth', dividerWidth)
add_opt(options, 'dividerHeight', dividerHeight)
add_opt(options, 'dividerBaseHeight', dividerBaseHeight)
add_opt(options, 'dividerWidthReserved', dividerWidth + horizontalBorderSpace)
add_opt(options, 'dividerHeightReserved', dividerHeight + verticalBorderSpace)
add_opt(options, 'dividerWidthReserved', dividerWidthReserved)
add_opt(options, 'dividerHeightReserved', dividerHeightReserved)
add_opt(options, 'labelWidth', labelWidth)
add_opt(options, 'labelHeight', labelHeight)
add_opt(options, 'notch_height', notch_height)
add_opt(options, 'notch_width1', notch_width1)
add_opt(options, 'notch_width2', notch_width2)
# as we don't draw anything in the final border, it shouldn't count towards how many tabs we can fit
# so it gets added back in to the page size here
@ -433,7 +536,12 @@ def generate(options, data_path, f):
add_opt(options, 'data_path', data_path)
calculate_layout(options)
cards = read_write_card_data(options)
assert cards, "No cards after reading"
cards = filter_sort_cards(cards, options)
assert cards, "No cards after filtering/sorting"
calculate_layout(options, cards)
print "Paper dimensions: {:.2f}cm (w) x {:.2f}cm (h)".format(options.paperwidth / cm,
options.paperheight / cm)
@ -444,10 +552,6 @@ def generate(options, data_path, f):
print "Margins: {:.2f}cm h, {:.2f}cm v\n".format(options.horizontalMargin / cm,
options.verticalMargin / cm)
cards = read_write_card_data(options)
assert cards, "No cards after reading"
cards = filter_sort_cards(cards, options)
assert cards, "No cards after filtering/sorting"
if not f:
f = "dominion_dividers.pdf"

View File

@ -1,6 +1,6 @@
import json
import os
from reportlab.lib.units import cm
def getType(typespec):
return cardTypes[tuple(typespec)]
@ -101,7 +101,8 @@ class Card(object):
return promoTextIcons[cardName.lower()]
return None
def __init__(self, name, cardset, types, cost, description='', potcost=0, debtcost=0, extra=''):
def __init__(self, name, cardset, types, cost, description='', potcost=0, debtcost=0, extra='', count=-1):
self.name = name.strip()
self.cardset = cardset.strip()
self.types = types
@ -110,6 +111,20 @@ class Card(object):
self.debtcost = debtcost
self.description = description
self.extra = extra
if count < 0:
self.count = getType(self.types).getTypeDefaultCardCount()
else:
self.count = count
def getCardCount(self):
return self.count
def setCardCount(self, value):
self.count = value
def getStackHeight(self, thickness):
# return height of the stacked cards in cm. Using hight in cm of a stack of 60 Copper cards as thickness.
return self.count * cm * (thickness / 60.0) + 2
def getType(self):
return getType(self.types)
@ -122,16 +137,20 @@ class Card(object):
+ ' ' + self.cost + ' ' + self.description + ' ' + self.extra
def isExpansion(self):
return self.getType().getTypeNames() == ('Expansion',)
return 'Expansion' in self.getType().getTypeNames()
def isEvent(self):
return self.getType().getTypeNames() == ('Event',)
return 'Event' in self.getType().getTypeNames()
def isLandmark(self):
return self.getType().getTypeNames() == ('Landmark',)
return 'Landmark' in self.getType().getTypeNames()
def isPrize(self):
return 'Prize' in self.getType().getTypeNames()
def isType(self, what):
return what in self.getType().getTypeNames()
def setImage(self):
setImage = Card.getSetImage(self.cardset, self.name)
@ -164,11 +183,15 @@ class BlankCard(Card):
class CardType(object):
def __init__(self, typeNames, tabImageFile, tabTextHeightOffset=0, tabCostHeightOffset=-1):
def __init__(self, typeNames, tabImageFile, defaultCardCount=10, tabTextHeightOffset=0, tabCostHeightOffset=-1):
self.typeNames = typeNames
self.tabImageFile = tabImageFile
self.tabTextHeightOffset = tabTextHeightOffset
self.tabCostHeightOffset = tabCostHeightOffset
self.defaultCardCount = defaultCardCount
def getTypeDefaultCardCount(self):
return self.defaultCardCount
def getTypeNames(self):
return self.typeNames
@ -192,42 +215,47 @@ class CardType(object):
cardTypes = [
CardType(('Action',), 'action.png'),
CardType(('Action', 'Attack'), 'action.png'),
CardType(('Action', 'Attack', 'Prize'), 'action.png'),
CardType(('Action', 'Attack', 'Prize'), 'action.png',1),
CardType(('Action', 'Reaction'), 'reaction.png'),
CardType(('Action', 'Victory'), 'action-victory.png'),
CardType(('Action', 'Duration'), 'duration.png'),
CardType(('Action', 'Victory'), 'action-victory.png',12),
CardType(('Action', 'Duration'), 'duration.png',5),
CardType(('Action', 'Duration', 'Reaction'), 'duration-reaction.png'),
CardType(('Action', 'Attack', 'Duration'), 'duration.png'),
CardType(('Action', 'Looter'), 'action.png'),
CardType(('Action', 'Prize'), 'action.png'),
CardType(('Action', 'Ruins'), 'ruins.png', 0, 1),
CardType(('Action', 'Shelter'), 'action-shelter.png'),
CardType(('Action', 'Prize'), 'action.png',1),
CardType(('Action', 'Ruins'), 'ruins.png',10, 0, 1),
CardType(('Action', 'Shelter'), 'action-shelter.png',6),
CardType(('Action', 'Attack', 'Duration'), 'duration.png'),
CardType(('Action', 'Attack', 'Looter'), 'action.png'),
CardType(('Action', 'Attack', 'Traveller'), 'action.png'),
CardType(('Action', 'Reserve'), 'reserve.png'),
CardType(('Action', 'Reserve', 'Victory'), 'reserve-victory.png'),
CardType(('Action', 'Traveller'), 'action.png'),
CardType(('Action', 'Attack', 'Traveller'), 'action.png',5),
CardType(('Action', 'Reserve'), 'reserve.png',5),
CardType(('Action', 'Reserve', 'Victory'), 'reserve-victory.png',12),
CardType(('Action', 'Traveller'), 'action.png',5),
CardType(('Action', 'Gathering'), 'action.png'),
CardType(('Action', 'Treasure'), 'action-treasure.png'),
CardType(('Prize',), 'action.png'),
CardType(('Event',), 'event.png'),
CardType(('Prize',), 'action.png',1),
CardType(('Event',), 'event.png',1),
CardType(('Reaction',), 'reaction.png'),
CardType(('Reaction', 'Shelter'), 'reaction-shelter.png'),
CardType(('Treasure',), 'treasure.png', 3, 0),
CardType(('Reaction', 'Shelter'), 'reaction-shelter.png',6),
CardType(('Treasure',), 'treasure.png',10, 3, 0),
CardType(('Treasure', 'Attack'), 'treasure.png'),
CardType(('Treasure', 'Victory'), 'treasure-victory.png'),
CardType(('Treasure', 'Prize'), 'treasure.png', 3, 0),
CardType(('Treasure', 'Reaction'), 'treasure-reaction.png', 0, 1),
CardType(('Treasure', 'Victory'), 'treasure-victory.png',12),
CardType(('Treasure', 'Prize'), 'treasure.png',1, 3, 0),
CardType(('Treasure', 'Reaction'), 'treasure-reaction.png',10, 0, 1),
CardType(('Treasure', 'Reserve'), 'reserve-treasure.png'),
CardType(('Victory',), 'victory.png'),
CardType(('Victory', 'Reaction'), 'victory-reaction.png', 0, 1),
CardType(('Victory', 'Shelter'), 'victory-shelter.png'),
CardType(('Victory', 'Castle'), 'victory.png'),
CardType(('Curse',), 'curse.png', 3),
CardType(('Expansion',), 'expansion.png', 4),
CardType(('Victory',), 'victory.png',12),
CardType(('Victory', 'Reaction'), 'victory-reaction.png',12, 0, 1),
CardType(('Victory', 'Shelter'), 'victory-shelter.png',6),
CardType(('Victory', 'Castle'), 'victory.png',12),
CardType(('Curse',), 'curse.png', 30, 3),
CardType(('Trash',), 'action.png', 1),
CardType(('Prizes',), 'action.png',0),
CardType(('Events',), 'event.png',0),
CardType(('Shelters',), 'shelter.png',0),
CardType(('Expansion',), 'expansion.png',0, 4),
CardType(('Blank',), ''),
CardType(('Landmark',), 'landmark.png')
CardType(('Landmark',), 'landmark.png',1),
CardType(('Landmarks',), 'landmark.png',0)
]
cardTypes = dict(((c.getTypeNames(), c) for c in cardTypes))

View File

@ -43,42 +43,150 @@ class DividerDrawer(object):
self.fontNameBold = 'Times-Bold'
self.fontNameOblique = 'Times-Oblique'
def getOutline(self, card, isExpansionDivider = False):
dividerWidth = self.options.dividerWidth
dividerHeight = self.options.dividerHeight
dividerBaseHeight = self.options.dividerBaseHeight
tabLabelWidth = self.options.labelWidth
notch_height = self.options.notch_height # thumb notch height
notch_width1 = self.options.notch_width1 # thumb notch width: top away from tab
notch_width2 = self.options.notch_width2 # thumb notch width: bottom on side of tab
theTabHeight = dividerHeight - dividerBaseHeight
theTabWidth = self.options.labelWidth
if isExpansionDivider:
side_2_tab = (dividerWidth - theTabWidth) / 2
else:
side_2_tab = 0
nonTabWidth = dividerWidth - tabLabelWidth - side_2_tab
def DeltaXYtoLines(delta):
result = []
started = False
for x,y in delta:
if not started:
last_x = x
last_y = y
started = True
else:
result.append( (last_x , last_y, last_x + x, last_y + y) )
last_x = last_x + x
last_y = last_y + y
return result
self.canvas.saveState()
if not self.options.wrapper:
# Normal Card Outline
# + F+-------------------+E
# | |
# H+-----------------------+G D+-----+C
# | |
# | Generic Divider |
# | Tab Centered or to the Side |
# | |
# A+-------------------------------------------------+B
# delta x delta y
delta = [ ( 0 , 0 ), # to A
( dividerWidth , 0 ), #A to B
( 0 , dividerBaseHeight ), #B to C
( -side_2_tab , 0 ), #C to D
( 0 , theTabHeight ), #D to E
( -theTabWidth , 0 ), #E to F
( 0 , -theTabHeight ), #F to G
( -nonTabWidth , 0 ), #G to H
( 0 , -dividerBaseHeight )] #H to A
self.canvas.lines(DeltaXYtoLines(delta))
else:
# Card Wrapper Outline
notch_width3 = notch_width1 # thumb notch width: bottom away from tab
stackHeight = card.getStackHeight(self.options.thickness)
body_minus_notches = dividerBaseHeight - (2.0 * notch_height)
tab_2_notch = dividerWidth - theTabWidth - side_2_tab - notch_width1
if (tab_2_notch < 0):
tab_2_notch = dividerWidth - theTabWidth - side_2_tab
notch_width1 = 0
# + U+-------------------+T +
# | |
# + V+. . . . . . . . . .+S +
# | |
# + X+---------------------+W . . . . . . . . R+----+Q
# | |
# Z+-------+Y +P
# | |
# | Generic Wrapper |
# | Normal Side |
# | |
# AA+-------+BB N+-------+O
# | |
# + +CC. . . . . . . . . . . . . . . . . .M+ +
# | |
# + +DD. . . . . . . . . . . . . . . . . .L+ +
# | |
# FF+-------+EE K+-------+J
# | |
# | Reverse Side |
# | rotated 180 |
# | |
# A+-------+B +I
# | |
# + C+---------------------+D G+----+H
# | |
# + E+-------------------+F +
#
# delta x delta y
delta = [ ( 0 , theTabHeight+notch_height), # to A
( notch_width1, 0 ), #A to B
( 0 , -notch_height ), #B to C
( tab_2_notch , 0 ), #C to D
( 0 , -theTabHeight ), #D to E
( theTabWidth , 0 ), #E to F
( 0 , theTabHeight ), #F to G
( side_2_tab , 0 ), #G to H
( 0 , notch_height ), #H to I
( 0 , body_minus_notches ), #I to J
(-notch_width2, 0 ), #J to K
( 0 , notch_height ), #K to L
( 0 , stackHeight ), #L to M
( 0 , notch_height ), #M to N
( notch_width2, 0 ), #N to O
( 0 , body_minus_notches ), #O to P
( 0 , notch_height ), #P to Q
(-side_2_tab , 0 ), #Q to R
( 0 , stackHeight ), #R to S
( 0 , theTabHeight ), #S to T
(-theTabWidth , 0 ), #T to U
( 0 , -theTabHeight ), #U to V
( 0 , -stackHeight ), #V to W
(-tab_2_notch , 0 ), #W to X
( 0 , -notch_height ), #X to Y
(-notch_width1, 0 ), #Y to Z
( 0 , -body_minus_notches ), #Z to AA
( notch_width3, 0 ), #AA to BB
( 0 , -notch_height ), #BB to CC
( 0 , -stackHeight ), #CC to DD
( 0 , -notch_height ), #DD to EE
(-notch_width3, 0 ), #EE to FF
( 0 , -body_minus_notches )] #FF to A
self.canvas.lines(DeltaXYtoLines(delta))
self.canvas.setStrokeGray(0.9)
self.canvas.line(dividerWidth-side_2_tab, dividerHeight + dividerBaseHeight + stackHeight , dividerWidth-side_2_tab-theTabWidth , dividerHeight + dividerBaseHeight + stackHeight )
self.canvas.line(dividerWidth-side_2_tab, dividerHeight + dividerBaseHeight + 2*stackHeight , dividerWidth-side_2_tab-theTabWidth , dividerHeight + dividerBaseHeight + 2*stackHeight )
self.canvas.line(notch_width1 , dividerHeight , dividerWidth - notch_width2, dividerHeight )
self.canvas.line(notch_width1 , dividerHeight + stackHeight , dividerWidth - notch_width2, dividerHeight + stackHeight )
self.canvas.restoreState()
def draw(self, fname, cards, options):
self.options = options
self.registerFonts()
dividerWidth = options.dividerWidth
dividerHeight = options.dividerHeight
dividerBaseHeight = options.dividerBaseHeight
tabLabelWidth = options.labelWidth
self.tabOutline = [(0, 0, dividerWidth, 0),
(dividerWidth, 0, dividerWidth, dividerHeight),
(dividerWidth, dividerHeight,
dividerWidth - tabLabelWidth, dividerHeight),
(dividerWidth - tabLabelWidth,
dividerHeight, dividerWidth - tabLabelWidth,
dividerBaseHeight),
(dividerWidth - tabLabelWidth,
dividerBaseHeight, 0, dividerBaseHeight),
(0, dividerBaseHeight, 0, 0)]
self.expansionTabOutline = [(0, 0, dividerWidth, 0),
(dividerWidth, 0, dividerWidth,
dividerBaseHeight),
(dividerWidth, dividerBaseHeight,
dividerWidth / 2 + tabLabelWidth / 2, dividerBaseHeight),
(dividerWidth / 2 + tabLabelWidth / 2, dividerBaseHeight,
dividerWidth / 2 + tabLabelWidth / 2, dividerHeight),
(dividerWidth / 2 + tabLabelWidth / 2, dividerHeight,
dividerWidth / 2 - tabLabelWidth / 2, dividerHeight),
(dividerWidth / 2 - tabLabelWidth / 2, dividerHeight,
dividerWidth / 2 - tabLabelWidth / 2, dividerBaseHeight),
(dividerWidth / 2 - tabLabelWidth / 2, dividerBaseHeight,
0, dividerBaseHeight),
(0, dividerBaseHeight, 0, 0)]
self.canvas = canvas.Canvas(
fname, pagesize=(options.paperwidth, options.paperheight))
self.drawDividers(cards)
@ -109,7 +217,7 @@ class DividerDrawer(object):
text = re.sub('Potion', replace, text)
return text
def drawOutline(self, x, y, rightSide, isBack=False, isExpansionDivider=False):
def drawOutline(self, card, x, y, rightSide, isBack=False, isExpansionDivider=False):
# draw outline or cropmarks
self.canvas.saveState()
self.canvas.setLineWidth(self.options.linewidth)
@ -122,11 +230,11 @@ class DividerDrawer(object):
# don't draw outline on back, in case lines don't line up with
# front
if isExpansionDivider and self.options.centre_expansion_dividers:
outline = self.expansionTabOutline
self.getOutline(card, isExpansionDivider=True)
else:
outline = self.tabOutline
self.canvas.lines(outline)
elif self.options.cropmarks:
self.getOutline(card)
elif self.options.cropmarks and not self.options.wrapper:
cmw = 0.5 * cm
# Horizontal-line cropmarks
@ -175,7 +283,25 @@ class DividerDrawer(object):
leftLine, self.options.dividerHeight + 2 * cmw)
self.canvas.restoreState()
def drawCardCount(self, card, x, y, offset=-1):
if card.count < 1:
return 0
# base width is 16 (for image) + 2 (1 pt border on each side)
width = 18
cardIconHeight = y + offset
countHeight = cardIconHeight - 4
self.canvas.drawImage(os.path.join(self.options.data_path, 'images', 'card.png'),
x, countHeight, 16, 16, preserveAspectRatio=True, mask='auto')
self.canvas.setFont(self.fontNameBold, 10)
count = str(card.count)
self.canvas.drawCentredString(x + 8, countHeight + 4, count)
return width
def drawCost(self, card, x, y, costOffset=-1):
# base width is 16 (for image) + 2 (1 pt border on each side)
width = 18
@ -230,18 +356,36 @@ class DividerDrawer(object):
self.fontNameRegular, fontSize - 2)
return w
def drawTab(self, card, rightSide):
def drawTab(self, card, rightSide, wrapper="no"):
# draw tab flap
self.canvas.saveState()
if card.isExpansion() and self.options.centre_expansion_dividers:
self.canvas.translate(self.options.dividerWidth / 2 - self.options.labelWidth / 2,
self.options.dividerHeight - self.options.labelHeight)
translate_x = self.options.dividerWidth / 2 - self.options.labelWidth / 2
translate_y = self.options.dividerHeight - self.options.labelHeight
elif not rightSide:
self.canvas.translate(self.options.dividerWidth - self.options.labelWidth,
self.options.dividerHeight - self.options.labelHeight)
translate_x = self.options.dividerWidth - self.options.labelWidth
translate_y = self.options.dividerHeight - self.options.labelHeight
else:
self.canvas.translate(0, self.options.dividerHeight - self.options.labelHeight)
translate_x = 0
translate_y = self.options.dividerHeight - self.options.labelHeight
if wrapper == "back":
translate_y = self.options.labelHeight
if card.isExpansion() and self.options.centre_expansion_dividers:
translate_x = self.options.dividerWidth / 2 + self.options.labelWidth / 2
elif not rightSide:
translate_x = self.options.dividerWidth
else:
translate_x = self.options.labelWidth
if wrapper == "front":
translate_y = translate_y + self.options.dividerHeight + 2.0 * card.getStackHeight(self.options.thickness)
self.canvas.translate(translate_x, translate_y)
if wrapper == "back":
self.canvas.rotate(180)
# allow for 3 pt border on each side
textWidth = self.options.labelWidth - 6
textHeight = 7
@ -259,7 +403,7 @@ class DividerDrawer(object):
preserveAspectRatio=False, anchor='n', mask='auto')
# draw cost
if not card.isExpansion() and not card.isBlank() and not card.isLandmark():
if not card.isExpansion() and not card.isBlank() and not card.isLandmark() and not card.isType('Trash'):
if 'tab' in self.options.cost:
textInset = 4
textInset += self.drawCost(card, textInset, textHeight,
@ -325,9 +469,11 @@ class DividerDrawer(object):
h -= h / 2
words = line.split()
if (not self.options.tab_name_align == "right") and (self.options.tab_name_align == "centre" or
rightSide or
not self.options.tab_name_align == "edge"):
NotRightEdge = ( not self.options.tab_name_align == "right"
and (self.options.tab_name_align == "centre" or rightSide or not self.options.tab_name_align == "edge"))
if wrapper == "back" and not self.options.tab_name_align == "centre":
NotRightEdge = not NotRightEdge
if NotRightEdge:
if self.options.tab_name_align == "centre":
w = self.options.labelWidth / 2 - self.nameWidth(line, fontSize) / 2
else:
@ -361,23 +507,67 @@ class DividerDrawer(object):
w += drawWordPiece(word[0], fontSize)
if i != len(words) - 1:
w += drawWordPiece(' ', fontSize)
if wrapper == "front" and card.getCardCount() >= 5:
# Print smaller version of name on the top wrapper edge
self.canvas.translate(0 , -card.getStackHeight(self.options.thickness)) # move into area used by the wrapper
fontSize = 8 # use the smallest font
self.canvas.setFont(self.fontNameRegular, fontSize)
textHeight = fontSize - 2
textHeight = card.getStackHeight(self.options.thickness) / 2 - textHeight / 2
h = textHeight
words = name.split()
w = self.options.labelWidth / 2 - self.nameWidth(name, fontSize) / 2
def drawWordPiece(text, fontSize):
self.canvas.setFont(self.fontNameRegular, fontSize)
if text != ' ':
self.canvas.drawString(w, h, text)
return pdfmetrics.stringWidth(text, self.fontNameRegular, fontSize)
for i, word in enumerate(words):
if i != 0:
w += drawWordPiece(' ', fontSize)
w += drawWordPiece(word[0], fontSize)
w += drawWordPiece(word[1:], fontSize - 2)
self.canvas.restoreState()
def drawText(self, card, divider_text="card"):
def drawText(self, card, divider_text="card", wrapper="no"):
self.canvas.saveState()
usedHeight = 0
totalHeight = self.options.dividerHeight - self.options.labelHeight
# Figure out if any translation needs to be done
if wrapper == "back":
self.canvas.translate(self.options.dividerWidth, self.options.dividerHeight)
self.canvas.rotate(180)
if wrapper == "front":
self.canvas.translate( 0 , self.options.dividerHeight + card.getStackHeight(self.options.thickness))
if wrapper == "front" or wrapper == "back":
if self.options.notch_width1 > 0:
usedHeight += self.options.notch_height
drewTopIcon = False
if 'body-top' in self.options.cost and not card.isExpansion():
self.drawCost(card, cm / 4.0, totalHeight - 0.5 * cm)
self.drawCost(card, cm / 4.0, totalHeight - usedHeight - 0.5 * cm)
drewTopIcon = True
Image_x = self.options.dividerWidth - 16
if 'body-top' in self.options.set_icon and not card.isExpansion():
setImage = card.setImage()
if setImage:
self.drawSetIcon(setImage, self.options.dividerWidth - 16,
totalHeight - 0.5 * cm - 3)
self.drawSetIcon(setImage, Image_x,
totalHeight - usedHeight - 0.5 * cm - 3)
Image_x -= 16
drewTopIcon = True
if self.options.count:
self.drawCardCount(card, Image_x, totalHeight - usedHeight - 0.5 * cm)
drewTopIcon = True
if drewTopIcon:
usedHeight += 15
@ -432,8 +622,10 @@ class DividerDrawer(object):
h -= p.height
p.drawOn(self.canvas, textHorizontalMargin, h)
h -= spacerHeight
self.canvas.restoreState()
def drawDivider(self, card, x, y, isBack=False, divider_text="card"):
def drawDivider(self, card, x, y, isBack=False, divider_text="card", divider_text2="rules"):
# figure out whether the tab should go on the right side or not
if self.options.tab_side == "right":
rightSide = isBack
@ -456,11 +648,18 @@ class DividerDrawer(object):
# actual drawing
if not self.options.tabs_only:
self.drawOutline(
x, y, rightSide, isBack, card.getType().getTypeNames() == ('Expansion',))
self.drawTab(card, rightSide)
self.drawOutline(card, x, y, rightSide, isBack, card.getType().getTypeNames() == ('Expansion',))
if self.options.wrapper:
wrap = "front"
else:
wrap = "no"
self.drawTab(card, rightSide, wrapper=wrap)
if not self.options.tabs_only:
self.drawText(card, divider_text)
self.drawText(card, divider_text, wrapper=wrap)
if self.options.wrapper:
self.drawTab(card, rightSide, wrapper="back")
self.drawText(card, divider_text2, wrapper="back")
def drawSetNames(self, pageCards):
# print sets for this page
@ -500,7 +699,11 @@ class DividerDrawer(object):
return
self.canvas.setFont(fontname, fontsize)
xPos = layout['width'] / 2
# Place at the very edge of the margin
yPos = layout['minMarginHeight']
sets = []
for c in pageCards:
setTitle = c.cardset.title()
@ -542,13 +745,13 @@ class DividerDrawer(object):
x = i % self.options.numDividersHorizontal
y = i / self.options.numDividersHorizontal
self.canvas.saveState()
self.drawDivider(card, x, self.options.numDividersVertical - 1 - y, isBack=False, divider_text=self.options.text_front)
self.drawDivider(card, x, self.options.numDividersVertical - 1 - y, isBack=False, divider_text=self.options.text_front, divider_text2=self.options.text_back)
self.canvas.restoreState()
self.odd = not self.odd
self.canvas.showPage()
if pageNum + 1 == self.options.num_pages:
break
if self.options.tabs_only or self.options.text_back == "none":
if self.options.tabs_only or self.options.text_back == "none" or self.options.wrapper:
# Don't print the sheets with the back of the dividers
continue
if not self.options.no_page_footer and self.options.order != "global":

BIN
images/card.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
img_sources/card.xcf Normal file

Binary file not shown.