Battle type constants in the wild.

Also add constants for trap and Celebi event battles.
This commit is contained in:
yenatch 2014-06-13 22:53:20 -07:00
parent eb9fc6676c
commit e23f341258
16 changed files with 60 additions and 54 deletions

View File

@ -58,7 +58,7 @@ Function3c000: ; 3c000
ld a, [BattleType] ld a, [BattleType]
cp $2 cp $2
jp z, Function3c0e2 jp z, Function3c0e2
cp $3 cp BATTLETYPE_TUTORIAL
jp z, Function3c0e2 jp z, Function3c0e2
xor a xor a
ld [CurPartyMon], a ld [CurPartyMon], a
@ -2459,7 +2459,7 @@ Function3cfa4: ; 3cfa4
ld c, $28 ld c, $28
call DelayFrames call DelayFrames
ld a, [BattleType] ld a, [BattleType]
cp $1 cp BATTLETYPE_CANLOSE
jr nz, .asm_3cfe8 jr nz, .asm_3cfe8
ld a, $2 ld a, $2
call Predef call Predef
@ -3717,13 +3717,13 @@ Function3d7c7: ; 3d7c7
ld [$cfca], a ld [$cfca], a
ld [$c689], a ld [$c689], a
call SetEnemyTurn call SetEnemyTurn
ld de, $0101 ld de, ANIM_SEND_OUT_MON
call Function3ee17 call Function3ee17
call Function3da79 call Function3da79
jr nc, .asm_3d800 jr nc, .asm_3d800
ld a, $1 ld a, $1
ld [$c689], a ld [$c689], a
ld de, $0101 ld de, ANIM_SEND_OUT_MON
call Function3ee17 call Function3ee17
.asm_3d800 .asm_3d800
@ -3773,7 +3773,7 @@ NewEnemyMonStatus: ; 3d834
ld [$c731], a ld [$c731], a
ld [EnemyTurnsTaken], a ld [EnemyTurnsTaken], a
ld hl, PlayerSubStatus5 ld hl, PlayerSubStatus5
res 7, [hl] res SUBSTATUS_CANT_RUN, [hl]
ret ret
; 3d867 ; 3d867
@ -3793,7 +3793,7 @@ Function3d873: ; 3d873
ld e, a ld e, a
xor a xor a
ld hl, PartyMon1HP ld hl, PartyMon1HP
ld bc, $002f ld bc, PartyMon2 - (PartyMon1 + 1)
.asm_3d87e .asm_3d87e
or [hl] or [hl]
inc hl inc hl
@ -3842,13 +3842,13 @@ Function3d8b3: ; 3d8b3
jp z, .asm_3d9a2 jp z, .asm_3d9a2
cp $6 cp $6
jp z, .asm_3d9a2 jp z, .asm_3d9a2
cp $9 cp BATTLETYPE_TRAP
jp z, .asm_3d98d jp z, .asm_3d98d
cp $b cp BATTLETYPE_CELEBI
jp z, .asm_3d98d jp z, .asm_3d98d
cp $7 cp BATTLETYPE_SHINY
jp z, .asm_3d98d jp z, .asm_3d98d
cp $c cp BATTLETYPE_SUICUNE
jp z, .asm_3d98d jp z, .asm_3d98d
ld a, [InLinkBattle] ld a, [InLinkBattle]
@ -3860,7 +3860,7 @@ Function3d8b3: ; 3d8b3
jp nz, .asm_3d992 jp nz, .asm_3d992
ld a, [EnemySubStatus5] ld a, [EnemySubStatus5]
bit 7, a bit SUBSTATUS_CANT_RUN, a
jp nz, .asm_3d98d jp nz, .asm_3d98d
ld a, [$c730] ld a, [$c730]
@ -5093,7 +5093,7 @@ Function3e139: ; 3e139
ld a, [BattleType] ld a, [BattleType]
cp $2 cp $2
jr z, .asm_3e156 jr z, .asm_3e156
cp $3 cp BATTLETYPE_TUTORIAL
jr z, .asm_3e156 jr z, .asm_3e156
call EmptyBattleTextBox call EmptyBattleTextBox
call UpdateBattleHuds call UpdateBattleHuds
@ -5173,7 +5173,7 @@ Function3e1c7: ; 3e1c7
jp nz, Function3e22b jp nz, Function3e22b
call Function1d6e call Function1d6e
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jr z, .asm_3e1f1 jr z, .asm_3e1f1
cp $6 cp $6
jr z, .asm_3e201 jr z, .asm_3e201
@ -5234,7 +5234,7 @@ Function3e234: ; 3e234
call Function3ed9f call Function3ed9f
call ClearSprites call ClearSprites
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jr z, .asm_3e25d jr z, .asm_3e25d
call Function3f43d call Function3f43d
@ -9527,8 +9527,8 @@ BattleStartMessage: ; 3fc8b
ld hl, PokemonFellFromTreeText ld hl, PokemonFellFromTreeText
cp BATTLETYPE_TREE cp BATTLETYPE_TREE
jr z, .asm_3fd0e jr z, .asm_3fd0e
ld hl, WildPokemonAppearedText2 ld hl, WildCelebiAppearedText
cp $b cp BATTLETYPE_CELEBI
jr z, .asm_3fd0e jr z, .asm_3fd0e
ld hl, WildPokemonAppearedText ld hl, WildPokemonAppearedText

