本文整理汇总了Python中MinigameGlobals类的典型用法代码示例。如果您正苦于以下问题:Python MinigameGlobals类的具体用法?Python MinigameGlobals怎么用?Python MinigameGlobals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MinigameGlobals类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enterShowScores
def enterShowScores(self):
self.notify.debug('enterShowScores')
lerpTrack = Parallel()
lerpDur = 0.5
lerpTrack.append(Parallel(LerpPosInterval(self.goalBar, lerpDur, Point3(0, 0, -.6), blendType='easeInOut'), LerpScaleInterval(self.goalBar, lerpDur, Vec3(self.goalBar.getScale()) * 2.0, blendType='easeInOut')))
tY = 0.6
bY = -.05
lX = -.5
cX = 0
rX = 0.5
scorePanelLocs = (((cX, bY),),
((lX, bY), (rX, bY)),
((cX, tY), (lX, bY), (rX, bY)),
((lX, tY),
(rX, tY),
(lX, bY),
(rX, bY)))
scorePanelLocs = scorePanelLocs[self.numPlayers - 1]
for i in xrange(self.numPlayers):
panel = self.scorePanels[i]
pos = scorePanelLocs[i]
panel.wrtReparentTo(aspect2d)
lerpTrack.append(Parallel(LerpPosInterval(panel, lerpDur, Point3(pos[0], 0, pos[1]), blendType='easeInOut'), LerpScaleInterval(panel, lerpDur, Vec3(panel.getScale()) * 2.0, blendType='easeInOut')))
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))
self.showScoreTrack.start()
#For the Alpha Blueprint ARG
if config.GetBool('want-blueprint4-ARG', False):
MinigameGlobals.generateDebugARGPhrase()
示例2: getSafezoneId
def getSafezoneId(self):
if self.trolleyZoneOverride is not None:
return self.trolleyZoneOverride
if hasattr(self.air, 'minigameSafezoneId'):
return MinigameGlobals.getSafezoneId(self.air.minigameSafezoneId)
return MinigameGlobals.getSafezoneId(self.trolleyZone)
示例3: setEveryoneDone
def setEveryoneDone(self):
if not self.hasLocalToon:
return
if self.gameFSM.getCurrentState().getName() != "play":
self.notify.warning("ignoring setEveryoneDone msg")
return
self.notify.debug("setEveryoneDone")
def endGame(task, self=self):
if not CatchGameGlobals.EndlessGame:
self.gameOver()
return Task.done
self.notify.debug("num fruits: %s" % self.numFruits)
self.notify.debug("num catches: %s" % self.fruitsCaught)
self.timer.hide()
# For the Alpha Blueprint ARG
if base.config.GetBool("want-blueprint4-ARG", False):
MinigameGlobals.generateDebugARGPhrase()
if self.fruitsCaught >= self.numFruits:
self.notify.debug("perfect game!")
perfectTextSubnode = hidden.attachNewNode(self.__genText(TTLocalizer.CatchGamePerfect))
perfectText = hidden.attachNewNode("perfectText")
perfectTextSubnode.reparentTo(perfectText)
frame = self.__textGen.getCardActual()
offsetY = -abs(frame[2] + frame[3]) / 2.0
perfectTextSubnode.setPos(0, 0, offsetY)
perfectText.setColor(1, 0.1, 0.1, 1)
def fadeFunc(t, text=perfectText):
text.setColorScale(1, 1, 1, t)
def destroyText(text=perfectText):
text.removeNode()
textTrack = Sequence(
Func(perfectText.reparentTo, aspect2d),
Parallel(
LerpScaleInterval(perfectText, duration=0.5, scale=0.3, startScale=0.0),
LerpFunctionInterval(fadeFunc, fromData=0.0, toData=1.0, duration=0.5),
),
Wait(2.0),
Parallel(
LerpScaleInterval(perfectText, duration=0.5, scale=1.0),
LerpFunctionInterval(fadeFunc, fromData=1.0, toData=0.0, duration=0.5, blendType="easeIn"),
),
Func(destroyText),
WaitInterval(0.5),
Func(endGame, None),
)
soundTrack = SoundInterval(self.sndPerfect)
self.perfectIval = Parallel(textTrack, soundTrack)
self.perfectIval.start()
else:
taskMgr.doMethodLater(1, endGame, self.EndGameTaskName)
return
示例4: getDifficulty
def getDifficulty(self):
if self.difficultyOverride is not None:
return self.difficultyOverride
if hasattr(self.air, 'minigameDifficulty'):
return float(self.air.minigameDifficulty)
return MinigameGlobals.getDifficulty(self.getSafezoneId())
示例5: enterFrameworkCleanup
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')
示例6: enterFrameworkCleanup
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")
示例7: getSafezoneId
def getSafezoneId(self):
if self.trolleyZoneOverride is not None:
return self.trolleyZoneOverride
if hasattr(base, "minigameSafezoneId"):
return MinigameGlobals.getSafezoneId(base.minigameSafezoneId)
return MinigameGlobals.getSafezoneId(self.trolleyZone)
示例8: getDifficulty
def getDifficulty(self):
if self.difficultyOverride is not None:
return self.difficultyOverride
if hasattr(base, "minigameDifficulty"):
return float(base.minigameDifficulty)
return MinigameGlobals.getDifficulty(self.getSafezoneId())