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

Trainer Battle Parameter Consolidation #5982

Open
wants to merge 8 commits into
base: upcoming
Choose a base branch
from

Conversation

u8-Salem
Copy link

@u8-Salem u8-Salem commented Jan 9, 2025

Consolidates almost all global trainer battle parameter into a global struct

Description

Introduces gTrainerBattleParameter a union of type TrainerBattleParameter. the struct holds most relevant parameter.
the trainerbattle macro was changed to always take all parameters and copy them to the struct, instead of taking parameters depending on battle type.

changed TRAINER_BATTLE_SET_TRAINER_A/B to TRAINER_BATTLE_SET_TRAINERS_FOR_MULTI_BATTLE which takes both trainers always. for 2v1 multi battles leave the second trainer als TRAINER_NONE and NULL for the defeat text.

this PR does NOT handle:

this is part of #5938, which I decided to split into smaller prs. this PR does not do anything but consolidate the parameter.

Things to note in the release changelog:

Breaking: raw uses of trainerbattle need to be adjusted to provide all possible parameter. Unused parameter musst be 0 or an alias. already parameterized macros like trainerbattle_single work out of the box.

Discord contact info

u8-Salem

@u8-Salem u8-Salem marked this pull request as ready for review January 9, 2025 11:33
src/battle_setup.c Outdated Show resolved Hide resolved
src/scrcmd.c Outdated Show resolved Hide resolved
@u8-Salem
Copy link
Author

u8-Salem commented Jan 9, 2025

ready for review again

@AlexOn1ine
Copy link
Collaborator

is there anything to watch out with this. anything that you suspect might be broken?

@u8-Salem
Copy link
Author

is there anything to watch out with this. anything that you suspect might be broken?

id say the less common battle types need some testing for sure. rematches, multi, facility etc.
I tested all of those except ereader and secret base already but some more cant hurt.

also some battles that have scripts running after them to make sure those arent broken.

@Pawkkie Pawkkie added the type: big feature A feature with big diffs and / or high impact / subjectivity / pervasiveness label Jan 13, 2025
@AlexOn1ine AlexOn1ine self-assigned this Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: big feature A feature with big diffs and / or high impact / subjectivity / pervasiveness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants