本文整理汇总了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")