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

Acey and Kingsley game.

This commit is contained in:
Joe R 2021-07-26 18:31:09 -04:00
parent 747b1fd60b
commit c9275edb26
3 changed files with 38 additions and 2 deletions

View file

@ -0,0 +1,13 @@
<h1>Acey and Kingsley</h1>
<p>
Two-Deck game type. 2 decks. No redeal.
<h3>Object</h3>
<p>
Move all the cards to the foundations.
<h3>Quick Description</h3>
<p>
Like <a href="acesandkings.html">Aces and Kings</a>,
but the aces and kings are dealt to the foundations at
the start of the game.

View file

@ -331,7 +331,7 @@ class GI:
("Bill Taylor", (349,)), ("Bill Taylor", (349,)),
("Thomas Warfield", (189, 264, 300, 320, 336, 337, 359, ("Thomas Warfield", (189, 264, 300, 320, 336, 337, 359,
415, 427, 458, 495, 496, 497, 508, 415, 427, 458, 495, 496, 497, 508,
800)), 800, 814)),
) )
GAMES_BY_PYSOL_VERSION = ( GAMES_BY_PYSOL_VERSION = (
@ -406,7 +406,7 @@ class GI:
('fc-2.8', (343001,)), ('fc-2.8', (343001,)),
('fc-2.12', tuple(range(774, 811)) + (16681,) + ('fc-2.12', tuple(range(774, 811)) + (16681,) +
tuple(range(22217, 22219))), tuple(range(22217, 22219))),
('fc-2.14', tuple(range(811, 814))) ('fc-2.14', tuple(range(811, 815)))
) )
# deprecated - the correct way is to or a GI.GT_XXX flag # deprecated - the correct way is to or a GI.GT_XXX flag

View file

@ -55,6 +55,11 @@ class AcesAndKings(Game):
# create stacks # create stacks
x, y = l.XM, l.YM x, y = l.XM, l.YM
w1, w2 = 4 * l.XS + l.XM, 2 * l.XS
if w2 + 13 * l.XOFFSET > w1:
l.XOFFSET = int((w1 - w2) / 13)
for i in range(2): for i in range(2):
stack = OpenStack(x, y, self) stack = OpenStack(x, y, self)
stack.CARD_XOFFSET = l.XOFFSET stack.CARD_XOFFSET = l.XOFFSET
@ -99,6 +104,24 @@ class AcesAndKings(Game):
self.s.talon.moveMove(1, stack) self.s.talon.moveMove(1, stack)
# ************************************************************************
# * Acey and Kingsley
# ************************************************************************
class AceyAndKingsley(AcesAndKings):
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):
self.s.talon.dealRow(rows=self.s.foundations, frames=0)
AcesAndKings.startGame(self)
# register the game # register the game
registerGame(GameInfo(800, AcesAndKings, "Aces and Kings", registerGame(GameInfo(800, AcesAndKings, "Aces and Kings",
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED)) GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(814, AceyAndKingsley, "Acey and Kingsley",
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))