View File

@ -7083,7 +7083,7 @@ BattleCommanda0: ; 36778
jr z, .asm_367b9 jr z, .asm_367b9
cp $9 cp $9
jr z, .asm_367b9 jr z, .asm_367b9
cp $b cp BATTLETYPE_CELEBI
jr z, .asm_367b9 jr z, .asm_367b9
cp BATTLETYPE_SUICUNE cp BATTLETYPE_SUICUNE
jr z, .asm_367b9 jr z, .asm_367b9
@ -7175,7 +7175,7 @@ BattleCommand23: ; 3680f
jp z, .asm_36969 jp z, .asm_36969
cp $9 cp $9
jp z, .asm_36969 jp z, .asm_36969
cp $b cp BATTLETYPE_CELEBI
jp z, .asm_36969 jp z, .asm_36969
cp BATTLETYPE_SUICUNE cp BATTLETYPE_SUICUNE
jp z, .asm_36969 jp z, .asm_36969

View File

@ -48,7 +48,9 @@ BATTLETYPE_FISH EQU $04
BATTLETYPE_ROAMING EQU $05 BATTLETYPE_ROAMING EQU $05
BATTLETYPE_SHINY EQU $07 BATTLETYPE_SHINY EQU $07
BATTLETYPE_TREE EQU $08 BATTLETYPE_TREE EQU $08
BATTLETYPE_TRAP EQU $09
BATTLETYPE_FORCEITEM EQU $0a BATTLETYPE_FORCEITEM EQU $0a
BATTLETYPE_CELEBI EQU $0b
BATTLETYPE_SUICUNE EQU $0c BATTLETYPE_SUICUNE EQU $0c
; battle variables ; battle variables

View File

@ -1583,7 +1583,7 @@ Function36f5:: ; 36f5
Function3718:: ; 3718 Function3718:: ; 3718
ld a, [BattleType] ld a, [BattleType]
cp $1 cp BATTLETYPE_CANLOSE
jr .asm_3724 jr .asm_3724
ld hl, WalkingTile ld hl, WalkingTile

View File

@ -238,10 +238,10 @@ ParkBall: ; e8a2
ld a, [EnemyMonCatchRate] ld a, [EnemyMonCatchRate]
ld b, a ld b, a
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jp z, .asm_e99c jp z, .asm_e99c
ld a, [CurItem] ld a, [CurItem]
cp $1 cp MASTER_BALL
jp z, .asm_e99c jp z, .asm_e99c
ld a, [CurItem] ld a, [CurItem]
ld c, a ld c, a

View File

