Ticket #3311: ticket3311.diff

File ticket3311.diff, 11.0 KB (added by bb, 9 years ago)

patch with using "-x --ignore-eol-style"

  • binaries/data/mods/public/gui/session/session.js

     
    912912        "Cavalry",
    913913        "Champion",
    914914        "Hero",
    915         "Ship"
     915        "Ship",
     916        "Trader"
    916917    ];
    917918    var unitsCountersTypes = [
    918919        "unitsTrained",
     
    993994    playerStatistics.totalScore = "";
    994995    // Various
    995996    playerStatistics.treasuresCollected = "";
     997    playerStatistics.lootCollected = "";
    996998    playerStatistics.feminisation = "";
    997999    playerStatistics.percentMapExplored = "";
    9981000    var mapName = Engine.GetMapSettings().Name;
     
    10361038        playerStatistics.tributesReceived += player.statistics.tributesReceived + ",";
    10371039        playerStatistics.percentMapExplored += player.statistics.percentMapExplored + ",";
    10381040        playerStatistics.treasuresCollected += player.statistics.treasuresCollected + ",";
     1041        playerStatistics.lootCollected += player.statistics.lootCollected + ",";
    10391042    }
    10401043
    10411044    // Send the report with serialized data
     
    10771080    reportObject.tributesReceived = playerStatistics.tributesReceived;
    10781081    reportObject.percentMapExplored = playerStatistics.percentMapExplored;
    10791082    reportObject.treasuresCollected = playerStatistics.treasuresCollected;
     1083    reportObject.lootCollected = playerStatistics.lootCollected;
    10801084    reportObject.tradeIncome = playerStatistics.tradeIncome;
    10811085
    10821086    Engine.SendGameReport(reportObject);
  • binaries/data/mods/public/gui/summary/counters.js

     
    136136    return playerState.statistics.treasuresCollected;
    137137}
    138138
     139function calculateLootCollected(playerState, position)
     140{
     141    return playerState.statistics.lootCollected;
     142}
     143
    139144function calculateTributeSent(playerState, position)
    140145{
    141146    return INCOME_COLOR + playerState.statistics.tributesSent + "[/color] / " + OUTCOME_COLOR + playerState.statistics.tributesReceived + "[/color]";
  • binaries/data/mods/public/gui/summary/layout.js

     
    2929            { "caption": translate("Wonders"), "yStart": 34, "width": 85 }
    3030        ],
    3131        "titleHeadings": [
    32             { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed)"), "yStart": 16, "width": (85 * 7 + 105) },   // width = 735
     32            { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed)"), "yStart": 16, "width": (85 * 7 + 105) },   // width = 700
    3333        ],
    3434        "counters": [   // counters on buildings panel
    3535            {"width": 105, "fn": calculateBuildings},
     
    5252            { "caption": translate("Cavalry"), "yStart": 34, "width": 100 },
    5353            { "caption": translate("Champion"), "yStart": 34, "width": 100 },
    5454            { "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 }
    5657        ],
    5758        "titleHeadings": [
    58             { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 6 + 120) }, // width = 720
     59            { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 7 + 120) }, // width = 820
    5960        ],
    6061        "counters": [   // counters on units panel
    6162            {"width": 120, "fn": calculateUnits},
     
    6465            {"width": 100, "fn": calculateUnits},
    6566            {"width": 100, "fn": calculateUnits},
    6667            {"width": 100, "fn": calculateUnits},
     68            {"width": 100, "fn": calculateUnits},
    6769            {"width": 100, "fn": calculateUnits}
    6870        ],
    6971        "teamCounterFn": calculateColorsTeam
     
    7779            { "caption": translate("Metal"), "yStart": 34, "width": 100 },
    7880            { "caption": translate("Total"), "yStart": 34, "width": 110 },
    7981            { "caption": translate("Treasures collected"), "yStart": 16, "width": 100 },
     82            { "caption": translate("Looted"), "yStart": 16, "width": 100 },
    8083            { "caption": translate("Tributes (Sent / Received)"), "yStart": 16, "width": 121 }
    8184        ],
    8285        "titleHeadings": [
     
    8891            {"width": 100, "fn": calculateResources},
    8992            {"width": 100, "fn": calculateResources},
    9093            {"width": 110, "fn": calculateTotalResources},
    91             {"width": 100, "fn": calculateTreasureCollected},
     94            {"width": 100, "fn": calculateTreasureCollected},
     95            {"width": 100, "fn": calculateLootCollected},
    9296            {"width": 121, "fn": calculateTributeSent}
    9397        ],
    9498        "teamCounterFn": calculateResourcesTeam
  • binaries/data/mods/public/gui/summary/summary.js

     
    2121const KILLED_COLOR = '[color="196 198 255"]';
    2222
    2323const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ];
    24 const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ];
     24const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship", "Trader" ];
    2525const RESOURCES_TYPES = [ "food", "wood", "stone", "metal" ];
    2626
    2727// Colors used for gathered and traded resources
  • binaries/data/mods/public/simulation/components/Looter.js

     
    2727    }
    2828    cmpPlayer.AddResources(resources);
    2929
     30    let cmpStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker);
     31    if (cmpStatisticsTracker)
     32        cmpStatisticsTracker.IncreaseLootCollectedCounter(resources);
     33
    3034    // If target entity has trader component, add carried goods to loot too
    3135    var cmpTrader = Engine.QueryInterface(targetEntity, IID_Trader);
    3236    if (cmpTrader)
     
    4246            if (carriedGoods.amount.market2Gain)
    4347                resourcesToAdd[carriedGoods.type] += carriedGoods.amount.market2Gain;
    4448            cmpPlayer.AddResources(resourcesToAdd);
     49           
     50            let cmpStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker);
     51            if (cmpStatisticsTracker)
     52                cmpStatisticsTracker.IncreaseLootCollectedCounter(resourcesToAdd);
    4553        }
    4654    }
    4755}
  • binaries/data/mods/public/simulation/components/StatisticsTracker.js

     
    1313        "Cavalry",
    1414        "Champion",
    1515        "Hero",
    16         "Ship"
     16        "Ship",
     17        "Trader"
    1718    ]; 
    1819    this.unitsTrained = {
    1920        "Infantry": 0,
     
    2324        "Champion": 0,
    2425        "Hero": 0,
    2526        "Ship": 0,
     27        "Trader": 0,
    2628        "total": 0
    2729    };
    2830    this.unitsLost = {
     
    3335        "Champion": 0,
    3436        "Hero": 0,
    3537        "Ship": 0,
     38        "Trader": 0,
    3639        "total": 0
    3740    };
    3841    this.unitsLostValue = 0;
     
    4447        "Champion": 0,
    4548        "Hero": 0,
    4649        "Ship": 0,
     50        "Trader": 0,
    4751        "total": 0
    4852    };
    4953    this.enemyUnitsKilledValue = 0;
     
    119123    this.tributesReceived = 0;
    120124    this.tradeIncome = 0;
    121125    this.treasuresCollected = 0;
     126    this.lootCollected = 0;
    122127};
    123128
    124129/**
     
    158163        "tributesReceived": this.tributesReceived,
    159164        "tradeIncome": this.tradeIncome,
    160165        "treasuresCollected": this.treasuresCollected,
     166        "lootCollected": this.lootCollected,
    161167        "percentMapExplored": this.GetPercentMapExplored(),
    162168        "teamPercentMapExplored": this.GetTeamPercentMapExplored()
    163169    };
     
    309315
    310316/**
    311317 * @param type Generic type of resource (string)
    312  * @param amount Amount of resource, whick should be added (integer)
     318 * @param amount Amount of resource, which should be added (integer)
    313319 */
    314320StatisticsTracker.prototype.IncreaseResourceUsedCounter = function(type, amount)
    315321{
     
    321327    this.treasuresCollected++;
    322328};
    323329
     330StatisticsTracker.prototype.IncreaseLootCollectedCounter = function(amount)
     331{
     332    for (var type in amount)
     333    {
     334        this.lootCollected += (+amount[type]);
     335    }
     336};
    324337StatisticsTracker.prototype.IncreaseResourcesSoldCounter = function(type, amount)
    325338{
    326339    this.resourcesSold[type] += amount;
  • source/tools/XpartaMuPP/LobbyRanking.py

     
    6161    metalUsed = Column(Integer)
    6262    vegetarianFoodGathered = Column(Integer)
    6363    treasuresCollected = Column(Integer)
     64    lootCollected = Column(Integer)
    6465    tributesSent = Column(Integer)
    6566    tributesReceived = Column(Integer)
    6667    totalUnitsTrained = Column(Integer)
     
    8788    shipUnitsTrained = Column(Integer)
    8889    shipUnitsLost = Column(Integer)
    8990    enemyShipUnitsKilled = Column(Integer)
     91    traderUnitsTrained = Column(Integer)
     92    traderUnitsLost = Column(Integer)
     93    enemyTraderUnitsKilled = Column(Integer)
    9094    totalBuildingsConstructed = Column(Integer)
    9195    totalBuildingsLost = Column(Integer)
    9296    enemytotalBuildingsDestroyed = Column(Integer)
  • source/tools/XpartaMuPP/XpartaMuPP.py

     
    122122    totalScoreStats = {'economyScore', 'militaryScore', 'totalScore'}
    123123    resourceStats = {'foodGathered', 'foodUsed', 'woodGathered', 'woodUsed',
    124124            'stoneGathered', 'stoneUsed', 'metalGathered', 'metalUsed', 'vegetarianFoodGathered',
    125             'treasuresCollected', 'tributesSent', 'tributesReceived'}
     125            'treasuresCollected', 'lootCollected', 'tributesSent', 'tributesReceived'}
    126126    unitsStats = {'totalUnitsTrained', 'totalUnitsLost', 'enemytotalUnitsKilled', 'infantryUnitsTrained',
    127127            'infantryUnitsLost', 'enemyInfantryUnitsKilled', 'workerUnitsTrained', 'workerUnitsLost',
    128128            'enemyWorkerUnitsKilled', 'femaleUnitsTrained', 'femaleUnitsLost', 'enemyFemaleUnitsKilled',
    129129            'cavalryUnitsTrained', 'cavalryUnitsLost', 'enemyCavalryUnitsKilled', 'championUnitsTrained',
    130130            'championUnitsLost', 'enemyChampionUnitsKilled', 'heroUnitsTrained', 'heroUnitsLost',
    131             'enemyHeroUnitsKilled', 'shipUnitsTrained', 'shipUnitsLost', 'enemyShipUnitsKilled'}
     131            'enemyHeroUnitsKilled', 'shipUnitsTrained', 'shipUnitsLost', 'enemyShipUnitsKilled', 'traderUnitsTrained',
     132            'traderUnitsLost', 'enemyTraderUnitsKilled'}
    132133    buildingsStats = {'totalBuildingsConstructed', 'totalBuildingsLost', 'enemytotalBuildingsDestroyed',
    133134            'civCentreBuildingsConstructed', 'civCentreBuildingsLost', 'enemyCivCentreBuildingsDestroyed',
    134135            'houseBuildingsConstructed', 'houseBuildingsLost', 'enemyHouseBuildingsDestroyed',