Ticket #3216: t3216_capture_statistics_v10.patch
File t3216_capture_statistics_v10.patch, 21.7 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/summary/counters.js
25 25 } 26 26 27 27 function calculateMilitaryScore(playerState, position) 28 28 { 29 29 return Math.round((playerState.statistics.enemyUnitsKilledValue + 30 playerState.statistics.enemyBuildingsDestroyedValue) / 10); 30 playerState.statistics.enemyBuildingsDestroyedValue + 31 playerState.statistics.buildingsCapturedValue) / 10); 31 32 } 32 33 33 34 function calculateExplorationScore(playerState, position) 34 35 { 35 36 return playerState.statistics.percentMapExplored * 10; … … 62 63 63 64 function calculateBuildings(playerState, position) 64 65 { 65 66 var type = BUILDINGS_TYPES[position]; 66 67 return TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' + 67 LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' + 68 KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]'; 68 KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]\n' + 69 CAPTURED_COLOR + playerState.statistics.buildingsCaptured[type] + '[/color] / ' + 70 LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color]\n'; 69 71 } 70 72 71 function calculate ColorsTeam(counters)73 function calculateBuildingsTeam(counters) 72 74 { 73 for ( vart in g_Teams)75 for (let t in g_Teams) 74 76 { 75 77 if (t == -1) 76 78 continue; 77 79 78 for (var w in counters) 80 for (let w in counters) 81 { 82 let total = { 83 constructed : 0, 84 destroyed : 0, 85 captured : 0, 86 lost : 0 87 }; 88 for (let p = 0; p < g_Teams[t]; ++p) 89 { 90 let caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption; 91 // clean [Color=""], [/Color] and white space for make the sum more easy 92 caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|[\t\r \f]/g, ""); 93 94 let splitCaption = caption.split("\n"); 95 let first = splitCaption[0].split("/"); 96 let second = splitCaption[1].split("/"); 97 98 total.constructed += (+first[0]); 99 total.destroyed += (+first[1]); 100 total.captured += (+second[0]); 101 total.lost += (+second[1]); 102 } 103 let teamTotal = TRAINED_COLOR + total.constructed + '[/color] / ' + 104 KILLED_COLOR + total.destroyed + '[/color]\n' + 105 CAPTURED_COLOR + total.captured + '[/color] / ' + 106 LOST_COLOR + total.lost + '[/color]\n'; 107 108 Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal; 109 } 110 } 111 } 112 113 function calculateUnitsTeam(counters) 114 { 115 for (let t in g_Teams) 79 116 { 80 var total = { 117 if (t == -1) 118 continue; 119 120 for (let w in counters) 121 { 122 let total = { 81 123 c : 0, 82 124 l : 0, 83 125 d : 0 84 126 }; 85 for ( varp = 0; p < g_Teams[t]; ++p)127 for (let p = 0; p < g_Teams[t]; ++p) 86 128 { 87 varcaption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption;129 let caption = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]").caption; 88 130 // clean [Color=""], [/Color] and white space for make the sum more easy 89 131 caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s/g, ""); 90 132 91 varsplitCaption = caption.split("/");133 let splitCaption = caption.split("/"); 92 134 93 135 total.c += (+splitCaption[0]); 94 136 total.l += (+splitCaption[1]); 95 137 total.d += (+splitCaption[2]); 96 138 } 97 varteamTotal = TRAINED_COLOR + total.c + '[/color] / ' +139 let teamTotal = TRAINED_COLOR + total.c + '[/color] / ' + 98 140 LOST_COLOR + total.l + '[/color] / ' + KILLED_COLOR + total.d + '[/color]'; 99 141 100 142 Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal; 101 143 } 102 144 } -
binaries/data/mods/public/gui/summary/layout.js
7 7 { "caption": translate("Exploration score"), "yStart": 16, "width": 100 }, 8 8 { "caption": translate("Total score"), "yStart": 16, "width": 100 } 9 9 ], 10 10 "titleHeadings": [], 11 11 "counters": [ // counters on score panel 12 { "width": 100, "fn": calculateEconomyScore },13 { "width": 100, "fn": calculateMilitaryScore },14 { "width": 100, "fn": calculateExplorationScore },15 { "width": 100, "fn": calculateScoreTotal }12 { "width": 100, "fn": calculateEconomyScore, "verticalOffset": 12 }, 13 { "width": 100, "fn": calculateMilitaryScore, "verticalOffset": 12 }, 14 { "width": 100, "fn": calculateExplorationScore, "verticalOffset": 12 }, 15 { "width": 100, "fn": calculateScoreTotal, "verticalOffset": 12 } 16 16 ], 17 17 "teamCounterFn": calculateScoreTeam 18 18 }, 19 19 { // buildings panel 20 20 "headings": [ // headings on buildings panel … … 27 27 { "caption": translate("Fortresses"), "yStart": 34, "width": 85 }, 28 28 { "caption": translate("Civ centers"), "yStart": 34, "width": 85 }, 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 = 735 32 { 33 "caption": sprintf(translate("Buildings Statistics (%(constructed)s / %(destroyed)s / %(captured)s / %(lost)s)"), 34 { 35 constructed: '[color="201 255 200"]' + translate("Constructed") + '[/color]', 36 destroyed: '[color="196 198 255"]' + translate("Destroyed") + '[/color]', 37 captured: '[color="255 255 157"]' + translate("Captured") + '[/color]', 38 lost: '[color="255 213 213"]' + translate("Lost") + '[/color]' 39 }), 40 "yStart": 16, 41 "width": (85 * 7 + 105) 42 }, // width = 735 33 43 ], 34 44 "counters": [ // counters on buildings panel 35 {"width": 105, "fn": calculateBuildings },36 {"width": 85, "fn": calculateBuildings },37 {"width": 85, "fn": calculateBuildings },38 {"width": 85, "fn": calculateBuildings },39 {"width": 85, "fn": calculateBuildings },40 {"width": 85, "fn": calculateBuildings },41 {"width": 85, "fn": calculateBuildings },42 {"width": 85, "fn": calculateBuildings }45 {"width": 105, "fn": calculateBuildings, "verticalOffset": 3}, 46 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3}, 47 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3}, 48 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3}, 49 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3}, 50 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3}, 51 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3}, 52 {"width": 85, "fn": calculateBuildings, "verticalOffset": 3} 43 53 ], 44 "teamCounterFn": calculate ColorsTeam54 "teamCounterFn": calculateBuildingsTeam 45 55 }, 46 56 { // units panel 47 57 "headings": [ // headings on units panel 48 58 { "caption": translate("Player name"), "yStart": 26, "width": 200 }, 49 59 { "caption": translate("Total"), "yStart": 34, "width": 120 }, … … 53 63 { "caption": translate("Champion"), "yStart": 34, "width": 100 }, 54 64 { "caption": translate("Heroes"), "yStart": 34, "width": 100 }, 55 65 { "caption": translate("Navy"), "yStart": 34, "width": 100 } 56 66 ], 57 67 "titleHeadings": [ 58 { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 6 + 120) }, // width = 720 68 { 69 "caption": sprintf(translate("Units Statistics (%(trained)s / %(lost)s / %(killed)s)"), 70 { 71 trained: '[color="201 255 200"]' + translate("Trained") + '[/color]', 72 lost: '[color="255 213 213"]' + translate("Lost") + '[/color]', 73 killed: '[color="196 198 255"]' + translate("Killed") + '[/color]' 74 }), 75 "yStart": 16, 76 "width": (100 * 6 + 120) 77 }, // width = 720 59 78 ], 60 79 "counters": [ // counters on units panel 61 {"width": 120, "fn": calculateUnits },62 {"width": 100, "fn": calculateUnits },63 {"width": 100, "fn": calculateUnits },64 {"width": 100, "fn": calculateUnits },65 {"width": 100, "fn": calculateUnits },66 {"width": 100, "fn": calculateUnits },67 {"width": 100, "fn": calculateUnits }80 {"width": 120, "fn": calculateUnits, "verticalOffset": 12}, 81 {"width": 100, "fn": calculateUnits, "verticalOffset": 12}, 82 {"width": 100, "fn": calculateUnits, "verticalOffset": 12}, 83 {"width": 100, "fn": calculateUnits, "verticalOffset": 12}, 84 {"width": 100, "fn": calculateUnits, "verticalOffset": 12}, 85 {"width": 100, "fn": calculateUnits, "verticalOffset": 12}, 86 {"width": 100, "fn": calculateUnits, "verticalOffset": 12} 68 87 ], 69 "teamCounterFn": calculate ColorsTeam88 "teamCounterFn": calculateUnitsTeam 70 89 }, 71 90 { // resources panel 72 91 "headings": [ // headings on resources panel 73 92 { "caption": translate("Player name"), "yStart": 26, "width": 200 }, 74 93 { "caption": translate("Food"), "yStart": 34, "width": 100 }, 75 94 { "caption": translate("Wood"), "yStart": 34, "width": 100 }, 76 95 { "caption": translate("Stone"), "yStart": 34, "width": 100 }, 77 96 { "caption": translate("Metal"), "yStart": 34, "width": 100 }, 78 97 { "caption": translate("Total"), "yStart": 34, "width": 110 }, 79 98 { "caption": translate("Treasures collected"), "yStart": 16, "width": 100 }, 80 { "caption": translate("Tributes (Sent / Received)"), "yStart": 16, "width": 121 } 99 { 100 "caption": sprintf(translate("Tributes (%(sent)s / %(received)s)"), 101 { 102 sent: '[color="201 255 200"]' + translate("Sent") + '[/color]', 103 received: '[color="255 213 213"]' + translate("Received") + '[/color]' 104 }), 105 "yStart": 16, 106 "width": 121 107 } 81 108 ], 82 109 "titleHeadings": [ 83 { "caption": translate("Resource Statistics (Gathered / Used)"), "yStart": 16, "width": (100 * 4 + 110) }, // width = 510 110 { 111 "caption": sprintf(translate("Resource Statistics (%(gathered)s / %(used)s)"), 112 { 113 gathered: '[color="201 255 200"]' + translate("Gathered") + '[/color]', 114 used: '[color="255 213 213"]' + translate("Used") + '[/color]' 115 }), 116 "yStart": 16, 117 "width": (100 * 4 + 110) 118 }, // width = 510 84 119 ], 85 120 "counters": [ // counters on resources panel 86 {"width": 100, "fn": calculateResources },87 {"width": 100, "fn": calculateResources },88 {"width": 100, "fn": calculateResources },89 {"width": 100, "fn": calculateResources },90 {"width": 110, "fn": calculateTotalResources },91 {"width": 100, "fn": calculateTreasureCollected },92 {"width": 121, "fn": calculateTributeSent }121 {"width": 100, "fn": calculateResources, "verticalOffset": 12}, 122 {"width": 100, "fn": calculateResources, "verticalOffset": 12}, 123 {"width": 100, "fn": calculateResources, "verticalOffset": 12}, 124 {"width": 100, "fn": calculateResources, "verticalOffset": 12}, 125 {"width": 110, "fn": calculateTotalResources, "verticalOffset": 12}, 126 {"width": 100, "fn": calculateTreasureCollected, "verticalOffset": 12}, 127 {"width": 121, "fn": calculateTributeSent, "verticalOffset": 12} 93 128 ], 94 129 "teamCounterFn": calculateResourcesTeam 95 130 }, 96 131 { // market panel 97 132 "headings": [ // headings on market panel … … 103 138 { "caption": translate("Barter efficiency"), "yStart": 16, "width": 100 }, 104 139 { "caption": translate("Trade income"), "yStart": 16, "width": 100 } 105 140 ], 106 141 "titleHeadings": [], 107 142 "counters": [ // counters on market panel 108 {"width": 100, "fn": calculateResourceExchanged },109 {"width": 100, "fn": calculateResourceExchanged },110 {"width": 100, "fn": calculateResourceExchanged },111 {"width": 100, "fn": calculateResourceExchanged },112 {"width": 100, "fn": calculateBatteryEfficiency },113 {"width": 100, "fn": calculateTradeIncome }143 {"width": 100, "fn": calculateResourceExchanged, "verticalOffset": 12}, 144 {"width": 100, "fn": calculateResourceExchanged, "verticalOffset": 12}, 145 {"width": 100, "fn": calculateResourceExchanged, "verticalOffset": 12}, 146 {"width": 100, "fn": calculateResourceExchanged, "verticalOffset": 12}, 147 {"width": 100, "fn": calculateBatteryEfficiency, "verticalOffset": 12}, 148 {"width": 100, "fn": calculateTradeIncome, "verticalOffset": 12} 114 149 ], 115 150 "teamCounterFn": calculateMarketTeam 116 151 }, 117 152 { // miscellaneous panel 118 153 "headings": [ // headings on miscellaneous panel … … 122 157 { "caption": translate("Kill / Death\nratio"), "yStart": 16, "width": 100 }, 123 158 { "caption": translate("Map\nexploration"), "yStart": 16, "width": 100 } 124 159 ], 125 160 "titleHeadings": [], 126 161 "counters": [ // counters on miscellaneous panel 127 {"width": 100, "fn": calculateVegetarianRatio },128 {"width": 100, "fn": calculateFeminisation },129 {"width": 100, "fn": calculateKillDeathRatio },130 {"width": 100, "fn": calculateMapExploration }162 {"width": 100, "fn": calculateVegetarianRatio, "verticalOffset": 12}, 163 {"width": 100, "fn": calculateFeminisation, "verticalOffset": 12}, 164 {"width": 100, "fn": calculateKillDeathRatio, "verticalOffset": 12}, 165 {"width": 100, "fn": calculateMapExploration, "verticalOffset": 12} 131 166 ], 132 167 "teamCounterFn": calculateMiscellaneous 133 168 } 134 169 ]; 135 170 … … 187 222 188 223 function updateGeneralPanelCounter(counters) 189 224 { 190 225 var rowPlayerObjectWidth = 0; 191 226 var left = 0; 227 192 228 for (var p = 0; p < MAX_SLOTS; ++p) 193 229 { 194 230 left = 240; 195 231 var counterObject; 196 232 for (var w in counters) 197 233 { 198 234 counterObject = Engine.GetGUIObjectByName("valueData[" + p + "][" + w + "]"); 199 counterObject.size = left + " 6" + (left + counters[w].width) + " 100%";235 counterObject.size = left + " " + counters[w].verticalOffset + " " + (left + counters[w].width) + " 100%"; 200 236 counterObject.hidden = false; 201 237 left += counters[w].width; 202 238 } 203 239 if (rowPlayerObjectWidth == 0) 204 240 rowPlayerObjectWidth = left; … … 208 244 { 209 245 left = 240; 210 246 for (var w in counters) 211 247 { 212 248 counterObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]"); 213 counterObject.size = left + " 6" + (left + counters[w].width) + " 100%";249 counterObject.size = left + " " + counters[w].verticalOffset + " " + (left + counters[w].width) + " 100%"; 214 250 counterObject.hidden = false; 215 251 216 252 if (g_Teams[t]) 217 253 { 218 var yStart = 30 + g_Teams[t] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 2;254 let yStart = 25 + g_Teams[t] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 3 + counters[w].verticalOffset; 219 255 counterTotalObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]"); 220 256 counterTotalObject.size = (left + 20) + " " + yStart + " " + (left + counters[w].width) + " 100%"; 221 257 counterTotalObject.hidden = false; 222 258 } 223 259 … … 250 286 251 287 yStart += 30 + g_Teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 32; 252 288 253 289 Engine.GetGUIObjectByName("teamNameHeadingt["+i+"]").caption = "Team "+(i+1); 254 290 255 varteamHeading = Engine.GetGUIObjectByName("teamHeadingt["+i+"]");256 var yStartTotal = 30 + g_Teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 2;257 teamHeading.size = "50 " +yStartTotal+" 100% "+(yStartTotal+20);291 let teamHeading = Engine.GetGUIObjectByName("teamHeadingt["+i+"]"); 292 let yStartTotal = 30 + g_Teams[i] * (PLAYER_BOX_Y_SIZE + PLAYER_BOX_GAP) + 10; 293 teamHeading.size = "50 " + yStartTotal + " 100% " + (yStartTotal + 20); 258 294 teamHeading.caption = translate("Team total"); 259 295 } 260 296 // If there are no players without team, hide "player name" heading 261 297 if (!g_WithoutTeam) 262 298 Engine.GetGUIObjectByName("playerNameHeading").caption = ""; -
binaries/data/mods/public/gui/summary/summary.js
4 4 const MAX_HEADINGTITLE = 8; 5 5 6 6 // const for filtering long collective headings 7 7 const LONG_HEADING_WIDTH = 250; 8 8 // Vertical size of player box 9 const PLAYER_BOX_Y_SIZE = 30;9 const PLAYER_BOX_Y_SIZE = 40; 10 10 // Gap between players boxes 11 11 const PLAYER_BOX_GAP = 2; 12 12 // Alpha for player box 13 13 const PLAYER_BOX_ALPHA = " 32"; 14 14 // Alpha for player color box 15 15 const PLAYER_COLOR_BOX_ALPHA = " 255"; 16 16 // yStart value for spacing teams boxes (and noTeamsBox) 17 const TEAMS_BOX_Y_START = 65;17 const TEAMS_BOX_Y_START = 40; 18 18 // Colors used for units and buildings 19 19 const TRAINED_COLOR = '[color="201 255 200"]'; 20 20 const LOST_COLOR = '[color="255 213 213"]'; 21 21 const KILLED_COLOR = '[color="196 198 255"]'; 22 const CAPTURED_COLOR = '[color="255 255 157"]'; 22 23 23 24 const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ]; 24 25 const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ]; 25 26 const RESOURCES_TYPES = [ "food", "wood", "stone", "metal" ]; 26 27 -
binaries/data/mods/public/gui/summary/summary.xml
117 117 <object type="image" name="teamBoxt[i]" size="0 65 100% 100%-50" hidden="true"> 118 118 <object type="text" name="teamNameHeadingt[i]" size="15 5 100% 100%" style="ModernLeftTabLabelText"/> 119 119 <object size="0 30 100% 100%"> 120 120 <repeat count="8" var="n"> 121 121 <object type="image" name="playerBoxt[i][n]" size="10 0 10 30" hidden="true"> 122 <object name="playerColorBoxt[i][n]" type="image" size="10 4 30 24"/> 122 <object type="image" sprite="ForegroundBox" size="10 9 34 33"> 123 <object name="playerColorBoxt[i][n]" type="image" size="2 2 22 22"/> 124 </object> 123 125 <object name="playerNamet[i][n]" type="text" size="40 2 208 100%" style="ModernLeftLabelText" /> 124 <object name="civIcont[i][n]" type="image" size="208 0 240 32"/>126 <object name="civIcont[i][n]" type="image" size="208 5 240 37" tooltip_style="sessionToolTip"/> 125 127 <repeat var="x" count="8"> 126 128 <object name="valueDataTeam[i][n][x]" type="text" style="ModernTabLabelText"> 127 129 </object> 128 130 </repeat> 129 131 </object> … … 138 140 </repeat> 139 141 140 142 <object type="image" name="noTeamsBox" size="0 65 100% 100%-50" hidden="true"> 141 143 <repeat count="8"> 142 144 <object type="image" name="playerBox[n]" size="10 0 10 30" hidden="true"> 143 <object type="image" sprite="ForegroundBox" size="10 4 34 28">145 <object type="image" sprite="ForegroundBox" size="10 9 34 33"> 144 146 <object name="playerColorBox[n]" type="image" size="2 2 22 22"/> 145 147 </object> 146 148 <object name="playerName[n]" type="text" size="40 2 208 100%" style="ModernLeftLabelText"/> 147 <object name="civIcon[n]" type="image" size="208 0 240 32"/>149 <object name="civIcon[n]" type="image" size="208 5 240 37"/> 148 150 <repeat var="x" count="8"> 149 151 <object name="valueData[n][x]" type="text" style="ModernTabLabelText"> 150 152 </object> 151 153 </repeat> 152 154 </object> -
binaries/data/mods/public/simulation/components/Capturable.js
149 149 var bestPlayer = 0; 150 150 for (let i in this.cp) 151 151 if (this.cp[i] >= this.cp[bestPlayer]) 152 152 bestPlayer = +i; 153 153 154 let cmpLostPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 155 if (cmpLostPlayerStatisticsTracker) 156 cmpLostPlayerStatisticsTracker.LostEntity(this.entity); 157 154 158 cmpOwnership.SetOwner(bestPlayer); 159 160 let cmpCapturedPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 161 if (cmpCapturedPlayerStatisticsTracker) 162 cmpCapturedPlayerStatisticsTracker.CapturedBuilding(this.entity); 155 163 }; 156 164 157 165 Capturable.prototype.GetRegenRate = function() 158 166 { 159 167 var regenRate = +this.template.RegenRate; -
binaries/data/mods/public/simulation/components/StatisticsTracker.js
87 87 "CivCentre": 0, 88 88 "Wonder": 0, 89 89 "total": 0 90 90 }; 91 91 this.enemyBuildingsDestroyedValue = 0; 92 this.buildingsCaptured = { 93 "House": 0, 94 "Economic": 0, 95 "Outpost": 0, 96 "Military": 0, 97 "Fortress": 0, 98 "CivCentre": 0, 99 "Wonder": 0, 100 "total": 0 101 }; 102 this.buildingsCapturedValue = 0; 92 103 // resources 93 104 this.resourcesGathered = { 94 105 "food": 0, 95 106 "wood": 0, 96 107 "metal": 0, … … 148 159 "buildingsConstructed": this.buildingsConstructed, 149 160 "buildingsLost": this.buildingsLost, 150 161 "buildingsLostValue": this.buildingsLostValue, 151 162 "enemyBuildingsDestroyed": this.enemyBuildingsDestroyed, 152 163 "enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue, 164 "buildingsCaptured": this.buildingsCaptured, 165 "buildingsCapturedValue": this.buildingsCapturedValue, 153 166 "resourcesGathered": this.resourcesGathered, 154 167 "resourcesUsed": this.resourcesUsed, 155 168 "resourcesSold": this.resourcesSold, 156 169 "resourcesBought": this.resourcesBought, 157 170 "tributesSent": this.tributesSent, … … 292 305 for each (var cost in costs) 293 306 this.buildingsLostValue += cost; 294 307 } 295 308 }; 296 309 310 StatisticsTracker.prototype.CapturedBuilding = function(capturedBuilding) 311 { 312 let cmpCapturedBuildingIdentity = Engine.QueryInterface(capturedBuilding, IID_Identity); 313 let cmpCost = Engine.QueryInterface(capturedBuilding, IID_Cost); 314 let costs = cmpCost.GetResourceCosts(); 315 316 for (let type of this.buildingsClasses) 317 this.CounterIncrement(cmpCapturedBuildingIdentity, "buildingsCaptured", type); 318 319 this.buildingsCaptured.total++; 320 321 for (let i in costs) 322 this.buildingsCapturedValue += costs[i]; 323 }; 324 297 325 /** 298 326 * @param type Generic type of resource (string) 299 327 * @param amount Amount of resource, whick should be added (integer) 300 328 * @param specificType Specific type of resource (string, optional) 301 329 */