@ -10585,7 +10585,7 @@ Functioncfaf: ; cfaf
ld [$d22e], a ld [$d22e], a
ld a, e ld a, e
ld [CurPartyLevel], a ld [CurPartyLevel], a
ld a, $4 ld a, BATTLETYPE_FISH
ld [BattleType], a ld [BattleType], a
ld a, $2 ld a, $2
ret ret
@ -16003,7 +16003,7 @@ Function1089d: ; 1089d
ld e, a ld e, a
ld d, $0 ld d, $0
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jr z, .asm_108b3 jr z, .asm_108b3
ld a, [PlayerGender] ld a, [PlayerGender]
bit 0, a bit 0, a
@ -16127,7 +16127,7 @@ Function10955: ; 10955
ld a, $24 ld a, $24
call ByteFill call ByteFill
hlcoord 5, 1 hlcoord 5, 1
ld bc, $0b0f lb bc, 11, 15
call ClearBox call ClearBox
ld hl, TileMap ld hl, TileMap
ld a, $28 ld a, $28
@ -16140,7 +16140,7 @@ Function10955: ; 10955
call Function109bb call Function109bb
call Function109a5 call Function109a5
hlcoord 0, 12 hlcoord 0, 12
ld bc, $0412 lb bc, 4, 18
call TextBox call TextBox
call EnableLCD call EnableLCD
call Function1089d call Function1089d
@ -36142,7 +36142,7 @@ Function2715c: ; 2715c
call WhiteBGMap call WhiteBGMap
call ClearTileMap call ClearTileMap
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jr z, .asm_27171 jr z, .asm_27171
callba Function3f43d callba Function3f43d
jr .asm_27177 jr .asm_27177
@ -40583,7 +40583,7 @@ Function2a0e7:: ; 2a0e7
ret ret
.asm_2a0f8 .asm_2a0f8
xor a xor a ; BATTLETYPE_NORMAL
ld [$d22e], a ld [$d22e], a
ld [BattleType], a ld [BattleType], a
ld a, 1 ld a, 1
@ -40984,6 +40984,7 @@ Function2a2ce: ; 2a2ce
ld [CurPartyLevel], a ld [CurPartyLevel], a
ld a, BATTLETYPE_ROAMING ld a, BATTLETYPE_ROAMING
ld [BattleType], a ld [BattleType], a
pop hl pop hl
scf scf
ret ret
@ -42840,9 +42841,10 @@ Function2c9b1: ; 2c9b1 (b:49b1)
; known jump sources: 2c8d6 (b:48d6), 2c915 (b:4915), 2c9bf (b:49bf), 2c9dc (b:49dc) ; known jump sources: 2c8d6 (b:48d6), 2c915 (b:4915), 2c9bf (b:49bf), 2c9dc (b:49dc)
Function2c9e2: ; 2c9e2 (b:49e2) Function2c9e2: ; 2c9e2 (b:49e2)
ld a, [BattleType] ; $d230 ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jp z, Function2caca jp z, Function2caca
hlcoord 5, 2 hlcoord 5, 2
ld bc, $a0f ld bc, $a0f
ld a, $7f ld a, $7f
@ -52591,7 +52593,7 @@ Function49bed: ; 49bed
; 49bf3 ; 49bf3
Function49bf3: ; 49bf3 Function49bf3: ; 49bf3
ld a, $b ld a, BATTLETYPE_CELEBI
ld [BattleType], a ld [BattleType], a
ret ret
; 49bf9 ; 49bf9
@ -58218,11 +58220,11 @@ Jumptable_4e564: ; 4e564 (13:6564)
Function4e56a: ; 4e56a (13:656a) Function4e56a: ; 4e56a (13:656a)
ld hl, PlayerName ; $d47d ld hl, PlayerName ; $d47d
ld de, MomsName ; $d488 ld de, MomsName ; $d488
ld bc, $b ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ld hl, String_4e5da ld hl, String_4e5da
ld de, PlayerName ; $d47d ld de, PlayerName ; $d47d
ld bc, $b ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
call Function4e5b7 call Function4e5b7
xor a xor a
@ -58242,7 +58244,7 @@ Function4e56a: ; 4e56a (13:656a)
ld [Options], a ; $cfcc ld [Options], a ; $cfcc
ld hl, MomsName ; $d488 ld hl, MomsName ; $d488
ld de, PlayerName ; $d47d ld de, PlayerName ; $d47d
ld bc, $b ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ret ret
@ -63190,7 +63192,7 @@ Unknown_80671: ; 80671
Function806c5: ; 806c5 Function806c5: ; 806c5
; Caught mons. ; Caught mons.
ld hl, PokedexCaught ld hl, PokedexCaught
ld b, $20 ld b, EndPokedexCaught - PokedexCaught
call CountSetBits call CountSetBits
ld a, [$d265] ld a, [$d265]
jp Function8066c jp Function8066c
@ -63199,7 +63201,7 @@ Function806c5: ; 806c5
Function806d3: ; 806d3 Function806d3: ; 806d3
; Seen mons. ; Seen mons.
ld hl, PokedexSeen ld hl, PokedexSeen
ld b, $20 ld b, EndPokedexSeen - PokedexSeen
call CountSetBits call CountSetBits
ld a, [$d265] ld a, [$d265]
jp Function8066c jp Function8066c
@ -63207,7 +63209,7 @@ Function806d3: ; 806d3
Function806e1: ; 806e1 Function806e1: ; 806e1
; Number of owned badges. ; Number of owned badges.
ld hl, JohtoBadges ; $d857 ld hl, Badges ; $d857
ld b, 2 ld b, 2
call CountSetBits call CountSetBits
ld a, [$d265] ld a, [$d265]
@ -87330,7 +87332,7 @@ Functionb81ea: ; b81ea
jr nc, .asm_b8214 jr nc, .asm_b8214
call Functionb83e5 call Functionb83e5
jr nc, .asm_b8214 jr nc, .asm_b8214
ld a, $8 ld a, BATTLETYPE_TREE
ld [BattleType], a ld [BattleType], a
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
@ -108250,7 +108252,7 @@ Function106050: ; 106050
Function106051: ; 106051 Function106051: ; 106051
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
ret z ret z
ld hl, $a01b ld hl, $a01b
jp Function10611d jp Function10611d
@ -108263,7 +108265,7 @@ Function10605d: ; 10605d
Function10605e: ; 10605e Function10605e: ; 10605e
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
ret z ret z
ld hl, $a01e ld hl, $a01e
jp Function10611d jp Function10611d

