本文整理汇总了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)
示例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)
示例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