even more ai cleanup

This commit is contained in:
yenatch 2013-05-07 00:58:35 -04:00
parent 573db5b1b4
commit 3a7edf8b1a

View File

@ -391,19 +391,16 @@ AIScoring_Smart: ; 386be
AIScoring_Sleep: ; 387e3 AIScoring_Sleep: ; 387e3
ld b, $8 ld b, EFFECT_DREAM_EATER
call Function_0x392ca call AIHasMove
jr c, .asm_387f0 jr c, .asm_387f0
ld b, $6b ld b, EFFECT_NIGHTMARE
call Function_0x392ca call AIHasMove
ret nc ret nc
.asm_387f0 .asm_387f0
call Function_0x39527 call Function_0x39527
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -413,15 +410,13 @@ AIScoring_Sleep: ; 387e3
AIScoring_LeechHit: ; 387f7 AIScoring_LeechHit: ; 387f7
push hl push hl
ld a, $1 ld a, 1
ld [hBattleTurn], a ld [hBattleTurn], a
ld hl, $47c8 callab Function0x347c8
ld a, $d
rst FarCall
pop hl pop hl
ld a, [$d265] ld a, [$d265]
cp $a cp 10 ; 1.0
jr c, .asm_38815 jr c, .asm_38815
ret z ret z
@ -564,31 +559,24 @@ AIScoring_LockOn: ; 3881d
AIScoring_Explosion: ; 388a6 AIScoring_Explosion: ; 388a6
push hl push hl
ld a, $d callba Function0x349f4
ld hl, $49f4
rst FarCall
pop hl pop hl
jr nc, .asm_388b7 jr nc, .asm_388b7
push hl push hl
call Function_0x38e2e call AICheckLastPlayerMon
pop hl pop hl
jr nz, .asm_388c6 jr nz, .asm_388c6
.asm_388b7 .asm_388b7
call AICheckEnemyHalfHP call AICheckEnemyHalfHP
jr c, .asm_388c6 jr c, .asm_388c6
call AICheckEnemyQuarterHP call AICheckEnemyQuarterHP
ret nc ret nc
call RNG
cp $14 call RNG
cp 20
ret c ret c
.asm_388c6 .asm_388c6
@ -916,9 +904,7 @@ AIScoring_Bide: ; 38a1e
AIScoring_Whirlwind: ; 38a2a AIScoring_Whirlwind: ; 38a2a
push hl push hl
ld hl, $484e callab Function0x3484e
ld a, $d
rst FarCall
ld a, [$c716] ld a, [$c716]
cp $a cp $a
pop hl pop hl
@ -1171,7 +1157,7 @@ AIScoring_SpeedDownHit: ; 38b40
call AICompareSpeed call AICompareSpeed
ret c ret c
call RNG call RNG
cp $1e cp 30
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -1198,7 +1184,7 @@ AIScoring_HyperBeam: ; 38b63
.asm_38b72 .asm_38b72
call RNG call RNG
cp $28 cp 40
ret c ret c
inc [hl] inc [hl]
call Function_0x39527 call Function_0x39527
@ -1725,7 +1711,6 @@ AIScoring_Conversion2: ; 38d98
AIScoring_Disable: ; 38dd1 AIScoring_Disable: ; 38dd1
call AICompareSpeed call AICompareSpeed
jr nc, .asm_38df3 jr nc, .asm_38df3
push hl push hl
@ -1738,8 +1723,7 @@ AIScoring_Disable: ; 38dd1
jr nc, .asm_38dee jr nc, .asm_38dee
call RNG call RNG
cp 100
cp $64
ret c ret c
dec [hl] dec [hl]
ret ret
@ -1751,8 +1735,7 @@ AIScoring_Disable: ; 38dd1
.asm_38df3 .asm_38df3
call RNG call RNG
cp 20
cp $14
ret c ret c
inc [hl] inc [hl]
ret ret
@ -1761,28 +1744,23 @@ AIScoring_Disable: ; 38dd1
AIScoring_MeanLook: ; 38dfb AIScoring_MeanLook: ; 38dfb
call AICheckEnemyHalfHP call AICheckEnemyHalfHP
jr nc, .asm_38e24 jr nc, .asm_38e24
push hl push hl
call Function_0x38e2e call AICheckLastPlayerMon
pop hl pop hl
jp z, AIDiscourageMove jp z, AIDiscourageMove
ld a, [EnemySubStatus5] ld a, [EnemySubStatus5]
bit 0, a bit SUBSTATUS_TOXIC, a
jr nz, .asm_38e26 jr nz, .asm_38e26
ld a, [PlayerSubStatus1] ld a, [PlayerSubStatus1]
and $c9 and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
jr nz, .asm_38e26 jr nz, .asm_38e26
push hl push hl
ld hl, $484e callab Function0x3484e
ld a, $d
rst FarCall
ld a, [$c716] ld a, [$c716]
cp $b cp $b
pop hl pop hl
@ -1794,7 +1772,6 @@ AIScoring_MeanLook: ; 38dfb
.asm_38e26 .asm_38e26
call Function_0x39521 call Function_0x39521
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -1803,7 +1780,7 @@ AIScoring_MeanLook: ; 38dfb
; 38e2e ; 38e2e
Function_0x38e2e: ; 38e2e AICheckLastPlayerMon: ; 38e2e
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
ld c, 0 ld c, 0
@ -1832,7 +1809,6 @@ Function_0x38e2e: ; 38e2e
AIScoring_Nightmare: ; 38e4a AIScoring_Nightmare: ; 38e4a
call Function_0x39527 call Function_0x39527
ret c ret c
dec [hl] dec [hl]
ret ret
@ -1841,7 +1817,7 @@ AIScoring_Nightmare: ; 38e4a
AIScoring_FlameWheel: ; 38e50 AIScoring_FlameWheel: ; 38e50
ld a, [EnemyMonStatus] ld a, [EnemyMonStatus]
bit 5, a bit FRZ, a
ret z ret z
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -1854,34 +1830,30 @@ AIScoring_FlameWheel: ; 38e50
AIScoring_Curse: ; 38e5c AIScoring_Curse: ; 38e5c
ld a, [EnemyMonType1] ld a, [EnemyMonType1]
cp $8 cp GHOST
jr z, .asm_38e95 jr z, .ghostcurse
ld a, [EnemyMonType2] ld a, [EnemyMonType2]
cp $8 cp GHOST
jr z, .asm_38e95 jr z, .ghostcurse
call AICheckEnemyHalfHP call AICheckEnemyHalfHP
jr nc, .asm_38e93 jr nc, .asm_38e93
ld a, [EnemyAtkLevel] ld a, [EnemyAtkLevel]
cp $b cp $b
jr nc, .asm_38e93 jr nc, .asm_38e93
cp $9 cp $9
ret nc ret nc
ld a, [BattleMonType1]
cp $8
jr z, .asm_38e92
cp $14 ld a, [BattleMonType1]
cp GHOST
jr z, .asm_38e92
cp FIRE
ret nc ret nc
ld a, [BattleMonType2] ld a, [BattleMonType2]
cp $14 cp FIRE
ret nc ret nc
call Function_0x39521 call Function_0x39521
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -1890,30 +1862,24 @@ AIScoring_Curse: ; 38e5c
.asm_38e90 .asm_38e90
inc [hl] inc [hl]
inc [hl] inc [hl]
.asm_38e92 .asm_38e92
inc [hl] inc [hl]
.asm_38e93 .asm_38e93
inc [hl] inc [hl]
ret ret
.asm_38e95 .ghostcurse
ld a, [PlayerSubStatus1] ld a, [PlayerSubStatus1]
bit 1, a bit SUBSTATUS_CURSE, a
jp nz, AIDiscourageMove jp nz, AIDiscourageMove
push hl push hl
ld a, $d callba Function0x349f4
ld hl, $49f4
rst FarCall
pop hl pop hl
jr nc, .asm_38eb0 jr nc, .asm_38eb0
push hl push hl
call Function_0x38e2e call AICheckLastPlayerMon
pop hl pop hl
jr nz, .asm_38e90 jr nz, .asm_38e90
@ -1922,24 +1888,21 @@ AIScoring_Curse: ; 38e5c
.asm_38eb0 .asm_38eb0
push hl push hl
call Function_0x38e2e call AICheckLastPlayerMon
pop hl pop hl
jr z, .asm_38ecb jr z, .asm_38ecb
.asm_38eb7 .asm_38eb7
call AICheckEnemyQuarterHP call AICheckEnemyQuarterHP
jp nc, .asm_38e90 jp nc, .asm_38e90
call AICheckEnemyHalfHP call AICheckEnemyHalfHP
jr nc, .asm_38e92 jr nc, .asm_38e92
call AICheckEnemyMaxHP call AICheckEnemyMaxHP
ret nc ret nc
ld a, [PlayerTurnsTaken] ld a, [PlayerTurnsTaken]
and a and a
ret nz ret nz
@ -1960,40 +1923,36 @@ AIScoring_Protect: ; 38ed2
jr nz, .asm_38f13 jr nz, .asm_38f13
ld a, [PlayerSubStatus5] ld a, [PlayerSubStatus5]
bit 5, a bit SUBSTATUS_LOCK_ON, a
jr nz, .asm_38f14 jr nz, .asm_38f14
ld a, [PlayerFuryCutterCount] ld a, [PlayerFuryCutterCount]
cp $3 cp 3
jr nc, .asm_38f0d jr nc, .asm_38f0d
ld a, [PlayerSubStatus3] ld a, [PlayerSubStatus3]
bit 4, a bit SUBSTATUS_CHARGED, a
jr nz, .asm_38f0d jr nz, .asm_38f0d
ld a, [PlayerSubStatus5] ld a, [PlayerSubStatus5]
bit 0, a bit SUBSTATUS_TOXIC, a
jr nz, .asm_38f0d jr nz, .asm_38f0d
ld a, [PlayerSubStatus4] ld a, [PlayerSubStatus4]
bit 7, a bit SUBSTATUS_LEECH_SEED, a
jr nz, .asm_38f0d jr nz, .asm_38f0d
ld a, [PlayerSubStatus1] ld a, [PlayerSubStatus1]
bit 1, a bit SUBSTATUS_CURSE, a
jr nz, .asm_38f0d jr nz, .asm_38f0d
bit 6, a bit SUBSTATUS_ENCORED, a
jr z, .asm_38f14 jr z, .asm_38f14
ld a, [PlayerRolloutCount] ld a, [PlayerRolloutCount]
cp $3 cp 3
jr c, .asm_38f14 jr c, .asm_38f14
.asm_38f0d .asm_38f0d
call Function_0x39521 call Function_0x39521
ret c ret c
dec [hl] dec [hl]
ret ret
@ -2003,8 +1962,7 @@ AIScoring_Protect: ; 38ed2
.asm_38f14 .asm_38f14
call RNG call RNG
cp 20
cp $14
ret c ret c
inc [hl] inc [hl]
inc [hl] inc [hl]
@ -2016,30 +1974,26 @@ AIScoring_Foresight: ; 38f1d
ld a, [EnemyAccLevel] ld a, [EnemyAccLevel]
cp $5 cp $5
jr c, .asm_38f41 jr c, .asm_38f41
ld a, [PlayerEvaLevel] ld a, [PlayerEvaLevel]
cp $a cp $a
jr nc, .asm_38f41 jr nc, .asm_38f41
ld a, [BattleMonType1] ld a, [BattleMonType1]
cp $8 cp GHOST
jr z, .asm_38f41 jr z, .asm_38f41
ld a, [BattleMonType2] ld a, [BattleMonType2]
cp $8 cp GHOST
jr z, .asm_38f41 jr z, .asm_38f41
call RNG call RNG
cp 20
cp $14
ret c ret c
inc [hl] inc [hl]
ret ret
.asm_38f41 .asm_38f41
call RNG call RNG
cp 100
cp $64
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -2049,10 +2003,7 @@ AIScoring_Foresight: ; 38f1d
AIScoring_PerishSong: ; 38f4a AIScoring_PerishSong: ; 38f4a
push hl push hl
ld hl, $49f4 callab Function0x349f4
ld a, $d
rst FarCall
pop hl pop hl
jr c, .asm_38f75 jr c, .asm_38f75
@ -2061,17 +2012,15 @@ AIScoring_PerishSong: ; 38f4a
jr nz, .asm_38f6f jr nz, .asm_38f6f
push hl push hl
ld hl, $484e callab Function0x3484e
ld a, $d
rst FarCall
ld a, [$c716] ld a, [$c716]
cp $a cp 10 ; 1.0
pop hl pop hl
ret c ret c
call Function_0x39527
call Function_0x39527
ret c ret c
inc [hl] inc [hl]
ret ret
@ -2084,7 +2033,7 @@ AIScoring_PerishSong: ; 38f4a
.asm_38f75 .asm_38f75
ld a, [hl] ld a, [hl]
add $5 add 5
ld [hl], a ld [hl], a
ret ret
; 38f7a ; 38f7a
@ -2137,21 +2086,18 @@ AIScoring_Endure: ; 38fac
jr nz, .asm_38fd8 jr nz, .asm_38fd8
call AICheckEnemyMaxHP call AICheckEnemyMaxHP
jr c, .asm_38fd8 jr c, .asm_38fd8
call AICheckEnemyQuarterHP call AICheckEnemyQuarterHP
jr c, .asm_38fd9 jr c, .asm_38fd9
ld b, $63 ld b, EFFECT_REVERSAL
call Function_0x392ca call AIHasMove
jr nc, .asm_38fcb jr nc, .asm_38fcb
call Function_0x39521 call Function_0x39521
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -2159,7 +2105,7 @@ AIScoring_Endure: ; 38fac
.asm_38fcb .asm_38fcb
ld a, [EnemySubStatus5] ld a, [EnemySubStatus5]
bit 5, a bit SUBSTATUS_LOCK_ON, a
ret z ret z
call Function_0x39527 call Function_0x39527
@ -2180,20 +2126,21 @@ AIScoring_Endure: ; 38fac
AIScoring_FuryCutter: ; 38fdb AIScoring_FuryCutter: ; 38fdb
ld a, [EnemyFuryCutterCount] ld a, [EnemyFuryCutterCount]
and a and a
jr z, AIScoring_Rollout jr z, .end
dec [hl]
cp 2
jr c, .end
dec [hl]
dec [hl] dec [hl]
cp $2
jr c, AIScoring_Rollout
cp 3
jr c, .end
dec [hl]
dec [hl] dec [hl]
dec [hl] dec [hl]
cp $3
jr c, AIScoring_Rollout
dec [hl] .end
dec [hl]
dec [hl]
; fallthrough ; fallthrough
; 38fef ; 38fef
@ -2201,32 +2148,29 @@ AIScoring_FuryCutter: ; 38fdb
AIScoring_Rollout: ; 38fef AIScoring_Rollout: ; 38fef
ld a, [EnemySubStatus1] ld a, [EnemySubStatus1]
bit 7, a bit SUBSTATUS_IN_LOVE, a
jr nz, .asm_39020 jr nz, .asm_39020
ld a, [EnemySubStatus3] ld a, [EnemySubStatus3]
bit 7, a bit SUBSTATUS_CONFUSED, a
jr nz, .asm_39020 jr nz, .asm_39020
ld a, [EnemyMonStatus] ld a, [EnemyMonStatus]
bit 6, a bit PAR, a
jr nz, .asm_39020 jr nz, .asm_39020
call AICheckEnemyQuarterHP call AICheckEnemyQuarterHP
jr nc, .asm_39020 jr nc, .asm_39020
ld a, [EnemyAccLevel] ld a, [EnemyAccLevel]
cp $7 cp 7
jr c, .asm_39020 jr c, .asm_39020
ld a, [PlayerEvaLevel] ld a, [PlayerEvaLevel]
cp $8 cp 8
jr nc, .asm_39020 jr nc, .asm_39020
call RNG call RNG
cp 200
cp $c8
ret nc ret nc
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -2234,7 +2178,6 @@ AIScoring_Rollout: ; 38fef
.asm_39020 .asm_39020
call Function_0x39521 call Function_0x39521
ret c ret c
inc [hl] inc [hl]
ret ret
@ -2248,15 +2191,13 @@ AIScoring_Attract: ; 39026
jr z, .asm_39032 jr z, .asm_39032
call Function_0x39521 call Function_0x39521
ret c ret c
inc [hl] inc [hl]
ret ret
.asm_39032 .asm_39032
call RNG call RNG
cp 200
cp $c8
ret nc ret nc
dec [hl] dec [hl]
ret ret
@ -2265,10 +2206,8 @@ AIScoring_Attract: ; 39026
AIScoring_Safeguard: ; 3903a AIScoring_Safeguard: ; 3903a
call AICheckPlayerHalfHP call AICheckPlayerHalfHP
ret c ret c
call Function_0x39521 call Function_0x39521
ret c ret c
inc [hl] inc [hl]
ret ret
@ -2278,14 +2217,14 @@ AIScoring_Safeguard: ; 3903a
AIScoring_Magnitude: AIScoring_Magnitude:
AIScoring_Earthquake: ; 39044 AIScoring_Earthquake: ; 39044
ld a, [LastEnemyCounterMove] ld a, [LastEnemyCounterMove]
cp $5b cp DIG
ret nz ret nz
ld a, [PlayerSubStatus3] ld a, [PlayerSubStatus3]
bit 5, a bit SUBSTATUS_UNDERGROUND, a
jr z, .asm_39058 jr z, .asm_39058
call AICompareSpeed call AICompareSpeed
ret nc ret nc
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -2293,10 +2232,8 @@ AIScoring_Earthquake: ; 39044
.asm_39058 .asm_39058
call AICompareSpeed call AICompareSpeed
ret c ret c
call Function_0x39527 call Function_0x39527
ret c ret c
dec [hl] dec [hl]
ret ret
@ -2305,12 +2242,9 @@ AIScoring_Earthquake: ; 39044
AIScoring_BatonPass: ; 39062 AIScoring_BatonPass: ; 39062
push hl push hl
ld hl, $484e callab Function0x3484e
ld a, $d
rst FarCall
ld a, [$c716] ld a, [$c716]
cp $a cp 10 ; 1.0
pop hl pop hl
ret c ret c
inc [hl] inc [hl]
@ -2320,18 +2254,14 @@ AIScoring_BatonPass: ; 39062
AIScoring_Pursuit: ; 39072 AIScoring_Pursuit: ; 39072
call AICheckPlayerQuarterHP call AICheckPlayerQuarterHP
jr nc, .asm_3907d jr nc, .asm_3907d
call Function_0x39521 call Function_0x39521
ret c ret c
inc [hl] inc [hl]
ret ret
.asm_3907d .asm_3907d
call Function_0x39527 call Function_0x39527
ret c ret c
dec [hl] dec [hl]
dec [hl] dec [hl]
@ -2345,11 +2275,11 @@ AIScoring_RapidSpin: ; 39084
jr nz, .asm_39097 jr nz, .asm_39097
ld a, [EnemySubStatus4] ld a, [EnemySubStatus4]
bit 7, a bit SUBSTATUS_LEECH_SEED, a
jr nz, .asm_39097 jr nz, .asm_39097
ld a, [EnemyScreens] ld a, [EnemyScreens]
bit 0, a bit SCREENS_SPIKES, a
ret z ret z
.asm_39097 .asm_39097
@ -2364,17 +2294,14 @@ AIScoring_RapidSpin: ; 39084
AIScoring_HiddenPower: ; 3909e AIScoring_HiddenPower: ; 3909e
push hl push hl
ld a, $1 ld a, 1
ld [hBattleTurn], a ld [hBattleTurn], a
ld hl, $7ced ld hl, $7ced
ld a, $3e ld a, $3e
rst FarCall rst FarCall
callab Function0x347c8
ld hl, $47c8
ld a, $d
rst FarCall
pop hl pop hl
ld a, [$d265] ld a, [$d265]
cp $a cp $a
jr c, .asm_390c9 jr c, .asm_390c9
@ -2404,22 +2331,21 @@ AIScoring_HiddenPower: ; 3909e
AIScoring_RainDance: ; 390cb AIScoring_RainDance: ; 390cb
ld a, [BattleMonType1] ld a, [BattleMonType1]
cp WATER cp WATER
jr z, Function_0x3911e jr z, AIBadWeatherType
cp FIRE cp FIRE
jr z, Function_0x39122 jr z, AIGoodWeatherType
ld a, [BattleMonType2] ld a, [BattleMonType2]
cp WATER cp WATER
jr z, Function_0x3911e jr z, AIBadWeatherType
cp FIRE cp FIRE
jr z, Function_0x39122 jr z, AIGoodWeatherType
push hl push hl
ld hl, RainDanceMoves ld hl, RainDanceMoves
jr Function_0x3910d jr AIScoring_WeatherMove
; 390e7 ; 390e7
RainDanceMoves: ; 390e7 RainDanceMoves: ; 390e7
db WATER_GUN db WATER_GUN
db HYDRO_PUMP db HYDRO_PUMP
@ -2439,15 +2365,15 @@ RainDanceMoves: ; 390e7
AIScoring_SunnyDay: ; 390f3 AIScoring_SunnyDay: ; 390f3
ld a, [BattleMonType1] ld a, [BattleMonType1]
cp FIRE cp FIRE
jr z, Function_0x3911e jr z, AIBadWeatherType
cp WATER cp WATER
jr z, Function_0x39122 jr z, AIGoodWeatherType
ld a, [BattleMonType2] ld a, [BattleMonType2]
cp FIRE cp FIRE
jr z, Function_0x3911e jr z, AIBadWeatherType
cp WATER cp WATER
jr z, Function_0x39122 jr z, AIGoodWeatherType
push hl push hl
ld hl, SunnyDayMoves ld hl, SunnyDayMoves
@ -2456,39 +2382,41 @@ AIScoring_SunnyDay: ; 390f3
; 3910d ; 3910d
Function_0x3910d: ; 3910d AIScoring_WeatherMove: ; 3910d
call Function_0x392e6 call AIHasMoveInArray
pop hl pop hl
jr nc, Function_0x3911e jr nc, AIBadWeatherType
call AICheckPlayerHalfHP call AICheckPlayerHalfHP
jr nc, Function_0x3911e jr nc, AIBadWeatherType
call Function_0x39527 call Function_0x39527
ret c ret c
dec [hl] dec [hl]
ret ret
; 3911e
Function_0x3911e: ; 3911e AIBadWeatherType: ; 3911e
inc [hl] inc [hl]
inc [hl] inc [hl]
inc [hl] inc [hl]
ret ret
; 39122
Function_0x39122: ; 39122 AIGoodWeatherType: ; 39122
call AICheckPlayerHalfHP call AICheckPlayerHalfHP
ret nc ret nc
ld a, [PlayerTurnsTaken] ld a, [PlayerTurnsTaken]
and a and a
jr z, .asm_39131 jr z, .good
ld a, [EnemyTurnsTaken] ld a, [EnemyTurnsTaken]
and a and a
ret nz ret nz
.asm_39131 .good
dec [hl] dec [hl]
dec [hl] dec [hl]
ret ret
@ -2597,7 +2525,7 @@ AIScoring_MirrorCoat: ; 3918b
jr z, .asm_391a8 jr z, .asm_391a8
ld a, [EnemyMoveType] ld a, [EnemyMoveType]
cp $14 cp FIRE
jr c, .asm_391a8 jr c, .asm_391a8
inc b inc b
@ -2625,16 +2553,14 @@ AIScoring_MirrorCoat: ; 3918b
jr z, .asm_391d2 jr z, .asm_391d2
ld a, [EnemyMoveType] ld a, [EnemyMoveType]
cp $14 cp FIRE
jr c, .asm_391d2 jr c, .asm_391d2
.asm_391ca .asm_391ca
call RNG call RNG
cp 100
cp $64
jr c, .asm_391d2 jr c, .asm_391d2
dec [hl] dec [hl]
.asm_391d2 .asm_391d2
@ -2649,25 +2575,24 @@ AIScoring_MirrorCoat: ; 3918b
AIScoring_Twister: AIScoring_Twister:
AIScoring_Gust: ; 391d5 AIScoring_Gust: ; 391d5
ld a, [LastEnemyCounterMove] ld a, [LastEnemyCounterMove]
cp $13 cp FLY
ret nz ret nz
ld a, [PlayerSubStatus3] ld a, [PlayerSubStatus3]
bit 6, a bit SUBSTATUS_FLYING, a
jr z, .asm_391e9 jr z, .asm_391e9
call AICompareSpeed call AICompareSpeed
ret nc ret nc
dec [hl] dec [hl]
dec [hl] dec [hl]
ret ret
.asm_391e9 .asm_391e9
call AICompareSpeed call AICompareSpeed
ret c ret c
call Function_0x39527 call Function_0x39527
ret c ret c
dec [hl] dec [hl]
ret ret
@ -2676,11 +2601,12 @@ AIScoring_Gust: ; 391d5
AIScoring_FutureSight: ; 391f3 AIScoring_FutureSight: ; 391f3
call AICompareSpeed call AICompareSpeed
ret nc ret nc
ld a, [PlayerSubStatus3] ld a, [PlayerSubStatus3]
and $60 and 1<<SUBSTATUS_FLYING | 1<<SUBSTATUS_UNDERGROUND
ret z ret z
dec [hl] dec [hl]
dec [hl] dec [hl]
ret ret
@ -2691,9 +2617,10 @@ AIScoring_Stomp: ; 39200
ld a, [$c6fe] ld a, [$c6fe]
and a and a
ret z ret z
call Function_0x39521
call Function_0x39521
ret c ret c
dec [hl] dec [hl]
ret ret
; 3920b ; 3920b
@ -2889,12 +2816,13 @@ AICheckPlayerQuarterHP: ; 392b3
; 392ca ; 392ca
Function_0x392ca: ; 392ca AIHasMove: ; 392ca
; Return carry if the enemy has move b.
push hl push hl
ld hl, EnemyMonMoves ld hl, EnemyMonMoves
ld c, EnemyMonMovesEnd - EnemyMonMoves ld c, EnemyMonMovesEnd - EnemyMonMoves
.asm_392d0 .checkmove
ld a, [hli] ld a, [hli]
and a and a
jr z, .asm_392e0 jr z, .asm_392e0
@ -2906,7 +2834,7 @@ Function_0x392ca: ; 392ca
jr z, .asm_392e3 jr z, .asm_392e3
dec c dec c
jr nz, .asm_392d0 jr nz, .checkmove
.asm_392e0 .asm_392e0
pop hl pop hl
@ -2920,7 +2848,9 @@ Function_0x392ca: ; 392ca
; 392e6 ; 392e6
Function_0x392e6: ; 392e6 AIHasMoveInArray: ; 392e6
; Return carry if the enemy has a move in array hl.
push hl push hl
push de push de
push bc push bc