mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Improvements to Knockout family games and full-deck variant.
This commit is contained in:
parent
bd49171a4c
commit
fbb369d93b
3 changed files with 29 additions and 3 deletions
13
html-src/rules/knockoutplus.html
Normal file
13
html-src/rules/knockoutplus.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<h1>Knockout +</h1>
|
||||||
|
<p>
|
||||||
|
One deck type. 1 deck. 2 redeals.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all the clubs to the foundation.
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="knockout.html">Knockout</a>,
|
||||||
|
but with a full deck of cards, and eight rows of
|
||||||
|
cards are dealt per redeal.
|
|
@ -548,7 +548,7 @@ class GI:
|
||||||
tuple(range(22217, 22219))),
|
tuple(range(22217, 22219))),
|
||||||
('fc-2.14', tuple(range(811, 827))),
|
('fc-2.14', tuple(range(811, 827))),
|
||||||
('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407))),
|
('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407))),
|
||||||
('dev', tuple(range(855, 872)))
|
('dev', tuple(range(855, 873)))
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
|
|
@ -34,13 +34,14 @@ from pysollib.util import ANY_RANK, CLUB, HEART
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Knockout
|
# * Knockout
|
||||||
|
# * Knockout +
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
class Knockout_Talon(DealRowTalonStack):
|
class Knockout_Talon(DealRowTalonStack):
|
||||||
def dealCards(self, sound=False):
|
def dealCards(self, sound=False):
|
||||||
game = self.game
|
game = self.game
|
||||||
if game.cards_dealt == game.DEALS_BEFORE_SHUFFLE:
|
if game.cards_dealt == game.DEALS_BEFORE_SHUFFLE:
|
||||||
if self.round < self.max_rounds:
|
if self.canDealCards():
|
||||||
old_state = game.enterState(game.S_FILL)
|
old_state = game.enterState(game.S_FILL)
|
||||||
game.saveStateMove(2 | 16) # for undo
|
game.saveStateMove(2 | 16) # for undo
|
||||||
self.game.cards_dealt = 0
|
self.game.cards_dealt = 0
|
||||||
|
@ -58,6 +59,11 @@ class Knockout_Talon(DealRowTalonStack):
|
||||||
|
|
||||||
return DealRowTalonStack.dealCards(self, sound)
|
return DealRowTalonStack.dealCards(self, sound)
|
||||||
|
|
||||||
|
def canDealCards(self):
|
||||||
|
game = self.game
|
||||||
|
return (game.cards_dealt < game.DEALS_BEFORE_SHUFFLE
|
||||||
|
or self.round < self.max_rounds)
|
||||||
|
|
||||||
def canFlipCard(self):
|
def canFlipCard(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -170,6 +176,10 @@ class Knockout(Game):
|
||||||
return [self.cards_dealt]
|
return [self.cards_dealt]
|
||||||
|
|
||||||
|
|
||||||
|
class KnockoutPlus(Knockout):
|
||||||
|
DEALS_BEFORE_SHUFFLE = 8
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Herz zu Herz
|
# * Herz zu Herz
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -184,8 +194,11 @@ class HerzZuHerz(Knockout):
|
||||||
# register the game
|
# register the game
|
||||||
registerGame(GameInfo(850, Knockout, "Knockout",
|
registerGame(GameInfo(850, Knockout, "Knockout",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_STRIPPED, 1, 2, GI.SL_LUCK,
|
GI.GT_1DECK_TYPE | GI.GT_STRIPPED, 1, 2, GI.SL_LUCK,
|
||||||
altnames=("Hope Deferred",),
|
altnames=("Hope Deferred", "Hope"),
|
||||||
ranks=(0, 6, 7, 8, 9, 10, 11, 12)))
|
ranks=(0, 6, 7, 8, 9, 10, 11, 12)))
|
||||||
registerGame(GameInfo(851, HerzZuHerz, "Herz zu Herz",
|
registerGame(GameInfo(851, HerzZuHerz, "Herz zu Herz",
|
||||||
GI.GT_1DECK_TYPE | GI.GT_STRIPPED, 1, 2, GI.SL_LUCK,
|
GI.GT_1DECK_TYPE | GI.GT_STRIPPED, 1, 2, GI.SL_LUCK,
|
||||||
ranks=(0, 6, 7, 8, 9, 10, 11, 12)))
|
ranks=(0, 6, 7, 8, 9, 10, 11, 12)))
|
||||||
|
registerGame(GameInfo(872, KnockoutPlus, "Knockout +",
|
||||||
|
GI.GT_1DECK_TYPE, 1, 2, GI.SL_LUCK,
|
||||||
|
altnames=("Abandon Hope",)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue