diff --git a/PoGo.NecroBot.Logic/ILogicSettings.cs b/PoGo.NecroBot.Logic/ILogicSettings.cs index e8011f72a..0076b55bc 100644 --- a/PoGo.NecroBot.Logic/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/ILogicSettings.cs @@ -83,7 +83,8 @@ public interface ILogicSettings bool EvolveAllPokemonAboveIv { get; } float EvolveAboveIvValue { get; } bool DumpPokemonStats { get; } - bool RenameAboveIv { get; } + bool RenamePokemon { get; } + bool RenameOnlyAboveIv { get; } string RenameTemplate { get; } int AmountOfPokemonToDisplayOnStart { get; } string TranslationLanguageCode { get; } @@ -92,6 +93,7 @@ public interface ILogicSettings string GeneralConfigPath { get; } bool SnipeAtPokestops { get; } int MinPokeballsToSnipe { get; } + int MinPokeballsWhileSnipe { get; } string SnipeLocationServer { get; } int SnipeLocationServerPort { get; } bool UseSnipeLocationServer { get; } diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index f0d7092f1..d6052d3ce 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -124,7 +124,8 @@ public class GlobalSettings public float KeepMinIvPercentage = 95; public bool KeepPokemonsThatCanEvolve = false; public bool PrioritizeIvOverCp = true; - public bool RenameAboveIv = true; + public bool RenamePokemon = false; + public bool RenameOnlyAboveIv = true; public string RenameTemplate = "{1}_{0}"; public bool TransferDuplicatePokemon = true; public string TranslationLanguageCode = "en"; @@ -582,7 +583,8 @@ public LogicSettings(GlobalSettings settings) public int UseLuckyEggsMinPokemonAmount => _settings.UseLuckyEggsMinPokemonAmount; public bool EvolveAllPokemonAboveIv => _settings.EvolveAllPokemonAboveIv; public float EvolveAboveIvValue => _settings.EvolveAboveIvValue; - public bool RenameAboveIv => _settings.RenameAboveIv; + public bool RenamePokemon => _settings.RenamePokemon; + public bool RenameOnlyAboveIv => _settings.RenameOnlyAboveIv; public string RenameTemplate => _settings.RenameTemplate; public int AmountOfPokemonToDisplayOnStart => _settings.AmountOfPokemonToDisplayOnStart; public bool DumpPokemonStats => _settings.DumpPokemonStats; diff --git a/PoGo.NecroBot.Logic/State/FarmState.cs b/PoGo.NecroBot.Logic/State/FarmState.cs index 46c0a18f9..987d72d79 100644 --- a/PoGo.NecroBot.Logic/State/FarmState.cs +++ b/PoGo.NecroBot.Logic/State/FarmState.cs @@ -22,7 +22,7 @@ public async Task Execute(ISession session, CancellationToken cancellati await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } - if (session.LogicSettings.RenameAboveIv) + if (session.LogicSettings.RenamePokemon) { await RenamePokemonTask.Execute(session, cancellationToken); } diff --git a/PoGo.NecroBot.Logic/Tasks/Farm.cs b/PoGo.NecroBot.Logic/Tasks/Farm.cs index fc0eb0f7a..5946b4b2b 100644 --- a/PoGo.NecroBot.Logic/Tasks/Farm.cs +++ b/PoGo.NecroBot.Logic/Tasks/Farm.cs @@ -30,7 +30,7 @@ public void Run(CancellationToken cancellationToken) TransferDuplicatePokemonTask.Execute(_session, cancellationToken).Wait(); } - if (_session.LogicSettings.RenameAboveIv) + if (_session.LogicSettings.RenamePokemon) { RenamePokemonTask.Execute(_session, cancellationToken).Wait(); } diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs index 9eb941204..0bf5bf425 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs @@ -126,7 +126,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } - if (session.LogicSettings.RenameAboveIv) + if (session.LogicSettings.RenamePokemon) { await RenamePokemonTask.Execute(session, cancellationToken); } diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs index 18326fc63..13d4967ac 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs @@ -168,7 +168,7 @@ await session.Navigation.HumanLikeWalking(new GeoCoordinate(pokeStop.Latitude, p { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } - if (session.LogicSettings.RenameAboveIv) + if (session.LogicSettings.RenamePokemon) { await RenamePokemonTask.Execute(session, cancellationToken); } diff --git a/PoGo.NecroBot.Logic/Tasks/RenamePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/RenamePokemonTask.cs index 05cdf44fe..d0cebd392 100644 --- a/PoGo.NecroBot.Logic/Tasks/RenamePokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/RenamePokemonTask.cs @@ -36,8 +36,9 @@ public static async Task Execute(ISession session, CancellationToken cancellatio string newNickname = String.Format(session.LogicSettings.RenameTemplate, pokemonName, perfection); string oldNickname = (pokemon.Nickname.Length != 0) ? pokemon.Nickname : pokemon.PokemonId.ToString(); - if (perfection >= session.LogicSettings.KeepMinIvPercentage && newNickname != oldNickname && - session.LogicSettings.RenameAboveIv) + // If "RenameOnlyAboveIv" = true only rename pokemon with IV over "KeepMinIvPercentage" + // Favorites will be skipped + if ((!session.LogicSettings.RenameOnlyAboveIv || perfection >= session.LogicSettings.KeepMinIvPercentage) && newNickname != oldNickname && pokemon.Favorite == 0) { await session.Client.Inventory.NicknamePokemon(pokemon.Id, newNickname);