mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added a Hex A version of Yukon.
This commit is contained in:
parent
5aa9071893
commit
0d774623e2
2 changed files with 97 additions and 1 deletions
31
html-src/rules/hexyukon.html
Normal file
31
html-src/rules/hexyukon.html
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<h1>Hex Yukon</h1>
|
||||||
|
<p>
|
||||||
|
Hex A Deck 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>, except the wizards are wild, but
|
||||||
|
can only be moved as individual cards.
|
||||||
|
|
||||||
|
<h3>Rules</h3>
|
||||||
|
<p>
|
||||||
|
Game play is like Yukon with the Wizards being wild. They can be played
|
||||||
|
on the tableau as any rank or color. However, wizards can only be moved as
|
||||||
|
individual cards, meaning any cards behind a wizard are blocked until the Wizard
|
||||||
|
is moved. Wizards can be moved to a separate foundation at any time, in order
|
||||||
|
by their rank. Wizards' ranks can be identified by the size of their hats, with
|
||||||
|
the one with the tallest hat being the one, and the remaining wizards' ranks
|
||||||
|
have increasingly smaller hats.
|
||||||
|
|
||||||
|
<h3>Strategy</h3>
|
||||||
|
<p>
|
||||||
|
Be careful where you play the wizards. While you can use them to free up any
|
||||||
|
cards you like, if you play them on the wrong pile, you might end up blocking
|
||||||
|
a more important card later.
|
||||||
|
<p>
|
||||||
|
There are certain patterns in how you choose to move the wizards that will help
|
||||||
|
you use them most effectively. You'll just have to figure them out...
|
|
@ -40,7 +40,8 @@ from pysollib.stack import \
|
||||||
SS_FoundationStack, \
|
SS_FoundationStack, \
|
||||||
StackWrapper, \
|
StackWrapper, \
|
||||||
WasteStack, \
|
WasteStack, \
|
||||||
WasteTalonStack
|
WasteTalonStack, \
|
||||||
|
Yukon_AC_RowStack
|
||||||
from pysollib.util import ANY_RANK, ANY_SUIT, NO_RANK, UNLIMITED_ACCEPTS, \
|
from pysollib.util import ANY_RANK, ANY_SUIT, NO_RANK, UNLIMITED_ACCEPTS, \
|
||||||
UNLIMITED_MOVES
|
UNLIMITED_MOVES
|
||||||
|
|
||||||
|
@ -1438,6 +1439,69 @@ class Snakestone(Convolution):
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
class HexYukon_RowStack(Yukon_AC_RowStack):
|
||||||
|
|
||||||
|
def canMoveCards(self, cards):
|
||||||
|
if len(cards) > 1:
|
||||||
|
for card in cards:
|
||||||
|
if card.suit == 4:
|
||||||
|
return False
|
||||||
|
return Yukon_AC_RowStack.canMoveCards(self, cards)
|
||||||
|
|
||||||
|
def acceptsCards(self, from_stack, cards):
|
||||||
|
if not self.basicAcceptsCards(from_stack, cards):
|
||||||
|
return 0
|
||||||
|
stackcards = self.cards
|
||||||
|
if stackcards:
|
||||||
|
if (stackcards[-1].suit == 4 or cards[0].suit == 4):
|
||||||
|
return 1
|
||||||
|
return Yukon_AC_RowStack.acceptsCards(self, from_stack, cards)
|
||||||
|
|
||||||
|
|
||||||
|
class HexYukon(Game):
|
||||||
|
Layout_Method = staticmethod(Layout.yukonLayout)
|
||||||
|
Talon_Class = InitialDealTalonStack
|
||||||
|
Foundation_Class = HexADeck_FoundationStack
|
||||||
|
RowStack_Class = StackWrapper(HexYukon_RowStack, base_rank=15)
|
||||||
|
|
||||||
|
def createGame(self, **layout):
|
||||||
|
# create layout
|
||||||
|
l, s = Layout(self), self.s
|
||||||
|
kwdefault(layout, rows=8, texts=0, playcards=25)
|
||||||
|
self.Layout_Method(l, **layout)
|
||||||
|
self.setSize(l.size[0], l.size[1])
|
||||||
|
# create stacks
|
||||||
|
s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self)
|
||||||
|
for r in l.s.foundations:
|
||||||
|
s.foundations.append(
|
||||||
|
self.Foundation_Class(
|
||||||
|
r.x, r.y, self,
|
||||||
|
r.suit, mod=16, max_cards=16, max_move=1))
|
||||||
|
for r in l.s.rows:
|
||||||
|
s.rows.append(self.RowStack_Class(r.x, r.y, self))
|
||||||
|
# default
|
||||||
|
l.defaultAll()
|
||||||
|
return l
|
||||||
|
|
||||||
|
def startGame(self):
|
||||||
|
for i in range(1, len(self.s.rows)):
|
||||||
|
self.s.talon.dealRow(rows=self.s.rows[i:], flip=0, frames=0)
|
||||||
|
for i in range(4):
|
||||||
|
self.s.talon.dealRow(rows=self.s.rows[0:], flip=1, frames=0)
|
||||||
|
self._startAndDealRow()
|
||||||
|
|
||||||
|
def getHighlightPilesStacks(self):
|
||||||
|
return ()
|
||||||
|
|
||||||
|
shallHighlightMatch = Game._shallHighlightMatch_AC
|
||||||
|
|
||||||
|
|
||||||
|
# ************************************************************************
|
||||||
|
# *
|
||||||
|
# ************************************************************************
|
||||||
|
|
||||||
|
|
||||||
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
|
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
|
||||||
game_type = game_type | GI.GT_HEXADECK
|
game_type = game_type | GI.GT_HEXADECK
|
||||||
gi = GameInfo(id, gameclass, name, game_type, decks, redeals, skill_level,
|
gi = GameInfo(id, gameclass, name, game_type, decks, redeals, skill_level,
|
||||||
|
@ -1471,5 +1535,6 @@ r(16677, MagesGame, 'Mage\'s Game', GI.GT_HEXADECK, 1, 0, GI.SL_BALANCED)
|
||||||
r(16678, Convolution, 'Convolution', GI.GT_HEXADECK, 2, 0, GI.SL_MOSTLY_SKILL)
|
r(16678, Convolution, 'Convolution', GI.GT_HEXADECK, 2, 0, GI.SL_MOSTLY_SKILL)
|
||||||
r(16679, Labyrinth, 'Hex Labyrinth', GI.GT_HEXADECK, 2, 0, GI.SL_MOSTLY_SKILL)
|
r(16679, Labyrinth, 'Hex Labyrinth', GI.GT_HEXADECK, 2, 0, GI.SL_MOSTLY_SKILL)
|
||||||
r(16680, Snakestone, 'Snakestone', GI.GT_HEXADECK, 2, 0, GI.SL_MOSTLY_SKILL)
|
r(16680, Snakestone, 'Snakestone', GI.GT_HEXADECK, 2, 0, GI.SL_MOSTLY_SKILL)
|
||||||
|
r(16681, HexYukon, 'Hex Yukon', GI.GT_HEXADECK, 1, 0, GI.SL_BALANCED)
|
||||||
|
|
||||||
del r
|
del r
|
||||||
|
|
Loading…
Add table
Reference in a new issue