diff --git a/html-src/rules/bigalhambra.html b/html-src/rules/bigalhambra.html new file mode 100644 index 000000000..08a17a422 --- /dev/null +++ b/html-src/rules/bigalhambra.html @@ -0,0 +1,14 @@ +
+Three-Deck game type. 3 decks. 2 redeals. + +
+Move all the cards to the foundations. + +
+Like Alhambra, +but with three decks and ten piles. For the third +deck, the black foundations are built up from ace to king +while the red foundations are built down from king to ace. diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index 31912bca4..e23c8877e 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -598,7 +598,7 @@ def _callback(gi, gt=game_type): ('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, 952)) + tuple(range(11017, 11020)) + + ('dev', tuple(range(906, 953)) + tuple(range(11017, 11020)) + tuple(range(5600, 5624)) + tuple(range(18000, 18005)) + tuple(range(19000, 19012)) + tuple(range(22303, 22311)) + tuple(range(22353, 22361))), diff --git a/pysollib/games/royalcotillion.py b/pysollib/games/royalcotillion.py index 3aee05784..dafd4ad58 100644 --- a/pysollib/games/royalcotillion.py +++ b/pysollib/games/royalcotillion.py @@ -416,6 +416,82 @@ def fillStack(self, stack): shallHighlightMatch = Game._shallHighlightMatch_SSW +# ************************************************************************ +# * Big Alhambra +# ************************************************************************ + +class BigAlhambra(Alhambra): + + def createGame(self, rows=1, reserves=10, playcards=3): + # create layout + l, s = Layout(self), self.s + + # set window + w, h = l.XM + 12 * l.XS, l.YM + 3.5 * l.YS + playcards * l.YOFFSET + h += l.TEXT_HEIGHT + self.setSize(w, h) + + # create stacks + x, y, = l.XM, l.YM + for i in range(4): + s.foundations.append(SS_FoundationStack(x, y, self, suit=i, + max_move=0)) + x += l.XS + for i in range(2): + s.foundations.append(SS_FoundationStack(x, y, self, suit=i, + max_move=0)) + x += l.XS + for i in range(2, 4): + s.foundations.append(SS_FoundationStack(x, y, self, suit=i, + max_move=0, base_rank=KING, dir=-1)) + x += l.XS + for i in range(4): + s.foundations.append(SS_FoundationStack(x, y, self, suit=i, + max_move=0, base_rank=KING, dir=-1)) + x += l.XS + x, y, = l.XM + l.XS, y + l.YS + for i in range(10): + stack = OpenStack(x, y, self, max_accept=0) + stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET + s.reserves.append(stack) + x += l.XS + x, y = l.XM + 5 * l.XS, self.height - l.YS + s.talon = Alhambra_Talon(x, y, self, max_rounds=3) + if rows == 1: + l.createText(s.talon, 'sw') + else: + l.createText(s.talon, 'n') + anchor = 'nn' + if rows > 1: + anchor = 'sw' + l.createRoundText(s.talon, anchor) + + x += l.XS + for i in range(rows): + stack = self.RowStack_Class(x, y, self, mod=13, max_accept=1) + stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 + s.rows.append(stack) + x += l.XS + if rows == 1: + l.createText(stack, 'se') + else: + l.createText(stack, 'n') + + # define stack-groups (non default) + l.defaultStackGroups() + + # + # game overrides + # + + def _shuffleHook(self, cards): + # move the appropriate aces and kings to top of the Talon + # (i.e. first card to be dealt) + return self._shuffleHookMoveToTop( + cards, lambda c: (c.id in (0, 13, 26, 39, 52, 65, 90, 103, 116, + 129, 142, 155), c.id), 12) + + # ************************************************************************ # * Carpet # ************************************************************************ @@ -1545,3 +1621,5 @@ def _autoDeal(self, sound=True): registerGame(GameInfo(943, RosamundsBower, "Rosamund's Bower", GI.GT_1DECK_TYPE, 1, 3, GI.SL_BALANCED, altnames=("Rosamund",))) +registerGame(GameInfo(952, BigAlhambra, "Big Alhambra", + GI.GT_3DECK_TYPE, 3, 2, GI.SL_BALANCED))