mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added additional multi-deck variations of Golf and Forty Thieves.
This commit is contained in:
parent
3b53d94305
commit
f91817ee51
5 changed files with 82 additions and 11 deletions
12
html-src/rules/doublegolf.html
Normal file
12
html-src/rules/doublegolf.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Double Golf</h1>
|
||||
<p>
|
||||
Golf type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the waste stack.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="golf.html">Golf</a>,
|
||||
but with two decks and nine dealt columns.
|
12
html-src/rules/eightythieves.html
Normal file
12
html-src/rules/eightythieves.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Eighty Thieves</h1>
|
||||
<p>
|
||||
Forty Thieves type. 4 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 four decks and eighty dealt cards.
|
12
html-src/rules/sixtythieves.html
Normal file
12
html-src/rules/sixtythieves.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Sixty Thieves</h1>
|
||||
<p>
|
||||
Forty Thieves type. 3 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 three decks and sixty dealt cards.
|
|
@ -162,6 +162,8 @@ class FortyThieves(Game):
|
|||
# * Big Courtyard
|
||||
# * San Juan Hill
|
||||
# * Famous Fifty
|
||||
# * Sixty Thieves
|
||||
# * Eighty Thieves
|
||||
# * rows build down by suit
|
||||
# ************************************************************************
|
||||
|
||||
|
@ -270,6 +272,20 @@ class FamousFifty(FortyThieves):
|
|||
DEAL = (0, 5)
|
||||
|
||||
|
||||
class SixtyThieves(FortyThieves):
|
||||
DEAL = (0, 5)
|
||||
|
||||
def createGame(self):
|
||||
FortyThieves.createGame(self, rows=12, playcards=16, XCARDS=96)
|
||||
|
||||
|
||||
class EightyThieves(FortyThieves):
|
||||
DEAL = (0, 8)
|
||||
|
||||
def createGame(self):
|
||||
FortyThieves.createGame(self, rows=10, playcards=16, XCARDS=128)
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Deuces
|
||||
# ************************************************************************
|
||||
|
@ -1349,3 +1365,7 @@ registerGame(GameInfo(751, BlindPatience, "Blind Patience",
|
|||
registerGame(GameInfo(765, Foothold, "Foothold",
|
||||
GI.GT_FORTY_THIEVES | GI.GT_ORIGINAL, 2, 0,
|
||||
GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(775, SixtyThieves, "Sixty Thieves",
|
||||
GI.GT_FORTY_THIEVES, 3, 0, GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(776, EightyThieves, "Eighty Thieves",
|
||||
GI.GT_FORTY_THIEVES, 4, 0, GI.SL_MOSTLY_SKILL))
|
||||
|
|
|
@ -140,23 +140,23 @@ class Golf(Game):
|
|||
# game layout
|
||||
#
|
||||
|
||||
def createGame(self):
|
||||
def createGame(self, columns=7):
|
||||
# create layout
|
||||
layout, s = Layout(self), self.s
|
||||
|
||||
# set window
|
||||
playcards = 5
|
||||
w1, w2 = 8*layout.XS+layout.XM, 2*layout.XS
|
||||
if w2 + 52*layout.XOFFSET > w1:
|
||||
layout.XOFFSET = int((w1 - w2) / 52)
|
||||
self.setSize(
|
||||
w1,
|
||||
layout.YM+3*layout.YS +
|
||||
(playcards-1)*layout.YOFFSET+layout.TEXT_HEIGHT)
|
||||
w1, w2 = (columns + 1) * layout.XS + layout.XM, 2 * layout.XS
|
||||
|
||||
totalcards = 52 * self.gameinfo.decks
|
||||
if w2 + totalcards * layout.XOFFSET > w1:
|
||||
layout.XOFFSET = int((w1 - w2) / totalcards)
|
||||
self.setSize(w1, layout.YM + 3 * layout.YS +
|
||||
(playcards - 1) * layout.YOFFSET + layout.TEXT_HEIGHT)
|
||||
|
||||
# create stacks
|
||||
x, y = layout.XM + layout.XS // 2, layout.YM
|
||||
for i in range(7):
|
||||
for i in range(columns):
|
||||
s.rows.append(Golf_RowStack(x, y, self))
|
||||
x = x + layout.XS
|
||||
x, y = layout.XM, self.height - layout.YS
|
||||
|
@ -178,8 +178,8 @@ class Golf(Game):
|
|||
# game overrides
|
||||
#
|
||||
|
||||
def startGame(self):
|
||||
self._startDealNumRows(4)
|
||||
def startGame(self, num_rows=5):
|
||||
self._startDealNumRows(num_rows - 1)
|
||||
self.s.talon.dealRow()
|
||||
self.s.talon.dealCards() # deal first card to WasteStack
|
||||
|
||||
|
@ -203,6 +203,19 @@ class Golf(Game):
|
|||
return (self.sg.dropstacks, self.sg.dropstacks, ())
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Double Golf
|
||||
# ************************************************************************
|
||||
|
||||
class DoubleGolf(Golf):
|
||||
|
||||
def createGame(self):
|
||||
Golf.createGame(self, 9)
|
||||
|
||||
def startGame(self):
|
||||
Golf.startGame(self, 7)
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# *
|
||||
# ************************************************************************
|
||||
|
@ -1193,3 +1206,5 @@ registerGame(GameInfo(764, Beacon, "Beacon",
|
|||
GI.SL_MOSTLY_SKILL))
|
||||
registerGame(GameInfo(768, RelaxedThreeFirTrees, "Relaxed Three Fir-trees",
|
||||
GI.GT_GOLF, 2, 0, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(777, DoubleGolf, "Double Golf",
|
||||
GI.GT_GOLF, 2, 0, GI.SL_BALANCED))
|
||||
|
|
Loading…
Add table
Reference in a new issue