def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     FSM.__init__(self, 'ToonfestBalloonFSM')
     self.avId = 0
     self.flightPathIndex = 0
     self.balloon = loader.loadModel('phase_6/models/events/tf_balloon')
     self.balloon.reparentTo(base.render)
     self.balloon.setPos(*ToonfestBalloonGlobals.BalloonBasePosition)
     self.balloon.setH(250)
     self.balloon.setScale(ToonfestBalloonGlobals.BalloonScale)
     self.cr.parentMgr.registerParent(ToontownGlobals.SPToonfestBalloon, self.balloon)
     cs = CollisionSphere(0, 0, 0, 9)
     cs.setTangible(False)
     self.collisionNP = self.balloon.find('**/basket_wall_collision')
     self.collisionNP.node().addSolid(cs)
     self.alec = NPCToons.createLocalNPC(91915)
     self.alec.setPos(0.7, 0.7, 0.4)
     self.alec.setH(150)
     self.alec.setScale(1 / ToonfestBalloonGlobals.BalloonScale)
     self.alec.initializeBodyCollisions('toon')
     self.alec.setPickable(0)
     self.alec.addActive()
     self.alec.startBlink()
     self.alec.loop('neutral')
     self.flightPaths = ToonfestBalloonGlobals.generateFlightPaths(self)
     self.toonFlightPaths = ToonfestBalloonGlobals.generateToonFlightPaths(self)
     self.speechSequence = ToonfestBalloonGlobals.generateSpeechSequence(self)
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self._scores = {}
     self._names = {}
     self._teams = {}
     self._types = {}
     self._stats = {}
예제 #3
0
    def __init__(self, cr, name = None, color = None, gameId = None):
        DistributedObject.__init__(self, cr)

        # This is true if this avatar represents the "local avatar",
        # i.e. the player at the keyboard, as opposed to a remote
        # player.
        self.localPlayer = False

        # The doId of the game we've joined.
        self.gameId = gameId

        # The doId of the associated avatar.
        self.avId = 0

        # The list of avatars onto which this player has painted.
        self.paintedAvatars = []

        self.name = name
        self.brushRadius = 1
        self.brushes = {}
        self.setColor(color)
        self.posterData = ('', 0)
        self.score = 0
        self.wallCount = 0
        self.floorCount = 0
        self.pixelCount = 0
        self.avPixelCount = 0
        self.onMePixelCount = 0
        self.bonus = 1
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.cr.cameraManager = self
     self.mainCam = 0
     self.cameraIds = []
     self.cameraViewEnabled = False
     self.tvOn = True
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.shardId = 0
     self.population = 0
     self.popLimits = [
         0,
         0]
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)
        self.parent = None
        self.fixtures = {}
        self.cameraId = base.config.GetInt('camera-id',0)

        pass
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)
        FSM.__init__(self, 'FlippyStandFSM')
        self.flippyStand = Actor.Actor('phase_4/models/events/election_flippyStand-mod', {'idle': 'phase_4/models/events/election_flippyStand-idle'})
        self.flippyStand.reparentTo(render)
        self.flippyStand.setScale(0.55)
        self.flippyStand.setHpr(315, 0, 349.7)
        self.flippyStand.setPos(180, -250, 9.58)
        self.flippyStand.exposeJoint(None, 'modelRoot', 'LInnerShoulder')
        flippyTable = self.flippyStand.find('**/LInnerShoulder')
        self.flippyStand.exposeJoint(None, 'modelRoot', 'Box_Joint')
        wheelbarrowJoint = self.flippyStand.find('**/Box_Joint').attachNewNode('Pie_Joint')
        wheelbarrow = self.flippyStand.find('**/Box')
        wheelbarrow.setPosHprScale(-2.39, 0.0, 1.77, 0.0, 0.0, 6.0, 1.14, 1.54, 0.93)
        pie = loader.loadModel('phase_3.5/models/props/tart')
        pieS = pie.copyTo(flippyTable)
        pieS.setPosHprScale(-2.61, -0.37, -1.99, 355.6, 90.0, 4.09, 1.6, 1.6, 1.6)
        for pieSettings in ElectionGlobals.FlippyWheelbarrowPies:
            pieModel = pie.copyTo(wheelbarrowJoint)
            pieModel.setPosHprScale(*pieSettings)

        wheelbarrowJoint.setPosHprScale(3.94, 0.0, 1.06, 270.0, 344.74, 0.0, 1.43, 1.12, 1.0)
        self.restockSfx = loader.loadSfx('phase_9/audio/sfx/CHQ_SOS_pies_restock.ogg')
        cs = CollisionBox(Point3(7, 0, 0), 12, 5, 18)
        self.pieCollision = self.flippyStand.attachNewNode(CollisionNode('wheelbarrow_collision'))
        self.pieCollision.node().addSolid(cs)
        self.accept('enter' + self.pieCollision.node().getName(), self.handleWheelbarrowCollisionSphereEnter)
        self.flippyStand.loop('idle')
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)
        #self.model = loader.loadModel('environment')
        #self.model.setZ(0)
        #self.builder = Builder(self, "map.txt", "development")


        plane = CollisionPlane(Plane(Vec3(0, 0, 1), Point3(0, 0, 0)))
        cnode = CollisionNode('cnode')
        cnode.setIntoCollideMask(BitMask32.bit(1))
        cnode.setFromCollideMask(BitMask32.bit(1))
        cnode.addSolid(plane)
        self.planeNP = self.model.attachNewNode(cnode)
        self.planeNP.show()

        # Setup a traverser for the picking collisions
        self.picker = CollisionTraverser()
        # Setup mouse ray
        self.pq = CollisionHandlerQueue()
        # Create a collision Node
        pickerNode = CollisionNode('MouseRay')
        # set the nodes collision bitmask
        pickerNode.setFromCollideMask(BitMask32.bit(1))
        # create a collision ray
        self.pickerRay = CollisionRay()
        # add the ray as a solid to the picker node
        pickerNode.addSolid(self.pickerRay)
        # create a nodepath with the camera to the picker node
        self.pickerNP = base.camera.attachNewNode(pickerNode)
        # add the nodepath to the base traverser
        self.picker.addCollider(self.pickerNP, self.pq)

        print "model loaded"
        #TODO: check how to load multiple levels and set players in specific levels!
        self.accept("mouse1", self.mouseClick)
