1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

+ 2 new game

* fixed rules for `frog', `fly' and `house in the wood'
+ update russian translation


git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@15 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
skomoroh 2006-06-27 21:14:20 +00:00
parent 67f84ccc67
commit 46d22dba3d
5 changed files with 133 additions and 45 deletions

View file

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Sat Jun 24 16:07:12 2006\n"
"PO-Revision-Date: 2006-06-24 18:11+0400\n"
"PO-Revision-Date: 2006-06-28 00:12+0400\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n"
@ -1159,16 +1159,14 @@ msgstr "Ураган"
msgid "Idiot's Delight"
msgstr "Дурацкое удовольствие"
#, fuzzy
msgid "Idle Aces"
msgstr "Пять тузов"
msgstr "Свободные тузы"
msgid "IloveU"
msgstr ""
#, fuzzy
msgid "Imperial Guards"
msgstr "Имперские козыри"
msgstr "Императорская гвардия"
msgid "Imperial Trumps"
msgstr "Имперские козыри"

View file

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Sat Jun 24 16:07:07 2006\n"
"PO-Revision-Date: 2006-06-24 18:24+0400\n"
"PO-Revision-Date: 2006-06-25 23:53+0400\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n"
@ -3262,7 +3262,7 @@ msgstr "Пауза"
#: pysollib/tk/toolbar.py:192
msgid "Pause game"
msgstr "Пауза в игре"
msgstr "Приостановить игру"
#: pysollib/tk/toolbar.py:194
msgid "View statistics"

View file

