本文整理汇总了Python中toontown.fishing.FishGlobals.getCastCost方法的典型用法代码示例。如果您正苦于以下问题:Python FishGlobals.getCastCost方法的具体用法?Python FishGlobals.getCastCost怎么用?Python FishGlobals.getCastCost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.fishing.FishGlobals
的用法示例。
在下文中一共展示了FishGlobals.getCastCost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enterLocalAdjusting
# 需要导入模块: from toontown.fishing import FishGlobals [as 别名]
# 或者: from toontown.fishing.FishGlobals import getCastCost [as 别名]
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()
示例2: enterLocalCasting
# 需要导入模块: from toontown.fishing import FishGlobals [as 别名]
# 或者: from toontown.fishing.FishGlobals import getCastCost [as 别名]
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)
示例3: doCast
# 需要导入模块: from toontown.fishing import FishGlobals [as 别名]
# 或者: from toontown.fishing.FishGlobals import getCastCost [as 别名]
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