From c5c22a0005e2317d37667e7458d1431074457206 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Fri, 31 Jan 2025 21:50:26 +0100 Subject: [PATCH] Fixes Dynamic Moves types in SumScreen while in Battle (#6145) --- src/battle_main.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 5028a02e33..43bc13277b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5844,11 +5844,12 @@ u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) u32 moveType = gMovesInfo[move].type; u32 moveEffect = gMovesInfo[move].effect; u32 species, heldItem, holdEffect, ability, type1, type2, type3; + bool32 monInBattle = gMain.inBattle && gPartyMenu.menuType != PARTY_MENU_TYPE_IN_BATTLE; if (move == MOVE_STRUGGLE) return TYPE_NORMAL; - if (gMain.inBattle) + if (monInBattle) { species = gBattleMons[battler].species; heldItem = gBattleMons[battler].item; @@ -5872,18 +5873,21 @@ u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) switch (moveEffect) { case EFFECT_WEATHER_BALL: - if (gMain.inBattle && WEATHER_HAS_EFFECT) + if (monInBattle) { - if (gBattleWeather & B_WEATHER_RAIN && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) - return TYPE_WATER; - else if (gBattleWeather & B_WEATHER_SANDSTORM) - return TYPE_ROCK; - else if (gBattleWeather & B_WEATHER_SUN && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) - return TYPE_FIRE; - else if (gBattleWeather & (B_WEATHER_SNOW | B_WEATHER_HAIL)) - return TYPE_ICE; - else - return moveType; + if (WEATHER_HAS_EFFECT) + { + if (gBattleWeather & B_WEATHER_RAIN && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) + return TYPE_WATER; + else if (gBattleWeather & B_WEATHER_SANDSTORM) + return TYPE_ROCK; + else if (gBattleWeather & B_WEATHER_SUN && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) + return TYPE_FIRE; + else if (gBattleWeather & (B_WEATHER_SNOW | B_WEATHER_HAIL)) + return TYPE_ICE; + else + return moveType; + } } else { @@ -5909,7 +5913,7 @@ u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) case EFFECT_HIDDEN_POWER: { u32 typeBits = 0; - if (gMain.inBattle) + if (monInBattle) { typeBits = ((gBattleMons[battler].hpIV & 1) << 0) | ((gBattleMons[battler].attackIV & 1) << 1) @@ -5985,7 +5989,7 @@ u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) else return moveType; case EFFECT_TERRAIN_PULSE: - if (gMain.inBattle) + if (monInBattle) { if (IsBattlerTerrainAffected(battler, STATUS_FIELD_TERRAIN_ANY)) {