first pass at Dark Ages; starting to add coins images to text instead of +x Coins; fix setup to include .txt files; bzr cleanup and additions
33
.bzrignore
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
dist
|
||||||
|
card_images
|
||||||
|
build
|
||||||
|
sumpfork_dominion_tabs_A4_v1.3.pdf
|
||||||
|
sumpfork_dominion_tabs_A4_v1.4.pdf
|
||||||
|
sumpfork_dominion_tabs_A4_v1.5.pdf
|
||||||
|
sumpfork_dominion_tabs_cornucopia.pdf
|
||||||
|
sumpfork_dominion_tabs_sameside_v1.1.pdf
|
||||||
|
sumpfork_dominion_tabs_sleeved_v1.3.pdf
|
||||||
|
sumpfork_dominion_tabs_sleeved_v1.4.pdf
|
||||||
|
sumpfork_dominion_tabs_sleeved_v1.5.pdf
|
||||||
|
sumpfork_dominion_tabs_v1.0.pdf
|
||||||
|
sumpfork_dominion_tabs_v1.1.pdf
|
||||||
|
sumpfork_dominion_tabs_v1.2.pdf
|
||||||
|
sumpfork_dominion_tabs_v1.3.pdf
|
||||||
|
sumpfork_dominion_tabs_v1.4.pdf
|
||||||
|
sumpfork_dominion_tabs_v1.5.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_A4_v1.3.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_A4_v1.5.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_sameside_v1.1.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_sleeved_v1.3.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_sleeved_v1.4.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_sleeved_v1.5.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_v1.1.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_v1.2.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_v1.3.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_v1.4.pdf
|
||||||
|
sumpfork_dominion_tabs_vertical_v1.5.pdf
|
||||||
|
fonts
|
||||||
|
old_images
|
||||||
|
sumpfork_dominion_tabs_v1.3.zip
|
||||||
|
sumpfork_dominion_tabs_v1.4.zip
|
||||||
|
sumpfork_dominion_tabs_v1.5.zip
|
||||||
3
MANIFEST.in
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
include dominion_cards.txt
|
||||||
|
include dominion_card_extras.txt
|
||||||
|
include *.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
#main package
|
#main package
|
||||||
|
|
||||||
__version__ = '1.5'
|
__version__ = '1.6'
|
||||||
|
|||||||
@ -1,485 +0,0 @@
|
|||||||
#!python
|
|
||||||
"""Bootstrap distribute installation
|
|
||||||
|
|
||||||
If you want to use setuptools in your package's setup.py, just include this
|
|
||||||
file in the same directory with it, and add this to the top of your setup.py::
|
|
||||||
|
|
||||||
from distribute_setup import use_setuptools
|
|
||||||
use_setuptools()
|
|
||||||
|
|
||||||
If you want to require a specific version of setuptools, set a download
|
|
||||||
mirror, or use an alternate download directory, you can do so by supplying
|
|
||||||
the appropriate options to ``use_setuptools()``.
|
|
||||||
|
|
||||||
This file can also be run as a script to install or upgrade setuptools.
|
|
||||||
"""
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
import fnmatch
|
|
||||||
import tempfile
|
|
||||||
import tarfile
|
|
||||||
from distutils import log
|
|
||||||
|
|
||||||
try:
|
|
||||||
from site import USER_SITE
|
|
||||||
except ImportError:
|
|
||||||
USER_SITE = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
def _python_cmd(*args):
|
|
||||||
args = (sys.executable,) + args
|
|
||||||
return subprocess.call(args) == 0
|
|
||||||
|
|
||||||
except ImportError:
|
|
||||||
# will be used for python 2.3
|
|
||||||
def _python_cmd(*args):
|
|
||||||
args = (sys.executable,) + args
|
|
||||||
# quoting arguments if windows
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
def quote(arg):
|
|
||||||
if ' ' in arg:
|
|
||||||
return '"%s"' % arg
|
|
||||||
return arg
|
|
||||||
args = [quote(arg) for arg in args]
|
|
||||||
return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
|
|
||||||
|
|
||||||
DEFAULT_VERSION = "0.6.14"
|
|
||||||
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
|
|
||||||
SETUPTOOLS_FAKED_VERSION = "0.6c11"
|
|
||||||
|
|
||||||
SETUPTOOLS_PKG_INFO = """\
|
|
||||||
Metadata-Version: 1.0
|
|
||||||
Name: setuptools
|
|
||||||
Version: %s
|
|
||||||
Summary: xxxx
|
|
||||||
Home-page: xxx
|
|
||||||
Author: xxx
|
|
||||||
Author-email: xxx
|
|
||||||
License: xxx
|
|
||||||
Description: xxx
|
|
||||||
""" % SETUPTOOLS_FAKED_VERSION
|
|
||||||
|
|
||||||
|
|
||||||
def _install(tarball):
|
|
||||||
# extracting the tarball
|
|
||||||
tmpdir = tempfile.mkdtemp()
|
|
||||||
log.warn('Extracting in %s', tmpdir)
|
|
||||||
old_wd = os.getcwd()
|
|
||||||
try:
|
|
||||||
os.chdir(tmpdir)
|
|
||||||
tar = tarfile.open(tarball)
|
|
||||||
_extractall(tar)
|
|
||||||
tar.close()
|
|
||||||
|
|
||||||
# going in the directory
|
|
||||||
subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
|
|
||||||
os.chdir(subdir)
|
|
||||||
log.warn('Now working in %s', subdir)
|
|
||||||
|
|
||||||
# installing
|
|
||||||
log.warn('Installing Distribute')
|
|
||||||
if not _python_cmd('setup.py', 'install'):
|
|
||||||
log.warn('Something went wrong during the installation.')
|
|
||||||
log.warn('See the error message above.')
|
|
||||||
finally:
|
|
||||||
os.chdir(old_wd)
|
|
||||||
|
|
||||||
|
|
||||||
def _build_egg(egg, tarball, to_dir):
|
|
||||||
# extracting the tarball
|
|
||||||
tmpdir = tempfile.mkdtemp()
|
|
||||||
log.warn('Extracting in %s', tmpdir)
|
|
||||||
old_wd = os.getcwd()
|
|
||||||
try:
|
|
||||||
os.chdir(tmpdir)
|
|
||||||
tar = tarfile.open(tarball)
|
|
||||||
_extractall(tar)
|
|
||||||
tar.close()
|
|
||||||
|
|
||||||
# going in the directory
|
|
||||||
subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
|
|
||||||
os.chdir(subdir)
|
|
||||||
log.warn('Now working in %s', subdir)
|
|
||||||
|
|
||||||
# building an egg
|
|
||||||
log.warn('Building a Distribute egg in %s', to_dir)
|
|
||||||
_python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
|
|
||||||
|
|
||||||
finally:
|
|
||||||
os.chdir(old_wd)
|
|
||||||
# returning the result
|
|
||||||
log.warn(egg)
|
|
||||||
if not os.path.exists(egg):
|
|
||||||
raise IOError('Could not build the egg.')
|
|
||||||
|
|
||||||
|
|
||||||
def _do_download(version, download_base, to_dir, download_delay):
|
|
||||||
egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
|
|
||||||
% (version, sys.version_info[0], sys.version_info[1]))
|
|
||||||
if not os.path.exists(egg):
|
|
||||||
tarball = download_setuptools(version, download_base,
|
|
||||||
to_dir, download_delay)
|
|
||||||
_build_egg(egg, tarball, to_dir)
|
|
||||||
sys.path.insert(0, egg)
|
|
||||||
import setuptools
|
|
||||||
setuptools.bootstrap_install_from = egg
|
|
||||||
|
|
||||||
|
|
||||||
def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
|
|
||||||
to_dir=os.curdir, download_delay=15, no_fake=True):
|
|
||||||
# making sure we use the absolute path
|
|
||||||
to_dir = os.path.abspath(to_dir)
|
|
||||||
was_imported = 'pkg_resources' in sys.modules or \
|
|
||||||
'setuptools' in sys.modules
|
|
||||||
try:
|
|
||||||
try:
|
|
||||||
import pkg_resources
|
|
||||||
if not hasattr(pkg_resources, '_distribute'):
|
|
||||||
if not no_fake:
|
|
||||||
_fake_setuptools()
|
|
||||||
raise ImportError
|
|
||||||
except ImportError:
|
|
||||||
return _do_download(version, download_base, to_dir, download_delay)
|
|
||||||
try:
|
|
||||||
pkg_resources.require("distribute>="+version)
|
|
||||||
return
|
|
||||||
except pkg_resources.VersionConflict:
|
|
||||||
e = sys.exc_info()[1]
|
|
||||||
if was_imported:
|
|
||||||
sys.stderr.write(
|
|
||||||
"The required version of distribute (>=%s) is not available,\n"
|
|
||||||
"and can't be installed while this script is running. Please\n"
|
|
||||||
"install a more recent version first, using\n"
|
|
||||||
"'easy_install -U distribute'."
|
|
||||||
"\n\n(Currently using %r)\n" % (version, e.args[0]))
|
|
||||||
sys.exit(2)
|
|
||||||
else:
|
|
||||||
del pkg_resources, sys.modules['pkg_resources'] # reload ok
|
|
||||||
return _do_download(version, download_base, to_dir,
|
|
||||||
download_delay)
|
|
||||||
except pkg_resources.DistributionNotFound:
|
|
||||||
return _do_download(version, download_base, to_dir,
|
|
||||||
download_delay)
|
|
||||||
finally:
|
|
||||||
if not no_fake:
|
|
||||||
_create_fake_setuptools_pkg_info(to_dir)
|
|
||||||
|
|
||||||
def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
|
|
||||||
to_dir=os.curdir, delay=15):
|
|
||||||
"""Download distribute from a specified location and return its filename
|
|
||||||
|
|
||||||
`version` should be a valid distribute version number that is available
|
|
||||||
as an egg for download under the `download_base` URL (which should end
|
|
||||||
with a '/'). `to_dir` is the directory where the egg will be downloaded.
|
|
||||||
`delay` is the number of seconds to pause before an actual download
|
|
||||||
attempt.
|
|
||||||
"""
|
|
||||||
# making sure we use the absolute path
|
|
||||||
to_dir = os.path.abspath(to_dir)
|
|
||||||
try:
|
|
||||||
from urllib.request import urlopen
|
|
||||||
except ImportError:
|
|
||||||
from urllib2 import urlopen
|
|
||||||
tgz_name = "distribute-%s.tar.gz" % version
|
|
||||||
url = download_base + tgz_name
|
|
||||||
saveto = os.path.join(to_dir, tgz_name)
|
|
||||||
src = dst = None
|
|
||||||
if not os.path.exists(saveto): # Avoid repeated downloads
|
|
||||||
try:
|
|
||||||
log.warn("Downloading %s", url)
|
|
||||||
src = urlopen(url)
|
|
||||||
# Read/write all in one block, so we don't create a corrupt file
|
|
||||||
# if the download is interrupted.
|
|
||||||
data = src.read()
|
|
||||||
dst = open(saveto, "wb")
|
|
||||||
dst.write(data)
|
|
||||||
finally:
|
|
||||||
if src:
|
|
||||||
src.close()
|
|
||||||
if dst:
|
|
||||||
dst.close()
|
|
||||||
return os.path.realpath(saveto)
|
|
||||||
|
|
||||||
def _no_sandbox(function):
|
|
||||||
def __no_sandbox(*args, **kw):
|
|
||||||
try:
|
|
||||||
from setuptools.sandbox import DirectorySandbox
|
|
||||||
if not hasattr(DirectorySandbox, '_old'):
|
|
||||||
def violation(*args):
|
|
||||||
pass
|
|
||||||
DirectorySandbox._old = DirectorySandbox._violation
|
|
||||||
DirectorySandbox._violation = violation
|
|
||||||
patched = True
|
|
||||||
else:
|
|
||||||
patched = False
|
|
||||||
except ImportError:
|
|
||||||
patched = False
|
|
||||||
|
|
||||||
try:
|
|
||||||
return function(*args, **kw)
|
|
||||||
finally:
|
|
||||||
if patched:
|
|
||||||
DirectorySandbox._violation = DirectorySandbox._old
|
|
||||||
del DirectorySandbox._old
|
|
||||||
|
|
||||||
return __no_sandbox
|
|
||||||
|
|
||||||
def _patch_file(path, content):
|
|
||||||
"""Will backup the file then patch it"""
|
|
||||||
existing_content = open(path).read()
|
|
||||||
if existing_content == content:
|
|
||||||
# already patched
|
|
||||||
log.warn('Already patched.')
|
|
||||||
return False
|
|
||||||
log.warn('Patching...')
|
|
||||||
_rename_path(path)
|
|
||||||
f = open(path, 'w')
|
|
||||||
try:
|
|
||||||
f.write(content)
|
|
||||||
finally:
|
|
||||||
f.close()
|
|
||||||
return True
|
|
||||||
|
|
||||||
_patch_file = _no_sandbox(_patch_file)
|
|
||||||
|
|
||||||
def _same_content(path, content):
|
|
||||||
return open(path).read() == content
|
|
||||||
|
|
||||||
def _rename_path(path):
|
|
||||||
new_name = path + '.OLD.%s' % time.time()
|
|
||||||
log.warn('Renaming %s into %s', path, new_name)
|
|
||||||
os.rename(path, new_name)
|
|
||||||
return new_name
|
|
||||||
|
|
||||||
def _remove_flat_installation(placeholder):
|
|
||||||
if not os.path.isdir(placeholder):
|
|
||||||
log.warn('Unkown installation at %s', placeholder)
|
|
||||||
return False
|
|
||||||
found = False
|
|
||||||
for file in os.listdir(placeholder):
|
|
||||||
if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
|
|
||||||
found = True
|
|
||||||
break
|
|
||||||
if not found:
|
|
||||||
log.warn('Could not locate setuptools*.egg-info')
|
|
||||||
return
|
|
||||||
|
|
||||||
log.warn('Removing elements out of the way...')
|
|
||||||
pkg_info = os.path.join(placeholder, file)
|
|
||||||
if os.path.isdir(pkg_info):
|
|
||||||
patched = _patch_egg_dir(pkg_info)
|
|
||||||
else:
|
|
||||||
patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
|
|
||||||
|
|
||||||
if not patched:
|
|
||||||
log.warn('%s already patched.', pkg_info)
|
|
||||||
return False
|
|
||||||
# now let's move the files out of the way
|
|
||||||
for element in ('setuptools', 'pkg_resources.py', 'site.py'):
|
|
||||||
element = os.path.join(placeholder, element)
|
|
||||||
if os.path.exists(element):
|
|
||||||
_rename_path(element)
|
|
||||||
else:
|
|
||||||
log.warn('Could not find the %s element of the '
|
|
||||||
'Setuptools distribution', element)
|
|
||||||
return True
|
|
||||||
|
|
||||||
_remove_flat_installation = _no_sandbox(_remove_flat_installation)
|
|
||||||
|
|
||||||
def _after_install(dist):
|
|
||||||
log.warn('After install bootstrap.')
|
|
||||||
placeholder = dist.get_command_obj('install').install_purelib
|
|
||||||
_create_fake_setuptools_pkg_info(placeholder)
|
|
||||||
|
|
||||||
def _create_fake_setuptools_pkg_info(placeholder):
|
|
||||||
if not placeholder or not os.path.exists(placeholder):
|
|
||||||
log.warn('Could not find the install location')
|
|
||||||
return
|
|
||||||
pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
|
|
||||||
setuptools_file = 'setuptools-%s-py%s.egg-info' % \
|
|
||||||
(SETUPTOOLS_FAKED_VERSION, pyver)
|
|
||||||
pkg_info = os.path.join(placeholder, setuptools_file)
|
|
||||||
if os.path.exists(pkg_info):
|
|
||||||
log.warn('%s already exists', pkg_info)
|
|
||||||
return
|
|
||||||
|
|
||||||
log.warn('Creating %s', pkg_info)
|
|
||||||
f = open(pkg_info, 'w')
|
|
||||||
try:
|
|
||||||
f.write(SETUPTOOLS_PKG_INFO)
|
|
||||||
finally:
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
pth_file = os.path.join(placeholder, 'setuptools.pth')
|
|
||||||
log.warn('Creating %s', pth_file)
|
|
||||||
f = open(pth_file, 'w')
|
|
||||||
try:
|
|
||||||
f.write(os.path.join(os.curdir, setuptools_file))
|
|
||||||
finally:
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
|
|
||||||
|
|
||||||
def _patch_egg_dir(path):
|
|
||||||
# let's check if it's already patched
|
|
||||||
pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
|
|
||||||
if os.path.exists(pkg_info):
|
|
||||||
if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
|
|
||||||
log.warn('%s already patched.', pkg_info)
|
|
||||||
return False
|
|
||||||
_rename_path(path)
|
|
||||||
os.mkdir(path)
|
|
||||||
os.mkdir(os.path.join(path, 'EGG-INFO'))
|
|
||||||
pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
|
|
||||||
f = open(pkg_info, 'w')
|
|
||||||
try:
|
|
||||||
f.write(SETUPTOOLS_PKG_INFO)
|
|
||||||
finally:
|
|
||||||
f.close()
|
|
||||||
return True
|
|
||||||
|
|
||||||
_patch_egg_dir = _no_sandbox(_patch_egg_dir)
|
|
||||||
|
|
||||||
def _before_install():
|
|
||||||
log.warn('Before install bootstrap.')
|
|
||||||
_fake_setuptools()
|
|
||||||
|
|
||||||
|
|
||||||
def _under_prefix(location):
|
|
||||||
if 'install' not in sys.argv:
|
|
||||||
return True
|
|
||||||
args = sys.argv[sys.argv.index('install')+1:]
|
|
||||||
for index, arg in enumerate(args):
|
|
||||||
for option in ('--root', '--prefix'):
|
|
||||||
if arg.startswith('%s=' % option):
|
|
||||||
top_dir = arg.split('root=')[-1]
|
|
||||||
return location.startswith(top_dir)
|
|
||||||
elif arg == option:
|
|
||||||
if len(args) > index:
|
|
||||||
top_dir = args[index+1]
|
|
||||||
return location.startswith(top_dir)
|
|
||||||
if arg == '--user' and USER_SITE is not None:
|
|
||||||
return location.startswith(USER_SITE)
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def _fake_setuptools():
|
|
||||||
log.warn('Scanning installed packages')
|
|
||||||
try:
|
|
||||||
import pkg_resources
|
|
||||||
except ImportError:
|
|
||||||
# we're cool
|
|
||||||
log.warn('Setuptools or Distribute does not seem to be installed.')
|
|
||||||
return
|
|
||||||
ws = pkg_resources.working_set
|
|
||||||
try:
|
|
||||||
setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
|
|
||||||
replacement=False))
|
|
||||||
except TypeError:
|
|
||||||
# old distribute API
|
|
||||||
setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
|
|
||||||
|
|
||||||
if setuptools_dist is None:
|
|
||||||
log.warn('No setuptools distribution found')
|
|
||||||
return
|
|
||||||
# detecting if it was already faked
|
|
||||||
setuptools_location = setuptools_dist.location
|
|
||||||
log.warn('Setuptools installation detected at %s', setuptools_location)
|
|
||||||
|
|
||||||
# if --root or --preix was provided, and if
|
|
||||||
# setuptools is not located in them, we don't patch it
|
|
||||||
if not _under_prefix(setuptools_location):
|
|
||||||
log.warn('Not patching, --root or --prefix is installing Distribute'
|
|
||||||
' in another location')
|
|
||||||
return
|
|
||||||
|
|
||||||
# let's see if its an egg
|
|
||||||
if not setuptools_location.endswith('.egg'):
|
|
||||||
log.warn('Non-egg installation')
|
|
||||||
res = _remove_flat_installation(setuptools_location)
|
|
||||||
if not res:
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
log.warn('Egg installation')
|
|
||||||
pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
|
|
||||||
if (os.path.exists(pkg_info) and
|
|
||||||
_same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
|
|
||||||
log.warn('Already patched.')
|
|
||||||
return
|
|
||||||
log.warn('Patching...')
|
|
||||||
# let's create a fake egg replacing setuptools one
|
|
||||||
res = _patch_egg_dir(setuptools_location)
|
|
||||||
if not res:
|
|
||||||
return
|
|
||||||
log.warn('Patched done.')
|
|
||||||
_relaunch()
|
|
||||||
|
|
||||||
|
|
||||||
def _relaunch():
|
|
||||||
log.warn('Relaunching...')
|
|
||||||
# we have to relaunch the process
|
|
||||||
# pip marker to avoid a relaunch bug
|
|
||||||
if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
|
|
||||||
sys.argv[0] = 'setup.py'
|
|
||||||
args = [sys.executable] + sys.argv
|
|
||||||
sys.exit(subprocess.call(args))
|
|
||||||
|
|
||||||
|
|
||||||
def _extractall(self, path=".", members=None):
|
|
||||||
"""Extract all members from the archive to the current working
|
|
||||||
directory and set owner, modification time and permissions on
|
|
||||||
directories afterwards. `path' specifies a different directory
|
|
||||||
to extract to. `members' is optional and must be a subset of the
|
|
||||||
list returned by getmembers().
|
|
||||||
"""
|
|
||||||
import copy
|
|
||||||
import operator
|
|
||||||
from tarfile import ExtractError
|
|
||||||
directories = []
|
|
||||||
|
|
||||||
if members is None:
|
|
||||||
members = self
|
|
||||||
|
|
||||||
for tarinfo in members:
|
|
||||||
if tarinfo.isdir():
|
|
||||||
# Extract directories with a safe mode.
|
|
||||||
directories.append(tarinfo)
|
|
||||||
tarinfo = copy.copy(tarinfo)
|
|
||||||
tarinfo.mode = 448 # decimal for oct 0700
|
|
||||||
self.extract(tarinfo, path)
|
|
||||||
|
|
||||||
# Reverse sort directories.
|
|
||||||
if sys.version_info < (2, 4):
|
|
||||||
def sorter(dir1, dir2):
|
|
||||||
return cmp(dir1.name, dir2.name)
|
|
||||||
directories.sort(sorter)
|
|
||||||
directories.reverse()
|
|
||||||
else:
|
|
||||||
directories.sort(key=operator.attrgetter('name'), reverse=True)
|
|
||||||
|
|
||||||
# Set correct owner, mtime and filemode on directories.
|
|
||||||
for tarinfo in directories:
|
|
||||||
dirpath = os.path.join(path, tarinfo.name)
|
|
||||||
try:
|
|
||||||
self.chown(tarinfo, dirpath)
|
|
||||||
self.utime(tarinfo, dirpath)
|
|
||||||
self.chmod(tarinfo, dirpath)
|
|
||||||
except ExtractError:
|
|
||||||
e = sys.exc_info()[1]
|
|
||||||
if self.errorlevel > 1:
|
|
||||||
raise
|
|
||||||
else:
|
|
||||||
self._dbg(1, "tarfile: %s" % e)
|
|
||||||
|
|
||||||
|
|
||||||
def main(argv, version=DEFAULT_VERSION):
|
|
||||||
"""Install or upgrade setuptools and EasyInstall"""
|
|
||||||
tarball = download_setuptools()
|
|
||||||
_install(tarball)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main(sys.argv[1:])
|
|
||||||
@ -1424,3 +1424,436 @@ When you play Young Witch, after you draw 2 cards and discard 2 cards, each othe
|
|||||||
:::Border Village:
|
:::Border Village:
|
||||||
:::Farmland:
|
:::Farmland:
|
||||||
|
|
||||||
|
:::Altar
|
||||||
|
You trash a card from your hand if you can, and then gain a
|
||||||
|
card whether or not you trashed one. The gained card comes from
|
||||||
|
the Supply and is put into your discard pile.
|
||||||
|
:::Armory
|
||||||
|
The card you gain comes from the Supply and is put on
|
||||||
|
top of your deck.
|
||||||
|
:::Band of Misfits
|
||||||
|
When you play this, you pick an Action card from
|
||||||
|
the Supply that costs less than it, and treat this card as if it were
|
||||||
|
the card you chose. Normally this will just mean that you follow
|
||||||
|
the instructions on the card you picked. So, if you play Band of
|
||||||
|
Misfits and Fortress is in the Supply, you could pick that and then
|
||||||
|
you would draw a card and get +2 Actions, since that is what
|
||||||
|
Fortress does when you play it. Band of Misfits also gets the
|
||||||
|
chosen card's cost, name, and types. If you use Band of Misfits as
|
||||||
|
a card that trashes itself, such as Death Cart, you will trash the
|
||||||
|
Band of Misfits (at which point it will just be a Band of Misfits
|
||||||
|
card in the trash). If you use Band of Misfits as a duration card
|
||||||
|
(from Seaside), Band of Misfits will stay in play until next turn,
|
||||||
|
just like the duration card would. If you use Band of Misfits as a
|
||||||
|
Throne Room (from Dominion), King's Court (from Prosperity),
|
||||||
|
or Procession, and use that effect to play a duration card, Band of
|
||||||
|
Misfits will similarly stay in play. If you use Throne Room, King's
|
||||||
|
Court, or Procession to play a Band of Misfits card multiple times,
|
||||||
|
you only pick what to play it as the first time; the other times it is
|
||||||
|
still copying the same card. For example, if you use Procession to
|
||||||
|
play Band of Misfits twice and choose Fortress the first time, you
|
||||||
|
will automatically replay it as Fortress, then trash the Band of
|
||||||
|
Misfits, return it to your hand (it is a Fortress when it's trashed,
|
||||||
|
and Fortress has a when-trashed ability that returns it to your
|
||||||
|
hand), and gain an Action card costing exactly 6 Coins(1 Coin more than
|
||||||
|
Band of Misfits, which has left play and so is no longer copying
|
||||||
|
Fortress). If you use Band of Misfits as a card that does something
|
||||||
|
during Clean-up, such as Hermit, it will do that thing during
|
||||||
|
Clean-up. When you play Horn of Plenty (from Cornucopia), it
|
||||||
|
counts Band of Misfits as whatever Band of Misfits was played as;
|
||||||
|
for example if you play a Band of Misfits as a Fortress, and then
|
||||||
|
play another Band of Misfits as a Scavenger, and then play Horn
|
||||||
|
of Plenty, you will gain a card costing up to 3 Coins. Band of Misfits can
|
||||||
|
only be played as a card that is visible in the Supply; it cannot be
|
||||||
|
played as a card after its pile runs out, and cannot be played as a
|
||||||
|
non-Supply card like Mercenary; it can be played as the top card
|
||||||
|
of the Ruins pile, but no other Ruins, and can only be played as Sir
|
||||||
|
Martin when that is the top card of the Knights pile
|
||||||
|
:::Bandit Camp
|
||||||
|
Draw a card before gaining a Spoils. The Spoils
|
||||||
|
comes from the Spoils pile, which is not part of the Supply, and is
|
||||||
|
put into your discard pile. If there are no Spoils cards left, you do
|
||||||
|
not get one.
|
||||||
|
:::Beggar
|
||||||
|
When you play this, you gain three Coppers from the
|
||||||
|
Supply, putting them into your hand. If there are not three
|
||||||
|
Coppers left, just gain as many as you can. When another player
|
||||||
|
plays an Attack card, you may discard this from your hand. If you
|
||||||
|
do, you gain two Silvers from the Supply, putting one on your deck
|
||||||
|
and the other into your discard pile. If there is only one Silver left,
|
||||||
|
put it on your deck; if there are no Silvers left, you do not gain any.
|
||||||
|
:::Catacombs
|
||||||
|
When you play this, you look at the top 3 cards of
|
||||||
|
your deck, and either put all 3 into your hand, or discard all 3 and
|
||||||
|
draw the next 3 cards. If you discard them and have to shuffle to
|
||||||
|
draw 3 cards, you will shuffle in the cards you discarded and may
|
||||||
|
end up drawing some of them. When you trash Catacombs, you
|
||||||
|
gain a card costing less than it. This happens whether Catacombs
|
||||||
|
is trashed on your turn or someone else's, and no matter who has
|
||||||
|
the card that trashed it. The gained card comes from the Supply
|
||||||
|
and is put into your discard pile.
|
||||||
|
:::Count
|
||||||
|
This card gives you two separate choices: first you either
|
||||||
|
discard 2 cards, put a card from your hand on top of your deck, or
|
||||||
|
gain a Copper; after resolving that, you either get + Coins, trash your
|
||||||
|
hand, or gain a Duchy. For example, you might choose to discard
|
||||||
|
2 cards, then gain a Duchy. Gained cards come from the Supply
|
||||||
|
and are put into your discard pile. You can choose an option even
|
||||||
|
if you cannot do it. If you trash multiple cards that do something
|
||||||
|
when trashed at once, trash them all, then choose an order to
|
||||||
|
resolve the things that happen due to them being trashed.
|
||||||
|
:::Ruins
|
||||||
|
See Additional Rules for Dark Ages and Preparation.
|
||||||
|
Abandoned Mine: When you play this, you just get +1 Coin.
|
||||||
|
Ruined Library: When you play this, you draw a card.
|
||||||
|
Ruined Market: When you play this, you just get +1 Buy.
|
||||||
|
Ruined Village: When you play this, you just get +1 Action.
|
||||||
|
Survivors: You either discard both cards, or put both cards back on
|
||||||
|
top; you cannot just discard one card.
|
||||||
|
:::Counterfeit
|
||||||
|
This is a Treasure worth 1 Coin. You play it in your Buy
|
||||||
|
phase, like other Treasures. When you play it, you also get +1 Buy,
|
||||||
|
and you may play an additional Treasure card from your hand
|
||||||
|
twice. If you choose to do that, you trash that Treasure. You still
|
||||||
|
get any coins that Treasure gave you from playing it, despite
|
||||||
|
trashing it. If you use Counterfeit to play Spoils twice, you will get
|
||||||
|
+ 6 Coins, (in addition to the 1 Coin, from Counterfeit) and return Spoils to
|
||||||
|
the Spoils pile; you will be unable to trash it. If you use
|
||||||
|
Counterfeit to play a Treasure that does something special when
|
||||||
|
you play it, you will do that thing twice. Cards with two types, one
|
||||||
|
of which is Treasure (such as Harem from Intrigue) are Treasures
|
||||||
|
and so can be played via Counterfeit.
|
||||||
|
:::Cultist
|
||||||
|
When you play this, you draw two cards, then each other
|
||||||
|
player gains a Ruins. These come from the Ruins pile in the Supply,
|
||||||
|
and are put into discard piles. Go in turn order starting to your
|
||||||
|
left; each player takes the top Ruins, revealing the next one each
|
||||||
|
time. If the Ruins pile runs out, players stop gaining them at that
|
||||||
|
point. After giving out Ruins, you may play another Cultist from
|
||||||
|
your hand. It can be one you just drew from playing Cultist, or
|
||||||
|
one you already had in your hand. Playing a Cultist this way does
|
||||||
|
not use up any extra Actions you were allowed to play due to cards
|
||||||
|
like Fortress - the original Cultist uses up one Action and that is it.
|
||||||
|
When you trash a Cultist of yours, you draw three cards. This
|
||||||
|
happens whether or not it is your turn, and whether or not the
|
||||||
|
card that causes Cultist to be trashed was yours. If you trash a
|
||||||
|
Cultist while revealing cards, such as to a Knight attack, you do not
|
||||||
|
draw the revealed cards that are about to be discarded.
|
||||||
|
:::Death Cart
|
||||||
|
When you play Death Cart, you get + 5 Coins, and either
|
||||||
|
trash an Action card from your hand, or trash the Death Cart. If
|
||||||
|
you have no Action card in your hand, you will have to trash the
|
||||||
|
Death Cart, but you can trash the Death Cart whether or not you
|
||||||
|
have an Action card in hand. A card with multiple types, one of
|
||||||
|
which is Action, is an Action card. When you gain a Death Cart,
|
||||||
|
either from buying it or from gaining it some other way, you also
|
||||||
|
gain 2 Ruins. You just take the top 2, whatever they are. If there
|
||||||
|
are not enough Ruins left, take as many as you can. The Ruins
|
||||||
|
come from the Supply and are put into your discard pile. The
|
||||||
|
other players get to see which ones you got. The player gaining
|
||||||
|
Death Cart is the one who gains Ruins; if Possession (from
|
||||||
|
Alchemy) is used to make another player buy Death Cart, the
|
||||||
|
player actually gaining the Death Cart (the one who played
|
||||||
|
Possession) gains the Ruins. If you use Trader (from Hinterlands)
|
||||||
|
to take a Silver instead of a Death Cart, you do not gain any Ruins.
|
||||||
|
It doesn't matter whose turn it is; if you use Ambassador (from
|
||||||
|
Seaside) to give Death Carts to each other player, those players
|
||||||
|
also gain Ruins. Passing cards with Masquerade (from Intrigue)
|
||||||
|
does not count as gaining them.
|
||||||
|
:::Feodum
|
||||||
|
This is a Victory card. Play with 8 for games with 2
|
||||||
|
players, or 12 cards for games with 3 or more players. At the end
|
||||||
|
of the game, each Feodum is worth 1 Victory for every 3 Silvers in your
|
||||||
|
deck, rounded down. For example, if you have 11 Silvers, your
|
||||||
|
Feodums are worth 3 Victory each. If a Feodum is trashed, you gain 3
|
||||||
|
Silvers. The Silvers come from the Supply and are put into your
|
||||||
|
discard pile. If there are not enough Silvers left, gain as many as
|
||||||
|
you can.
|
||||||
|
:::Forager
|
||||||
|
Trash a card from your hand if you can. Whether or not
|
||||||
|
you can, you still get +1 Coin er differently named Treasure in the
|
||||||
|
trash, plus +1 Action and +1 Buy. Multiple copies of the same
|
||||||
|
Treasure card do not increase how much you get. For example, if
|
||||||
|
the trash has four Coppers, a Counterfeit, and six Estates, you get
|
||||||
|
+2 Coins. Cards with multiple types, one of which is Treasure (such as
|
||||||
|
Harem from Intrigue), are Treasures.
|
||||||
|
:::Fortress
|
||||||
|
When you play this, you draw a card and get +2 Actions.
|
||||||
|
If this is trashed, you take it from the trash and put it into your
|
||||||
|
hand. This happens no matter whose turn it is when Fortress is
|
||||||
|
trashed. It is not optional. You still trashed Fortress, even though
|
||||||
|
you get it back; for example if you play Death Cart and choose to
|
||||||
|
trash Fortress, the "if you do" on Death Cart is true, you did trash
|
||||||
|
an Action, so you do not trash Death Cart.
|
||||||
|
:::Graverobber
|
||||||
|
You choose either option, then do as much of it as
|
||||||
|
you can; you can choose an option even if you will not be able to
|
||||||
|
do it. You can look through the trash at any time. If you choose to
|
||||||
|
gain a card from the trash, the other players get to see what it is,
|
||||||
|
and it goes on top of your deck. If there were no cards in your
|
||||||
|
deck, it becomes the only card in your deck. If there is no card in
|
||||||
|
the trash costing from 3 Coins to 6 Coins, you will fail to gain one. Cards
|
||||||
|
with Potion in the cost (from Alchemy) do not cost from 3 Coins to 6 Coins. If
|
||||||
|
you choose to trash an Action card from your hand, the card you
|
||||||
|
gain comes from the Supply and is put into your discard pile.
|
||||||
|
:::Hermit
|
||||||
|
When you play this, look through your discard pile, and
|
||||||
|
then you may choose to trash a card that is not a Treasure, from
|
||||||
|
either your hand or your discard pile. You do not have to trash a
|
||||||
|
card and cannot trash Treasures. A card with multiple types, one
|
||||||
|
of which is Treasure (such as Harem from Intrigue), is a Treasure.
|
||||||
|
After trashing or not, you gain a card costing up to 3 Coins. The card
|
||||||
|
you gain comes from the Supply and is put into your discard pile.
|
||||||
|
Gaining a card is mandatory if it is possible. Then, when you
|
||||||
|
discard Hermit from play - normally, in Clean-up, after playing it
|
||||||
|
in your Action phase - if you did not buy any cards this turn, you
|
||||||
|
trash Hermit and gain a Madman. The Madman comes from the
|
||||||
|
Madman pile, which is not in the Supply, and is put into your
|
||||||
|
discard pile. It does not matter whether or not you gained cards
|
||||||
|
other ways, only whether or not you bought a card. If there are no
|
||||||
|
Madman cards left, you do not gain one. If Hermit is not
|
||||||
|
discarded from play during Clean-up - for example, if you put it
|
||||||
|
on your deck with Scheme (from Hinterlands) - then the ability
|
||||||
|
that trashes it will not trigger.
|
||||||
|
:::Hovel
|
||||||
|
This is a Shelter; see Preparation. It is never in the Supply.
|
||||||
|
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.
|
||||||
|
:::Hunting Grounds
|
||||||
|
When you play this, draw 4 cards. If this is
|
||||||
|
trashed, you either gain a Duchy or 3 Estates, your choice. These
|
||||||
|
cards come from the Supply and are put into your discard pile. If
|
||||||
|
you choose the 3 Estates and there are not 3 left, just gain as many
|
||||||
|
as you can.
|
||||||
|
:::Ironmonger
|
||||||
|
First you draw a card, then you reveal the top card of
|
||||||
|
your deck, then you either discard that card or put it back on top
|
||||||
|
of your deck. Then you get bonuses based on the types of the card
|
||||||
|
you revealed. A card with 2 types gives you both bonuses; for
|
||||||
|
example, if you revealed Harem (from Intrigue), you would both
|
||||||
|
draw a card and get +1 Coins.
|
||||||
|
:::Junk Dealer
|
||||||
|
You have to trash a card from your hand if you can.
|
||||||
|
You draw before trashing.
|
||||||
|
:::Knights
|
||||||
|
The ability Knights have in common is that each other player reveals the top 2 cards of his deck, trashes one of them that he chooses that costs from 3 Coins to 6 Coins, and discards the rest; then, if a Knight was trashed, you trash the Knight you played that caused this trashing. Resolve this ability in turn order, starting with the player to your left. Cards with Potion in the cost (from Alchemy) do not cost from 3 Coins to 6 Coins. The player losing a card only gets a choice if both cards revealed cost from 3 Coins to 6 Coins; if they both do and one is a Knight but the player picks the other card, that will not cause the played Knight to be trashed.
|
||||||
|
|
||||||
|
When Sir Martin is the top card of the pile, it can be gained with
|
||||||
|
an Armory and so on. If Sir Vander is trashed, you gain a Gold; this
|
||||||
|
happens whether it is trashed on your turn or someone else's. The
|
||||||
|
player who had Sir Vander is the one who gains the Gold,
|
||||||
|
regardless of who played the card that trashed it. The Gold from
|
||||||
|
Sir Vander, and the card gained for Dame Natalie, comes from the
|
||||||
|
Supply and is put into your discard pile.
|
||||||
|
When playing Dame Anna, you may choose to trash zero, one, or
|
||||||
|
two cards from your hand. Dame Josephine is also a Victory card,
|
||||||
|
worth 2 Victory at the end of the game. The Knight pile is not a Victory
|
||||||
|
pile though, and does not get a counter for Trade Route (from
|
||||||
|
Prosperity) even if Dame Josephine starts on top. If you choose to
|
||||||
|
use the Knights with Black Market (a promotional card), put a
|
||||||
|
Knight directly into the Black Market deck, rather than using the
|
||||||
|
randomizer card. Sir Martin only costs 4 Coins, though the other
|
||||||
|
Knights all cost 5 Coins.
|
||||||
|
:::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.
|
||||||
|
:::Marauder
|
||||||
|
First you gain a Spoils. It comes from the Spoils pile,
|
||||||
|
which is not part of the Supply, and is put into your discard pile.
|
||||||
|
If there are no Spoils cards left, you do not get one. Then each
|
||||||
|
other player gains a Ruins. These come from the Ruins pile in the
|
||||||
|
Supply, and are put into discard piles. Go in turn order starting to
|
||||||
|
your left; each player takes the top Ruins, revealing the next one
|
||||||
|
each time. If the Ruins pile runs out, players stop gaining them at
|
||||||
|
that point.
|
||||||
|
:::Market Square
|
||||||
|
When you play this, you draw a card and get +1
|
||||||
|
Action and +1 Buy. When one of your cards is trashed, you may
|
||||||
|
discard Market Square from your hand. If you do, you gain a Gold.
|
||||||
|
The Gold comes from the Supply and is put into your discard pile.
|
||||||
|
If there is no Gold left in the Supply, you do not gain one. You may
|
||||||
|
discard multiple Market Squares when a single card of yours is
|
||||||
|
trashed.
|
||||||
|
:::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.
|
||||||
|
:::Mystic
|
||||||
|
You get +1 Action and +2 Coins. Then name a card ("Copper,"
|
||||||
|
for example - not "Treasure") and reveal the top card of your deck;
|
||||||
|
if you named the same card you revealed, put the revealed card
|
||||||
|
into your hand. If you do not name the right card, put the
|
||||||
|
revealed card back on top. You do not need to name a card being
|
||||||
|
used this game. Names need to match exactly for you to get the
|
||||||
|
card; for example Sir Destry and Sir Martin do not match. You do
|
||||||
|
not need to name a card available in the Supply.
|
||||||
|
:::Necropolis
|
||||||
|
This is a Shelter; see Preparation. It is never in the
|
||||||
|
Supply. It is an Action card; when you play it, you get +2 Actions.
|
||||||
|
:::Overgrown Estate
|
||||||
|
This is a Shelter; see Preparation. It is never in
|
||||||
|
the Supply. 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.
|
||||||
|
:::Pillage
|
||||||
|
First trash Pillage. Then each other player with 5 or more
|
||||||
|
cards in hand reveals his hand and discards a card of your choice.
|
||||||
|
This happens in turn order, starting with the player to your left.
|
||||||
|
Then you gain two Spoils cards. The two Spoils cards come from
|
||||||
|
the Spoils pile, which is not part of the Supply, and are put into
|
||||||
|
your discard pile. If there are no Spoils cards left, you do not get
|
||||||
|
one; if there is only one, you just get one.
|
||||||
|
:::Poor House
|
||||||
|
First you get +4 Coins. Then you reveal your hand, and lose 1 Coin
|
||||||
|
per Treasure card in it. You can lose more than 4 Coins this way, but
|
||||||
|
the amount of coins you have available to spend can never go
|
||||||
|
below 0 Coins. Cards with two types, one of which is Treasure (such as
|
||||||
|
Harem from Intrigue) are Treasure cards.
|
||||||
|
:::Procession
|
||||||
|
Playing an Action card from your hand is optional. If
|
||||||
|
you do play one, you then play it a second time, then trash it, then
|
||||||
|
gain an Action card costing exactly 1 Coin more than it (even if
|
||||||
|
somehow you failed to trash it). Gaining a card is not optional
|
||||||
|
once you choose to play an Action card, but will fail to happen if
|
||||||
|
no card in the Supply costs the exact amount needed. If something
|
||||||
|
happens due to trashing the card - for example drawing 3 cards
|
||||||
|
due to trashing a Cultist - that will resolve before you gain a card.
|
||||||
|
The gained card comes from the Supply and is put into your
|
||||||
|
discard pile. This does not use up any extra Actions you were
|
||||||
|
allowed to play due to cards like Fortress - Procession itself uses up
|
||||||
|
one Action and that is it. You cannot play any other cards in
|
||||||
|
between resolving the Procession-ed Action card multiple times,
|
||||||
|
unless that Action card specifically tells you to (such as Procession
|
||||||
|
itself does). If you Procession a Procession, you will play one
|
||||||
|
Action twice, trash it, gain an Action card costing 1 Coin
|
||||||
|
more, then play another Action twice, trash it, gain an Action card costing
|
||||||
|
1 Coin more, then trash the Procession and gain an Action costing
|
||||||
|
1 Coin more than it. If you Procession a card that gives you +1 Action,
|
||||||
|
such as Vagrant, you will end up with 2 Actions to use afterwards,
|
||||||
|
rather than the one you would have left if you just played two
|
||||||
|
Vagrants. If you use Procession on a Duration card (from Seaside),
|
||||||
|
Procession will stay out until your next turn and the Duration
|
||||||
|
card will have its effect twice on your next turn, even though the
|
||||||
|
Duration card is trashed.
|
||||||
|
:::Rats
|
||||||
|
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.
|
||||||
|
:::Rebuild
|
||||||
|
You can name any card, whether or not it is being used
|
||||||
|
this game or is a Victory card. Then reveal cards from your deck
|
||||||
|
until you reveal a Victory card that is not what you named. If you
|
||||||
|
run out of cards, shuffle your discard pile and continue, without
|
||||||
|
shuffling in the revealed cards. If you run out of cards with no
|
||||||
|
cards left in your discard pile, stop there, discard everything, and
|
||||||
|
nothing more happens. If you did find a Victory card that was not
|
||||||
|
what you named, you discard the other revealed cards, trash the
|
||||||
|
Victory card, and gain a Victory card costing up to
|
||||||
|
3 Coins more than the trashed card. The card you gain comes from the Supply and is
|
||||||
|
put into your discard pile.
|
||||||
|
:::Rogue
|
||||||
|
If there is a card in the trash costing from 3 Coins to 6 Coins, you
|
||||||
|
have to gain one of them; it is not optional. You can look through
|
||||||
|
the trash at any time. The other players get to see what card you
|
||||||
|
took. The gained card goes into your discard pile. Cards with
|
||||||
|
Potion in the cost (from Alchemy) do not cost from 3 Coins to
|
||||||
|
6 Coins. If there was no card in the trash costing from
|
||||||
|
3 Coins to 6 Coins, you instead have each
|
||||||
|
other player reveal the top 2 cards of his deck, trash one of them
|
||||||
|
of his choice that costs from 3 Coins to 6 Coins (if possible), and discard the
|
||||||
|
rest. Go in turn order, starting with the player to your left.
|
||||||
|
:::Sage
|
||||||
|
If you run out of cards while revealing cards, shuffle your
|
||||||
|
discard pile (not including the revealed cards) and continue. If you
|
||||||
|
run out of cards to reveal and have no cards in your discard pile,
|
||||||
|
stop there; discard everything revealed, and you do not get a card.
|
||||||
|
If you find a card costing 3 Coins or more, put that one into your hand
|
||||||
|
and discard the rest. For example you might reveal Copper, then
|
||||||
|
Copper, then Curse, then Province; Province costs 8 Coins, so you
|
||||||
|
would stop there, put Province in your hand, and discard the two
|
||||||
|
Coppers and the Curse.
|
||||||
|
:::Scavenger
|
||||||
|
Putting your deck into your discard pile is optional, but
|
||||||
|
putting a card from your discard pile on top of your deck is not;
|
||||||
|
you do it unless there are no cards in your discard pile. Putting
|
||||||
|
your deck into your discard pile will not trigger Tunnel (from
|
||||||
|
Hinterlands). If your deck has no cards in it, such as from putting
|
||||||
|
them into your discard pile, then the card you put on top of your
|
||||||
|
deck will be the only card in your deck.
|
||||||
|
:::Spoils
|
||||||
|
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.
|
||||||
|
:::Squire
|
||||||
|
When you play this, you get +1 Coins, and your choice of either
|
||||||
|
+2 Actions, +2 Buys, or gaining a Silver. The Silver comes from the
|
||||||
|
Supply and is put into your discard pile. If Squire is trashed
|
||||||
|
somehow, you gain an Attack card; the Attack card comes from the
|
||||||
|
Supply and is put into your discard pile. You can gain any Attack
|
||||||
|
card available in the Supply, but if no Attack card is available, you
|
||||||
|
do not gain one.
|
||||||
|
:::Storeroom
|
||||||
|
Discard any number of cards from your hand, and
|
||||||
|
draw as many cards as you discarded. Then, discard any number of
|
||||||
|
cards - which could include cards you just drew - and you get +1 Coins
|
||||||
|
per card you discarded that time.
|
||||||
|
:::Urchin
|
||||||
|
When you play this, you draw a card and get +1 Action,
|
||||||
|
then each other player discards down to 4 cards in hand. Players
|
||||||
|
who already have 4 or fewer cards in hand do not do anything.
|
||||||
|
While Urchin is in play, when you play another Attack card, before
|
||||||
|
resolving it, you may trash the Urchin. If you do, you gain a
|
||||||
|
Mercenary. The Mercenary comes from the Mercenary pile, which
|
||||||
|
is not in the Supply, and is put into your discard pile. If there are
|
||||||
|
no Mercenaries left you do not gain one. If you play the same
|
||||||
|
Urchin twice in one turn, such as via Procession, that does not let
|
||||||
|
you trash it for a Mercenary. If you play two different Urchins
|
||||||
|
however, playing the second one will let you trash the first one.
|
||||||
|
:::Vagrant
|
||||||
|
You draw a card before revealing your top card. If the top
|
||||||
|
card of your deck is a Curse, Ruins, Shelter, or Victory card, it goes
|
||||||
|
into your hand; otherwise it goes back on top. A card with
|
||||||
|
multiple types goes into your hand if at least one of the types is
|
||||||
|
Curse, Ruins, Shelter, or Victory.
|
||||||
|
:::Wandering Minstrel
|
||||||
|
First draw a card, then reveal the top 3 cards
|
||||||
|
of your deck, shuffling your discard pile if there are not enough
|
||||||
|
cards in your deck. If there still are not enough after shuffling, just
|
||||||
|
reveal what you can. Put the revealed Action cards on top of your
|
||||||
|
deck in any order, and discard the other cards. A card with
|
||||||
|
multiple types, one of which is Action, is an Action card. If you
|
||||||
|
didn't reveal any Action cards, no cards will be put on top.
|
||||||
|
|||||||
@ -246,10 +246,10 @@ Each other player discards the top card of his deck. If it’s a Victory card he
|
|||||||
+1 Card per Victory card revealed. If this is the first time you played a Crossroads this turn, +3 Actions.
|
+1 Card per Victory card revealed. If this is the first time you played a Crossroads this turn, +3 Actions.
|
||||||
2 Duchess Hinterlands Action $2 +2 Coins
|
2 Duchess Hinterlands Action $2 +2 Coins
|
||||||
Each player (including you) looks at the top card of his deck, and discards it or puts it back.
|
Each player (including you) looks at the top card of his deck, and discards it or puts it back.
|
||||||
----------
|
______________________
|
||||||
In games using this, when you gain a Duchy, you may gain a Duchess.
|
In games using this, when you gain a Duchy, you may gain a Duchess.
|
||||||
3 Fool's Gold Hinterlands Treasure - Reaction $2 If this is the first time you played a Fool's Gold this turn, this is worth 1 coin, otherwise it's worth 4 coins.
|
3 Fool's Gold Hinterlands Treasure - Reaction $2 If this is the first time you played a Fool's Gold this turn, this is worth 1 coin, otherwise it's worth 4 coins.
|
||||||
----------------------
|
______________________
|
||||||
When another player gains a Province, you may trash this from your hand. If you do, gain a Gold, putting it on your deck.
|
When another player gains a Province, you may trash this from your hand. If you do, gain a Gold, putting it on your deck.
|
||||||
4 Develop Hinterlands Action $3 Trash a card from your hand. Gain a card costing exactly 1 coin more than it and a card costing exactly 1 less than it, in either order, putting them on top of your deck.
|
4 Develop Hinterlands Action $3 Trash a card from your hand. Gain a card costing exactly 1 coin more than it and a card costing exactly 1 less than it, in either order, putting them on top of your deck.
|
||||||
5 Oasis Hinterlands Action $3 +1 Card
|
5 Oasis Hinterlands Action $3 +1 Card
|
||||||
@ -262,7 +262,7 @@ Discard a card.
|
|||||||
+1 Action
|
+1 Action
|
||||||
At the start of Clean-up this turn, you may choose an Action card you have in play. If you discard it from play this turn, put it on your deck.
|
At the start of Clean-up this turn, you may choose an Action card you have in play. If you discard it from play this turn, put it on your deck.
|
||||||
8 Tunnel Hinterlands Victory - Reaction $3 2 VP
|
8 Tunnel Hinterlands Victory - Reaction $3 2 VP
|
||||||
----------
|
______________________
|
||||||
When you discard this other than during a Clean-up phase, you may reveal it. If you do, gain a Gold.
|
When you discard this other than during a Clean-up phase, you may reveal it. If you do, gain a Gold.
|
||||||
9 Jack of all Trades Hinterlands Action $4 Gain a Silver.
|
9 Jack of all Trades Hinterlands Action $4 Gain a Silver.
|
||||||
Look at the top card of your deck; discard it or put it back.
|
Look at the top card of your deck; discard it or put it back.
|
||||||
@ -272,40 +272,40 @@ You may trash a card from your hand that is not a Treasure.
|
|||||||
When you buy this or play it, each other player reveals the top 2 cards of his deck, trashes a revealed Silver or Gold you choose, and discards the rest. If he didn't reveal a Treasure, he gains a Copper. You gain the trashed cards.
|
When you buy this or play it, each other player reveals the top 2 cards of his deck, trashes a revealed Silver or Gold you choose, and discards the rest. If he didn't reveal a Treasure, he gains a Copper. You gain the trashed cards.
|
||||||
11 Nomad Camp Hinterlands Action $4 +1 Buy
|
11 Nomad Camp Hinterlands Action $4 +1 Buy
|
||||||
+2 Coins
|
+2 Coins
|
||||||
----------------------
|
______________________
|
||||||
When you gain this, put it on top of your deck.
|
When you gain this, put it on top of your deck.
|
||||||
12 Silk Road Hinterlands Victory $4 Worth 1 VP for every 4 Victory cards in your deck (round down).
|
12 Silk Road Hinterlands Victory $4 Worth 1 VP for every 4 Victory cards in your deck (round down).
|
||||||
13 Spice Merchant Hinterlands Action $4 You may trash a Treasure from your hand. If you do, choose one:
|
13 Spice Merchant Hinterlands Action $4 You may trash a Treasure from your hand. If you do, choose one:
|
||||||
+2 Cards and +1 Action;
|
+2 Cards and +1 Action;
|
||||||
or +2 Coins and +1 Buy.
|
or +2 Coins and +1 Buy.
|
||||||
14 Trader Hinterlands Action - Reaction $4 Trash a card from your hand. Gain a number of Silvers equal to its cost in coins.
|
14 Trader Hinterlands Action - Reaction $4 Trash a card from your hand. Gain a number of Silvers equal to its cost in coins.
|
||||||
----------------------
|
______________________
|
||||||
When you would gain a card, you may reveal this from your hand. If you do, instead, gain a silver.
|
When you would gain a card, you may reveal this from your hand. If you do, instead, gain a silver.
|
||||||
15 Cache Hinterlands Treasure $5 Worth 3 coins
|
15 Cache Hinterlands Treasure $5 Worth 3 coins
|
||||||
----------
|
______________________
|
||||||
When you gain this, gain two Coppers.
|
When you gain this, gain two Coppers.
|
||||||
16 Cartographer Hinterlands Action $5 +1 Card
|
16 Cartographer Hinterlands Action $5 +1 Card
|
||||||
+1 Action
|
+1 Action
|
||||||
Look at the top 4 cards of your deck. Discard any number of them. Put the rest back on top in any order.
|
Look at the top 4 cards of your deck. Discard any number of them. Put the rest back on top in any order.
|
||||||
17 Embassy Hinterlands Action $5 +5 Cards
|
17 Embassy Hinterlands Action $5 +5 Cards
|
||||||
Discard 3 cards.
|
Discard 3 cards.
|
||||||
----------
|
______________________
|
||||||
When you gain this, each other player gains a Silver.
|
When you gain this, each other player gains a Silver.
|
||||||
18 Haggler Hinterlands Action $5 +2 Coins
|
18 Haggler Hinterlands Action $5 +2 Coins
|
||||||
----------
|
______________________
|
||||||
While this is in play, when you buy a card, gain a card costing less than it that is not a Victory card.
|
While this is in play, when you buy a card, gain a card costing less than it that is not a Victory card.
|
||||||
19 Highway Hinterlands Action $5 +1 Card
|
19 Highway Hinterlands Action $5 +1 Card
|
||||||
+1 Action
|
+1 Action
|
||||||
----------
|
______________________
|
||||||
While this is in play, cards cost $1 less, but not less than $0.
|
While this is in play, cards cost $1 less, but not less than $0.
|
||||||
20 Ill-Gotten Gains Hinterlands Treasure $5 Worth 1 Coin
|
20 Ill-Gotten Gains Hinterlands Treasure $5 Worth 1 Coin
|
||||||
When you play this, you may gain a Copper, putting it into your hand.
|
When you play this, you may gain a Copper, putting it into your hand.
|
||||||
----------------------
|
______________________
|
||||||
When you gain this, each other player gains a Curse.
|
When you gain this, each other player gains a Curse.
|
||||||
21 Inn Hinterlands Action $5 +2 Cards
|
21 Inn Hinterlands Action $5 +2 Cards
|
||||||
+2 Actions
|
+2 Actions
|
||||||
Discard 2 cards.
|
Discard 2 cards.
|
||||||
----------
|
______________________
|
||||||
When you gain this, look through your discard pile (including this), reveal any number of Action cards from it, and shuffle them into your deck.
|
When you gain this, look through your discard pile (including this), reveal any number of Action cards from it, and shuffle them into your deck.
|
||||||
22 Mandarin Hinterlands Action $5 +3 coins
|
22 Mandarin Hinterlands Action $5 +3 coins
|
||||||
Put a card from your hand on top of your deck.
|
Put a card from your hand on top of your deck.
|
||||||
@ -322,3 +322,148 @@ When you gain this, gain a card costing less than this.
|
|||||||
26 Farmland Hinterlands Victory $6 2 VP
|
26 Farmland Hinterlands Victory $6 2 VP
|
||||||
----------
|
----------
|
||||||
When you buy this, trash a card from your hand. Gain a card costing exactly $2 more than the trashed card.
|
When you buy this, trash a card from your hand. Gain a card costing exactly $2 more than the trashed card.
|
||||||
|
1 Ruins Dark Ages Action - Ruins $0 Abandoned Mine: +1 Coin
|
||||||
|
Ruined Library: +1 Card
|
||||||
|
Ruined Marked: :1 Buy
|
||||||
|
Ruined Village: +1 Action
|
||||||
|
Survivors: Look at the top 2 cards of your deck. Discard them or put them back in any order.
|
||||||
|
2 Madman Dark Ages Action $0 +2 Actions
|
||||||
|
Return this to the Madman pile. If you do, +1 Card per card in your hand.
|
||||||
|
(This card is not in the supply.)
|
||||||
|
3 Spoils Dark Ages Treasure $0 3 Coins
|
||||||
|
When you play this, return it to the Spoils pile.
|
||||||
|
(This is not in the Supply.)
|
||||||
|
4 Hovel Dark Ages Reaction - Shelter $1 When you buy a Victory card, you may trash this from your hand.
|
||||||
|
5 Necropolis Dark Ages Action - Shelter $1 +2 Actions
|
||||||
|
6 Overgrown Estate Dark Ages Victory - Shelter $1 0 Victory
|
||||||
|
______________________
|
||||||
|
When you trash this, +1 Card.
|
||||||
|
7 Poor House Dark Ages Action $1 +4 Coins
|
||||||
|
Reveal your hand. -1 Coin per Treasure card in your hand, to a minimum of 0 Coins.
|
||||||
|
8 Squire Dark Ages Action $2 +1 Coin
|
||||||
|
Choose one: +2 Actions; or +2 Buys; or gain a Silver.
|
||||||
|
______________________
|
||||||
|
When you trash this, gain an Action card.
|
||||||
|
9 Vagrant Dark Ages Action $2 +1 Card, +1 Action
|
||||||
|
Reveal the top card of your deck. If it's a Curse, Ruins, Shelter, or Victory card, put it into your hand.
|
||||||
|
10 Hermit Dark Ages Action $3 Look through your discard pile. You may trash a card from your discard pile or hand that is not a Treasure. Gain a card costing up to 3 Coins.
|
||||||
|
When you discard this from play, if you did not buy any cards this turn, trash this and gain a Madman from the Madman pile.
|
||||||
|
11 Sage Dark Ages Action $3 +1 Action
|
||||||
|
Reveal cards from the top of your deck until you reveal one costing 3 Coins or more. Put that card into your hand and discard the rest.
|
||||||
|
12 Feodum Dark Ages Victory $4 Worth 1 Victory for every 3 Silvers in your deck (round down).
|
||||||
|
______________________
|
||||||
|
When you trash this, gain 3 Silvers.
|
||||||
|
13 Fortress Dark Ages Action $4 +1 Card, +2 Actions
|
||||||
|
______________________
|
||||||
|
When you trash this, put it into your hand.
|
||||||
|
14 Ironmonger Dark Ages Action $4 +1 Card, +1 Action
|
||||||
|
Reveal the top card of your deck; you may discard it. Either way, if it is an…
|
||||||
|
Action card, +1 Action
|
||||||
|
Treasure card, +1 Coin
|
||||||
|
Victory card, +1 Card
|
||||||
|
15 Procession Dark Ages Action $4 You may play an Action card from your hand twice. Trash it. Gain an Action card costing exactly 1 Coin more than it.
|
||||||
|
16 Rats Dark Ages Action $4 +1 Card, +1 Action
|
||||||
|
Gain a Rats. Trash a card from your hand other than a Rats (or reveal a hand of all Rats).
|
||||||
|
______________________
|
||||||
|
When you tash this, +1 Card.
|
||||||
|
17 Band of Misfits Dark Ages Action $5 Play this as if it were an Action card in the Supply costing less than it that you choose.
|
||||||
|
This is that card until it leaves play.
|
||||||
|
18 Bandit Camp Dark Ages Action $5 +1 Card, +2 Actions
|
||||||
|
Gain a Spoils from the Spoils pile.
|
||||||
|
19 Count Dark Ages Action $5 Choose one: Discard 2 cards; or put a card from your hand on top of your deck; or gain a Copper.
|
||||||
|
Choose one: +3 Coins; or trash your hand; or gain a Duchy.
|
||||||
|
20 Cultist Dark Ages Action - Attack - Looter $5 +2 Cards
|
||||||
|
Each other player gains a Ruins. You may play a Cultist from your hand.
|
||||||
|
______________________
|
||||||
|
When you trash this, +3 Cards.
|
||||||
|
21 Graverobber Dark Ages Action $5 Choose one: Gain a card from the trash costing from 3 Coins to 6 Coins, putting it on top of your deck; or trash an Action card from your hand and gain a card costing up to 3 Coins more than it.
|
||||||
|
22 Pillage Dark Ages Action - Attack $5 Trash this. Each other player with 5 or more cards in hand reveals his hand and discards a card that you choose.
|
||||||
|
Gain 2 Spoils from the Spoils pile.
|
||||||
|
23 Scavenger Dark Ages Action $5 +1 Coins
|
||||||
|
You may put your deck into your discard pile. Look through your discard pile and put one card from it on top of your deck.
|
||||||
|
24 Altar Dark Ages Action $6 Trash a card from your hand. Gain a card costing up to 5 Coins.
|
||||||
|
29 Armory Dark Ages Action $4 Gain a card costing up to 4 Coins,putting it on top of your deck.
|
||||||
|
25 Beggar Dark Ages Action - Reaction $2 Gain 3 Coppers, putting them into your hand.
|
||||||
|
______________________
|
||||||
|
When another player plays an Attack card, you may discard this.
|
||||||
|
If you do, gain two Silvers, putting one on top of your deck.
|
||||||
|
26 Catacombs Dark Ages Action $5 Look at the top 3 cards of your deck.
|
||||||
|
Choose one: Put them into your hand;
|
||||||
|
or discard them and +3 Cards.
|
||||||
|
______________________
|
||||||
|
When you trash this, gain a cheaper card.
|
||||||
|
27 Counterfeit Dark Ages Treasure $5 Worth 1 Coin
|
||||||
|
+1 Buy
|
||||||
|
When you play this, you may play a Treasure from your hand twice. If you do, trash that Treasure
|
||||||
|
28 Death Cart Dark Ages Action - Looter $4 +5 Coins
|
||||||
|
You may trash an Action card from your hand. If you don’t, trash this.
|
||||||
|
______________________
|
||||||
|
When you gain this, gain 2 Ruins.
|
||||||
|
29 Forager Dark Ages Action $3 +1 Action
|
||||||
|
+1 Buy
|
||||||
|
Trash a card from your hand.
|
||||||
|
+1 Coin per differently named Treasure
|
||||||
|
in the trash.
|
||||||
|
30 Junk Dealer Dark Ages Action $5 +1 Card
|
||||||
|
+1 Action
|
||||||
|
+1 Coin
|
||||||
|
Trash a card from your hand.
|
||||||
|
31 Knights Dark Ages Action $3 This is a pile in which each card is different. There is the same basic ability on each card, but also another ability unique to that card in the pile, and they all have different names. Shuffle the Knights pile before playing with it, keeping it face down except for the top one, which is the only card that can be gained from the pile. See Additional Rules for Dark Ages and Preparation. Follow the rules on Knights in order from top to bottom; Sir Michael causes players to discard before it trashes cards.
|
||||||
|
32 Marauder Dark Ages Action $4 Gain a Spoils from the Spoils pile.
|
||||||
|
Each other player gains a Ruins.
|
||||||
|
33 Market Square Dark Ages Action - Reaction $3 +1 Card
|
||||||
|
+1 Action
|
||||||
|
+1 Buy
|
||||||
|
______________________
|
||||||
|
When one of your cards is trashed,
|
||||||
|
you may discard this from your
|
||||||
|
hand. If you do, gain a Gold.
|
||||||
|
34 Rebuild Dark Ages Action $5 + 1Action
|
||||||
|
Name a card. Reveal cards from the
|
||||||
|
top of your deck until you reveal a
|
||||||
|
Victory card that is not the named
|
||||||
|
card. Discard the other cards. Trash the
|
||||||
|
Victory card and gain a Victory card
|
||||||
|
costing up to 3 Coins more than it.
|
||||||
|
35 Rogue Dark Ages Action - Attack $5 + 2 Coins
|
||||||
|
If there are any cards in the trash
|
||||||
|
costing from 3 Coins to 6 Coins, gain one of
|
||||||
|
them. Otherwise, each other player
|
||||||
|
reveals the top 2 cards of his deck,
|
||||||
|
trashes one of them costing from 3 Coins
|
||||||
|
to 6 Coins, and discards the rest.
|
||||||
|
36 Storeroom Dark Ages Action $3 + 1 Buy
|
||||||
|
Discard any number of cards.
|
||||||
|
+1 Card per card discarded.
|
||||||
|
Discard any number of cards.
|
||||||
|
+ 1 Coins per card discarded the second time.
|
||||||
|
37 Urchin Dark Ages Action - Attack $3 +1 Card
|
||||||
|
+1 Action
|
||||||
|
Each other player discards down to
|
||||||
|
4 cards in hand.
|
||||||
|
______________________
|
||||||
|
When you play another Attack card
|
||||||
|
with this in play, you may trash this.
|
||||||
|
If you do, gain a Mercenary from
|
||||||
|
the Mercenary pile.
|
||||||
|
38 Wandering Minstrel Dark Ages Action $4 +1 Card
|
||||||
|
+2 Actions
|
||||||
|
Reveal the top 3 cards of your deck.
|
||||||
|
Put the Actions back on top in any
|
||||||
|
order and discard the rest.
|
||||||
|
39 Hunting Grounds Dark Ages Action $6 + 4 Cards
|
||||||
|
______________________
|
||||||
|
When you trash this,
|
||||||
|
gain a Duchy or 3 Estates.
|
||||||
|
40 Mercenary Dark Ages Action - Attack $0 You may trash 2 cards from your
|
||||||
|
hand.
|
||||||
|
If you do, +2 Cards, + 2 Coins,
|
||||||
|
and each other player discards down
|
||||||
|
to 3 cards in hand.
|
||||||
|
(This is not in the Supply.)
|
||||||
|
41 Mystic Dark Ages Action $5 +1Action
|
||||||
|
+ 2 Coins
|
||||||
|
Name a card.
|
||||||
|
Reveal the top card of your deck.
|
||||||
|
If it’s the named card, put it into your
|
||||||
|
hand.
|
||||||
|
|||||||
@ -41,14 +41,20 @@ class DominionTabs:
|
|||||||
('Action','Reaction') : 'reaction.png',
|
('Action','Reaction') : 'reaction.png',
|
||||||
('Action','Victory') : 'action-victory.png',
|
('Action','Victory') : 'action-victory.png',
|
||||||
('Action','Duration') : 'duration.png',
|
('Action','Duration') : 'duration.png',
|
||||||
|
('Action','Looter') : 'action.png',
|
||||||
('Action','Prize') : 'action.png',
|
('Action','Prize') : 'action.png',
|
||||||
|
('Action','Ruins') : 'action.png',
|
||||||
|
('Action','Shelter') : 'action.png',
|
||||||
|
('Action','Attack','Looter') : 'action.png',
|
||||||
('Reaction',) : 'reaction.png',
|
('Reaction',) : 'reaction.png',
|
||||||
|
('Reaction','Shelter') : 'reaction.png',
|
||||||
('Treasure',) : 'treasure.png',
|
('Treasure',) : 'treasure.png',
|
||||||
('Treasure','Victory') : 'treasure-victory.png',
|
('Treasure','Victory') : 'treasure-victory.png',
|
||||||
('Treasure','Prize') : 'treasure.png',
|
('Treasure','Prize') : 'treasure.png',
|
||||||
('Treasure','Reaction') : 'treasure.png',
|
('Treasure','Reaction') : 'treasure.png',
|
||||||
('Victory',) : 'victory.png',
|
('Victory',) : 'victory.png',
|
||||||
('Victory','Reaction') : 'victory.png',
|
('Victory','Reaction') : 'victory.png',
|
||||||
|
('Victory','Shelter') : 'victory.png',
|
||||||
('Curse',) : 'curse.png'
|
('Curse',) : 'curse.png'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +88,7 @@ class DominionTabs:
|
|||||||
self.tabTotalHeight-self.tabLabelHeight)
|
self.tabTotalHeight-self.tabLabelHeight)
|
||||||
else:
|
else:
|
||||||
self.canvas.translate(0,self.tabTotalHeight-self.tabLabelHeight)
|
self.canvas.translate(0,self.tabTotalHeight-self.tabLabelHeight)
|
||||||
self.canvas.drawImage(DominionTabs.labelImages[card.types],1,0,
|
self.canvas.drawImage(os.path.join('images',DominionTabs.labelImages[card.types]),1,0,
|
||||||
self.tabLabelWidth-2,self.tabLabelHeight-1,
|
self.tabLabelWidth-2,self.tabLabelHeight-1,
|
||||||
preserveAspectRatio=False,anchor='n')
|
preserveAspectRatio=False,anchor='n')
|
||||||
if card.types[0] == 'Treasure' or card.types == ('Curse',):
|
if card.types[0] == 'Treasure' or card.types == ('Curse',):
|
||||||
@ -100,7 +106,7 @@ class DominionTabs:
|
|||||||
textWidth = 85
|
textWidth = 85
|
||||||
|
|
||||||
if card.potcost:
|
if card.potcost:
|
||||||
self.canvas.drawImage("potion.png",21,potHeight,potSize,potSize,preserveAspectRatio=True,mask=[255,255,255,255,255,255])
|
self.canvas.drawImage("images/potion.png",21,potHeight,potSize,potSize,preserveAspectRatio=True,mask=[255,255,255,255,255,255])
|
||||||
textInset += potSize
|
textInset += potSize
|
||||||
textWidth -= potSize
|
textWidth -= potSize
|
||||||
|
|
||||||
@ -152,7 +158,9 @@ class DominionTabs:
|
|||||||
for d in descriptions:
|
for d in descriptions:
|
||||||
s = getSampleStyleSheet()['BodyText']
|
s = getSampleStyleSheet()['BodyText']
|
||||||
s.fontName = "Times-Roman"
|
s.fontName = "Times-Roman"
|
||||||
p = Paragraph(d,s)
|
replace = '<img src='"'images/coin_small_\\1.png'"' width=%d height='"'100%%'"' valign='"'middle'"'/> ' % s.fontSize
|
||||||
|
dmod = re.sub('(\d) Coin(s)?', replace,d)
|
||||||
|
p = Paragraph(dmod,s)
|
||||||
textHeight = self.tabTotalHeight - self.tabLabelHeight + 0.2*cm
|
textHeight = self.tabTotalHeight - self.tabLabelHeight + 0.2*cm
|
||||||
textWidth = self.tabWidth - cm
|
textWidth = self.tabWidth - cm
|
||||||
|
|
||||||
@ -161,7 +169,9 @@ class DominionTabs:
|
|||||||
s.fontSize -= 1
|
s.fontSize -= 1
|
||||||
s.leading -= 1
|
s.leading -= 1
|
||||||
#print 'decreasing fontsize on description for',card.name,'now',s.fontSize
|
#print 'decreasing fontsize on description for',card.name,'now',s.fontSize
|
||||||
p = Paragraph(d,s)
|
replace = '<img src='"'images/coin_small_\\1.png'"' width=%d height='"'100%%'"' valign='"'middle'"'/>' % s.fontSize
|
||||||
|
dmod = re.sub('(\d) Coin(s)?', replace,d)
|
||||||
|
p = Paragraph(dmod,s)
|
||||||
w,h = p.wrap(textWidth,textHeight)
|
w,h = p.wrap(textWidth,textHeight)
|
||||||
p.drawOn(self.canvas,cm/2.0,textHeight-height-h-0.5*cm)
|
p.drawOn(self.canvas,cm/2.0,textHeight-height-h-0.5*cm)
|
||||||
height += h + 0.2*cm
|
height += h + 0.2*cm
|
||||||
@ -182,6 +192,8 @@ class DominionTabs:
|
|||||||
extras[currentCard] = extra
|
extras[currentCard] = extra
|
||||||
currentCard = m.groupdict()["name"]
|
currentCard = m.groupdict()["name"]
|
||||||
extra = ""
|
extra = ""
|
||||||
|
if currentCard and (currentCard not in (c.name for c in cards)):
|
||||||
|
print currentCard + ' has extra description, but is not in cards'
|
||||||
else:
|
else:
|
||||||
extra += line
|
extra += line
|
||||||
if currentCard and extra:
|
if currentCard and extra:
|
||||||
@ -212,7 +224,7 @@ class DominionTabs:
|
|||||||
def read_card_defs(self,fname):
|
def read_card_defs(self,fname):
|
||||||
cards = []
|
cards = []
|
||||||
f = open(fname)
|
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>.*)")
|
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
|
currentCard = None
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
@ -231,6 +243,7 @@ class DominionTabs:
|
|||||||
self.add_definition_line(currentCard,m.groupdict()["description"])
|
self.add_definition_line(currentCard,m.groupdict()["description"])
|
||||||
cards.append(currentCard)
|
cards.append(currentCard)
|
||||||
elif line:
|
elif line:
|
||||||
|
assert currentCard
|
||||||
self.add_definition_line(currentCard,line)
|
self.add_definition_line(currentCard,line)
|
||||||
#print currentCard
|
#print currentCard
|
||||||
#print '----'
|
#print '----'
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
BIN
images/coin.png
Normal file
|
After Width: | Height: | Size: 1005 KiB |
BIN
images/coin_small.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
images/coin_small_0.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
images/coin_small_1.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
images/coin_small_10.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
images/coin_small_11.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
images/coin_small_2.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
images/coin_small_3.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
images/coin_small_4.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
images/coin_small_5.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
images/coin_small_6.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
images/coin_small_7.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
images/coin_small_8.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
images/coin_small_9.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
BIN
img_sources/Base.pxm
Normal file
BIN
img_sources/Intrigue.pxm
Normal file
BIN
img_sources/Promotional.pxm
Normal file
BIN
img_sources/Prosperity.pxm
Normal file
BIN
img_sources/Seaside.pxm
Normal file
BIN
img_sources/coin_small.xcf
Normal file
BIN
img_sources/expansion_labels.pxm
Normal file
3
setup.py
@ -7,8 +7,8 @@ from setuptools import setup,find_packages
|
|||||||
setup(
|
setup(
|
||||||
name="dominiontabs",
|
name="dominiontabs",
|
||||||
version=__version__,
|
version=__version__,
|
||||||
packages=find_packages(),
|
|
||||||
scripts=["dominion_tabs.py"],
|
scripts=["dominion_tabs.py"],
|
||||||
|
packages=find_packages(),
|
||||||
install_requires=["reportlab>=2.5",
|
install_requires=["reportlab>=2.5",
|
||||||
"PIL>=1.1.7"],
|
"PIL>=1.1.7"],
|
||||||
package_data = {
|
package_data = {
|
||||||
@ -18,3 +18,4 @@ setup(
|
|||||||
author_email="sumpfork@mailmight.net",
|
author_email="sumpfork@mailmight.net",
|
||||||
description="Tab Divider Generation for the Dominion Card Game"
|
description="Tab Divider Generation for the Dominion Card Game"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||