diff --git a/html-src/rules/morphy.html b/html-src/rules/morphy.html new file mode 100644 index 00000000..82376880 --- /dev/null +++ b/html-src/rules/morphy.html @@ -0,0 +1,12 @@ +
+Beleaguered Castle type. 1 deck. No redeal. + +
+Move all cards to the foundations. + +
+Like Chessboard, but piles are built +up or down by alternate color. diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index 0f90d8ed..2ad188a3 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -594,7 +594,7 @@ class GI: ('fc-2.20', tuple(range(855, 897))), ('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) + tuple(range(13160, 13163)) + (16682,)), - ('dev', tuple(range(906, 951)) + tuple(range(11017, 11020)) + + ('dev', tuple(range(906, 952)) + tuple(range(11017, 11020)) + tuple(range(5600, 5624)) + tuple(range(18000, 18005)) + tuple(range(22303, 22311)) + tuple(range(22353, 22361))), ) diff --git a/pysollib/games/beleagueredcastle.py b/pysollib/games/beleagueredcastle.py index 9a7f35d8..e5fcc0fd 100644 --- a/pysollib/games/beleagueredcastle.py +++ b/pysollib/games/beleagueredcastle.py @@ -376,6 +376,7 @@ class CastlesEnd(Bastion): # ************************************************************************ # * Chessboard # * Lasker +# * Morphy # ************************************************************************ class Chessboard_Foundation(SS_FoundationStack): @@ -431,6 +432,20 @@ class Lasker(Chessboard): max_accept=UNLIMITED_ACCEPTS) +class Morphy_RowStack(UD_AC_RowStack): + def canDropCards(self, stacks): + if self.game.demo: + return UD_AC_RowStack.canDropCards(self, stacks) + for s in self.game.s.foundations: + if s.cards: + return UD_AC_RowStack.canDropCards(self, stacks) + return (None, 0) + + +class Morphy(Chessboard): + RowStack_Class = StackWrapper(Morphy_RowStack, mod=13) + + # ************************************************************************ # * Siegecraft # * Stronghold @@ -943,3 +958,6 @@ registerGame(GameInfo(831, Siegecraft, "Siegecraft", registerGame(GameInfo(881, Lasker, "Lasker", GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, GI.SL_SKILL)) +registerGame(GameInfo(951, Morphy, "Morphy", + GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, + GI.SL_SKILL))