当前位置: 首页>>代码示例>>Python>>正文


Python PetDNA.getRandomPetDNA方法代码示例

本文整理汇总了Python中toontown.pets.PetDNA.getRandomPetDNA方法的典型用法代码示例。如果您正苦于以下问题:Python PetDNA.getRandomPetDNA方法的具体用法?Python PetDNA.getRandomPetDNA怎么用?Python PetDNA.getRandomPetDNA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.pets.PetDNA的用法示例。


在下文中一共展示了PetDNA.getRandomPetDNA方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _initDBVals

# 需要导入模块: from toontown.pets import PetDNA [as 别名]
# 或者: from toontown.pets.PetDNA import getRandomPetDNA [as 别名]
    def _initDBVals(self, ownerId, name = None, traitSeed = 0, dna = None, safeZone = ToontownGlobals.ToontownCentral):
        self.b_setOwnerId(ownerId)
        if name is None:
            name = 'pet%s' % self.doId
        self.b_setPetName(name)
        self.b_setTraitSeed(traitSeed)
        self.b_setSafeZone(safeZone)
        traits = PetTraits.PetTraits(traitSeed, safeZone)
        for traitName in PetTraits.getTraitNames():
            setter = self.getSetterName(traitName, 'b_set')
            self.__dict__[setter](traits.getTraitValue(traitName))

        self.traits = traits
        for component in PetMood.PetMood.Components:
            setterName = self.getSetterName(component, 'b_set')
            self.__dict__[setterName](0.0)

        if not dna:
            dna = PetDNA.getRandomPetDNA()
        self.setDNA(dna)
        self.b_setLastSeenTimestamp(self.getCurEpochTimestamp())
        for component in PetMood.PetMood.Components:
            self.setMoodComponent(component, 0.0)

        self.b_setTrickAptitudes([])
        return
开发者ID:nate97,项目名称:src,代码行数:28,代码来源:DistributedPetAI.py

示例2: getPicture

# 需要导入模块: from toontown.pets import PetDNA [as 别名]
# 或者: from toontown.pets.PetDNA import getRandomPetDNA [as 别名]
 def getPicture(self, avatar):
     from toontown.pets import PetDNA, Pet
     pet = Pet.Pet(forGui=1)
     dna = PetDNA.getRandomPetDNA()
     pet.setDNA(dna)
     pet.setH(180)
     model, ival = self.makeFrameModel(pet, 0)
     pet.setScale(2.0)
     pet.setP(-40)
     track = PetTricks.getTrickIval(pet, self.trickId)
     name = 'petTrick-item-%s' % self.sequenceNumber
     CatalogPetTrickItem.sequenceNumber += 1
     if track is not None:
         track = Sequence(
             Sequence(track),
             ActorInterval(
                 pet,
                 'neutral',
                 duration=2),
             name=name)
     else:
         pet.animFSM.request('neutral')
         track = Sequence(Wait(4), name=name)
     self.petPicture = pet
     self.hasPicture = True
     return model, track
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:28,代码来源:CatalogPetTrickItem.py

示例3: getPetInfoFromSeed

# 需要导入模块: from toontown.pets import PetDNA [as 别名]
# 或者: from toontown.pets.PetDNA import getRandomPetDNA [as 别名]
def getPetInfoFromSeed(seed, safezoneId):
    S = random.getstate()
    random.seed(seed)
    dnaArray = PetDNA.getRandomPetDNA(safezoneId)
    gender = PetDNA.getGender(dnaArray)
    nameString = TTLocalizer.getRandomPetName(gender=gender, seed=seed)
    traitSeed = PythonUtil.randUint31()
    random.setstate(S)
    return (nameString, dnaArray, traitSeed)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:11,代码来源:PetUtil.py

示例4: makeRandomPet

# 需要导入模块: from toontown.pets import PetDNA [as 别名]
# 或者: from toontown.pets.PetDNA import getRandomPetDNA [as 别名]
 def makeRandomPet(self):
     dna = PetDNA.getRandomPetDNA()
     self.setDNA(dna)
开发者ID:Teku16,项目名称:MikeyTheRepository,代码行数:5,代码来源:Pet.py


注:本文中的toontown.pets.PetDNA.getRandomPetDNA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。