예제 #9
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     base.cr.partyManager = self
     self.allowUnreleased = False
     self.partyPlannerStyle = None
     self.partyPlannerName = None
     self.showDoid = False
     return
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.collNode = None
     self.destroyed = False
     self.smokeVfx = None
     self.barrelModel = None
     self.trailEffect = None
     self._initAudio()
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.firstAvatarId = None
     self.firstAvatarStatus = 0
     self.firstAvatarGiving = []
     self.secondAvatarId = None
     self.secondAvatarStatus = 0
     self.secondAvatarGiving = []
예제 #12
0
    def __init__(self, cr):
        try:
            self.DistributedMinigameStation_initialized
            return
        except:
            self.DistributedMinigameStation_initialized = 1

        MinigameStation.MinigameStation.__init__(self)
        DistributedObject.__init__(self, cr)
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     
     self.startTime = 0
     self._name = ""
     self.waiter = False
     
     self.__msgs = []
     self.cr.DSIMgr = self
예제 #14
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.myTurret = None
     self.guiFrame = None
     self.guiLabel = None
     self.guiBar = None
     self.guiBg = None
     self.turretGag = None
     return
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     FSM.FSM.__init__(self, 'PVPGameBase')
     base.cr.gameRules = self
     self.scoreboardHolder = ScoreboardHolder(self)
     self.statsHolder = StatsHolder(self)
     self.stats = { }
     self.rowColors = { }
     localAvatar.guiMgr.radarGui.request('On')
     self.request('Init')
예제 #16
0
    def __init__(self, cr):
        try:
            self.DistributedSuitManager_initialized
            return
        except:
            self.DistributedSuitManager_initialized = 1

        DistributedObject.__init__(self, cr)
        self.hood = cr.playGame.hood
        self.spawnerStatus = 0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     LawOfficeBase.LawOfficeBase.__init__(self)
     self.suitIds = []
     self.suits = []
     self.reserveSuits = []
     self.joiningReserves = []
     self.suitsInitialized = 0
     self.goonClipPlanes = { }
     self.level = None
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.destWorldGrid = None
     self.destInstance = None
     self.numInterestsCleared = 0
     self.pendingWorld = None
     self.spawnWorldName = None
     self.instanceWorldName = None
     self.doneCallback = None
     self.miniLog = MiniLog('DistributedTeleportHandler')
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     FSM.__init__(self, 'ToonfestTowerFSM')
     self.towerGeom = loader.loadModel('phase_6/models/events/tf_tower')
     self.towerGeom.reparentTo(render)
     self.towerGeom.setH(-30)
     self.towerGeom.setPos(221, -61, 4.5)
     self.base1 = self.towerGeom.find('**/base1')
     self.base2 = self.towerGeom.find('**/base2')
     self.base3 = self.towerGeom.find('**/base3')
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     Cannon.__init__(self, parent=self.getParentNodePath())
     self.localCannonMoving = False
     self.active = False
     self.activityDoId = 0
     self.activity = None
     self.gui = None
     self.toonInsideAvId = 0
     self.sign = None
     self.controllingToonAvId = None
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        self.grabbed = False
        self.nodePath = None
        self.bankCollectable = None
        self.collNodePath = None
        self.grabSound = None
        self.rotateIval = None
        self.floatIval = None
        self.flyTrack = None
