mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added Yukonic Plague game.
This commit is contained in:
parent
ff30f50bfe
commit
b149b3c301
4 changed files with 98 additions and 2 deletions
22
html-src/rules/hawaiian.html
Normal file
22
html-src/rules/hawaiian.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<h1>Hawaiian</h1>
|
||||||
|
<p>
|
||||||
|
Yukon type. 2 decks. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Rules</h3>
|
||||||
|
<p>
|
||||||
|
Fifty cards are dealt into ten piles of five cards. The
|
||||||
|
remaining 54 cards are dealt to a reserve pile.
|
||||||
|
<p>
|
||||||
|
Cards in tableau are built down by alternate color.
|
||||||
|
Groups of cards can be moved regardless of sequence.
|
||||||
|
Any card or sequence can be used to fill an empty pile.
|
||||||
|
<p>
|
||||||
|
The top card of the reserve pile can be moved to any
|
||||||
|
appropriate tableau or foundation.
|
||||||
|
<p>
|
||||||
|
The foundations are built up by suit from ace to king.
|
||||||
|
The game is won when all cards are moved to the foundations.
|
14
html-src/rules/yukonicplague.html
Normal file
14
html-src/rules/yukonicplague.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<h1>Yukonic Plague</h1>
|
||||||
|
<p>
|
||||||
|
Yukon type. 1 deck. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="yukon.html">Yukon</a>,
|
||||||
|
but with an additional 13 card reserve. The top
|
||||||
|
card of this reserve can be moved to any appropriate
|
||||||
|
tableau or foundation pile.
|
|
@ -479,7 +479,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, 826)))
|
('fc-2.14', tuple(range(811, 827)))
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
|
|
@ -688,6 +688,64 @@ class Wave(Game):
|
||||||
shallHighlightMatch = Game._shallHighlightMatch_AC
|
shallHighlightMatch = Game._shallHighlightMatch_AC
|
||||||
|
|
||||||
|
|
||||||
|
class YukonicPlague(Yukon):
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
# create layout
|
||||||
|
l, s = Layout(self), self.s
|
||||||
|
|
||||||
|
ROWS = 7
|
||||||
|
|
||||||
|
# set size so that at least 2//3 of a card is visible with 20 cards
|
||||||
|
h = l.CH * 2 // 27 * l.YOFFSET
|
||||||
|
h = l.YM + max(h, 5 * l.YS)
|
||||||
|
|
||||||
|
# create rows
|
||||||
|
x, y = l.XM, l.YM
|
||||||
|
|
||||||
|
w1, w2 = (7 * (l.XS + l.XM)), (2 * l.XS)
|
||||||
|
if w2 + 13 * l.XOFFSET > w1:
|
||||||
|
l.XOFFSET = int((w1 - w2) / 13)
|
||||||
|
|
||||||
|
reserve = OpenStack(x * 3, y, self)
|
||||||
|
reserve.CARD_XOFFSET = l.XOFFSET
|
||||||
|
l.createText(reserve, "sw")
|
||||||
|
s.reserves.append(reserve)
|
||||||
|
|
||||||
|
y += l.YS
|
||||||
|
for i in range(ROWS):
|
||||||
|
self.s.rows.append(self.RowStack_Class(x, y, self))
|
||||||
|
x += l.XS
|
||||||
|
|
||||||
|
# Don't know why this is necessary for the Yukon layout.
|
||||||
|
# But we should probably figure out how to get this to work
|
||||||
|
# like other games.
|
||||||
|
self.setRegion(self.s.rows, (-999, -999, x - l.CW // 2, 999999))
|
||||||
|
|
||||||
|
# create foundations
|
||||||
|
y = l.YM
|
||||||
|
for suit in range(4):
|
||||||
|
self.s.foundations.append(self.Foundation_Class(
|
||||||
|
x, y, self, suit=suit, max_move=0))
|
||||||
|
y += l.YS
|
||||||
|
|
||||||
|
x, y = l.XM, h - l.YS
|
||||||
|
self.s.talon = self.Talon_Class(x, y, self)
|
||||||
|
|
||||||
|
# set window
|
||||||
|
self.setSize(l.XM + 8 * l.XS, h)
|
||||||
|
l.defaultAll()
|
||||||
|
|
||||||
|
def startGame(self):
|
||||||
|
for i in range(13):
|
||||||
|
self.s.talon.dealRow(rows=self.s.reserves, frames=0)
|
||||||
|
for i in range(2):
|
||||||
|
self.s.talon.dealRow(rows=self.s.rows[1:7], flip=0, frames=0)
|
||||||
|
for i in range(5):
|
||||||
|
self.s.talon.dealRow(rows=self.s.rows[i + 1:7], flip=1, frames=0)
|
||||||
|
self._startAndDealRow()
|
||||||
|
|
||||||
|
|
||||||
# register the game
|
# register the game
|
||||||
registerGame(GameInfo(19, Yukon, "Yukon",
|
registerGame(GameInfo(19, Yukon, "Yukon",
|
||||||
GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
|
GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
|
||||||
|
@ -746,6 +804,8 @@ registerGame(GameInfo(531, DoubleRussianSpider, "Double Russian Spider",
|
||||||
registerGame(GameInfo(603, Brisbane, "Brisbane",
|
registerGame(GameInfo(603, Brisbane, "Brisbane",
|
||||||
GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
|
GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(707, Hawaiian, "Hawaiian",
|
registerGame(GameInfo(707, Hawaiian, "Hawaiian",
|
||||||
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
|
GI.GT_YUKON | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(732, Wave, "Wave",
|
registerGame(GameInfo(732, Wave, "Wave",
|
||||||
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
|
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
|
||||||
|
registerGame(GameInfo(826, YukonicPlague, "Yukonic Plague",
|
||||||
|
GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
|
||||||
|
|
Loading…
Add table
Reference in a new issue