Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified BizHawk/ExternalTools/Pokebot.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Factories/BotFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public static IBot Create(BotCode code, ApiContainer apiContainer, GameVersion g
return new LegendaryBot(apiContainer, gameVersion);
case BotCode.PokeFinder:
return new PokeFinderBot(apiContainer, gameVersion);
case BotCode.Eevee:
return new EeveeBot(apiContainer, gameVersion);
case BotCode.PickupPokemon:
return new PickupPokemonBot(apiContainer, gameVersion);
case BotCode.Fishing:
return new FishingBot(apiContainer, gameVersion);
}
Expand Down
36 changes: 0 additions & 36 deletions src/Factories/Bots/EeveeBot.cs

This file was deleted.

51 changes: 51 additions & 0 deletions src/Factories/Bots/PickupPokemonBot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using BizHawk.Client.Common;
using Pokebot.Exceptions;
using Pokebot.Factories.Versions;
using Pokebot.Models;
using Pokebot.Models.Player;
using Pokebot.Models.Pokemons;
using System.Linq;

namespace Pokebot.Factories.Bots
{
public class PickupPokemonBot : StaticBot
{
public PickupPokemonBot(ApiContainer apiContainer, GameVersion gameVersion) : base(apiContainer, gameVersion)
{

}

private int _startPartySize = 0;

public override void Start()
{
var partySize = GameVersion.Memory.GetPartyCount();
if (partySize >= 6)
{
throw new BotException(Messages.BotPickupPokemon_PartyFull);
}

_startPartySize = partySize;

base.Start();
}

public override void Execute(PlayerData playerData, GameState state)
{
if (GameVersion.Memory.GetPartyCount() > _startPartySize)
{
Pokemon pokemon = GameVersion.Memory.GetParty().Last();
Check(pokemon);
}
else
{
APIContainer.Joypad.Set("A", true);
}
}

protected override string GetSaveStateName()
{
return $"{GameVersion.VersionInfo.Name}_pickup_pokemon";
}
}
}
2 changes: 1 addition & 1 deletion src/Factories/Bots/StaticBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public StaticBot(ApiContainer apiContainer, GameVersion gameVersion)
Control.FilterPanel.SetShinyHackVisible(gameVersion.Memory.CanSetShiny());
}

public void Start()
public virtual void Start()
{
Enabled = true;
StateChanged?.Invoke(Enabled);
Expand Down
9 changes: 9 additions & 0 deletions src/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Messages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
<data name="BotFactory_NotSupported" xml:space="preserve">
<value>Bot type is not supported</value>
</data>
<data name="BotPickupPokemon_PartyFull" xml:space="preserve">
<value>Your party is full. You need at least 1 empty slot to use this bot.</value>
</data>
<data name="BotPokeFinder_InvalidFrame" xml:space="preserve">
<value>This frame has already passed. Save the game and reload it (without save state).</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Config/BotCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public enum BotCode
Spin = 1,
Static = 2,
PokeFinder = 3,
Eevee = 4,
PickupPokemon = 4,
Fishing = 5,
}
}
4 changes: 2 additions & 2 deletions src/Pokebot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<PropertyGroup>
<Version>2.0.4</Version>
<Version>2.0.5</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>2.0.4</FileVersion>
<FileVersion>2.0.5</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release' ">
<VersionSuffix>release</VersionSuffix>
Expand Down
4 changes: 2 additions & 2 deletions src/appconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"Supported": [ 0, 1, 2, 3, 4, 5, 6, 7 ]
},
{
"Name": "Eevee",
"Name": "Pickup Pokemon",
"Code": 4,
"Supported": [ 3, 4 ]
"Supported": [ 0, 1, 2, 3, 4, 5, 6, 7 ]
},
{
"Name": "Fishing",
Expand Down
Loading