WeaponGlobals.C_FLAMING: ('buff_burn', PLocalizer.BuffOnFire),
 WeaponGlobals.C_STUN: ('buff_stun', PLocalizer.BuffStun),
 WeaponGlobals.C_UNSTUN: ('buff_stun', PLocalizer.BuffUnstun),
 WeaponGlobals.C_SLOW: ('buff_stun', PLocalizer.BuffSlow),
 WeaponGlobals.C_PAIN: ('buff_stun', PLocalizer.BuffSlow),
 WeaponGlobals.C_DIRT: ('buff_blind', PLocalizer.BuffBlind),
 WeaponGlobals.C_BLIND: ('buff_blind', PLocalizer.BuffBlind),
 WeaponGlobals.C_CURSE: ('buff_curse', PLocalizer.BuffCurse),
 WeaponGlobals.C_HASTEN: ('buff_hasten', PLocalizer.BuffHasten % int(WeaponGlobals.HASTEN_BONUS * 100)),
 WeaponGlobals.C_TAUNT: ('buff_taunt', PLocalizer.BuffTaunt),
 WeaponGlobals.C_WEAKEN: ('buff_weaken', PLocalizer.BuffWeaken),
 WeaponGlobals.C_REGEN: ('buff_stun', PLocalizer.BuffRegen),
 WeaponGlobals.C_SPAWN: ('buff_blind', PLocalizer.BuffSpawn),
 WeaponGlobals.C_VOODOO_STUN_LOCK: ('buff_stun', PLocalizer.BuffVoodooStunLock),
 WeaponGlobals.C_UNKNOWN_EFFECT: ('buff_weaken', PLocalizer.BuffUnknownEffect),
 WeaponGlobals.C_REP_BONUS_LVL1: ('buff_repBoost', PLocalizer.BuffReputation % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_REP_BONUS_LVL1) * 100)),
 WeaponGlobals.C_REP_BONUS_LVL2: ('buff_repBoost', PLocalizer.BuffReputation % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_REP_BONUS_LVL2) * 100)),
 WeaponGlobals.C_REP_BONUS_LVL3: ('buff_repBoost', PLocalizer.BuffReputation % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_REP_BONUS_LVL3) * 100)),
 WeaponGlobals.C_GOLD_BONUS_LVL1: ('buff_goldBoost', PLocalizer.BuffGold % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_GOLD_BONUS_LVL1) * 100)),
 WeaponGlobals.C_GOLD_BONUS_LVL2: ('buff_goldBoost', PLocalizer.BuffGold % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_GOLD_BONUS_LVL2) * 100)),
 WeaponGlobals.C_CANNON_DAMAGE_LVL1: ('buff_cannonDmgUp', PLocalizer.BuffCannonDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_CANNON_DAMAGE_LVL1) * 100)),
 WeaponGlobals.C_CANNON_DAMAGE_LVL2: ('buff_cannonDmgUp', PLocalizer.BuffCannonDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_CANNON_DAMAGE_LVL2) * 100)),
 WeaponGlobals.C_CANNON_DAMAGE_LVL3: ('buff_cannonDmgUp', PLocalizer.BuffCannonDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_CANNON_DAMAGE_LVL3) * 100)),
 WeaponGlobals.C_PISTOL_DAMAGE_LVL1: ('buff_gunDmgUp', PLocalizer.BuffPistolDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_PISTOL_DAMAGE_LVL1) * 100)),
 WeaponGlobals.C_PISTOL_DAMAGE_LVL2: ('buff_gunDmgUp', PLocalizer.BuffPistolDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_PISTOL_DAMAGE_LVL2) * 100)),
 WeaponGlobals.C_PISTOL_DAMAGE_LVL3: ('buff_gunDmgUp', PLocalizer.BuffPistolDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_PISTOL_DAMAGE_LVL3) * 100)),
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL1: ('buff_swordDmgUp', PLocalizer.BuffCutlassDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_CUTLASS_DAMAGE_LVL1) * 100)),
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL2: ('buff_swordDmgUp', PLocalizer.BuffCutlassDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_CUTLASS_DAMAGE_LVL2) * 100)),
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL3: ('buff_swordDmgUp', PLocalizer.BuffCutlassDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_CUTLASS_DAMAGE_LVL3) * 100)),
 WeaponGlobals.C_DOLL_DAMAGE_LVL1: ('buff_voodooDmgUp', PLocalizer.BuffDollDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_DOLL_DAMAGE_LVL1) * 100)),
 WeaponGlobals.C_DOLL_DAMAGE_LVL2: ('buff_voodooDmgUp', PLocalizer.BuffDollDamage % int(PotionGlobals.getPotionPotency(WeaponGlobals.C_DOLL_DAMAGE_LVL2) * 100)),
 def showDetails(self, cell, detailsPos, detailsHeight, event = None):
     self.notify.debug('Item showDetails')
     if self.manager.heldItem and self.manager.locked and cell.isEmpty() and self.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*')
     self.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
     self.BuffIcons = loader.loadModel('models/textureCards/buff_icons')
     border = self.SkillIcons.find('**/base')
     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)
     subtypeText = PLocalizer.getItemSubtypeName(ItemGlobals.getSubtype(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 = '\x01slant\x01%s %s\x02' % (rarityText, subtypeText), 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)
     itemType = ItemGlobals.getType(itemId)
     itemSubtype = ItemGlobals.getSubtype(itemId)
     model = ItemGlobals.getModel(itemId)
     skillIcons = loader.loadModel('models/textureCards/skillIcons')
     if itemSubtype == ItemGlobals.POTION_BUFF:
         self.iconLabel = DirectLabel(parent = self.portraitSceneGraph, relief = None, image = skillIcons.find('**/%s' % ItemGlobals.getIcon(itemId)), pos = (0.0, 2.5, 0.0))
     elif model:
         self.realItem = loader.loadModel('models/inventory/' + model, okMissing = True)
         if not self.realItem:
             self.realItem = loader.loadModel('models/handheld/' + model)
         
         if self.realItem:
             posHpr = ItemGlobals.getModelPosHpr(model)
             if posHpr:
                 self.realItem.setPos(posHpr[0], posHpr[1], posHpr[2])
                 self.realItem.setHpr(posHpr[3], posHpr[4], posHpr[5])
             else:
                 self.realItem.setPos(0.0, 2.5, -0.40000000000000002)
                 self.realItem.setHpr(45, 0, 0)
             self.realItem.reparentTo(self.portraitSceneGraph)
         
     
     iHeight = 0.17999999999999999
     self.createBuffer()
     self.itemCard.setZ(runningVertPosition - 0.059999999999999998)
     runningVertPosition -= iHeight
     runningSize += iHeight
     labels.append(self.itemCard)
     itemCost = int(ItemGlobals.getGoldCost(itemId))
     if self.cell and self.cell.container:
         itemCost = int(itemCost * self.cell.container.getItemPriceMult())
     
     goldLabel = DirectLabel(parent = self, relief = None, image = coinImage, image_scale = 0.12, image_pos = Vec3(0.025000000000000001, 0, -0.02), text = str(itemCost), text_scale = subtitleScale, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (halfWidth - 0.050000000000000003, 0.0, runningVertPosition + 0.080000000000000002), text_pos = (0.0, -textScale))
     labels.append(goldLabel)
     if ItemGlobals.getSubtype(itemId) == 30:
         duration = PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(ItemGlobals.getUseSkill(itemId)))
         if duration >= 3600:
             duration = duration / 3600
             if duration == 1:
                 units = PLocalizer.Hour
             else:
                 units = PLocalizer.Hours
         elif duration >= 60:
             duration = duration / 60
             if duration == 1:
                 units = PLocalizer.Minute
             else:
                 units = PLocalizer.Minutes
         else:
             units = PLocalizer.Seconds
         potency = PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(ItemGlobals.getUseSkill(itemId)))
         data = {
             'pot': int(potency * 100),
             'dur': int(duration),
             'unit': units }
         description = PLocalizer.PotionDescs[ItemGlobals.getUseSkill(itemId)].safe_substitute(data)
     else:
         description = PLocalizer.getItemFlavorText(itemId)
     if description != '':
         descriptionLabel = DirectLabel(parent = self, relief = None, text = description, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.94999999999999996 / textScale), text_align = TextNode.ALeft, pos = (-halfWidth + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
         dHeight = descriptionLabel.getHeight() + 0.02
         runningVertPosition -= dHeight
         runningSize += dHeight
         labels.append(descriptionLabel)
     
     if not Freebooter.getPaidStatus(localAvatar.getDoId()):
         if rarity != ItemGlobals.CRUDE:
             unlimitedLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.UnlimitedAccessRequirement, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = PiratesGuiGlobals.TextFG6, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
             uHeight = unlimitedLabel.getHeight()
             runningVertPosition -= uHeight
             runningSize += uHeight
             labels.append(unlimitedLabel)
         
     
     runningVertPosition -= 0.02
     runningSize += 0.02
     useLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.RightClickPotion, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = PiratesGuiGlobals.TextFG6, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
     uHeight = useLabel.getHeight()
     runningVertPosition -= uHeight
     runningSize += uHeight
     labels.append(useLabel)
     runningVertPosition -= 0.02
     runningSize += 0.02
     panels = self.helpFrame.attachNewNode('panels')
     topPanel = panels.attachNewNode('middlePanel')
     detailGui.find('**/top_panel').copyTo(topPanel)
     topPanel.setScale(0.080000000000000002)
     topPanel.reparentTo(self.helpFrame)
     middlePanel = panels.attachNewNode('middlePanel')
     detailGui.find('**/middle_panel').copyTo(middlePanel)
     middlePanel.setScale(0.080000000000000002)
     middlePanel.reparentTo(self.helpFrame)
     placement = 0
     i = 0
     heightMax = -0.080000000000000002
     currentHeight = runningVertPosition
     if detailsHeight:
         currentHeight = -detailsHeight
     
     while currentHeight < heightMax:
         middlePanel = panels.attachNewNode('middlePanel%s' % 1)
         detailGui.find('**/middle_panel').copyTo(middlePanel)
         middlePanel.setScale(0.080000000000000002)
         middlePanel.reparentTo(self.helpFrame)
         if currentHeight + 0.20000000000000001 >= heightMax:
             difference = heightMax - currentHeight
             placement += (0.16800000000000001 / 0.20000000000000001) * difference
             currentHeight += difference
         else:
             placement += 0.16800000000000001
             currentHeight += 0.20000000000000001
         middlePanel.setZ(-placement)
         i += 1
     bottomPanel = panels.attachNewNode('bottomPanel')
     detailGui.find('**/bottom_panel').copyTo(bottomPanel)
     bottomPanel.setScale(0.080000000000000002)
     bottomPanel.setZ(-placement)
     bottomPanel.reparentTo(self.helpFrame)
     colorPanel = panels.attachNewNode('colorPanel')
     detailGui.find('**/color').copyTo(colorPanel)
     colorPanel.setScale(0.080000000000000002)
     colorPanel.setColor(titleColor)
     colorPanel.reparentTo(self.helpFrame)
     lineBreakTopPanel = panels.attachNewNode('lineBreakTopPanel')
     detailGui.find('**/line_break_top').copyTo(lineBreakTopPanel)
     lineBreakTopPanel.setScale(0.080000000000000002, 0.080000000000000002, 0.070000000000000007)
     lineBreakTopPanel.setZ(0.0080000000000000002)
     lineBreakTopPanel.reparentTo(self.helpFrame)
     panels.flattenStrong()
     self.helpFrame['frameSize'] = (-halfWidth, halfWidth, -(runningSize + vMargin), vMargin)
     totalHeight = self.helpFrame.getHeight() - 0.10000000000000001
     for label in labels:
         label.reparentTo(self.helpFrame)
     
     if basePosX > 0.0:
         newPosX = basePosX - halfWidth + cellSizeX * 0.45000000000000001
     else:
         newPosX = basePosX + halfWidth + cellSizeX * 0.45000000000000001
     if basePosZ > 0.0:
         newPosZ = basePosZ + cellSizeZ * 0.45000000000000001
     else:
         newPosZ = basePosZ + totalHeight - cellSizeZ * 0.75
     if detailsPos:
         (newPosX, newPosZ) = detailsPos
     
     self.helpFrame.setPos(newPosX, 0, newPosZ)
Exemplo n.º 3
0
        'level': 6
    }],
    'level':
    20,
    'discovered':
    False
}, {
    'name':
    PLocalizer.InventoryTypeNames[InventoryType.CannonDamageLvl1],
    'desc':
    safeSubstitute(
        PLocalizer.PotionDescs[InventoryType.CannonDamageLvl1], {
            'pot':
            int(
                PotionGlobals.getPotionPotency(
                    WeaponGlobals.getSkillEffectFlag(
                        InventoryType.CannonDamageLvl1)) * 100),
            'dur':
            int(
                PotionGlobals.getPotionBuffDuration(
                    WeaponGlobals.getSkillEffectFlag(
                        InventoryType.CannonDamageLvl1))),
            'unit':
            'seconds'
        }),
    'potionID':
    C_CANNON_DAMAGE_LVL1,
    'ingredients': [{
        'color': 0,
        'level': 3
    }, {
Exemplo n.º 4
0
 WeaponGlobals.C_BLIND: ('buff_blind', PLocalizer.BuffBlind),
 WeaponGlobals.C_CURSE: ('buff_curse', PLocalizer.BuffCurse),
 WeaponGlobals.C_HASTEN:
 ('buff_hasten',
  PLocalizer.BuffHasten % int(WeaponGlobals.HASTEN_BONUS * 100)),
 WeaponGlobals.C_TAUNT: ('buff_taunt', PLocalizer.BuffTaunt),
 WeaponGlobals.C_WEAKEN: ('buff_weaken', PLocalizer.BuffWeaken),
 WeaponGlobals.C_REGEN: ('buff_stun', PLocalizer.BuffRegen),
 WeaponGlobals.C_SPAWN: ('buff_blind', PLocalizer.BuffSpawn),
 WeaponGlobals.C_VOODOO_STUN_LOCK:
 ('buff_stun', PLocalizer.BuffVoodooStunLock),
 WeaponGlobals.C_UNKNOWN_EFFECT:
 ('buff_weaken', PLocalizer.BuffUnknownEffect),
 WeaponGlobals.C_REP_BONUS_LVL1:
 ('buff_repBoost', PLocalizer.BuffReputation % int(
     PotionGlobals.getPotionPotency(WeaponGlobals.C_REP_BONUS_LVL1) * 100)),
 WeaponGlobals.C_REP_BONUS_LVL2:
 ('buff_repBoost', PLocalizer.BuffReputation % int(
     PotionGlobals.getPotionPotency(WeaponGlobals.C_REP_BONUS_LVL2) * 100)),
 WeaponGlobals.C_REP_BONUS_LVL3:
 ('buff_repBoost', PLocalizer.BuffReputation % int(
     PotionGlobals.getPotionPotency(WeaponGlobals.C_REP_BONUS_LVL3) * 100)),
 WeaponGlobals.C_GOLD_BONUS_LVL1:
 ('buff_goldBoost', PLocalizer.BuffGold % int(
     PotionGlobals.getPotionPotency(WeaponGlobals.C_GOLD_BONUS_LVL1) * 100)
  ),
 WeaponGlobals.C_GOLD_BONUS_LVL2:
 ('buff_goldBoost', PLocalizer.BuffGold % int(
     PotionGlobals.getPotionPotency(WeaponGlobals.C_GOLD_BONUS_LVL2) * 100)
  ),
 WeaponGlobals.C_CANNON_DAMAGE_LVL1:
Exemplo n.º 5
0
 PotionRecipeData.PotionRecipeList[21]['desc'],
 WeaponGlobals.C_HASTEN_LVL2:
 PotionRecipeData.PotionRecipeList[22]['desc'],
 WeaponGlobals.C_HASTEN_LVL3:
 PotionRecipeData.PotionRecipeList[23]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL1:
 PotionRecipeData.PotionRecipeList[24]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL2:
 PotionRecipeData.PotionRecipeList[25]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL3:
 safeSubstitute(
     PLocalizer.PotionDescs[InventoryType.RepBonusLvl1], {
         'pot':
         int(
             PotionGlobals.getPotionPotency(
                 WeaponGlobals.getSkillEffectFlag(
                     InventoryType.RepBonusLvl1)) * 100),
         'dur':
         int(
             PotionGlobals.getPotionBuffDuration(
                 WeaponGlobals.getSkillEffectFlag(
                     InventoryType.RepBonusLvl1))) / 3600,
         'unit':
         'hour'
     }),
 WeaponGlobals.C_REP_BONUS_LVLCOMP:
 safeSubstitute(
     PLocalizer.PotionDescs[InventoryType.RepBonusLvlComp], {
         'pot':
         int(
             PotionGlobals.getPotionPotency(
         'pot': 0,
         'dur': 0,
         'unit': 0 }),
     'disabled': True,
     'potionID': C_CRAB_TRANSFORM,
     'ingredients': [
         {
             'color': 1,
             'level': 6 }],
     'level': 20,
     'free': False,
     'discovered': False },
 {
     'name': PLocalizer.InventoryTypeNames[InventoryType.CannonDamageLvl1],
     'desc': safeSubstitute(PLocalizer.PotionDescs[InventoryType.CannonDamageLvl1], {
         'pot': int(PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(InventoryType.CannonDamageLvl1)) * 100),
         'dur': int(PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(InventoryType.CannonDamageLvl1))),
         'unit': 'seconds' }),
     'potionID': C_CANNON_DAMAGE_LVL1,
     'ingredients': [
         {
             'color': 0,
             'level': 3 },
         {
             'color': 1,
             'level': 3 },
         {
             'color': 2,
             'level': 3 }],
     'level': 2,
     'free': True,
    def showDetails(self, cell, detailsPos, detailsHeight, event = None):
        self.notify.debug('Item showDetails')
        if self.manager.heldItem and self.manager.locked and cell.isEmpty() and self.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*')
        self.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
        self.BuffIcons = loader.loadModel('models/textureCards/buff_icons')
        border = self.SkillIcons.find('**/base')
        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)
        subtypeText = PLocalizer.getItemSubtypeName(ItemGlobals.getSubtype(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 = 'slant%s %s' % (rarityText, subtypeText), 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)
        itemType = ItemGlobals.getType(itemId)
        itemSubtype = ItemGlobals.getSubtype(itemId)
        model = ItemGlobals.getModel(itemId)
        skillIcons = loader.loadModel('models/textureCards/skillIcons')
        if itemSubtype == ItemGlobals.POTION_BUFF:
            self.iconLabel = DirectLabel(parent = self.portraitSceneGraph, relief = None, image = skillIcons.find('**/%s' % ItemGlobals.getIcon(itemId)), pos = (0.0, 2.5, 0.0))
        elif model:
            self.realItem = loader.loadModel('models/inventory/' + model, okMissing = True)
            if not self.realItem:
                self.realItem = loader.loadModel('models/handheld/' + model)

            if self.realItem:
                posHpr = ItemGlobals.getModelPosHpr(model)
                if posHpr:
                    self.realItem.setPos(posHpr[0], posHpr[1], posHpr[2])
                    self.realItem.setHpr(posHpr[3], posHpr[4], posHpr[5])
                else:
                    self.realItem.setPos(0.0, 2.5, -0.40000000000000002)
                    self.realItem.setHpr(45, 0, 0)
                self.realItem.reparentTo(self.portraitSceneGraph)


        iHeight = 0.17999999999999999
        self.createBuffer()
        self.itemCard.setZ(runningVertPosition - 0.059999999999999998)
        runningVertPosition -= iHeight
        runningSize += iHeight
        labels.append(self.itemCard)
        goldLabel = DirectLabel(parent = self, relief = None, image = coinImage, image_scale = 0.12, image_pos = Vec3(0.025000000000000001, 0, -0.02), text = str(int(ItemGlobals.getGoldCost(itemId) * ItemGlobals.GOLD_SALE_MULTIPLIER)), text_scale = subtitleScale, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, pos = (halfWidth - 0.050000000000000003, 0.0, runningVertPosition + 0.080000000000000002), text_pos = (0.0, -textScale))
        labels.append(goldLabel)
        if ItemGlobals.getSubtype(itemId) == 30:
            duration = PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(ItemGlobals.getUseSkill(itemId)))
            if duration >= 3600:
                duration = duration / 3600
                if duration == 1:
                    units = PLocalizer.Hour
                else:
                    units = PLocalizer.Hours
            elif duration >= 60:
                duration = duration / 60
                if duration == 1:
                    units = PLocalizer.Minute
                else:
                    units = PLocalizer.Minutes
            else:
                units = PLocalizer.Seconds
            potency = PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(ItemGlobals.getUseSkill(itemId)))
            data = {
                'pot': int(potency * 100),
                'dur': int(duration),
                'unit': units }
            description = PLocalizer.PotionDescs[ItemGlobals.getUseSkill(itemId)].safe_substitute(data)
        else:
            description = PLocalizer.getItemFlavorText(itemId)
        if description != '':
            descriptionLabel = DirectLabel(parent = self, relief = None, text = description, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (0.94999999999999996 / textScale), text_align = TextNode.ALeft, pos = (-halfWidth + textScale * 0.5, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
            dHeight = descriptionLabel.getHeight() + 0.02
            runningVertPosition -= dHeight
            runningSize += dHeight
            labels.append(descriptionLabel)

        if not Freebooter.getPaidStatus(localAvatar.getDoId()):
            if rarity != ItemGlobals.CRUDE:
                unlimitedLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.UnlimitedAccessRequirement, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = PiratesGuiGlobals.TextFG6, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
                uHeight = unlimitedLabel.getHeight()
                runningVertPosition -= uHeight
                runningSize += uHeight
                labels.append(unlimitedLabel)


        runningVertPosition -= 0.02
        runningSize += 0.02
        useLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.RightClickPotion, text_scale = textScale, text_wordwrap = halfWidth * 2.0 * (1.5 / titleScale), text_fg = PiratesGuiGlobals.TextFG6, text_shadow = PiratesGuiGlobals.TextShadow, text_align = TextNode.ACenter, pos = (0.0, 0.0, runningVertPosition), text_pos = (0.0, -textScale))
        uHeight = useLabel.getHeight()
        runningVertPosition -= uHeight
        runningSize += uHeight
        labels.append(useLabel)
        runningVertPosition -= 0.02
        runningSize += 0.02
        panels = self.helpFrame.attachNewNode('panels')
        topPanel = panels.attachNewNode('middlePanel')
        detailGui.find('**/top_panel').copyTo(topPanel)
        topPanel.setScale(0.080000000000000002)
        topPanel.reparentTo(self.helpFrame)
        middlePanel = panels.attachNewNode('middlePanel')
        detailGui.find('**/middle_panel').copyTo(middlePanel)
        middlePanel.setScale(0.080000000000000002)
        middlePanel.reparentTo(self.helpFrame)
        placement = 0
        i = 0
        heightMax = -0.080000000000000002
        currentHeight = runningVertPosition
        if detailsHeight:
            currentHeight = -detailsHeight

        while currentHeight < heightMax:
            middlePanel = panels.attachNewNode('middlePanel%s' % 1)
            detailGui.find('**/middle_panel').copyTo(middlePanel)
            middlePanel.setScale(0.080000000000000002)
            middlePanel.reparentTo(self.helpFrame)
            if currentHeight + 0.20000000000000001 >= heightMax:
                difference = heightMax - currentHeight
                placement += (0.16800000000000001 / 0.20000000000000001) * difference
                currentHeight += difference
            else:
                placement += 0.16800000000000001
                currentHeight += 0.20000000000000001
            middlePanel.setZ(-placement)
            i += 1
        bottomPanel = panels.attachNewNode('bottomPanel')
        detailGui.find('**/bottom_panel').copyTo(bottomPanel)
        bottomPanel.setScale(0.080000000000000002)
        bottomPanel.setZ(-placement)
        bottomPanel.reparentTo(self.helpFrame)
        colorPanel = panels.attachNewNode('colorPanel')
        detailGui.find('**/color').copyTo(colorPanel)
        colorPanel.setScale(0.080000000000000002)
        colorPanel.setColor(titleColor)
        colorPanel.reparentTo(self.helpFrame)
        lineBreakTopPanel = panels.attachNewNode('lineBreakTopPanel')
        detailGui.find('**/line_break_top').copyTo(lineBreakTopPanel)
        lineBreakTopPanel.setScale(0.080000000000000002, 0.080000000000000002, 0.070000000000000007)
        lineBreakTopPanel.setZ(0.0080000000000000002)
        lineBreakTopPanel.reparentTo(self.helpFrame)
        panels.flattenStrong()
        self.helpFrame['frameSize'] = (-halfWidth, halfWidth, -(runningSize + vMargin), vMargin)
        totalHeight = self.helpFrame.getHeight() - 0.10000000000000001
        for label in labels:
            label.reparentTo(self.helpFrame)

        if basePosX > 0.0:
            newPosX = basePosX - halfWidth + cellSizeX * 0.45000000000000001
        else:
            newPosX = basePosX + halfWidth + cellSizeX * 0.45000000000000001
        if basePosZ > 0.0:
            newPosZ = basePosZ + cellSizeZ * 0.45000000000000001
        else:
            newPosZ = basePosZ + totalHeight - cellSizeZ * 0.75
        if detailsPos:
            (newPosX, newPosZ) = detailsPos

        self.helpFrame.setPos(newPosX, 0, newPosZ)
 WeaponGlobals.C_PISTOL_DAMAGE_LVL1: PotionRecipeData.PotionRecipeList[11]['desc'],
 WeaponGlobals.C_PISTOL_DAMAGE_LVL2: PotionRecipeData.PotionRecipeList[15]['desc'],
 WeaponGlobals.C_PISTOL_DAMAGE_LVL3: PotionRecipeData.PotionRecipeList[19]['desc'],
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL1: PotionRecipeData.PotionRecipeList[12]['desc'],
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL2: PotionRecipeData.PotionRecipeList[16]['desc'],
 WeaponGlobals.C_CUTLASS_DAMAGE_LVL3: PotionRecipeData.PotionRecipeList[11]['desc'],
 WeaponGlobals.C_DOLL_DAMAGE_LVL1: PotionRecipeData.PotionRecipeList[13]['desc'],
 WeaponGlobals.C_DOLL_DAMAGE_LVL2: PotionRecipeData.PotionRecipeList[17]['desc'],
 WeaponGlobals.C_DOLL_DAMAGE_LVL3: PotionRecipeData.PotionRecipeList[20]['desc'],
 WeaponGlobals.C_HASTEN_LVL1: PotionRecipeData.PotionRecipeList[21]['desc'],
 WeaponGlobals.C_HASTEN_LVL2: PotionRecipeData.PotionRecipeList[22]['desc'],
 WeaponGlobals.C_HASTEN_LVL3: PotionRecipeData.PotionRecipeList[23]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL1: PotionRecipeData.PotionRecipeList[24]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL2: PotionRecipeData.PotionRecipeList[25]['desc'],
 WeaponGlobals.C_REP_BONUS_LVL3: safeSubstitute(PLocalizer.PotionDescs[InventoryType.RepBonusLvl1], {
     'pot': int(PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvl1)) * 100),
     'dur': int(PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvl1))) / 3600,
     'unit': 'hour' }),
 WeaponGlobals.C_REP_BONUS_LVLCOMP: safeSubstitute(PLocalizer.PotionDescs[InventoryType.RepBonusLvlComp], {
     'pot': int(PotionGlobals.getPotionPotency(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvlComp)) * 100),
     'dur': int(PotionGlobals.getPotionBuffDuration(WeaponGlobals.getSkillEffectFlag(InventoryType.RepBonusLvlComp))) / 3600,
     'unit': 'hour' }),
 WeaponGlobals.C_GOLD_BONUS_LVL1: PotionRecipeData.PotionRecipeList[26]['desc'],
 WeaponGlobals.C_GOLD_BONUS_LVL2: PotionRecipeData.PotionRecipeList[27]['desc'],
 WeaponGlobals.C_INVISIBILITY_LVL1: PotionRecipeData.PotionRecipeList[28]['desc'],
 WeaponGlobals.C_INVISIBILITY_LVL2: PotionRecipeData.PotionRecipeList[29]['desc'],
 WeaponGlobals.C_REGEN_LVL1: PotionRecipeData.PotionRecipeList[35]['desc'],
 WeaponGlobals.C_REGEN_LVL2: PotionRecipeData.PotionRecipeList[36]['desc'],
 WeaponGlobals.C_REGEN_LVL3: PotionRecipeData.PotionRecipeList[37]['desc'],
 WeaponGlobals.C_REGEN_LVL4: PotionRecipeData.PotionRecipeList[38]['desc'],
 WeaponGlobals.C_BURP: PotionRecipeData.PotionRecipeList[0]['desc'],