View File

@ -130,7 +130,7 @@ UnknownScript_0x19c0ae: ; 0x19c0ae
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6 winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
setlasttalked $3 setlasttalked $3
loadtrainer RIVAL1, RIVAL1_3 loadtrainer RIVAL1, RIVAL1_3
writecode $3, $1 writecode $3, BATTLETYPE_CANLOSE
startbattle startbattle
reloadmapmusic reloadmapmusic
reloadmap reloadmap
@ -142,7 +142,7 @@ UnknownScript_0x19c0ee: ; 0x19c0ee
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6 winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
setlasttalked $3 setlasttalked $3
loadtrainer RIVAL1, RIVAL1_1 loadtrainer RIVAL1, RIVAL1_1
writecode $3, $1 writecode $3, BATTLETYPE_CANLOSE
startbattle startbattle
reloadmapmusic reloadmapmusic
reloadmap reloadmap
@ -154,7 +154,7 @@ UnknownScript_0x19c104: ; 0x19c104
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6 winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
setlasttalked $3 setlasttalked $3
loadtrainer RIVAL1, RIVAL1_2 loadtrainer RIVAL1, RIVAL1_2
writecode $3, $1 writecode $3, BATTLETYPE_CANLOSE
startbattle startbattle
reloadmapmusic reloadmapmusic
reloadmap reloadmap

View File

@ -88,7 +88,7 @@ GyaradosScript_0x70063: ; 0x70063
cry GYARADOS cry GYARADOS
loadmovesprites loadmovesprites
loadpokedata GYARADOS, 30 loadpokedata GYARADOS, 30
writecode $3, $7 writecode $3, BATTLETYPE_SHINY
startbattle startbattle
if_equal $1, UnknownScript_0x7007a if_equal $1, UnknownScript_0x7007a
disappear $a disappear $a

View File

