def __init__(self, serialNum, maze, randomNumGen, difficulty, startTile, cogdoSuitType, walkAnimName=None): data = Globals.SuitData[cogdoSuitType] MazeSuit.__init__( self, serialNum, maze, randomNumGen, data['cellWalkPeriod'], difficulty, data['dnaName'], startTile=startTile, walkSameDirectionProb=Globals.SuitWalkSameDirectionProb, walkTurnAroundProb=Globals.SuitWalkTurnAroundProb, uniqueRandomNumGen=False, walkAnimName=walkAnimName) FSM.__init__(self, 'CogdoMazeSuit') CogdoMazeSplattable.__init__( self, self.suit, '%s-%i' % (Globals.SuitCollisionName, self.serialNum), 1.5) if 'scale' in data: self.suit.setScale(data['scale']) self.hp = data['hp'] self.type = cogdoSuitType self.memos = data['memos'] self.deathSuit = self.suit.getLoseActor() self.deathSuit.pose('lose', 0) BattleParticles.loadParticles() self._initSfx()
def __init__(self, serialNum, maze, randomNumGen, difficulty, startTile, cogdoSuitType, walkAnimName = None): data = Globals.SuitData[cogdoSuitType] MazeSuit.__init__(self, serialNum, maze, randomNumGen, data['cellWalkPeriod'], difficulty, data['dnaName'], startTile=startTile, walkSameDirectionProb=Globals.SuitWalkSameDirectionProb, walkTurnAroundProb=Globals.SuitWalkTurnAroundProb, uniqueRandomNumGen=False, walkAnimName=walkAnimName) FSM.__init__(self, 'CogdoMazeSuit') CogdoMazeSplattable.__init__(self, self.suit, '%s-%i' % (Globals.SuitCollisionName, self.serialNum), 1.5) if 'scale' in data: self.suit.setScale(data['scale']) self.hp = data['hp'] self.type = cogdoSuitType self.memos = data['memos'] self.deathSuit = self.suit.getLoseActor() self.deathSuit.pose('lose', 0) BattleParticles.loadParticles() self._initSfx()
def __updateTask(self, task): dt = globalClock.getDt() self.localPlayer.update(dt) for player in self.players: curTX, curTY = self.maze.world2tileClipped(player.toon.getX(), player.toon.getY()) self.guiMgr.mazeMapGui.updateToon(player.toon, curTX, curTY) self.__updateGags() if Globals.QuakeSfxEnabled: self.__updateQuakeSound() for pickup in self.pickups: pickup.update(dt) MazeSuit.thinkSuits(self.suits, self.distGame.getStartTime()) return Task.cont
def think(self, curTic, curT, unwalkables): MazeSuit.think(self, curTic, curT, unwalkables) messenger.send(self.ThinkEventName, [self, self.TX, self.TY])
def initCollisions(self): MazeSuit.initCollisions(self) self.collNodePath.setScale(0.75) self.accept(self.uniqueName('again' + self.COLL_SPHERE_NAME), self.handleEnterSphere)
def gameStart(self, gameStartTime): MazeSuit.gameStart(self, gameStartTime) self.accept(Globals.GagCollisionName + '-into-' + self.gagCollisionName, self.handleGagHit) messenger.send(self.ThinkEventName, [self, self.TX, self.TY])
def destroy(self): BattleParticles.unloadParticles() self.ignoreAll() self._destroySfx() CogdoMazeSplattable.destroy(self) MazeSuit.destroy(self)
def gameStart(self, gameStartTime): MazeSuit.gameStart(self, gameStartTime) self.accept( Globals.GagCollisionName + '-into-' + self.gagCollisionName, self.handleGagHit) messenger.send(self.ThinkEventName, [self, self.TX, self.TY])