Remove all address comments

This commit is contained in:
mid-kid
2018-06-24 16:09:41 +02:00
parent 131875d3e3
commit 1d9a68dbdd
616 changed files with 12133 additions and 20380 deletions

View File

@@ -1,4 +1,4 @@
AI_SwitchOrTryItem: ; 38000
AI_SwitchOrTryItem:
and a
ld a, [wBattleMode]
@@ -38,12 +38,11 @@ AI_SwitchOrTryItem: ; 38000
jp nz, SwitchSometimes
; fallthrough
DontSwitch: ; 38041
DontSwitch:
call AI_TryItem
ret
; 38045
SwitchOften: ; 38045
SwitchOften:
callfar CheckAbleToSwitch
ld a, [wEnemySwitchMonParam]
and $f0
@@ -77,9 +76,8 @@ SwitchOften: ; 38045
; In register 'a' is the number (1-6) of the mon to switch to
ld [wEnemySwitchMonIndex], a
jp AI_TrySwitch
; 38083
SwitchRarely: ; 38083
SwitchRarely:
callfar CheckAbleToSwitch
ld a, [wEnemySwitchMonParam]
and $f0
@@ -112,9 +110,8 @@ SwitchRarely: ; 38083
inc a
ld [wEnemySwitchMonIndex], a
jp AI_TrySwitch
; 380c1
SwitchSometimes: ; 380c1
SwitchSometimes:
callfar CheckAbleToSwitch
ld a, [wEnemySwitchMonParam]
and $f0
@@ -147,17 +144,15 @@ SwitchSometimes: ; 380c1
inc a
ld [wEnemySwitchMonIndex], a
jp AI_TrySwitch
; 380ff
CheckSubstatusCantRun: ; 380ff
CheckSubstatusCantRun:
ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
; 38105
AI_TryItem: ; 38105
AI_TryItem:
; items are not allowed in the BattleTower
ld a, [wInBattleTowerBattle]
and a
@@ -244,7 +239,7 @@ AI_TryItem: ; 38105
ret
.IsHighestLevel: ; 38170
.IsHighestLevel:
ld a, [wOTPartyCount]
ld d, a
ld e, 0
@@ -274,10 +269,9 @@ AI_TryItem: ; 38105
.yes
scf
ret
; 38196
AI_Items: ; 39196
AI_Items:
dbw FULL_RESTORE, .FullRestore
dbw MAX_POTION, .MaxPotion
dbw HYPER_POTION, .HyperPotion
@@ -292,16 +286,14 @@ AI_Items: ; 39196
dbw X_SPEED, .XSpeed
dbw X_SPECIAL, .XSpecial
db -1 ; end
; 381be
.FullHeal: ; 381be
.FullHeal:
call .Status
jp c, .DontUse
call EnemyUsedFullHeal
jp .Use
; 381ca
.Status: ; 381ca (e:41ca)
.Status:
ld a, [wEnemyMonStatus]
and a
jp z, .DontUse
@@ -332,9 +324,8 @@ AI_Items: ; 39196
and 1 << FRZ | SLP
jp z, .DontUse
jp .Use
; 38208
.FullRestore: ; 38208
.FullRestore:
call .HealItem
jp nc, .UseFullRestore
ld a, [bc]
@@ -346,15 +337,14 @@ AI_Items: ; 39196
.UseFullRestore:
call EnemyUsedFullRestore
jp .Use
; 38220
.MaxPotion: ; 38220
.MaxPotion:
call .HealItem
jp c, .DontUse
call EnemyUsedMaxPotion
jp .Use
.HealItem: ; 3822c (e:422c)
.HealItem:
ld a, [bc]
bit CONTEXT_USE_F, a
jr nz, .CheckHalfOrQuarterHP
@@ -370,7 +360,7 @@ AI_Items: ; 39196
jp c, .UseHealItem
jp .DontUse
.CheckQuarterHP: ; 38254 (e:4254)
.CheckQuarterHP:
callfar AICheckEnemyQuarterHP
jp c, .DontUse
call Random
@@ -378,7 +368,7 @@ AI_Items: ; 39196
jp c, .DontUse
jr .UseHealItem
.CheckHalfOrQuarterHP: ; 38267 (e:4267)
.CheckHalfOrQuarterHP:
callfar AICheckEnemyHalfHP
jp c, .DontUse
callfar AICheckEnemyQuarterHP
@@ -387,33 +377,29 @@ AI_Items: ; 39196
cp 20 percent - 1
jp nc, .DontUse
.UseHealItem: ; 38281 (e:4281)
.UseHealItem:
jp .Use
; 38284
.HyperPotion: ; 38284
.HyperPotion:
call .HealItem
jp c, .DontUse
ld b, 200
call EnemyUsedHyperPotion
jp .Use
; 38292 (e:4292)
.SuperPotion: ; 38292
.SuperPotion:
call .HealItem
jp c, .DontUse
ld b, 50
call EnemyUsedSuperPotion
jp .Use
; 382a0
.Potion: ; 382a0
.Potion:
call .HealItem
jp c, .DontUse
ld b, 20
call EnemyUsedPotion
jp .Use
; 382ae
.asm_382ae ; This appears to be unused
callfar AICheckEnemyMaxHP
@@ -457,58 +443,50 @@ AI_Items: ; 39196
cp 39 percent + 1
jp c, .Use
jp .DontUse
; 382f9
.XAccuracy: ; 382f9
.XAccuracy:
call .XItem
jp c, .DontUse
call EnemyUsedXAccuracy
jp .Use
; 38305
.GuardSpec: ; 38305
.GuardSpec:
call .XItem
jp c, .DontUse
call EnemyUsedGuardSpec
jp .Use
; 38311
.DireHit: ; 38311
.DireHit:
call .XItem
jp c, .DontUse
call EnemyUsedDireHit
jp .Use
; 3831d (e:431d)
.XAttack: ; 3831d
.XAttack:
call .XItem
jp c, .DontUse
call EnemyUsedXAttack
jp .Use
; 38329
.XDefend: ; 38329
.XDefend:
call .XItem
jp c, .DontUse
call EnemyUsedXDefend
jp .Use
; 38335
.XSpeed: ; 38335
.XSpeed:
call .XItem
jp c, .DontUse
call EnemyUsedXSpeed
jp .Use
; 38341
.XSpecial: ; 38341
.XSpecial:
call .XItem
jp c, .DontUse
call EnemyUsedXSpecial
jp .Use
; 3834d
.XItem: ; 3834d (e:434d)
.XItem:
ld a, [wEnemyTurnsTaken]
and a
jr nz, .notfirstturnout
@@ -543,7 +521,7 @@ AI_Items: ; 39196
ret
AIUpdateHUD: ; 38387
AIUpdateHUD:
call UpdateEnemyMonInParty
farcall UpdateEnemyHUD
ld a, $1
@@ -552,29 +530,27 @@ AIUpdateHUD: ; 38387
dec [hl]
scf
ret
; 3839a
AIUsedItemSound: ; 3839a
AIUsedItemSound:
push de
ld de, SFX_FULL_HEAL
call PlaySFX
pop de
ret
; 383a3
EnemyUsedFullHeal: ; 383a3 (e:43a3)
EnemyUsedFullHeal:
call AIUsedItemSound
call AI_HealStatus
ld a, FULL_HEAL
jp PrintText_UsedItemOn_AND_AIUpdateHUD
EnemyUsedMaxPotion: ; 383ae (e:43ae)
EnemyUsedMaxPotion:
ld a, MAX_POTION
ld [wCurEnemyItem], a
jr FullRestoreContinue
EnemyUsedFullRestore: ; 383b5 (e:43b5)
EnemyUsedFullRestore:
call AI_HealStatus
ld a, FULL_RESTORE
ld [wCurEnemyItem], a
@@ -583,7 +559,7 @@ EnemyUsedFullRestore: ; 383b5 (e:43b5)
xor a
ld [wEnemyConfuseCount], a
FullRestoreContinue: ; 383c6
FullRestoreContinue:
ld de, wCurHPAnimOldHP
ld hl, wEnemyMonHP + 1
ld a, [hld]
@@ -603,23 +579,22 @@ FullRestoreContinue: ; 383c6
ld [wCurHPAnimMaxHP + 1], a
ld [wEnemyMonHP], a
jr EnemyPotionFinish
; 383e8 (e:43e8)
EnemyUsedPotion: ; 383e8
EnemyUsedPotion:
ld a, POTION
ld b, 20
jr EnemyPotionContinue
EnemyUsedSuperPotion: ; 383ee
EnemyUsedSuperPotion:
ld a, SUPER_POTION
ld b, 50
jr EnemyPotionContinue
EnemyUsedHyperPotion: ; 383f4 (e:43f4)
EnemyUsedHyperPotion:
ld a, HYPER_POTION
ld b, 200
EnemyPotionContinue: ; 383f8
EnemyPotionContinue:
ld [wCurEnemyItem], a
ld hl, wEnemyMonHP + 1
ld a, [hl]
@@ -658,7 +633,7 @@ EnemyPotionContinue: ; 383f8
ld [hl], a
ld [wCurHPAnimNewHP + 1], a
EnemyPotionFinish: ; 38436
EnemyPotionFinish:
call PrintText_UsedItemOn
hlcoord 2, 2
xor a
@@ -668,7 +643,7 @@ EnemyPotionFinish: ; 38436
jp AIUpdateHUD
AI_TrySwitch: ; 3844b
AI_TrySwitch:
; Determine whether the AI can switch based on how many Pokemon are still alive.
; If it can switch, it will.
ld a, [wOTPartyCount]
@@ -695,9 +670,8 @@ AI_TrySwitch: ; 3844b
jp nc, AI_Switch
and a
ret
; 3846c
AI_Switch: ; 3846c
AI_Switch:
ld a, $1
ld [wEnemyIsSwitching], a
ld [wEnemyGoesFirst], a
@@ -739,21 +713,18 @@ AI_Switch: ; 3846c
ret nz
scf
ret
; 384d0
TextJump_EnemyWithdrew: ; 384d0
TextJump_EnemyWithdrew:
text_jump Text_EnemyWithdrew
db "@"
; 384d5
Function384d5: ; This appears to be unused
call AIUsedItemSound
call AI_HealStatus
ld a, FULL_HEAL_RED ; X_SPEED
jp PrintText_UsedItemOn_AND_AIUpdateHUD
; 384e0
AI_HealStatus: ; 384e0
AI_HealStatus:
ld a, [wCurOTMon]
ld hl, wOTPartyMon1Status
ld bc, PARTYMON_STRUCT_LENGTH
@@ -768,31 +739,27 @@ AI_HealStatus: ; 384e0
ld hl, wEnemySubStatus5
res SUBSTATUS_TOXIC, [hl]
ret
; 384f7
EnemyUsedXAccuracy: ; 384f7
EnemyUsedXAccuracy:
call AIUsedItemSound
ld hl, wEnemySubStatus4
set SUBSTATUS_X_ACCURACY, [hl]
ld a, X_ACCURACY
jp PrintText_UsedItemOn_AND_AIUpdateHUD
; 38504
EnemyUsedGuardSpec: ; 38504
EnemyUsedGuardSpec:
call AIUsedItemSound
ld hl, wEnemySubStatus4
set SUBSTATUS_MIST, [hl]
ld a, GUARD_SPEC
jp PrintText_UsedItemOn_AND_AIUpdateHUD
; 38511
EnemyUsedDireHit: ; 38511
EnemyUsedDireHit:
call AIUsedItemSound
ld hl, wEnemySubStatus4
set SUBSTATUS_FOCUS_ENERGY, [hl]
ld a, DIRE_HIT
jp PrintText_UsedItemOn_AND_AIUpdateHUD
; 3851e
Function3851e: ; This appears to be unused
ld [hDivisor], a
@@ -818,27 +785,23 @@ Function3851e: ; This appears to be unused
ld a, e
sub c
ret
; 38541
EnemyUsedXAttack: ; 38541
EnemyUsedXAttack:
ld b, ATTACK
ld a, X_ATTACK
jr EnemyUsedXItem
; 38547
EnemyUsedXDefend: ; 38547
EnemyUsedXDefend:
ld b, DEFENSE
ld a, X_DEFEND
jr EnemyUsedXItem
; 3854d
EnemyUsedXSpeed: ; 3854d
EnemyUsedXSpeed:
ld b, SPEED
ld a, X_SPEED
jr EnemyUsedXItem
; 38553
EnemyUsedXSpecial: ; 38553
EnemyUsedXSpecial:
ld b, SP_ATTACK
ld a, X_SPECIAL
@@ -853,18 +816,16 @@ EnemyUsedXItem:
pop bc
farcall CheckIfStatCanBeRaised
jp AIUpdateHUD
; 38568
; Parameter
; a = ITEM_CONSTANT
PrintText_UsedItemOn_AND_AIUpdateHUD: ; 38568
PrintText_UsedItemOn_AND_AIUpdateHUD:
ld [wCurEnemyItem], a
call PrintText_UsedItemOn
jp AIUpdateHUD
; 38571
PrintText_UsedItemOn: ; 38571
PrintText_UsedItemOn:
ld a, [wCurEnemyItem]
ld [wd265], a
call GetItemName
@@ -874,9 +835,7 @@ PrintText_UsedItemOn: ; 38571
call CopyBytes
ld hl, TextJump_EnemyUsedOn
jp PrintText
; 3858c
TextJump_EnemyUsedOn: ; 3858c
TextJump_EnemyUsedOn:
text_jump Text_EnemyUsedOn
db "@"
; 38591

