本文整理汇总了Python中toontown.pets.PetDNA.setGender方法的典型用法代码示例。如果您正苦于以下问题:Python PetDNA.setGender方法的具体用法?Python PetDNA.setGender怎么用?Python PetDNA.setGender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.pets.PetDNA
的用法示例。
在下文中一共展示了PetDNA.setGender方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makePetList
# 需要导入模块: from toontown.pets import PetDNA [as 别名]
# 或者: from toontown.pets.PetDNA import setGender [as 别名]
def makePetList(self):
self.numPets = len(self.petSeeds)
self.curPet = 0
self.petDNA = []
self.petName = []
self.petDesc = []
self.petCost = []
for i in xrange(self.numPets):
random.seed(self.petSeeds[i])
zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId())
name, dna, traitSeed = PetUtil.getPetInfoFromSeed(self.petSeeds[i], zoneId)
cost = PetUtil.getPetCostFromSeed(self.petSeeds[i], zoneId)
traits = PetTraits.PetTraits(traitSeed, zoneId)
traitList = traits.getExtremeTraitDescriptions()
numGenders = len(PetDNA.PetGenders)
gender = i % numGenders
PetDNA.setGender(dna, gender)
self.petDNA.append(dna)
self.petName.append(TTLocalizer.PetshopUnknownName)
descList = []
descList.append(TTLocalizer.PetshopDescGender % PetDNA.getGenderString(gender=gender))
if traitList:
descList.append(TTLocalizer.PetshopDescTrait % traitList[0])
else:
descList.append(TTLocalizer.PetshopDescTrait % TTLocalizer.PetshopDescStandard)
traitList.extend(['',
'',
'',
''])
for trait in traitList[1:4]:
descList.append('\t%s' % trait)
descList.append(TTLocalizer.PetshopDescCost % cost)
self.petDesc.append('\n'.join(descList))
self.petCost.append(cost)