def update(self): speed = 0 shutterDir = 0 if self.slowCounter == 0: self.slowCounter = -1 if self.didStop: soundSystem.playSound(4) else: soundSystem.playSound(3) if self.slowCounter <= 0: speed = PHASE_IMAGE_SPEED_FAST if self.didStop: shutterDir = -1 else: shutterDir = 1 else: speed = PHASE_IMAGE_SPEED_SLOW self.slowCounter -= 1 shutterDir = 0 self.rects[0].left -= speed self.rects[1].left += speed self.shutterRects[0].top += SHUTTER_SPEED * shutterDir self.shutterRects[1].top -= SHUTTER_SPEED * shutterDir if (self.rects[0].left <= self.rects[1].left) and (not self.didStop): self.didStop = True self.slowCounter = PHASE_IMAGE_SLOW_TIME if (self.rects[0].right < 0) and (self.rects[1].left > SCREEN_SIZE[0]): self.goForward = True
def cancel(self): #Occurs when the Cancel button is pressed if self.stationOpen: #When Character Station is open self.stationOpen = False elif self.menuOpen: #When Menu is open self.menuOpen = False elif self.targetOpen: #When choosing a target self.targetOpen = False self.setCursorPos(self.currentTarget[0], self.currentTarget[1]) self.currentTarget = None self.movementArea = None self.auras = [] elif self.movementOpen: #When directing movement self.movementOpen = False self.setCursorPos(self.currentTarget[0], self.currentTarget[1]) self.currentTarget = None self.currentAbility = None self.movementArea = None self.auras = [] else: #Other citsumtances return soundSystem.playSound(2)
def confirm(self): currChar = self.planningScreen.currActiveCharacter() self.planningScreen.pieceBox.tryLight(currChar) if self.planningScreen.cursorPos[1].isMax(): tempNum = self.planningScreen.numActiveChars() if (tempNum >= 1) and (tempNum <= MAX_CHAR_ACTIVE): soundSystem.playSound(1) self.goForward = True
def confirm(self): if self.planningScreen.cursorPos[1].isMax(): self.goForward = True elif self.planningScreen.validCharacter(): if not(self.planningScreen.selectedXP): if self.planningScreen.xp >= self.planningScreen.currNextLevel(): self.planningScreen.goSelectXP() self.planningScreen.xpMeter.segment = self.planningScreen.currNextLevel() else: self.planningScreen.confirmXP() else: return soundSystem.playSound(1)
def confirm(self): #Occurs when the Enter button is pressed if self.stationOpen: #When Character Station is open self.charStation.selectChar() self.stationOpen = False self.menuOpen = False self.insertActor(self.characters[self.charStation.position.value - 1], self.cursorTuple()) elif self.menuOpen: #When Menu is open if self.battleMenu.text() == "Place Character": self.stationOpen = True self.charStation.checkRight() elif self.battleMenu.text() == "Remove Character": self.returnCharToStation() self.removeActor(self.cursorTuple()) self.menuOpen = False elif self.battleMenu.text() == "Begin Battle" or self.battleMenu.text() == "End Turn": self.menuOpen = False self.movementOpen = False if self.stationOpen: fatalError("Turn was ended while character station was open") self.nextPhase() elif self.battleMenu.text() == "Spell": self.cardsOpen = True self.menuOpen = False elif self.battleMenu.text() == "Weapon": self.performAction(-1) self.setSpending([0, 0, 0]) self.menuOpen = False elif self.battleMenu.text() == "Item": self.actionOutCharacter() self.menuOpen = False elif (self.targetOpen): targetSquares = self.findAOETargets(self.currentAbility) if (self.cursorTuple() in self.movementArea) and (len(targetSquares) > 0): self.squaresToAttack = targetSquares self.targetOpen = False self.auras = [] self.abilityChainOpen = True self.beginAbilityChain() elif (self.movementOpen == False) and (self.overMovableCharacter()): #When over a selectable character self.movementOpen = True self.currentTarget = (self.cursorPos[0].value, self.cursorPos[1].value) self.movementArea = self.findMovementArea(self.currentTarget, "P") self.auras.append(tileAura.TileAura(AURA_COLORS["blue"], self.movementArea)) elif (self.movementOpen) and (not self.matchCursorLoc(self.currentTarget)): #When directing movement and not over the moving character if self.validMoveSpot(self.cursorTuple()) and self.isInMovementArea(self.cursorTuple()): self.moveCharacter() self.closeMovement() else: #Other circumstances - Build Menu self.buildMenu() if self.phase == 1: self.closeMovement() self.menuOpen = True soundSystem.playSound(1) if not self.movementOpen: self.updateActiveAnimation() self.updateCornerInfo()
def cancel(self): if self.planningScreen.selectedXP: self.planningScreen.selectedXP = False self.planningScreen.xpMeter.segment = 0 soundSystem.playSound(2)
def lightCharacter(self, currChar): self.charSelections[currChar] = not(self.charSelections[currChar]) if self.charSelections[currChar]: soundSystem.playSound(1) else: soundSystem.playSound(2)
def playSound(self): soundSystem.playSound(0)