Skip to content

Commit

Permalink
Added Yukon Cells game.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Oct 2, 2023
1 parent c027e6c commit e858b38
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
12 changes: 12 additions & 0 deletions html-src/rules/yukoncells.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h1>Yukon Cells</h1>
<p>
Yukon type. 1 deck. No redeal.

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

<h3>Quick Description</h3>
<p>
Just like <a href="yukon.html">Yukon</a>,
but with two free cells.
2 changes: 1 addition & 1 deletion pysollib/gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,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, 925)) + tuple(range(11017, 11020)) +
('dev', tuple(range(906, 926)) + tuple(range(11017, 11020)) +
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
)

Expand Down
35 changes: 29 additions & 6 deletions pysollib/games/yukon.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,16 @@ def startGame(self):
shallHighlightMatch = Game._shallHighlightMatch_AC


class YukonicPlague(Yukon):
# ************************************************************************
# * Yukon Cells
# * Yukonic Plague
# ************************************************************************

class YukonCells(Yukon):
Reserve_Stack = ReserveStack

RESERVES = 2
RESERVE_TEXT = False

def createGame(self):
# create layout
Expand All @@ -725,10 +734,14 @@ def createGame(self):
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)
x2 = x * 3
for i in range(self.RESERVES):
reserve = self.Reserve_Stack(x2, y, self)
reserve.CARD_XOFFSET = l.XOFFSET
if self.RESERVE_TEXT:
l.createText(reserve, "sw")
s.reserves.append(reserve)
x2 += l.XS

y += l.YS
for i in range(ROWS):
Expand All @@ -738,7 +751,8 @@ def createGame(self):
# 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))
self.setRegion(self.s.rows + self.s.reserves,
(-999, -999, x - l.CW // 2, 999999))

# create foundations
y = l.YM
Expand All @@ -754,6 +768,13 @@ def createGame(self):
self.setSize(l.XM + 8 * l.XS, h)
l.defaultAll()


class YukonicPlague(YukonCells):
Reserve_Stack = OpenStack

RESERVES = 1
RESERVE_TEXT = True

def startGame(self):
for i in range(13):
self.s.talon.dealRow(rows=self.s.reserves, frames=0)
Expand Down Expand Up @@ -837,3 +858,5 @@ def startGame(self):
GI.GT_YUKON, 1, 1, GI.SL_BALANCED))
registerGame(GameInfo(919, Dnieper, "Dnieper",
GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(925, YukonCells, "Yukon Cells",
GI.GT_YUKON, 1, 0, GI.SL_BALANCED))

0 comments on commit e858b38

Please sign in to comment.