diff --git a/html-src/rules/diamondmine.html b/html-src/rules/diamondmine.html new file mode 100644 index 00000000..fe85e0ff --- /dev/null +++ b/html-src/rules/diamondmine.html @@ -0,0 +1,24 @@ +
+One-Deck game type. 1 deck. No redeal. + +
+Remove all diamonds to the foundation and have all the other cards in suit and +sequence with Aces being low in the Tableau. + +
+Cards (other than diamonds) can be built down in sequence regardless of suit. +Builds of cards can be moved as a unit. Empty slots can be filled by any card +(except for diamonds) or build of cards. +
+Diamonds cannot be moved except to be place on to the Foundation. The diamond +Foundation must be built up in sequence but can start from any number you +want. + +
+Mining for diamonds is hard work. Keep in mind that not all diamonds are worth +the same. Don't forget to clean up after yourself and put the other suits in +order. diff --git a/pysollib/game.py b/pysollib/game.py index b9a91dd6..fe2fe8e3 100644 --- a/pysollib/game.py +++ b/pysollib/game.py @@ -986,6 +986,7 @@ class Game: shadow = self.app.opt.shadow shadows = () # start animation + from_stack._unshadeStack() if tkraise: for card in cards: card.tkraise() diff --git a/pysollib/games/spider.py b/pysollib/games/spider.py index f404c8c0..953bd3fb 100644 --- a/pysollib/games/spider.py +++ b/pysollib/games/spider.py @@ -32,7 +32,6 @@ __all__ = [] # imports -import sys # PySol imports from pysollib.gamedb import registerGame, GameInfo, GI @@ -288,8 +287,8 @@ class SimpleSimon(Spider): Spider.createGame(self, rows=10, texts=0) def startGame(self): - for l in (9, 8, 7, 6, 5, 4, 3): - self.s.talon.dealRow(rows=self.s.rows[:l], frames=0) + for i in (9, 8, 7, 6, 5, 4, 3): + self.s.talon.dealRow(rows=self.s.rows[:i], frames=0) self.startDealSample() self.s.talon.dealRow() @@ -770,12 +769,12 @@ class SpiderWeb(RelaxedSpider): x += 2*l.XS s.reserves.append(ReserveStack(x, y, self)) x += 2*l.XS - for r in range(4): + for i in range(4): s.foundations.append(Spider_SS_Foundation(x, y, self, suit=ANY_SUIT)) x += l.XS x, y = l.XM+l.XS, l.YM+l.YS - for r in range(7): + for i in range(7): s.rows.append(Spider_RowStack(x, y, self, base_rank=ANY_RANK)) x += l.XS @@ -803,8 +802,8 @@ class SimonJester(Spider): Spider.createGame(self, rows=14, texts=0) def startGame(self): - for l in range(1, 14): - self.s.talon.dealRow(rows=self.s.rows[:l], frames=0) + for i in range(1, 14): + self.s.talon.dealRow(rows=self.s.rows[:i], frames=0) self.startDealSample() self.s.talon.dealRow(rows=self.s.rows[1:]) @@ -873,7 +872,7 @@ class BigSpider(Spider): def createGame(self): Spider.createGame(self, rows=13, playcards=28) def startGame(self): - for l in range(5): + for i in range(5): self.s.talon.dealRow(frames=0, flip=0) self.startDealSample() self.s.talon.dealRow() @@ -887,7 +886,7 @@ class BigSpider2Suits(BigSpider): class Spider3x3(BigSpider): def startGame(self): - for l in range(4): + for i in range(4): self.s.talon.dealRow(frames=0, flip=0) self.startDealSample() self.s.talon.dealRow() @@ -946,7 +945,7 @@ class ChineseSpider(Spider): def createGame(self): Spider.createGame(self, rows=12, playcards=28) def startGame(self): - for l in range(5): + for i in range(5): self.s.talon.dealRow(frames=0, flip=0) self.startDealSample() self.s.talon.dealRow() @@ -1197,6 +1196,58 @@ class FechtersGame(RelaxedSpider): shallHighlightMatch = Game._shallHighlightMatch_AC +# /*********************************************************************** +# // Bebop +# ************************************************************************/ + +class Bebop(Game): + + def createGame(self): + l, s = Layout(self), self.s + self.setSize(l.XM+10*l.XS, l.YM+2*l.YS+18*l.YOFFSET) + + x, y = l.XM+2*l.XS, l.YM + for i in range(8): + s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2)) + x += l.XS + x, y = l.XM+l.XS, l.YM+l.YS + for i in range(8): + s.rows.append(RK_RowStack(x, y, self)) + x += l.XS + x, y = l.XM, l.YM + s.talon = TalonStack(x, y, self) + l.createText(s.talon, 'ne') + + l.defaultStackGroups() + + def startGame(self): + for i in range(len(self.s.rows)-1): + self.s.talon.dealRow(frames=0, flip=0) + self.startDealSample() + self.s.talon.dealRow() + + def fillStack(self, stack): + if stack in self.s.rows: + if len(stack.cards) == len(self.s.rows)-1: + for c in stack.cards: + if c.face_up: + return + old_state = self.enterState(self.S_FILL) + for s in self.s.rows: + if s is stack: + continue + stack.flipMove() + stack.moveMove(1, s, frames=4) + for i in range(len(self.s.rows)-1): + if self.s.talon.cards: + self.s.talon.dealRow(rows=[stack], frames=4, flip=0) + if self.s.talon.cards: + self.s.talon.dealRow(rows=[stack]) + self.leaveState(old_state) + + shallHighlightMatch = Game._shallHighlightMatch_RK + + # register the game registerGame(GameInfo(10, RelaxedSpider, "Relaxed Spider", @@ -1317,4 +1368,6 @@ registerGame(GameInfo(680, Tarantula, "Tarantula", GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL)) registerGame(GameInfo(685, FechtersGame, "Fechter's Game", GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL)) +registerGame(GameInfo(710, Bebop, "Bebop", + GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))