Merge pull request #962 from GriffinRichards/bug-aiweather

Note AI weather bug
This commit is contained in:
Diegoisawesome 2020-01-22 20:42:18 -08:00 committed by GitHub
commit 53eb1ecf2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -743,7 +743,7 @@ AI_CheckViability:
if_effect EFFECT_MIRROR_COAT, AI_CV_MirrorCoat if_effect EFFECT_MIRROR_COAT, AI_CV_MirrorCoat
if_effect EFFECT_SKULL_BASH, AI_CV_ChargeUpMove if_effect EFFECT_SKULL_BASH, AI_CV_ChargeUpMove
if_effect EFFECT_SOLARBEAM, AI_CV_ChargeUpMove if_effect EFFECT_SOLARBEAM, AI_CV_ChargeUpMove
if_effect EFFECT_SEMI_INVULNERABLE, AI_CV_Fly if_effect EFFECT_SEMI_INVULNERABLE, AI_CV_SemiInvulnerable
if_effect EFFECT_SOFTBOILED, AI_CV_Heal if_effect EFFECT_SOFTBOILED, AI_CV_Heal
if_effect EFFECT_FAKE_OUT, AI_CV_FakeOut if_effect EFFECT_FAKE_OUT, AI_CV_FakeOut
if_effect EFFECT_SPIT_UP, AI_CV_SpitUp if_effect EFFECT_SPIT_UP, AI_CV_SpitUp
@ -2317,48 +2317,51 @@ AI_CV_ChargeUpMove_ScoreDown2:
AI_CV_ChargeUpMove_End: AI_CV_ChargeUpMove_End:
end end
AI_CV_Fly: AI_CV_SemiInvulnerable:
if_doesnt_have_move_with_effect AI_TARGET, EFFECT_PROTECT, AI_CV_Fly2 if_doesnt_have_move_with_effect AI_TARGET, EFFECT_PROTECT, AI_CV_SemiInvulnerable2
score -1 score -1
goto AI_CV_Fly_End goto AI_CV_SemiInvulnerable_End
AI_CV_Fly2: @ BUG: The scripts for checking type-resistance to weather for semi-invulnerable moves are swapped
if_status AI_TARGET, STATUS1_TOXIC_POISON, AI_CV_Fly6 @ The result is that the AI is encouraged to stall while taking damage from weather
if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_Fly6 @ To fix, swap _CheckSandstormTypes/_CheckIceType in the below script
if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_Fly6 AI_CV_SemiInvulnerable2:
if_status AI_TARGET, STATUS1_TOXIC_POISON, AI_CV_SemiInvulnerable_TryEncourage
if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_SemiInvulnerable_TryEncourage
if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_SemiInvulnerable_TryEncourage
get_weather get_weather
if_equal AI_WEATHER_HAIL, AI_CV_Fly3 if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckSandstormTypes
if_equal AI_WEATHER_SANDSTORM, AI_CV_Fly4 if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckIceType
goto AI_CV_Fly5 goto AI_CV_SemiInvulnerable5
AI_CV_Fly3: AI_CV_SemiInvulnerable_CheckSandstormTypes:
get_user_type1 get_user_type1
if_in_bytes AI_CV_Fly_TypesToEncourage, AI_CV_Fly6 if_in_bytes AI_CV_SandstormResistantTypes, AI_CV_SemiInvulnerable_TryEncourage
get_user_type2 get_user_type2
if_in_bytes AI_CV_Fly_TypesToEncourage, AI_CV_Fly6 if_in_bytes AI_CV_SandstormResistantTypes, AI_CV_SemiInvulnerable_TryEncourage
goto AI_CV_Fly5 goto AI_CV_SemiInvulnerable5
AI_CV_Fly4: AI_CV_SemiInvulnerable_CheckIceType:
get_user_type1 get_user_type1
if_equal TYPE_ICE, AI_CV_Fly6 if_equal TYPE_ICE, AI_CV_SemiInvulnerable_TryEncourage
get_user_type2 get_user_type2
if_equal TYPE_ICE, AI_CV_Fly6 if_equal TYPE_ICE, AI_CV_SemiInvulnerable_TryEncourage
AI_CV_Fly5: AI_CV_SemiInvulnerable5:
if_target_faster AI_CV_Fly_End if_target_faster AI_CV_SemiInvulnerable_End
get_last_used_bank_move AI_TARGET get_last_used_bank_move AI_TARGET
get_move_effect_from_result get_move_effect_from_result
if_not_equal EFFECT_LOCK_ON, AI_CV_Fly6 if_not_equal EFFECT_LOCK_ON, AI_CV_SemiInvulnerable_TryEncourage
goto AI_CV_Fly_End goto AI_CV_SemiInvulnerable_End
AI_CV_Fly6: AI_CV_SemiInvulnerable_TryEncourage:
if_random_less_than 80, AI_CV_Fly_End if_random_less_than 80, AI_CV_SemiInvulnerable_End
score +1 score +1
AI_CV_Fly_End: AI_CV_SemiInvulnerable_End:
end end
AI_CV_Fly_TypesToEncourage: AI_CV_SandstormResistantTypes:
.byte TYPE_GROUND .byte TYPE_GROUND
.byte TYPE_ROCK .byte TYPE_ROCK
.byte TYPE_STEEL .byte TYPE_STEEL