Skip to content

Commit

Permalink
Merge pull request #9 from Kakumi/beta
Browse files Browse the repository at this point in the history
Pull Request V1.1.2
  • Loading branch information
Kakumi committed Jan 18, 2024
2 parents 36dba18 + 664cf2a commit a489da1
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 110 deletions.
Binary file modified BizHawk/ExternalTools/Pokebot.dll
Binary file not shown.
11 changes: 8 additions & 3 deletions src/Factories/Bots/PokeFinderBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,17 @@ public void Execute(PlayerData playerData, GameState state)
var pokemon = party[0];
PokemonEncountered?.Invoke(pokemon);
Control.SetPID(pokemon.PID.ToString("X"));
if (pokemon.PID.ToString("X") == Control.GetPID())

var opponent = GameVersion.Memory.GetOpponent();
if (opponent != null)
{
Log.Info(Messages.Pokemon_Found);
PokemonFound?.Invoke(pokemon);
PokemonEncountered?.Invoke(opponent);
Control.SetOpponentPID(opponent.PID.ToString("X"));
}

Log.Info(Messages.Pokemon_Found);
PokemonFound?.Invoke(pokemon);

Stop();
}
}
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 @@ -330,6 +330,9 @@
<data name="Viewer_NotShiny" xml:space="preserve">
<value>Not shiny</value>
</data>
<data name="Viewer_PID" xml:space="preserve">
<value>PID: {0}</value>
</data>
<data name="Viewer_Shiny" xml:space="preserve">
<value>Shiny</value>
</data>
Expand Down
23 changes: 23 additions & 0 deletions src/Panels/PokeFinderControl.Designer.cs

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

10 changes: 10 additions & 0 deletions src/Panels/PokeFinderControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public string GetPID()
return _inputPID.Text;
}

public string GetOpponentPID()
{
return _opponentPID.Text;
}

public void SetInfo(int tid, int sid)
{
_labelTIDSID.Text = string.Format(Messages.BotPokeFinder_TrainerInfo, tid, sid);
Expand Down Expand Up @@ -90,6 +95,11 @@ internal void SetPID(string pid)
_inputPID.Text = pid;
}

internal void SetOpponentPID(string pid)
{
_opponentPID.Text = pid;
}

private void _pokefinderTypesComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (_pokefinderTypesComboBox.SelectedItem is PokeFinderType pokeFinderType)
Expand Down

0 comments on commit a489da1

Please sign in to comment.