mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added additional multi-deck game variations.
This commit is contained in:
parent
25f6818496
commit
dcd12cd66a
12 changed files with 189 additions and 27 deletions
12
html-src/rules/algerianpatience3decks.html
Normal file
12
html-src/rules/algerianpatience3decks.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Algerian Patience (3 decks)</h1>
|
||||
<p>
|
||||
Three-Deck game type. 3 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Fill all of the foundations.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="algerianpatience.html">Algerian Patience</a>,
|
||||
but with three decks and eight reserve piles.
|
12
html-src/rules/bigparade.html
Normal file
12
html-src/rules/bigparade.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Big Parade</h1>
|
||||
<p>
|
||||
Three-Deck game type. 3 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Fill all of the foundations.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="royalparade.html">Royal Parade</a>,
|
||||
but with three decks and twelve piles per row.
|
12
html-src/rules/doublenestor.html
Normal file
12
html-src/rules/doublenestor.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Double Nestor</h1>
|
||||
<p>
|
||||
Pairing type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the waste stack.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="nestor.html">Nestor</a>,
|
||||
but with two decks and ten columns of ten cards.
|
|
@ -20,8 +20,8 @@ you can only fill it with the right card:
|
|||
<li>third row with a Two.
|
||||
</ul>
|
||||
You build up sequences incrementing by three, up to
|
||||
the face cards. Thus, in the first row, each pile is 4-7-10-K, in the
|
||||
second row 3-6-9-D, and in the third row, 2-5-8-B. Once a sequence has been
|
||||
the face cards. Thus, in the first row, each pile is 4-7-10-King, in the
|
||||
second row 3-6-9-Queen, and in the third row, 2-5-8-Jack. Once a sequence has been
|
||||
started, you have to follow suit.
|
||||
<p>
|
||||
If you clear a space at the bottom it will get automatically filled
|
||||
|
|
33
html-src/rules/royalparade.html
Normal file
33
html-src/rules/royalparade.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
<h1>Royal Parade</h1>
|
||||
<p>
|
||||
Two-Deck game type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the foundations.
|
||||
|
||||
<h3>Rules</h3>
|
||||
<p>
|
||||
Royal Parade is a variation of
|
||||
<a href="picturegallery.html">Picture Gallery</a>
|
||||
Similarly, the layout consists of three rows of playing piles, a row for
|
||||
newly-dealt cards, and a castoff pile for Aces.
|
||||
<p>
|
||||
All Aces are cast off to the pile on the right. Use the <A> key.
|
||||
When you clear a space on the tableau, you can only fill it with the right card:
|
||||
<ul>
|
||||
<li>In the first row, you build up sequences starting with a Two,
|
||||
<li>in the second row with a Three, and in the
|
||||
<li>third row with a Four.
|
||||
</ul>
|
||||
Additionally, the position of two cards on the tableau can be swapped
|
||||
if both of them would end up in the correct row as a result.
|
||||
<p>
|
||||
You build up sequences incrementing by three, up to
|
||||
the face cards. Thus, in the first row, each pile is 2-5-8-Jack, in the
|
||||
second row 3-6-9-Queen, and in the third row, 4-7-10-King. Once a sequence has
|
||||
been started, you have to follow suit.
|
||||
<p>
|
||||
If you clear a space at the bottom it will get automatically filled
|
||||
with a card from the talon. If the talon is empty, clear spaces in the talon
|
||||
cannot be filled.
|
12
html-src/rules/threeup.html
Normal file
12
html-src/rules/threeup.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Three Up</h1>
|
||||
<p>
|
||||
Three-Deck game type. 3 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Fill all of the foundations.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="virginiareel.html">Virginia Reel</a>,
|
||||
but with three decks and twelve piles per row.
|
|
@ -1,6 +1,6 @@
|
|||
<h1>Triple Alliance</h1>
|
||||
<p>
|
||||
Pairing type. 1 deck. No redeals.
|
||||
One-Deck game type. 1 deck. No redeals.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
|
|
14
html-src/rules/triplealliance2decks.html
Normal file
14
html-src/rules/triplealliance2decks.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<h1>Triple Alliance (2 decks)</h1>
|
||||
<p>
|
||||
Two-Deck game type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all but two cards to the single foundation.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="triplealliance.html">Triple Alliance</a>,
|
||||
but with two decks and six cards per pile. Additionally,
|
||||
due to the difference in the number of cards, the game is
|
||||
won when two cards are left.
|
20
html-src/rules/virginiareel.html
Normal file
20
html-src/rules/virginiareel.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<h1>Virginia Reel</h1>
|
||||
<p>
|
||||
Two-Deck game type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the foundations.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Virginia Reel is a variation of <a href="royalparade.html">Royal Parade</a>,
|
||||
intended to be an improvement to that game.
|
||||
<p>
|
||||
Gameplay is similar except cards are not dealt to replace empty piles in the
|
||||
bottom row of the tableau. Additionally, if any empty spaces are left in the
|
||||
top three rows of the tableau, they must be filled immediately. If they cannot,
|
||||
no additional cards can be drawn from the stock until they are filled.
|
||||
<p>
|
||||
Also, a two, three, and four are dealt to the leftmost tableau piles at the
|
||||
start of the game.
|
|
@ -432,6 +432,7 @@ class Fourteen(Game):
|
|||
|
||||
# ************************************************************************
|
||||
# * Nestor
|
||||
# * Double Nestor
|
||||
# ************************************************************************
|
||||
|
||||
class Nestor_RowStack(MonteCarlo_RowStack):
|
||||
|
@ -448,6 +449,9 @@ class Nestor(Game):
|
|||
|
||||
FILL_STACKS_AFTER_DROP = False
|
||||
|
||||
COLS = 8
|
||||
COLCARDS = 6
|
||||
|
||||
#
|
||||
# game layout
|
||||
#
|
||||
|
@ -457,16 +461,17 @@ class Nestor(Game):
|
|||
l, s = Layout(self), self.s
|
||||
|
||||
# set window
|
||||
self.setSize(l.XM+8*l.XS, l.YM+2*l.YS+12*l.YOFFSET)
|
||||
self.setSize(l.XM + self.COLS * l.XS,
|
||||
l.YM + 2 * l.YS + (self.COLCARDS + 6) * l.YOFFSET)
|
||||
|
||||
# create stacks
|
||||
x, y = l.XM, l.YM
|
||||
for i in range(8):
|
||||
for i in range(self.COLS):
|
||||
s.rows.append(self.RowStack_Class(x, y, self,
|
||||
max_move=1, max_accept=1,
|
||||
dir=0, base_rank=NO_RANK))
|
||||
x += l.XS
|
||||
x, y = l.XM+2*l.XS, self.height-l.YS
|
||||
x, y = l.XM + ((self.COLS / 2) - 2) * l.XS, self.height-l.YS
|
||||
for i in range(4):
|
||||
s.rows.append(self.RowStack_Class(x, y, self,
|
||||
max_move=1, max_accept=1,
|
||||
|
@ -474,7 +479,8 @@ class Nestor(Game):
|
|||
x += l.XS
|
||||
x, y = self.width-l.XS, self.height-l.YS
|
||||
s.foundations.append(self.Foundation_Class(x, y, self, suit=ANY_SUIT,
|
||||
max_move=0, max_cards=52, base_rank=ANY_RANK))
|
||||
max_move=0, max_cards=(52 * self.gameinfo.decks),
|
||||
base_rank=ANY_RANK))
|
||||
l.createText(s.foundations[0], "n")
|
||||
x, y = l.XM, self.height - l.YS
|
||||
s.talon = InitialDealTalonStack(x, y, self)
|
||||
|
@ -495,23 +501,25 @@ class Nestor(Game):
|
|||
|
||||
def _shuffleHook(self, cards):
|
||||
# no row will have two cards of the same rank
|
||||
for i in range(8):
|
||||
for i in range(self.COLS):
|
||||
for t in range(1000): # just in case
|
||||
j = self._checkRow(cards[i*6:(i+1)*6])
|
||||
j = self._checkRow(cards[i * self.COLCARDS:(i + 1)
|
||||
* self.COLCARDS])
|
||||
if j < 0:
|
||||
break
|
||||
j += i*6
|
||||
k = self.random.choice(list(range((i+1)*6, 52)))
|
||||
j += i * self.COLCARDS
|
||||
k = self.random.choice(list(range((i+1) * self.COLCARDS,
|
||||
(52 * self.gameinfo.decks))))
|
||||
cards[j], cards[k] = cards[k], cards[j]
|
||||
cards.reverse()
|
||||
return cards
|
||||
|
||||
def startGame(self):
|
||||
for r in self.s.rows[:8]:
|
||||
for j in range(6):
|
||||
for r in self.s.rows[:self.COLS]:
|
||||
for j in range(self.COLCARDS):
|
||||
self.s.talon.dealRow(rows=[r], frames=0)
|
||||
self.startDealSample()
|
||||
self.s.talon.dealRow(rows=self.s.rows[8:])
|
||||
self.s.talon.dealRow(rows=self.s.rows[self.COLS:])
|
||||
|
||||
def getAutoStacks(self, event=None):
|
||||
return ((), (), self.sg.dropstacks)
|
||||
|
@ -520,6 +528,11 @@ class Nestor(Game):
|
|||
return card1.rank == card2.rank
|
||||
|
||||
|
||||
class DoubleNestor(Nestor):
|
||||
COLS = 10
|
||||
COLCARDS = 10
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Vertical
|
||||
# ************************************************************************
|
||||
|
@ -928,3 +941,6 @@ registerGame(GameInfo(663, TheLastMonarchII, "The Last Monarch II",
|
|||
GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(727, RightAndLeft, "Right and Left",
|
||||
GI.GT_PAIRING_TYPE, 2, -1, GI.SL_LUCK))
|
||||
registerGame(GameInfo(801, DoubleNestor, "Double Nestor",
|
||||
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 2, 0,
|
||||
GI.SL_MOSTLY_LUCK))
|
||||
|
|
|
@ -468,6 +468,7 @@ class Zeus(MountOlympus):
|
|||
|
||||
# ************************************************************************
|
||||
# * Royal Parade
|
||||
# * Big Parade
|
||||
# ************************************************************************
|
||||
|
||||
|
||||
|
@ -517,18 +518,25 @@ class RoyalParade(PictureGallery):
|
|||
]
|
||||
RowStack_Class = StackWrapper(BasicRowStack, max_accept=0)
|
||||
|
||||
def createGame(self):
|
||||
PictureGallery.createGame(self)
|
||||
def createGame(self, numstacks=8):
|
||||
PictureGallery.createGame(self, numstacks=numstacks)
|
||||
self.s.internals.append(InvisibleStack(self))
|
||||
|
||||
def startGame(self):
|
||||
self.startDealSample()
|
||||
self.s.talon.dealRow(rows=self.s.tableaux)
|
||||
self.s.talon.dealRow(rows=self.s.tableaux, frames=0)
|
||||
self.s.talon.dealRow()
|
||||
|
||||
|
||||
class BigParade(RoyalParade):
|
||||
|
||||
def createGame(self):
|
||||
RoyalParade.createGame(self, numstacks=12)
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Virginia Reel
|
||||
# * Three Up
|
||||
# ************************************************************************
|
||||
|
||||
class VirginiaReel_Talon(DealRowTalonStack):
|
||||
|
@ -559,17 +567,24 @@ class VirginiaReel(RoyalParade):
|
|||
return cards+bottom_cards
|
||||
|
||||
def startGame(self):
|
||||
self.s.talon.dealRow(rows=self.s.tableaux[0::8], frames=0)
|
||||
numdeal = (4 * self.gameinfo.decks)
|
||||
self.s.talon.dealRow(rows=self.s.tableaux[0::numdeal], frames=0)
|
||||
self.startDealSample()
|
||||
for i in range(3):
|
||||
rows = self.s.tableaux[i*8+1:i*8+8]
|
||||
self.s.talon.dealRow(rows=rows)
|
||||
rows = self.s.tableaux[i*numdeal+1:i*numdeal+numdeal]
|
||||
self.s.talon.dealRow(rows=rows, frames=0)
|
||||
self.s.talon.dealRow()
|
||||
|
||||
def fillStack(self, stack):
|
||||
pass
|
||||
|
||||
|
||||
class ThreeUp(VirginiaReel):
|
||||
|
||||
def createGame(self):
|
||||
VirginiaReel.createGame(self, numstacks=12)
|
||||
|
||||
|
||||
# register the game
|
||||
registerGame(GameInfo(7, PictureGallery, "Picture Gallery",
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED,
|
||||
|
@ -583,11 +598,14 @@ registerGame(GameInfo(398, MountOlympus, "Mount Olympus",
|
|||
registerGame(GameInfo(399, Zeus, "Zeus",
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(546, RoyalParade, "Royal Parade",
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_SKILL,
|
||||
rules_filename='virginiareel.html'))
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(547, VirginiaReel, "Virginia Reel",
|
||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(782, GreaterWheel, "Greater Wheel",
|
||||
GI.GT_4DECK_TYPE, 4, 0, GI.SL_BALANCED,
|
||||
ranks=list(range(12)) # without Kings
|
||||
))
|
||||
registerGame(GameInfo(803, BigParade, "Big Parade",
|
||||
GI.GT_3DECK_TYPE, 3, 0, GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(804, ThreeUp, "Three Up",
|
||||
GI.GT_3DECK_TYPE, 3, 0, GI.SL_MOSTLY_SKILL))
|
||||
|
|
|
@ -688,11 +688,13 @@ class TripleAlliance_Reserve(ReserveStack):
|
|||
|
||||
|
||||
class TripleAlliance(Game):
|
||||
CARDS_PER_PILE = 3
|
||||
CARDS_PER_SMALL_PILE = 2
|
||||
|
||||
def createGame(self):
|
||||
|
||||
layout, s = Layout(self), self.s
|
||||
w0 = layout.XS+5*layout.XOFFSET
|
||||
w0 = layout.XS + (2 + self.CARDS_PER_PILE) * layout.XOFFSET
|
||||
self.setSize(layout.XM+5*w0, layout.YM+5*layout.YS)
|
||||
|
||||
x, y = layout.XM, layout.YM
|
||||
|
@ -723,8 +725,10 @@ class TripleAlliance(Game):
|
|||
layout.defaultStackGroups()
|
||||
|
||||
def startGame(self):
|
||||
self._startDealNumRows(2)
|
||||
self.s.talon.dealRowAvail()
|
||||
self._startDealNumRows(self.CARDS_PER_SMALL_PILE)
|
||||
for i in range(self.CARDS_PER_PILE - self.CARDS_PER_SMALL_PILE - 1):
|
||||
self.s.talon.dealRowAvail(self.s.rows[:16], frames=0)
|
||||
self.s.talon.dealRowAvail(self.s.rows[:16])
|
||||
|
||||
def fillStack(self, stack):
|
||||
for r in self.s.reserves:
|
||||
|
@ -738,7 +742,12 @@ class TripleAlliance(Game):
|
|||
self.leaveState(old_state)
|
||||
|
||||
def isGameWon(self):
|
||||
return len(self.s.foundations[0].cards) == 51
|
||||
return len(self.s.foundations[0].cards) == 51 * self.gameinfo.decks
|
||||
|
||||
|
||||
class TripleAlliance2Decks(TripleAlliance):
|
||||
CARDS_PER_PILE = 6
|
||||
CARDS_PER_SMALL_PILE = 4
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
|
@ -1377,7 +1386,8 @@ registerGame(GameInfo(596, SuitElevens, "Suit Elevens",
|
|||
registerGame(GameInfo(597, Fifteens, "Fifteens",
|
||||
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
|
||||
registerGame(GameInfo(619, TripleAlliance, "Triple Alliance",
|
||||
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))
|
||||
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0,
|
||||
GI.SL_MOSTLY_SKILL, altnames=('Triplets',)))
|
||||
registerGame(GameInfo(655, Pharaohs, "Pharaohs",
|
||||
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(657, Baroness, "Baroness",
|
||||
|
@ -1407,3 +1417,6 @@ registerGame(GameInfo(735, Hurricane, "Hurricane",
|
|||
registerGame(GameInfo(796, Exit, "Exit",
|
||||
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0,
|
||||
GI.SL_MOSTLY_SKILL, altnames=('Gay Gordons',)))
|
||||
registerGame(GameInfo(802, TripleAlliance2Decks, "Triple Alliance (2 decks)",
|
||||
GI.GT_2DECK_TYPE | GI.GT_OPEN, 2, 0,
|
||||
GI.SL_MOSTLY_SKILL))
|
||||
|
|
Loading…
Add table
Reference in a new issue