From 24b5a5709a999facdfd7e10cd97f737fd1a72905 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 10 Jan 2022 23:01:18 -0300 Subject: [PATCH] Allow Galarian Darmanitan's Zen Mode to work --- include/constants/battle_config.h | 96 ++++++++++++++++--------------- src/battle_util.c | 36 ++++++------ 2 files changed, 68 insertions(+), 64 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 6662f261f..8f56ac871 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -5,53 +5,55 @@ // Species with peculiar battle effects. #ifndef POKEMON_EXPANSION - #define SPECIES_DIALGA 0 - #define SPECIES_PALKIA 0 - #define SPECIES_GIRATINA 0 - #define SPECIES_CHERRIM 0 - #define SPECIES_ARCEUS 0 - #define SPECIES_SILVALLY 0 - #define SPECIES_GENESECT 0 - #define SPECIES_AEGISLASH 0 - #define SPECIES_AEGISLASH_BLADE 10000 - #define SPECIES_MIMIKYU 0 - #define SPECIES_MIMIKYU_BUSTED 10001 - #define SPECIES_DARMANITAN 0 - #define SPECIES_DARMANITAN_ZEN_MODE 10002 - #define SPECIES_MINIOR_CORE_RED 0 - #define SPECIES_MINIOR 10003 - #define SPECIES_MINIOR_CORE_BLUE 0 - #define SPECIES_MINIOR_METEOR_BLUE 10004 - #define SPECIES_MINIOR_CORE_GREEN 0 - #define SPECIES_MINIOR_METEOR_GREEN 10005 - #define SPECIES_MINIOR_CORE_INDIGO 0 - #define SPECIES_MINIOR_METEOR_INDIGO 10006 - #define SPECIES_MINIOR_CORE_ORANGE 0 - #define SPECIES_MINIOR_METEOR_ORANGE 10007 - #define SPECIES_MINIOR_CORE_VIOLET 0 - #define SPECIES_MINIOR_METEOR_VIOLET 10008 - #define SPECIES_MINIOR_CORE_YELLOW 0 - #define SPECIES_MINIOR_METEOR_YELLOW 10009 - #define SPECIES_WISHIWASHI 0 - #define SPECIES_WISHIWASHI_SCHOOL 10010 - #define SPECIES_ZYGARDE 0 // 50% - #define SPECIES_ZYGARDE_10 10011 // 10 % - #define SPECIES_ZYGARDE_COMPLETE 10012 // 100 % - #define SPECIES_BURMY 0 - #define SPECIES_BURMY_SANDY_CLOAK 10013 - #define SPECIES_BURMY_TRASH_CLOAK 10014 - #define SPECIES_CRAMORANT 0 - #define SPECIES_CRAMORANT_GORGING 10015 - #define SPECIES_CRAMORANT_GULPING 10016 - #define SPECIES_GRENINJA_BATTLE_BOND 0 - #define SPECIES_GRENINJA_ASH 10017 - #define SPECIES_HOOPA 0 - #define SPECIES_HOOPA_UNBOUND 10018 - #define SPECIES_MELOETTA 0 - #define SPECIES_MELOETTA_PIROUETTE 10019 - #define SPECIES_MORPEKO 0 - #define SPECIES_MORPEKO_HANGRY 10020 - #define SPECIES_SIRFETCHD 10021 + #define SPECIES_DIALGA 0 + #define SPECIES_PALKIA 0 + #define SPECIES_GIRATINA 0 + #define SPECIES_CHERRIM 0 + #define SPECIES_ARCEUS 0 + #define SPECIES_SILVALLY 0 + #define SPECIES_GENESECT 0 + #define SPECIES_AEGISLASH 0 + #define SPECIES_AEGISLASH_BLADE 10000 + #define SPECIES_MIMIKYU 0 + #define SPECIES_MIMIKYU_BUSTED 10001 + #define SPECIES_DARMANITAN 0 + #define SPECIES_DARMANITAN_ZEN_MODE 10002 + #define SPECIES_MINIOR_CORE_RED 0 + #define SPECIES_MINIOR 10003 + #define SPECIES_MINIOR_CORE_BLUE 0 + #define SPECIES_MINIOR_METEOR_BLUE 10004 + #define SPECIES_MINIOR_CORE_GREEN 0 + #define SPECIES_MINIOR_METEOR_GREEN 10005 + #define SPECIES_MINIOR_CORE_INDIGO 0 + #define SPECIES_MINIOR_METEOR_INDIGO 10006 + #define SPECIES_MINIOR_CORE_ORANGE 0 + #define SPECIES_MINIOR_METEOR_ORANGE 10007 + #define SPECIES_MINIOR_CORE_VIOLET 0 + #define SPECIES_MINIOR_METEOR_VIOLET 10008 + #define SPECIES_MINIOR_CORE_YELLOW 0 + #define SPECIES_MINIOR_METEOR_YELLOW 10009 + #define SPECIES_WISHIWASHI 0 + #define SPECIES_WISHIWASHI_SCHOOL 10010 + #define SPECIES_ZYGARDE 0 // 50% + #define SPECIES_ZYGARDE_10 10011 // 10 % + #define SPECIES_ZYGARDE_COMPLETE 10012 // 100 % + #define SPECIES_BURMY 0 + #define SPECIES_BURMY_SANDY_CLOAK 10013 + #define SPECIES_BURMY_TRASH_CLOAK 10014 + #define SPECIES_CRAMORANT 0 + #define SPECIES_CRAMORANT_GORGING 10015 + #define SPECIES_CRAMORANT_GULPING 10016 + #define SPECIES_GRENINJA_BATTLE_BOND 0 + #define SPECIES_GRENINJA_ASH 10017 + #define SPECIES_HOOPA 0 + #define SPECIES_HOOPA_UNBOUND 10018 + #define SPECIES_MELOETTA 0 + #define SPECIES_MELOETTA_PIROUETTE 10019 + #define SPECIES_MORPEKO 0 + #define SPECIES_MORPEKO_HANGRY 10020 + #define SPECIES_SIRFETCHD 10021 + #define SPECIES_DARMANITAN_GALARIAN 0 + #define SPECIES_DARMANITAN_ZEN_MODE_GALARIAN 10022 #endif // Items with peculiar battle effects. diff --git a/src/battle_util.c b/src/battle_util.c index b293b9a5e..491c117ab 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3969,6 +3969,7 @@ static bool32 ShouldChangeFormHpBased(u32 battler) {ABILITY_SCHOOLING, SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI, 4}, {ABILITY_GULP_MISSILE, SPECIES_CRAMORANT, SPECIES_CRAMORANT_GORGING, 2}, {ABILITY_GULP_MISSILE, SPECIES_CRAMORANT, SPECIES_CRAMORANT_GULPING, 1}, + {ABILITY_ZEN_MODE, SPECIES_DARMANITAN_GALARIAN, SPECIES_DARMANITAN_ZEN_MODE_GALARIAN, 2}, }; u32 i; @@ -9350,23 +9351,24 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; static const u16 species[][3] = { - // Changed Form ID Default Form ID Should change on switch - {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU, FALSE}, - {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND, FALSE}, - {SPECIES_MELOETTA_PIROUETTE, SPECIES_MELOETTA, FALSE}, - {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH, TRUE}, - {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN, TRUE}, - {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED, TRUE}, - {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE, TRUE}, - {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN, TRUE}, - {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO, TRUE}, - {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE, TRUE}, - {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET, TRUE}, - {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW, TRUE}, - {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI, TRUE}, - {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT, TRUE}, - {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT, TRUE}, - {SPECIES_MORPEKO_HANGRY, SPECIES_MORPEKO, TRUE}, + // Changed Form ID Default Form ID Should change on switch + {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU, FALSE}, + {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND, FALSE}, + {SPECIES_MELOETTA_PIROUETTE, SPECIES_MELOETTA, FALSE}, + {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH, TRUE}, + {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN, TRUE}, + {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED, TRUE}, + {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE, TRUE}, + {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN, TRUE}, + {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO, TRUE}, + {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE, TRUE}, + {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET, TRUE}, + {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW, TRUE}, + {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI, TRUE}, + {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT, TRUE}, + {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT, TRUE}, + {SPECIES_MORPEKO_HANGRY, SPECIES_MORPEKO, TRUE}, + {SPECIES_DARMANITAN_ZEN_MODE_GALARIAN, SPECIES_DARMANITAN_GALARIAN, TRUE}, }; currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL);