Open UnderscorePoY opened 4 years ago
I'm fairly sure that the AI in general assumes that SetEnemyTurn has been prepared, meaning that the problem here is Conversion2, not Encore?
Wondering if the documentation from https://github.com/pret/pokecrystal/pull/656 fixed this originally
Documented in #936, awaiting on a fix
File :
engine/battle/ai/scoring.asm
(linked to Draft Pull Request #784)The raw call to
CheckTypeMatchup
might have some oversights.Contrarily to the general comment of this routine, since
wEnemyMoveStruct
is populated with the last player move, this will be used properly inCheckTypeMatchup
(putting it ina
is indeed not how to use the matchup routine, but it is irrelevant in that case).However, if the AI flow can lead to this clause being called with a
hBattleTurn
set to 0, the type matchup will consider the player types instead of the enemy types.AI layers which can cause this oversight if called before
AI_Smart_Encore
(withouthBattleTurn
being set back to 1 unvoluntarily) :AI_Smart_Conversion2
hBattleTurn
, etc.AI layers which unvoluntarily avoid this oversight (by setting
hBattleTurn
to 1) :AI_Types
(SuperNerd, Juggler, ExecutiveM/F, PokefanM/F).AI_Status
reaching the.typeimmunity
jump label.AI_Smart_LeechHit
.AI_Smart_LockOn
when the player isn't locked on.AI_Smart_Mimic
when player used a move & enemy HP > 50%.AI_Smart_PriorityHit
when the enemy is slower or speedtied and the player is not using Fly or Dig.AI_Smart_HiddenPower
.Example (not encoutered in vanilla) :
Mud-Slap
.SMART_AI
Raichu withConversion2, Encore
in that order (any other moves before or after).AI_Smart_Conversion2
layer. It will see Ho-Oh as immune to Mud-Slap and consider this matchup its. ThusEncore
is 72% greatly encouraged (-2 score) despite Mud-Slap being super-effective against Raichu.