mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added Archway game.
This commit is contained in:
parent
88201c0ca6
commit
723d3ff85f
4 changed files with 88 additions and 10 deletions
19
html-src/rules/archway.html
Normal file
19
html-src/rules/archway.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<h1>Archway</h1>
|
||||
<p>
|
||||
Two-Deck game type. 2 decks. 2 redeals.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all the cards to the foundations.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Archway is a variant of <a href="ladyofthemanor.html">Lady of the Manor</a>,
|
||||
invented by David Parlett. It is played similarly, except all cards in the
|
||||
tableau are visible, and the foundations are built differently. The first
|
||||
four foundations have an ace of each suit dealt to them, and are built up
|
||||
by suit, while the other four foundations have a king dealt to them and
|
||||
are built down by suit.
|
||||
<p>
|
||||
As not all aces are dealt to the foundations, a thirteenth reserve pile
|
||||
on the far left is used for extra aces.
|
21
html-src/rules/ladyofthemanor.html
Normal file
21
html-src/rules/ladyofthemanor.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<h1>Lady of the Manor</h1>
|
||||
<p>
|
||||
Two-Deck game type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all the cards to the foundations.
|
||||
|
||||
<h3>Rules</h3>
|
||||
<p>
|
||||
At the start of the game, the aces are dealt to eight foundations.
|
||||
Four tableau piles of twelve cards are dealt, with only the top card
|
||||
of each pile visible. The remaining cards are dealt to twelve reserve
|
||||
piles, forming an arch around the tableau, with each pile being dealt
|
||||
the cards of a different rank - twos on the far left, leading up to
|
||||
kings on the far right.
|
||||
<p>
|
||||
Cards from the reserves or tableau can be moved to foundation piles,
|
||||
building the foundation piles up by rank, regardless of suit. No
|
||||
building on the tableau is allowed. The game is won when all cards have
|
||||
been moved to the foundations.
|
|
@ -344,8 +344,8 @@ class GI:
|
|||
# from XM Solitaire should be researched before being added to PySol.
|
||||
#
|
||||
# still missing:
|
||||
# Ace of Hearts, Affinity, Agnes Three, Antares, Archway,
|
||||
# Avenue, Baker's Fan, Baker's Spider, Bedeviled, Binding,
|
||||
# Ace of Hearts, Affinity, Agnes Three, Antares, Avenue,
|
||||
# Baker's Fan, Baker's Spider, Bedeviled, Binding,
|
||||
# Black Holes, Black Spider, California, Carcassone,
|
||||
# Cascade, Club, Color Cell, Cornelius, Demons and Thieves,
|
||||
# Desert Fox, Deuces and Queens, Double Antares,
|
||||
|
@ -374,7 +374,7 @@ class GI:
|
|||
363, 364, 372, 376, 383, 384, 385, 386, 390, 391, 393, 398,
|
||||
405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476, 480,
|
||||
484, 511, 512, 516, 561, 610, 625, 629, 631, 638, 641, 647,
|
||||
650, 655, 678, 734, 751, 784, 825, 829, 834, 837, 901,
|
||||
650, 655, 678, 734, 751, 784, 825, 829, 834, 837, 844, 901,
|
||||
)),
|
||||
|
||||
# xpat2 1.06 (we have 14 out of 16 games)
|
||||
|
@ -485,7 +485,7 @@ class GI:
|
|||
('fc-2.12', tuple(range(774, 811)) + (16681,) +
|
||||
tuple(range(22217, 22219))),
|
||||
('fc-2.14', tuple(range(811, 827))),
|
||||
('fc-2.16', tuple(range(827, 844)))
|
||||
('fc-2.16', tuple(range(827, 845)))
|
||||
)
|
||||
|
||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||
|
|
|
@ -367,12 +367,20 @@ class LadyOfTheManor(Game):
|
|||
Foundation_Class_1 = RK_FoundationStack
|
||||
Foundation_Class_2 = RK_FoundationStack
|
||||
|
||||
ACE_STACK = False
|
||||
|
||||
def createGame(self):
|
||||
|
||||
l, s = Layout(self), self.s
|
||||
self.setSize(l.XM+8*l.XS, l.YM+max(4*l.YS, 3*l.YS+14*l.YOFFSET))
|
||||
cols = 8
|
||||
if self.ACE_STACK:
|
||||
cols += 1
|
||||
self.setSize(l.XM + cols * l.XS,
|
||||
l.YM + max(4 * l.YS, 3 * l.YS + 14 * l.YOFFSET))
|
||||
|
||||
x, y = l.XM, self.height-l.YS
|
||||
if self.ACE_STACK:
|
||||
x += (l.XS / 2)
|
||||
for i in range(4):
|
||||
suit = i
|
||||
if self.Foundation_Class_1 is RK_FoundationStack:
|
||||
|
@ -387,13 +395,22 @@ class LadyOfTheManor(Game):
|
|||
s.foundations.append(
|
||||
self.Foundation_Class_2(x, y, self, suit=suit))
|
||||
x += l.XS
|
||||
x, y = l.XM+2*l.XS, l.YM+l.YS
|
||||
x, y = l.XM + 2 * l.XS, l.YM + l.YS
|
||||
if self.ACE_STACK:
|
||||
x += (l.XS / 2)
|
||||
for i in range(4):
|
||||
s.rows.append(LadyOfTheManor_RowStack(x, y, self, max_accept=0))
|
||||
x += l.XS
|
||||
for i, j in ((0, 2), (0, 1), (0, 0),
|
||||
(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0),
|
||||
(7, 0), (7, 1), (7, 2), ):
|
||||
if self.ACE_STACK:
|
||||
reservelocs = ((0, 2), (0, 1), (0, 0),
|
||||
(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0),
|
||||
(7, 0), (8, 0), (8, 1), (8, 2), )
|
||||
else:
|
||||
reservelocs = ((0, 2), (0, 1), (0, 0),
|
||||
(1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0),
|
||||
(7, 0), (7, 1), (7, 2),)
|
||||
|
||||
for i, j in reservelocs:
|
||||
x, y = l.XM+i*l.XS, l.YM+j*l.YS
|
||||
s.reserves.append(LadyOfTheManor_Reserve(x, y, self, max_accept=0))
|
||||
|
||||
|
@ -417,10 +434,29 @@ class LadyOfTheManor(Game):
|
|||
while self.s.talon.cards:
|
||||
self.flipMove(self.s.talon)
|
||||
c = self.s.talon.cards[-1]
|
||||
r = self.s.reserves[c.rank-1]
|
||||
if self.ACE_STACK:
|
||||
r = self.s.reserves[c.rank]
|
||||
else:
|
||||
r = self.s.reserves[c.rank - 1]
|
||||
self.moveMove(1, self.s.talon, r, frames=4)
|
||||
|
||||
|
||||
class Archway(LadyOfTheManor):
|
||||
Foundation_Class_1 = SS_FoundationStack
|
||||
Foundation_Class_2 = StackWrapper(SS_FoundationStack, dir=-1)
|
||||
|
||||
ACE_STACK = True
|
||||
|
||||
def _shuffleHook(self, cards):
|
||||
return self._shuffleHookMoveToTop(
|
||||
cards,
|
||||
lambda c: (c.rank in (ACE, KING) and c.deck == 0,
|
||||
(c.rank, c.suit)))
|
||||
|
||||
def startGame(self):
|
||||
LadyOfTheManor.startGame(self, flip=True)
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Matrimony
|
||||
# ************************************************************************
|
||||
|
@ -1403,3 +1439,5 @@ registerGame(GameInfo(745, DesertIsland, "Desert Island",
|
|||
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(761, CatherineTheGreat, "Catherine the Great",
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(844, Archway, "Archway",
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
|
||||
|
|
Loading…
Add table
Reference in a new issue