From 1a40202ea4691447b326ac2f0519283b05d104df Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 04:46:31 -0500 Subject: [PATCH] Note bug in Foresight AI --- data/battle_ai_scripts.s | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index 6019303df..56be92c5e 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -2057,12 +2057,22 @@ AI_CV_Protect_ScoreDown2: AI_CV_Protect_End: end +@ BUG: Foresight is only encouraged if the user is Ghost type or +@ has high evasion, but should check target instead AI_CV_Foresight: +.ifdef BUGFIX + get_target_type1 + if_equal TYPE_GHOST, AI_CV_Foresight2 + get_target_type2 + if_equal TYPE_GHOST, AI_CV_Foresight2 + if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, AI_CV_Foresight3 +.else get_user_type1 if_equal TYPE_GHOST, AI_CV_Foresight2 get_user_type2 if_equal TYPE_GHOST, AI_CV_Foresight2 if_stat_level_more_than AI_USER, STAT_EVASION, 8, AI_CV_Foresight3 +.endif score -2 goto AI_CV_Foresight_End @@ -2329,13 +2339,13 @@ AI_CV_SemiInvulnerable2: if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_SemiInvulnerable_TryEncourage if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_SemiInvulnerable_TryEncourage get_weather - .ifdef BUGFIX +.ifdef BUGFIX if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckIceType if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckSandstormTypes - .else +.else if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckSandstormTypes if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckIceType - .endif +.endif goto AI_CV_SemiInvulnerable5 AI_CV_SemiInvulnerable_CheckSandstormTypes: @@ -2404,11 +2414,11 @@ AI_CV_Hail_End: @ BUG: Facade score is increased if the target is statused, but should be if the user is AI_CV_Facade: - .ifdef BUGFIX +.ifdef BUGFIX if_not_status AI_USER, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End - .else +.else if_not_status AI_TARGET, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End - .endif +.endif score +1 AI_CV_Facade_End: end