本文整理汇总了Python中pirates.economy.EconomyGlobals.getCargoTotalValue方法的典型用法代码示例。如果您正苦于以下问题:Python EconomyGlobals.getCargoTotalValue方法的具体用法?Python EconomyGlobals.getCargoTotalValue怎么用?Python EconomyGlobals.getCargoTotalValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.economy.EconomyGlobals
的用法示例。
在下文中一共展示了EconomyGlobals.getCargoTotalValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getMissionResults
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getCargoTotalValue [as 别名]
def getMissionResults(self):
(missionTime, shipDamage, skeletonKills, navyKills, creatureKills, seamonsterKills, pirateKills, townfolkKills, shipKills, repairCost, exp, gold, cargo, numCrew) = self.stats
(pMissionTime, pShipDamage, pSkeletonKills, pNavyKills, pCreatureKills, pSeamonsterKills, pPirateKills, pTownfolkKills, pShipKills, pRepairCost, pExp, pGold, pCargo, pLootBoxes, dummyCrew) = self.playerStats
inventory = base.localAvatar.getInventory()
if inventory:
currentGold = inventory.getGoldInPocket()
t = time.gmtime(missionTime)
totalTime = str(t[3]) + '"' + str(t[4]) + "'" + str(t[5])
self.cargo = cargo
cargoValue = EconomyGlobals.getCargoTotalValue(cargo)
totalGold = max(cargoValue + gold - repairCost, 0)
self.results = []
self.results.append({
'Type': 'Title',
'Text': PLocalizer.PlunderedLootContainers,
'Value1': '' })
if len(pLootBoxes) == 0:
self.results.append({
'Type': 'Entry',
'Text': PLocalizer.NoLootContainersPlundered,
'Value1': '',
'UnwrapMode': 1 })
else:
gold = 0
height = self.plunderHeight
for lootBox in pLootBoxes:
plunderList = lootBox[1]
gridText = self.getLootLabel(lootBox[2])
self.makeLootLabel(gridText, self.plunderHeight)
grid = self.setupPlunderGrid(plunderList, height, lootBox[0])
grid.gridText = gridText
self.manager.addScoreboard(self)
return self.results
示例2: getMissionResults
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getCargoTotalValue [as 别名]
def getMissionResults(self):
(missionTime, shipDamage, skeletonKills, navyKills, creatureKills, seamonsterKills, pirateKills, townfolkKills, shipKills, repairCost, exp, gold, cargo, numCrew) = self.stats
(pMissionTime, pShipDamage, pSkeletonKills, pNavyKills, pCreatureKills, pSeamonsterKills, pPirateKills, pTownfolkKills, pShipKills, pRepairCost, pExp, pGold, pCargo, pLootBoxes, dummyCrew) = self.playerStats
inventory = base.localAvatar.getInventory()
if inventory:
currentGold = inventory.getGoldInPocket()
t = time.gmtime(missionTime)
totalTime = str(t[3]) + '"' + str(t[4]) + "'" + str(t[5])
self.cargo = cargo
cargoValue = EconomyGlobals.getCargoTotalValue(cargo)
totalGold = max(cargoValue + gold - repairCost, 0)
self.results = []
self.results.append({
'Type': 'Title',
'Text': PLocalizer.PlunderedLootContainers,
'Value1': '' })
if len(pLootBoxes) == 0:
self.results.append({
'Type': 'Entry',
'Text': PLocalizer.NoLootContainersPlundered,
'Value1': '',
'UnwrapMode': 1 })
else:
gold = 0
height = 1.6499999999999999
for lootBox in pLootBoxes:
plunderList = lootBox[1]
if lootBox[2] == PiratesGlobals.ITEM_SAC:
self.makeLootLabel(PLocalizer.LootContainerItemSac, height)
elif lootBox[2] == PiratesGlobals.TREASURE_CHEST:
self.makeLootLabel(PLocalizer.LootContainerTreasureChest, height)
elif lootBox[2] == PiratesGlobals.RARE_CHEST:
self.makeLootLabel(PLocalizer.LootContainerRareChest, height)
height -= 0.029999999999999999
ammoAmountIndex = 0
self.setupPlunderGrid(plunderList, height, lootBox[0])
plunderLength = len(plunderList)
while plunderLength > 0:
height -= self.buttonSize
plunderLength -= 2
height -= 0.10000000000000001
self.manager.addScoreboard(self)
return self.results
示例3: getCargoResults
# 需要导入模块: from pirates.economy import EconomyGlobals [as 别名]
# 或者: from pirates.economy.EconomyGlobals import getCargoTotalValue [as 别名]
def getCargoResults(self):
(missionTime, shipDamage, skeletonKills, navyKills, creatureKills, seamonsterKills, pirateKills, townfolkKills, shipKills, repairCost, exp, gold, cargo, numCrew) = self.stats
(pMissionTime, pShipDamage, pSkeletonKills, pNavyKills, pCreatureKills, pSeamonsterKills, pPirateKills, pTownfolkKills, pShipKills, pRepairCost, pExp, pGold, pCargo, pLootBoxes, dummyCrew) = self.playerStats
inventory = base.localAvatar.getInventory()
if inventory:
currentGold = inventory.getGoldInPocket()
avId = base.localAvatar.getDoId()
cargoValue = EconomyGlobals.getCargoTotalValue(pCargo)
totalGold = cargoValue + pGold
bonusGold = 0
if base.localAvatar.ship:
if base.localAvatar.ship.getOwnerId() == avId and len(base.localAvatar.ship.getCrew()) > 1:
bonusGold = int(totalGold * EconomyGlobals.CAPTAIN_LOOT_MULTIPLIER)
totalGold += bonusGold
if base.cr.newsManager:
if base.cr.newsManager.getHoliday(HolidayGlobals.DOUBLEGOLDHOLIDAYPAID) or Freebooter.getPaidStatus(avId) or base.cr.newsManager.getHoliday(HolidayGlobals.DOUBLEGOLDHOLIDAY):
totalGold *= 2
netGold = totalGold - pRepairCost
self.results = []
self.results.append({
'Type': 'Title',
'Text': PLocalizer.CargoPlunder,
'Value1': '' })
if pGold:
self.results.append({
'Type': 'Entry',
'Text': PLocalizer.GoldLooted,
'Value1': pGold,
'Value2': gold })
if len(pCargo) == 0:
self.results.append({
'Type': 'Entry',
'Text': PLocalizer.NoCargoLooted,
'Value1': '',
'UnwrapMode': 1 })
else:
for itemId in pCargo:
self.results.append({
'Type': 'Cargo',
'Text': '',
'Value1': itemId,
'UnwrapMode': 1 })
if bonusGold > 0:
self.results.append({
'Type': 'Space',
'Text': '',
'Value1': '',
'UnwrapMode': 1 })
self.results.append({
'Type': 'Entry',
'Text': PLocalizer.CaptainsBonus,
'Value1': str(bonusGold) + ' ' + PLocalizer.MoneyName,
'UnwrapMode': 1 })
if base.cr.newsManager:
if base.cr.newsManager.getHoliday(HolidayGlobals.DOUBLEGOLDHOLIDAYPAID) or Freebooter.getPaidStatus(avId) or base.cr.newsManager.getHoliday(HolidayGlobals.DOUBLEGOLDHOLIDAY):
self.results.append({
'Type': 'Space',
'Text': '',
'Value1': '',
'UnwrapMode': 1 })
self.results.append({
'Type': 'Entry',
'Text': PLocalizer.DoubleGoldBonus,
'Value1': str(totalGold / 2) + ' ' + PLocalizer.MoneyName,
'UnwrapMode': 1 })
self.results.append({
'Type': 'Space',
'Text': '',
'Value1': '',
'UnwrapMode': 1 })
self.results.append({
'Type': 'Title',
'Text': PLocalizer.PlunderShare,
'Value1': str(netGold) + ' ' + PLocalizer.MoneyName,
'UnwrapMode': 1 })
return self.results