'initial'

This commit is contained in:
Sumpfork 2010-10-12 12:52:48 -07:00
commit 1cee518407
22 changed files with 1774 additions and 0 deletions

BIN
action-victory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
action.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

3
convert.ff Normal file
View File

@ -0,0 +1,3 @@
#!/opt/local/bin/fontforge
Open($1)
Generate($1:r + ".ttf")

BIN
curse.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

1334
dominion_card_extras.txt Normal file

File diff suppressed because it is too large Load Diff

191
dominion_cards.txt Normal file
View File

@ -0,0 +1,191 @@
1 Cellar Base Action $2 +1 Action, Discard any number of cards. +1 Card per card discarded.
2 Chapel Base Action $2 Trash up to 4 cards from your hand.
3 Moat Base Action - Reaction $2 +2 Cards, When another player plays an Attack card, you may reveal this from your hand. If you do, you are unaffected by that Attack.
4 Chancellor Base Action $3 +2 Coins, You may immediately put your deck into your discard pile.
5 Village Base Action $3 +1 Card, +2 Actions.
6 Woodcutter Base Action $3 +1 Buy, +2 Coins.
7 Workshop Base Action $3 Gain a card costing up to 4 Coins.
8 Bureaucrat Base Action - Attack $4 Gain a silver card; put it on top of your deck. Each other player reveals a Victory card from his hand and puts it on his deck (or reveals a hand with no Victory cards).
9 Feast Base Action $4 Trash this card. Gain a card costing up to 5 Coins.
10 Gardens Base Victory $4 Variable, Worth 1 Victory for every 10 cards in your deck (rounded down).
11 Militia Base Action - Attack $4 +2 Coins, Each other player discards down to 3 cards in his hand.
12 Moneylender Base Action $4 Trash a Copper from your hand. If you do, +3 Coins.
13 Remodel Base Action $4 Trash a card from your hand. Gain a card costing up to 2 Coins more than the trashed card.
14 Smithy Base Action $4 +3 Cards.
15 Spy Base Action - Attack $4 +1 Card, +1 Action, Each player (including you) reveals the top card of his deck and either discards it or puts it back, your chouce.
16 Thief Base Action - Attack $4 Each other player reveals the top 2 cards of his deck. If they revealed any Treasure cards, they trash one of them that you choose. You may gain any or all of these trashed cards. They discard the other revealed cards.
17 Throne Room Base Action $4 Choose an Action card in your hand. Play it twice.
18 Council Room Base Action $5 +4 Cards, +1 Buy, Each other player draws a card.
19 Festival Base Action $5 +2 Actions, +1 Buy, +2 Coins.
20 Laboratory Base Action $5 +2 Cards, +1 Action.
21 Library Base Action $5 Draw until you have 7 cards in hand. You may set aside any Action cards drawn this way, as you draw them; discard the set aside cards after you finish drawing.
22 Market Base Action $5 +1 Card, +1 Action, +1 Buy, +1 Coin.
23 Mine Base Action $5 Trash a Treasure card from your hand. Gain a Treasure card costing up to 3 Coins more; put it into your hand.
24 Witch Base Action - Attack $5 +2 Cards, Each other player gains a Curse card.
25 Adventurer Base Action $6 Reveal cards from your deck until you reveal 2 Treasure cards. Put those Treasure cards in your hand and discard the other revealed cards.
1 Courtyard Intrigue Action $2 +3 Card, Put a card from your hand on top of your deck.
2 Pawn Intrigue Action $2 Choose two: +1 Card, +1 Action, +1 Buy, +1 Coin. (The choices must be different.).
3 Secret Chamber Intrigue Action - Reaction $2 Discard any number of cards. +1 Coin per card discarded. - When another player plays an Attack card, you may reveal this from your hand. If you do, +2 cards, then put 2 cards from your hand on top of your deck.
4 Great Hall Intrigue Action - Victory $3 1 Victory, +1 Card, +1 Action.
5 Masquerade Intrigue Action $3 +2 Card, Each player passes a card in their hand to the player on their left. You may trash a card from your hand.
6 Shanty Town Intrigue Action $3 +2 Actions, Reveal your hand. If you have no Action cards in hand, +2 Cards.
7 Steward Intrigue Action $3 Choose one: +2 Cards; or +2 Coins; or trash 2 cards from your hand.
8 Swindler Intrigue Action - Attack $3 +2 Coins, Each other player trashes the top card of his deck and gains a card with the same cost that you choose.
9 Wishing Well Intrigue Action $3 +1 Card, +1 Action, Name a card, then reveal the top card of your deck. If it is the named card, put it in your hand.
10 Baron Intrigue Action $4 +1 Buy, You may discard an Estate card. If you do, +4 Coins. Otherwise, gain an Estate card.
11 Bridge Intrigue Action $4 +1 Buy, +1 Coin. All cards (including cards in players' hands) cost 1 Coin less this turn, but not less than 0 Coins.
12 Conspirator Intrigue Action $4 +2 Coins. If you've played 3 or more Actions this turn (counting this): +1 Card, +1 Action.
13 Coppersmith Intrigue Action $4 Copper produces an extra 1 Coin this turn.
14 Ironworks Intrigue Action $4 Gain a card costing up to 4 Coins. If it is an... Action card, +1 Action. Treasure card, +1 Coin. Victory card, +1 Card.
15 Mining Village Intrigue Action $4 +1 Card, +2 Actions. You may trash this card immediately. If you do, +2 Coins.
16 Scout Intrigue Action $4 +1 Action. Reveal the top 4 cards of your deck. Put the revealed Victory cards into your hand. Put the other cards on top of your deck in any order.
17 Duke Intrigue Victory $5 Worth 1 Victory per Duchy you have.
18 Minion Intrigue Action - Attack $5 +1 Action, Choose one: +2 Coins; or discard your hand, +4 Cards, and each other player with at least 5 cards in hand discards his hand and draws 4 cards.
19 Saboteur Intrigue Action - Attack $5 Each other player reveals cards from the top of his deck until revealing one costing 3 Coins or more. He trashes that card and may gain a card costing at most 2 Coins less than it. He discards the other revealed cards.
20 Torturer Intrigue Action - Attack $5 +3 Card, Each other player chooses one: he discards 2 cards; or he gains a Curse card, putting it in his hand.
21 Trading Post Intrigue Action $5 Trash 2 cards from your hand. If you do, gain a silver card; put it into your hand.
22 Tribute Intrigue Action $5 The player to your left reveals then discards the top 2 cards of his deck. For each differently named card revealed, if it is an... Action Card, +2 Actions; Treasure Card, +2 Coins; Victory Card, +2 Cards.
23 Upgrade Intrigue Action $5 +1 Card, +1 Action, Trash a card from your hand. Gain a card costing exactly 1 Coin more than it.
24 Harem Intrigue Treasure - Victory $6 2 Coins, 2 Victory.
25 Nobles Intrigue Action - Victory $6 2 Victory, Choose one: +3 Cards, or +2 Actions.
1 Embargo Seaside Action $2 +2 Coins, Trash this card. Put an Embargo token on top of a Supply pile. - When a player buys a card, he gains a Curse card per Embargo token on that pile.
2 Haven Seaside Action - Duration $2 +1 Card, +1 Action, Set aside a card from your hand face down. At the start of your next turn, put it into your hand.
3 Lighthouse Seaside Action - Duration $2 +1 Action, Now and at the start of your next turn: +1 Coin. - While this is in play, when another player plays an Attack card, it doesn't affect you.
4 Native Village Seaside Action $2 +2 Actions, Choose one: Set aside the top card of your deck face down on your Native Village mat; or put all the cards from your mat into your hand. You may look at the cards on your mat at any time; return them to your deck at the end of the game.
5 Pearl Diver Seaside Action $2 +1 Card, +1 Action, Look at the bottom card of your deck. You may put it on top.
6 Ambassador Seaside Action $3 Reveal a card from your hand. Return up to 2 copies of it from your hand to the Supply. Then each other player gains a copy of it.
7 Fishing Village Seaside Action - Duration $3 +2 Actions, +1 Coin, At the start of your next turn: +1 Action, +1 Coin.
8 Lookout Seaside Action $3 +1 Action, Look at the top 3 cards of your deck. Trash one of them. Discard one of them. Put the other one on top of your deck.
9 Smugglers Seaside Action $3 Gain a copy of a card costing up to 6 Coins that the player to your right gained on his last turn.
10 Warehouse Seaside Action $3 +3 Card, +1 Action, Discard 3 cards.
11 Caravan Seaside Action - Duration $4 +1 Card, +1 Action
At the start of your next turn, +1 Card.
12 Cutpurse Seaside Action - Attack $4 +2 Coins, Each other player discards a Copper card (or reveals a hand with no Copper).
13 Island Seaside Action - Victory $4 Set aside this and another card from your hand. Return them to your deck at the end of the game. 2 VP
14 Navigator Seaside Action $4 +2 Coins, Look at the top 5 cards of your deck. Either discard all of them, or put them back on top of your deck in any order.
15 Pirate Ship Seaside Action - Attack $4 Choose one: Each other player reveals the top 2 cards of his deck, trashes a revealed Treasure that you choose, discards the rest, and if anyone trashed a Treasure you take a Coin token; or, +1 Coin per Coin token you've taken with Pirate Ships this game.
16 Salvager Seaside Action $4 +1 Buy, Trash a card from your hand. +Coins equal to its cost.
17 Sea Hag Seaside Action - Attack $4 Each other player discards the top card of his deck, then gains a Curse card, putting it on top of his deck.
18 Treasure Map Seaside Action $4 Trash this and another copy of Treasure Map from your hand. If you do trash two Treasure Maps, gain 4 Gold cards, putting them on top of your deck.
19 Bazaar Seaside Action $5 +1 Card, +2 Actions, +1 Coin.
20 Explorer Seaside Action $5 You may reveal a Province card from your hand. If you do, gain a Gold card, putting it into your hand. Otherwise, gain a Silver card, putting it into your hand.
21 Ghost Ship Seaside Action - Attack $5 +2 Card, Each other player with 4 or more cards in hand puts cards from his hand on top of his deck until he has 3 cards in his hand.
22 Merchant Ship Seaside Action - Duration $5 Now and at the start of your next turn: +2 Coins.
23 Outpost Seaside Action - Duration $5 You only draw 3 cards (instead of 5) in this turn's Clean-up phase. Take an extra turn after this one. This can't cause you to take more than two consecutive turns.
24 Tactician Seaside Action - Duration $5 Discard your hand. If you discarded any cards this way, then at the start of your next turn, +5 Cards, +1 Buy, and +1 Action.
25 Treasury Seaside Action $5 +1 Card, +1 Action, +1 Coin, When you discard this from play, if you didn't buy a Victory card this turn, you may put this on top of your deck.
26 Wharf Seaside Action - Duration $5 Now and at the start of your next turn: +2 Cards, +1 Buy.
1 Transmute Alchemy Action $0 1P Trash a card from your hand. If it is an...
Action card, gain a Duchy
Treasure card, gain a Transmute
Victory card, gain a Gold
2 Vineyard Alchemy Victory $0 1P Worth 1 Victory for every 3 Action cards in your deck (rounded down).
3 Apothecary Alchemy Action $2 1P +1 Card
+1 Action
Reveal the top 4 cards of your deck. Put the revealed Coppers and Potions into your hand. Put the other cards back on top in any order.
4 Herbalist Alchemy Action $2 +1 Buy
+1 Coin
When you discard this from play, you may put one of your Treasures from play on top of your deck.
5 Scrying Pool Alchemy Action - Attack $2 1P +1 Action
Each player (including you) reveals the top card of his deck and either discards it or puts it back, your choice. Then reveal cards from the top of your deck until revealing one that isn't an Action.
Put all of your revealed cards into your hand.
6 University Alchemy Action $2 1P +2 Actions
You may gain an Action card costing up to 5 Coins.
7 Alchemist Alchemy Action $3 1P +2 Cards
+1 Action
When you discard this from play, you may put this on top of your deck if you have a Potion in play.
8 Familiar Alchemy Action - Attack $3 1P +1 Card
+1 Action
Each other player gains a curse.
9 Philosopher's Stone Alchemy Treasure $3 1P When you play this, count your deck and discard pile.
Worth 1 Coin per 5 cards total between them (rounded down).
10 Golem Alchemy Action $4 1P Reveal cards from your deck until you reveal 2 Action cards other than Golem Cards.
Discard the other cards, then play the Action cards in either order.
11 Potion Alchemy Treasure $4 Worth 1 Potion.
12 Apprentice Alchemy Action $5 +1 Action
Trash a card from your hand.
+1 Card per Coin it costs.
+2 Cards if it has Potion in its cost.
13 Possession Alchemy Action $6 1P The player to your left takes an extra turn after this one, in which you can see all cards he can and make all decisions for him. Any cards he would gain on that turn, you gain instead; any cards of his that are trashed are set aside and returned to his discard pile at end of turn.
1 Loan Prosperity Treasure $3 Worth 1 Coin.
When you play this, reveal cards from your deck until you reveal a Treasure. Discard it or trash it. Discard the other cards.
2 Trade Route Prosperity Action $3 +1 Buy
+$1 per token on the Trade Route mat.
Trash a card from your hand.
----------
Setup: Put a token on each Victory card Supply pile. When a card is gained from that pile, move the token to the Trade Route mat.
3 Watchtower Prosperity Reaction $3 Draw until you have 6 cards in hand.
----------
When you gain a card, you may reveal this from your hand. If you do, either trash that card, or put it on top of your deck.
4 Bishop Prosperity Action $4 +$1
+1 <VP>
Trash a card from your hand. +<VP> equal to half its cost in coins, rounded down.
Each other player may trash a card from his hand.
5 Monument Prosperity Action $4 +$2; +1 <VP>
6 Quarry Prosperity Treasure $4 Worth 1 Coin.
----------
While this is in play, Action cards cost $2 less, but not less than $0.
7 Talisman Prosperity Treasure $4 Worth 1 Coin.
----------
While this is in play, when you buy a card costing $4 or less that is not a Victory card, gain a copy of it.
8 Worker's Village Prosperity Action $4 +1 Card
+2 Actions
+1 Buy
9 City Prosperity Action $5 +1 Card
+2 Actions
If there are one or more empty Supply piles, +1 Card. If there are two or more, +$1 and +1 Buy.
10 Contraband Prosperity Treasure $5 Worth 3 Coins.
+1 Buy
When you play this, the player to your left names a card. You can't buy that card this turn.
11 Counting House Prosperity Action $5 Look through your discard pile, reveal any number of Copper cards from it, and put them into your hand.
12 Mint Prosperity Action $5 You may reveal a Treasure card from your hand. Gain a copy of it.
----------
When you buy this, trash all Treasures you have in play.
13 Mountebank Prosperity Action - Attack $5 +2 Coins
Each other player may discard a Curse. If he doesn't, he gains a Curse and a Copper.
14 Rabble Prosperity Action - Attack $5 +3 Cards
Each other player reveals the top 3 cards of his deck, discards the revealed Actions and Treasures, and puts the rest back on top in any order he chooses.
15 Royal Seal Prosperity Treasure $5 Worth 2 Coins.
----------
While this is in play, when you gain a card, you may put that card on top of your deck.
16 Vault Prosperity Action $5 +2 Cards
Discard any number of cards. +$1 per card discarded.
Each other player may discard 2 cards. If he does, he draws a card.
17 Venture Prosperity Treasure $5 Worth 1 Coin.
When you play this, reveal cards from your deck until you reveal a Treasure. Discard the other cards. Play that Treasure.
18 Goons Prosperity Action - Attack $6 +1 Buy
+$2
Each other player discards down to 3 cards in hand.
----------
While this is in play, when you buy a card, +1 <VP>.
19 Grand Market Prosperity Action $6 +1 Card
+1 Action
+1 Buy
+$2
----------
You can't buy this if you have any Copper in play.
20 Hoard Prosperity Treasure $6 Worth 2 Coins.
----------
While this is in play, when you buy a Victory card, gain a Gold.
21 Bank Prosperity Treasure $7 Worth ? Coins.
When you play this, it`s worth $1 per Treasure card you have in play (counting this).
22 Expand Prosperity Action $7 Trash a card from your hand. Gain a card costing up to $3 more than the trashed card.
23 Forge Prosperity Action $7 Trash any number of cards from your hand. Gain a card with cost exactly equal to the total cost in coins of the trashed cards.
24 King's Court Prosperity Action $7 You may choose an Action card in your hand. Play it three times.
25 Peddler Prosperity Action $8 +1 Card; +1 Action; +2 Coin
----------
During your Buy phase, this costs $2 less per Action card you have in play, but not less than $0.
26 Platinum Prosperity Treasure $9 5 Coins.
27 Colony Prosperity Victory $11 10 Victory.
1 Black Market Promo Action $3 +2 Coins, Reveal the top 3 cards of the Black Market deck. You may buy one of them immediately. Put the unbought cards on the bottom of the Black Market deck in any order.
(Before the game, make a Black Market deck out of one copy of each Kingdom card not in the supply.).
2 Envoy Promo Action $4 Reveal the top 5 cards of your deck. The player to your left chooses one for you to discard. Draw the rest.
3 Stash Promo Treasure $5 Worth 2 Coins. When you shuffle, you may put this anywhere in your deck.
1 Copper Common Treasure $0 1 Coin.
2 Curse Common Curse $0 -1 Victory.
3 Estate Common Victory $2 1 Victory.
4 Silver Common Treasure $3 2 Coins.
5 Duchy Common Victory $5 3 Victory.
6 Gold Common Treasure $6 3 Coins.
7 Province Common Victory $8 6 Victory.

246
dominion_tabs.py Normal file
View File

@ -0,0 +1,246 @@
import re,pprint
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import cm,inch
from reportlab.platypus import Frame,Paragraph
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
tabWidth = 9.1*cm
tabBaseHeight = 5.9*cm
tabLabelHeight = 0.9*cm
tabLabelWidth = 3.5*cm
tabTotalHeight = tabBaseHeight + tabLabelHeight
numTabsVertical = 3
numTabsHorizontal = 2
tabOutline = [(0,0,tabWidth,0),
(tabWidth,0,tabWidth,tabTotalHeight),
(tabWidth,tabTotalHeight,tabWidth-tabLabelWidth,tabTotalHeight),
(tabWidth-tabLabelWidth,tabTotalHeight,tabWidth-tabLabelWidth,tabBaseHeight),
(tabWidth-tabLabelWidth,tabBaseHeight,0,tabBaseHeight),
(0,tabBaseHeight,0,0)]
allTabsHeight = numTabsVertical*tabTotalHeight
allTabsWidth = numTabsHorizontal*tabWidth
horizontalMargin = (8.5*inch-allTabsWidth)/2
verticalMargin = (11*inch-allTabsHeight)/2
labelImages = {
('Action',) : 'action.png',
('Action','Attack') : 'action.png',
('Action','Reaction') : 'reaction.png',
('Action','Victory') : 'action-victory.png',
('Action','Duration') : 'duration.png',
('Reaction',) : 'reaction.png',
('Treasure',) : 'treasure.png',
('Treasure','Victory') : 'treasure-victory.png',
('Victory',) : 'victory.png',
('Curse',) : 'curse.png'
}
def drawTab(card,x,y,useExtra=False):
rightSide = x%2 == 1
c.resetTransforms()
c.translate(horizontalMargin,verticalMargin)
if useExtra:
c.translate(5,0)
c.translate(x*tabWidth,y*tabTotalHeight)
#draw outline
#don't draw outline on back, in case lines don't line up with front
if not useExtra:
c.saveState()
c.setLineWidth(0.1)
if rightSide:
c.translate(tabWidth,0)
c.scale(-1,1)
c.lines(tabOutline)
c.restoreState()
#draw tab flap
c.saveState()
if not rightSide:
c.translate(tabWidth-tabLabelWidth,tabTotalHeight-tabLabelHeight)
else:
c.translate(0,tabTotalHeight-tabLabelHeight)
c.drawImage(labelImages[card.types],1,0,
tabLabelWidth-2,tabLabelHeight-1,
preserveAspectRatio=False,anchor='n')
if card.types == ('Treasure',) or card.types == ('Curse',):
textHeight = tabLabelHeight/2-4
costHeight = textHeight
else:
textHeight = tabLabelHeight/2-7
costHeight = textHeight-1
c.setFont('MinionPro-Bold',12)
c.drawCentredString(12,costHeight,str(card.cost))
fontSize = 12
name = card.name.upper()
name_parts = name.split()
width = pdfmetrics.stringWidth(name,'MinionPro-Regular',fontSize)
while width > 85 and fontSize > 8:
fontSize -= 1
print 'decreasing font size for tab of',name,'now',fontSize
width = pdfmetrics.stringWidth(name,'MinionPro-Regular',fontSize)
#c.drawString(tabLabelWidth/2+8,tabLabelHeight/2-7,name[0])
w = 0
for n in name_parts:
c.setFont('MinionPro-Regular',fontSize)
c.drawString(22+w,textHeight,n[0])
w += pdfmetrics.stringWidth(n[0],'MinionPro-Regular',fontSize)
#c.drawString(tabLabelWidth/2+8+w,tabLabelHeight/2-7,name[1:])
c.setFont('MinionPro-Regular',fontSize-2)
c.drawString(22+w,textHeight,n[1:])
w += pdfmetrics.stringWidth(n[1:],'MinionPro-Regular',fontSize-2)
w += pdfmetrics.stringWidth(' ','MinionPro-Regular',fontSize)
c.restoreState()
#draw text
if useExtra and card.extra:
usingExtra = True
descriptions = (card.extra,)
else:
usingExtra = False
descriptions = re.split("--+",card.description)
height = 0
for d in descriptions:
if not usingExtra:
#d = re.sub(r"\n",";",d,flags=re.MULTILINE)
d = re.sub(r"([^ ;])\+",r"\1; +",d)
s = getSampleStyleSheet()['BodyText']
s.fontName = "Times-Roman"
p = Paragraph(d,s)
textHeight = tabTotalHeight - tabLabelHeight + 0.3*cm
textWidth = tabWidth - cm
w,h = p.wrap(textWidth,textHeight)
while h > textHeight:
s.fontSize -= 1
s.leading -= 1
print 'decreasing fontsize on description for',card.name,'now',s.fontSize
p = Paragraph(d,s)
w,h = p.wrap(textWidth,textHeight)
p.drawOn(c,cm/2.0,textHeight-height-h-0.5*cm)
height += h + 0.2*cm
class Card:
def __init__(self,name,cardset,types,cost,description,potcost=0):
self.name = name
self.cardset = cardset
self.types = types
self.cost = cost
self.potcost = potcost
self.description = description
self.extra = ""
def __repr__(self):
return '"' + self.name + '"'
def toString(self):
return self.name + ' ' + self.cardset + ' ' + '-'.join(self.types) + ' ' + `self.cost` + ' ' + self.description + ' ' + self.extra
def read_card_extras(fname,cards):
f = open(fname)
cardName = re.compile("^:::(?P<name>[ \w']*)")
extras = {}
currentCard = ""
extra = ""
for line in f:
m = cardName.match(line)
if m:
if currentCard:
#print 'found',currentCard
#print extra
#print '------------------'
extras[currentCard] = extra
currentCard = m.groupdict()["name"]
extra = ""
else:
extra += line
if currentCard and extra:
extras[currentCard] = extra
for c in cards:
if not c.name in extras:
print c.name + ' missing from extras'
else:
c.extra = extras[c.name]
#print c.name + ' ::: ' + extra
def read_card_defs(fname):
cards = []
f = open(fname)
carddef = re.compile("^\d+\t+(?P<name>[\w' ]+)\t+(?P<set>\w+)\t+(?P<type>[-\w ]+)\t+\$(?P<cost>\d+)( (?P<potioncost>\d)+P)?\t+(?P<description>.*)")
currentCard = None
for line in f:
m = carddef.match(line)
if m:
currentCard = Card(m.groupdict()["name"],
m.groupdict()["set"],
tuple([t.strip() for t in m.groupdict()["type"].split("-")]),
int(m.groupdict()["cost"]),
m.groupdict()["description"])
cards.append(currentCard)
elif line.strip():
if not currentCard.description.strip().endswith(';')\
and not currentCard.description.strip().endswith('.')\
and not currentCard.description.strip().endswith('---')\
and not line.startswith('---'):
#print currentCard.description
#print line
currentCard.description += '; ' + line
else:
currentCard.description += line
#print currentCard
#print '----'
return cards
def split(l,n):
i = 0
while i < len(l) - n:
yield l[i:i+n]
i += n
yield l[i:]
def drawCards(c,cards):
cards = split(cards,6)
for pageCards in cards:
#print 'pageCards:',pageCards
for i,card in enumerate(pageCards):
#print card
x = i % numTabsHorizontal
y = i / numTabsHorizontal
c.saveState()
drawTab(card,x,y)
c.restoreState()
c.showPage()
for i,card in enumerate(pageCards):
#print card
x = (i+1) % numTabsHorizontal
y = i / numTabsHorizontal
c.saveState()
drawTab(card,x,y,useExtra=True)
c.restoreState()
c.showPage()
if __name__=='__main__':
pdfmetrics.registerFont(TTFont('MinionPro-Regular','MinionPro-Regular.ttf'))
pdfmetrics.registerFont(TTFont('MinionPro-Bold','MinionPro-Bold.ttf'))
cards = read_card_defs("dominion_cards.txt")
extras = read_card_extras("dominion_card_extras.txt",cards)
print '%d cards read' % len(cards)
sets = {}
types = {}
for c in cards:
sets[c.cardset] = sets.get(c.cardset,0) + 1
types[c.types] = types.get(c.types,0) + 1
pprint.pprint(sets)
pprint.pprint(types)
c = canvas.Canvas("dominion_tabs.pdf", pagesize=letter)
#pprint.pprint(c.getAvailableFonts())
drawCards(c,cards)
c.save()

BIN
duration.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

BIN
img_sources/action.psd Normal file

Binary file not shown.

BIN
img_sources/curse.psd Normal file

Binary file not shown.

BIN
img_sources/duration.psd Normal file

Binary file not shown.

BIN
img_sources/label_scan1.psd Normal file

Binary file not shown.

BIN
img_sources/label_scan2.psd Normal file

Binary file not shown.

BIN
img_sources/reaction.psd Normal file

Binary file not shown.

Binary file not shown.

BIN
img_sources/treasure.psd Normal file

Binary file not shown.

BIN
img_sources/victory.psd Normal file

Binary file not shown.

BIN
reaction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
treasure-victory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
treasure.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
victory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB