1
0
Fork 0
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: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@83 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
skomoroh 2006-10-23 21:15:36 +00:00
parent 0326e8f208
commit 9f6d8c62a0
4 changed files with 53 additions and 17 deletions

View file

@ -847,6 +847,15 @@ class Soother(Game):
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
registerGame(GameInfo(146, StreetsAndAlleys, "Streets and Alleys",
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))
registerGame(GameInfo(650, CastlesEnd, "Castles End",
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))

View file

@ -45,7 +45,7 @@ from pysollib.layout import Layout
from pysollib.hint import AbstractHint, DefaultHint, CautiousDefaultHint
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
rows = self.game.s.rows
reserves = self.game.s.reserves
for i in range(8):
for i in range(len(rows)):
r1 = reserves[i]
r2 = rows[i]
if r1.cards:
@ -632,16 +632,18 @@ class Trapdoor_Talon(DealRowTalonStack):
class Trapdoor(Gypsy):
Foundation_Class = SS_FoundationStack
RowStack_Class = AC_RowStack
def createGame(self):
kw = {'rows' : 8,
def createGame(self, rows=8):
kw = {'rows' : rows,
'waste' : 0,
'texts' : 1,
'reserves' : 8,}
'reserves' : rows,}
Layout(self).createGame(layout_method = Layout.gypsyLayout,
talon_class = Trapdoor_Talon,
foundation_class = SS_FoundationStack,
row_class = AC_RowStack,
foundation_class = self.Foundation_Class,
row_class = self.RowStack_Class,
reserve_class = OpenStack,
**kw
)
@ -650,6 +652,29 @@ class Trapdoor(Gypsy):
Gypsy.startGame(self)
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
# ************************************************************************/
@ -784,4 +809,5 @@ registerGame(GameInfo(584, Eclipse, "Eclipse",
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(640, BrazilianPatience, "Brazilian Patience",
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))

View file

@ -128,6 +128,7 @@ class Matrix_RowStack(OpenStack):
row = game.s.rows
if not self.cards or game.drag.stack is self or self.basicIsBlocked():
return 1
game.playSample("move", priority=10)
stack_map = self.blockMap()
for j in range(2):
dir = 1
@ -140,11 +141,11 @@ class Matrix_RowStack(OpenStack):
step = 1
from_stack = row[stack_map[j][i + dir]]
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
step = step + 1
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
@ -302,7 +303,7 @@ class Matrix3(Game):
x = x + l.CW
# Create talon
x, y = l.XM - l.XS, l.YM
x, y = -2*l.XS, 0 # invisible
s.talon = InitialDealTalonStack(x, y, self)
# Define stack groups
@ -347,7 +348,7 @@ class Matrix3(Game):
for r in s[:l]:
if not r.cards or not r.cards[0].rank == r.id:
return 0
self.s.talon.dealRow(rows=s[l:], frames=3)
self.s.talon.dealRow(rows=s[l:], frames=0)
return 1
def shallHighlightMatch(self, stack1, card1, stack2, card2):

View file

@ -43,7 +43,7 @@ import gettext
# PySol imports
from mfxutil import destruct, EnvError
from util import CARDSET, DataLoader
from settings import PACKAGE, TOOLKIT, VERSION, USE_TILE
from settings import PACKAGE, TOOLKIT, VERSION
from resource import Tile
from gamedb import GI
from app import Application
@ -52,7 +52,7 @@ from pysolaudio import AbstractAudioClient, PysolSoundServerModuleClient
from pysolaudio import Win32AudioClient, OSSAudioClient, PyGameAudioClient
# 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 TclError, MfxRoot
from pysoltk import PysolProgressBar
@ -508,7 +508,5 @@ def main(args=None):
raise Exception, "-1 % 13 != 12"
# run it
r = pysol_main(args)
##print "FINAL\n"; dumpmem()
return r
return pysol_main(args)