예제 #1
0
 def onDoorCloseFinish(self):
     if self.index == 1:
         if self.localAvOnElevator:
             base.transitions.fadeScreen(1)
             self.thebldg.d_readyForNextFloor()
             self.localAvOnElevator = False
         else:
             requestStatus = {
                 'zoneId':
                 ZoneUtil.getZoneId(
                     ZoneUtil.getHoodId(self.zoneId, street=1)),
                 'hoodId':
                 self.cr.playGame.hood.hoodId,
                 'where':
                 'playground',
                 'avId':
                 base.localAvatar.doId,
                 'loader':
                 'safeZoneLoader',
                 'shardId':
                 None,
                 'wantLaffMeter':
                 1,
                 'world':
                 base.cr.playGame.getCurrentWorldName(),
                 'how':
                 'teleportIn'
             }
             self.cr.playGame.getPlace().doneStatus = requestStatus
             messenger.send(self.cr.playGame.getPlace().doneEvent)
예제 #2
0
 def diedStateDone(self, requestStatus):
     hood = self.cr.playGame.hood.id
     if hood == CIGlobals.BattleTTC:
         hood = CIGlobals.ToontownCentral
     toZone = ZoneUtil.getZoneId(hood)
     if self.zoneId != toZone:
         requestStatus = {'zoneId': toZone,
          'hoodId': hood,
          'where': ZoneUtil.getWhereName(toZone),
          'avId': self.doId,
          'loader': ZoneUtil.getLoaderName(toZone),
          'shardId': None,
          'wantLaffMeter': 1,
          'how': 'teleportIn'}
         self.cr.playGame.getPlace().doneStatus = requestStatus
         messenger.send(self.cr.playGame.getPlace().doneEvent)
     else:
         return
     return
