Skip to content

Commit

Permalink
Added Vincent game.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Feb 7, 2024
1 parent 4f2f17b commit a94d023
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
14 changes: 14 additions & 0 deletions html-src/rules/vincent.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<h1>Vincent</h1>
<p>
Fan type. 1 deck. No redeals.

<h3>Object</h3>
<p>
Move all cards to the foundations.

<h3>Quick Description</h3>
<p>
Like <a href="bristol.html">Bristol</a>,
but tableau piles are built down by same suit, and sequences of
cards can be moved together and kings can be played to empty
piles. Foundations are built up by the same suit.
2 changes: 1 addition & 1 deletion pysollib/gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def _callback(gi, gt=game_type):
('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, 949)) + tuple(range(11017, 11020)) +
('dev', tuple(range(906, 950)) + tuple(range(11017, 11020)) +
tuple(range(5600, 5624)) + tuple(range(18000, 18005)) +
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
)
Expand Down
21 changes: 19 additions & 2 deletions pysollib/games/bristol.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def dealCards(self, sound=False):


class Bristol(Game):
RowStack_Class = StackWrapper(
RK_RowStack, base_rank=NO_RANK, max_move=1)
Foundation_Class = RK_FoundationStack

Hint_Class = Bristol_Hint

#
Expand All @@ -88,13 +92,15 @@ def createGame(self):
# create stacks
x, y, = l.XM + 3*l.XS, l.YM
for i in range(4):
s.foundations.append(RK_FoundationStack(x, y, self, max_move=0))
s.foundations.append(self.Foundation_Class(x, y,
self, max_move=0,
suit=i))
x += l.XS
for i in range(2):
y = l.YM + (i*2+3)*l.YS//2
for j in range(4):
x = l.XM + (j*5)*l.XS//2
stack = RK_RowStack(x, y, self, base_rank=NO_RANK, max_move=1)
stack = self.RowStack_Class(x, y, self)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
s.rows.append(stack)
x, y, = l.XM + 3*l.XS, l.YM + 4*l.YS
Expand Down Expand Up @@ -145,6 +151,15 @@ def startGame(self):
shallHighlightMatch = Game._shallHighlightMatch_RK


# ************************************************************************
# * Vincent
# ************************************************************************

class Vincent(Bristol):
RowStack_Class = StackWrapper(SS_RowStack, base_rank=KING)
Foundation_Class = SS_FoundationStack


# ************************************************************************
# * Belvedere
# ************************************************************************
Expand Down Expand Up @@ -514,3 +529,5 @@ def getQuickPlayScore(self, ncards, from_stack, to_stack):
GI.GT_FAN_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(604, Interment, "Interment",
GI.GT_FAN_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(949, Vincent, "Vincent",
GI.GT_FAN_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))

0 comments on commit a94d023

Please sign in to comment.