本文整理汇总了Python中toontown.toon.ToonDNA.ToonDNA.getAnimal方法的典型用法代码示例。如果您正苦于以下问题:Python ToonDNA.getAnimal方法的具体用法?Python ToonDNA.getAnimal怎么用?Python ToonDNA.getAnimal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.toon.ToonDNA.ToonDNA
的用法示例。
在下文中一共展示了ToonDNA.getAnimal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enterCreateAvatar
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import getAnimal [as 别名]
def enterCreateAvatar(self):
dna = ToonDNA()
dna.makeFromNetString(self.dna)
colorString = TTLocalizer.NumToColor[dna.headColor]
animalType = TTLocalizer.AnimalToSpecies[dna.getAnimal()]
name = ' '.join((colorString, animalType))
toonFields = {
'setName': (name,),
'WishNameState': ('OPEN',),
'WishName': ('',),
'setDNAString': (self.dna,),
'setDISLid': (self.target,)
}
self.csm.air.dbInterface.createObject(
self.csm.air.dbId,
self.csm.air.dclassesByName['DistributedToonUD'],
toonFields,
self.__handleCreate)
示例2: enterCreateAvatar
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import getAnimal [as 别名]
def enterCreateAvatar(self):
dna = ToonDNA()
dna.makeFromNetString(self.dna)
colorstring = TTLocalizer.NumToColor[dna.headColor]
animaltype = TTLocalizer.AnimalToSpecies[dna.getAnimal()]
name = colorstring + " " + animaltype
toonFields = {
"setName": (name,),
"WishNameState": WISHNAME_OPEN,
"WishName": "",
"setDNAString": (self.dna,),
"setDISLid": (self.target,),
}
self.csm.air.dbInterface.createObject(
self.csm.air.dbId, self.csm.air.dclassesByName["DistributedToonUD"], toonFields, self.__handleCreate
)
示例3: enterCreateAvatar
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import getAnimal [as 别名]
def enterCreateAvatar(self):
name = self.name
if not isNamePattern(self.name):
dna = ToonDNA()
dna.makeFromNetString(self.dna)
colorstring = TTLocalizer.NumToColor[dna.headColor]
animaltype = TTLocalizer.AnimalToSpecies[dna.getAnimal()]
name = colorstring + ' ' + animaltype
toonFields = {
'setName': (name,),
'WishNameState': ('PENDING' if not isNamePattern(self.name) else '',),
'WishName': (self.name if not isNamePattern(self.name) else '',),
'setDNAString': (self.dna,),
'setDISLid': (self.target,)
}
if not self.tf and not self.hood:
toonFields['setTutorialAck'] = (1,)
toonFields['setQuests'] = ([163, 1000, 1000, 100, 3],)
if self.hood:
hqZones = []
if self.hood == 1: # dd
if not -1 in self.trackChoice:
self.demand('Kill', 'Invalid track choice for DD!')
return
jarsize = 50
gaglimit = 25
hoodId = 1000
prevZones = [2000]
questlimit = 2
tier = 4
hp = 25
expm = 1500
elif self.hood == 2: # dg
if -1 in self.trackChoice:
self.demand('Kill', 'Invalid track choice for DG!')
return
jarsize = 60
gaglimit = 30
hoodId = 5000
prevZones = [1000, 2000]
questlimit = 2
tier = 7
hp = 34
expm = 2300
elif self.hood == 3 and config.GetBool('csp-want-mm', False): # mm (MIGHT BE DISABLED)
if-1 in self.trackChoice:
self.demand('Kill', 'Invalid track choice for MM!')
return
jarsize = 80
gaglimit = 35
hoodId = 4000
prevZones = [1000, 2000, 5000]
questlimit = 3
tier = 8
hp = 43
expm = 4000
hqZones = [11000]
toonFields['setCogParts'] = ((0, 0, 0, 1),)
else:
self.demand('Kill', 'Invalid hood!')
return
ta = [0, 0, 0, 0, 1, 1, 0]
for t in self.trackChoice:
if t != -1:
ta[t] = 1
toonFields['setMaxMoney'] = (jarsize,)
toonFields['setMaxCarry'] = (gaglimit,)
toonFields['setTrackAccess'] = (ta,)
toonFields['setDefaultZone'] = (hoodId,)
toonFields['setHoodsVisited'] = (prevZones + hqZones + [hoodId],)
toonFields['setZonesVisited'] = (prevZones + hqZones + [hoodId],)
toonFields['setTeleportAccess'] = (prevZones,)
toonFields['setQuestCarryLimit'] = (questlimit,)
toonFields['setRewardHistory'] = (tier, [])
toonFields['setHp'] = (hp,)
toonFields['setMaxHp'] = (hp,)
toonFields['setTutorialAck'] = (1,)
e = Experience()
e.makeExpRegular(expm)
for i, t in enumerate(ta):
if not t:
e.experience[i] = 0
toonFields['setExperience'] = (e.makeNetString(),)
self.csm.air.dbInterface.createObject(
#.........这里部分代码省略.........