本文整理匯總了Python中MinigameGlobals.getScoreMult方法的典型用法代碼示例。如果您正苦於以下問題:Python MinigameGlobals.getScoreMult方法的具體用法?Python MinigameGlobals.getScoreMult怎麽用?Python MinigameGlobals.getScoreMult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MinigameGlobals
的用法示例。
在下文中一共展示了MinigameGlobals.getScoreMult方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: enterFrameworkCleanup
# 需要導入模塊: import MinigameGlobals [as 別名]
# 或者: from MinigameGlobals import getScoreMult [as 別名]
def enterFrameworkCleanup(self):
self.notify.debug('BASE: enterFrameworkCleanup: normalExit=%s' % self.normalExit)
scoreMult = MinigameGlobals.getScoreMult(self.getSafezoneId())
if not self.hasScoreMult():
scoreMult = 1.0
self.notify.debug('score multiplier: %s' % scoreMult)
for avId in self.avIdList:
self.scoreDict[avId] *= scoreMult
scoreList = []
if not self.normalExit:
randReward = random.randrange(DEFAULT_POINTS, MAX_POINTS + 1)
for avId in self.avIdList:
if self.normalExit:
score = int(self.scoreDict[avId] + 0.5)
else:
score = randReward
if ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY in simbase.air.holidayManager.currentHolidays or ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY_MONTH in simbase.air.holidayManager.currentHolidays:
score *= MinigameGlobals.JellybeanTrolleyHolidayScoreMultiplier
logEvent = False
if score > 255:
score = 255
logEvent = True
elif score < 0:
score = 0
logEvent = True
if logEvent:
self.air.writeServerEvent('suspicious', avId, 'got %s jellybeans playing minigame %s in zone %s' % (score, self.minigameId, self.getSafezoneId()))
scoreList.append(score)
self.requestDelete()
if self.metagameRound > -1:
self.handleMetagamePurchaseManager(scoreList)
else:
self.handleRegularPurchaseManager(scoreList)
self.frameworkFSM.request('frameworkOff')
示例2: enterFrameworkCleanup
# 需要導入模塊: import MinigameGlobals [as 別名]
# 或者: from MinigameGlobals import getScoreMult [as 別名]
def enterFrameworkCleanup(self):
self.notify.debug("BASE: enterFrameworkCleanup: normalExit=%s" % self.normalExit)
scoreMult = MinigameGlobals.getScoreMult(self.getSafezoneId())
if not self.hasScoreMult():
scoreMult = 1.0
self.notify.debug("score multiplier: %s" % scoreMult)
for avId in self.avIdList:
self.scoreDict[avId] *= scoreMult
scoreList = []
for avId in self.avIdList:
if self.normalExit:
score = int(self.scoreDict[avId] + 0.5)
else:
score = 0
if simbase.air.newsManager.isHolidayRunning(
ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY
) or simbase.air.newsManager.isHolidayRunning(ToontownGlobals.JELLYBEAN_TROLLEY_HOLIDAY_MONTH):
score *= MinigameGlobals.JellybeanTrolleyHolidayScoreMultiplier
logEvent = False
if score > 255:
score = 255
logEvent = True
elif score < 0:
score = 0
logEvent = True
if logEvent:
self.air.writeServerEvent(
"suspicious",
avId,
"got %s jellybeans playing minigame %s in zone %s" % (score, self.minigameId, self.getSafezoneId()),
)
scoreList.append(score)
self.requestDelete()
self.handleRegularPurchaseManager(scoreList)
self.frameworkFSM.request("frameworkOff")