Ticket #1152: economy.js.patch

File economy.js.patch, 5.5 KB (added by gudo, 12 years ago)

Fixed version of previous patch

  • economy.js

     
    1414        // Greek building list
    1515        // Relative proportions of workers to assign to each resource type
    1616        this.gatherWeights = {
    17             "food": 180,
     17            "food": 170,
    1818            "wood": 180,
    1919            "stone": 45,
    20             "metal": 120,
     20            "metal": 110,
    2121        };
    2222    },
    2323
     
    2525            if (gameState.displayCiv() == "hele"){
    2626        this.villageBuildings = [
    2727            {
    28                 "template": "structures/{civ}_scout_tower",
     28                "template": "structures/{civ}_defense_tower",
    2929                "priority": 105,
    3030                "count": 1,
    3131            },
     
    5050            else if (gameState.displayCiv() == "celt"){
    5151        this.villageBuildings = [
    5252            {
    53                 "template": "structures/{civ}_scout_tower",
     53                "template": "structures/{civ}_defense_tower",
    5454                "priority": 105,
    5555                "count": 1,
    5656            },
     
    7575            else if (gameState.displayCiv() == "cart"){
    7676        this.villageBuildings = [
    7777            {
    78                 "template": "structures/{civ}_scout_tower",
     78                "template": "structures/{civ}_defense_tower",
    7979                "priority": 105,
    8080                "count": 1,
    8181            },
     
    100100            else if (gameState.displayCiv() == "iber"){
    101101        this.villageBuildings = [
    102102            {
    103                 "template": "structures/{civ}_scout_tower",
     103                "template": "structures/{civ}_defense_tower",
    104104                "priority": 105,
    105105                "count": 1,
    106106            },
     
    125125            else if (gameState.displayCiv() == "pers"){
    126126        this.villageBuildings = [
    127127            {
    128                 "template": "structures/{civ}_scout_tower",
     128                "template": "structures/{civ}_defense_tower",
    129129                "priority": 105,
    130130                "count": 1,
    131131            },
     
    147147        ];
    148148            }
    149149
     150            // Roman building list
     151            else if (gameState.displayCiv() == "rome"){
     152        this.villageBuildings = [
     153            {
     154                "template": "structures/{civ}_barracks",
     155                "priority": 105,
     156                "count": 1,
     157            },
     158                {
     159                "template": "structures/{civ}_field",
     160                "priority": 103,
     161                "count": 1,
     162            },
     163            {
     164                "template": "structures/{civ}_defense_tower",
     165                "priority": 101,
     166                "count": 1,
     167            },
     168            {
     169                "template": "structures/{civ}_field",
     170                "priority": 70,
     171                "count": 2,
     172            },
     173        ];
     174            }
    150175            // Fallback option just in case
    151176        else {
    152177        this.villageBuildings = [
    153178            {
    154                 "template": "structures/{civ}_scout_tower",
     179                "template": "structures/{civ}_defense_tower",
    155180                "priority": 105,
    156181                "count": 1,
    157182            },
     
    166191                "count": 1,
    167192            },
    168193            {
    169                 "template": "structures/{civ}_scout_tower",
     194                "template": "structures/{civ}_defense_tower",
    170195                "priority": 60,
    171196                "count": 4,
    172197            },
     
    217242                "priority": 80,
    218243                "count": 1,
    219244            },
     245                        {
     246                "template": "structures/{civ}_kennel",
     247                "priority": 75,
     248                "count": 1,
     249            },
    220250        ];
    221251            }
    222252            // Carthage building list
     
    249279            },
    250280        ];
    251281            }
    252             // Celt building list
     282            // Iberian building list
    253283            else if (gameState.displayCiv() == "iber"){
    254284        this.targetBuildings = [
    255285            {
     
    280310            },
    281311        ];
    282312            }
     313            // Roman building list
     314            else if (gameState.displayCiv() == "rome"){
     315        this.targetBuildings = [
     316            {
     317                "template": "structures/rome_army_camp",
     318                "priority": 75,
     319                "count": 1,
     320            },
     321            {
     322                "template": "structures/rome_fortress",
     323                "priority": 80,
     324                "count": 2,
     325            }
     326        ];
     327            }
    283328            // Fallback option just in case
    284329        else {
    285330        this.targetBuildings = [
     
    294339                "count": 1,
    295340            },
    296341            {
    297                 "template": "structures/{civ}_scout_tower",
     342                "template": "structures/{civ}_defense_tower",
    298343                "priority": 60,
    299344                "count": 4,
    300345            },
     
    408453        {
    409454        var priority = 140;
    410455        }
    411 
     456        //Hele and Celt Training List
    412457        if (gameState.displayCiv() == "hele" || gameState.displayCiv() == "celt"){
    413458            if (workNumMod < 0.95){
    414459            planGroups.economyPersonnel.addPlan(priority,
     
    429474            );
    430475            }
    431476        }
     477        //Carthage Training List
    432478        else if (gameState.displayCiv() == "cart"){
    433479            if (workNumMod < 0.95){
    434480            planGroups.economyPersonnel.addPlan(priority,
     
    449495            );
    450496            }
    451497        }
     498        //Iberian Training List
    452499        else if (gameState.displayCiv() == "iber"){
    453500            if (workNumMod < 0.95){
    454501            planGroups.economyPersonnel.addPlan(priority,
     
    469516            );
    470517            }
    471518        }
     519        //Persian Training List
    472520        else if (gameState.displayCiv() == "pers"){
    473521            if (workNumMod < 0.95){
    474522            planGroups.economyPersonnel.addPlan(priority,
     
    489537            );
    490538            }
    491539        }
     540        //Roman Training List
     541                else if (gameState.displayCiv() == "rome"){
     542            if (workNumMod < 0.95){
     543            planGroups.economyPersonnel.addPlan(priority,
     544                new UnitTrainingPlan(gameState,
     545                    "units/{civ}_support_female_citizen", 2, { "role": "worker" })
     546            );
     547            }
     548            else if (workNumMod > 1.3) {
     549            planGroups.economyPersonnel.addPlan(priority,
     550                new UnitTrainingPlan(gameState,
     551                    "units/{civ}_infantry_swordsman_b", 2, { "role": "militia" })
     552            );
     553            }
     554            else if (workNumMod > 1.6) {
     555            planGroups.economyPersonnel.addPlan(priority,
     556                new UnitTrainingPlan(gameState,
     557                    "units/{civ}_infantry_spearman_a", 2, { "role": "militia" })
     558            );
     559            }
     560            else {
     561            planGroups.economyPersonnel.addPlan(priority,
     562                new UnitTrainingPlan(gameState,
     563                    "units/{civ}_infantry_javelinist_b", 2, { "role": "militia" })
     564            );
     565            }
     566        }
     567        //Any Other Civ Training List
    492568        else {
    493569            planGroups.economyPersonnel.addPlan(priority,
    494570                new UnitTrainingPlan(gameState,