public void alterPrioritiesBasedOnProvinceGain(Nation player, MyEnum.Resources res) { TopLevel aiTopLevel = player.getAI().GetTopLevel(); aiTopLevel.alterResPriority(player, res, -0.65f); if (res == MyEnum.Resources.coal) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.arms, 0.15f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.steel, 0.25f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.parts, 0.15f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.chemicals, 0.5f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.arms, 0.25f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.steel, 0.4f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.parts, 0.3f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.chemicals, 0.4f); aiTopLevel.alterTechnologyPriority(player, "chemistry", 0.65f); aiTopLevel.alterTechnologyPriority(player, "fertilizer", 0.5f); aiTopLevel.alterTechnologyPriority(player, "medicine", 0.4f); aiTopLevel.alterTechnologyPriority(player, "synthetic_dyes", 0.5f); aiTopLevel.alterTechnologyPriority(player, "bessemer_process", 0.33f); aiTopLevel.alterTechnologyPriority(player, "steel_plows", 0.45f); aiTopLevel.alterTechnologyPriority(player, "square_timbering", 0.45f); aiTopLevel.alterTechnologyPriority(player, "steam_engine", 0.45f); aiTopLevel.alterTechnologyPriority(player, "compound_steam_engine", 0.45f); } if (res == MyEnum.Resources.cotton) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.fabric, 0.6f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.clothing, 0.45f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.furniture, 0.25f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.clothing, 0.5f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.fabric, 0.55f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.furniture, 0.25f); aiTopLevel.alterTechnologyPriority(player, "cotton_gin", 0.5f); aiTopLevel.alterTechnologyPriority(player, "power_loom", 0.5f); aiTopLevel.alterTechnologyPriority(player, "sewing_machine", 0.5f); aiTopLevel.alterTechnologyPriority(player, "spinning_jenny", 0.5f); } if (res == MyEnum.Resources.dyes) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.clothing, 0.4f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.clothing, 0.35f); aiTopLevel.alterTechnologyPriority(player, "synthetic_dyes", -0.5f); aiTopLevel.alterTechnologyPriority(player, "sewing_machine", 0.25f); aiTopLevel.alterTechnologyPriority(player, "spinning_jenny", 0.25f); aiTopLevel.alterTechnologyPriority(player, "fertilizer", 0.2f); } if (res == MyEnum.Resources.iron) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.arms, 0.25f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.steel, 0.4f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.parts, 0.25f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.gear, 0.2f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.arms, 0.35f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.steel, 0.6f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.parts, 0.3f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.gear, 0.3f); aiTopLevel.alterTechnologyPriority(player, "bessemer_process", 0.55f); aiTopLevel.alterTechnologyPriority(player, "advanced_metalworking", 0.33f); aiTopLevel.alterTechnologyPriority(player, "steam_engine", 0.34f); aiTopLevel.alterTechnologyPriority(player, "automobile", 0.25f); aiTopLevel.alterTechnologyPriority(player, "flight", 0.25f); aiTopLevel.alterTechnologyPriority(player, "square_timbering", 0.45f); aiTopLevel.alterTechnologyPriority(player, "dynamite", 0.25f); aiTopLevel.alterTechnologyPriority(player, "steam_locomotive", 0.2f); } if (res == MyEnum.Resources.oil) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.auto, 0.5f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.auto, 0.6f); aiTopLevel.alterTechnologyPriority(player, "oil_drilling", 0.75f); aiTopLevel.alterTechnologyPriority(player, "automobile", 0.35f); aiTopLevel.alterTechnologyPriority(player, "flight", 0.35f); } if (res == MyEnum.Resources.rubber) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.gear, 0.6f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.telephone, 0.45f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.auto, 0.4f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.gear, 0.85f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.telephone, 0.65f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.auto, 0.6f); aiTopLevel.alterTechnologyPriority(player, "electricity", 0.75f); aiTopLevel.alterTechnologyPriority(player, "automobile", 0.35f); aiTopLevel.alterTechnologyPriority(player, "flight", 0.25f); aiTopLevel.alterTechnologyPriority(player, "telephone", 0.55f); aiTopLevel.alterTechnologyPriority(player, "fertilizer", 0.2f); } if (res == MyEnum.Resources.wood) { aiTopLevel.alterFactPriority(player, MyEnum.Goods.lumber, 0.65f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.paper, 0.55f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.furniture, 0.35f); aiTopLevel.alterFactPriority(player, MyEnum.Goods.telephone, 0.2f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.paper, 1.0f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.lumber, 1.1f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.furniture, 0.65f); aiTopLevel.alterProductionPriorities(player, MyEnum.Goods.telephone, 0.35f); aiTopLevel.alterTechnologyPriority(player, "pulping", 0.5f); aiTopLevel.alterTechnologyPriority(player, "compound_steam_engine", 0.35f); aiTopLevel.alterTechnologyPriority(player, "steam_engine", 0.35f); } if (res == MyEnum.Resources.wheat) { aiTopLevel.alterTechnologyPriority(player, "steel_plows", 0.35f); aiTopLevel.alterTechnologyPriority(player, "mechanical_reaper", 0.35f); aiTopLevel.alterTechnologyPriority(player, "fertilizer", 0.15f); } if (res == MyEnum.Resources.meat) { aiTopLevel.alterTechnologyPriority(player, "biology", 0.5f); aiTopLevel.alterTechnologyPriority(player, "barbed_wire", 0.5f); } if (res == MyEnum.Resources.fruit) { aiTopLevel.alterTechnologyPriority(player, "steel_plows", 0.35f); aiTopLevel.alterTechnologyPriority(player, "fertilizer", 0.25f); } }
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); } } }