You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # engine/items/mart.asm
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
_AnimateHPBar: ; d627
|
||||
_AnimateHPBar:
|
||||
call .IsMaximumMoreThan48Pixels
|
||||
jr c, .MoreThan48Pixels
|
||||
call .ComputePixels
|
||||
@@ -38,9 +38,8 @@ _AnimateHPBar: ; d627
|
||||
pop af
|
||||
jr nc, .LongAnimLoop
|
||||
ret
|
||||
; d65f
|
||||
|
||||
.IsMaximumMoreThan48Pixels: ; d65f
|
||||
.IsMaximumMoreThan48Pixels:
|
||||
ld a, [wCurHPAnimMaxHP + 1]
|
||||
and a
|
||||
jr nz, .player
|
||||
@@ -53,9 +52,8 @@ _AnimateHPBar: ; d627
|
||||
.player
|
||||
scf
|
||||
ret
|
||||
; d670
|
||||
|
||||
.ComputePixels: ; d670
|
||||
.ComputePixels:
|
||||
push hl
|
||||
ld hl, wCurHPAnimMaxHP
|
||||
ld a, [hli]
|
||||
@@ -127,9 +125,8 @@ _AnimateHPBar: ; d627
|
||||
ld a, e
|
||||
ld [wCurHPAnimDeltaHP + 1], a
|
||||
ret
|
||||
; d6e2
|
||||
|
||||
ShortAnim_UpdateVariables: ; d6e2
|
||||
ShortAnim_UpdateVariables:
|
||||
ld hl, wCurHPBarPixels
|
||||
ld a, [wNewHPBarPixels]
|
||||
cp [hl]
|
||||
@@ -144,9 +141,8 @@ ShortAnim_UpdateVariables: ; d6e2
|
||||
call ShortHPBar_CalcPixelFrame
|
||||
and a
|
||||
ret
|
||||
; d6f5
|
||||
|
||||
LongAnim_UpdateVariables: ; d6f5
|
||||
LongAnim_UpdateVariables:
|
||||
.loop
|
||||
ld hl, wCurHPAnimOldHP
|
||||
ld a, [hli]
|
||||
@@ -199,9 +195,8 @@ LongAnim_UpdateVariables: ; d6f5
|
||||
ld [hl], a
|
||||
and a
|
||||
ret
|
||||
; d730
|
||||
|
||||
ShortHPBarAnim_UpdateTiles: ; d730
|
||||
ShortHPBarAnim_UpdateTiles:
|
||||
call HPBarAnim_UpdateHPRemaining
|
||||
ld d, HP_BAR_LENGTH
|
||||
ld a, [wWhichHPBar]
|
||||
@@ -215,9 +210,8 @@ ShortHPBarAnim_UpdateTiles: ; d730
|
||||
pop de
|
||||
call HPBarAnim_PaletteUpdate
|
||||
ret
|
||||
; d749
|
||||
|
||||
LongHPBarAnim_UpdateTiles: ; d749
|
||||
LongHPBarAnim_UpdateTiles:
|
||||
call HPBarAnim_UpdateHPRemaining
|
||||
ld a, [wCurHPAnimOldHP]
|
||||
ld c, a
|
||||
@@ -238,9 +232,8 @@ LongHPBarAnim_UpdateTiles: ; d749
|
||||
pop de
|
||||
call HPBarAnim_PaletteUpdate
|
||||
ret
|
||||
; d771
|
||||
|
||||
HPBarAnim_RedrawHPBar: ; d771
|
||||
HPBarAnim_RedrawHPBar:
|
||||
ld a, [wWhichHPBar]
|
||||
cp $2
|
||||
jr nz, .skip
|
||||
@@ -253,9 +246,8 @@ HPBarAnim_RedrawHPBar: ; d771
|
||||
.skip
|
||||
call DrawBattleHPBar
|
||||
ret
|
||||
; d784
|
||||
|
||||
HPBarAnim_UpdateHPRemaining: ; d784
|
||||
HPBarAnim_UpdateHPRemaining:
|
||||
ld a, [wWhichHPBar]
|
||||
and a
|
||||
ret z
|
||||
@@ -283,9 +275,8 @@ HPBarAnim_UpdateHPRemaining: ; d784
|
||||
call PrintNum
|
||||
pop hl
|
||||
ret
|
||||
; d7b4
|
||||
|
||||
HPBarAnim_PaletteUpdate: ; d7b4
|
||||
HPBarAnim_PaletteUpdate:
|
||||
ld a, [hCGB]
|
||||
and a
|
||||
ret z
|
||||
@@ -295,9 +286,8 @@ HPBarAnim_PaletteUpdate: ; d7b4
|
||||
ld c, a
|
||||
farcall ApplyHPBarPals
|
||||
ret
|
||||
; d7c9
|
||||
|
||||
HPBarAnim_BGMapUpdate: ; d7c9
|
||||
HPBarAnim_BGMapUpdate:
|
||||
ld a, [hCGB]
|
||||
and a
|
||||
jr nz, .cgb
|
||||
@@ -369,9 +359,8 @@ HPBarAnim_BGMapUpdate: ; d7c9
|
||||
ld [hBGMapThird], a
|
||||
call DelayFrame
|
||||
ret
|
||||
; d839
|
||||
|
||||
ShortHPBar_CalcPixelFrame: ; d839
|
||||
ShortHPBar_CalcPixelFrame:
|
||||
ld a, [wCurHPAnimMaxHP]
|
||||
ld c, a
|
||||
ld b, 0
|
||||
@@ -433,4 +422,3 @@ ShortHPBar_CalcPixelFrame: ; d839
|
||||
ld a, [wCurHPAnimMaxHP]
|
||||
ld [wCurHPAnimOldHP], a
|
||||
ret
|
||||
; d88c
|
||||
|
||||
@@ -6,7 +6,7 @@ BATTLETRANSITION_NO_CAVE_STRONGER EQU $18
|
||||
BATTLETRANSITION_FINISH EQU $20
|
||||
BATTLETRANSITION_END EQU $80
|
||||
|
||||
DoBattleTransition: ; 8c20f
|
||||
DoBattleTransition:
|
||||
call .InitGFX
|
||||
ld a, [rBGP]
|
||||
ld [wBGP], a
|
||||
@@ -58,9 +58,8 @@ DoBattleTransition: ; 8c20f
|
||||
ld [hVBlank], a
|
||||
call DelayFrame
|
||||
ret
|
||||
; 8c26d
|
||||
|
||||
.InitGFX: ; 8c26d
|
||||
.InitGFX:
|
||||
ld a, [wLinkMode]
|
||||
cp LINK_MOBILE
|
||||
jr z, .mobile
|
||||
@@ -87,14 +86,12 @@ DoBattleTransition: ; 8c20f
|
||||
ld [hl], a
|
||||
call WipeLYOverrides
|
||||
ret
|
||||
; 8c2a0
|
||||
|
||||
.NonMobile_LoadPokeballTiles: ; 8c2a0
|
||||
.NonMobile_LoadPokeballTiles:
|
||||
call LoadTrainerBattlePokeballTiles
|
||||
hlbgcoord 0, 0
|
||||
call ConvertTrainerBattlePokeballTilesTo2bpp
|
||||
ret
|
||||
; 8c2aa
|
||||
|
||||
LoadTrainerBattlePokeballTiles:
|
||||
; Load the tiles used in the Pokeball Graphic that fills the screen
|
||||
@@ -119,9 +116,8 @@ LoadTrainerBattlePokeballTiles:
|
||||
pop af
|
||||
ld [rVBK], a
|
||||
ret
|
||||
; 8c2cf
|
||||
|
||||
ConvertTrainerBattlePokeballTilesTo2bpp: ; 8c2cf
|
||||
ConvertTrainerBattlePokeballTilesTo2bpp:
|
||||
ld a, [rSVBK]
|
||||
push af
|
||||
ld a, BANK(wDecompressScratch)
|
||||
@@ -146,17 +142,15 @@ ConvertTrainerBattlePokeballTilesTo2bpp: ; 8c2cf
|
||||
pop af
|
||||
ld [rSVBK], a
|
||||
ret
|
||||
; 8c2f4
|
||||
|
||||
TrainerBattlePokeballTiles: ; 8c2f4
|
||||
TrainerBattlePokeballTiles:
|
||||
INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp"
|
||||
|
||||
|
||||
BattleTransitionJumptable: ; 8c314
|
||||
BattleTransitionJumptable:
|
||||
jumptable .Jumptable, wJumptableIndex
|
||||
; 8c323
|
||||
|
||||
.Jumptable ; 8c323 (23:4323)
|
||||
.Jumptable
|
||||
dw StartTrainerBattle_DetermineWhichAnimation ; 00
|
||||
|
||||
; BATTLETRANSITION_CAVE
|
||||
@@ -213,7 +207,7 @@ BattleTransitionJumptable: ; 8c314
|
||||
TRANS_STRONGER_F EQU 0 ; bit set in TRANS_CAVE_STRONGER and TRANS_NO_CAVE_STRONGER
|
||||
TRANS_NO_CAVE_F EQU 1 ; bit set in TRANS_NO_CAVE and TRANS_NO_CAVE_STRONGER
|
||||
|
||||
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
||||
StartTrainerBattle_DetermineWhichAnimation:
|
||||
; The screen flashes a different number of times depending on the level of
|
||||
; your lead Pokemon relative to the opponent's.
|
||||
; BUG: wBattleMonLevel and wEnemyMonLevel are not set at this point, so whatever
|
||||
@@ -240,41 +234,39 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
||||
ld a, [hl]
|
||||
ld [wJumptableIndex], a
|
||||
ret
|
||||
; 8c38f (23:438f)
|
||||
|
||||
.StartingPoints: ; 8c38f
|
||||
.StartingPoints:
|
||||
; entries correspond to TRANS_* constants
|
||||
db BATTLETRANSITION_CAVE
|
||||
db BATTLETRANSITION_CAVE_STRONGER
|
||||
db BATTLETRANSITION_NO_CAVE
|
||||
db BATTLETRANSITION_NO_CAVE_STRONGER
|
||||
; 8c393
|
||||
|
||||
StartTrainerBattle_Finish: ; 8c393 (23:4393)
|
||||
StartTrainerBattle_Finish:
|
||||
call ClearSprites
|
||||
ld a, BATTLETRANSITION_END
|
||||
ld [wJumptableIndex], a
|
||||
ret
|
||||
|
||||
StartTrainerBattle_NextScene: ; 8c39c (23:439c)
|
||||
StartTrainerBattle_NextScene:
|
||||
ld hl, wJumptableIndex
|
||||
inc [hl]
|
||||
ret
|
||||
|
||||
StartTrainerBattle_SetUpBGMap: ; 8c3a1 (23:43a1)
|
||||
StartTrainerBattle_SetUpBGMap:
|
||||
call StartTrainerBattle_NextScene
|
||||
xor a
|
||||
ld [wcf64], a
|
||||
ld [hBGMapMode], a
|
||||
ret
|
||||
|
||||
StartTrainerBattle_Flash: ; 8c3ab (23:43ab)
|
||||
StartTrainerBattle_Flash:
|
||||
call .DoFlashAnimation
|
||||
ret nc
|
||||
call StartTrainerBattle_NextScene
|
||||
ret
|
||||
|
||||
.DoFlashAnimation: ; 8c3b3 (23:43b3)
|
||||
.DoFlashAnimation:
|
||||
ld a, [wTimeOfDayPalset]
|
||||
cp %11111111 ; dark cave
|
||||
jr z, .done
|
||||
@@ -299,9 +291,8 @@ StartTrainerBattle_Flash: ; 8c3ab (23:43ab)
|
||||
ld [wcf64], a
|
||||
scf
|
||||
ret
|
||||
; 8c3db (23:43db)
|
||||
|
||||
.pals ; 8c3db
|
||||
.pals
|
||||
db %11111001 ; 3321
|
||||
db %11111110 ; 3332
|
||||
db %11111111 ; 3333
|
||||
@@ -315,9 +306,8 @@ StartTrainerBattle_Flash: ; 8c3ab (23:43ab)
|
||||
db %10010000 ; 2100
|
||||
db %11100100 ; 3210
|
||||
db %00000001 ; 0001
|
||||
; 8c3e8
|
||||
|
||||
StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)
|
||||
StartTrainerBattle_SetUpForWavyOutro:
|
||||
farcall Function5602
|
||||
ld a, BANK(wLYOverrides)
|
||||
ld [rSVBK], a
|
||||
@@ -335,7 +325,7 @@ StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)
|
||||
ld [wcf65], a
|
||||
ret
|
||||
|
||||
StartTrainerBattle_SineWave: ; 8c408 (23:4408)
|
||||
StartTrainerBattle_SineWave:
|
||||
ld a, [wcf64]
|
||||
cp $60
|
||||
jr nc, .end
|
||||
@@ -347,7 +337,7 @@ StartTrainerBattle_SineWave: ; 8c408 (23:4408)
|
||||
ld [wJumptableIndex], a
|
||||
ret
|
||||
|
||||
.DoSineWave: ; 8c419 (23:4419)
|
||||
.DoSineWave:
|
||||
ld hl, wcf65
|
||||
ld a, [hl]
|
||||
inc [hl]
|
||||
@@ -375,7 +365,7 @@ StartTrainerBattle_SineWave: ; 8c408 (23:4408)
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d)
|
||||
StartTrainerBattle_SetUpForSpinOutro:
|
||||
farcall Function5602
|
||||
ld a, BANK(wLYOverrides)
|
||||
ld [rSVBK], a
|
||||
@@ -384,7 +374,7 @@ StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d)
|
||||
ld [wcf64], a
|
||||
ret
|
||||
|
||||
StartTrainerBattle_SpinToBlack: ; 8c44f (23:444f)
|
||||
StartTrainerBattle_SpinToBlack:
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
ld a, [wcf64]
|
||||
@@ -418,7 +408,6 @@ endr
|
||||
ld a, BATTLETRANSITION_FINISH
|
||||
ld [wJumptableIndex], a
|
||||
ret
|
||||
; 8c490 (23:4490)
|
||||
|
||||
; quadrants
|
||||
const_def
|
||||
@@ -431,7 +420,7 @@ endr
|
||||
RIGHT_QUADRANT_F EQU 0 ; bit set in UPPER_RIGHT and LOWER_RIGHT
|
||||
LOWER_QUADRANT_F EQU 1 ; bit set in LOWER_LEFT and LOWER_RIGHT
|
||||
|
||||
.spintable ; 8c490
|
||||
.spintable
|
||||
spintable_entry: MACRO
|
||||
db \1
|
||||
dw .wedge\2
|
||||
@@ -458,9 +447,8 @@ ENDM
|
||||
spintable_entry LOWER_LEFT, 2, 0, 14
|
||||
spintable_entry LOWER_LEFT, 1, 1, 11
|
||||
db -1
|
||||
; 8c4f5
|
||||
|
||||
.load ; 8c4f5 (23:44f5)
|
||||
.load
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld a, [hli]
|
||||
@@ -512,16 +500,14 @@ ENDM
|
||||
dec c
|
||||
jr nz, .loop2
|
||||
jr .loop
|
||||
; 8c538 (23:4538)
|
||||
|
||||
.wedge1 db 2, 3, 5, 4, 9, -1
|
||||
.wedge2 db 1, 1, 2, 2, 4, 2, 4, 2, 3, -1
|
||||
.wedge3 db 2, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 2, 1, 1, 1, 1, -1
|
||||
.wedge4 db 4, 1, 4, 0, 3, 1, 3, 0, 2, 1, 2, 0, 1, -1
|
||||
.wedge5 db 4, 0, 3, 0, 3, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, -1
|
||||
; 8c578
|
||||
|
||||
StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578)
|
||||
StartTrainerBattle_SetUpForRandomScatterOutro:
|
||||
farcall Function5602
|
||||
ld a, BANK(wLYOverrides)
|
||||
ld [rSVBK], a
|
||||
@@ -532,7 +518,7 @@ StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578)
|
||||
ld [hBGMapMode], a
|
||||
ret
|
||||
|
||||
StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
|
||||
StartTrainerBattle_SpeckleToBlack:
|
||||
ld hl, wcf64
|
||||
ld a, [hl]
|
||||
and a
|
||||
@@ -559,7 +545,7 @@ StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
|
||||
ld [wJumptableIndex], a
|
||||
ret
|
||||
|
||||
.BlackOutRandomTile: ; 8c5b8 (23:45b8)
|
||||
.BlackOutRandomTile:
|
||||
.y_loop
|
||||
call Random
|
||||
cp SCREEN_HEIGHT
|
||||
@@ -590,7 +576,7 @@ StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
|
||||
ld [hl], $ff
|
||||
ret
|
||||
|
||||
StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
|
||||
StartTrainerBattle_LoadPokeBallGraphics:
|
||||
ld a, [wOtherTrainerClass]
|
||||
and a
|
||||
jp z, .nextscene ; don't need to be here if wild
|
||||
@@ -690,11 +676,11 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
|
||||
call DelayFrame
|
||||
call BattleStart_CopyTilemapAtOnce
|
||||
|
||||
.nextscene ; 8c673 (23:4673)
|
||||
.nextscene
|
||||
call StartTrainerBattle_NextScene
|
||||
ret
|
||||
|
||||
.copypals ; 8c677 (23:4677)
|
||||
.copypals
|
||||
ld de, wBGPals1 palette PAL_BG_TEXT
|
||||
call .copy
|
||||
ld de, wBGPals2 palette PAL_BG_TEXT
|
||||
@@ -707,21 +693,18 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
|
||||
call .copy
|
||||
ld de, wOBPals2 palette PAL_OW_ROCK
|
||||
|
||||
.copy ; 8c698 (23:4698)
|
||||
.copy
|
||||
push hl
|
||||
ld bc, 1 palettes
|
||||
call CopyBytes
|
||||
pop hl
|
||||
ret
|
||||
; 8c6a1 (23:46a1)
|
||||
|
||||
.daypals ; 8c6a1
|
||||
.daypals
|
||||
INCLUDE "gfx/overworld/trainer_battle_day.pal"
|
||||
; 8c6a9
|
||||
|
||||
.nightpals ; 8c6a9
|
||||
.nightpals
|
||||
INCLUDE "gfx/overworld/trainer_battle_nite.pal"
|
||||
; 8c6b1
|
||||
|
||||
.loadpokeballgfx
|
||||
ld a, [wOtherTrainerClass]
|
||||
@@ -746,7 +729,7 @@ PokeBallTransition:
|
||||
db %00001111, %11110000
|
||||
db %00000011, %11000000
|
||||
|
||||
WipeLYOverrides: ; 8c6d8
|
||||
WipeLYOverrides:
|
||||
ld a, [rSVBK]
|
||||
push af
|
||||
ld a, BANK(wLYOverrides)
|
||||
@@ -760,9 +743,8 @@ WipeLYOverrides: ; 8c6d8
|
||||
pop af
|
||||
ld [rSVBK], a
|
||||
ret
|
||||
; 8c6ef
|
||||
|
||||
.wipe ; 8c6ef
|
||||
.wipe
|
||||
xor a
|
||||
ld c, SCREEN_HEIGHT_PX
|
||||
.loop
|
||||
@@ -770,14 +752,12 @@ WipeLYOverrides: ; 8c6d8
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ret
|
||||
; 8c6f7
|
||||
|
||||
|
||||
StartTrainerBattle_DrawSineWave: ; 8c6f7 (23:46f7)
|
||||
StartTrainerBattle_DrawSineWave:
|
||||
calc_sine_wave
|
||||
; 8c768
|
||||
|
||||
StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
|
||||
StartTrainerBattle_ZoomToBlack:
|
||||
farcall Function5602
|
||||
ld de, .boxes
|
||||
|
||||
@@ -806,9 +786,8 @@ StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
|
||||
ld a, BATTLETRANSITION_FINISH
|
||||
ld [wJumptableIndex], a
|
||||
ret
|
||||
; 8c792 (23:4792)
|
||||
|
||||
.boxes ; 8c792
|
||||
.boxes
|
||||
zoombox: MACRO
|
||||
; width, height, start y, start x
|
||||
db \1, \2
|
||||
@@ -824,9 +803,8 @@ ENDM
|
||||
zoombox 18, 16, 1, 1
|
||||
zoombox 20, 18, 0, 0
|
||||
db -1
|
||||
; 8c7b7
|
||||
|
||||
.Copy: ; 8c7b7 (23:47b7)
|
||||
.Copy:
|
||||
ld a, $ff
|
||||
.row
|
||||
push bc
|
||||
@@ -842,7 +820,6 @@ ENDM
|
||||
dec b
|
||||
jr nz, .row
|
||||
ret
|
||||
; 8c7c9 (23:47c9)
|
||||
|
||||
Unreferenced_Function8c7c9:
|
||||
ld a, $1
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
BattleStart_CopyTilemapAtOnce: ; 8cf4f
|
||||
BattleStart_CopyTilemapAtOnce:
|
||||
call CGBOnly_CopyTilemapAtOnce
|
||||
ret
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CheckBattleScene: ; 4ea44
|
||||
CheckBattleScene:
|
||||
; Return carry if battle scene is turned off.
|
||||
|
||||
ld a, BANK(wLinkMode)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
ConsumeHeldItem: ; 27192
|
||||
ConsumeHeldItem:
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
HiddenPowerDamage: ; fbced
|
||||
HiddenPowerDamage:
|
||||
; Override Hidden Power's type and power based on the user's DVs.
|
||||
|
||||
ld hl, wBattleMonDVs
|
||||
@@ -108,4 +108,3 @@ HiddenPowerDamage: ; fbced
|
||||
pop af
|
||||
ld d, a
|
||||
ret
|
||||
; fbd54
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
DetermineLinkBattleResult: ; 2b930
|
||||
DetermineLinkBattleResult:
|
||||
farcall UpdateEnemyMonInParty
|
||||
ld hl, wPartyMon1HP
|
||||
call .CountMonsRemaining
|
||||
@@ -58,7 +58,7 @@ DetermineLinkBattleResult: ; 2b930
|
||||
ld [wBattleResult], a
|
||||
ret
|
||||
|
||||
.CountMonsRemaining: ; 2b995
|
||||
.CountMonsRemaining:
|
||||
ld c, 0
|
||||
ld b, 3
|
||||
ld de, PARTYMON_STRUCT_LENGTH - 1
|
||||
@@ -74,7 +74,7 @@ DetermineLinkBattleResult: ; 2b930
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
.CalcPercentHPRemaining: ; 2b9a6
|
||||
.CalcPercentHPRemaining:
|
||||
ld de, 0
|
||||
ld c, $3
|
||||
.loop2
|
||||
@@ -117,7 +117,7 @@ DetermineLinkBattleResult: ; 2b930
|
||||
jr nz, .loop2
|
||||
ret
|
||||
|
||||
.BothSides_CheckNumberMonsAtFullHealth: ; 2b9e1
|
||||
.BothSides_CheckNumberMonsAtFullHealth:
|
||||
ld hl, wPartyMon1HP
|
||||
call .CheckFaintedOrFullHealth
|
||||
jr nz, .finish ; we have a pokemon that's neither fainted nor at full health
|
||||
@@ -136,7 +136,7 @@ DetermineLinkBattleResult: ; 2b930
|
||||
and a
|
||||
ret
|
||||
|
||||
.CheckFaintedOrFullHealth: ; 2ba01
|
||||
.CheckFaintedOrFullHealth:
|
||||
ld d, 3
|
||||
.loop3
|
||||
ld a, [hli]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
LoadBattleMenu: ; 24ef2
|
||||
LoadBattleMenu:
|
||||
ld hl, BattleMenuHeader
|
||||
call LoadMenuHeader
|
||||
ld a, [wBattleMenuCursorBuffer]
|
||||
@@ -8,21 +8,18 @@ LoadBattleMenu: ; 24ef2
|
||||
ld [wBattleMenuCursorBuffer], a
|
||||
call ExitMenu
|
||||
ret
|
||||
; 24f0b
|
||||
|
||||
SafariBattleMenu: ; 24f0b
|
||||
SafariBattleMenu:
|
||||
; untranslated
|
||||
ld hl, MenuHeader_0x24f4e
|
||||
call LoadMenuHeader
|
||||
jr Function24f19
|
||||
; 24f13
|
||||
|
||||
ContestBattleMenu: ; 24f13
|
||||
ContestBattleMenu:
|
||||
ld hl, MenuHeader_0x24f89
|
||||
call LoadMenuHeader
|
||||
; 24f19
|
||||
|
||||
Function24f19: ; 24f19
|
||||
Function24f19:
|
||||
ld a, [wBattleMenuCursorBuffer]
|
||||
ld [wMenuCursorBuffer], a
|
||||
call _2DMenu
|
||||
@@ -30,86 +27,74 @@ Function24f19: ; 24f19
|
||||
ld [wBattleMenuCursorBuffer], a
|
||||
call ExitMenu
|
||||
ret
|
||||
; 24f2c
|
||||
|
||||
BattleMenuHeader: ; 24f2c
|
||||
BattleMenuHeader:
|
||||
db MENU_BACKUP_TILES ; flags
|
||||
menu_coords 8, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
||||
dw MenuData_0x24f34
|
||||
db 1 ; default option
|
||||
; 24f34
|
||||
|
||||
MenuData_0x24f34: ; 0x24f34
|
||||
MenuData_0x24f34:
|
||||
db STATICMENU_CURSOR | STATICMENU_DISABLE_B ; flags
|
||||
dn 2, 2 ; rows, columns
|
||||
db 6 ; spacing
|
||||
dba Strings24f3d
|
||||
dbw BANK(MenuData_0x24f34), 0
|
||||
; 0x24f3d
|
||||
|
||||
Strings24f3d: ; 0x24f3d
|
||||
Strings24f3d:
|
||||
db "FIGHT@"
|
||||
db "<PKMN>@"
|
||||
db "PACK@"
|
||||
db "RUN@"
|
||||
; 24f4e
|
||||
|
||||
MenuHeader_0x24f4e: ; 24f4e
|
||||
MenuHeader_0x24f4e:
|
||||
db MENU_BACKUP_TILES ; flags
|
||||
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
||||
dw MenuData_0x24f56
|
||||
db 1 ; default option
|
||||
; 24f56
|
||||
|
||||
MenuData_0x24f56: ; 24f56
|
||||
MenuData_0x24f56:
|
||||
db STATICMENU_CURSOR | STATICMENU_DISABLE_B ; flags
|
||||
dn 2, 2 ; rows, columns
|
||||
db 11 ; spacing
|
||||
dba Strings24f5f
|
||||
dba Function24f7c
|
||||
; 24f5f
|
||||
|
||||
Strings24f5f: ; 24f5f
|
||||
Strings24f5f:
|
||||
db "サファりボール× @" ; "SAFARI BALL× @"
|
||||
db "エサをなげる@" ; "THROW BAIT"
|
||||
db "いしをなげる@" ; "THROW ROCK"
|
||||
db "にげる@" ; "RUN"
|
||||
; 24f7c
|
||||
|
||||
Function24f7c: ; 24f7c
|
||||
Function24f7c:
|
||||
hlcoord 17, 13
|
||||
ld de, wSafariBallsRemaining
|
||||
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
|
||||
call PrintNum
|
||||
ret
|
||||
; 24f89
|
||||
|
||||
MenuHeader_0x24f89: ; 24f89
|
||||
MenuHeader_0x24f89:
|
||||
db MENU_BACKUP_TILES ; flags
|
||||
menu_coords 2, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
||||
dw MenuData_0x24f91
|
||||
db 1 ; default option
|
||||
; 24f91
|
||||
|
||||
MenuData_0x24f91: ; 24f91
|
||||
MenuData_0x24f91:
|
||||
db STATICMENU_CURSOR | STATICMENU_DISABLE_B ; flags
|
||||
dn 2, 2 ; rows, columns
|
||||
db 12 ; spacing
|
||||
dba Strings24f9a
|
||||
dba Function24fb2
|
||||
; 24f9a
|
||||
|
||||
Strings24f9a: ; 24f9a
|
||||
Strings24f9a:
|
||||
db "FIGHT@"
|
||||
db "<PKMN>", "@"
|
||||
db "PARKBALL× @"
|
||||
db "RUN@"
|
||||
; 24fb2
|
||||
|
||||
Function24fb2: ; 24fb2
|
||||
Function24fb2:
|
||||
hlcoord 13, 16
|
||||
ld de, wParkBallsRemaining
|
||||
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
|
||||
call PrintNum
|
||||
ret
|
||||
; 24fbf
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
_DisappearUser: ; fbd54
|
||||
_DisappearUser:
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
ld a, [hBattleTurn]
|
||||
@@ -12,14 +12,14 @@ _DisappearUser: ; fbd54
|
||||
call ClearBox
|
||||
jr FinishAppearDisappearUser
|
||||
|
||||
_AppearUserRaiseSub: ; fbd69 (3e:7d69)
|
||||
_AppearUserRaiseSub:
|
||||
farcall BattleCommand_RaiseSubNoAnim
|
||||
jr AppearUser
|
||||
|
||||
_AppearUserLowerSub: ; fbd71 (3e:7d71)
|
||||
_AppearUserLowerSub:
|
||||
farcall BattleCommand_LowerSubNoAnim
|
||||
|
||||
AppearUser: ; fbd77 (3e:7d77)
|
||||
AppearUser:
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
ld a, [hBattleTurn]
|
||||
@@ -34,23 +34,23 @@ AppearUser: ; fbd77 (3e:7d77)
|
||||
.okay
|
||||
ld [hGraphicStartTile], a
|
||||
predef PlaceGraphic
|
||||
FinishAppearDisappearUser: ; fbd91 (3e:7d91)
|
||||
FinishAppearDisappearUser:
|
||||
ld a, $1
|
||||
ld [hBGMapMode], a
|
||||
ret
|
||||
|
||||
GetEnemyFrontpicCoords: ; fbd96 (3e:7d96)
|
||||
GetEnemyFrontpicCoords:
|
||||
hlcoord 12, 0
|
||||
lb bc, 7, 7
|
||||
ret
|
||||
|
||||
GetPlayerBackpicCoords: ; fbd9d (3e:7d9d)
|
||||
GetPlayerBackpicCoords:
|
||||
hlcoord 2, 6
|
||||
lb bc, 6, 6
|
||||
ret
|
||||
|
||||
|
||||
DoWeatherModifiers: ; fbda4
|
||||
DoWeatherModifiers:
|
||||
|
||||
ld de, WeatherTypeModifiers
|
||||
ld a, [wBattleWeather]
|
||||
@@ -148,7 +148,7 @@ DoWeatherModifiers: ; fbda4
|
||||
INCLUDE "data/battle/weather_modifiers.asm"
|
||||
|
||||
|
||||
DoBadgeTypeBoosts: ; fbe24
|
||||
DoBadgeTypeBoosts:
|
||||
ld a, [wLinkMode]
|
||||
and a
|
||||
ret nz
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
BattleCommand_Attract: ; 377ce
|
||||
BattleCommand_Attract:
|
||||
; attract
|
||||
ld a, [wAttackMissed]
|
||||
and a
|
||||
@@ -21,10 +21,9 @@ BattleCommand_Attract: ; 377ce
|
||||
|
||||
.failed
|
||||
jp FailMove
|
||||
; 377f5
|
||||
|
||||
|
||||
CheckOppositeGender: ; 377f5
|
||||
CheckOppositeGender:
|
||||
ld a, MON_SPECIES
|
||||
call BattlePartyAttr
|
||||
ld a, [hl]
|
||||
@@ -76,4 +75,3 @@ CheckOppositeGender: ; 377f5
|
||||
.genderless_samegender
|
||||
scf
|
||||
ret
|
||||
; 3784b
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
BattleCommand_BatonPass: ; 379c9
|
||||
BattleCommand_BatonPass:
|
||||
; batonpass
|
||||
|
||||
ld a, [hBattleTurn]
|
||||
@@ -81,10 +81,9 @@ BattleCommand_BatonPass: ; 379c9
|
||||
|
||||
jr ResetBatonPassStatus
|
||||
|
||||
; 37a67
|
||||
|
||||
|
||||
BatonPass_LinkPlayerSwitch: ; 37a67
|
||||
BatonPass_LinkPlayerSwitch:
|
||||
ld a, [wLinkMode]
|
||||
and a
|
||||
ret z
|
||||
@@ -101,10 +100,9 @@ BatonPass_LinkPlayerSwitch: ; 37a67
|
||||
ld [wBattlePlayerAction], a
|
||||
ret
|
||||
|
||||
; 37a82
|
||||
|
||||
|
||||
BatonPass_LinkEnemySwitch: ; 37a82
|
||||
BatonPass_LinkEnemySwitch:
|
||||
ld a, [wLinkMode]
|
||||
and a
|
||||
ret z
|
||||
@@ -129,17 +127,15 @@ BatonPass_LinkEnemySwitch: ; 37a82
|
||||
.switch
|
||||
jp CloseWindow
|
||||
|
||||
; 37aab
|
||||
|
||||
|
||||
FailedBatonPass: ; 37aab
|
||||
FailedBatonPass:
|
||||
call AnimateFailedMove
|
||||
jp PrintButItFailed
|
||||
|
||||
; 37ab1
|
||||
|
||||
|
||||
ResetBatonPassStatus: ; 37ab1
|
||||
ResetBatonPassStatus:
|
||||
; Reset status changes that aren't passed by Baton Pass.
|
||||
|
||||
; Nightmare isn't passed.
|
||||
@@ -178,10 +174,9 @@ ResetBatonPassStatus: ; 37ab1
|
||||
ld [wEnemyWrapCount], a
|
||||
ret
|
||||
|
||||
; 37ae9
|
||||
|
||||
|
||||
CheckAnyOtherAlivePartyMons: ; 37ae9
|
||||
CheckAnyOtherAlivePartyMons:
|
||||
ld hl, wPartyMon1HP
|
||||
ld a, [wPartyCount]
|
||||
ld d, a
|
||||
@@ -189,10 +184,9 @@ CheckAnyOtherAlivePartyMons: ; 37ae9
|
||||
ld e, a
|
||||
jr CheckAnyOtherAliveMons
|
||||
|
||||
; 37af6
|
||||
|
||||
|
||||
CheckAnyOtherAliveEnemyMons: ; 37af6
|
||||
CheckAnyOtherAliveEnemyMons:
|
||||
ld hl, wOTPartyMon1HP
|
||||
ld a, [wOTPartyCount]
|
||||
ld d, a
|
||||
@@ -200,9 +194,8 @@ CheckAnyOtherAliveEnemyMons: ; 37af6
|
||||
ld e, a
|
||||
|
||||
; fallthrough
|
||||
; 37b01
|
||||
|
||||
CheckAnyOtherAliveMons: ; 37b01
|
||||
CheckAnyOtherAliveMons:
|
||||
; Check for nonzero HP starting from partymon
|
||||
; HP at hl for d partymons, besides current mon e.
|
||||
|
||||
@@ -238,4 +231,3 @@ CheckAnyOtherAliveMons: ; 37b01
|
||||
and a
|
||||
ret
|
||||
|
||||
; 37b1d
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
BattleCommand_BeatUp: ; 35461
|
||||
BattleCommand_BeatUp:
|
||||
; beatup
|
||||
|
||||
call ResetDamage
|
||||
@@ -193,17 +193,15 @@ BattleCommand_BeatUp: ; 35461
|
||||
ld d, a
|
||||
ret
|
||||
|
||||
; 355b0
|
||||
|
||||
|
||||
.beatup_fail ; 355b0
|
||||
.beatup_fail
|
||||
ld b, buildopponentrage_command
|
||||
jp SkipToBattleCommand
|
||||
|
||||
; 355b5
|
||||
|
||||
|
||||
BattleCommand_BeatUpFailText: ; 355b5
|
||||
BattleCommand_BeatUpFailText:
|
||||
; beatupfailtext
|
||||
|
||||
ld a, [wBeatUpHitAtLeastOnce]
|
||||
@@ -212,10 +210,9 @@ BattleCommand_BeatUpFailText: ; 355b5
|
||||
|
||||
jp PrintButItFailed
|
||||
|
||||
; 355bd
|
||||
|
||||
|
||||
GetBeatupMonLocation: ; 355bd
|
||||
GetBeatupMonLocation:
|
||||
push bc
|
||||
ld c, a
|
||||
ld b, 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
BattleCommand_BellyDrum: ; 37c1a
|
||||
BattleCommand_BellyDrum:
|
||||
; bellydrum
|
||||
; This command is buggy because it raises the user's attack
|
||||
; before checking that it has enough HP to use the move.
|
||||
@@ -33,4 +33,3 @@ BattleCommand_BellyDrum: ; 37c1a
|
||||
call AnimateFailedMove
|
||||
jp PrintButItFailed
|
||||
|
||||
; 37c55
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user