本文整理汇总了Python中GardenGlobals.getTreeTrackAndLevel方法的典型用法代码示例。如果您正苦于以下问题:Python GardenGlobals.getTreeTrackAndLevel方法的具体用法?Python GardenGlobals.getTreeTrackAndLevel怎么用?Python GardenGlobals.getTreeTrackAndLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GardenGlobals
的用法示例。
在下文中一共展示了GardenGlobals.getTreeTrackAndLevel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hasDependentTrees
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def hasDependentTrees(self):
myTrack, myLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
allGagTrees = base.cr.doFindAll('DistributedGagTree')
for gagTree in allGagTrees:
if gagTree.getOwnerId() == localAvatar.doId:
curTrack, curLevel = GardenGlobals.getTreeTrackAndLevel(gagTree.typeIndex)
if curTrack == myTrack:
if myLevel < curLevel:
return True
return False
示例2: requestHarvest
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def requestHarvest(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av:
return
if avId != self.ownerDoId:
self.air.writeServerEvent('suspicious', avId, 'tried to harvest someone else\'s tree!')
return
problem = self.isFruiting()
if problem:
self.air.writeServerEvent('suspicious', avId, 'tried to harvest a tree that\'s not fruiting!', problem=problem)
return
harvested = 0
track, level = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
while av.inventory.addItem(track, level) > 0 and harvested < 10:
harvested += 1
av.d_setInventory(av.getInventory())
self.lastHarvested = int(time.time())
self.sendUpdate('setFruiting', [self.getFruiting()])
self.d_setMovie(GardenGlobals.MOVIE_HARVEST)
self.update()
示例3: doResultDialog
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def doResultDialog(self):
self.startInteraction()
curTrack, curLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
species = GardenGlobals.getTreeTypeIndex(curTrack, curLevel)
treeName = GardenGlobals.PlantAttributes[species]['name']
stringToShow = TTLocalizer.getResultPlantedSomethingSentence(treeName)
self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
示例4: requestHarvest
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def requestHarvest(self, doId):
av = simbase.air.doId2do.get(doId)
harvested = 0
track, level = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
while av.inventory.addItem(track, level) > 0 and harvested < 10:
harvested += 1
self.sendUpdate('setMovie', [GardenGlobals.MOVIE_HARVEST, doId])
示例5: canBeHarvested
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def canBeHarvested(self):
myTrack, myLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
levelsInTrack = []
levelTreeDict = {}
allGagTrees = base.cr.doFindAll('DistributedGagTree')
for gagTree in allGagTrees:
if gagTree.getOwnerId() == localAvatar.doId:
curTrack, curLevel = GardenGlobals.getTreeTrackAndLevel(gagTree.typeIndex)
if curTrack == myTrack:
levelsInTrack.append(curLevel)
levelTreeDict[curLevel] = gagTree
for levelToTest in xrange(myLevel):
if levelToTest not in levelsInTrack:
return False
curTree = levelTreeDict[levelToTest]
if not curTree.isGTEFullGrown():
return False
return True
示例6: calcDependencies
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def calcDependencies(self):
if self.getWilted():
return
missingPrevIndex = 0
track, value = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
while value:
value -= 1
if not self.mgr.hasTree(track, value):
self.b_setWilted(1)
continue
tree = self.mgr.getTree(track, value)
if not tree:
self.b_setWilted(1)
continue
self.accept(self.getEventName('going-down', 666), self.ignoreAll)
self.accept(self.getEventName('remove', track * 7 + value), self.calcDependencies)
示例7: setTypeIndex
# 需要导入模块: import GardenGlobals [as 别名]
# 或者: from GardenGlobals import getTreeTrackAndLevel [as 别名]
def setTypeIndex(self, typeIndex):
DistributedPlantBase.DistributedPlantBase.setTypeIndex(self, typeIndex)
track, level = GardenGlobals.getTreeTrackAndLevel(typeIndex)
self.gagTrack = track
self.gagLevel = level
invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons')
propName = ToontownBattleGlobals.AvPropsNew[track][level]
self.prop = invModel.find('**/' + propName)
self.prop.setScale(7)
invModel.removeNode()
invModel2 = loader.loadModel('phase_3.5/models/gui/inventory_icons')
propName = ToontownBattleGlobals.AvPropsNew[track][level]
self.prop2 = invModel2.find('**/' + propName)
self.prop2.setScale(7)
self.filename = self.attributes['filename']
self.maxFruit = self.attributes['maxFruit']
if hasattr(self, 'needToLoad'):
if self.needToLoad:
self.loadModel()