예제 #22
0
    def __init__(self, cr):
        try:
            self.DistributedGroupStation_initialized
            return
        except:
            self.DistributedGroupStation_initialized = 1

        DistributedObject.__init__(self, cr)
        self.abortBtn = None
        self.name = None
        self.mySlot = None
        return
예제 #23
0
    def __init__(self, cr):
        try:
            self.DistributedDistrict_initialized
            return
        except:
            self.DistributedDistrict_initialized = 1

        DistributedObject.__init__(self, cr)
        self.available = 0
        self.population = 0
        self.popRecord = 0
        self.name = None
        return
예제 #24
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.bankGui = None
     self.bankTrack = None
     self.bankDialog = None
     self.hasLocalAvatar = 0
     self.hasJarOut = 0
     self.jarLods = []
     self.bankSphereEvent = 'bankSphere'
     self.bankSphereEnterEvent = 'enter' + self.bankSphereEvent
     self.bankSphereExitEvent = 'exit' + self.bankSphereEvent
     self.bankGuiDoneEvent = 'bankGuiDone'
     return
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     
     self.__announced = 0
     
     self.startTime = 0
     self._name = ""
     self.waiter = False
     
     self.__msgs = []
     self.cr.DSIMgr = self
     
     base.localAvatar.inventory.setInvasionCreditMultiplier(1)
예제 #26
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.currWave = 0
     self.maxWave = 0
     self.flagshipUIBaseNode = None
     self.baseFrame = None
     self.counter = None
     self.counterNode = None
     self.waveCount = None
     self.waveCountNode = None
     self.counterLabel = None
     self.counterLabelNode = None
     self.updateCounterTask = None
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     TimeOfDayManager.__init__(self)
     self.skyEnabled = base.config.GetBool('enable-sky', 1)
     self.syncEnabled = True
     self.isPaused = 0
     if not base.win.getGsg().isHardware():
         self.skyEnabled = False
     
     if not self.skyEnabled:
         self.skyGroup.stash()
     
     self.clockSyncData = None
     self.accept('gotTimeSync', self.handleClockSync)
예제 #28
0
파일: Cell.py 프로젝트: frainfreeze/tagger
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        self.bits = Globals.AllDirs
        self.sx = None
        self.sy = None
        self.root = None
        self.wallGeoms = {}
        self.posterDir = 0
        self.posterData = ("", 0)
        self.textures = {}
        self.lastPaintPoint = None
        self.paintDirty = 0  # A bitmask of walls
        self.flushTask = None
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        self.lt = base.localAvatar
        self.props = []
        self.pos = None
        self.radius = 0
        self.gridCells = 20
        self.propTable = [None] * self.gridCells

        for i in xrange(len(self.propTable)):
            self.propTable[i] = [None] * self.gridCells

        self.dx = 1.0 / self.gridCells
        self.occupied = []
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     WorldNode.__init__(self)
     self.islands = { }
     self.playerSpawnPts = { }
     self.playerBootPts = { }
     self.cutsceneOriginNodes = { }
     self.type = PiratesGlobals.INSTANCE_GENERIC
     self.spawnInfo = None
     self.pendingJail = None
     self._onOffState = False
     if hasattr(localAvatar, 'gameFSM') and localAvatar.gameFSM:
         localAvatar.gameFSM.setDefaultGameState('LandRoam')
     
     self.worldGrid = None
     self.fireworkShowMgr = None
