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


Python ItemGlobals.getMaleModelId方法代码示例

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


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

示例1: apply

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getMaleModelId [as 别名]
 def apply(self, pirate):
     pirate.style.setClothesShirt(0)
     pirate.style.setClothesCoat(0)
     pirate.style.setClothesVest(0)
     pirate.model.handleClothesHiding()
     gender = localAvatar.style.getGender()
     if gender == 'm':
         tattooId = ItemGlobals.getMaleModelId(self.uid)
         if self.zone == TattooGlobals.ZONE3:
             orientation = ItemGlobals.getMaleOrientation2(self.uid)
         else:
             orientation = ItemGlobals.getMaleOrientation(self.uid)
     else:
         tattooId = ItemGlobals.getFemaleModelId(self.uid)
         if self.zone == TattooGlobals.ZONE3:
             orientation = ItemGlobals.getFemaleOrientation2(self.uid)
         else:
             orientation = ItemGlobals.getFemaleOrientation(self.uid)
     (offsetx, offsety, scale, rotate) = ItemGlobals.getOrientation(orientation)
     if not hasattr(pirate, 'model'):
         return None
     
     pirate.model.tattoos[self.zone][TattooGlobals.TYPE] = tattooId
     S = Vec2(1 / float(scale), 1 / float(scale))
     Iv = Vec2(offsetx, offsety)
     Vm = Vec2(sin(rotate * pi / 180.0), cos(rotate * pi / 180.0))
     Vms = Vec2(Vm[0] * S[0], Vm[1] * S[1])
     Vn = Vec2(Vm[1], -Vm[0])
     Vns = Vec2(Vn[0] * S[0], Vn[1] * S[1])
     F = Vec2(-Vns.dot(Iv) + 0.5, -Vms.dot(Iv) + 0.5)
     pirate.model.tattoos[self.zone][TattooGlobals.OFFSETX] = F[0]
     pirate.model.tattoos[self.zone][TattooGlobals.OFFSETY] = F[1]
     pirate.model.tattoos[self.zone][TattooGlobals.SCALE] = S[0]
     pirate.model.tattoos[self.zone][TattooGlobals.ROTATE] = rotate
     pirate.model.updateTattoo(self.zone)
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:37,代码来源:SimpleStoreItem.py

示例2: canLocalUseItem

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getMaleModelId [as 别名]
 def canLocalUseItem(self, itemTuple):
     canUse = 1
     reason = ItemConstants.REASON_NONE
     itemCat = itemTuple[0]
     itemId = itemTuple[1]
     rarity = ItemGlobals.getRarity(itemId)
     if rarity != ItemConstants.CRUDE and not Freebooter.getPaidStatus(base.localAvatar.getDoId()):
         canUse = 0
         reason = ItemConstants.REASON_VELVETROPE
         return (canUse, reason)
     elif itemCat == InventoryType.ItemTypeClothing:
         gender = localAvatar.style.getGender()
         if gender == 'm' and ItemGlobals.getMaleModelId(itemId) == -1:
             canUse = 0
             reason = ItemConstants.REASON_GENDER
             return (canUse, reason)
         elif gender == 'f' and ItemGlobals.getFemaleModelId(itemId) == -1:
             canUse = 0
             reason = ItemConstants.REASON_GENDER
             return (canUse, reason)
         
     elif itemCat in [
         InventoryType.ItemTypeWeapon,
         InventoryType.ItemTypeCharm]:
         inv = localAvatar.getInventory()
         if not inv:
             canUse = 0
             reason = ItemConstants.REASON_INVENTORY
             return (canUse, reason)
         
         reqs = localAvatar.getInventory().getItemRequirements(itemId)
         if reqs == None or filter(lambda x: reqs[x][1] == False, reqs):
             canUse = 0
             reason = ItemConstants.REASON_LEVEL
             return (canUse, reason)
         
     
     return (canUse, reason)
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:40,代码来源:InventoryUIManager.py

示例3: showDetails

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getMaleModelId [as 别名]

