Count Trained Cattle as resource and not as unit. Also only count the net amount of gathered/used food for cattle.
Reviewed by: temple Fixes: #3948 Differential Revision: https://code.wildfiregames.com/D1052 This was SVN commit r20543.
This commit is contained in:
parent
aec1ff5493
commit
215a102c27
@ -126,9 +126,6 @@ function calculateEconomyScore(playerState, index)
|
||||
for (let type of g_ResourceData.GetCodes())
|
||||
total += playerState.sequences.resourcesGathered[type][index];
|
||||
|
||||
// Subtract costs for sheep/goats/pigs to get the net food gain for corralling
|
||||
total -= playerState.sequences.domesticUnitsTrainedValue[index];
|
||||
|
||||
total += playerState.sequences.tradeIncome[index];
|
||||
return Math.round(total / 10);
|
||||
}
|
||||
@ -244,6 +241,11 @@ function calculateTributeSent(playerState, index)
|
||||
};
|
||||
}
|
||||
|
||||
function calculateLivestockTrained(playerState, index)
|
||||
{
|
||||
return playerState.sequences.unitsTrained.Domestic[index];
|
||||
}
|
||||
|
||||
function calculateResourcesTeam(team, index, type, counters, headings)
|
||||
{
|
||||
return summaryArraySum(getPlayerValuesPerTeam(team, index, type, counters, headings));
|
||||
|
@ -116,8 +116,9 @@ var getScorePanelsData = () => ({
|
||||
"yStart": 16,
|
||||
"width": 121
|
||||
},
|
||||
{ "identifier": "treasuresCollected", "caption": translate("Treasures collected"), "yStart": 16, "width": 100 },
|
||||
{ "identifier": "loot", "caption": translate("Loot"), "yStart": 16, "width": 100 }
|
||||
{ "identifier": "treasuresCollected", "caption": translate("Treasures collected"), "yStart": 16, "width": 85 },
|
||||
{ "identifier": "loot", "caption": translate("Loot"), "yStart": 16, "width": 85 },
|
||||
{ "identifier": "livestock", "caption": translate("Livestock bred"), "yStart": 16, "width": 85 }
|
||||
],
|
||||
"titleHeadings": [
|
||||
{
|
||||
@ -138,8 +139,9 @@ var getScorePanelsData = () => ({
|
||||
"width": 100
|
||||
})),
|
||||
{ "width": 121, "fn": calculateTributeSent, "verticalOffset": 12 },
|
||||
{ "width": 100, "fn": calculateTreasureCollected, "verticalOffset": 12 },
|
||||
{ "width": 100, "fn": calculateLootCollected, "verticalOffset": 12 }
|
||||
{ "width": 85, "fn": calculateTreasureCollected, "verticalOffset": 12 },
|
||||
{ "width": 85, "fn": calculateLootCollected, "verticalOffset": 12 },
|
||||
{ "width": 85, "fn": calculateLivestockTrained, "verticalOffset": 12 }
|
||||
],
|
||||
"teamCounterFn": calculateResourcesTeam
|
||||
},
|
||||
|
@ -16,6 +16,7 @@ StatisticsTracker.prototype.Init = function()
|
||||
"Hero",
|
||||
"Siege",
|
||||
"Ship",
|
||||
"Domestic",
|
||||
"Trader"
|
||||
];
|
||||
this.unitsTrained = {
|
||||
@ -28,9 +29,9 @@ StatisticsTracker.prototype.Init = function()
|
||||
"Siege": 0,
|
||||
"Ship": 0,
|
||||
"Trader": 0,
|
||||
"Domestic": 0,
|
||||
"total": 0
|
||||
};
|
||||
this.domesticUnitsTrainedValue = 0;
|
||||
this.unitsLost = {
|
||||
"Infantry": 0,
|
||||
"Worker": 0,
|
||||
@ -179,7 +180,6 @@ StatisticsTracker.prototype.GetStatistics = function()
|
||||
{
|
||||
return {
|
||||
"unitsTrained": this.unitsTrained,
|
||||
"domesticUnitsTrainedValue": this.domesticUnitsTrainedValue,
|
||||
"unitsLost": this.unitsLost,
|
||||
"unitsLostValue": this.unitsLostValue,
|
||||
"enemyUnitsKilled": this.enemyUnitsKilled,
|
||||
@ -273,11 +273,15 @@ StatisticsTracker.prototype.IncreaseTrainedUnitsCounter = function(trainedUnit)
|
||||
for (let type of this.unitsClasses)
|
||||
this.CounterIncrement(cmpUnitEntityIdentity, "unitsTrained", type);
|
||||
|
||||
++this.unitsTrained.total;
|
||||
if (!cmpUnitEntityIdentity.HasClass("Domestic"))
|
||||
++this.unitsTrained.total;
|
||||
|
||||
if (cmpUnitEntityIdentity.HasClass("Domestic") && costs)
|
||||
for (let type in costs)
|
||||
this.domesticUnitsTrainedValue += costs[type];
|
||||
{
|
||||
// Subtract costs for sheep/goats/pigs to get the net food gain/use for corralling
|
||||
this.resourcesUsed.food -= costs.food;
|
||||
this.resourcesGathered.food -= costs.food;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user