Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve wild encounter handling #86

Merged
merged 8 commits into from
Feb 9, 2022

Conversation

Drakansoul
Copy link
Contributor

This PR is intended to resolve the issue of only the first Pokemon being shown when in a wild encounter.
The code used by the wild encounter system is shared by the trainer battle system and as such this PR changes the naming to highlight that fact.
As this is the case, this PR should also resolve the outstanding requests raised in #36.

There are some scenarios (Eterna Forest with Cheryl) where wild
encounters may contain more than one wild pokemon. This solution needs
some polish as I'm unfamilair with the codebase.
The wild encounter list is now only populated with pokemon in the
battle. Empty pokemon entries are not added to the list.
The party list is iterated through to cull any empty slots that would
otherwise be present as well as providing the species of the pokemon
before requiring the user to drill down.
The wild objects used in bdsp are shared by both random encounters as
well as trainer battles. In order to highlight this, the use of wild in
several places was replaced with encounter.
Copy link
Owner

@zaksabeast zaksabeast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

The improvement to show shiny status in the list is great.

The changes I'm requesting will make the view more generic. Once this PR is merged, I'll use it for the other games and remove the party list view.

libs/csight-core/src/bdsp/read.rs Outdated Show resolved Hide resolved
src/views/bdsp/encounter-list-view.hpp Outdated Show resolved Hide resolved
src/views/bdsp/encounter-list-view.hpp Outdated Show resolved Hide resolved
src/views/bdsp/main-view.hpp Outdated Show resolved Hide resolved
This change is to facilitate generalized pokemon parsing in order to
improve standardization and reusability of code.
@zaksabeast
Copy link
Owner

Just to be clear, I don't expect you to replace the party view for all games; that's outside the scope of this PR. I can do that later.

Unified pokemon list implemented and applied to both encounter lsits as
well as the party.
The filtering was implemented to solve the problem of empty stots being
hown in the list view, this has been resolved with the addition of the
count parameter.
Player party count added to support pokemon list view changes
@Drakansoul
Copy link
Contributor Author

Issues should be resolved.
Party count was also implemented.

Copy link
Owner

@zaksabeast zaksabeast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@zaksabeast zaksabeast merged commit d4250cb into zaksabeast:main Feb 9, 2022
@zaksabeast
Copy link
Owner

zaksabeast commented Feb 9, 2022

After reading the issue mentioned in the original post (#36), I'm going to keep it opened since it isn't fully resolved:

  • This PR addresses bdsp, but the original issue was for swsh
  • Part of the issue was to show Pokemon weaknesses, which was added originally, but was not added during the CaptureSight rewrite

I should probably open a new issue to address the second point and separate the two.

However this PR did help get it closer to being closed!

@Drakansoul Drakansoul deleted the wild-encounter-duo branch February 9, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants