Fixes Dynamic Moves types in SumScreen while in Battle (#6145)
This commit is contained in:
parent
89cfd85b8f
commit
c5c22a0005
@ -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))
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user