Poodletooth-iLand/toontown/minigame/MinigameGlobals.py

37 lines
1.1 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from direct.showbase import PythonUtil
from toontown.toonbase import ToontownGlobals
from toontown.hood import ZoneUtil
from random import choice
latencyTolerance = 10.0
MaxLoadTime = 40.0
2015-06-21 14:09:31 -05:00
rulesDuration = 21
2015-03-03 16:10:12 -06:00
JellybeanTrolleyHolidayScoreMultiplier = 2
DifficultyOverrideMult = int(1 << 16)
def QuantizeDifficultyOverride(diffOverride):
return int(round(diffOverride * DifficultyOverrideMult)) / float(DifficultyOverrideMult)
NoDifficultyOverride = 2147483647
NoTrolleyZoneOverride = -1
SafeZones = [ToontownGlobals.ToontownCentral,
ToontownGlobals.DonaldsDock,
ToontownGlobals.DaisyGardens,
ToontownGlobals.MinniesMelodyland,
ToontownGlobals.TheBrrrgh,
ToontownGlobals.DonaldsDreamland]
def getDifficulty(trolleyZone):
hoodZone = getSafezoneId(trolleyZone)
return float(SafeZones.index(hoodZone)) / (len(SafeZones) - 1)
def getSafezoneId(trolleyZone):
return ZoneUtil.getCanonicalHoodId(trolleyZone)
2015-03-03 16:10:12 -06:00
def getScoreMult(trolleyZone):
szId = getSafezoneId(trolleyZone)
multiplier = PythonUtil.lerp(1.0, 1.5, float(SafeZones.index(szId)) / (len(SafeZones) - 1))
2015-07-05 18:59:25 -05:00
return multiplier