當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。