mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-03-12 04:07:01 -04:00
Add Louis game
This commit is contained in:
parent
ff9cc5e98c
commit
63a63fdfd3
3 changed files with 58 additions and 3 deletions
19
html-src/rules/louis.html
Normal file
19
html-src/rules/louis.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<h1>Louis</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>
|
||||
Like <a href="sthelena.html">St. Helena</a>,
|
||||
but at the start of the game, a card is dealt to each of the
|
||||
twelve tableau piles. During this round, an empty tableau pile
|
||||
will be immediately filled from the talon. When no moves are left,
|
||||
the rest of the deck can be dealt.
|
||||
<p>
|
||||
Also, there are no restrictions as to which tableau piles
|
||||
cards can be moved to foundations from, and tableau piles are
|
||||
built up or down by same suit.
|
|
@ -594,7 +594,7 @@ class GI:
|
|||
tuple(range(19000, 19012)) + tuple(range(22303, 22311)) +
|
||||
tuple(range(22353, 22361))),
|
||||
('fc-3.1', tuple(range(961, 971))),
|
||||
('dev', tuple(range(971, 975)) + tuple(range(18005, 18007)) + (526,)),
|
||||
('dev', tuple(range(971, 976)) + tuple(range(18005, 18007)) + (526,)),
|
||||
)
|
||||
|
||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||
|
|
|
@ -51,10 +51,18 @@ class StHelena_Talon(TalonStack):
|
|||
# move all cards to the Talon and redeal
|
||||
lr = len(self.game.s.rows)
|
||||
num_cards = 0
|
||||
assert len(self.cards) == 0
|
||||
if len(self.cards) > 0:
|
||||
num_cards = len(self.cards)
|
||||
self.game.startDealSample()
|
||||
for i in range(lr):
|
||||
k = min(lr, len(self.cards))
|
||||
for j in range(k):
|
||||
self.game.flipAndMoveMove(self, self.game.s.rows[j], 4)
|
||||
self.game.stopSamples()
|
||||
return num_cards
|
||||
for r in self.game.s.rows[::-1]:
|
||||
for i in range(len(r.cards)):
|
||||
num_cards = num_cards + 1
|
||||
num_cards += 1
|
||||
self.game.moveMove(1, r, self, frames=0)
|
||||
assert len(self.cards) == num_cards
|
||||
if num_cards == 0: # game already finished
|
||||
|
@ -169,6 +177,32 @@ class BoxKite(StHelena):
|
|||
|
||||
shallHighlightMatch = Game._shallHighlightMatch_RKW
|
||||
|
||||
# ************************************************************************
|
||||
# * Louis
|
||||
# ************************************************************************
|
||||
|
||||
|
||||
class Louis(StHelena):
|
||||
Foundation_Class = SS_FoundationStack
|
||||
RowStack_Class = StackWrapper(UD_SS_RowStack, base_rank=NO_RANK, mod=13)
|
||||
|
||||
shallHighlightMatch = Game._shallHighlightMatch_RKW
|
||||
|
||||
def startGame(self):
|
||||
self.startDealSample()
|
||||
self.s.talon.dealRow(self.s.foundations)
|
||||
self.s.talon.dealRow()
|
||||
|
||||
def _shuffleHook(self, cards):
|
||||
return self._shuffleHookMoveToTop(
|
||||
cards, lambda c: (c.deck == 0 and c.rank in (0, 12),
|
||||
(-c.rank, c.suit)), 8)
|
||||
|
||||
def fillStack(self, stack):
|
||||
if (self.s.talon.cards and stack in self.s.rows
|
||||
and len(stack.cards) == 0):
|
||||
self.s.talon.dealRow(rows=[stack])
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Les Quatre Coins
|
||||
|
@ -452,3 +486,5 @@ registerGame(GameInfo(621, RegalFamily, "Regal Family",
|
|||
registerGame(GameInfo(859, KingsAudience, "King's Audience",
|
||||
GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK,
|
||||
altnames=("Queen's Audience")))
|
||||
registerGame(GameInfo(975, Louis, "Louis",
|
||||
GI.GT_2DECK_TYPE, 2, 2, GI.SL_BALANCED))
|
||||
|
|
Loading…
Add table
Reference in a new issue