Skip to content

Commit

Permalink
fix LevelUpPokemonTask
Browse files Browse the repository at this point in the history
  • Loading branch information
keinPlan committed Jul 31, 2016
1 parent a45d81a commit c1db967
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
30 changes: 28 additions & 2 deletions PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -215,7 +230,18 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down Expand Up @@ -271,4 +297,4 @@ foreach (var item in filesToCleanup)
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
15 changes: 6 additions & 9 deletions PoGo.NecroBot.Logic/Tasks/LevelUpPokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ internal class LevelUpPokemonTask
{
public static async Task Execute(ISession session, CancellationToken cancellationToken)
{
if (DisplayPokemonStatsTask.PokemonId.Count == 0 || DisplayPokemonStatsTask.PokemonIdcp.Count == 0)
{
return;
}
if (await session.Inventory.GetStarDust() <= session.LogicSettings.GetMinStarDustForLevelUp)
{
return;
}
if (session.LogicSettings.LevelUpByCPorIv.ToLower().Contains("iv"))

if (session.LogicSettings.LevelUpByCPorIv.ToLower().Contains("iv") && DisplayPokemonStatsTask.PokemonId.Count != 0)
{
for (int i = 0; i < session.LogicSettings.AmountOfTimesToUpgradeLoop; i++)
{
Expand Down Expand Up @@ -53,11 +50,11 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
break;
}
}

}
else if (session.LogicSettings.LevelUpByCPorIv.ToLower().Contains("cp"))
else if (session.LogicSettings.LevelUpByCPorIv.ToLower().Contains("cp") && DisplayPokemonStatsTask.PokemonIdcp.Count != 0)
{

for (int i = 0; i < session.LogicSettings.AmountOfTimesToUpgradeLoop; i++)
{
var rand = new Random();
Expand Down Expand Up @@ -87,7 +84,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
break;
}
}

}
}
}
Expand Down

0 comments on commit c1db967

Please sign in to comment.