def dealCards(self, sound=False, shuffle=False): old_state = self.game.enterState(self.game.S_FILL) self.game.saveStateMove(2 | 16) # for undo empties = False for r in self.game.s.reserves: if not r.cards: empties = True if empties: self.game.draws_with_open += 1 else: self.game.draws_with_open = 0 self.game.saveStateMove(1 | 16) # for redo self.game.leaveState(old_state) WasteTalonStack.dealCards(self, sound, shuffle)
def dealCards(self, sound=False): game = self.game old_state = game.enterState(game.S_FILL) game.saveStateMove(2 | 16) # for undo game.used = False game.saveStateMove(1 | 16) # for redo game.leaveState(old_state) return WasteTalonStack.dealCards(self, sound)
def dealCards(self, sound=False): if self.cards: return WasteTalonStack.dealCards(self, sound=sound) if sound: self.game.startDealSample() self._redeal() if sound: self.game.stopSamples() return
def dealCards(self, sound=False): if self.round == self.max_rounds: return 0 if self.cards: return WasteTalonStack.dealCards(self, sound) # last round num_cards = WasteTalonStack.dealCards(self, sound) wastes = [self.waste] + list(self.game.s.reserves) old_state = self.game.enterState(self.game.S_DEAL) if self.cards: if sound and not self.game.demo: self.game.startDealSample() num_cards = min(len(self.cards), 8) for i in range(num_cards): if not self.cards[-1].face_up: self.game.flipMove(self) self.game.moveMove(1, self, wastes[i], frames=4, shadow=0) if sound and not self.game.demo: self.game.stopSamples() self.game.leaveState(old_state) return num_cards
def dealCards(self, sound=False): if self.round == self.max_rounds: return 0 if self.cards: return WasteTalonStack.dealCards(self, sound) # last round num_cards = WasteTalonStack.dealCards(self, sound) wastes = [self.waste]+list(self.game.s.reserves) old_state = self.game.enterState(self.game.S_DEAL) if self.cards: if sound and not self.game.demo: self.game.startDealSample() num_cards = min(len(self.cards), 8) for i in range(num_cards): if not self.cards[-1].face_up: self.game.flipMove(self) self.game.moveMove(1, self, wastes[i], frames=4, shadow=0) if sound and not self.game.demo: self.game.stopSamples() self.game.leaveState(old_state) return num_cards
def dealCards(self, sound=False): game = self.game old_state = game.enterState(game.S_FILL) game.saveStateMove(2 | 16) # for undo if len(self.cards) > 0: game.rank += 1 else: game.deadDeals += 1 if game.rank > 12: game.rank = 0 game.saveStateMove(1 | 16) # for redo game.leaveState(old_state) return WasteTalonStack.dealCards(self, sound)
def dealCards(self, sound=False): self.num_deal = 4-self.round return WasteTalonStack.dealCards(self, sound=sound)
def dealCards(self, sound=False): self.num_deal = 4 - self.round WasteTalonStack.dealCards(self, sound=sound)