Skip to content

Commit

Permalink
Merge pull request #1445 from AlessioDP/Custom-pokeballs
Browse files Browse the repository at this point in the history
Custom pokeballs
  • Loading branch information
NecronomiconCoding authored Jul 30, 2016
2 parents 45ab2ca + 7df37b6 commit 3e0e9d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions PoGo.NecroBot.Logic/ILogicSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public interface ILogicSettings
bool KeepPokemonsThatCanEvolve { get; }
bool TransferDuplicatePokemon { get; }
bool UseEggIncubators { get; }
int UseGreatBallAboveCP { get; }
int UseUltraBallAboveCP { get; }
int UseMasterBallAboveCP { get; }
int DelayBetweenPokemonCatch { get; }
int DelayBetweenPlayerActions { get; }
bool UsePokemonToNotCatchFilter { get; }
Expand Down
6 changes: 6 additions & 0 deletions PoGo.NecroBot.Logic/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public class GlobalSettings
public int UseLuckyEggsMinPokemonAmount = 30;
public bool UseLuckyEggsWhileEvolving = false;
public bool UseEggIncubators = true;
public int UseGreatBallAboveCP = 750;
public int UseUltraBallAboveCP = 1000;
public int UseMasterBallAboveCP = 1500;
public bool DumpPokemonStats = false;
public string GpxFile = "GPXPath.GPX";
public bool UseGpxPathing = false;
Expand Down Expand Up @@ -590,6 +593,9 @@ public LogicSettings(GlobalSettings settings)
public bool KeepPokemonsThatCanEvolve => _settings.KeepPokemonsThatCanEvolve;
public bool TransferDuplicatePokemon => _settings.TransferDuplicatePokemon;
public bool UseEggIncubators => _settings.UseEggIncubators;
public int UseGreatBallAboveCP => _settings.UseGreatBallAboveCP;
public int UseUltraBallAboveCP => _settings.UseUltraBallAboveCP;
public int UseMasterBallAboveCP => _settings.UseMasterBallAboveCP;
public int DelayBetweenPokemonCatch => _settings.DelayBetweenPokemonCatch;
public int DelayBetweenPlayerActions => _settings.DelayBetweenPlayerActions;
public bool UsePokemonToNotCatchFilter => _settings.UsePokemonToNotCatchFilter;
Expand Down
8 changes: 4 additions & 4 deletions PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ private static async Task<ItemId> GetBestBall(ISession session, dynamic encounte
var ultraBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemUltraBall);
var masterBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemMasterBall);

if (masterBallsCount > 0 && ((pokemonCp >= 1200 && !session.LogicSettings.PokemonToUseMasterball.Any()) || session.LogicSettings.PokemonToUseMasterball.Contains(pokemonId)))
if (masterBallsCount > 0 && ((pokemonCp >= session.LogicSettings.UseMasterBallAboveCP && !session.LogicSettings.PokemonToUseMasterball.Any()) || session.LogicSettings.PokemonToUseMasterball.Contains(pokemonId)))
return ItemId.ItemMasterBall;
if (ultraBallsCount > 0 && pokemonCp >= 1000)
if (ultraBallsCount > 0 && pokemonCp >= session.LogicSettings.UseUltraBallAboveCP)
return ItemId.ItemUltraBall;
if (greatBallsCount > 0 && pokemonCp >= 750)
if (greatBallsCount > 0 && pokemonCp >= session.LogicSettings.UseGreatBallAboveCP)
return ItemId.ItemGreatBall;

if (ultraBallsCount > 0 && iV >= session.LogicSettings.KeepMinIvPercentage && probability < 0.40)
Expand Down Expand Up @@ -200,4 +200,4 @@ private static async Task UseBerry(ISession session, ulong encounterId, string s
session.EventDispatcher.Send(new UseBerryEvent {Count = berry.Count});
}
}
}
}

0 comments on commit 3e0e9d1

Please sign in to comment.