This commit is contained in:
Llinos Evans 2025-07-25 17:31:12 +01:00
parent 178cfd2f2d
commit 919250bd73
67 changed files with 94 additions and 1035 deletions

View file

@ -387,8 +387,6 @@ AI_Smart_EffectHandlers:
dbw EFFECT_SOLARBEAM, AI_Smart_Solarbeam
dbw EFFECT_THUNDER, AI_Smart_Thunder
dbw EFFECT_FLY, AI_Smart_Fly
dbw EFFECT_SURF, AI_Smart_Surf
dbw EFFECT_WHIRLPOOL, AI_Smart_Whirlpool
db -1 ; end
AI_Smart_Sleep:
@ -1139,19 +1137,15 @@ AI_Smart_SpDefenseUp2:
ret
AI_Smart_Fly:
; Fly, Dig, Dive, Bounce
; Fly, Dig
; Greatly encourage this move if the player is
; flying or underground, and slower than the enemy.
ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .player_hidden
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
ret z
.player_hidden
call AICompareSpeed
ret nc
@ -1643,13 +1637,10 @@ AI_Smart_PriorityHit:
call AICompareSpeed
ret c
; Dismiss this move if the player is flying, underwater, or underground.
; Dismiss this move if the player is flying or underground.
ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jp nz, AIDiscourageMove
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
jp nz, AIDiscourageMove
; Greatly encourage this move if it will KO the player.
ld a, 1
@ -1672,31 +1663,6 @@ AI_Smart_PriorityHit:
dec [hl]
dec [hl]
ret
AI_Smart_Surf:
AI_Smart_Whirlpool:
; Greatly encourage this move if the player is underwater and the enemy is faster.
ld a, [wLastPlayerCounterMove]
ld bc, WATER_SPORT
call CompareMove
ret nz
ld a, [wPlayerSubStatus4]
bit SUBSTATUS_UNDERWATER, a
jr z, .could_dive
call AICompareSpeed
ret nc
dec [hl]
dec [hl]
ret
.could_dive
; Try to predict if the player will use Dive this turn.
; 50% chance to encourage this move if the enemy is slower than the player.
call AICompareSpeed
ret c
call AI_50_50
ret c
dec [hl]
ret
AI_Smart_Thief:
; Don't use Thief unless it's the only move available.
@ -2667,19 +2633,15 @@ AI_Smart_Gust:
AI_Smart_FutureSight:
; Greatly encourage this move if the player is
; flying, underwater, or underground, and slower than the enemy.
; flying or underground, and slower than the enemy.
call AICompareSpeed
ret nc
ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jr nz, .player_hidden
ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_UNDERWATER
ret z
.player_hidden
dec [hl]
dec [hl]
ret