예제 #31
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.invading = False
     self.activeHolidays = []
     base.localAvatar.inventory.setInvasionCreditMultiplier(1)
     base.cr.newsManager = self
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.parent = None
     self.fixtures = {}
     self.cameraId = base.config.GetInt('camera-id', 0)
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        # This is a list of the occupants of this dungeon.
        self.occupants = []
예제 #34
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.uberInterest = None
     self.population = 0
예제 #35
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self._gameFullTxt = None
     self._gameFullSeq = None
예제 #36
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     DistributedRepairGameBase.__init__(self)
     self.accept('onCodeReload', self.codeReload)
     self.gameFSM = None
     self.goldBonus = 0
예제 #37
0
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        base.cr.inGameNewsMgr = self
예제 #38
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.name = ''
     self.population = 0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     base.cr.whitelistMgr = self
예제 #40
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.shardId = 0
     self.population = 0
     self.popLimits = [0, 0]
 def __init__(self, cr):
     assert self.notify.debugStateCall(self)
     DistributedObject.__init__(self, cr)
     self.parentId = 0
     self.zoneId = 0
예제 #42
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.cr.tradeManager = self
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     Suit.__init__(self)
     self._moveIval = None
     return
예제 #44
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     SiegeManagerBase.__init__(self)
예제 #45
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     Entity.__init__(self)
     self.entnum = None
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     cr.aprilToonsMgr = self
     self.events = []
예제 #48
0
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        self.interiorDoId = 0
        self.lightSwitch = None
예제 #49
0
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)
        base.cogdoGame = self

        self._waitingStartLabel = DirectLabel(
            text = TTL.MinigameWaitingForOtherPlayers,
            text_fg = VBase4(1,1,1,1),
            relief = None,
            pos = (-0.6, 0, -0.75),
            scale = 0.075)
        self._waitingStartLabel.hide()

        self.loadFSM = ClassicFSM.ClassicFSM(
            'DistCogdoGame.loaded',
            [State.State('NotLoaded',
                         self.enterNotLoaded,
                         self.exitNotLoaded,
                         ['Loaded']),
             State.State('Loaded',
                         self.enterLoaded,
                         self.exitLoaded,
                         ['NotLoaded'])],
            # Initial state
            'NotLoaded',
            # Final state
            'NotLoaded')

        self.fsm = ClassicFSM.ClassicFSM(
            'DistCogdoGame',
            [State.State('Intro',
                         self.enterIntro,
                         self.exitIntro,
                         ['WaitServerStart']),
             State.State('WaitServerStart',
                         self.enterWaitServerStart,
                         self.exitWaitServerStart,
                         ['Game']),
             State.State('Game',
                         self.enterGame,
                         self.exitGame,
                         ['Finish']),
             State.State('Finish',
                         self.enterFinish,
                         self.exitFinish,
                         ['Off']),
             State.State('Off',
                         self.enterOff,
                         self.exitOff,
                         ['Intro'])],
            # Initial state
            'Off',
            # Final state
            'Off')
        self.fsm.enterInitialState()
        self.difficultyOverride = None
        self.exteriorZoneOverride = None
        self._gotInterior = StateVar(False)
        self._toonsInEntranceElev = StateVar(False)
        self._wantStashElevator = StateVar(False)
        self._stashElevatorFC = FunctionCall(self._doStashElevator,
                                             self._toonsInEntranceElev,
                                             self._gotInterior,
                                             self._wantStashElevator,
                                             )
예제 #50
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.startingBlocks = []
예제 #51
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     Flag.__init__(self, 'flag')
예제 #52
0
    def __init__(self, cr):
        DistributedObject.__init__(self, cr)

        self.xsize = 0
        self.ysize = 0
        self.numWalls = 0
예제 #53
0
 def __init__(self, cr):
     """Construct ourselves, set up web dispatcher."""
     assert self.notify.debugCall()
     DistributedObject.__init__(self, cr)
     base.cr.whitelistMgr = self
예제 #54
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.parentId = 0
     self.zoneId = 0
예제 #55
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     GameStatManagerBase.__init__(self)
     self.aggroModelIndex = None
     base.gsm = self
     return
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     TradableInventory.__init__(self, cr)
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.nextTime = 0
예제 #58
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.name = "NotGiven"
     self.available = 0
     self.avatarCount = 0
     self.newAvatarCount = 0
예제 #59
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     self.dnaStore = cr.playGame.dnaStore
예제 #60
0
 def __init__(self, cr):
     DistributedObject.__init__(self, cr)
     FSM.__init__(self, self.__class__.__name__)