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

Mega evolution may change order #1914

Closed
wants to merge 13 commits into from
Closed

Mega evolution may change order #1914

wants to merge 13 commits into from

Conversation

kleeenexfeu
Copy link

@kleeenexfeu kleeenexfeu commented Nov 17, 2021

#535 raises a problem with mega evolution.
This PR should solve it.

EDIT: After several tests, this works the intended way. However, it may be interesting ti include other turn order calculation in this PR. For example:
-Weather is sandstorm, double battle, start of a turn
-Cacturn' sand rush is active
-One mon switches-out/another switches in, with drizzle
-Drizzle is triggered, sand rush shouldn't be considered this turn, but with the current system it is, because an action during the battle phase changed the turn order, but it wasn't recalculated.

Same logic can be applied with tailwind used in double battles, and possibly other scenari I haven't thought about.

This is a change brought in gen 8. Should this be done in another PR?

@LOuroboros
Copy link
Collaborator

LOuroboros commented Nov 17, 2021

And if the behavior in gen6 is seen as a feature as opposed to a bug, we can add a config

Yeah, that's actually the whole point of the Issue ticket you just linked. To add a config so the user can choose their preferred Mega Evolution turn order behavior; Gen. 6's or Gen. 7's 👀

@@ -104,6 +104,7 @@ static void RunTurnActionsFunctions(void);
static void SetActionsAndBattlersTurnOrder(void);
static void sub_803CDF8(void);
static bool8 AllAtActionConfirmed(void);
static void CheckIfTurnOrderMustChangeAfterMega(void)

Choose a reason for hiding this comment

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

Suggested change
static void CheckIfTurnOrderMustChangeAfterMega(void)
static void CheckIfTurnOrderMustChangeAfterMega(void);

@@ -92,6 +92,9 @@
#define GEN_8 5
#endif

// Mega Evolution settings
#define B_MEGA_INFO_CHANGE_ORDER GEN_7 // In gen6, mega evolving doesn't change the turn order the turn you mega evolve. This is fixed in gen 7
Copy link
Collaborator

@LOuroboros LOuroboros Nov 17, 2021

Choose a reason for hiding this comment

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

Suggested change
#define B_MEGA_INFO_CHANGE_ORDER GEN_7 // In gen6, mega evolving doesn't change the turn order the turn you mega evolve. This is fixed in gen 7
#define B_MEGA_EVOLUTION_TURN_ORDER GEN_7 // In Gen7, a Pokémon's Speed after Mega Evolution is used to determine turn order, not its Speed before.

@@ -4687,7 +4688,39 @@ static void CheckMegaEvolutionBeforeTurn(void)
}
}
}
if (B_MEGA_EVO_CHANGE_ORDER <= GEN_6)
Copy link
Collaborator

@LOuroboros LOuroboros Nov 17, 2021

Choose a reason for hiding this comment

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

Suggested change
if (B_MEGA_EVO_CHANGE_ORDER <= GEN_6)
if (B_MEGA_EVOLUTION_TURN_ORDER <= GEN_6)

AsparagusEduardo pushed a commit that referenced this pull request Aug 31, 2023
Added newer decomp projects to readme
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.

3 participants