本文整理汇总了Python中toontown.fishing.FishGlobals类的典型用法代码示例。如果您正苦于以下问题:Python FishGlobals类的具体用法?Python FishGlobals怎么用?Python FishGlobals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FishGlobals类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: generateCard
def generateCard(self, tileSeed, zoneId):
rng = RandomNumGen.RandomNumGen(tileSeed)
rowSize = self.game.getRowSize()
fishList = FishGlobals.getPondGeneraList(zoneId)
for i in xrange(len(fishList)):
fishTuple = fishList.pop(0)
weight = FishGlobals.getRandomWeight(fishTuple[0], fishTuple[1])
fish = FishBase.FishBase(fishTuple[0], fishTuple[1], weight)
fishList.append(fish)
emptyCells = self.game.getCardSize() - 1 - len(fishList)
rodId = 0
for i in xrange(emptyCells):
fishVitals = FishGlobals.getRandomFishVitals(zoneId, rodId, rng)
while not fishVitals[0]:
fishVitals = FishGlobals.getRandomFishVitals(zoneId, rodId, rng)
fish = FishBase.FishBase(fishVitals[1], fishVitals[2], fishVitals[3])
fishList.append(fish)
rodId += 1
if rodId > 4:
rodId = 0
continue
for i in xrange(rowSize):
for j in xrange(self.game.getColSize()):
color = self.getCellColor(i * rowSize + j)
if i * rowSize + j == self.game.getCardSize() / 2:
tmpFish = 'Free'
else:
choice = rng.randrange(0, len(fishList))
tmpFish = fishList.pop(choice)
xPos = BG.CellImageScale * (j - 2) + BG.GridXOffset
yPos = BG.CellImageScale * (i - 2) - 0.014999999999999999
cellGui = BingoCardCell.BingoCardCell(i * rowSize + j, tmpFish, self.model, color, self, image_scale = BG.CellImageScale, pos = (xPos, 0, yPos))
self.cellGuiList.append(cellGui)
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:35,代码来源:BingoCardGui.py
示例2: generateCatch
def generateCatch(self, av, zoneId):
if len(av.fishTank) >= av.getMaxFishTank():
return [FishGlobals.OverTankLimit, 0, 0, 0]
caughtItem = simbase.air.questManager.toonFished(av, zoneId)
if caughtItem:
return [FishGlobals.QuestItem, caughtItem, 0, 0]
rand = random.random() * 100.0
for cutoff in FishGlobals.SortedProbabilityCutoffs:
if rand <= cutoff:
itemType = FishGlobals.ProbabilityDict[cutoff]
break
if av.doId in self.requestedFish:
genus, species = self.requestedFish[av.doId]
weight = FishGlobals.getRandomWeight(genus, species)
fish = FishBase(genus, species, weight)
fishType = av.fishCollection.collectFish(fish)
if fishType == FishGlobals.COLLECT_NEW_ENTRY:
itemType = FishGlobals.FishItemNewEntry
elif fishType == FishGlobals.COLLECT_NEW_RECORD:
itemType = FishGlobals.FishItemNewRecord
else:
itemType = FishGlobals.FishItem
netlist = av.fishCollection.getNetLists()
av.d_setFishCollection(netlist[0], netlist[1], netlist[2])
av.fishTank.addFish(fish)
netlist = av.fishTank.getNetLists()
av.d_setFishTank(netlist[0], netlist[1], netlist[2])
del self.requestedFish[av.doId]
return [itemType, genus, species, weight]
if itemType == FishGlobals.FishItem:
success, genus, species, weight = FishGlobals.getRandomFishVitals(
zoneId, av.getFishingRod())
fish = FishBase(genus, species, weight)
fishType = av.fishCollection.collectFish(fish)
if fishType == FishGlobals.COLLECT_NEW_ENTRY:
itemType = FishGlobals.FishItemNewEntry
elif fishType == FishGlobals.COLLECT_NEW_RECORD:
itemType = FishGlobals.FishItemNewRecord
else:
itemType = FishGlobals.FishItem
netlist = av.fishCollection.getNetLists()
av.d_setFishCollection(netlist[0], netlist[1], netlist[2])
av.fishTank.addFish(fish)
netlist = av.fishTank.getNetLists()
av.d_setFishTank(netlist[0], netlist[1], netlist[2])
return [itemType, genus, species, weight]
elif itemType == FishGlobals.BootItem:
return [itemType, 0, 0, 0]
else:
money = FishGlobals.Rod2JellybeanDict[av.getFishingRod()]
av.addMoney(money)
return [itemType, money, 0, 0]
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:52,代码来源:FishManagerAI.py
示例3: updatePage
def updatePage(self):
if hasattr(self, 'collectedTotal'):
self.collectedTotal['text'] = TTLocalizer.FishPageCollectedTotal % (len(base.localAvatar.fishCollection), FishGlobals.getTotalNumFish())
if hasattr(self, 'rod'):
rod = base.localAvatar.fishingRod
rodName = TTLocalizer.FishingRodNameDict[rod]
rodWeightRange = FishGlobals.getRodWeightRange(rod)
self.rod['text'] = TTLocalizer.FishPageRodInfo % (rodName, rodWeightRange[0], rodWeightRange[1])
if self.mode == FishPage_Tank:
if hasattr(self, 'picker'):
newTankFish = base.localAvatar.fishTank.getFish()
self.picker.update(newTankFish)
elif self.mode == FishPage_Collection:
if hasattr(self, 'browser'):
self.browser.update()
elif self.mode == FishPage_Trophy:
if hasattr(self, 'trophies'):
for trophy in self.trophies:
trophy.setLevel(-1)
for trophyId in base.localAvatar.getFishingTrophies():
self.trophies[trophyId].setLevel(trophyId)
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:26,代码来源:FishPage.py
示例4: completeSale
def completeSale(self, sell):
avId = self.air.getAvatarIdFromSender()
if self.busy != avId:
self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedNPCFishermanAI.completeSale busy with %s' % self.busy)
self.notify.warning('somebody called setMovieDone that I was not busy with! avId: %s' % avId)
return
if sell:
av = simbase.air.doId2do.get(avId)
if av:
#maybe: recreate Disney-style fishManager that does the above code?
trophyResult = self.air.fishManager.creditFishTank(av)
if trophyResult:
movieType = NPCToons.SELL_MOVIE_TROPHY
extraArgs = [len(av.fishCollection), FishGlobals.getTotalNumFish()]
else:
movieType = NPCToons.SELL_MOVIE_COMPLETE
extraArgs = []
self.d_setMovie(avId, movieType, extraArgs)
else:
av = simbase.air.doId2do.get(avId)
if av:
self.d_setMovie(avId, NPCToons.SELL_MOVIE_NOFISH)
self.sendClearMovie(None)
return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:25,代码来源:DistributedNPCFishermanAI.py
示例5: generateCard
def generateCard(self, tileSeed, zoneId):
rng = RandomNumGen.RandomNumGen(tileSeed)
fishList = FishGlobals.getPondGeneraList(zoneId)
emptyCells = self.cardSize - 1 - len(fishList)
rodId = 0
for i in xrange(emptyCells):
fish = FishGlobals.getRandomFishVitals(zoneId, rodId, rng)
while not fish[0]:
fish = FishGlobals.getRandomFishVitals(zoneId, rodId, rng)
fishList.append((fish[1], fish[2]))
rodId += 1
if rodId > 4:
rodId = 0
continue
for index in xrange(self.cardSize):
if index != self.cardSize / 2:
choice = rng.randrange(0, len(fishList))
self.cellList.append(fishList.pop(choice))
continue
self.cellList.append((None, None))
开发者ID:OldToontown,项目名称:OldToontown,代码行数:21,代码来源:BingoCardBase.py
示例6: fishSold
def fishSold(self):
avId = self.air.getAvatarIdFromSender()
if self.busy != avId:
self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedNPCPetshopAI.fishSold busy with %s' % self.busy)
self.notify.warning('somebody called fishSold that I was not busy with! avId: %s' % avId)
return
av = simbase.air.doId2do.get(avId)
if av:
trophyResult = self.air.fishManager.creditFishTank(av)
if trophyResult:
movieType = NPCToons.SELL_MOVIE_TROPHY
extraArgs = [len(av.fishCollection), FishGlobals.getTotalNumFish()]
else:
movieType = NPCToons.SELL_MOVIE_COMPLETE
extraArgs = []
self.d_setMovie(avId, movieType, extraArgs)
self.transactionType = 'fish'
self.sendClearMovie(None)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:18,代码来源:DistributedNPCPetclerkAI.py
示例7: enterLocalAdjusting
def enterLocalAdjusting(self, guiEvent = None):
if self.track:
self.track.pause()
if self.castTrack:
self.castTrack.pause()
self.power = 0.0
self.firstCast = 0
self.castButton['image0_color'] = Vec4(0, 1, 0, 1)
self.castButton['text'] = ''
self.av.stopLookAround()
self._DistributedFishingSpot__hideLine()
self._DistributedFishingSpot__hideBob()
self.howToDialog.hide()
castCost = FishGlobals.getCastCost(self.av.getFishingRod())
if self.av.getMoney() < castCost:
self._DistributedFishingSpot__hideCastGui()
self._DistributedFishingSpot__showBroke()
self.av.loop('pole-neutral')
return None
if self.av.isFishTankFull():
self._DistributedFishingSpot__hideCastGui()
self._DistributedFishingSpot__showFishTankFull()
self.av.loop('pole-neutral')
return None
self.arrow.show()
self.arrow.setColorScale(1, 1, 0, 0.69999999999999996)
self.startAngleNP = self.angleNP.getH()
self.getMouse()
self.initMouseX = self.mouseX
self.initMouseY = self.mouseY
self._DistributedFishingSpot__hideBob()
if config.GetBool('fishing-independent-axes', 0):
taskMgr.add(self.localAdjustingCastTaskIndAxes, self.taskName('adjustCastTask'))
else:
taskMgr.add(self.localAdjustingCastTask, self.taskName('adjustCastTask'))
if base.wantBingo:
bingoMgr = self.pond.getPondBingoManager()
if bingoMgr:
bingoMgr.castingStarted()
开发者ID:OldToontown,项目名称:OldToontown,代码行数:43,代码来源:DistributedFishingSpot.py
示例8: enterLocalCasting
def enterLocalCasting(self):
if self.power == 0.0 and len(self.av.fishCollection) == 0:
self.__showHowTo(TTLocalizer.FishingHowToFailed)
if self.castTrack:
self.castTrack.pause()
self.av.loop('pole-neutral')
self.track = None
return
castCost = FishGlobals.getCastCost(self.av.getFishingRod())
self.jar['text'] = str(max(self.av.getMoney() - castCost, 0))
if not self.castTrack:
self.createCastTrack()
self.castTrack.pause()
startT = 0.7 + (1 - self.power) * 0.3
self.castTrack.start(startT)
self.track = Sequence(Wait(1.2 - startT), Func(self.startMoveBobTask), Func(self.__showLineCasting))
self.track.start()
heading = self.angleNP.getH()
self.d_doCast(self.power, heading)
self.timer.countdown(FishGlobals.CastTimeout)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:20,代码来源:DistributedFishingSpot.py
示例9: doCast
def doCast(self, p, h):
avId = self.air.getAvatarIdFromSender()
if self.avId != avId:
self.air.writeServerEventMessage('suspicious', avId, 'Toon tried to cast from a pier they\'re not on!')
return
av = self.air.doId2do[avId]
money = av.getMoney()
cost = FishGlobals.getCastCost(av.getFishingRod())
if money < cost:
self.air.writeServerEventMessage('suspicious', avId, 'Toon tried to cast without enough jellybeans!')
return
if len(av.fishTank) >= av.getMaxFishTank():
self.air.writeServerEventMessage('suspicious', avId, 'Toon tried to cast with too many fish!')
return
av.takeMoney(cost, False)
self.d_setMovie(FishGlobals.CastMovie, 0, 0, 0, 0, p, h)
taskMgr.remove('cancelAnimation%d' % self.doId)
taskMgr.doMethodLater(2, DistributedFishingSpotAI.cancelAnimation, 'cancelAnimation%d' % self.doId, [self])
taskMgr.remove('timeOut%d' % self.doId)
taskMgr.doMethodLater(45, DistributedFishingSpotAI.removeFromPierWithAnim, 'timeOut%d' % self.doId, [self])
self.cast = True
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:21,代码来源:DistributedFishingSpotAI.py
示例10: __showSellFishConfirmDialog
def __showSellFishConfirmDialog(self, numFishCaught):
self.__makeGui()
msg = TTLocalizer.STOREOWNER_TROPHY % (numFishCaught, FishGlobals.getTotalNumFish())
self.sellFishConfirmDialog.setMessage(msg)
self.sellFishConfirmDialog.show()
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:5,代码来源:DistributedFishingSpot.py
示例11: completeFishSale
def completeFishSale(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av:
return
if self.air.fishManager.creditFishTank(av):
self.sendUpdateToAvatarId(avId, 'thankSeller', [ToontownGlobals.FISHSALE_TROPHY, len(av.fishCollection), FishGlobals.getTotalNumFish()])
else:
self.sendUpdateToAvatarId(avId, 'thankSeller', [ToontownGlobals.FISHSALE_COMPLETE, 0, 0])
开发者ID:Kawaiikat14,项目名称:Toontown-2-Revised,代码行数:11,代码来源:DistributedEstateAI.py
注:本文中的toontown.fishing.FishGlobals类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论