mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
More review changes and added lackings
-Removed unnecessary special handling of terrain-inducing overworld weather states from ChangeTypeBasedOnTerrain. -Mimicry now activates normally for terrain-inducing overworld weather states. -Weather abilities now activate normally when switchineffects is called, and at the beginning of a battle. -Terrain abilities now activate normally at the beginning of a battle.
This commit is contained in:
parent
c32f584940
commit
91b2e1bb50
@ -8629,6 +8629,7 @@ BattleScript_TerrainSeedLoop_NextBattler:
|
||||
addbyte gBattlerTarget, 0x1
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TerrainSeedLoopIter
|
||||
restoretarget
|
||||
call BattleScript_ActivateSwitchInAbilities
|
||||
return
|
||||
|
||||
BattleScript_ActivateSwitchInAbilities:
|
||||
|
@ -3720,6 +3720,10 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->switchInAbilitiesCounter++];
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gBattlerAttacker, 0, 0, 0) != 0)
|
||||
return;
|
||||
if (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT && AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, gActiveBattler, 0, 0, 0) != 0)
|
||||
return;
|
||||
if (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY && AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, gActiveBattler, 0, 0, 0) != 0)
|
||||
return;
|
||||
}
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_TRACE1, 0, 0, 0, 0) != 0)
|
||||
return;
|
||||
|
@ -6785,6 +6785,7 @@ static void Cmd_switchineffects(void)
|
||||
gDisableStructs[gActiveBattler].truantSwitchInHack = 0;
|
||||
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0)
|
||||
|| (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT && AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, gActiveBattler, 0, 0, 0))
|
||||
|| (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY && AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, gActiveBattler, 0, 0, 0))
|
||||
|| ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE)
|
||||
|| AbilityBattleEffects(ABILITYEFFECT_TRACE2, 0, 0, 0, 0)
|
||||
|
@ -4298,10 +4298,6 @@ static u8 ForewarnChooseMove(u32 battler)
|
||||
bool8 ChangeTypeBasedOnTerrain(u8 battlerId)
|
||||
{
|
||||
u8 battlerType;
|
||||
u16 terrainFlags = VarGet(VAR_TERRAIN) & STATUS_FIELD_TERRAIN_ANY;
|
||||
|
||||
if (terrainFlags && gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
|
||||
gFieldStatuses = terrainFlags | STATUS_FIELD_TERRAIN_PERMANENT; // terrain is permanent
|
||||
|
||||
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN)
|
||||
battlerType = TYPE_ELECTRIC;
|
||||
|
Loading…
Reference in New Issue
Block a user