當前位置: 首頁>>代碼示例>>Python>>正文


Python Freebooter.getPaidStatusAI方法代碼示例

本文整理匯總了Python中pirates.piratesbase.Freebooter.getPaidStatusAI方法的典型用法代碼示例。如果您正苦於以下問題:Python Freebooter.getPaidStatusAI方法的具體用法?Python Freebooter.getPaidStatusAI怎麽用?Python Freebooter.getPaidStatusAI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pirates.piratesbase.Freebooter的用法示例。


在下文中一共展示了Freebooter.getPaidStatusAI方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: applyTo

# 需要導入模塊: from pirates.piratesbase import Freebooter [as 別名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatusAI [as 別名]
    def applyTo(self, trade, av):
        avId = av.getDoId()
        goldAmt = EnemyGlobals.getMaxGoldDrop(None, self.amount, 5)
        if Freebooter.getPaidStatusAI(avId):
            if REWARD_TO == 2 or REWARD_TO == 3:
                goldAmt *= GOLDFACTOR_HOLIDAY
            elif not Freebooter.getPaidStatusAI(avId):
                if REWARD_TO == 1 or REWARD_TO == 3:
                    goldAmt *= GOLDFACTOR_HOLIDAY

        trade.giveGoldInPocket(goldAmt)
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:13,代碼來源:QuestReward.py

示例2: giveReputation

# 需要導入模塊: from pirates.piratesbase import Freebooter [as 別名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatusAI [as 別名]
 def giveReputation(self, category, amount):
     if self.avatarId:
         av = self.air.doId2do.get(self.avatarId)
         if av:
             inv = av.getInventory()
             avExpMult = av.getExpMult()
             amount = int(avExpMult * amount)
             if inv:
                 if category == InventoryType.OverallRep:
                     curLevel = av.getLevel()
                     if Freebooter.getPaidStatusAI(self.avatarId):
                         levelCap = ReputationGlobals.GlobalLevelCap
                     else:
                         levelCap = Freebooter.FreeOverallLevelCap
                     if amount > 0 and curLevel < levelCap:
                         curRepTotal = inv.getAccumulator(InventoryType.OverallRep)
                         (newLevel, left) = ReputationGlobals.getLevelFromTotalReputation(InventoryType.OverallRep, curRepTotal + amount)
                         if newLevel >= levelCap:
                             amount = max(0, amount - left)
                         
                         self.giveAccumulatorAddition(category, amount)
                     
                 elif category == InventoryType.GeneralRep:
                     self.giveAccumulatorAddition(category, amount)
                 elif Freebooter.getPaidStatusAI(self.avatarId):
                     if category in [
                         InventoryType.PotionsRep,
                         InventoryType.FishingRep]:
                         levelCap = ReputationGlobals.MinigameLevelCap
                     else:
                         levelCap = ReputationGlobals.LevelCap
                 else:
                     levelCap = Freebooter.FreeLevelCap
                 repAmt = inv.getAccumulator(category)
                 (curLevel, curLeft) = ReputationGlobals.getLevelFromTotalReputation(category, repAmt)
                 if curLevel >= levelCap:
                     amount = 0
                 
                 (expLevel, left) = ReputationGlobals.getLevelFromTotalReputation(category, repAmt + amount)
                 if expLevel >= levelCap and curLevel < levelCap:
                     amount = max(0, amount - left)
                 
                 self.giveAccumulatorAddition(category, amount)
開發者ID:TTGhost,項目名稱:POTCOR-src,代碼行數:45,代碼來源:AITrade.py

示例3: getItemRequirements

# 需要導入模塊: from pirates.piratesbase import Freebooter [as 別名]
# 或者: from pirates.piratesbase.Freebooter import getPaidStatusAI [as 別名]
    def getItemRequirements(self, itemType, otherAdds = []):
        if not itemType:
            return None

        results = { }
        if game.process == 'client':
            paidStatus = Freebooter.getPaidStatus(self.ownerId)
        else:
            paidStatus = Freebooter.getPaidStatusAI(self.ownerId)
        rarity = ItemGlobals.getRarity(itemType)
        if rarity != ItemConstants.CRUDE and not paidStatus:
            results['paidStatus'] = (rarity != ItemConstants.CRUDE, False)

        itemClass = ItemGlobals.getClass(itemType)
        if itemClass == InventoryType.ItemTypeWeapon or itemClass == InventoryType.ItemTypeCharm:
            itemRepId = ItemGlobals.getItemRepId(itemType)
            itemRep = self.getReputation(itemRepId)
            itemLevel = ReputationGlobals.getLevelFromTotalReputation(itemRepId, itemRep)[0]
            weaponReq = ItemGlobals.getWeaponRequirement(itemType)
            trainingToken = EconomyGlobals.getItemTrainingReq(itemType)
            trainingAmt = self.getItemQuantity(trainingToken)
            for currAdd in otherAdds:
                otherAdd = InvItem(currAdd)
                if otherAdd.getCat() == trainingToken and otherAdd.getCount() > 0:
                    trainingAmt += otherAdd.getCount()
                    continue

            if not weaponReq == None:
                pass
            weaponLevelPass = itemLevel >= weaponReq
            if not trainingToken == 0 and trainingToken == None:
                pass
            weaponTrainPass = trainingAmt > 0
            if weaponLevelPass:
                pass
            results['itemLevel'] = (weaponReq, weaponTrainPass)
        else:
            results['itemLevel'] = (0, True)
        return results
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:41,代碼來源:TradableInventoryBase.py


注:本文中的pirates.piratesbase.Freebooter.getPaidStatusAI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。