-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Mega evolution may change order #1914
Conversation
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 👀 |
src/battle_main.c
Outdated
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static void CheckIfTurnOrderMustChangeAfterMega(void) | |
static void CheckIfTurnOrderMustChangeAfterMega(void); |
include/constants/battle_config.h
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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. |
src/battle_main.c
Outdated
@@ -4687,7 +4688,39 @@ static void CheckMegaEvolutionBeforeTurn(void) | |||
} | |||
} | |||
} | |||
if (B_MEGA_EVO_CHANGE_ORDER <= GEN_6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (B_MEGA_EVO_CHANGE_ORDER <= GEN_6) | |
if (B_MEGA_EVOLUTION_TURN_ORDER <= GEN_6) |
Added newer decomp projects to readme
#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?