mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
Redeal stack for Archway (discussed in issue #332).
This commit is contained in:
parent
622c8a455c
commit
be1929a33e
2 changed files with 45 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
<h1>Archway</h1>
|
<h1>Archway</h1>
|
||||||
<p>
|
<p>
|
||||||
Two-Deck game type. 2 decks. No redeal.
|
Two-Deck game type. 2 decks. Unlimited redeals.
|
||||||
|
|
||||||
<h3>Object</h3>
|
<h3>Object</h3>
|
||||||
<p>
|
<p>
|
||||||
|
@ -15,5 +15,8 @@ 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
|
by suit, while the other four foundations have a king dealt to them and
|
||||||
are built down by suit.
|
are built down by suit.
|
||||||
<p>
|
<p>
|
||||||
|
Additionally, every card from the reserve piles is available to play. Hitting
|
||||||
|
the redeal button will shift the topmost card of each reserve.
|
||||||
|
<p>
|
||||||
As not all aces are dealt to the foundations, a thirteenth reserve pile
|
As not all aces are dealt to the foundations, a thirteenth reserve pile
|
||||||
on the far left is used for extra aces.
|
on the far left is used for extra aces.
|
||||||
|
|
|
@ -33,10 +33,12 @@ from pysollib.stack import \
|
||||||
DealRowRedealTalonStack, \
|
DealRowRedealTalonStack, \
|
||||||
DealRowTalonStack, \
|
DealRowTalonStack, \
|
||||||
InitialDealTalonStack, \
|
InitialDealTalonStack, \
|
||||||
|
InvisibleStack, \
|
||||||
KingAC_RowStack, \
|
KingAC_RowStack, \
|
||||||
OpenStack, \
|
OpenStack, \
|
||||||
RK_FoundationStack, \
|
RK_FoundationStack, \
|
||||||
RK_RowStack, \
|
RK_RowStack, \
|
||||||
|
RedealTalonStack, \
|
||||||
ReserveStack, \
|
ReserveStack, \
|
||||||
SS_FoundationStack, \
|
SS_FoundationStack, \
|
||||||
SS_RowStack, \
|
SS_RowStack, \
|
||||||
|
@ -368,6 +370,8 @@ class LadyOfTheManor(Game):
|
||||||
Foundation_Class_1 = RK_FoundationStack
|
Foundation_Class_1 = RK_FoundationStack
|
||||||
Foundation_Class_2 = RK_FoundationStack
|
Foundation_Class_2 = RK_FoundationStack
|
||||||
|
|
||||||
|
Talon_Class = InitialDealTalonStack
|
||||||
|
|
||||||
ACE_STACK = False
|
ACE_STACK = False
|
||||||
|
|
||||||
def createGame(self):
|
def createGame(self):
|
||||||
|
@ -380,8 +384,6 @@ class LadyOfTheManor(Game):
|
||||||
l.YM + max(4 * l.YS, 3 * l.YS + 14 * l.YOFFSET))
|
l.YM + max(4 * l.YS, 3 * l.YS + 14 * l.YOFFSET))
|
||||||
|
|
||||||
x, y = l.XM, self.height-l.YS
|
x, y = l.XM, self.height-l.YS
|
||||||
if self.ACE_STACK:
|
|
||||||
x += (l.XS / 2)
|
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
suit = i
|
suit = i
|
||||||
if self.Foundation_Class_1 is RK_FoundationStack:
|
if self.Foundation_Class_1 is RK_FoundationStack:
|
||||||
|
@ -415,8 +417,8 @@ class LadyOfTheManor(Game):
|
||||||
x, y = l.XM+i*l.XS, l.YM+j*l.YS
|
x, y = l.XM+i*l.XS, l.YM+j*l.YS
|
||||||
s.reserves.append(LadyOfTheManor_Reserve(x, y, self, max_accept=0))
|
s.reserves.append(LadyOfTheManor_Reserve(x, y, self, max_accept=0))
|
||||||
|
|
||||||
s.talon = InitialDealTalonStack(
|
s.talon = self.Talon_Class(
|
||||||
self.width-l.XS, self.height-2*l.YS, self)
|
self.width-l.XS, self.height-l.YS, self)
|
||||||
|
|
||||||
l.defaultAll()
|
l.defaultAll()
|
||||||
|
|
||||||
|
@ -442,12 +444,46 @@ class LadyOfTheManor(Game):
|
||||||
self.moveMove(1, self.s.talon, r, frames=4)
|
self.moveMove(1, self.s.talon, r, frames=4)
|
||||||
|
|
||||||
|
|
||||||
|
class Archway_Talon(RedealTalonStack):
|
||||||
|
|
||||||
|
def dealCards(self, sound=False):
|
||||||
|
old_state = self.game.enterState(self.game.S_DEAL)
|
||||||
|
ncards = 0
|
||||||
|
intern1, intern2 = self.game.s.internals
|
||||||
|
if sound and self.game.app.opt.animations:
|
||||||
|
self.game.startDealSample()
|
||||||
|
for r in self.game.s.reserves:
|
||||||
|
if len(r.cards) <= 1:
|
||||||
|
continue
|
||||||
|
ncards += len(r.cards)
|
||||||
|
# move cards to internal stacks
|
||||||
|
while len(r.cards) != 1:
|
||||||
|
self.game.moveMove(1, r, intern1, frames=0)
|
||||||
|
self.game.moveMove(1, r, intern2, frames=0)
|
||||||
|
# move back
|
||||||
|
while intern1.cards:
|
||||||
|
self.game.moveMove(1, intern1, r, frames=0)
|
||||||
|
self.game.moveMove(1, intern2, r, frames=0)
|
||||||
|
self.game.nextRoundMove(self)
|
||||||
|
if sound:
|
||||||
|
self.game.stopSamples()
|
||||||
|
self.game.leaveState(old_state)
|
||||||
|
return ncards
|
||||||
|
|
||||||
|
|
||||||
class Archway(LadyOfTheManor):
|
class Archway(LadyOfTheManor):
|
||||||
Foundation_Class_1 = SS_FoundationStack
|
Foundation_Class_1 = SS_FoundationStack
|
||||||
Foundation_Class_2 = StackWrapper(SS_FoundationStack, dir=-1)
|
Foundation_Class_2 = StackWrapper(SS_FoundationStack, dir=-1)
|
||||||
|
Talon_Class = StackWrapper(Archway_Talon, max_rounds=-1)
|
||||||
|
|
||||||
ACE_STACK = True
|
ACE_STACK = True
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
LadyOfTheManor.createGame(self)
|
||||||
|
|
||||||
|
self.s.internals.append(InvisibleStack(self))
|
||||||
|
self.s.internals.append(InvisibleStack(self))
|
||||||
|
|
||||||
def _shuffleHook(self, cards):
|
def _shuffleHook(self, cards):
|
||||||
return self._shuffleHookMoveToTop(
|
return self._shuffleHookMoveToTop(
|
||||||
cards,
|
cards,
|
||||||
|
@ -1448,4 +1484,4 @@ registerGame(GameInfo(745, DesertIsland, "Desert Island",
|
||||||
registerGame(GameInfo(761, CatherineTheGreat, "Catherine the Great",
|
registerGame(GameInfo(761, CatherineTheGreat, "Catherine the Great",
|
||||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
|
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(844, Archway, "Archway",
|
registerGame(GameInfo(844, Archway, "Archway",
|
||||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
|
GI.GT_2DECK_TYPE, 2, -1, GI.SL_MOSTLY_LUCK))
|
||||||
|
|
Loading…
Add table
Reference in a new issue