private poziom countAgentLevel(Player player, Player op) { int dif = 10; if (!PlayerDataService.mySettings.isFighterSI) { dif = 20; } poziom aLevel = poziom.Malo; if (player.agents.Count < dif) { aLevel = poziom.Malo; } else if (player.agents.Count < op.agents.Count) { aLevel = poziom.Malo; } else if (player.agents.Count < op.agents.Count + dif) { aLevel = poziom.Srednio; } else { aLevel = poziom.Duzo; } return(aLevel); }
public void updateSI(Player player) { if (player.controledBySI == false) { //Debug.Log(player.FoodLevelFuzzy.ToString()); } if (player.controledBySI == true) { force = false; // pobieranie liczby agentów Player op = null; foreach (var pp in MatchDataS.myMatch.mapData.players) { Player cur = pp.Value; if (cur.id != player.id) { op = cur; } } poziom aLevel = countAgentLevel(player, op); dest = new Vector2(op.baseBuilding.x, op.baseBuilding.y); #region fighter if (PlayerDataService.mySettings.isFighterSI) { //ROZWOJ if (player._foodLevel > poziom.Malo) { CreateNewVilager(player); } //Debug.Log(player.FoodLevel + " " + player.WoodLevel + " " + player.GoldLevel); // WALKA if (aLevel == poziom.Duzo) { player.currentGoal = Agent.Goal.Fight; force = true; return; } // EKONOMIA if (player.FoodLevel == poziom.Malo) { player.currentGoal = Agent.Goal.SearchFood; } else if (player.FoodLevel == poziom.Srednio) { player.currentGoal = Agent.Goal.SearchFood; } } #endregion #region notfighter if (!PlayerDataService.mySettings.isFighterSI) { //ROZWOJ if (player._foodLevel > poziom.Malo && aLevel < poziom.Srednio) { CreateNewVilager(player); } else if (player._foodLevel > poziom.Srednio && aLevel < poziom.Duzo) { CreateNewVilager(player); } else if (player.GoldLevel > poziom.Srednio || (player.GoldLevel > poziom.Malo && player.collectSpeed < 10)) { player.buySpeed(); } else if ((player.GoldLevel > poziom.Srednio && player.WoodLevel > poziom.Srednio) || (player.WoodLevel > poziom.Malo && player.GoldLevel > poziom.Malo && player.collectMax < 50)) { player.buySize(); } else if (player._foodLevel > poziom.Malo) { CreateNewVilager(player); } // WALKA if (aLevel == poziom.Duzo) { player.currentGoal = Agent.Goal.Fight; return; } // EKONOMIA if (player.FoodLevel == poziom.Malo) { //if (player.currentGoal != Agent.Goal.SearchFood) Debug.Log("Nowy cel " + Agent.Goal.SearchFood); player.currentGoal = Agent.Goal.SearchFood; } else if (player.GoldLevel == poziom.Malo) { //if (player.currentGoal != Agent.Goal.SearchFood) Debug.Log("Nowy cel " + Agent.Goal.SearchFood); player.currentGoal = Agent.Goal.SearchGold; } else if (player.WoodLevel == poziom.Malo) { //if (player.currentGoal != Agent.Goal.SearchFood) Debug.Log("Nowy cel " + Agent.Goal.SearchFood); player.currentGoal = Agent.Goal.SearchWood; } else if (player.FoodLevel == poziom.Srednio) { //if (player.currentGoal != Agent.Goal.SearchFood) Debug.Log("Nowy cel " + Agent.Goal.SearchFood); player.currentGoal = Agent.Goal.SearchFood; } } #endregion } }