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


Python ToonDNA.getRandomTop方法代码示例

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


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

示例1: __swapTorso

# 需要导入模块: from toontown.toon import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA import getRandomTop [as 别名]
 def __swapTorso(self, offset):
     gender = self.toon.style.getGender()
     if not self.clothesPicked:
         length = len(ToonDNA.toonTorsoTypes[6:])
         torsoOffset = 6
     elif gender == "m":
         length = len(ToonDNA.toonTorsoTypes[:3])
         torsoOffset = 0
         if self.toon.style.topTex not in ToonDNA.MakeAToonBoyShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             shirtTex, shirtColor, sleeveTex, sleeveColor = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         if self.toon.style.botTex not in ToonDNA.MakeAToonBoyBottoms:
             botTex, botTexColor = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON)
             self.toon.style.botTex = botTex
             self.toon.style.botTexColor = botTexColor
     else:
         length = len(ToonDNA.toonTorsoTypes[3:6])
         if self.toon.style.torso[1] == "d":
             torsoOffset = 3
         else:
             torsoOffset = 0
         if self.toon.style.topTex not in ToonDNA.MakeAToonGirlShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             shirtTex, shirtColor, sleeveTex, sleeveColor = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         if self.toon.style.botTex not in ToonDNA.MakeAToonGirlBottoms:
             if self.toon.style.torso[1] == "d":
                 botTex, botTexColor = ToonDNA.getRandomBottom(
                     gender, ToonDNA.MAKE_A_TOON, girlBottomType=ToonDNA.SKIRT
                 )
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 3
             else:
                 botTex, botTexColor = ToonDNA.getRandomBottom(
                     gender, ToonDNA.MAKE_A_TOON, girlBottomType=ToonDNA.SHORTS
                 )
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 0
     self.torsoChoice = (self.torsoChoice + offset) % length
     self.__updateScrollButtons(self.torsoChoice, length, self.torsoStart, self.torsoLButton, self.torsoRButton)
     torso = ToonDNA.toonTorsoTypes[torsoOffset + self.torsoChoice]
     self.dna.torso = torso
     self.toon.swapToonTorso(torso)
     self.toon.loop("neutral", 0)
     self.toon.swapToonColor(self.dna)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:56,代码来源:BodyShop.py

示例2: _BodyShop__swapTorso

# 需要导入模块: from toontown.toon import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA import getRandomTop [as 别名]
 def _BodyShop__swapTorso(self, offset):
     gender = self.toon.style.getGender()
     if not self.clothesPicked:
         length = len(ToonDNA.toonTorsoTypes[6:])
         torsoOffset = 6
     elif gender == 'm':
         length = len(ToonDNA.toonTorsoTypes[:3])
         torsoOffset = 0
         if self.dna.armColor not in ToonDNA.defaultBoyColorList:
             self.dna.armColor = ToonDNA.defaultBoyColorList[0]
         
         if self.dna.legColor not in ToonDNA.defaultBoyColorList:
             self.dna.legColor = ToonDNA.defaultBoyColorList[0]
         
         if self.dna.headColor not in ToonDNA.defaultBoyColorList:
             self.dna.headColor = ToonDNA.defaultBoyColorList[0]
         
         if self.toon.style.topTex not in ToonDNA.MakeAToonBoyShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             (shirtTex, shirtColor, sleeveTex, sleeveColor) = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         
         if self.toon.style.botTex not in ToonDNA.MakeAToonBoyBottoms:
             (botTex, botTexColor) = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON)
             self.toon.style.botTex = botTex
             self.toon.style.botTexColor = botTexColor
         
     else:
         length = len(ToonDNA.toonTorsoTypes[3:6])
         if self.toon.style.torso[1] == 'd':
             torsoOffset = 3
         else:
             torsoOffset = 0
         if self.dna.armColor not in ToonDNA.defaultGirlColorList:
             self.dna.armColor = ToonDNA.defaultGirlColorList[0]
         
         if self.dna.legColor not in ToonDNA.defaultGirlColorList:
             self.dna.legColor = ToonDNA.defaultGirlColorList[0]
         
         if self.dna.headColor not in ToonDNA.defaultGirlColorList:
             self.dna.headColor = ToonDNA.defaultGirlColorList[0]
         
         if self.toon.style.topTex not in ToonDNA.MakeAToonGirlShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             (shirtTex, shirtColor, sleeveTex, sleeveColor) = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         
         if self.toon.style.botTex not in ToonDNA.MakeAToonGirlBottoms:
             if self.toon.style.torso[1] == 'd':
                 (botTex, botTexColor) = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON, girlBottomType = ToonDNA.SKIRT)
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 3
             else:
                 (botTex, botTexColor) = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON, girlBottomType = ToonDNA.SHORTS)
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 0
         
     self.torsoChoice = (self.torsoChoice + offset) % length
     self._BodyShop__updateScrollButtons(self.torsoChoice, length, self.torsoStart, self.torsoLButton, self.torsoRButton)
     torso = ToonDNA.toonTorsoTypes[torsoOffset + self.torsoChoice]
     self.dna.torso = torso
     self.toon.swapToonTorso(torso)
     self.toon.loop('neutral', 0)
     self.toon.swapToonColor(self.dna)
开发者ID:OldToontown,项目名称:OldToontown,代码行数:74,代码来源:BodyShop.py


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