def teleportToShop(self, npcId): npcZone = NPCToons.getNPCZone(npcId) npcHood = ZoneUtil.getCanonicalHoodId(npcZone) avZone = base.localAvatar.getZoneId() avHood = ZoneUtil.getCanonicalHoodId(avZone) avShard = base.localAvatar.defaultShard avPlace = base.cr.playGame.getPlace() hqZone = { 2000: 2520, 1000: 1507, 3000: 3508, 4000: 4504, 5000: 5502, 7000: 7503, 9000: 9505 } def callback(flag): if flag: npcZone = None base.cr.buildingQueryMgr.d_isSuit(npcZone, callback) if avShard not in base.cr.activeDistrictMap: return if npcZone in [-1, 0, None]: return if not ZoneUtil.isInterior(npcZone): return if ZoneUtil.isHQ(npcZone): args = (avHood, hqZone[avHood], avShard, -1) else: args = (npcHood, npcZone, avShard, -1) avPlace.requestTeleport(*args)
def exitDoorEnterClosing(self, ts): doorFrameHoleLeft = self.findDoorNode('doorFrameHoleLeft') if doorFrameHoleLeft.isEmpty(): self.notify.warning('enterOpening(): did not find flatDoors') return if ZoneUtil.isInterior(self.zoneId): doorFrameHoleLeft.setColor(1.0, 1.0, 1.0, 1.0) if self.leftSwing: h = -100 else: h = 100 leftDoor = self.findDoorNode('leftDoor') if not leftDoor.isEmpty(): otherNP = self.getDoorNodePath() trackName = 'doorExitTrack-%d' % self.doId self.doorExitTrack = Parallel(Sequence( LerpHprInterval(nodePath=leftDoor, duration=1.0, hpr=VBase3(0, 0, 0), startHpr=VBase3(h, 0, 0), other=otherNP, blendType='easeInOut'), Func(doorFrameHoleLeft.hide), Func(self.hideIfHasFlat, leftDoor)), Sequence( Wait(0.5), SoundInterval(self.closeSfx, node=leftDoor)), name=trackName) self.doorExitTrack.start(ts)
def exitDoorEnterClosing(self, ts): doorFrameHoleLeft = self.findDoorNode('doorFrameHoleLeft') if doorFrameHoleLeft.isEmpty(): self.notify.warning('enterOpening(): did not find flatDoors') return if ZoneUtil.isInterior(self.zoneId): doorFrameHoleLeft.setColor(1.0, 1.0, 1.0, 1.0) if self.leftSwing: h = -100 else: h = 100 leftDoor = self.findDoorNode('leftDoor') if not leftDoor.isEmpty(): otherNP = self.getDoorNodePath() trackName = 'doorExitTrack-%d' % self.doId self.doorExitTrack = Parallel(Sequence(LerpHprInterval(nodePath=leftDoor, duration=1.0, hpr=VBase3(0, 0, 0), startHpr=VBase3(h, 0, 0), other=otherNP, blendType='easeInOut'), Func(doorFrameHoleLeft.hide), Func(self.hideIfHasFlat, leftDoor)), Sequence(Wait(0.5), SoundInterval(self.closeSfx, node=leftDoor)), name=trackName) self.doorExitTrack.start(ts)
def teleportToShop(self, npcId): npcZone = NPCToons.getNPCZone(npcId) npcHood = ZoneUtil.getCanonicalHoodId(npcZone) avZone = base.localAvatar.getZoneId() avHood = ZoneUtil.getCanonicalHoodId(avZone) avShard = base.localAvatar.defaultShard avPlace = base.cr.playGame.getPlace() hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505} def callback(flag): if flag: npcZone = None base.cr.buildingQueryMgr.d_isSuit(npcZone, callback) if avShard not in base.cr.activeDistrictMap: return if npcZone in [-1, 0, None]: return if not ZoneUtil.isInterior(npcZone): return if ZoneUtil.isHQ(npcZone): args = (avHood, hqZone[avHood], avShard, -1) else: args = (npcHood, npcZone, avShard, -1) avPlace.requestTeleport(*args)
def wantsNametag(self): return not ZoneUtil.isInterior(self.zoneId)