1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Added Napoleon's Shoulder game.

This commit is contained in:
Joe R 2023-08-20 21:32:26 -04:00
parent 7499599ba3
commit 29f737c633
4 changed files with 33 additions and 2 deletions

View file

@ -0,0 +1,14 @@
<h1>Napoleon's Shoulder</h1>
<p>
Forty Thieves type. 2 decks. No redeal.
<h3>Object</h3>
<p>
Move all cards to the foundations.
<h3>Quick Description</h3>
<p>
Like <a href="fortythieves.html">Forty Thieves</a>,
but with twelve piles, tableau piles are built down regardless
of suit, and empty tableau piles can only be filled with a
card from the waste.

View file

@ -1,6 +1,6 @@
<h1>Napoleon's Square</h1>
<p>
Forty Thieves type. 2 decks. 1 redeal.
Forty Thieves type. 2 decks. No redeal.
<h3>Object</h3>
<p>

View file

@ -566,7 +566,7 @@ class GI:
('fc-2.20', tuple(range(855, 897))),
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
tuple(range(13160, 13163)) + (16682,)),
('dev', tuple(range(906, 910)) + tuple(range(11017, 11020))),
('dev', tuple(range(906, 911)) + tuple(range(11017, 11020))),
)
# deprecated - the correct way is to or a GI.GT_XXX flag

View file

@ -157,6 +157,7 @@ class FortyThieves(Game):
# * Waning Moon
# * Lucas
# * Napoleon's Square
# * Napoleon's Shoulder
# * Carre Napoleon
# * Josephine
# * Marie Rose
@ -201,6 +202,20 @@ class NapoleonsSquare(FortyThieves):
FortyThieves.createGame(self, rows=12)
class NapoleonsShoulder_RowStack(RK_RowStack):
def acceptsCards(self, from_stack, cards):
if from_stack is not self.game.s.waste and len(self.cards) == 0:
return False
return RK_RowStack.acceptsCards(self, from_stack, cards)
class NapoleonsShoulder(FortyThieves):
RowStack_Class = NapoleonsShoulder_RowStack
def createGame(self):
FortyThieves.createGame(self, rows=12)
class CarreNapoleon(FortyThieves):
RowStack_Class = StackWrapper(SS_RowStack, base_rank=KING)
@ -1543,3 +1558,5 @@ registerGame(GameInfo(884, JacksInTheBox, "Jacks in the Box",
GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(895, Preference, "Preference",
GI.GT_FORTY_THIEVES, 1, 0, GI.SL_LUCK))
registerGame(GameInfo(910, NapoleonsShoulder, "Napoleon's Shoulder",
GI.GT_FORTY_THIEVES, 2, 0, GI.SL_BALANCED))