mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
+ 2 new games
* misc. improvements git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@83 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
parent
ffc332886d
commit
9752088973
4 changed files with 53 additions and 17 deletions
|
@ -847,6 +847,15 @@ class Soother(Game):
|
||||||
return int(to_stack in self.s.rows)
|
return int(to_stack in self.s.rows)
|
||||||
|
|
||||||
|
|
||||||
|
# /***********************************************************************
|
||||||
|
# // Penelope's Web
|
||||||
|
# ************************************************************************/
|
||||||
|
|
||||||
|
class PenelopesWeb(StreetsAndAlleys):
|
||||||
|
RowStack_Class = StackWrapper(RK_RowStack, base_rank=KING)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# register the game
|
# register the game
|
||||||
registerGame(GameInfo(146, StreetsAndAlleys, "Streets and Alleys",
|
registerGame(GameInfo(146, StreetsAndAlleys, "Streets and Alleys",
|
||||||
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
@ -888,3 +897,5 @@ registerGame(GameInfo(626, Soother, "Soother",
|
||||||
GI.GT_4DECK_TYPE | GI.GT_ORIGINAL, 4, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_4DECK_TYPE | GI.GT_ORIGINAL, 4, 0, GI.SL_MOSTLY_SKILL))
|
||||||
registerGame(GameInfo(650, CastlesEnd, "Castles End",
|
registerGame(GameInfo(650, CastlesEnd, "Castles End",
|
||||||
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
registerGame(GameInfo(665, PenelopesWeb, "Penelope's Web",
|
||||||
|
GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
|
|
@ -45,7 +45,7 @@ from pysollib.layout import Layout
|
||||||
from pysollib.hint import AbstractHint, DefaultHint, CautiousDefaultHint
|
from pysollib.hint import AbstractHint, DefaultHint, CautiousDefaultHint
|
||||||
from pysollib.hint import KlondikeType_Hint, YukonType_Hint
|
from pysollib.hint import KlondikeType_Hint, YukonType_Hint
|
||||||
|
|
||||||
from spider import Spider_Hint
|
from spider import Spider_SS_Foundation, Spider_RowStack, Spider_Hint
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
@ -619,7 +619,7 @@ class Trapdoor_Talon(DealRowTalonStack):
|
||||||
n = 0
|
n = 0
|
||||||
rows = self.game.s.rows
|
rows = self.game.s.rows
|
||||||
reserves = self.game.s.reserves
|
reserves = self.game.s.reserves
|
||||||
for i in range(8):
|
for i in range(len(rows)):
|
||||||
r1 = reserves[i]
|
r1 = reserves[i]
|
||||||
r2 = rows[i]
|
r2 = rows[i]
|
||||||
if r1.cards:
|
if r1.cards:
|
||||||
|
@ -632,16 +632,18 @@ class Trapdoor_Talon(DealRowTalonStack):
|
||||||
|
|
||||||
|
|
||||||
class Trapdoor(Gypsy):
|
class Trapdoor(Gypsy):
|
||||||
|
Foundation_Class = SS_FoundationStack
|
||||||
|
RowStack_Class = AC_RowStack
|
||||||
|
|
||||||
def createGame(self):
|
def createGame(self, rows=8):
|
||||||
kw = {'rows' : 8,
|
kw = {'rows' : rows,
|
||||||
'waste' : 0,
|
'waste' : 0,
|
||||||
'texts' : 1,
|
'texts' : 1,
|
||||||
'reserves' : 8,}
|
'reserves' : rows,}
|
||||||
Layout(self).createGame(layout_method = Layout.gypsyLayout,
|
Layout(self).createGame(layout_method = Layout.gypsyLayout,
|
||||||
talon_class = Trapdoor_Talon,
|
talon_class = Trapdoor_Talon,
|
||||||
foundation_class = SS_FoundationStack,
|
foundation_class = self.Foundation_Class,
|
||||||
row_class = AC_RowStack,
|
row_class = self.RowStack_Class,
|
||||||
reserve_class = OpenStack,
|
reserve_class = OpenStack,
|
||||||
**kw
|
**kw
|
||||||
)
|
)
|
||||||
|
@ -650,6 +652,29 @@ class Trapdoor(Gypsy):
|
||||||
Gypsy.startGame(self)
|
Gypsy.startGame(self)
|
||||||
self.s.talon.dealCards()
|
self.s.talon.dealCards()
|
||||||
|
|
||||||
|
|
||||||
|
class TrapdoorSpider(Trapdoor):
|
||||||
|
Foundation_Class = Spider_SS_Foundation
|
||||||
|
RowStack_Class = Spider_RowStack
|
||||||
|
Hint_Class = Spider_Hint
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
Trapdoor.createGame(self, rows=10)
|
||||||
|
|
||||||
|
def startGame(self, flip=0):
|
||||||
|
for i in range(3):
|
||||||
|
self.s.talon.dealRow(flip=flip, frames=0)
|
||||||
|
r = self.s.rows
|
||||||
|
rows = (r[0], r[3], r[6], r[9])
|
||||||
|
self.s.talon.dealRow(rows=rows, flip=flip, frames=0)
|
||||||
|
self.startDealSample()
|
||||||
|
self.s.talon.dealRow()
|
||||||
|
self.s.talon.dealCards()
|
||||||
|
|
||||||
|
shallHighlightMatch = Game._shallHighlightMatch_RK
|
||||||
|
getQuickPlayScore = Game._getSpiderQuickPlayScore
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# // Flamenco
|
# // Flamenco
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
@ -784,4 +809,5 @@ registerGame(GameInfo(584, Eclipse, "Eclipse",
|
||||||
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
|
||||||
registerGame(GameInfo(640, BrazilianPatience, "Brazilian Patience",
|
registerGame(GameInfo(640, BrazilianPatience, "Brazilian Patience",
|
||||||
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
registerGame(GameInfo(666, TrapdoorSpider, "Trapdoor Spider",
|
||||||
|
GI.GT_SPIDER | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
|
|
@ -128,6 +128,7 @@ class Matrix_RowStack(OpenStack):
|
||||||
row = game.s.rows
|
row = game.s.rows
|
||||||
if not self.cards or game.drag.stack is self or self.basicIsBlocked():
|
if not self.cards or game.drag.stack is self or self.basicIsBlocked():
|
||||||
return 1
|
return 1
|
||||||
|
game.playSample("move", priority=10)
|
||||||
stack_map = self.blockMap()
|
stack_map = self.blockMap()
|
||||||
for j in range(2):
|
for j in range(2):
|
||||||
dir = 1
|
dir = 1
|
||||||
|
@ -140,11 +141,11 @@ class Matrix_RowStack(OpenStack):
|
||||||
step = 1
|
step = 1
|
||||||
from_stack = row[stack_map[j][i + dir]]
|
from_stack = row[stack_map[j][i + dir]]
|
||||||
while not from_stack is self:
|
while not from_stack is self:
|
||||||
from_stack.playMoveMove(1, to_stack, frames = 0, sound = 1)
|
from_stack.playMoveMove(1, to_stack, frames=0, sound=0)
|
||||||
to_stack = from_stack
|
to_stack = from_stack
|
||||||
step = step + 1
|
step = step + 1
|
||||||
from_stack = row[stack_map[j][i + dir * step]]
|
from_stack = row[stack_map[j][i + dir * step]]
|
||||||
self.playMoveMove(1, to_stack, frames = 0, sound = 1)
|
self.playMoveMove(1, to_stack, frames=0, sound=0)
|
||||||
return 1
|
return 1
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@ -302,7 +303,7 @@ class Matrix3(Game):
|
||||||
x = x + l.CW
|
x = x + l.CW
|
||||||
|
|
||||||
# Create talon
|
# Create talon
|
||||||
x, y = l.XM - l.XS, l.YM
|
x, y = -2*l.XS, 0 # invisible
|
||||||
s.talon = InitialDealTalonStack(x, y, self)
|
s.talon = InitialDealTalonStack(x, y, self)
|
||||||
|
|
||||||
# Define stack groups
|
# Define stack groups
|
||||||
|
@ -347,7 +348,7 @@ class Matrix3(Game):
|
||||||
for r in s[:l]:
|
for r in s[:l]:
|
||||||
if not r.cards or not r.cards[0].rank == r.id:
|
if not r.cards or not r.cards[0].rank == r.id:
|
||||||
return 0
|
return 0
|
||||||
self.s.talon.dealRow(rows=s[l:], frames=3)
|
self.s.talon.dealRow(rows=s[l:], frames=0)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
|
|
@ -43,7 +43,7 @@ import gettext
|
||||||
# PySol imports
|
# PySol imports
|
||||||
from mfxutil import destruct, EnvError
|
from mfxutil import destruct, EnvError
|
||||||
from util import CARDSET, DataLoader
|
from util import CARDSET, DataLoader
|
||||||
from settings import PACKAGE, TOOLKIT, VERSION, USE_TILE
|
from settings import PACKAGE, TOOLKIT, VERSION
|
||||||
from resource import Tile
|
from resource import Tile
|
||||||
from gamedb import GI
|
from gamedb import GI
|
||||||
from app import Application
|
from app import Application
|
||||||
|
@ -52,7 +52,7 @@ from pysolaudio import AbstractAudioClient, PysolSoundServerModuleClient
|
||||||
from pysolaudio import Win32AudioClient, OSSAudioClient, PyGameAudioClient
|
from pysolaudio import Win32AudioClient, OSSAudioClient, PyGameAudioClient
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from pysoltk import tkversion, wm_withdraw, wm_set_icon, loadImage
|
from pysoltk import tkversion, wm_withdraw, loadImage
|
||||||
from pysoltk import MfxMessageDialog, MfxExceptionDialog
|
from pysoltk import MfxMessageDialog, MfxExceptionDialog
|
||||||
from pysoltk import TclError, MfxRoot
|
from pysoltk import TclError, MfxRoot
|
||||||
from pysoltk import PysolProgressBar
|
from pysoltk import PysolProgressBar
|
||||||
|
@ -508,7 +508,5 @@ def main(args=None):
|
||||||
raise Exception, "-1 % 13 != 12"
|
raise Exception, "-1 % 13 != 12"
|
||||||
|
|
||||||
# run it
|
# run it
|
||||||
r = pysol_main(args)
|
return pysol_main(args)
|
||||||
##print "FINAL\n"; dumpmem()
|
|
||||||
return r
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue