Better trainer AI comments and finish off trainer attributes.

This commit is contained in:
yenatch
2014-08-13 19:44:56 -07:00
parent 88a15c5038
commit da799c80d4
8 changed files with 893 additions and 854 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -480,7 +480,7 @@ Function3c314: ; 3c314
jp .asm_3c3f1 jp .asm_3c3f1
.asm_3c34c .asm_3c34c
callab Function3846c callab AI_Switch
call SetEnemyTurn call SetEnemyTurn
call SpikesDamage call SpikesDamage
jp Function3c3f3 jp Function3c3f3
@@ -5454,7 +5454,7 @@ Function3e3ad: ; 3e3ad
; 3e3ff ; 3e3ff
Function3e3ff: ; 3e3ff Function3e3ff: ; 3e3ff
callab Function3846c callab AI_Switch
call SetEnemyTurn call SetEnemyTurn
jp SpikesDamage jp SpikesDamage
; 3e40b ; 3e40b

View File

@@ -1041,6 +1041,7 @@ BattleCommand04: ; 34555
ld bc, EnemyTurnsTaken ld bc, EnemyTurnsTaken
.asm_34570 .asm_34570
; If we've gotten this far, this counts as a turn. ; If we've gotten this far, this counts as a turn.
ld a, [bc] ld a, [bc]
inc a inc a
@@ -1052,7 +1053,7 @@ BattleCommand04: ; 34555
ret z ret z
ld a, [de] ld a, [de]
and %111 ; rollout | bide | ??? and 1 << SUBSTATUS_IN_LOOP | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
ret nz ret nz
call .asm_345ad call .asm_345ad
@@ -1060,7 +1061,7 @@ BattleCommand04: ; 34555
and a and a
jp nz, EndMoveEffect jp nz, EndMoveEffect
; SubStatus5 ; SubStatus5
inc de inc de
inc de inc de
@@ -1542,28 +1543,28 @@ Function347d3: ; 347d3
.asm_347e7 .asm_347e7
ld a, [hli] ld a, [hli]
cp $ff cp $ff
jr z, .asm_3482f ; 0x347ea $43 jr z, .asm_3482f
cp $fe cp $fe
jr nz, .asm_347fb ; 0x347ee $b jr nz, .asm_347fb
ld a, BATTLE_VARS_SUBSTATUS1_OPP ld a, BATTLE_VARS_SUBSTATUS1_OPP
call GetBattleVar call GetBattleVar
bit SUBSTATUS_IDENTIFIED, a bit SUBSTATUS_IDENTIFIED, a
jr nz, .asm_3482f ; 0x347f7 $36 jr nz, .asm_3482f
jr .asm_347e7 ; 0x347f9 $ec jr .asm_347e7
.asm_347fb .asm_347fb
cp d cp d
jr nz, .asm_34807 ; 0x347fc $9 jr nz, .asm_34807
ld a, [hli] ld a, [hli]
cp b cp b
jr z, .asm_3480b ; 0x34800 $9 jr z, .asm_3480b
cp c cp c
jr z, .asm_3480b ; 0x34803 $6 jr z, .asm_3480b
jr .asm_34808 ; 0x34805 $1 jr .asm_34808
.asm_34807 .asm_34807
inc hl inc hl
.asm_34808 .asm_34808
inc hl inc hl
jr .asm_347e7 ; 0x34809 $dc jr .asm_347e7
.asm_3480b .asm_3480b
xor a xor a
ld [$ffb3], a ld [$ffb3], a
@@ -1572,17 +1573,18 @@ Function347d3: ; 347d3
ld a, [hli] ld a, [hli]
ld [$ffb6], a ld [$ffb6], a
ld a, [$d265] ld a, [$d265]
ld [$ffb7], a ld [hMultiplier], a
call Multiply call Multiply
ld a, $a ld a, 10
ld [$ffb7], a ld [hDivisor], a
push bc push bc
ld b, $4 ld b, 4
call Divide call Divide
pop bc pop bc
ld a, [$ffb6] ld a, [$ffb6]
ld [$d265], a ld [$d265], a
jr .asm_347e7 ; 0x3482d $b8 jr .asm_347e7
.asm_3482f .asm_3482f
pop bc pop bc
pop de pop de
@@ -1613,7 +1615,7 @@ Function3484e: ; 3484e
push hl push hl
push de push de
push bc push bc
ld a, $a ld a, 10
ld [$c716], a ld [$c716], a
ld hl, PlayerUsedMoves ld hl, PlayerUsedMoves
ld a, [hl] ld a, [hl]
@@ -1795,24 +1797,26 @@ Function34939: ; 34939
Function34941: ; 34941 Function34941: ; 34941
xor a xor a
ld [$c717], a ld [$c717], a
call Function349f4 call CountEnemyAliveMons
ret c ret c
ld a, [EnemySubStatus1] ld a, [EnemySubStatus1]
bit SUBSTATUS_PERISH, a bit SUBSTATUS_PERISH, a
jr z, .asm_34986 jr z, .no_perish
ld a, [EnemyPerishCount] ld a, [EnemyPerishCount]
cp 1 cp 1
jr nz, .asm_34986 jr nz, .no_perish
call Function349f4 ; Perish count is 1
call CountEnemyAliveMons
call Function34b77 call Function34b77
call Function34b20 call Function34b20
call Function34a85 call Function34a85
ld a, e ld a, e
cp $2 cp 2
jr nz, .asm_34971 jr nz, .asm_34971
ld a, [$c716] ld a, [$c716]
@@ -1821,7 +1825,7 @@ Function34941: ; 34941
ret ret
.asm_34971 .asm_34971
call Function349f4 call CountEnemyAliveMons
sla c sla c
sla c sla c
ld b, $ff ld b, $ff
@@ -1836,10 +1840,11 @@ Function34941: ; 34941
ld [$c717], a ld [$c717], a
ret ret
.asm_34986 .no_perish
call Function3484e call Function3484e
ld a, [$c716] ld a, [$c716]
cp $b cp 11
ret nc ret nc
ld a, [LastEnemyCounterMove] ld a, [LastEnemyCounterMove]
@@ -1859,12 +1864,12 @@ Function34941: ; 34941
ld b, a ld b, a
ld a, e ld a, e
cp $2 cp 2
jr z, .asm_349be jr z, .asm_349be
call Function3484e call Function3484e
ld a, [$c716] ld a, [$c716]
cp $a cp 10
ret nc ret nc
ld a, b ld a, b
@@ -1876,7 +1881,7 @@ Function34941: ; 34941
ld c, $10 ld c, $10
call Function3484e call Function3484e
ld a, [$c716] ld a, [$c716]
cp $a cp 10
jr nc, .asm_349cc jr nc, .asm_349cc
ld c, $20 ld c, $20
@@ -1889,10 +1894,10 @@ Function34941: ; 34941
.asm_349d2 .asm_349d2
call Function3484e call Function3484e
ld a, [$c716] ld a, [$c716]
cp $a cp 10
ret nc ret nc
call Function349f4 call CountEnemyAliveMons
call Function34b77 call Function34b77
call Function34b20 call Function34b20
call Function34a85 call Function34a85
@@ -1908,7 +1913,7 @@ Function34941: ; 34941
; 349f4 ; 349f4
Function349f4: ; 349f4 CountEnemyAliveMons: ; 349f4
ld a, [OTPartyCount] ld a, [OTPartyCount]
cp 2 cp 2
jr c, .only_one jr c, .only_one
@@ -1964,7 +1969,7 @@ Function34a2a: ; 34a2a
ld hl, OTPartyMon1 ld hl, OTPartyMon1
ld a, [OTPartyCount] ld a, [OTPartyCount]
ld b, a ld b, a
ld c, $20 ld c, 1 << (PARTY_LENGTH - 1)
ld d, 0 ld d, 0
xor a xor a
ld [$c716], a ld [$c716], a
@@ -2027,8 +2032,8 @@ Function34a85: ; 34a85
ld a, [OTPartyCount] ld a, [OTPartyCount]
ld e, a ld e, a
ld hl, OTPartyMon1HP ld hl, OTPartyMon1HP
ld b, $20 ld b, 1 << (PARTY_LENGTH - 1)
ld c, $0 ld c, 0
.asm_34a91 .asm_34a91
ld a, [hli] ld a, [hli]
or [hl] or [hl]
@@ -2061,9 +2066,9 @@ Function34aa7: ; 34aa7
ld a, $ff ld a, $ff
ld [$c716], a ld [$c716], a
ld hl, OTPartyMon1Moves ld hl, OTPartyMon1Moves
ld b, $20 ld b, 1 << (PARTY_LENGTH - 1)
ld d, $0 ld d, 0
ld e, $0 ld e, 0
.asm_34ab5 .asm_34ab5
ld a, b ld a, b
and c and c
@@ -2072,7 +2077,7 @@ Function34aa7: ; 34aa7
push hl push hl
push bc push bc
ld b, NUM_MOVES ld b, NUM_MOVES
ld c, $0 ld c, 0
.asm_34abf .asm_34abf
ld a, [hli] ld a, [hli]
and a and a
@@ -2090,14 +2095,14 @@ Function34aa7: ; 34aa7
ld hl, BattleMonType1 ld hl, BattleMonType1
call Function347d3 call Function347d3
ld a, [$d265] ld a, [$d265]
cp $a cp 10
jr c, .asm_34ae9 jr c, .asm_34ae9
ld e, $1 ld e, 1
cp $b cp 11
jr c, .asm_34ae9 jr c, .asm_34ae9
ld e, $2 ld e, 2
jr .asm_34aef jr .asm_34aef
.asm_34ae9 .asm_34ae9
@@ -2157,8 +2162,8 @@ Function34aa7: ; 34aa7
Function34b20: ; 34b20 Function34b20: ; 34b20
push bc push bc
ld hl, OTPartySpecies ld hl, OTPartySpecies
ld b, $20 ld b, 1 << (PARTY_LENGTH - 1)
ld c, $0 ld c, 0
.asm_34b28 .asm_34b28
ld a, [hli] ld a, [hli]
@@ -2350,7 +2355,7 @@ BattleCommand09: ; 34d32
call .ThunderRain call .ThunderRain
ret z ret z
call .UnleashedEnergy call .XAccuracy
ret nz ret nz
; Perfect-accuracy moves ; Perfect-accuracy moves
@@ -2545,11 +2550,10 @@ BattleCommand09: ; 34d32
ret ret
.UnleashedEnergy .XAccuracy
; Return nz if unleashing energy from Bide.
ld a, BATTLE_VARS_SUBSTATUS4 ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVar call GetBattleVar
bit SUBSTATUS_UNLEASH, a bit SUBSTATUS_X_ACCURACY, a
ret ret
@@ -6915,8 +6919,9 @@ BattleCommand21: ; 36671
ld a, BATTLE_VARS_SUBSTATUS3 ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVar call GetBattleVar
bit 0, a bit SUBSTATUS_BIDE, a
ret z ret z
ld hl, PlayerRolloutCount ld hl, PlayerRolloutCount
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@@ -6925,9 +6930,10 @@ BattleCommand21: ; 36671
.asm_36684 .asm_36684
dec [hl] dec [hl]
jr nz, .asm_366dc jr nz, .asm_366dc
ld a, BATTLE_VARS_SUBSTATUS3 ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr call GetBattleVarAddr
res 0, [hl] res SUBSTATUS_BIDE, [hl]
ld hl, UnleashedEnergyText ld hl, UnleashedEnergyText
call StdBattleTextBox call StdBattleTextBox
@@ -6988,13 +6994,13 @@ BattleCommand22: ; 366e5
ld bc, PlayerRolloutCount ld bc, PlayerRolloutCount
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
jr z, .asm_366f6 ; 366ee $6 jr z, .asm_366f6
ld de, $c684 ld de, $c684
ld bc, EnemyRolloutCount ld bc, EnemyRolloutCount
.asm_366f6 .asm_366f6
ld a, BATTLE_VARS_SUBSTATUS3 ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr call GetBattleVarAddr
set 0, [hl] set SUBSTATUS_BIDE, [hl]
xor a xor a
ld [de], a ld [de], a
inc de inc de
@@ -7002,11 +7008,11 @@ BattleCommand22: ; 366e5
ld [wPlayerMoveStruct + MOVE_EFFECT], a ld [wPlayerMoveStruct + MOVE_EFFECT], a
ld [wEnemyMoveStruct + MOVE_EFFECT], a ld [wEnemyMoveStruct + MOVE_EFFECT], a
call BattleRandom call BattleRandom
and $1 and 1
inc a inc a
inc a inc a
ld [bc], a ld [bc], a
ld a, $1 ld a, 1
ld [$c689], a ld [$c689], a
call AnimateCurrentMove call AnimateCurrentMove
jp EndMoveEffect jp EndMoveEffect
@@ -7219,7 +7225,7 @@ BattleCommand23: ; 3680f
ld a, [wPlayerMoveStruct + MOVE_ANIM] ld a, [wPlayerMoveStruct + MOVE_ANIM]
jp .asm_36975 jp .asm_36975
.asm_36869 .asm_36869
call Function349f4 call CountEnemyAliveMons
jr c, .asm_368ca ; 3686c $5c jr c, .asm_368ca ; 3686c $5c
ld a, [$c70f] ld a, [$c70f]
and a and a

View File

@@ -109,15 +109,18 @@ SUBSTATUS_LEECH_SEED EQU 7
SUBSTATUS_RAGE EQU 6 SUBSTATUS_RAGE EQU 6
SUBSTATUS_RECHARGE EQU 5 SUBSTATUS_RECHARGE EQU 5
SUBSTATUS_SUBSTITUTE EQU 4 SUBSTATUS_SUBSTITUTE EQU 4
; EQU 3
SUBSTATUS_FOCUS_ENERGY EQU 2 SUBSTATUS_FOCUS_ENERGY EQU 2
SUBSTATUS_MIST EQU 1 SUBSTATUS_MIST EQU 1
SUBSTATUS_UNLEASH EQU 0 SUBSTATUS_X_ACCURACY EQU 0
SUBSTATUS_CANT_RUN EQU 7 SUBSTATUS_CANT_RUN EQU 7
SUBSTATUS_DESTINY_BOND EQU 6 SUBSTATUS_DESTINY_BOND EQU 6
SUBSTATUS_LOCK_ON EQU 5 SUBSTATUS_LOCK_ON EQU 5
SUBSTATUS_ENCORED EQU 4 SUBSTATUS_ENCORED EQU 4
SUBSTATUS_TRANSFORMED EQU 3 SUBSTATUS_TRANSFORMED EQU 3
; EQU 2
; EQU 1
SUBSTATUS_TOXIC EQU 0 SUBSTATUS_TOXIC EQU 0
; environmental ; environmental

View File

@@ -73,3 +73,18 @@ STEP_TURN EQU 5
STEP_BACK_LEDGE EQU 6 STEP_BACK_LEDGE EQU 6
STEP_WALK_IN_PLACE EQU 7 STEP_WALK_IN_PLACE EQU 7
; ai
CONTEXT_USE_F EQU 6
UNKNOWN_USE_F EQU 5
ALWAYS_USE_F EQU 4
SWITCH_SOMETIMES_F EQU 2
SWITCH_RARELY_F EQU 1
SWITCH_OFTEN_F EQU 0
CONTEXT_USE EQU 1 << CONTEXT_USE_F
UNKNOWN_USE EQU 1 << UNKNOWN_USE_F
ALWAYS_USE EQU 1 << ALWAYS_USE_F
SWITCH_SOMETIMES EQU 1 << SWITCH_SOMETIMES_F
SWITCH_RARELY EQU 1 << SWITCH_RARELY_F
SWITCH_OFTEN EQU 1 << SWITCH_OFTEN_F

313
main.asm
View File

@@ -41681,202 +41681,204 @@ TrainerClassNames:: ; 2c1ef
Function2c41a: ; 2c41a (b:441a) AI_Redundant: ; 2c41a
; More move AI. ; Check if move effect c will fail because it's already been used.
ld a, c ld a, c
ld de, 3 ld de, 3
ld hl, Unknown_2c42c ld hl, .Moves
call IsInArray call IsInArray
jp nc, Function2c545 jp nc, .NotRedundant
inc hl inc hl
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
jp [hl] jp [hl]
; 2c42c (b:442c)
Unknown_2c42c: ; 2c42c .Moves: ; 2c42c
dbw EFFECT_DREAM_EATER, Function2c524 dbw EFFECT_DREAM_EATER, .DreamEater
dbw EFFECT_HEAL, Function2c539 dbw EFFECT_HEAL, .Heal
dbw EFFECT_LIGHT_SCREEN, Function2c487 dbw EFFECT_LIGHT_SCREEN, .LightScreen
dbw EFFECT_MIST, Function2c48d dbw EFFECT_MIST, .Mist
dbw EFFECT_FOCUS_ENERGY, Function2c493 dbw EFFECT_FOCUS_ENERGY, .FocusEnergy
dbw EFFECT_CONFUSE, Function2c499 dbw EFFECT_CONFUSE, .Confuse
dbw EFFECT_TRANSFORM, Function2c4a5 dbw EFFECT_TRANSFORM, .Transform
dbw EFFECT_REFLECT, Function2c4ab dbw EFFECT_REFLECT, .Reflect
dbw EFFECT_SUBSTITUTE, Function2c4b1 dbw EFFECT_SUBSTITUTE, .Substitute
dbw EFFECT_LEECH_SEED, Function2c4b7 dbw EFFECT_LEECH_SEED, .LeechSeed
dbw EFFECT_DISABLE, Function2c4bd dbw EFFECT_DISABLE, .Disable
dbw EFFECT_ENCORE, Function2c4c2 dbw EFFECT_ENCORE, .Encore
dbw EFFECT_SNORE, Function2c4c8 dbw EFFECT_SNORE, .Snore
dbw EFFECT_SLEEP_TALK, Function2c4c8 dbw EFFECT_SLEEP_TALK, .SleepTalk
dbw EFFECT_MEAN_LOOK, Function2c4d1 dbw EFFECT_MEAN_LOOK, .MeanLook
dbw EFFECT_NIGHTMARE, Function2c4d7 dbw EFFECT_NIGHTMARE, .Nightmare
dbw EFFECT_SPIKES, Function2c4e3 dbw EFFECT_SPIKES, .Spikes
dbw EFFECT_FORESIGHT, Function2c4e9 dbw EFFECT_FORESIGHT, .Foresight
dbw EFFECT_PERISH_SONG, Function2c4ef dbw EFFECT_PERISH_SONG, .PerishSong
dbw EFFECT_SANDSTORM, Function2c4f5 dbw EFFECT_SANDSTORM, .Sandstorm
dbw EFFECT_ATTRACT, Function2c4fe dbw EFFECT_ATTRACT, .Attract
dbw EFFECT_SAFEGUARD, Function2c50c dbw EFFECT_SAFEGUARD, .Safeguard
dbw EFFECT_RAIN_DANCE, Function2c512 dbw EFFECT_RAIN_DANCE, .RainDance
dbw EFFECT_SUNNY_DAY, Function2c51b dbw EFFECT_SUNNY_DAY, .SunnyDay
dbw EFFECT_TELEPORT, Function2c541 dbw EFFECT_TELEPORT, .Teleport
dbw EFFECT_MORNING_SUN, Function2c539 dbw EFFECT_MORNING_SUN, .MorningSun
dbw EFFECT_SYNTHESIS, Function2c539 dbw EFFECT_SYNTHESIS, .Synthesis
dbw EFFECT_MOONLIGHT, Function2c539 dbw EFFECT_MOONLIGHT, .Moonlight
dbw EFFECT_SWAGGER, Function2c52d dbw EFFECT_SWAGGER, .Swagger
dbw EFFECT_FUTURE_SIGHT, Function2c533 dbw EFFECT_FUTURE_SIGHT, .FutureSight
db $ff db -1
; 2c487
Function2c487: ; 2c487 .LightScreen: ; 2c487
ld a, [EnemyScreens] ; $c700 ld a, [EnemyScreens]
bit 3, a bit SCREENS_LIGHT_SCREEN, a
ret ret
Function2c48d: ; 2c48d .Mist: ; 2c48d
ld a, [EnemySubStatus4] ; $c670
bit 1, a
ret
Function2c493: ; 2c493
ld a, [EnemySubStatus4] ; $c670
bit 2, a
ret
Function2c499: ; 2c499
ld a, [PlayerSubStatus3] ; $c66a
bit 7, a
ret nz
ld a, [PlayerScreens] ; $c6ff
bit 2, a
ret
Function2c4a5: ; 2c4a5
ld a, [EnemySubStatus5] ; $c671
bit 3, a
ret
Function2c4ab: ; 2c4ab
ld a, [EnemyScreens] ; $c700
bit 4, a
ret
; 2c4b1 (b:44b1)
Function2c4b1: ; 2c4b1
ld a, [EnemySubStatus4] ld a, [EnemySubStatus4]
bit 4, a bit SUBSTATUS_MIST, a
ret ret
Function2c4b7: ; 2c4b7 .FocusEnergy: ; 2c493
ld a, [PlayerSubStatus4] ; $c66b ld a, [EnemySubStatus4]
bit 7, a bit SUBSTATUS_FOCUS_ENERGY, a
ret ret
Function2c4bd: ; 2c4bd .Confuse: ; 2c499
ld a, [PlayerDisableCount] ; $c675 ld a, [PlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret nz
ld a, [PlayerScreens]
bit SCREENS_SAFEGUARD, a
ret
.Transform: ; 2c4a5
ld a, [EnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret
.Reflect: ; 2c4ab
ld a, [EnemyScreens]
bit SCREENS_REFLECT, a
ret
.Substitute: ; 2c4b1
ld a, [EnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
ret
.LeechSeed: ; 2c4b7
ld a, [PlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
ret
.Disable: ; 2c4bd
ld a, [PlayerDisableCount]
and a and a
ret ret
Function2c4c2: ; 2c4c2 .Encore: ; 2c4c2
ld a, [PlayerSubStatus5] ; $c66c ld a, [PlayerSubStatus5]
bit 4, a bit SUBSTATUS_ENCORED, a
ret ret
Function2c4c8: ; 2c4c8 .Snore:
ld a, [EnemyMonStatus] ; $d214 .SleepTalk: ; 2c4c8
and $7 ld a, [EnemyMonStatus]
jr z, Function2c541 and SLP
jr Function2c545 jr z, .Redundant
jr .NotRedundant
Function2c4d1: ; 2c4d1 .MeanLook: ; 2c4d1
ld a, [EnemySubStatus5] ; $c671 ld a, [EnemySubStatus5]
bit 7, a bit SUBSTATUS_CANT_RUN, a
ret ret
; 2c4d7 (b:44d7)
Function2c4d7: ; 2c4d7 .Nightmare: ; 2c4d7
ld a, [BattleMonStatus] ld a, [BattleMonStatus]
and a and a
jr z, Function2c541 jr z, .Redundant
ld a, [PlayerSubStatus1] ld a, [PlayerSubStatus1]
bit 0, a bit SUBSTATUS_NIGHTMARE, a
ret ret
Function2c4e3: ; 2c4e3 .Spikes: ; 2c4e3
ld a, [PlayerScreens] ; $c6ff ld a, [PlayerScreens]
bit 0, a bit SCREENS_SPIKES, a
ret ret
Function2c4e9: ; 2c4e9 .Foresight: ; 2c4e9
ld a, [PlayerSubStatus1] ; $c668 ld a, [PlayerSubStatus1]
bit 3, a bit SUBSTATUS_IDENTIFIED, a
ret ret
Function2c4ef: ; 2c4ef .PerishSong: ; 2c4ef
ld a, [PlayerSubStatus1] ; $c668 ld a, [PlayerSubStatus1]
bit 4, a bit SUBSTATUS_PERISH, a
ret ret
Function2c4f5: ; 2c4f5 .Sandstorm: ; 2c4f5
ld a, [Weather] ; $c70a ld a, [Weather]
cp $3 cp WEATHER_SANDSTORM
jr z, Function2c541 jr z, .Redundant
jr Function2c545 jr .NotRedundant
Function2c4fe: ; 2c4fe .Attract: ; 2c4fe
callba Function377f5 callba Function377f5
jr c, Function2c541 jr c, .Redundant
ld a, [PlayerSubStatus1] ; $c668 ld a, [PlayerSubStatus1]
bit 7, a bit SUBSTATUS_IN_LOVE, a
ret ret
Function2c50c: ; 2c50c .Safeguard: ; 2c50c
ld a, [EnemyScreens] ; $c700 ld a, [EnemyScreens]
bit 2, a bit SCREENS_SAFEGUARD, a
ret ret
Function2c512: ; 2c512 .RainDance: ; 2c512
ld a, [Weather] ; $c70a ld a, [Weather]
cp $1 cp WEATHER_RAIN
jr z, Function2c541 jr z, .Redundant
jr Function2c545 jr .NotRedundant
Function2c51b: ; 2c51b .SunnyDay: ; 2c51b
ld a, [Weather] ; $c70a ld a, [Weather]
cp $2 cp WEATHER_SUN
jr z, Function2c541 jr z, .Redundant
jr Function2c545 jr .NotRedundant
Function2c524: ; 2c524 .DreamEater: ; 2c524
ld a, [BattleMonStatus] ; $c63a ld a, [BattleMonStatus]
and $7 and SLP
jr z, Function2c541 jr z, .Redundant
jr Function2c545 jr .NotRedundant
Function2c52d: ; 2c52d .Swagger: ; 2c52d
ld a, [PlayerSubStatus3] ; $c66a ld a, [PlayerSubStatus3]
bit 7, a bit SUBSTATUS_CONFUSED, a
ret ret
Function2c533: ; 2c533 .FutureSight: ; 2c533
ld a, [EnemyScreens] ; $c700 ld a, [EnemyScreens]
bit 5, a bit 5, a
ret ret
Function2c539: ; 2c539 .Heal:
.MorningSun:
.Synthesis:
.Moonlight: ; 2c539
callba AICheckEnemyMaxHP callba AICheckEnemyMaxHP
jr nc, Function2c545 jr nc, .NotRedundant
Function2c541: ; 2c541 .Teleport:
ld a, $1 .Redundant: ; 2c541
ld a, 1
and a and a
ret ret
Function2c545: ; 2c545 (b:4545) .NotRedundant: ; 2c545
xor a xor a
ret ret
Function2c547: ; 2c547 Function2c547: ; 2c547
ld hl, UnknownText_0x2c5ef ld hl, UnknownText_0x2c5ef
call PrintText call PrintText
@@ -47151,7 +47153,7 @@ AIChooseMove: ; 440ce
jr z, .asm_4415e jr z, .asm_4415e
push bc push bc
ld d, $e ; BANK(TrainerAI) ld d, BANK(TrainerClassAttributes)
predef FlagPredef predef FlagPredef
ld d, c ld d, c
pop bc pop bc
@@ -47182,6 +47184,7 @@ AIChooseMove: ; 440ce
ld de, EnemyMonMoves ld de, EnemyMonMoves
ld c, EnemyMonMovesEnd - EnemyMonMoves ld c, EnemyMonMovesEnd - EnemyMonMoves
.asm_44166 .asm_44166
; If the enemy has no moves, this will infinite.
ld a, [de] ld a, [de]
inc de inc de
and a and a
@@ -47247,22 +47250,22 @@ AIChooseMove: ; 440ce
AIScoringPointers: ; 441af AIScoringPointers: ; 441af
dw AIScoring_RedStatus dw AI_Basic
dw AIScoring_RedStatMods dw AI_Setup
dw AIScoring_RedSuperEffective dw AI_Types
dw AIScoring_Offensive dw AI_Offensive
dw AIScoring_Smart dw AI_Smart
dw AIScoring_Opportunist dw AI_Opportunist
dw AIScoring_Aggressive dw AI_Aggressive
dw AIScoring_Cautious dw AI_Cautious
dw AIScoring_StatusImmunity dw AI_Status
dw AIScoring_Risky dw AI_Risky
dw AIScoring_None dw AI_None
dw AIScoring_None dw AI_None
dw AIScoring_None dw AI_None
dw AIScoring_None dw AI_None
dw AIScoring_None dw AI_None
dw AIScoring_None dw AI_None
; 441cf ; 441cf

File diff suppressed because it is too large Load Diff