#.........这里部分代码省略.........
         
     elif bodyShape == 9:
         bodyOffset = 0.5
         if gender == 'm':
             browOffset = -0.20000000000000001
             earOffset = -0.20000000000000001
             noseOffset = -0.29999999999999999
             mouthOffset = -0.10000000000000001
             handOffset = -0.050000000000000003
         elif gender == 'f':
             browOffset = -0.34999999999999998
             earOffset = -0.34999999999999998
             noseOffset = -0.45000000000000001
             mouthOffset = -0.34999999999999998
             handOffset = -0.20000000000000001
         
     
     m = Mat4(Mat4.identMat())
     itemType = ItemGlobals.getType(itemId)
     if itemType == ItemGlobals.BROW:
         jewelType = JewelryGlobals.LBROW
     elif itemType == ItemGlobals.EAR:
         jewelType = JewelryGlobals.LEAR
     elif itemType == ItemGlobals.NOSE:
         jewelType = JewelryGlobals.NOSE
     elif itemType == ItemGlobals.MOUTH:
         jewelType = JewelryGlobals.MOUTH
     elif itemType == ItemGlobals.HAND:
         jewelType = JewelryGlobals.LHAND
     
     primaryColor = ItemGlobals.getPrimaryColor(itemId)
     secondaryColor = ItemGlobals.getSecondaryColor(itemId)
     if localAvatar.style.gender == 'm':
         maleModelId = ItemGlobals.getMaleModelId(itemId)
         if maleModelId:
             jewelId = maleModelId
             dna = HumanDNA.HumanDNA(localAvatar.style.gender)
             dna.copy(localAvatar.style)
             gender = 'm'
         else:
             jewelId = ItemGlobals.getFemaleModelId(itemId)
             dna = HumanDNA.HumanDNA('f')
             gender = 'f'
     else:
         femaleModelId = ItemGlobals.getFemaleModelId(itemId)
         if femaleModelId:
             jewelId = femaleModelId
             dna = HumanDNA.HumanDNA(localAvatar.style.gender)
             dna.copy(localAvatar.style)
             gender = 'f'
         else:
             jewelId = ItemGlobals.getMaleModelId(itemId)
             dna = HumanDNA.HumanDNA('m')
             gender = 'm'
     if jewelType == JewelryGlobals.LBROW:
         dna.setJewelryZone3(jewelId, primaryColor, secondaryColor)
     elif jewelType == JewelryGlobals.LEAR:
         dna.setJewelryZone1(jewelId, primaryColor, secondaryColor)
     elif jewelType == JewelryGlobals.NOSE:
         dna.setJewelryZone5(jewelId, primaryColor, secondaryColor)
     elif jewelType == JewelryGlobals.MOUTH:
         dna.setJewelryZone6(jewelId, primaryColor, secondaryColor)
     elif jewelType == JewelryGlobals.LHAND:
         dna.setJewelryZone7(jewelId, primaryColor, secondaryColor)
     
     dna.setClothesHat(0, 0)
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:70,代码来源:InventoryUIJewelryItem.py

示例4: showDetails

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getMaleModelId [as 别名]

#.........这里部分代码省略.........
        elif bodyShape == 8:
            bodyOffset = 0.5
            if gender == 'm':
                headOffset = -0.14999999999999999
                armOffset = -0.10000000000000001
                chestOffset = -0.20000000000000001
            elif gender == 'f':
                headOffset = -0.20000000000000001
                armOffset = -0.10000000000000001
                chestOffset = -0.20000000000000001

        elif bodyShape == 9:
            bodyOffset = 0.5
            if gender == 'm':
                headOffset = -0.29999999999999999
                armOffset = -0.20000000000000001
                chestOffset = -0.29999999999999999
            elif gender == 'f':
                headOffset = -0.40000000000000002
                armOffset = -0.20000000000000001
                chestOffset = -0.29999999999999999


        m = Mat4(Mat4.identMat())
        itemType = ItemGlobals.getType(itemId)
        if itemType == ItemGlobals.CHEST:
            tattooType = TattooGlobals.ZONE1
        elif itemType == ItemGlobals.ARM:
            tattooType = TattooGlobals.ZONE2
        elif itemType == ItemGlobals.FACE:
            tattooType = TattooGlobals.ZONE4

        if localAvatar.style.gender == 'm':
            maleModelId = ItemGlobals.getMaleModelId(itemId)
            if maleModelId:
                tattooId = maleModelId
                tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getMaleOrientation(itemId))
                dna = HumanDNA.HumanDNA(localAvatar.style.gender)
                dna.copy(localAvatar.style)
                gender = 'm'
            else:
                tattooId = ItemGlobals.getFemaleModelId(itemId)
                tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getFemaleOrientation(itemId))
                dna = HumanDNA.HumanDNA('f')
                gender = 'f'
        else:
            femaleModelId = ItemGlobals.getFemaleModelId(itemId)
            if femaleModelId:
                tattooId = femaleModelId
                tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getFemaleOrientation(itemId))
                dna = HumanDNA.HumanDNA(localAvatar.style.gender)
                dna.copy(localAvatar.style)
                gender = 'f'
            else:
                tattooId = ItemGlobals.getMaleModelId(itemId)
                tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getMaleOrientation(itemId))
                dna = HumanDNA.HumanDNA('m')
                gender = 'm'
        offsetx = tattooOrientation[0]
        offsety = tattooOrientation[1]
        scale = tattooOrientation[2]
        rotate = tattooOrientation[3]
        color = 0
        S = Vec2(1 / float(scale), 1 / float(scale))
        Iv = Vec2(offsetx, offsety)
        Vm = Vec2(sin(rotate * pi / 180.0), cos(rotate * pi / 180.0))
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:70,代码来源:InventoryUITattooItem.py

示例5: showDetails

# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getMaleModelId [as 别名]
 def showDetails(self, cell, detailsPos, detailsHeight, event = None):
     self.notify.debug('Item showDetails')
     if self.manager.heldItem and self.manager.locked and cell.isEmpty() or not (self.itemTuple):
         self.notify.debug(' early exit')
         return None
     
     itemId = self.getId()
     self.helpFrame = DirectFrame(parent = self.manager, relief = None, state = DGG.DISABLED, sortOrder = 1)
     self.helpFrame.setBin('gui-popup', -5)
     detailGui = loader.loadModel('models/gui/gui_card_detail')
     topGui = loader.loadModel('models/gui/toplevel_gui')
     coinImage = topGui.find('**/treasure_w_coin*')
     halfWidth = 0.29999999999999999
     halfHeight = 0.20000000000000001
     basePosX = cell.getX(aspect2d)
     basePosZ = cell.getZ(aspect2d)
     cellSizeX = 0.0
     cellSizeZ = 0.0
     if cell:
         cellSizeX = cell.cellSizeX
         cellSizeZ = cell.cellSizeZ
     
     textScale = PiratesGuiGlobals.TextScaleMed
     titleScale = PiratesGuiGlobals.TextScaleTitleSmall
     if len(self.getName()) >= 30:
         titleNameScale = PiratesGuiGlobals.TextScaleLarge
     else:
         titleNameScale = PiratesGuiGlobals.TextScaleExtraLarge
     subtitleScale = PiratesGuiGlobals.TextScaleMed
     iconScalar = 1.5
     borderScaler = 0.25
     splitHeight = 0.01
     vMargin = 0.029999999999999999
     runningVertPosition = 0.29999999999999999
     runningSize = 0.0
     labels = []
     titleColor = PiratesGuiGlobals.TextFG6
     rarity = ItemGlobals.getRarity(itemId)
     rarityText = PLocalizer.getItemRarityName(rarity)
     typeText = ClothingGlobals.getClothingTypeName(ItemGlobals.getType(itemId))
     if rarity == ItemGlobals.CRUDE:
         titleColor = PiratesGuiGlobals.TextFG24
     elif rarity == ItemGlobals.COMMON:
         titleColor = PiratesGuiGlobals.TextFG13
     elif rarity == ItemGlobals.RARE:
         titleColor = PiratesGuiGlobals.TextFG4
     elif rarity == ItemGlobals.FAMED:
         titleColor = PiratesGuiGlobals.TextFG5
     
     titleLabel = DirectLabel(parent = self, relief = None, text = self.getName(), text_scale = titleNameScale, text_fg = titleColor, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
     self.bg.setColor(titleColor)
     tHeight = 0.070000000000000007
     titleLabel.setZ(runningVertPosition)
     runningVertPosition -= tHeight
     runningSize += tHeight
     labels.append(titleLabel)
     subtitleLabel = DirectLabel(parent = self, relief = None, text = '\x001slant\x001%s %s\x002' % (rarityText, typeText), text_scale = subtitleScale, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
     subtHeight = 0.050000000000000003
     subtitleLabel.setZ(subtHeight * 0.5 + runningVertPosition)
     runningVertPosition -= subtHeight
     runningSize += subtHeight
     labels.append(subtitleLabel)
     clothingType = ItemGlobals.getType(itemId)
     if localAvatar.style.getGender() == 'm':
         maleModelId = ItemGlobals.getMaleModelId(itemId)
         if maleModelId != -1:
             modelId = maleModelId
             texId = ItemGlobals.getMaleTextureId(itemId)
             dna = HumanDNA.HumanDNA(localAvatar.style.gender)
             dna.copy(localAvatar.style)
             gender = 'm'
         else:
             modelId = ItemGlobals.getFemaleModelId(itemId)
             texId = ItemGlobals.getFemaleTextureId(itemId)
             dna = HumanDNA.HumanDNA('f')
             gender = 'f'
     else:
         femaleModelId = ItemGlobals.getFemaleModelId(itemId)
         if femaleModelId != -1:
             modelId = femaleModelId
             texId = ItemGlobals.getFemaleTextureId(itemId)
             dna = HumanDNA.HumanDNA(localAvatar.style.gender)
             dna.copy(localAvatar.style)
             gender = 'f'
         else:
             modelId = ItemGlobals.getMaleModelId(itemId)
             texId = ItemGlobals.getMaleTextureId(itemId)
             dna = HumanDNA.HumanDNA('m')
             gender = 'm'
     bodyShape = localAvatar.style.getBodyShape()
     bodyHeight = localAvatar.style.getBodyHeight()
     bodyOffset = 0.5
     headOffset = 0
     topOffset = 0
     pantOffset = 0
     beltOffset = 0
     shoeOffset = 0
     if bodyShape == 0:
         bodyOffset = 1
         headOffset = 0.69999999999999996
#.........这里部分代码省略.........
开发者ID:TTGhost,项目名称:POTCOR-src,代码行数:103,代码来源:InventoryUIClothingItem.py


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