当前位置: 首页>>代码示例>>Python>>正文


Python MinigameGlobals.getScoreMult方法代码示例

本文整理汇总了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')
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:43,代码来源:DistributedMinigameAI.py

示例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")
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:39,代码来源:DistributedMinigameAI.py


注:本文中的MinigameGlobals.getScoreMult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。