def setupSuitBuilding(self, nodePath): if nodePath.isEmpty(): return dnaStore = self.cr.playGame.dnaStore level = int(self.difficulty / 2) + 1 suitNP = dnaStore.findNode('suit_landmark_' + self.getDeptClassFromAbbr(self.suitDept).getClothingPrefix() + str(level)) zoneId = dnaStore.getZoneFromBlockNumber(self.block) zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId) newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId] suitBuildingNP = suitNP.copyTo(newParentNP) buildingTitle = dnaStore.getTitleFromBlockNumber(self.block) if not buildingTitle: buildingTitle = "Cogs, Inc." else: buildingTitle += ", Inc." buildingTitle += "\n%s" % self.getDeptClassFromAbbr(self.suitDept).getName() textNode = TextNode('sign') textNode.setTextColor(1.0, 1.0, 1.0, 1.0) textNode.setFont(CIGlobals.getSuitFont()) textNode.setAlign(TextNode.ACenter) textNode.setWordwrap(17.0) textNode.setText(buildingTitle) textHeight = textNode.getHeight() zScale = (textHeight + 2) / 3.0 signOrigin = suitBuildingNP.find('**/sign_origin;+s') backgroundNP = loader.loadModel('phase_5/models/modules/suit_sign.bam') backgroundNP.reparentTo(signOrigin) backgroundNP.setPosHprScale(0.0, 0.0, textHeight * 0.8 / zScale, 0.0, 0.0, 0.0, 8.0, 8.0, 8.0 * zScale) #backgroundNP.node().setEffect(DecalEffect.make()) signTextNodePath = backgroundNP.attachNewNode(textNode.generate()) signTextNodePath.setPosHprScale(0.0, -0.02, -0.21 + textHeight * 0.1 / zScale, 0.0, 0.0, 0.0, 0.1, 0.1, 0.1 / zScale) signTextNodePath.setColor(1.0, 1.0, 1.0, 1.0) frontNP = suitBuildingNP.find('**/*_front/+GeomNode;+s') backgroundNP.wrtReparentTo(frontNP) frontNP.node().setEffect(DecalEffect.make()) suitBuildingNP.setName('sb' + str(self.block) + ':_landmark__DNARoot') suitBuildingNP.setPosHprScale(nodePath, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) suitBuildingNP.flattenMedium() self.loadElevator(suitBuildingNP) return suitBuildingNP
def getExteriorAndInteriorZoneId(self): dnaStore = self.air.dnaStoreMap[self.canonicalZoneId] zoneId = dnaStore.getZoneFromBlockNumber(self.block) zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId) interiorZoneId = (zoneId - (zoneId % 100)) + 500 + self.block return (zoneId, interiorZoneId)
def getVisZoneId(self): exteriorZoneId = self.cr.playGame.dnaStore.getZoneFromBlockNumber(self.block) visZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId) return visZoneId