-Foolproofed the ability checks in ABILITYEFFECT_ON_WEATHER and ABILITYEFFECT_ON_TERRAIN
-Made BattleScript_OverworldWeatherStarts and BattleScript_OverworldTerrain call the battle scripts that handle weather form changes, weather abilities, terrain seeds and terrain abilities.
-Consequentially, I removed the activation for weather and terrain abilities that I added to TryDoEventsBeforeFirstTurn, and the activation of Protosynthesis in ABILITYEFFECT_ON_SWITCHIN.
-Added a weatherAbilityDone to prevent abilities that lack self-checks like Protosynthesis from getting stuck in a loop.
-Removed now pointless ABILITYEFFECT_WEATHER_FORM. I think Duke/Sneed69 added it to fix Castform's form change, but it no longer serves a purpose.
-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.
Mimicry is now a proud member of ABILITYEFFECT_ON_TERRAIN.
Misc. changes:
-Ditched the dependency on and usage of gBattlerAttacker for the effects inside ABILITYEFFECT_ON_WEATHER and ABILITYEFFECT_ON_TERRAIN.
-Made Cmd_switchineffects activate ABILITYEFFECT_ON_TERRAIN to take into account overworld weather-induced field terrains.
-Updated the text strings printed by the battle scripts inside the aforementioned AbilityBattleEffects caseIDs.
-Removed constant label of unused VARIOUS_TRY_TO_APPLY_MIMICRY which I forgot about.
-Updated ChangeTypeBasedOnTerrain, partly as a result of the aforementioned changes but also for optimization purposes.
-There was never a reason to establish an empty scope, or to use GET_MOVE_TYPE and the variables that complemented it.
-Removed case ABILITY_QUARK_DRIVE from AbilityBattleEffects' case ABILITYEFFECT_ON_SWITCHIN.
A new, probably better way to handle the announcement trigger that abilities such as Protosynthesis and Quark Drive have, when the battle weather or the field terrain change.
Misc. changes:
-EFFECT_DAMAGE_SET_TERRAIN -> EFFECT_HIT_SET_REMOVE_TERRAIN
-It's more appropriate as the effect can be used to force set a terrain or simply to remove an active terrain, after all.
-The main reason for the rename was the inconsistency with the battle script's label.
-Reverted accidentally committed change to B_DOUBLE_WILD_CHANCE, performed back in c8abf00c.
-Removed BattleScript_WindRiderActivatesEnd2
-Tweaked the condition of Wind Power in AbilityBattleEffects
-Renamed ApplySupremeOverlordModifier to GetSupremeOverlordModifier
-Renamed TryActivateWindRiderLoop to BattleScript_TryTailwindAbilitiesLoop
-Modified how it handles the check for Wind Rider by using a various and incorporated Wind Power into the mix because that ability is affected by Tailwind as well.
Anger Shell:
-Made it print a string from the gStatDownStringIds table while lowering Def and Sp. Def
-Made it use the shiny new modifybattlerstatstage macro.
-Made it activate multiple times per battle, as it should.
Well-Baked Body:
-Turned it into an absorbing ability.
Wind Rider:
-Turned it into an absorbing ability.
-For its Tailwind interaction, I made it activate only when Tailwind kicks in successfully, instead of whenever it's active at the end of a turn.
Guard Dog:
-Updated its check inside BattleScript_EffectHitEscape.
-Moved it from Cmd_forcerandomswitch to BattleScript_EffectRoar.
Wind Power:
-Split off its move end effect from Electromorphosis'.
Electromorphosis:
-Split off its move end effect from Wind Power's.
Hadron Engine:
-Merged its Switch In effect with Electric Surge's.
Protosynthesis:
-Fixed its stat boost.
Quark Drive:
-Fixed its stat boost.
Cud Chew:
-Updated its ENDTURN effect's berry check.
Supreme Overlord:
-Tweaked the looping i variable's data type, the order of the variables and the checks inside ApplySupremeOverlordModifier.
Earth Eater:
-Turned it into an absorbing ability.
Misc changes:
-Added a variable to set the amount of stat stages raised inside AbilityMoveEffects' case ABILITYEFFECT_ABSORBING.
-Added a preproc config to update the text string that they print.
-Limited the scope of atkHighestStat and defHighestStat in CalcMoveBasePowerAfterModifiers to Protosynthesis's and Quark Drive's effects.