Ticket #3216: 3216.4.patch
File 3216.4.patch, 7.4 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/summary/counters.js
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) … … 65 66 var type = BUILDINGS_TYPES[position]; 66 67 return TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' + 67 68 LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' + 68 KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]'; 69 KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color] / ' + 70 CAPTURED_COLOR + playerState.statistics.buildingsCaptured[type] + '[/color]'; 69 71 } 70 72 71 73 function calculateColorsTeam(counters) -
binaries/data/mods/public/gui/summary/layout.js
19 19 { // buildings panel 20 20 "headings": [ // headings on buildings panel 21 21 { "caption": translate("Player name"), "yStart": 26, "width": 200 }, 22 { "caption": translate("Total"), "yStart": 34, "width": 10 5},23 { "caption": translate("Houses"), "yStart": 34, "width": 85},24 { "caption": translate("Economic"), "yStart": 34, "width": 85},25 { "caption": translate("Outposts"), "yStart": 34, "width": 85},26 { "caption": translate("Military"), "yStart": 34, "width": 85},27 { "caption": translate("Fortresses"), "yStart": 34, "width": 85},28 { "caption": translate("Civ centers"), "yStart": 34, "width": 85},29 { "caption": translate("Wonders"), "yStart": 34, "width": 85}22 { "caption": translate("Total"), "yStart": 34, "width": 100 }, 23 { "caption": translate("Houses"), "yStart": 34, "width": 90 }, 24 { "caption": translate("Economic"), "yStart": 34, "width": 90 }, 25 { "caption": translate("Outposts"), "yStart": 34, "width": 90 }, 26 { "caption": translate("Military"), "yStart": 34, "width": 90 }, 27 { "caption": translate("Fortresses"), "yStart": 34, "width": 90 }, 28 { "caption": translate("Civ centers"), "yStart": 34, "width": 90 }, 29 { "caption": translate("Wonders"), "yStart": 34, "width": 90 } 30 30 ], 31 31 "titleHeadings": [ 32 { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed )"), "yStart": 16, "width": (85 * 7 + 105) }, // width = 73532 { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed / Captured)"), "yStart": 16, "width": (90 * 7 + 100) }, // width = 735 33 33 ], 34 34 "counters": [ // counters on buildings panel 35 {"width": 10 5, "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}35 {"width": 100, "fn": calculateBuildings}, 36 {"width": 90, "fn": calculateBuildings}, 37 {"width": 90, "fn": calculateBuildings}, 38 {"width": 90, "fn": calculateBuildings}, 39 {"width": 90, "fn": calculateBuildings}, 40 {"width": 90, "fn": calculateBuildings}, 41 {"width": 90, "fn": calculateBuildings}, 42 {"width": 90, "fn": calculateBuildings} 43 43 ], 44 44 "teamCounterFn": calculateColorsTeam 45 45 }, -
binaries/data/mods/public/gui/summary/summary.js
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" ]; -
binaries/data/mods/public/simulation/components/Capturable.js
103 103 for (let i in this.cp) 104 104 if (this.cp[i] >= this.cp[bestPlayer]) 105 105 bestPlayer = +i; 106 106 107 var cmpLostPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 108 if (cmpLostPlayerStatisticsTracker) 109 cmpLostPlayerStatisticsTracker.LostEntity(this.entity); 110 107 111 cmpOwnership.SetOwner(bestPlayer); 112 113 var cmpCapturedPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 114 if (cmpCapturedPlayerStatisticsTracker) 115 cmpCapturedPlayerStatisticsTracker.CapturedBuilding(this.entity); 108 116 109 117 return takenCp; 110 118 }; -
binaries/data/mods/public/simulation/components/StatisticsTracker.js
76 76 "CivCentre": 0, 77 77 "Wonder": 0, 78 78 "total": 0 79 79 }; 80 80 this.buildingsLostValue = 0; 81 81 this.enemyBuildingsDestroyed = { 82 82 "House": 0, … … 87 87 "CivCentre": 0, 88 88 "Wonder": 0, 89 89 "total": 0 90 }; 91 this.enemyBuildingsDestroyedValue = 0; 90 }; 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, … … 149 160 "buildingsLost": this.buildingsLost, 150 161 "buildingsLostValue": this.buildingsLostValue, 151 162 "enemyBuildingsDestroyed": this.enemyBuildingsDestroyed, 152 "enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue, 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, … … 292 305 for each (var cost in costs) 293 306 this.buildingsLostValue += cost; 294 307 } 308 }; 309 310 StatisticsTracker.prototype.CapturedBuilding = function(capturedBuilding) 311 { 312 var cmpCapturedBuildingIdentity = Engine.QueryInterface(capturedBuilding, IID_Identity); 313 var cmpCost = Engine.QueryInterface(capturedBuilding, IID_Cost); 314 var costs = cmpCost.GetResourceCosts(); 315 316 for each (var type in this.buildingsClasses) 317 this.CounterIncrement(cmpCapturedBuildingIdentity, "buildingsCaptured", type); 318 319 this.buildingsCaptured.total++; 320 321 for each (var cost in costs) 322 this.buildingsCapturedValue += cost; 295 323 }; 296 324 297 325 /**