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

        aiTopLevel.setResPriority(player, MyEnum.Resources.wheat, 3);
        aiTopLevel.setResPriority(player, MyEnum.Resources.meat, 2.5f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.fruit, 2.5f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.coal, 1);
        aiTopLevel.setResPriority(player, MyEnum.Resources.cotton, 1.5f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.dyes, 2.5f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.gold, 3f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.iron, 2.25f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.oil, 0.25f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.rubber, 0.25f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.spice, 2.75f);
        aiTopLevel.setResPriority(player, MyEnum.Resources.wood, 1.5f);

        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.wheat)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.wheat, -0.2f);
            }
            if (prov.getResource() == MyEnum.Resources.meat)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.meat, -0.15f);
            }
            if (prov.getResource() == MyEnum.Resources.fruit)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.fruit, -0.15f);
            }
            if (prov.getResource() == MyEnum.Resources.coal)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.iron, 0.15f);
                aiTopLevel.alterResPriority(player, MyEnum.Resources.coal, -0.05f);
            }
            if (prov.getResource() == MyEnum.Resources.cotton)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.dyes, 0.16f);
                aiTopLevel.alterResPriority(player, MyEnum.Resources.cotton, -0.075f);
                aiTopLevel.alterResPriority(player, MyEnum.Resources.wood, 0.075f);
            }

            if (prov.getResource() == MyEnum.Resources.dyes)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.cotton, 0.2f);
            }
            if (prov.getResource() == MyEnum.Resources.gold)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.gold, -0.15f);
            }
            if (prov.getResource() == MyEnum.Resources.iron)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.coal, 0.1f);
                aiTopLevel.alterResPriority(player, MyEnum.Resources.iron, -0.075f);
            }
            if (prov.getResource() == MyEnum.Resources.oil)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.oil, -0.075f);
            }
            if (prov.getResource() == MyEnum.Resources.rubber)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.rubber, -0.075f);
            }
            if (prov.getResource() == MyEnum.Resources.spice)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.gold, -0.075f);
            }
            if (prov.getResource() == MyEnum.Resources.wood)
            {
                aiTopLevel.alterResPriority(player, MyEnum.Resources.wood, -0.1f);
                aiTopLevel.alterResPriority(player, MyEnum.Resources.cotton, 0.075f);
            }
        }
    }