View File

@@ -1,4 +1,4 @@
AIChooseMove: ; 440ce
AIChooseMove:
; Score each move in wEnemyMonMoves starting from wBuffer1. Lower is better.
; Pick the move with the lowest score.
@@ -198,10 +198,9 @@ AIChooseMove: ; 440ce
ld a, c
ld [wCurEnemyMoveNum], a
ret
; 441af
AIScoringPointers: ; 441af
AIScoringPointers:
; entries correspond to AI_* constants
dw AI_Basic
dw AI_Setup
@@ -219,4 +218,3 @@ AIScoringPointers: ; 441af
dw AI_None
dw AI_None
dw AI_None
; 441cf

View File

@@ -1,4 +1,4 @@
AI_Redundant: ; 2c41a
AI_Redundant:
; Check if move effect c will fail because it's already been used.
; Return z if the move is a good choice.
; Return nz if the move is a bad choice.
@@ -13,7 +13,7 @@ AI_Redundant: ; 2c41a
ld l, a
jp hl
.Moves: ; 2c42c
.Moves:
dbw EFFECT_DREAM_EATER, .DreamEater
dbw EFFECT_HEAL, .Heal
dbw EFFECT_LIGHT_SCREEN, .LightScreen
@@ -46,22 +46,22 @@ AI_Redundant: ; 2c41a
dbw EFFECT_FUTURE_SIGHT, .FutureSight
db -1
.LightScreen: ; 2c487
.LightScreen:
ld a, [wEnemyScreens]
bit SCREENS_LIGHT_SCREEN, a
ret
.Mist: ; 2c48d
.Mist:
ld a, [wEnemySubStatus4]
bit SUBSTATUS_MIST, a
ret
.FocusEnergy: ; 2c493
.FocusEnergy:
ld a, [wEnemySubStatus4]
bit SUBSTATUS_FOCUS_ENERGY, a
ret
.Confuse: ; 2c499
.Confuse:
ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret nz
@@ -69,49 +69,49 @@ AI_Redundant: ; 2c41a
bit SCREENS_SAFEGUARD, a
ret
.Transform: ; 2c4a5
.Transform:
ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret
.Reflect: ; 2c4ab
.Reflect:
ld a, [wEnemyScreens]
bit SCREENS_REFLECT, a
ret
.Substitute: ; 2c4b1
.Substitute:
ld a, [wEnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
ret
.LeechSeed: ; 2c4b7
.LeechSeed:
ld a, [wPlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
ret
.Disable: ; 2c4bd
.Disable:
ld a, [wPlayerDisableCount]
and a
ret
.Encore: ; 2c4c2
.Encore:
ld a, [wPlayerSubStatus5]
bit SUBSTATUS_ENCORED, a
ret
.Snore:
.SleepTalk: ; 2c4c8
.SleepTalk:
ld a, [wEnemyMonStatus]
and SLP
jr z, .Redundant
jr .NotRedundant
.MeanLook: ; 2c4d1
.MeanLook:
ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
.Nightmare: ; 2c4d7
.Nightmare:
ld a, [wBattleMonStatus]
and a
jr z, .Redundant
@@ -119,63 +119,63 @@ AI_Redundant: ; 2c41a
bit SUBSTATUS_NIGHTMARE, a
ret
.Spikes: ; 2c4e3
.Spikes:
ld a, [wPlayerScreens]
bit SCREENS_SPIKES, a
ret
.Foresight: ; 2c4e9
.Foresight:
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_IDENTIFIED, a
ret
.PerishSong: ; 2c4ef
.PerishSong:
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_PERISH, a
ret
.Sandstorm: ; 2c4f5
.Sandstorm:
ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
jr z, .Redundant
jr .NotRedundant
.Attract: ; 2c4fe
.Attract:
farcall CheckOppositeGender
jr c, .Redundant
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_IN_LOVE, a
ret
.Safeguard: ; 2c50c
.Safeguard:
ld a, [wEnemyScreens]
bit SCREENS_SAFEGUARD, a
ret
.RainDance: ; 2c512
.RainDance:
ld a, [wBattleWeather]
cp WEATHER_RAIN
jr z, .Redundant
jr .NotRedundant
.SunnyDay: ; 2c51b
.SunnyDay:
ld a, [wBattleWeather]
cp WEATHER_SUN
jr z, .Redundant
jr .NotRedundant
.DreamEater: ; 2c524
.DreamEater:
ld a, [wBattleMonStatus]
and SLP
jr z, .Redundant
jr .NotRedundant
.Swagger: ; 2c52d
.Swagger:
ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret
.FutureSight: ; 2c533
.FutureSight:
ld a, [wEnemyScreens]
bit 5, a
ret
@@ -183,16 +183,16 @@ AI_Redundant: ; 2c41a
.Heal:
.MorningSun:
.Synthesis:
.Moonlight: ; 2c539
.Moonlight:
farcall AICheckEnemyMaxHP
jr nc, .NotRedundant
.Teleport:
.Redundant: ; 2c541
.Redundant:
ld a, 1
and a
ret
.NotRedundant: ; 2c545
.NotRedundant:
xor a
ret

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
CheckPlayerMoveTypeMatchups: ; 3484e
CheckPlayerMoveTypeMatchups:
; Check how well the moves you've already used
; fare against the enemy's Pokemon. Used to
; score a potential switch.
@@ -95,10 +95,9 @@ CheckPlayerMoveTypeMatchups: ; 3484e
pop de
pop hl
ret
; 348de
.CheckEnemyMoveMatchups: ; 348de
.CheckEnemyMoveMatchups:
ld de, wEnemyMonMoves
ld b, NUM_MOVES + 1
ld c, 0
@@ -163,21 +162,19 @@ CheckPlayerMoveTypeMatchups: ; 3484e
.doubledown
call .DecreaseScore
.DecreaseScore: ; 34931
.DecreaseScore:
ld a, [wEnemyAISwitchScore]
dec a
ld [wEnemyAISwitchScore], a
ret
; 34939
.IncreaseScore: ; 34939
.IncreaseScore:
ld a, [wEnemyAISwitchScore]
inc a
ld [wEnemyAISwitchScore], a
ret
; 34941
CheckAbleToSwitch: ; 34941
CheckAbleToSwitch:
xor a
ld [wEnemySwitchMonParam], a
call FindAliveEnemyMons
@@ -292,10 +289,9 @@ CheckAbleToSwitch: ; 34941
add $10
ld [wEnemySwitchMonParam], a
ret
; 349f4
FindAliveEnemyMons: ; 349f4
FindAliveEnemyMons:
ld a, [wOTPartyCount]
cp 2
jr c, .only_one
@@ -344,10 +340,9 @@ FindAliveEnemyMons: ; 349f4
.more_than_one
and a
ret
; 34a2a
FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
FindEnemyMonsImmuneToLastCounterMove:
ld hl, wOTPartyMon1
ld a, [wOTPartyCount]
ld b, a
@@ -412,10 +407,9 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
inc d
srl c
jr .loop
; 34a85
FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
FindAliveEnemyMonsWithASuperEffectiveMove:
push bc
ld a, [wOTPartyCount]
ld e, a
@@ -445,7 +439,7 @@ FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
and c
ld c, a
FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
FindEnemyMonsWithASuperEffectiveMove:
ld a, -1
ld [wEnemyAISwitchScore], a
@@ -551,10 +545,9 @@ FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
ld [wEnemyAISwitchScore], a
pop bc
ret
; 34b20
FindEnemyMonsThatResistPlayer: ; 34b20
FindEnemyMonsThatResistPlayer:
push bc
ld hl, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
@@ -613,10 +606,9 @@ FindEnemyMonsThatResistPlayer: ; 34b20
and c
ld c, a
ret
; 34b77
FindEnemyMonsWithAtLeastQuarterMaxHP: ; 34b77
FindEnemyMonsWithAtLeastQuarterMaxHP:
push bc
ld de, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
@@ -669,4 +661,3 @@ FindEnemyMonsWithAtLeastQuarterMaxHP: ; 34b77
and c
ld c, a
ret
; 34bb1