@ -464,7 +464,7 @@ VoltorbExplodingTrap: ; 0x6ca34
cry VOLTORB cry VOLTORB
special $0031 special $0031
setlasttalked $ff setlasttalked $ff
writecode $3, $9 writecode $3, BATTLETYPE_TRAP
loadpokedata VOLTORB, 23 loadpokedata VOLTORB, 23
startbattle startbattle
end end
@ -474,7 +474,7 @@ GeodudeExplodingTrap: ; 0x6ca47
cry GEODUDE cry GEODUDE
special $0031 special $0031
setlasttalked $ff setlasttalked $ff
writecode $3, $9 writecode $3, BATTLETYPE_TRAP
loadpokedata GEODUDE, 21 loadpokedata GEODUDE, 21
startbattle startbattle
end end
@ -484,7 +484,7 @@ KoffingExplodingTrap: ; 0x6ca5a
cry KOFFING cry KOFFING
special $0031 special $0031
setlasttalked $ff setlasttalked $ff
writecode $3, $9 writecode $3, BATTLETYPE_TRAP
loadpokedata KOFFING, 21 loadpokedata KOFFING, 21
startbattle startbattle
end end

View File

@ -122,7 +122,7 @@ UnknownScript_0x1850d7: ; 0x1850d7
cry SUICUNE cry SUICUNE
pause 20 pause 20
loadpokedata SUICUNE, 40 loadpokedata SUICUNE, 40
writecode $3, $c writecode $3, BATTLETYPE_SUICUNE
startbattle startbattle
reloadmapmusic reloadmapmusic
disappear $2 disappear $2

View File

@ -36,7 +36,7 @@ HoOhScript_0x77244: ; 0x77244
pause 15 pause 15
loadmovesprites loadmovesprites
setevent EVENT_FOUGHT_HO_OH setevent EVENT_FOUGHT_HO_OH
writecode $3, $a writecode $3, BATTLETYPE_FORCEITEM
loadpokedata HO_OH, 60 loadpokedata HO_OH, 60
startbattle startbattle
disappear $2 disappear $2

View File

@ -56,7 +56,7 @@ UnknownScript_0x1aa9ab: ; 0x1aa9ab
pause 15 pause 15
cry SNORLAX cry SNORLAX
loadmovesprites loadmovesprites
writecode $3, $a writecode $3, BATTLETYPE_FORCEITEM
loadpokedata SNORLAX, 50 loadpokedata SNORLAX, 50
startbattle startbattle
disappear $6 disappear $6

View File

@ -36,7 +36,7 @@ LugiaScript_0x18c518: ; 0x18c518
pause 15 pause 15
loadmovesprites loadmovesprites
setevent EVENT_FOUGHT_LUGIA setevent EVENT_FOUGHT_LUGIA
writecode $3, $a writecode $3, BATTLETYPE_FORCEITEM
loadpokedata LUGIA, 60 loadpokedata LUGIA, 60
startbattle startbattle
disappear $2 disappear $2

View File

@ -840,11 +840,13 @@ Function93ba: ; 93ba
Function93d3: ; 93d3 Function93d3: ; 93d3
ld a, [BattleType] ld a, [BattleType]
cp $3 cp BATTLETYPE_TUTORIAL
jr z, .asm_93e6 jr z, .asm_93e6
ld a, [PlayerGender] ld a, [PlayerGender]
bit 0, a bit 0, a
jr z, .asm_93e6 jr z, .asm_93e6
ld hl, Palettes_9469 ld hl, Palettes_9469
jr .asm_93e9 jr .asm_93e9

View File

@ -30,7 +30,7 @@ PokemonFellFromTreeText: ; 0x80778
prompt prompt
; 0x80793 ; 0x80793
WildPokemonAppearedText2: ; 0x80793 WildCelebiAppearedText: ; 0x80793
text "Wild @" text "Wild @"
text_from_ram $c616 text_from_ram $c616
db $0 db $0

View File

@ -1375,9 +1375,9 @@ Coins:: ; d855
Badges:: Badges::
JohtoBadges:: ; d857 JohtoBadges:: ; d857
ds 1 flag_array 8
KantoBadges:: ; d858 KantoBadges:: ; d858
ds 1 flag_array 8
SECTION "Items",WRAMX[$d859],BANK[1] SECTION "Items",WRAMX[$d859],BANK[1]
TMsHMs:: ; d859 TMsHMs:: ; d859