示例#1
0
    public void initalizeAIPriorities(Nation player)
    {
        TopLevel aiTopLevel = player.getAI().GetTopLevel();

        foreach (MyEnum.macroPriorities macro in Enum.GetValues(typeof(MyEnum.macroPriorities)))
        {
            aiTopLevel.setMacroPriority(player, macro, 1);
        }
        for (int i = 0; i < player.getProvinces().Count; i++)
        {
            int pIndex = player.getProvinces()[i];
            assemblyCsharp.Province prov = State.getProvinces()[pIndex];
            if (prov.getResource() == MyEnum.Resources.coal)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.buildFactory, 0.15f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.research, 0.15f);
            }
            if (prov.getResource() == MyEnum.Resources.cotton)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.colonies, 0.1f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.developProvince, 0.1f);
            }
            if (prov.getResource() == MyEnum.Resources.dyes)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.developProvince, 0.1f);
            }
            if (prov.getResource() == MyEnum.Resources.gold)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.culture, 0.15f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.spheres, 0.15f);
            }
            if (prov.getResource() == MyEnum.Resources.iron)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.buildFactory, 0.15f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.conquest, 0.15f);
            }
            if (prov.getResource() == MyEnum.Resources.oil)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.developProvince, 0.1f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.conquest, 0.05f);
            }
            if (prov.getResource() == MyEnum.Resources.rubber)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.research, 0.1f);
            }
            if (prov.getResource() == MyEnum.Resources.spice)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.culture, 0.1f);
            }
            if (prov.getResource() == MyEnum.Resources.wood)
            {
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.colonies, 0.1f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.navy, 0.1f);
                aiTopLevel.alterMacroPriority(player, MyEnum.macroPriorities.buildFactory, 0.05f);
            }
        }
    }