From e9163216b3e4fbfddf3908a38aed9c64e6cb1a8f Mon Sep 17 00:00:00 2001 From: skomoroh Date: Sat, 11 Nov 2006 22:12:11 +0000 Subject: [PATCH] + 3 new games git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@93 39dd0a4e-7c14-0410-91b3-c4f2d318f732 --- po/games.pot | 11 ++++- po/pysol.pot | 4 +- po/ru_games.po | 14 +++++- po/ru_pysol.po | 2 +- pysollib/games/pyramid.py | 44 +++++++++++++++++++ pysollib/games/royalcotillion.py | 74 ++++++++++++++++++++++++++++++++ pysollib/games/ultra/hanafuda.py | 2 +- 7 files changed, 144 insertions(+), 7 deletions(-) diff --git a/po/games.pot b/po/games.pot index 9ff11803..09cb16cc 100644 --- a/po/games.pot +++ b/po/games.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PySol 0.0.1\n" -"POT-Creation-Date: Fri Nov 10 23:00:51 2006\n" +"POT-Creation-Date: Sat Nov 11 14:41:04 2006\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -357,6 +357,9 @@ msgstr "" msgid "Box Kite" msgstr "" +msgid "Boxing the Compass" +msgstr "" + msgid "Braid" msgstr "" @@ -1296,6 +1299,9 @@ msgstr "" msgid "Hanafuda Four Seasons" msgstr "" +msgid "Hanafuda Four Winds" +msgstr "" + msgid "Hanoi Puzzle 4" msgstr "" @@ -3555,6 +3561,9 @@ msgstr "" msgid "Two Familiars" msgstr "" +msgid "Two Pyramids" +msgstr "" + msgid "Two Squares" msgstr "" diff --git a/po/pysol.pot b/po/pysol.pot index d950f238..1beceff4 100644 --- a/po/pysol.pot +++ b/po/pysol.pot @@ -14,7 +14,7 @@ msgid "" msgstr "" "#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: Fri Nov 10 23:01:45 2006\n" +"POT-Creation-Date: Sat Nov 11 14:41:56 2006\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,7 +24,7 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" "#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2006-11-10 23:01+0300\n" +"POT-Creation-Date: 2006-11-11 14:41+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/ru_games.po b/po/ru_games.po index eb5ea65c..49b0a271 100644 --- a/po/ru_games.po +++ b/po/ru_games.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: PySol 0.0.1\n" -"POT-Creation-Date: Fri Nov 10 23:00:51 2006\n" -"PO-Revision-Date: 2006-11-10 13:20+0300\n" +"POT-Creation-Date: Sat Nov 11 14:41:04 2006\n" +"PO-Revision-Date: 2006-11-11 14:43+0300\n" "Last-Translator: Скоморох \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" @@ -359,6 +359,9 @@ msgstr "Коробка для веера" msgid "Box Kite" msgstr "Воздушный змей" +msgid "Boxing the Compass" +msgstr "Футляр для компаса" + msgid "Braid" msgstr "Коса" @@ -1314,6 +1317,9 @@ msgstr "Половинный Маджонг Стена" msgid "Hanafuda Four Seasons" msgstr "Ханафуда Четыре сезона" +msgid "Hanafuda Four Winds" +msgstr "Ханафуда Четыре ветра" + msgid "Hanoi Puzzle 4" msgstr "Ханойская головоломка 4" @@ -3611,6 +3617,10 @@ msgstr "Маджонг Two Domes" msgid "Two Familiars" msgstr "Два знакомца" +#, fuzzy +msgid "Two Pyramids" +msgstr "Пирамида" + msgid "Two Squares" msgstr "Два квадрата" diff --git a/po/ru_pysol.po b/po/ru_pysol.po index ae6f26e8..107dc162 100644 --- a/po/ru_pysol.po +++ b/po/ru_pysol.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PySol 0.0.1\n" -"POT-Creation-Date: Fri Nov 10 23:01:45 2006\n" +"POT-Creation-Date: Sat Nov 11 14:41:56 2006\n" "PO-Revision-Date: 2006-11-10 23:18+0300\n" "Last-Translator: Скоморох \n" "Language-Team: Russian \n" diff --git a/pysollib/games/pyramid.py b/pysollib/games/pyramid.py index 1dae5f5a..7543b4ea 100644 --- a/pysollib/games/pyramid.py +++ b/pysollib/games/pyramid.py @@ -1038,6 +1038,48 @@ class Exit(Game): return self._checkPair(card1, card2) +# /*********************************************************************** +# // Two Pyramids +# ************************************************************************/ + +class TwoPyramids(Pyramid): + + def createGame(self): + # create layout + l, s = Layout(self), self.s + + # set window + w = l.XM + 14*l.XS + h = l.YM + 5*l.YS + self.setSize(w, h) + + # create stacks + x, y = l.XM, l.YM+l.YS + s.rows = self._createPyramid(l, x, y, 7) + x += 7*l.XS + s.rows += self._createPyramid(l, x, y, 7) + + x, y = l.XM, l.YM + s.talon = self.Talon_Class(x, y, self) + l.createText(s.talon, "se") + tx, ty, ta, tf = l.getTextAttr(s.talon, "ne") + font = self.app.getFont("canvas_default") + s.talon.texts.rounds = MfxCanvasText(self.canvas, tx, ty, + anchor=ta, font=font) + y += l.YS + s.waste = self.WasteStack_Class(x, y, self, max_accept=1) + l.createText(s.waste, "se") + x, y = self.width-l.XS, l.YM + s.foundations.append(self.Foundation_Class(x, y, self, + suit=ANY_SUIT, dir=0, base_rank=ANY_RANK, + max_move=0, max_cards=104)) + # define stack-groups + l.defaultStackGroups() + self.sg.openstacks.append(s.talon) + self.sg.dropstacks.append(s.talon) + self.sg.openstacks.append(s.waste) + + # register the game registerGame(GameInfo(38, Pyramid, "Pyramid", @@ -1071,4 +1113,6 @@ registerGame(GameInfo(659, Cheops, "Cheops", GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_SKILL)) registerGame(GameInfo(674, Exit, "Exit", GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_SKILL)) +registerGame(GameInfo(677, TwoPyramids, "Two Pyramids", + GI.GT_PAIRING_TYPE | GI.GT_ORIGINAL, 2, 2, GI.SL_MOSTLY_LUCK)) diff --git a/pysollib/games/royalcotillion.py b/pysollib/games/royalcotillion.py index d11f2cff..4d7fe037 100644 --- a/pysollib/games/royalcotillion.py +++ b/pysollib/games/royalcotillion.py @@ -909,6 +909,76 @@ class ShadyLanes(Game): shallHighlightMatch = Game._shallHighlightMatch_AC +# /*********************************************************************** +# // Four Winds +# // Boxing the Compass +# ************************************************************************/ + +class FourWinds_RowStack(ReserveStack): + def getBottomImage(self): + return self.game.app.images.getSuitBottom(self.cap.base_suit) + + +class FourWinds(Game): + + def createGame(self): + l, s = Layout(self), self.s + self.setSize(l.XM+9*l.XS, l.YM+6*l.YS) + + # vertical rows + x = l.XM+l.XS + for i in (0, 1): + y = l.YM+l.YS + for j in range(4): + s.rows.append(FourWinds_RowStack(x, y, self, base_suit=i)) + y += l.YS + x += 6*l.XS + # horizontal rows + y = l.YM+l.YS + for i in (2, 3): + x = l.XM+2.5*l.XS + for j in range(4): + s.rows.append(FourWinds_RowStack(x, y, self, base_suit=i)) + x += l.XS + y += 3*l.YS + # foundations + decks = self.gameinfo.decks + for k in range(decks): + suit = 0 + for i, j in ((0, 3-decks*0.5+k), + (8, 3-decks*0.5+k), + (4.5-decks*0.5+k, 0), + (4.5-decks*0.5+k, 5)): + x, y = l.XM+i*l.XS, l.YM+j*l.YS + s.foundations.append(SS_FoundationStack(x, y, self, + suit=suit, max_move=0)) + suit += 1 + # talon & waste + x, y = l.XM+3.5*l.XS, l.YM+2.5*l.YS + s.talon = WasteTalonStack(x, y, self, max_rounds=2) + l.createText(s.talon, 'n') + x += l.XS + s.waste = WasteStack(x, y, self) + l.createText(s.waste, 'n') + + l.defaultStackGroups() + + def startGame(self): + self.s.talon.dealRow(rows=self.s.foundations, frames=0) + self.startDealSample() + self.s.talon.dealRow() + self.s.talon.dealCards() + + def _shuffleHook(self, cards): + # move Aces to top of the Talon (i.e. first cards to be dealt) + return self._shuffleHookMoveToTop(cards, + lambda c: (c.rank == ACE, (c.deck, c.suit))) + + +class BoxingTheCompass(FourWinds): + pass + + # register the game registerGame(GameInfo(54, RoyalCotillion, "Royal Cotillion", @@ -943,4 +1013,8 @@ registerGame(GameInfo(638, RoyalRendezvous, "Royal Rendezvous", GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED)) registerGame(GameInfo(639, ShadyLanes, "Shady Lanes", GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED)) +registerGame(GameInfo(675, FourWinds, "Four Winds", + GI.GT_1DECK_TYPE, 1, 1, GI.SL_BALANCED)) +registerGame(GameInfo(676, BoxingTheCompass, "Boxing the Compass", + GI.GT_2DECK_TYPE, 2, 1, GI.SL_BALANCED)) diff --git a/pysollib/games/ultra/hanafuda.py b/pysollib/games/ultra/hanafuda.py index b3e818ec..01a0b98b 100644 --- a/pysollib/games/ultra/hanafuda.py +++ b/pysollib/games/ultra/hanafuda.py @@ -1030,7 +1030,7 @@ r(12348, FlowerClock, "Flower Clock", GI.GT_HANAFUDA | GI.GT_OPEN, 1, 0, GI.SL_M r(12349, Pagoda, "Pagoda", GI.GT_HANAFUDA, 2, 0, GI.SL_BALANCED) r(12350, Samuri, "Samuri", GI.GT_HANAFUDA, 1, 0, GI.SL_BALANCED) r(12351, GreatWall, "Great Wall", GI.GT_HANAFUDA, 4, 0, GI.SL_MOSTLY_SKILL) -r(12352, FourWinds, "Four Winds", GI.GT_HANAFUDA, 1, 1, GI.SL_MOSTLY_SKILL) +r(12352, FourWinds, "Hanafuda Four Winds", GI.GT_HANAFUDA, 1, 1, GI.SL_MOSTLY_SKILL) r(12353, Sumo, "Sumo", GI.GT_HANAFUDA, 1, 0, GI.SL_MOSTLY_SKILL) r(12354, BigSumo, "Big Sumo", GI.GT_HANAFUDA, 2, 0, GI.SL_MOSTLY_SKILL) r(12355, LittleEasy, "Little Easy", GI.GT_HANAFUDA, 1, -1, GI.SL_BALANCED)