private bool DetectMulligan(ref Info info) { if (Extra.IsMulligan != true) { return(false); } if (NeedToWaitMulligan) { NeedToWaitMulligan = false; Thread.Sleep(1500); // Mulligan animation is slow } var image = Services.Container.GetInstance <IScreenShotManager>().CloneImage(Hardware.MulliganArea); var items = Services.Container.GetInstance <NeuralNet>().GetItems(image.Bitmap); var cards = CardFactory.Create(items, new Point(Hardware.MulliganArea.X, Hardware.MulliganArea.Y)); Mulligan.Update(cards); info = Mulligan.Count() < 3 ? Info.DoNothing : Info.Mulligan; return(true); }
private bool MulliganLogic(out ICollection <IBotTask> tasks) { tasks = new List <IBotTask>(); #region Replace some pairs if (Mulligan.Count(typeof(WildHuntRider)) == 2) { var card = Mulligan.GetCard(typeof(WildHuntRider)); return(AddMulliganTask(tasks, card, "Replace 2 riders")); } if (Mulligan.Count(typeof(Foglet)) == 2) { var card = Mulligan.GetCard(typeof(Foglet)); return(AddMulliganTask(tasks, card, "Replace 2 foglets")); } if (Mulligan.Count(typeof(Werewolf)) == 2) { var card = Mulligan.GetCard(typeof(Werewolf)); return(AddMulliganTask(tasks, card, "Replace 2 werewolfs")); } if (Mulligan.Count(typeof(CelaenoHarpy)) == 2) { var card = Mulligan.GetCard(typeof(CelaenoHarpy)); return(AddMulliganTask(tasks, card, "Replace 2 celaeno")); } if (IsRound1()) { if (Mulligan.Count(typeof(Nekker)) == 2) { var card = Mulligan.GetCard(typeof(Nekker)); return(AddMulliganTask(tasks, card, "Replace 2 nekkers")); } } #endregion #region Already tried to thin foglet if (GameMemory.InGraveyard(typeof(Foglet)) && Hand.Contain(typeof(Foglet))) { var card = Mulligan.GetCard(typeof(Foglet)); return(AddMulliganTask(tasks, card, "Already tried to thin foglet")); } #endregion #region Replace ozzrel and ghouls if (IsRound1()) { if (Mulligan.Contain(typeof(Ghoul))) { var card = Mulligan.GetCard(typeof(Ghoul)); return(AddMulliganTask(tasks, card, "Don't need ghoul R1")); } if (Mulligan.Contain(typeof(Ozzrel))) { var card = Mulligan.GetCard(typeof(Ozzrel)); return(AddMulliganTask(tasks, card, "Don't need ozzrel R1")); } } #endregion #region Replace weak card in R2+ if (NotRound1()) { if (Mulligan.Contain(typeof(Foglet)) && GameMemory.InGraveyard(typeof(Foglet))) { var card = Mulligan.GetCard(typeof(Foglet)); return(AddMulliganTask(tasks, card, "Don't need Foglet in R2+")); } if (Mulligan.Contain(typeof(Plumard))) { var card = Mulligan.GetCard(typeof(Plumard)); return(AddMulliganTask(tasks, card, "Don't need Plumard in R2+")); } if (Mulligan.Contain(typeof(Nekker))) { var card = Mulligan.GetCard(typeof(Nekker)); return(AddMulliganTask(tasks, card, "Don't need Nekker in R2+")); } if (Mulligan.Contain(typeof(Wyvern))) { var card = Mulligan.GetCard(typeof(Wyvern)); return(AddMulliganTask(tasks, card, "Don't need Wyvern in R2+")); } if (Mulligan.Contain(typeof(NekkerWarrior))) { var card = Mulligan.GetCard(typeof(NekkerWarrior)); return(AddMulliganTask(tasks, card, "Don't need NekkerWarrior in R2+")); } if (Mulligan.Contain(typeof(Brewess))) { var card = Mulligan.GetCard(typeof(Brewess)); return(AddMulliganTask(tasks, card, "Don't need Brewess in R2+")); } } #endregion tasks.Add(new FinishMulliganTask()); return(false); }