Ticket #3311: ticket3311_2.diff
File ticket3311_2.diff, 11.8 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/session/session.js
912 912 "Cavalry", 913 913 "Champion", 914 914 "Hero", 915 "Ship" 915 "Ship", 916 "Trader" 916 917 ]; 917 918 var unitsCountersTypes = [ 918 919 "unitsTrained", … … 993 994 playerStatistics.totalScore = ""; 994 995 // Various 995 996 playerStatistics.treasuresCollected = ""; 997 playerStatistics.lootCollected = ""; 996 998 playerStatistics.feminisation = ""; 997 999 playerStatistics.percentMapExplored = ""; 998 1000 var mapName = Engine.GetMapSettings().Name; … … 1036 1038 playerStatistics.tributesReceived += player.statistics.tributesReceived + ","; 1037 1039 playerStatistics.percentMapExplored += player.statistics.percentMapExplored + ","; 1038 1040 playerStatistics.treasuresCollected += player.statistics.treasuresCollected + ","; 1041 playerStatistics.lootCollected += player.statistics.lootCollected + ","; 1039 1042 } 1040 1043 1041 1044 // Send the report with serialized data … … 1077 1080 reportObject.tributesReceived = playerStatistics.tributesReceived; 1078 1081 reportObject.percentMapExplored = playerStatistics.percentMapExplored; 1079 1082 reportObject.treasuresCollected = playerStatistics.treasuresCollected; 1083 reportObject.lootCollected = playerStatistics.lootCollected; 1080 1084 reportObject.tradeIncome = playerStatistics.tradeIncome; 1081 1085 1082 1086 Engine.SendGameReport(reportObject); -
binaries/data/mods/public/gui/summary/counters.js
136 136 return playerState.statistics.treasuresCollected; 137 137 } 138 138 139 function calculateLootCollected(playerState, position) 140 { 141 return playerState.statistics.lootCollected; 142 } 143 139 144 function calculateTributeSent(playerState, position) 140 145 { 141 146 return INCOME_COLOR + playerState.statistics.tributesSent + "[/color] / " + OUTCOME_COLOR + playerState.statistics.tributesReceived + "[/color]"; -
binaries/data/mods/public/gui/summary/layout.js
29 29 { "caption": translate("Wonders"), "yStart": 34, "width": 85 } 30 30 ], 31 31 "titleHeadings": [ 32 { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed)"), "yStart": 16, "width": (85 * 7 + 105) }, // width = 7 3532 { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed)"), "yStart": 16, "width": (85 * 7 + 105) }, // width = 700 33 33 ], 34 34 "counters": [ // counters on buildings panel 35 35 {"width": 105, "fn": calculateBuildings}, … … 52 52 { "caption": translate("Cavalry"), "yStart": 34, "width": 100 }, 53 53 { "caption": translate("Champion"), "yStart": 34, "width": 100 }, 54 54 { "caption": translate("Heroes"), "yStart": 34, "width": 100 }, 55 { "caption": translate("Navy"), "yStart": 34, "width": 100 } 55 { "caption": translate("Navy"), "yStart": 34, "width": 100 }, 56 { "caption": translate("Traders"), "yStart": 34, "width": 100 } 56 57 ], 57 58 "titleHeadings": [ 58 { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 6 + 120) }, // width = 72059 { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 7 + 120) }, // width = 820 59 60 ], 60 61 "counters": [ // counters on units panel 61 62 {"width": 120, "fn": calculateUnits}, … … 64 65 {"width": 100, "fn": calculateUnits}, 65 66 {"width": 100, "fn": calculateUnits}, 66 67 {"width": 100, "fn": calculateUnits}, 68 {"width": 100, "fn": calculateUnits}, 67 69 {"width": 100, "fn": calculateUnits} 68 70 ], 69 71 "teamCounterFn": calculateColorsTeam … … 77 79 { "caption": translate("Metal"), "yStart": 34, "width": 100 }, 78 80 { "caption": translate("Total"), "yStart": 34, "width": 110 }, 79 81 { "caption": translate("Treasures collected"), "yStart": 16, "width": 100 }, 80 { "caption": translate("Tributes (Sent / Received)"), "yStart": 16, "width": 121 } 82 { "caption": translate("Tributes (Sent / Received)"), "yStart": 16, "width": 121 }, 83 { "caption": translate("Loot"), "yStart": 16, "width": 100 } 81 84 ], 82 85 "titleHeadings": [ 83 86 { "caption": translate("Resource Statistics (Gathered / Used)"), "yStart": 16, "width": (100 * 4 + 110) }, // width = 510 … … 88 91 {"width": 100, "fn": calculateResources}, 89 92 {"width": 100, "fn": calculateResources}, 90 93 {"width": 110, "fn": calculateTotalResources}, 91 {"width": 100, "fn": calculateTreasureCollected}, 92 {"width": 121, "fn": calculateTributeSent} 94 {"width": 100, "fn": calculateTreasureCollected}, 95 {"width": 121, "fn": calculateTributeSent}, 96 {"width": 100, "fn": calculateLootCollected} 93 97 ], 94 98 "teamCounterFn": calculateResourcesTeam 95 99 }, … … 118 122 "headings": [ // headings on miscellaneous panel 119 123 { "caption": translate("Player name"), "yStart": 26, "width": 200 }, 120 124 { "caption": translate("Vegetarian\nratio"), "yStart": 16, "width": 100 }, 121 { "caption": translate("Feminisation"), "yStart": 26, "width": 100 },125 { "caption": translate("Feminisation"), "yStart": 16, "width": 100 }, 122 126 { "caption": translate("Kill / Death\nratio"), "yStart": 16, "width": 100 }, 123 127 { "caption": translate("Map\nexploration"), "yStart": 16, "width": 100 } 124 128 ], -
binaries/data/mods/public/gui/summary/summary.js
21 21 const KILLED_COLOR = '[color="196 198 255"]'; 22 22 23 23 const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ]; 24 const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ];24 const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship", "Trader" ]; 25 25 const RESOURCES_TYPES = [ "food", "wood", "stone", "metal" ]; 26 26 27 27 // Colors used for gathered and traded resources -
binaries/data/mods/public/simulation/components/Looter.js
27 27 } 28 28 cmpPlayer.AddResources(resources); 29 29 30 let cmpStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 31 if (cmpStatisticsTracker) 32 cmpStatisticsTracker.IncreaseLootCollectedCounter(resources); 33 30 34 // If target entity has trader component, add carried goods to loot too 31 35 var cmpTrader = Engine.QueryInterface(targetEntity, IID_Trader); 32 36 if (cmpTrader) … … 42 46 if (carriedGoods.amount.market2Gain) 43 47 resourcesToAdd[carriedGoods.type] += carriedGoods.amount.market2Gain; 44 48 cmpPlayer.AddResources(resourcesToAdd); 49 50 let cmpStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 51 if (cmpStatisticsTracker) 52 cmpStatisticsTracker.IncreaseLootCollectedCounter(resourcesToAdd); 45 53 } 46 54 } 47 55 } -
binaries/data/mods/public/simulation/components/StatisticsTracker.js
13 13 "Cavalry", 14 14 "Champion", 15 15 "Hero", 16 "Ship" 16 "Ship", 17 "Trader" 17 18 ]; 18 19 this.unitsTrained = { 19 20 "Infantry": 0, … … 23 24 "Champion": 0, 24 25 "Hero": 0, 25 26 "Ship": 0, 27 "Trader": 0, 26 28 "total": 0 27 29 }; 28 30 this.unitsLost = { … … 33 35 "Champion": 0, 34 36 "Hero": 0, 35 37 "Ship": 0, 38 "Trader": 0, 36 39 "total": 0 37 40 }; 38 41 this.unitsLostValue = 0; … … 44 47 "Champion": 0, 45 48 "Hero": 0, 46 49 "Ship": 0, 50 "Trader": 0, 47 51 "total": 0 48 52 }; 49 53 this.enemyUnitsKilledValue = 0; … … 119 123 this.tributesReceived = 0; 120 124 this.tradeIncome = 0; 121 125 this.treasuresCollected = 0; 126 this.lootCollected = 0; 122 127 }; 123 128 124 129 /** … … 158 163 "tributesReceived": this.tributesReceived, 159 164 "tradeIncome": this.tradeIncome, 160 165 "treasuresCollected": this.treasuresCollected, 166 "lootCollected": this.lootCollected, 161 167 "percentMapExplored": this.GetPercentMapExplored(), 162 168 "teamPercentMapExplored": this.GetTeamPercentMapExplored() 163 169 }; … … 309 315 310 316 /** 311 317 * @param type Generic type of resource (string) 312 * @param amount Amount of resource, whic kshould be added (integer)318 * @param amount Amount of resource, which should be added (integer) 313 319 */ 314 320 StatisticsTracker.prototype.IncreaseResourceUsedCounter = function(type, amount) 315 321 { … … 321 327 this.treasuresCollected++; 322 328 }; 323 329 330 StatisticsTracker.prototype.IncreaseLootCollectedCounter = function(amount) 331 { 332 for (let type in amount) 333 this.lootCollected += amount[type]; 334 }; 324 335 StatisticsTracker.prototype.IncreaseResourcesSoldCounter = function(type, amount) 325 336 { 326 337 this.resourcesSold[type] += amount; -
source/tools/XpartaMuPP/LobbyRanking.py
61 61 metalUsed = Column(Integer) 62 62 vegetarianFoodGathered = Column(Integer) 63 63 treasuresCollected = Column(Integer) 64 lootCollected = Column(Integer) 64 65 tributesSent = Column(Integer) 65 66 tributesReceived = Column(Integer) 66 67 totalUnitsTrained = Column(Integer) … … 87 88 shipUnitsTrained = Column(Integer) 88 89 shipUnitsLost = Column(Integer) 89 90 enemyShipUnitsKilled = Column(Integer) 91 traderUnitsTrained = Column(Integer) 92 traderUnitsLost = Column(Integer) 93 enemyTraderUnitsKilled = Column(Integer) 90 94 totalBuildingsConstructed = Column(Integer) 91 95 totalBuildingsLost = Column(Integer) 92 96 enemytotalBuildingsDestroyed = Column(Integer) -
source/tools/XpartaMuPP/XpartaMuPP.py
122 122 totalScoreStats = {'economyScore', 'militaryScore', 'totalScore'} 123 123 resourceStats = {'foodGathered', 'foodUsed', 'woodGathered', 'woodUsed', 124 124 'stoneGathered', 'stoneUsed', 'metalGathered', 'metalUsed', 'vegetarianFoodGathered', 125 'treasuresCollected', ' tributesSent', 'tributesReceived'}125 'treasuresCollected', 'lootCollected', 'tributesSent', 'tributesReceived'} 126 126 unitsStats = {'totalUnitsTrained', 'totalUnitsLost', 'enemytotalUnitsKilled', 'infantryUnitsTrained', 127 127 'infantryUnitsLost', 'enemyInfantryUnitsKilled', 'workerUnitsTrained', 'workerUnitsLost', 128 128 'enemyWorkerUnitsKilled', 'femaleUnitsTrained', 'femaleUnitsLost', 'enemyFemaleUnitsKilled', 129 129 'cavalryUnitsTrained', 'cavalryUnitsLost', 'enemyCavalryUnitsKilled', 'championUnitsTrained', 130 130 'championUnitsLost', 'enemyChampionUnitsKilled', 'heroUnitsTrained', 'heroUnitsLost', 131 'enemyHeroUnitsKilled', 'shipUnitsTrained', 'shipUnitsLost', 'enemyShipUnitsKilled'} 131 'enemyHeroUnitsKilled', 'shipUnitsTrained', 'shipUnitsLost', 'enemyShipUnitsKilled', 'traderUnitsTrained', 132 'traderUnitsLost', 'enemyTraderUnitsKilled'} 132 133 buildingsStats = {'totalBuildingsConstructed', 'totalBuildingsLost', 'enemytotalBuildingsDestroyed', 133 134 'civCentreBuildingsConstructed', 'civCentreBuildingsLost', 'enemyCivCentreBuildingsDestroyed', 134 135 'houseBuildingsConstructed', 'houseBuildingsLost', 'enemyHouseBuildingsDestroyed',