mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-03-12 04:07:01 -04:00
Add Ides of March game
This commit is contained in:
parent
5c8d5c26b4
commit
f4dec3ed16
4 changed files with 53 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
<h1>Hurricane</h1>
|
||||
<p>
|
||||
Pairing game type. 1 deck. No redeal.
|
||||
Pairing type. 1 deck. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
|
|
12
html-src/rules/idesofmarch.html
Normal file
12
html-src/rules/idesofmarch.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<h1>Ides of March</h1>
|
||||
<p>
|
||||
Pairing type. 1 deck. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the single foundation.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Like <a href="hurricane.html">Hurricane</a>,
|
||||
but remove pairs whose ranks total 15, or pairs of aces.
|
|
@ -594,7 +594,7 @@ class GI:
|
|||
tuple(range(19000, 19012)) + tuple(range(22303, 22311)) +
|
||||
tuple(range(22353, 22361))),
|
||||
('fc-3.1', tuple(range(961, 971))),
|
||||
('dev', tuple(range(971, 974)) + tuple(range(18005, 18007)) + (526,)),
|
||||
('dev', tuple(range(971, 975)) + tuple(range(18005, 18007)) + (526,)),
|
||||
)
|
||||
|
||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||
|
|
|
@ -1791,6 +1791,8 @@ class Hurricane_Reserve(Hurricane_StackMethods, OpenStack):
|
|||
|
||||
class Hurricane(Pyramid):
|
||||
Hint_Class = Hurricane_Hint
|
||||
RowStack_Class = Hurricane_RowStack
|
||||
Reserve_Class = Hurricane_Reserve
|
||||
|
||||
def createGame(self):
|
||||
# create layout
|
||||
|
@ -1808,7 +1810,7 @@ class Hurricane(Pyramid):
|
|||
(0, 2), (1, 2), (2, 2), (3, 2),
|
||||
):
|
||||
x, y = layout.XM + 1.5*layout.XS + ww*xx, layout.YM + layout.YS*yy
|
||||
stack = Hurricane_Reserve(x, y, self, max_accept=1)
|
||||
stack = self.Reserve_Class(x, y, self, max_accept=1)
|
||||
stack.CARD_XOFFSET, stack.CARD_YOFFSET = layout.XOFFSET, 0
|
||||
s.reserves.append(stack)
|
||||
|
||||
|
@ -1816,7 +1818,7 @@ class Hurricane(Pyramid):
|
|||
x = layout.XM + 1.5*layout.XS + layout.XS+2*layout.XOFFSET + d//2
|
||||
y = layout.YM+layout.YS
|
||||
for i in range(3):
|
||||
stack = Hurricane_RowStack(x, y, self, max_accept=1)
|
||||
stack = self.RowStack_Class(x, y, self, max_accept=1)
|
||||
s.rows.append(stack)
|
||||
x += layout.XS
|
||||
|
||||
|
@ -1847,6 +1849,38 @@ class Hurricane(Pyramid):
|
|||
self.leaveState(old_state)
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Ides of March
|
||||
# ************************************************************************
|
||||
|
||||
class IdesOfMarch_StackMethods(Pyramid_StackMethods):
|
||||
|
||||
def acceptsCards(self, from_stack, cards):
|
||||
if from_stack is self:
|
||||
return False
|
||||
if len(cards) != 1:
|
||||
return False
|
||||
if not self.cards:
|
||||
return False
|
||||
c1 = self.cards[-1]
|
||||
c2 = cards[0]
|
||||
return (c1.face_up and c2.face_up and
|
||||
(c1.rank + c2.rank == 13 or c1.rank + c2.rank == 0))
|
||||
|
||||
|
||||
class IdesOfMarch_RowStack(IdesOfMarch_StackMethods, BasicRowStack):
|
||||
pass
|
||||
|
||||
|
||||
class IdesOfMarch_Reserve(IdesOfMarch_StackMethods, OpenStack):
|
||||
pass
|
||||
|
||||
|
||||
class IdesOfMarch(Hurricane):
|
||||
RowStack_Class = IdesOfMarch_RowStack
|
||||
Reserve_Class = IdesOfMarch_Reserve
|
||||
|
||||
|
||||
# register the game
|
||||
registerGame(GameInfo(38, Pyramid, "Pyramid",
|
||||
GI.GT_PAIRING_TYPE, 1, 2, GI.SL_MOSTLY_LUCK))
|
||||
|
@ -1927,3 +1961,6 @@ registerGame(GameInfo(961, Nines, "Nines",
|
|||
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_LUCK))
|
||||
registerGame(GameInfo(969, ElevenTriangle, "Eleven Triangle",
|
||||
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
|
||||
registerGame(GameInfo(974, IdesOfMarch, "Ides of March",
|
||||
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK,
|
||||
altnames=("XV",)))
|
||||
|
|
Loading…
Add table
Reference in a new issue