mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added Double Uintah game.
This commit is contained in:
parent
c1421fc92f
commit
526abc03ba
3 changed files with 44 additions and 5 deletions
13
html-src/rules/doubleuintah.html
Normal file
13
html-src/rules/doubleuintah.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<h1>Double Uintah</h1>
|
||||||
|
<p>
|
||||||
|
Golf type. 2 decks. Unlimited redeals.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundation stacks.
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="uintah.html">Uintah</a>,
|
||||||
|
but with two decks, and eight foundations - two for
|
||||||
|
each suit and four for each color.
|
|
@ -481,7 +481,7 @@ class GI:
|
||||||
("C.L. Baker", (45,)),
|
("C.L. Baker", (45,)),
|
||||||
("Mark S. Ball", (909,)),
|
("Mark S. Ball", (909,)),
|
||||||
("David Bernazzani", (314, 830,)),
|
("David Bernazzani", (314, 830,)),
|
||||||
("Gordon Bower", (763, 783, 852,)),
|
("Gordon Bower", (763, 783, 852, 959,)),
|
||||||
("Art Cabral", (9,)),
|
("Art Cabral", (9,)),
|
||||||
("Richard A. Canfield", (105, 835,)),
|
("Richard A. Canfield", (105, 835,)),
|
||||||
("Lillian Davies and Christa Baran", (605,)),
|
("Lillian Davies and Christa Baran", (605,)),
|
||||||
|
@ -598,7 +598,7 @@ class GI:
|
||||||
('fc-2.20', tuple(range(855, 897))),
|
('fc-2.20', tuple(range(855, 897))),
|
||||||
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
|
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
|
||||||
tuple(range(13160, 13163)) + (16682,)),
|
tuple(range(13160, 13163)) + (16682,)),
|
||||||
('dev', tuple(range(906, 959)) + tuple(range(5415, 5419)) +
|
('dev', tuple(range(906, 960)) + tuple(range(5415, 5419)) +
|
||||||
tuple(range(5600, 5624)) + tuple(range(11017, 11020)) +
|
tuple(range(5600, 5624)) + tuple(range(11017, 11020)) +
|
||||||
tuple(range(13168, 13169)) + tuple(range(18000, 18005)) +
|
tuple(range(13168, 13169)) + tuple(range(18000, 18005)) +
|
||||||
tuple(range(19000, 19012)) + tuple(range(22303, 22311)) +
|
tuple(range(19000, 19012)) + tuple(range(22303, 22311)) +
|
||||||
|
|
|
@ -646,7 +646,7 @@ class Robert(Game):
|
||||||
|
|
||||||
def createGame(self, max_rounds=3, num_deal=1, num_foundations=1):
|
def createGame(self, max_rounds=3, num_deal=1, num_foundations=1):
|
||||||
layout, s = Layout(self), self.s
|
layout, s = Layout(self), self.s
|
||||||
self.setSize(layout.XM + 4 * layout.XS,
|
self.setSize(layout.XM + max(4, num_foundations) * layout.XS,
|
||||||
layout.YM + layout.TEXT_HEIGHT + 2 * layout.YS)
|
layout.YM + layout.TEXT_HEIGHT + 2 * layout.YS)
|
||||||
x, y = layout.XM, layout.YM
|
x, y = layout.XM, layout.YM
|
||||||
if num_foundations == 1:
|
if num_foundations == 1:
|
||||||
|
@ -662,7 +662,8 @@ class Robert(Game):
|
||||||
layout.createText(stack, 's')
|
layout.createText(stack, 's')
|
||||||
x += layout.XS
|
x += layout.XS
|
||||||
|
|
||||||
x, y = layout.XM+layout.XS, layout.YM + layout.YS + layout.TEXT_HEIGHT
|
x, y = layout.XM + (layout.XS * max((num_foundations // 2) - 1, 1)), \
|
||||||
|
layout.YM + layout.YS + layout.TEXT_HEIGHT
|
||||||
s.talon = WasteTalonStack(x, y, self,
|
s.talon = WasteTalonStack(x, y, self,
|
||||||
max_rounds=max_rounds, num_deal=num_deal)
|
max_rounds=max_rounds, num_deal=num_deal)
|
||||||
layout.createText(s.talon, 'nw')
|
layout.createText(s.talon, 'nw')
|
||||||
|
@ -700,9 +701,9 @@ class Wasatch(Robert):
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Uintah
|
# * Uintah
|
||||||
|
# * Double Uintah
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
|
|
||||||
class Uintah_Foundation(AbstractFoundationStack):
|
class Uintah_Foundation(AbstractFoundationStack):
|
||||||
def acceptsCards(self, from_stack, cards):
|
def acceptsCards(self, from_stack, cards):
|
||||||
if not AbstractFoundationStack.acceptsCards(self, from_stack, cards):
|
if not AbstractFoundationStack.acceptsCards(self, from_stack, cards):
|
||||||
|
@ -741,6 +742,28 @@ class Uintah(Robert):
|
||||||
return cards + top_cards
|
return cards + top_cards
|
||||||
|
|
||||||
|
|
||||||
|
class DoubleUintah(Uintah):
|
||||||
|
Foundation_Stack = Uintah_Foundation
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
Robert.createGame(self, max_rounds=UNLIMITED_REDEALS, num_deal=3,
|
||||||
|
num_foundations=8)
|
||||||
|
|
||||||
|
def _shuffleHook(self, cards):
|
||||||
|
top_cards = []
|
||||||
|
for s in range(2):
|
||||||
|
suits = []
|
||||||
|
for c in cards[:]:
|
||||||
|
if c.suit not in suits:
|
||||||
|
suits.append(c.suit)
|
||||||
|
top_cards.append(c)
|
||||||
|
cards.remove(c)
|
||||||
|
if len(suits) == 4:
|
||||||
|
break
|
||||||
|
top_cards.sort(key=lambda x: -x.suit) # sort by suit
|
||||||
|
return cards + top_cards
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Diamond Mine
|
# * Diamond Mine
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -1536,3 +1559,6 @@ registerGame(GameInfo(906, Thieves, "Thieves",
|
||||||
registerGame(GameInfo(941, BinaryStar, "Binary Star",
|
registerGame(GameInfo(941, BinaryStar, "Binary Star",
|
||||||
GI.GT_GOLF | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL,
|
GI.GT_GOLF | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL,
|
||||||
altnames=("Black Holes",)))
|
altnames=("Black Holes",)))
|
||||||
|
registerGame(GameInfo(959, DoubleUintah, "Double Uintah",
|
||||||
|
GI.GT_GOLF, 2, UNLIMITED_REDEALS,
|
||||||
|
GI.SL_MOSTLY_LUCK))
|
||||||
|
|
Loading…
Add table
Reference in a new issue