예제 #3
0
    def diedStateDone(self, requestStatus):
        hood = self.cr.playGame.hood.id
        if hood == CIGlobals.BattleTTC:
            hood = CIGlobals.ToontownCentral
        toZone = ZoneUtil.getZoneId(hood)
        if self.zoneId != toZone:
            requestStatus = {
                'zoneId': toZone,
                'hoodId': hood,
                'where': ZoneUtil.getWhereName(toZone),
                'avId': self.doId,
                'loader': ZoneUtil.getLoaderName(toZone),
                'shardId': None,
                'wantLaffMeter': 1,
                'how': 'teleportIn'
            }
            self.cr.playGame.getPlace().doneStatus = requestStatus
            messenger.send(self.cr.playGame.getPlace().doneEvent)

        else:
            return
    def enterMapPage(self):
        if base.localAvatar.getAdminToken() > -1:
            self.createPageButtons('inventoryPage', 'adminPage')
        else:
            self.createPageButtons('inventoryPage', None)
        self.setTitle("")

        themap = loader.loadModel('phase_3.5/models/gui/toontown_map.bam')
        self.frame = DirectFrame(parent=aspect2d,
                                 relief=None,
                                 image=themap,
                                 image_scale=(1.8, 1, 1.35),
                                 scale=0.97,
                                 pos=(0, 0, 0.0775))
        cloudpos = [[(-0.61, 0, 0.18), (0.55, 0.25, 0.37), (180, 0, 0)],
                    [(-0.54, 0, 0.34), (0.76, 0.4, 0.55), (180, 0, 0)],
                    [(-0.55, 0, -0.09), (0.72, 0.4, 0.55), (0, 0, 0)],
                    [(-0.67, 0, -0.51), (0.5, 0.29, 0.38), (180, 0, 0)],
                    [(-0.67, 0, 0.51), (0.50, 0.29, 0.38), (0, 0, 0)],
                    [(0.67, 0, 0.51), (0.5, 0.29, 0.38), (0, 0, 0)],
                    [(0.35, 0, -0.46), (0.63, 0.35, 0.45), (0, 0, 0)],
                    [(0.18, 0, -0.45), (0.52, 0.27, 0.32), (0, 0, 0)],
                    [(0.67, 0, -0.44), (0.63, 0.35, 0.48), (180, 0, 0)]]
        hoodclouds = [  #[(0.02, 0, -0.17),  (0.63, 0.35, 0.48), (180, 0, 0), CIGlobals.ToontownCentral],
            [(0.63, 0, -0.13), (0.63, 0.35, 0.40), (0, 0, 0),
             CIGlobals.DonaldsDock],
            [(0.51, 0, 0.25), (0.57, 0.35, 0.40), (0, 0, 0),
             CIGlobals.TheBrrrgh],
            [(0.03, 0, 0.19), (0.63, 0.35, 0.40), (180, 0, 0),
             CIGlobals.MinniesMelodyland],
            [(-0.08, 0, 0.46), (0.54, 0.35, 0.40), (0, 0, 0),
             CIGlobals.DonaldsDreamland],
            [(-0.28, 0, -0.49), (0.60, 0.35, 0.45), (0, 0, 0),
             CIGlobals.DaisyGardens]
        ]
        self.clouds = []
        self.labels = []

        for pos, scale, hpr in cloudpos:
            cloud = loader.loadModel('phase_3.5/models/gui/cloud.bam')
            cloud.reparentTo(self.frame)
            cloud.setPos(pos)
            cloud.setScale(scale)
            cloud.setHpr(hpr)
            self.clouds.append(cloud)

        for pos, scale, hpr, hood in hoodclouds:
            if not base.localAvatar.hasDiscoveredHood(
                    ZoneUtil.getZoneId(hood)):
                cloud = loader.loadModel('phase_3.5/models/gui/cloud.bam')
                cloud.reparentTo(self.frame)
                cloud.setPos(pos)
                cloud.setScale(scale)
                cloud.setHpr(hpr)
                self.clouds.append(cloud)

        labeldata = [[(0, 0, -0.2), CIGlobals.ToontownCentral],
                     [(0.65, 0, -0.125), CIGlobals.DonaldsDock],
                     [(0.07, 0, 0.18), CIGlobals.MinniesMelodyland],
                     [(-0.1, 0, 0.45), CIGlobals.DonaldsDreamland],
                     [(0.5, 0, 0.25), CIGlobals.TheBrrrgh],
                     [(-0.37, 0, -0.525), CIGlobals.DaisyGardens]]

        for pos, name in labeldata:
            if base.localAvatar.hasDiscoveredHood(ZoneUtil.getZoneId(name)):
                text = name
                if base.localAvatar.hasTeleportAccess(
                        ZoneUtil.getZoneId(name)):
                    text = 'Go To\n' + text
                label = DirectButton(parent=self.frame,
                                     relief=None,
                                     pos=pos,
                                     pad=(0.2, 0.16),
                                     text=('', text, text, ''),
                                     text_bg=Vec4(1, 1, 1, 0.4),
                                     text_scale=0.055,
                                     text_wordwrap=8,
                                     rolloverSound=None,
                                     clickSound=None,
                                     pressEffect=0,
                                     sortOrder=1,
                                     text_font=CIGlobals.getToonFont())
                if base.localAvatar.hasTeleportAccess(
                        ZoneUtil.getZoneId(name)):
                    label['command'] = self.finished
                    label['extraArgs'] = [ZoneUtil.getZoneId(name)]
                label.resetFrameSize()
                self.labels.append(label)

        currHoodName = base.cr.playGame.hood.id
        currLocation = ''
        if base.localAvatar.zoneId == CIGlobals.MinigameAreaId or base.localAvatar.getMyBattle(
        ) is not None:
            currLocation = ''
        elif ZoneUtil.getWhereName(base.localAvatar.zoneId) == 'playground':
            currLocation = 'Playground'
        elif ZoneUtil.getWhereName(
                base.localAvatar.zoneId) in ['street', 'interior']:
            currLocation = CIGlobals.BranchZone2StreetName[
                ZoneUtil.getBranchZone(base.localAvatar.zoneId)]
        self.infoLabel = DirectLabel(relief=None,
                                     text='You are in: {0}\n{1}'.format(
                                         currHoodName, currLocation),
                                     scale=0.06,
                                     pos=(-0.4, 0, -0.74),
                                     parent=self.frame,
                                     text_align=TextNode.ACenter)

        if currHoodName in [CIGlobals.MinigameArea, CIGlobals.BattleTTC]:
            currHoodName = base.cr.playGame.lastHood
        btpText = "Back to Playground"
        btpEA = [ZoneUtil.getZoneId(currHoodName)]
        self.BTPButton = DirectButton(relief=None,
                                      text=btpText,
                                      geom=CIGlobals.getDefaultBtnGeom(),
                                      text_pos=(0, -0.018),
                                      geom_scale=(1.3, 1.11, 1.11),
                                      text_scale=0.06,
                                      parent=self.frame,
                                      text_font=CIGlobals.getToonFont(),
                                      pos=(0.25, 0, -0.75),
                                      command=self.finished,
                                      extraArgs=btpEA,
                                      scale=0.7)
        if base.localAvatar.zoneId != CIGlobals.MinigameAreaId:
            self.MGAButton = DirectButton(relief=None,
                                          text="Minigame Area",
                                          geom=CIGlobals.getDefaultBtnGeom(),
                                          text_pos=(0, -0.018),
                                          geom_scale=(1, 1.11, 1.11),
                                          text_scale=0.06,
                                          parent=self.frame,
                                          text_font=CIGlobals.getToonFont(),
                                          pos=(0.625, 0, -0.75),
                                          command=self.finished,
                                          extraArgs=[CIGlobals.MinigameAreaId],
                                          scale=0.7)