@ -59,8 +59,7 @@ class Fan_Hint(CautiousDefaultHint):
class Fan(Game):
Talon_Class = InitialDealTalonStack
Foundation_Class = SS_FoundationStack
Foundation_Class_2 = None
Foundation_Classes = [SS_FoundationStack]
ReserveStack_Class = ReserveStack
RowStack_Class = KingSS_RowStack
Hint_Class = Fan_Hint
@ -93,12 +92,9 @@ class Fan(Game):
dx = (self.width - self.gameinfo.decks*4*l.XS)/(self.gameinfo.decks*4+1)
x, y = l.XM + dx, l.YM
dx += l.XS
for i in range(4):
s.foundations.append(self.Foundation_Class(x, y, self, suit=i))
x += dx
if self.gameinfo.decks == 2:
for fnd_cls in self.Foundation_Classes:
for i in range(4):
s.foundations.append(self.Foundation_Class_2(x, y, self, suit=i))
s.foundations.append(fnd_cls(x, y, self, suit=i))
x += dx
for i in range(len(rows)):
x, y = l.XM, y + l.YS
@ -138,8 +134,12 @@ class Fan(Game):
# ************************************************************************/
class ScotchPatience(Fan):
Foundation_Class = AC_FoundationStack
Foundation_Classes = [AC_FoundationStack]
RowStack_Class = StackWrapper(RK_RowStack, base_rank=NO_RANK)
def createGame(self):
Fan.createGame(self, playcards=8)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return abs(card1.rank-card2.rank) == 1
# /***********************************************************************
@ -148,10 +148,8 @@ class ScotchPatience(Fan):
class Shamrocks(Fan):
RowStack_Class = StackWrapper(UD_RK_RowStack, base_rank=NO_RANK, max_cards=3)
def createGame(self):
Fan.createGame(self, playcards=4)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return abs(card1.rank-card2.rank) == 1
@ -325,7 +323,7 @@ class ThreeShufflesAndADraw(LaBelleLucie):
class Trefoil(LaBelleLucie):
GAME_VERSION = 2
Foundation_Class = StackWrapper(SS_FoundationStack, min_cards=1)
Foundation_Classes = [StackWrapper(SS_FoundationStack, min_cards=1)]
def createGame(self):
return Fan.createGame(self, rows=(5,5,5,1))
@ -395,8 +393,7 @@ class Intelligence_ReserveStack(ReserveStack, DealRow_StackMethods):
class Intelligence(Fan):
Foundation_Class = SS_FoundationStack
Foundation_Class_2 = SS_FoundationStack
Foundation_Classes = [SS_FoundationStack, SS_FoundationStack]
Talon_Class = StackWrapper(Intelligence_Talon, max_rounds=3)
RowStack_Class = StackWrapper(Intelligence_RowStack, base_rank=NO_RANK)
@ -432,8 +429,8 @@ class IntelligencePlus(Intelligence):
# ************************************************************************/
class HouseInTheWood(Fan):
Foundation_Class = Foundation_Class_2 = SS_FoundationStack
RowStack_Class = UD_SS_RowStack
Foundation_Classes = [SS_FoundationStack, SS_FoundationStack]
RowStack_Class = StackWrapper(UD_SS_RowStack, base_rank=NO_RANK)
def createGame(self):
Fan.createGame(self, rows=(6,6,6,6,6,5))
@ -445,9 +442,10 @@ class HouseInTheWood(Fan):
self.s.talon.dealRow(rows=self.s.rows[:35])
assert len(self.s.talon.cards) == 0
class HouseOnTheHill(HouseInTheWood):
Foundation_Class = SS_FoundationStack
Foundation_Class_2 = StackWrapper(SS_FoundationStack, base_rank=KING, dir=-1)
Foundation_Classes = [SS_FoundationStack,
StackWrapper(SS_FoundationStack, base_rank=KING, dir=-1)]
# /***********************************************************************
@ -511,10 +509,10 @@ class CloverLeaf(Game):
#
def startGame(self):
for i in range(3):
for i in range(2):
self.s.talon.dealRow(frames=0)
self.startDealSample()
#self.s.talon.dealRow()
self.s.talon.dealRow()
self.s.talon.dealRow(rows=self.s.foundations)
def _shuffleHook(self, cards):
@ -564,6 +562,53 @@ class BoxFan(Fan):
(card1.rank + 1 == card2.rank or card2.rank + 1 == card1.rank))
# /***********************************************************************
# // Troika
# ************************************************************************/
class Troika(Fan):
RowStack_Class = StackWrapper(RK_RowStack, dir=0, base_rank=NO_RANK, max_cards=3)
def createGame(self):
Fan.createGame(self, rows=(6, 6, 6), playcards=4)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank == card2.rank
def startGame(self, ncards=3):
self.startDealSample()
for r in self.s.rows:
for i in range(ncards):
if not self.s.talon.cards:
break
c = self.s.talon.cards[-1]
t = r
if c.rank == ACE:
t = self.s.foundations[c.suit]
self.s.talon.dealRow(rows=[t], frames=4)
class TroikaPlus_RowStack(RK_RowStack):
def getBottomImage(self):
return self.game.app.images.getReserveBottom()
class TroikaPlus(Troika):
RowStack_Class = StackWrapper(TroikaPlus_RowStack, dir=0,
##base_rank=NO_RANK,
max_cards=4)
def createGame(self):
Fan.createGame(self, rows=(5, 5, 3), playcards=5)
def startGame(self):
Troika.startGame(self, ncards=4)
## for i in range(3):
## self.s.talon.dealRow(rows=self.s.rows[:-1], frames=0)
## self.startDealSample()
## self.s.talon.dealRow(rows=self.s.rows[:-1])
# register the game
registerGame(GameInfo(56, Fan, "Fan",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
@ -595,4 +640,8 @@ registerGame(GameInfo(347, FreeFan, "Free Fan",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(385, BoxFan, "Box Fan",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(516, Troika, "Troika",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(517, TroikaPlus, "Troika +",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))

View file

@ -168,6 +168,37 @@ class LadyBetty(Numerica):
# // Puss in the Corner
# ************************************************************************/
class PussInTheCorner_Talon(OpenTalonStack):
rightclickHandler = OpenStack.rightclickHandler
def canDealCards(self):
if self.round != self.max_rounds:
return True
return False
def clickHandler(self, event):
if self.cards:
return OpenStack.clickHandler(self, event)
else:
return TalonStack.clickHandler(self, event)
def dealCards(self, sound=0):
ncards = 0
old_state = self.game.enterState(self.game.S_DEAL)
if not self.cards and self.round != self.max_rounds:
self.game.nextRoundMove(self)
self.game.startDealSample()
for r in self.game.s.rows:
while r.cards:
self.game.moveMove(1, r, self, frames=4)
self.game.flipMove(self)
ncards += 1
self.fillStack()
self.game.stopSamples()
self.game.leaveState(old_state)
return ncards
class PussInTheCorner_Foundation(SS_FoundationStack):
def __init__(self, x, y, game, **cap):
kwdefault(cap, base_suit=ANY_SUIT)
@ -219,7 +250,7 @@ class PussInTheCorner(Numerica):
s.foundations.append(PussInTheCorner_Foundation(x, y, self,
max_move=0))
x, y = l.XM+3*l.XS/2, l.YM
s.talon = OpenTalonStack(x, y, self)
s.waste = s.talon = PussInTheCorner_Talon(x, y, self, max_rounds=2)
l.createText(s.talon, 'se')
# define stack-groups
@ -237,6 +268,10 @@ class PussInTheCorner(Numerica):
self.s.talon.fillStack()
def _autoDeal(self, sound=1):
return 0
# /***********************************************************************
# // Frog
# // Fly
@ -245,7 +280,8 @@ class PussInTheCorner(Numerica):
class Frog(Game):
Hint_Class = Numerica_Hint
Foundation_Class = SS_FoundationStack
##Foundation_Class = SS_FoundationStack
Foundation_Class = RK_FoundationStack
def createGame(self):
# create layout
@ -283,20 +319,23 @@ class Frog(Game):
# define stack-groups
l.defaultStackGroups()
def _shuffleHook(self, cards):
for c in cards[:]:
if c.rank == ACE:
cards.remove(c)
cards.append(c)
return cards
def startGame(self):
tc = self.s.talon.cards[-1]
self.startDealSample()
self.s.talon.dealRow(rows=[self.s.foundations[tc.suit*2]])
for i in range(13):
self.s.talon.dealRow(self.s.reserves, flip=0)
self.flipMove(self.s.reserves[0])
n = 0
f = 0
while True:
c = self.s.talon.cards[-1]
if c.rank == ACE:
r = self.s.foundations[f]
f += 1
##r = self.s.foundations[c.suit*2]
else:
r = self.s.reserves[0]
n += 1
self.s.talon.dealRow(rows=[r])
if n == 13:
break
self.s.talon.dealCards()
@ -312,8 +351,7 @@ class Fly(Frog):
self.startDealSample()
self.s.talon.dealRow(rows=self.s.foundations)
for i in range(13):
self.s.talon.dealRow(self.s.reserves, flip=0)
self.flipMove(self.s.reserves[0])
self.s.talon.dealRow(self.s.reserves)
self.s.talon.dealCards()
@ -588,7 +626,8 @@ registerGame(GameInfo(171, LadyBetty, "Lady Betty",
registerGame(GameInfo(355, Frog, "Frog",
GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(356, Fly, "Fly",
GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED))
GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED,
rules_filename='frog.html'))
registerGame(GameInfo(357, Gnat, "Gnat",
GI.GT_NUMERICA, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(378, Gloaming, "Gloaming",
@ -598,7 +637,7 @@ registerGame(GameInfo(379, Chamberlain, "Chamberlain",
registerGame(GameInfo(402, Toad, "Toad",
GI.GT_NUMERICA | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(430, PussInTheCorner, "Puss in the Corner",
GI.GT_NUMERICA, 1, 0, GI.SL_BALANCED))
GI.GT_NUMERICA, 1, 1, GI.SL_BALANCED))
registerGame(GameInfo(435, Shifting, "Shifting",
GI.GT_NUMERICA, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(472, Strategerie, "Strategerie",

View file

@ -699,11 +699,13 @@ registerGame(GameInfo(354, Boudoir, "Boudoir",
registerGame(GameInfo(410, CaptiveQueens, "Captive Queens",
GI.GT_1DECK_TYPE, 1, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(418, Contradance, "Contradance",
GI.GT_2DECK_TYPE, 2, 1, GI.SL_LUCK))
GI.GT_2DECK_TYPE, 2, 1, GI.SL_LUCK,
altnames=("Cotillion",) ))
registerGame(GameInfo(419, IdleAces, "Idle Aces",
GI.GT_2DECK_TYPE, 2, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(423, LadyOfTheManor, "Lady of the Manor",
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK,
altnames=("Vassal", "La Chatelaine") ))
registerGame(GameInfo(424, Matrimony, "Matrimony",
GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(429, Patriarchs, "Patriarchs",