@@ -161,6 +161,46 @@ class RussianAces(AcesUp):
161161 Talon_Class = RussianAces_Talon
162162
163163
164+ # ************************************************************************
165+ # * Joker Bombs
166+ # ************************************************************************
167+
168+ class JokerBombs_Foundation (AcesUp_Foundation ):
169+ def acceptsCards (self , from_stack , cards ):
170+ if cards [0 ].suit == 4 :
171+ return True
172+
173+ return AcesUp_Foundation .acceptsCards (self , from_stack , cards )
174+
175+
176+ class JokerBombs_RowStack (AcesUp_RowStack ):
177+ def moveMove (self , ncards , to_stack , frames = - 1 , shadow = - 1 ):
178+ if self .cards [- 1 ].suit == 4 :
179+ s = BasicRowStack .moveMove (self , ncards , to_stack , frames = frames ,
180+ shadow = shadow )
181+
182+ old_state = self .game .enterState (self .game .S_FILL )
183+ self .game .saveStateMove (2 | 16 ) # for undo
184+
185+ while self .cards :
186+ self .game .flipMove (self )
187+ self .game .moveMove (1 , self , self .game .s .talon , frames = frames )
188+ self .game .shuffleStackMove (self .game .s .talon )
189+
190+ self .game .saveStateMove (1 | 16 ) # for redo
191+ self .game .leaveState (old_state )
192+
193+ return s
194+ else :
195+ return BasicRowStack .moveMove (self , ncards , to_stack ,
196+ frames = frames , shadow = shadow )
197+
198+
199+ class JokerBombs (AcesUp ):
200+ RowStack_Class = StackWrapper (JokerBombs_RowStack , max_accept = 1 )
201+ Foundation_Class = JokerBombs_Foundation
202+
203+
164204# ************************************************************************
165205# * Perpetual Motion
166206# ************************************************************************
@@ -500,12 +540,12 @@ def createGame(self):
500540
501541# register the game
502542registerGame (GameInfo (903 , AcesUp , "Aces Up" , # was: 52
503- GI .GT_1DECK_TYPE | GI . GT_CHILDREN , 1 , 0 , GI .SL_LUCK ,
543+ GI .GT_1DECK_TYPE , 1 , 0 , GI .SL_MOSTLY_LUCK ,
504544 altnames = ("Aces High" , "Drivel" , "Discard" )))
505545registerGame (GameInfo (206 , Fortunes , "Fortunes" ,
506- GI .GT_1DECK_TYPE , 1 , 0 , GI .SL_LUCK ))
546+ GI .GT_1DECK_TYPE , 1 , 0 , GI .SL_MOSTLY_LUCK ))
507547registerGame (GameInfo (213 , RussianAces , "Russian Aces" ,
508- GI .GT_1DECK_TYPE , 1 , 0 , GI .SL_LUCK ))
548+ GI .GT_1DECK_TYPE , 1 , 0 , GI .SL_MOSTLY_LUCK ))
509549registerGame (GameInfo (130 , PerpetualMotion , "Perpetual Motion" ,
510550 GI .GT_1DECK_TYPE , 1 , - 1 , GI .SL_MOSTLY_LUCK ,
511551 altnames = ("First Law" , "Narcotic" )))
@@ -526,3 +566,6 @@ def createGame(self):
526566 GI .GT_2DECK_TYPE , 2 , 0 , GI .SL_MOSTLY_SKILL ))
527567registerGame (GameInfo (934 , Valentine , "Valentine" ,
528568 GI .GT_1DECK_TYPE , 1 , - 1 , GI .SL_LUCK ))
569+ registerGame (GameInfo (984 , JokerBombs , "Joker Bombs" ,
570+ GI .GT_1DECK_TYPE , 1 , 0 , GI .SL_MOSTLY_LUCK ,
571+ subcategory = GI .GS_JOKER_DECK , trumps = list (range (2 ))))
0 commit comments