HoodId2HoodIndex = {
    BattleTTC: 0,
    TheBrrrgh: 1,
    DonaldsDreamland: 2,
    MinniesMelodyland: 3,
    DaisyGardens: 4,
    DonaldsDock: 5
}
HoodIndex2HoodName = {v: k for k, v in HoodId2HoodIndex.items()}
HoodIndex2HoodId = None
if HoodIndex2HoodId == None:
    HoodIndex2HoodId = {}
    for hoodName in HoodId2HoodIndex.keys():
        index = HoodId2HoodIndex[hoodName]
        zone = ZoneUtil.getZoneId(hoodName)
        HoodIndex2HoodId[index] = zone

hi2hi = HoodId2HoodIndex

HoodIndex2LevelRange = {
    hi2hi[BattleTTC]: list(range(1, 3 + 1)),
    hi2hi[TheBrrrgh]: list(range(5, 9 + 1)),
    hi2hi[DonaldsDreamland]: list(range(6, 9 + 1)),
    hi2hi[MinniesMelodyland]: range(2, 6 + 1),
    hi2hi[DaisyGardens]: range(2, 6 + 1),
    hi2hi[DonaldsDock]: range(2, 6 + 1)
}

HoodId2WantBattles = {
    BattleTTC: True,
예제 #6
0
# Embedded file name: lib.coginvasion.suit.CogBattleGlobals
from lib.coginvasion.globals.CIGlobals import BattleTTC, TheBrrrgh, DonaldsDreamland, DonaldsDock
from lib.coginvasion.hood import ZoneUtil
HoodId2HoodIndex = {BattleTTC: 0,
 TheBrrrgh: 1,
 DonaldsDreamland: 2,
 DonaldsDock: 5}
HoodIndex2HoodName = {v:k for k, v in HoodId2HoodIndex.items()}
HoodIndex2HoodId = None
if HoodIndex2HoodId == None:
    HoodIndex2HoodId = {}
    for hoodName in HoodId2HoodIndex.keys():
        index = HoodId2HoodIndex[hoodName]
        zone = ZoneUtil.getZoneId(hoodName)
        HoodIndex2HoodId[index] = zone

hi2hi = HoodId2HoodIndex
HoodIndex2LevelRange = {hi2hi[BattleTTC]: list(range(1, 6)),
 hi2hi[TheBrrrgh]: list(range(5, 10)),
 hi2hi[DonaldsDreamland]: list(range(6, 10)),
 hi2hi[DonaldsDock]: range(2, 7)}
HoodIndex2TotalCogs = {hi2hi[BattleTTC]: 40,
 hi2hi[TheBrrrgh]: 45,
 hi2hi[DonaldsDreamland]: 50,
 hi2hi[DonaldsDock]: 45}
WaiterHoodIndex = hi2hi[TheBrrrgh]
SkeletonHoodIndex = 10
예제 #7
0
    def enterMapPage(self):
        self.createPageButtons('inventoryPage', 'releaseNotesPage')
        self.setTitle('')
        themap = loader.loadModel('phase_3.5/models/gui/toontown_map.bam')
        self.frame = DirectFrame(parent=aspect2d, relief=None, image=themap, image_scale=(1.8, 1, 1.35), scale=0.97, pos=(0, 0, 0.0775))
        cloudpos = [[(-0.61, 0, 0.18), (0.55, 0.25, 0.37), (180, 0, 0)],
         [(-0.54, 0, 0.34), (0.76, 0.4, 0.55), (180, 0, 0)],
         [(-0.55, 0, -0.09), (0.72, 0.4, 0.55), (0, 0, 0)],
         [(-0.67, 0, -0.51), (0.5, 0.29, 0.38), (180, 0, 0)],
         [(-0.67, 0, 0.51), (0.5, 0.29, 0.38), (0, 0, 0)],
         [(0.67, 0, 0.51), (0.5, 0.29, 0.38), (0, 0, 0)],
         [(0.35, 0, -0.46), (0.63, 0.35, 0.45), (0, 0, 0)],
         [(0.18, 0, -0.45), (0.52, 0.27, 0.32), (0, 0, 0)],
         [(0.67, 0, -0.44), (0.63, 0.35, 0.48), (180, 0, 0)]]
        hoodclouds = [[(0.63, 0, -0.13),
          (0.63, 0.35, 0.4),
          (0, 0, 0),
          CIGlobals.DonaldsDock],
         [(0.51, 0, 0.25),
          (0.57, 0.35, 0.4),
          (0, 0, 0),
          CIGlobals.TheBrrrgh],
         [(0.03, 0, 0.19),
          (0.63, 0.35, 0.4),
          (180, 0, 0),
          CIGlobals.MinniesMelodyland],
         [(-0.08, 0, 0.46),
          (0.54, 0.35, 0.4),
          (0, 0, 0),
          CIGlobals.DonaldsDreamland],
         [(-0.28, 0, -0.49),
          (0.6, 0.35, 0.45),
          (0, 0, 0),
          CIGlobals.DaisyGardens]]
        self.clouds = []
        self.labels = []
        for pos, scale, hpr in cloudpos:
            cloud = loader.loadModel('phase_3.5/models/gui/cloud.bam')
            cloud.reparentTo(self.frame)
            cloud.setPos(pos)
            cloud.setScale(scale)
            cloud.setHpr(hpr)
            self.clouds.append(cloud)

        for pos, scale, hpr, hood in hoodclouds:
            if not base.localAvatar.hasDiscoveredHood(ZoneUtil.getZoneId(hood)):
                cloud = loader.loadModel('phase_3.5/models/gui/cloud.bam')
                cloud.reparentTo(self.frame)
                cloud.setPos(pos)
                cloud.setScale(scale)
                cloud.setHpr(hpr)
                self.clouds.append(cloud)

        labeldata = [[(0, 0, -0.2), CIGlobals.ToontownCentral],
         [(0.65, 0, -0.125), CIGlobals.DonaldsDock],
         [(0.07, 0, 0.18), CIGlobals.MinniesMelodyland],
         [(-0.1, 0, 0.45), CIGlobals.DonaldsDreamland],
         [(0.5, 0, 0.25), CIGlobals.TheBrrrgh],
         [(-0.37, 0, -0.525), CIGlobals.DaisyGardens]]
        for pos, name in labeldata:
            if base.localAvatar.hasDiscoveredHood(ZoneUtil.getZoneId(name)):
                text = name
                if base.localAvatar.hasTeleportAccess(ZoneUtil.getZoneId(name)):
                    text = 'Go To\n' + text
                label = DirectButton(parent=self.frame, relief=None, pos=pos, pad=(0.2, 0.16), text=('', text, text), text_bg=Vec4(1, 1, 1, 0.4), text_scale=0.055, text_wordwrap=8, rolloverSound=None, clickSound=None, pressEffect=0, sortOrder=1, text_font=CIGlobals.getToonFont())
                if base.localAvatar.hasTeleportAccess(ZoneUtil.getZoneId(name)):
                    label['command'] = self.finished
                    label['extraArgs'] = [ZoneUtil.getZoneId(name)]
                label.resetFrameSize()
                self.labels.append(label)

        currHoodName = base.cr.playGame.hood.id
        currLocation = ''
        if base.localAvatar.zoneId == CIGlobals.MinigameAreaId:
            currLocation = ''
        elif base.localAvatar.getMyBattle() != None:
            currLocation = 'CogTropolis'
        elif ZoneUtil.getWhereName(base.localAvatar.zoneId) == 'playground':
            currLocation = 'Playground'
        elif ZoneUtil.getWhereName(base.localAvatar.zoneId) in ('street', 'interior'):
            currLocation = CIGlobals.BranchZone2StreetName[ZoneUtil.getBranchZone(base.localAvatar.zoneId)]
        self.infoLabel = DirectLabel(relief=None, text='You are in: {0}\n{1}'.format(currHoodName, currLocation), scale=0.06, pos=(-0.4, 0, -0.74), parent=self.frame, text_align=TextNode.ACenter)
        if currHoodName in [CIGlobals.MinigameArea, CIGlobals.BattleTTC]:
            currHoodName = base.cr.playGame.lastHood
        self.BTPButton = DirectButton(relief=None, text='Back to Playground', geom=CIGlobals.getDefaultBtnGeom(), text_pos=(0, -0.018), geom_scale=(1.3, 1.11, 1.11), text_scale=0.06, parent=self.frame, text_font=CIGlobals.getToonFont(), pos=(0.25, 0, -0.75), command=self.finished, extraArgs=[ZoneUtil.getZoneId(currHoodName)], scale=0.7)
        if base.localAvatar.zoneId != CIGlobals.MinigameAreaId:
            self.MGAButton = DirectButton(relief=None, text='Minigame Area', geom=CIGlobals.getDefaultBtnGeom(), text_pos=(0, -0.018), geom_scale=(1, 1.11, 1.11), text_scale=0.06, parent=self.frame, text_font=CIGlobals.getToonFont(), pos=(0.625, 0, -0.75), command=self.finished, extraArgs=[CIGlobals.MinigameAreaId], scale=0.7)
        return