mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Add Wizard's Castle game
This commit is contained in:
parent
69c1440b2b
commit
c14be7b73e
3 changed files with 80 additions and 2 deletions
15
html-src/rules/wizardscastle.html
Normal file
15
html-src/rules/wizardscastle.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<h1>Wizard's Castle</h1>
|
||||||
|
<p>
|
||||||
|
Hex A Deck type. 1 deck. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Rules</h3>
|
||||||
|
<p>
|
||||||
|
Rows build down in rank in alternating color. Wizards are wild,
|
||||||
|
so any card can be played on one, and a wizard can be played on
|
||||||
|
any card. Only one card can be moved at a time. Foundations build
|
||||||
|
up in rank by suit. Any card can be played on an empty row. Cards
|
||||||
|
can be played from the foundations.
|
|
@ -595,7 +595,7 @@ class GI:
|
||||||
tuple(range(22353, 22361))),
|
tuple(range(22353, 22361))),
|
||||||
('fc-3.1', tuple(range(961, 971))),
|
('fc-3.1', tuple(range(961, 971))),
|
||||||
('dev', tuple(range(971, 979)) + tuple(range(5419, 5421)) +
|
('dev', tuple(range(971, 979)) + tuple(range(5419, 5421)) +
|
||||||
tuple(range(16683, 16685)) + tuple(range(18005, 18007)) +
|
tuple(range(16683, 16686)) + tuple(range(18005, 18007)) +
|
||||||
(44, 526,)),
|
(44, 526,)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1500,7 +1500,6 @@ class HexYukon(Game):
|
||||||
|
|
||||||
shallHighlightMatch = Game._shallHighlightMatch_AC
|
shallHighlightMatch = Game._shallHighlightMatch_AC
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -1685,6 +1684,68 @@ class WizardsStoreroom(AbstractHexADeckGame):
|
||||||
card1.rank - 1 == card2.rank) and
|
card1.rank - 1 == card2.rank) and
|
||||||
card1.color != card2.color)
|
card1.color != card2.color)
|
||||||
|
|
||||||
|
|
||||||
|
# ************************************************************************
|
||||||
|
# * Wizard's Castle
|
||||||
|
# ************************************************************************
|
||||||
|
|
||||||
|
class WizardsCastle(AbstractHexADeckGame):
|
||||||
|
Hint_Class = CautiousDefaultHint
|
||||||
|
|
||||||
|
#
|
||||||
|
# Game layout
|
||||||
|
#
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
l, s = Layout(self), self.s
|
||||||
|
|
||||||
|
# Set window size
|
||||||
|
h = max(5 * l.YS, 20 * l.YOFFSET)
|
||||||
|
self.setSize(l.XM + 9 * l.XS, l.YM + l.YS + h)
|
||||||
|
|
||||||
|
# Create foundations
|
||||||
|
x = self.width - l.XS
|
||||||
|
y = l.YM
|
||||||
|
s.foundations.append(SS_FoundationStack(x, y, self, 4, max_cards=22))
|
||||||
|
y = y + l.YS
|
||||||
|
for i in range(4):
|
||||||
|
s.foundations.append(
|
||||||
|
SS_FoundationStack(x, y, self, i, max_cards=14))
|
||||||
|
y = y + l.YS
|
||||||
|
|
||||||
|
# Create rows
|
||||||
|
x = l.XM
|
||||||
|
y = l.YM
|
||||||
|
for j in range(2):
|
||||||
|
for i in range(8):
|
||||||
|
s.rows.append(
|
||||||
|
HexAKlon_RowStack(x, y, self, max_move=1, max_accept=1))
|
||||||
|
x = x + l.XS
|
||||||
|
x = l.XM
|
||||||
|
y = y + l.YS * 3
|
||||||
|
self.setRegion(s.rows, (-999, -999, l.XM + l.XS * 8, 999999))
|
||||||
|
|
||||||
|
# Create talon
|
||||||
|
s.talon = InitialDealTalonStack(l.XM, self.height-l.YS, self)
|
||||||
|
|
||||||
|
# Define stack groups
|
||||||
|
l.defaultStackGroups()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Game over rides
|
||||||
|
#
|
||||||
|
|
||||||
|
def startGame(self):
|
||||||
|
for i in range(2):
|
||||||
|
self.s.talon.dealRow(flip=0, frames=0)
|
||||||
|
self.s.talon.dealRow(flip=0, frames=0)
|
||||||
|
self.s.talon.dealRow(rows=self.s.rows[:4], flip=0, frames=0)
|
||||||
|
self._startAndDealRow()
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return (card1.suit == card2.suit and
|
||||||
|
(card1.rank + 1 == card2.rank or card2.rank + 1 == card1.rank))
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -1735,4 +1796,6 @@ r(16683, WizardsStoreroom, "Wizard's Storeroom", GI.GT_HEXADECK, 1, 1,
|
||||||
GI.SL_MOSTLY_SKILL)
|
GI.SL_MOSTLY_SKILL)
|
||||||
r(16684, WizardsStoreroom, "Big Storeroom", GI.GT_HEXADECK, 2, 1,
|
r(16684, WizardsStoreroom, "Big Storeroom", GI.GT_HEXADECK, 2, 1,
|
||||||
GI.SL_MOSTLY_SKILL)
|
GI.SL_MOSTLY_SKILL)
|
||||||
|
r(16685, WizardsCastle, "Wizard's Castle", GI.GT_HEXADECK, 1, 0,
|
||||||
|
GI.SL_BALANCED)
|
||||||
del r
|
del r
|
||||||
|
|
Loading…
Add table
Reference in a new issue