2014-02-01 17:26:39 -08:00
|
|
|
|
_DoItemEffect:: ; e722
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, [CurItem]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call GetItemName
|
|
|
|
|
call CopyName1
|
|
|
|
|
ld a, 1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, [CurItem]
|
|
|
|
|
dec a
|
|
|
|
|
ld hl, ItemEffects
|
|
|
|
|
rst JumpTable
|
|
|
|
|
ret
|
|
|
|
|
; e73c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ItemEffects: ; e73c
|
|
|
|
|
dw MasterBall
|
|
|
|
|
dw UltraBall
|
|
|
|
|
dw Brightpowder
|
|
|
|
|
dw GreatBall
|
|
|
|
|
dw PokeBall
|
2014-04-28 13:43:11 -07:00
|
|
|
|
dw TownMap
|
2013-12-24 22:42:41 -08:00
|
|
|
|
dw Bicycle
|
|
|
|
|
dw MoonStone
|
|
|
|
|
dw Antidote
|
|
|
|
|
dw BurnHeal
|
|
|
|
|
dw IceHeal
|
|
|
|
|
dw Awakening
|
|
|
|
|
dw ParlyzHeal
|
|
|
|
|
dw FullRestore
|
|
|
|
|
dw MaxPotion
|
|
|
|
|
dw HyperPotion
|
|
|
|
|
dw SuperPotion
|
|
|
|
|
dw Potion
|
|
|
|
|
dw EscapeRope
|
|
|
|
|
dw Repel
|
|
|
|
|
dw MaxElixer
|
|
|
|
|
dw FireStone
|
|
|
|
|
dw Thunderstone
|
|
|
|
|
dw WaterStone
|
|
|
|
|
dw Item19
|
|
|
|
|
dw HpUp
|
|
|
|
|
dw Protein
|
|
|
|
|
dw Iron
|
|
|
|
|
dw Carbos
|
|
|
|
|
dw LuckyPunch
|
|
|
|
|
dw Calcium
|
|
|
|
|
dw RareCandy
|
|
|
|
|
dw XAccuracy
|
|
|
|
|
dw LeafStone
|
|
|
|
|
dw MetalPowder
|
|
|
|
|
dw Nugget
|
|
|
|
|
dw PokeDoll
|
|
|
|
|
dw FullHeal
|
|
|
|
|
dw Revive
|
|
|
|
|
dw MaxRevive
|
|
|
|
|
dw GuardSpec
|
|
|
|
|
dw SuperRepel
|
|
|
|
|
dw MaxRepel
|
|
|
|
|
dw DireHit
|
|
|
|
|
dw Item2D
|
|
|
|
|
dw FreshWater
|
|
|
|
|
dw SodaPop
|
|
|
|
|
dw Lemonade
|
|
|
|
|
dw XAttack
|
|
|
|
|
dw Item32
|
|
|
|
|
dw XDefend
|
|
|
|
|
dw XSpeed
|
|
|
|
|
dw XSpecial
|
|
|
|
|
dw CoinCase
|
|
|
|
|
dw Itemfinder
|
2014-04-28 13:43:11 -07:00
|
|
|
|
dw PokeFlute
|
2013-12-24 22:42:41 -08:00
|
|
|
|
dw ExpShare
|
|
|
|
|
dw OldRod
|
|
|
|
|
dw GoodRod
|
|
|
|
|
dw SilverLeaf
|
|
|
|
|
dw SuperRod
|
|
|
|
|
dw PpUp
|
|
|
|
|
dw Ether
|
|
|
|
|
dw MaxEther
|
|
|
|
|
dw Elixer
|
|
|
|
|
dw RedScale
|
|
|
|
|
dw Secretpotion
|
|
|
|
|
dw SSTicket
|
|
|
|
|
dw MysteryEgg
|
|
|
|
|
dw ClearBell
|
|
|
|
|
dw SilverWing
|
|
|
|
|
dw MoomooMilk
|
|
|
|
|
dw QuickClaw
|
|
|
|
|
dw Psncureberry
|
|
|
|
|
dw GoldLeaf
|
|
|
|
|
dw SoftSand
|
|
|
|
|
dw SharpBeak
|
|
|
|
|
dw Przcureberry
|
|
|
|
|
dw BurntBerry
|
|
|
|
|
dw IceBerry
|
|
|
|
|
dw PoisonBarb
|
|
|
|
|
dw KingsRock
|
|
|
|
|
dw BitterBerry
|
|
|
|
|
dw MintBerry
|
|
|
|
|
dw RedApricorn
|
|
|
|
|
dw Tinymushroom
|
|
|
|
|
dw BigMushroom
|
|
|
|
|
dw Silverpowder
|
|
|
|
|
dw BluApricorn
|
|
|
|
|
dw Item5A
|
|
|
|
|
dw AmuletCoin
|
|
|
|
|
dw YlwApricorn
|
|
|
|
|
dw GrnApricorn
|
|
|
|
|
dw CleanseTag
|
|
|
|
|
dw MysticWater
|
|
|
|
|
dw Twistedspoon
|
|
|
|
|
dw WhtApricorn
|
|
|
|
|
dw Blackbelt
|
|
|
|
|
dw BlkApricorn
|
|
|
|
|
dw Item64
|
|
|
|
|
dw PnkApricorn
|
|
|
|
|
dw Blackglasses
|
|
|
|
|
dw Slowpoketail
|
|
|
|
|
dw PinkBow
|
|
|
|
|
dw Stick
|
|
|
|
|
dw SmokeBall
|
|
|
|
|
dw Nevermeltice
|
|
|
|
|
dw Magnet
|
|
|
|
|
dw Miracleberry
|
|
|
|
|
dw Pearl
|
|
|
|
|
dw BigPearl
|
|
|
|
|
dw Everstone
|
|
|
|
|
dw SpellTag
|
|
|
|
|
dw Ragecandybar
|
|
|
|
|
dw GsBall
|
|
|
|
|
dw BlueCard
|
|
|
|
|
dw MiracleSeed
|
|
|
|
|
dw ThickClub
|
|
|
|
|
dw FocusBand
|
|
|
|
|
dw Item78
|
|
|
|
|
dw Energypowder
|
|
|
|
|
dw EnergyRoot
|
|
|
|
|
dw HealPowder
|
|
|
|
|
dw RevivalHerb
|
|
|
|
|
dw HardStone
|
|
|
|
|
dw LuckyEgg
|
|
|
|
|
dw CardKey
|
|
|
|
|
dw MachinePart
|
|
|
|
|
dw EggTicket
|
|
|
|
|
dw LostItem
|
|
|
|
|
dw Stardust
|
|
|
|
|
dw StarPiece
|
|
|
|
|
dw BasementKey
|
|
|
|
|
dw Pass
|
|
|
|
|
dw Item87
|
|
|
|
|
dw Item88
|
|
|
|
|
dw Item89
|
|
|
|
|
dw Charcoal
|
|
|
|
|
dw BerryJuice
|
|
|
|
|
dw ScopeLens
|
|
|
|
|
dw Item8D
|
|
|
|
|
dw Item8E
|
|
|
|
|
dw MetalCoat
|
|
|
|
|
dw DragonFang
|
|
|
|
|
dw Item91
|
|
|
|
|
dw Leftovers
|
|
|
|
|
dw Item93
|
|
|
|
|
dw Item94
|
|
|
|
|
dw Item95
|
|
|
|
|
dw Mysteryberry
|
|
|
|
|
dw DragonScale
|
|
|
|
|
dw BerserkGene
|
|
|
|
|
dw Item99
|
|
|
|
|
dw Item9A
|
|
|
|
|
dw Item9B
|
|
|
|
|
dw SacredAsh
|
|
|
|
|
dw HeavyBall
|
|
|
|
|
dw FlowerMail
|
|
|
|
|
dw LevelBall
|
|
|
|
|
dw LureBall
|
|
|
|
|
dw FastBall
|
|
|
|
|
dw ItemA2
|
|
|
|
|
dw LightBall
|
|
|
|
|
dw FriendBall
|
|
|
|
|
dw MoonBall
|
|
|
|
|
dw LoveBall
|
|
|
|
|
dw NormalBox
|
|
|
|
|
dw GorgeousBox
|
|
|
|
|
dw SunStone
|
|
|
|
|
dw PolkadotBow
|
|
|
|
|
dw ItemAB
|
|
|
|
|
dw UpGrade
|
|
|
|
|
dw Berry
|
|
|
|
|
dw GoldBerry
|
|
|
|
|
dw Squirtbottle
|
|
|
|
|
dw ItemB0
|
|
|
|
|
dw ParkBall
|
|
|
|
|
dw RainbowWing
|
|
|
|
|
dw ItemB3
|
|
|
|
|
; e8a2
|
|
|
|
|
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
MasterBall:
|
|
|
|
|
UltraBall:
|
|
|
|
|
GreatBall:
|
|
|
|
|
PokeBall:
|
|
|
|
|
HeavyBall:
|
|
|
|
|
LevelBall:
|
|
|
|
|
LureBall:
|
|
|
|
|
FastBall:
|
|
|
|
|
FriendBall:
|
|
|
|
|
MoonBall:
|
|
|
|
|
LoveBall:
|
|
|
|
|
ParkBall: ; e8a2
|
|
|
|
|
ld a, [IsInBattle]
|
|
|
|
|
dec a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp nz, Functionf7a0
|
2013-12-24 22:42:41 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [PartyCount]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp PARTY_LENGTH
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_e8c0
|
2013-12-24 22:42:41 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, $1
|
|
|
|
|
call GetSRAMBank
|
|
|
|
|
ld a, [$ad10]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
cp 20
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call CloseSRAM
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp z, Ball_BoxIsFullMessage
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_e8c0
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wc64e], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [CurItem]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
cp PARK_BALL
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call nz, Functionedfa
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld hl, Options
|
2014-08-13 19:42:58 -07:00
|
|
|
|
res NO_TEXT_SCROLL, [hl]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, UsedItemText
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [EnemyMonCatchRate]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [BattleType]
|
2014-06-13 22:53:20 -07:00
|
|
|
|
cp BATTLETYPE_TUTORIAL
|
2013-05-08 00:27:46 -07:00
|
|
|
|
jp z, .asm_e99c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [CurItem]
|
2014-06-13 22:53:20 -07:00
|
|
|
|
cp MASTER_BALL
|
2013-05-08 00:27:46 -07:00
|
|
|
|
jp z, .asm_e99c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [CurItem]
|
|
|
|
|
ld c, a
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ld hl, BallMultiplierFunctionTable
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_e8f2
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
cp $ff
|
|
|
|
|
jr z, .asm_e906
|
|
|
|
|
cp c
|
|
|
|
|
jr z, .asm_e8fe
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-07 23:02:15 -07:00
|
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr .asm_e8f2
|
|
|
|
|
|
|
|
|
|
.asm_e8fe
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld de, .asm_e906
|
2013-05-07 23:02:15 -07:00
|
|
|
|
push de
|
|
|
|
|
jp [hl]
|
|
|
|
|
|
|
|
|
|
.asm_e906
|
|
|
|
|
ld a, [CurItem]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp LEVEL_BALL
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, b
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp z, .asm_e98e
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, b
|
|
|
|
|
ld [$ffb6], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2014-06-12 18:32:42 -07:00
|
|
|
|
ld hl, EnemyMonHP
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld b, [hl]
|
|
|
|
|
inc hl
|
|
|
|
|
ld c, [hl]
|
|
|
|
|
inc hl
|
|
|
|
|
ld d, [hl]
|
|
|
|
|
inc hl
|
|
|
|
|
ld e, [hl]
|
|
|
|
|
sla c
|
|
|
|
|
rl b
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld h, d
|
|
|
|
|
ld l, e
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-07 23:02:15 -07:00
|
|
|
|
add hl, de
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld d, h
|
|
|
|
|
ld e, l
|
|
|
|
|
ld a, d
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_e940
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
srl d
|
|
|
|
|
rr e
|
|
|
|
|
srl d
|
|
|
|
|
rr e
|
|
|
|
|
srl b
|
|
|
|
|
rr c
|
|
|
|
|
srl b
|
|
|
|
|
rr c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, c
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_e940
|
|
|
|
|
ld c, $1
|
|
|
|
|
.asm_e940
|
|
|
|
|
ld b, e
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
push bc
|
|
|
|
|
ld a, b
|
|
|
|
|
sub c
|
|
|
|
|
ld [hMultiplier], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hProduct], a
|
|
|
|
|
ld [hMultiplicand], a
|
|
|
|
|
ld [$ffb5], a
|
|
|
|
|
call Multiply
|
|
|
|
|
pop bc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, b
|
2014-08-13 19:42:58 -07:00
|
|
|
|
ld [hDivisor], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld b, $4
|
|
|
|
|
call Divide
|
|
|
|
|
|
|
|
|
|
ld a, [$ffb6]
|
|
|
|
|
and a
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr nz, .statuscheck
|
2014-08-13 19:42:58 -07:00
|
|
|
|
ld a, 1
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.statuscheck
|
|
|
|
|
; This routine is buggy. It was intended that SLP and FRZ provide a higher
|
|
|
|
|
; catch rate than BRN/PSN/PAR, which in turn provide a higher catch rate than
|
|
|
|
|
; no status effect at all. But instead, it makes BRN/PSN/PAR provide no
|
|
|
|
|
; benefit.
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [EnemyMonStatus]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
and 1 << FRZ | SLP
|
|
|
|
|
ld c, 10
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr nz, .addstatus
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld c, 5
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr nz, .addstatus
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld c, 0
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.addstatus
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, b
|
|
|
|
|
add c
|
|
|
|
|
jr nc, .asm_e977
|
|
|
|
|
ld a, $ff
|
|
|
|
|
.asm_e977
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld d, a
|
|
|
|
|
push de
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
|
|
|
|
; BUG: callba overwrites a,
|
|
|
|
|
; and GetItem takes b anyway.
|
|
|
|
|
|
|
|
|
|
; This is probably the reason
|
|
|
|
|
; the HELD_CATCH_CHANCE effect
|
|
|
|
|
; is never used.
|
|
|
|
|
|
|
|
|
|
; Uncomment the line below to fix.
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [BattleMonItem]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
; ld b, a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba GetItem
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, b
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp HELD_CATCH_CHANCE
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
pop de
|
|
|
|
|
ld a, d
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_e98e
|
|
|
|
|
add c
|
|
|
|
|
jr nc, .asm_e98e
|
|
|
|
|
ld a, $ff
|
|
|
|
|
.asm_e98e
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld b, a
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld [Buffer1], a
|
2013-08-30 19:59:40 -07:00
|
|
|
|
call Random
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
cp b
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr z, .asm_e99c
|
|
|
|
|
jr nc, .asm_e99f
|
|
|
|
|
|
|
|
|
|
.asm_e99c
|
|
|
|
|
ld a, [EnemyMonSpecies]
|
|
|
|
|
|
|
|
|
|
.asm_e99f
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wc64e], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld c, 20
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call DelayFrames
|
|
|
|
|
|
|
|
|
|
ld a, [CurItem]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp POKE_BALL + 1 ; Assumes Master/Ultra/Great come before
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr c, .asm_e9b0
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, POKE_BALL
|
2013-05-07 23:02:15 -07:00
|
|
|
|
.asm_e9b0
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wc689], a
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld de, ANIM_THROW_POKE_BALL
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, e
|
|
|
|
|
ld [FXAnimIDLo], a
|
|
|
|
|
ld a, d
|
|
|
|
|
ld [FXAnimIDHi], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBattleTurn], a
|
|
|
|
|
ld [Buffer2], a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wcfca], a
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef PlayBattleAnim
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wc64e]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_e9f5
|
|
|
|
|
ld a, [Buffer2]
|
|
|
|
|
cp $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedb5
|
|
|
|
|
jp z, .asm_ebdc
|
2013-05-07 23:02:15 -07:00
|
|
|
|
cp $2
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedba
|
|
|
|
|
jp z, .asm_ebdc
|
2013-05-07 23:02:15 -07:00
|
|
|
|
cp $3
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedbf
|
|
|
|
|
jp z, .asm_ebdc
|
2013-05-07 23:02:15 -07:00
|
|
|
|
cp $4
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedc4
|
|
|
|
|
jp z, .asm_ebdc
|
2013-05-07 23:02:15 -07:00
|
|
|
|
.asm_e9f5
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld hl, EnemyMonStatus
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
push af
|
|
|
|
|
inc hl
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
push af
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
push hl
|
|
|
|
|
ld hl, EnemyMonItem
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
push hl
|
|
|
|
|
ld hl, EnemySubStatus5
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
2014-08-13 19:42:58 -07:00
|
|
|
|
set SUBSTATUS_TRANSFORMED, [hl]
|
|
|
|
|
bit SUBSTATUS_TRANSFORMED, a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_ea13
|
|
|
|
|
jr .asm_ea1a
|
|
|
|
|
|
|
|
|
|
.asm_ea13
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, DITTO
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [TempEnemyMonSpecies], a
|
|
|
|
|
jr .asm_ea27
|
|
|
|
|
|
|
|
|
|
.asm_ea1a
|
|
|
|
|
set 3, [hl]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wc6f2
|
2014-06-12 18:32:42 -07:00
|
|
|
|
ld a, [EnemyMonDVs]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [hli], a
|
2014-06-12 18:32:42 -07:00
|
|
|
|
ld a, [EnemyMonDVs + 1]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
|
|
.asm_ea27
|
|
|
|
|
ld a, [TempEnemyMonSpecies]
|
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
|
ld a, [EnemyMonLevel]
|
|
|
|
|
ld [CurPartyLevel], a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba LoadEnemyMon
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
pop af
|
|
|
|
|
ld [EnemySubStatus5], a
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
pop hl
|
|
|
|
|
pop af
|
|
|
|
|
ld [hl], a
|
|
|
|
|
pop hl
|
|
|
|
|
pop af
|
|
|
|
|
ld [hld], a
|
|
|
|
|
pop af
|
|
|
|
|
ld [hld], a
|
|
|
|
|
dec hl
|
|
|
|
|
pop af
|
|
|
|
|
ld [hl], a
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld hl, EnemySubStatus5
|
2014-08-13 19:42:58 -07:00
|
|
|
|
bit SUBSTATUS_TRANSFORMED, [hl]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_ea67
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wc735
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld de, EnemyMonMoves
|
|
|
|
|
ld bc, NUM_MOVES
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call CopyBytes
|
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wc739
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld de, EnemyMonPP
|
|
|
|
|
ld bc, NUM_MOVES
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call CopyBytes
|
|
|
|
|
.asm_ea67
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [EnemyMonSpecies]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wc64e], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [CurPartySpecies], a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [BattleType]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp BATTLETYPE_TUTORIAL
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp z, .asm_ebd9
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function10607f
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedc9
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
call ClearSprites
|
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd265]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
dec a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call CheckCaughtMon
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, c
|
|
|
|
|
push af
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd265]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
dec a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call SetSeenAndCaughtMon
|
2013-05-07 23:02:15 -07:00
|
|
|
|
pop af
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_eab7
|
|
|
|
|
|
2014-08-13 19:42:58 -07:00
|
|
|
|
call Function2ead
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr z, .asm_eab7
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedf0
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
call ClearSprites
|
|
|
|
|
|
|
|
|
|
ld a, [EnemyMonSpecies]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef Functionfb877
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_eab7
|
|
|
|
|
ld a, [BattleType]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp BATTLETYPE_CONTEST
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp z, .asm_ebd1
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp BATTLETYPE_CELEBI
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_eac8
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wd0ee
|
2013-05-07 23:02:15 -07:00
|
|
|
|
set 6, [hl]
|
|
|
|
|
.asm_eac8
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [PartyCount]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp PARTY_LENGTH
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr z, .asm_eb3c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
xor a
|
|
|
|
|
ld [MonType], a
|
|
|
|
|
call ClearSprites
|
|
|
|
|
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef Functiond88c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function4db49
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [CurItem]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp FRIEND_BALL
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_eaf8
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [PartyCount]
|
|
|
|
|
dec a
|
|
|
|
|
ld hl, PartyMon1Happiness
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld bc, PartyMon2 - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call AddNTimes
|
|
|
|
|
|
2014-08-13 19:42:58 -07:00
|
|
|
|
ld a, FRIEND_BALL_HAPPINESS
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [hl], a
|
|
|
|
|
.asm_eaf8
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedf5
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call GetPokemonName
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-03 23:49:12 -08:00
|
|
|
|
call YesNoBox
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp c, .asm_ebe2
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [PartyCount]
|
|
|
|
|
dec a
|
|
|
|
|
ld [CurPartyMon], a
|
2014-06-12 18:32:42 -07:00
|
|
|
|
ld hl, PartyMonNicknames
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld bc, PKMN_NAME_LENGTH
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call AddNTimes
|
|
|
|
|
|
|
|
|
|
ld d, h
|
|
|
|
|
ld e, l
|
|
|
|
|
push de
|
|
|
|
|
xor a
|
|
|
|
|
ld [MonType], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, 0
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function116c1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2015-07-20 00:51:52 -07:00
|
|
|
|
call FadeToWhite
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functione51
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
pop hl
|
|
|
|
|
ld de, StringBuffer1
|
2013-07-29 20:58:02 -07:00
|
|
|
|
call InitName
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp .asm_ebe2
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_eb3c
|
|
|
|
|
call ClearSprites
|
|
|
|
|
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef Functionde6e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function4db83
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, $1
|
|
|
|
|
call GetSRAMBank
|
|
|
|
|
|
|
|
|
|
ld a, [$ad10]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp MONS_PER_BOX
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_eb5b
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wd0ee
|
2013-05-07 23:02:15 -07:00
|
|
|
|
set 7, [hl]
|
|
|
|
|
|
|
|
|
|
.asm_eb5b
|
|
|
|
|
ld a, [CurItem]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp FRIEND_BALL
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_eb67
|
2014-08-13 19:42:58 -07:00
|
|
|
|
ld a, FRIEND_BALL_HAPPINESS
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [$ad41], a
|
|
|
|
|
|
|
|
|
|
.asm_eb67
|
|
|
|
|
call CloseSRAM
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xedf5
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call GetPokemonName
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-03 23:49:12 -08:00
|
|
|
|
call YesNoBox
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr c, .asm_ebaf
|
|
|
|
|
|
|
|
|
|
xor a
|
|
|
|
|
ld [CurPartyMon], a
|
2013-07-02 11:10:49 -07:00
|
|
|
|
ld a, BOXMON
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [MonType], a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld de, wd050
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld b, $0
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function116c1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, $1
|
|
|
|
|
call GetSRAMBank
|
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wd050
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld de, $b082
|
|
|
|
|
ld bc, $000b
|
|
|
|
|
call CopyBytes
|
|
|
|
|
|
|
|
|
|
ld hl, $b082
|
|
|
|
|
ld de, StringBuffer1
|
2013-07-29 20:58:02 -07:00
|
|
|
|
call InitName
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
call CloseSRAM
|
|
|
|
|
|
|
|
|
|
.asm_ebaf
|
|
|
|
|
ld a, $1
|
|
|
|
|
call GetSRAMBank
|
|
|
|
|
|
|
|
|
|
ld hl, $b082
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld de, wd050
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld bc, $000b
|
|
|
|
|
call CopyBytes
|
|
|
|
|
|
|
|
|
|
call CloseSRAM
|
|
|
|
|
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld hl, UnknownText_0xedeb
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2015-07-20 00:51:52 -07:00
|
|
|
|
call FadeToWhite
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functione51
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr .asm_ebe2
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_ebd1
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Functione6ce
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr .asm_ebe2
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_ebd9
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld hl, UnknownText_0xedc9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_ebdc
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call ClearSprites
|
|
|
|
|
|
|
|
|
|
.asm_ebe2
|
|
|
|
|
ld a, [BattleType]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp BATTLETYPE_TUTORIAL
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret z
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp 2
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret z
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp BATTLETYPE_CONTEST
|
|
|
|
|
jr z, .used_park_ball
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wc64e]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and a
|
2014-08-13 19:42:58 -07:00
|
|
|
|
jr z, .toss
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call WhiteBGMap
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call ClearTileMap
|
|
|
|
|
|
2014-08-13 19:42:58 -07:00
|
|
|
|
.toss
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld hl, NumItems
|
|
|
|
|
inc a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd10c], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp TossItem
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2014-08-13 19:42:58 -07:00
|
|
|
|
.used_park_ball
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wdc79
|
2013-05-07 23:02:15 -07:00
|
|
|
|
dec [hl]
|
|
|
|
|
ret
|
|
|
|
|
; ec0a
|
|
|
|
|
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
BallMultiplierFunctionTable:
|
|
|
|
|
; table of routines that increase or decrease the catch rate based on
|
|
|
|
|
; which ball is used in a certain situation.
|
|
|
|
|
dbw ULTRA_BALL, UltraBallMultiplier
|
|
|
|
|
dbw GREAT_BALL, GreatBallMultiplier
|
2014-10-23 23:43:50 -07:00
|
|
|
|
dbw 8, SafariBallMultiplier ; Safari Ball, leftover from RBY
|
2014-10-23 23:18:48 -07:00
|
|
|
|
dbw HEAVY_BALL, HeavyBallMultiplier
|
|
|
|
|
dbw LEVEL_BALL, LevelBallMultiplier
|
|
|
|
|
dbw LURE_BALL, LureBallMultiplier
|
|
|
|
|
dbw FAST_BALL, FastBallMultiplier
|
|
|
|
|
dbw MOON_BALL, MoonBallMultiplier
|
|
|
|
|
dbw LOVE_BALL, LoveBallMultiplier
|
2014-10-23 23:43:50 -07:00
|
|
|
|
dbw PARK_BALL, ParkBallMultiplier
|
2013-05-08 00:27:46 -07:00
|
|
|
|
db $ff
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
UltraBallMultiplier:
|
|
|
|
|
; multiply catch rate by 2
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
|
|
|
|
ret nc
|
|
|
|
|
ld b, $ff
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:43:50 -07:00
|
|
|
|
SafariBallMultiplier:
|
2014-10-23 23:18:48 -07:00
|
|
|
|
GreatBallMultiplier:
|
2014-10-23 23:43:50 -07:00
|
|
|
|
ParkBallMultiplier:
|
2014-10-23 23:18:48 -07:00
|
|
|
|
; multiply catch rate by 1.5
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, b
|
|
|
|
|
srl a
|
|
|
|
|
add b
|
|
|
|
|
ld b, a
|
|
|
|
|
ret nc
|
|
|
|
|
ld b, $ff
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
GetPokedexEntryBank:
|
2013-05-27 20:28:21 -07:00
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
ld a, [EnemyMonSpecies]
|
|
|
|
|
rlca
|
|
|
|
|
rlca
|
|
|
|
|
and 3
|
|
|
|
|
ld hl, .PokedexEntryBanks
|
|
|
|
|
ld d, 0
|
|
|
|
|
ld e, a
|
|
|
|
|
add hl, de
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
ret
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2013-05-27 20:28:21 -07:00
|
|
|
|
.PokedexEntryBanks
|
2014-02-04 18:29:13 -08:00
|
|
|
|
|
|
|
|
|
GLOBAL PokedexEntries1
|
|
|
|
|
GLOBAL PokedexEntries2
|
|
|
|
|
GLOBAL PokedexEntries3
|
|
|
|
|
GLOBAL PokedexEntries4
|
|
|
|
|
|
2013-05-27 20:28:21 -07:00
|
|
|
|
db BANK(PokedexEntries1)
|
|
|
|
|
db BANK(PokedexEntries2)
|
|
|
|
|
db BANK(PokedexEntries3)
|
|
|
|
|
db BANK(PokedexEntries4)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
HeavyBallMultiplier:
|
|
|
|
|
; subtract 20 from catch rate if weight < 102.4 kg
|
|
|
|
|
; else add 0 to catch rate if weight < 204.8 kg
|
|
|
|
|
; else add 20 to catch rate if weight < 307.2 kg
|
|
|
|
|
; else add 30 to catch rate if weight < 409.6 kg
|
|
|
|
|
; else add 40 to catch rate (never happens)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, [EnemyMonSpecies]
|
2013-05-27 20:28:21 -07:00
|
|
|
|
ld hl, PokedexDataPointerTable
|
2013-05-08 00:27:46 -07:00
|
|
|
|
dec a
|
|
|
|
|
ld e, a
|
2013-05-27 20:28:21 -07:00
|
|
|
|
ld d, 0
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-08 00:27:46 -07:00
|
|
|
|
add hl, de
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-05-27 20:28:21 -07:00
|
|
|
|
ld a, BANK(PokedexDataPointerTable)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarHalfword
|
|
|
|
|
|
2013-05-27 20:28:21 -07:00
|
|
|
|
.SkipText
|
|
|
|
|
call GetPokedexEntryBank
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarByte
|
|
|
|
|
inc hl
|
2013-05-27 20:28:21 -07:00
|
|
|
|
cp "@"
|
|
|
|
|
jr nz, .SkipText
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2013-05-27 20:28:21 -07:00
|
|
|
|
call GetPokedexEntryBank
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push bc
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-08 00:27:46 -07:00
|
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarHalfword
|
|
|
|
|
|
|
|
|
|
srl h
|
|
|
|
|
rr l
|
|
|
|
|
ld b, h
|
|
|
|
|
ld c, l
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
|
|
|
|
rept 4
|
2013-05-08 00:27:46 -07:00
|
|
|
|
srl b
|
|
|
|
|
rr c
|
2014-08-13 19:42:58 -07:00
|
|
|
|
endr
|
2014-10-23 23:18:48 -07:00
|
|
|
|
call .subbc
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
|
|
|
|
srl b
|
|
|
|
|
rr c
|
2014-10-23 23:18:48 -07:00
|
|
|
|
call .subbc
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
|
|
|
|
ld a, h
|
|
|
|
|
pop bc
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr .compare
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.subbc
|
|
|
|
|
; subtract bc from hl
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push bc
|
|
|
|
|
ld a, b
|
|
|
|
|
cpl
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, c
|
|
|
|
|
cpl
|
|
|
|
|
ld c, a
|
|
|
|
|
inc bc
|
|
|
|
|
add hl, bc
|
|
|
|
|
pop bc
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.compare
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld c, a
|
2014-10-23 23:18:48 -07:00
|
|
|
|
cp 1024 >> 8 ; 102.4 kg
|
|
|
|
|
jr c, .lightmon
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ld hl, .WeightsTable
|
|
|
|
|
.lookup
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, c
|
|
|
|
|
cp [hl]
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr c, .heavymon
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-08 00:27:46 -07:00
|
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr .lookup
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.heavymon
|
2013-05-08 00:27:46 -07:00
|
|
|
|
inc hl
|
|
|
|
|
ld a, b
|
|
|
|
|
add [hl]
|
|
|
|
|
ld b, a
|
|
|
|
|
ret nc
|
|
|
|
|
ld b, $ff
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.lightmon
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, b
|
2013-05-27 20:28:21 -07:00
|
|
|
|
sub 20
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld b, a
|
|
|
|
|
ret nc
|
|
|
|
|
ld b, $1
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.WeightsTable
|
|
|
|
|
; weight factor, boost
|
|
|
|
|
db 2048 >> 8, 0
|
|
|
|
|
db 3072 >> 8, 20
|
|
|
|
|
db 4096 >> 8, 30
|
|
|
|
|
db 65280 >> 8, 40
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
LureBallMultiplier:
|
|
|
|
|
; multiply catch rate by 3 if this is a fishing rod battle
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, [BattleType]
|
2014-08-13 19:42:58 -07:00
|
|
|
|
cp BATTLETYPE_FISH
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ret nz
|
2014-08-13 19:42:58 -07:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, b
|
|
|
|
|
add a
|
2014-08-13 19:42:58 -07:00
|
|
|
|
jr c, .max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
|
|
|
|
add b
|
2014-08-13 19:42:58 -07:00
|
|
|
|
jr nc, .done
|
|
|
|
|
.max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, $ff
|
2014-08-13 19:42:58 -07:00
|
|
|
|
.done
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld b, a
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
MoonBallMultiplier:
|
|
|
|
|
; This function is buggy.
|
|
|
|
|
; Intent: multiply catch rate by 4 if mon evolves with moon stone
|
|
|
|
|
; Reality: no boost
|
2014-02-04 18:29:13 -08:00
|
|
|
|
|
|
|
|
|
GLOBAL EvosAttacks
|
|
|
|
|
GLOBAL EvosAttacksPointers
|
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push bc
|
|
|
|
|
ld a, [TempEnemyMonSpecies]
|
|
|
|
|
dec a
|
|
|
|
|
ld c, a
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld b, 0
|
|
|
|
|
ld hl, EvosAttacksPointers
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-08 00:27:46 -07:00
|
|
|
|
add hl, bc
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld a, BANK(EvosAttacksPointers)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarHalfword
|
|
|
|
|
pop bc
|
2013-12-24 15:35:26 -08:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push bc
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld a, BANK(EvosAttacks)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarByte
|
2013-12-24 15:35:26 -08:00
|
|
|
|
cp EVOLVE_ITEM
|
2013-05-08 00:27:46 -07:00
|
|
|
|
pop bc
|
|
|
|
|
ret nz
|
2013-12-24 15:35:26 -08:00
|
|
|
|
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 3
|
2013-05-08 00:27:46 -07:00
|
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-12-24 15:35:26 -08:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
; Moon Stone's constant from Pokémon Red is used.
|
|
|
|
|
; No Pokémon evolve with Burn Heal,
|
|
|
|
|
; so Moon Balls always have a catch rate of 1×.
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push bc
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld a, BANK(EvosAttacks)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarByte
|
2014-10-23 23:43:50 -07:00
|
|
|
|
cp MOON_STONE_RED ; BURN_HEAL
|
2013-05-08 00:27:46 -07:00
|
|
|
|
pop bc
|
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
|
|
sla b
|
2013-12-24 15:35:26 -08:00
|
|
|
|
jr c, .max
|
|
|
|
|
sla b
|
|
|
|
|
jr nc, .done
|
|
|
|
|
.max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld b, $ff
|
2013-12-24 15:35:26 -08:00
|
|
|
|
.done
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
LoveBallMultiplier:
|
|
|
|
|
; This function is buggy.
|
|
|
|
|
; Intent: multiply catch rate by 8 if mons are of same species, different sex
|
|
|
|
|
; Reality: multiply catch rate by 8 if mons are of same species, same sex
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
; does species match?
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, [TempEnemyMonSpecies]
|
|
|
|
|
ld c, a
|
|
|
|
|
ld a, [TempBattleMonSpecies]
|
|
|
|
|
cp c
|
|
|
|
|
ret nz
|
2013-08-03 13:19:29 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
; check player mon species
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push bc
|
|
|
|
|
ld a, [TempBattleMonSpecies]
|
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
|
xor a
|
|
|
|
|
ld [MonType], a
|
|
|
|
|
ld a, [CurBattleMon]
|
|
|
|
|
ld [CurPartyMon], a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba GetGender
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr c, .done1 ; no effect on genderless
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ld d, 0 ; male
|
|
|
|
|
jr nz, .playermale
|
|
|
|
|
inc d ; female
|
|
|
|
|
.playermale
|
2013-08-03 13:19:29 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
; check wild mon species
|
2013-05-08 00:27:46 -07:00
|
|
|
|
push de
|
|
|
|
|
ld a, [TempEnemyMonSpecies]
|
|
|
|
|
ld [CurPartySpecies], a
|
2013-07-02 11:10:49 -07:00
|
|
|
|
ld a, WILDMON
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld [MonType], a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba GetGender
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr c, .done2 ; no effect on genderless
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ld d, 0 ; male
|
|
|
|
|
jr nz, .wildmale
|
|
|
|
|
inc d ; female
|
|
|
|
|
.wildmale
|
2013-08-03 13:19:29 -07:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, d
|
|
|
|
|
pop de
|
|
|
|
|
cp d
|
|
|
|
|
pop bc
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ret nz ; for the intended effect, this should be “ret z”
|
2013-08-03 13:19:29 -07:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr c, .max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr c, .max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
|
|
|
|
ret nc
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld b, $ff
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.done2
|
2013-05-08 00:27:46 -07:00
|
|
|
|
pop de
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
.done1
|
2013-05-08 00:27:46 -07:00
|
|
|
|
pop bc
|
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
FastBallMultiplier:
|
|
|
|
|
; This function is buggy.
|
|
|
|
|
; Intent: multiply catch rate by 4 if enemy mon is in one of the three
|
|
|
|
|
; FleeMons tables.
|
|
|
|
|
; Reality: multiply catch rate by 4 if enemy mon is one of the first three in
|
|
|
|
|
; the first FleeMons table.
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, [TempEnemyMonSpecies]
|
|
|
|
|
ld c, a
|
2013-12-24 14:19:39 -08:00
|
|
|
|
ld hl, FleeMons
|
|
|
|
|
ld d, 3
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2013-12-24 14:19:39 -08:00
|
|
|
|
.loop
|
|
|
|
|
ld a, BANK(FleeMons)
|
2013-05-08 00:27:46 -07:00
|
|
|
|
call GetFarByte
|
|
|
|
|
|
|
|
|
|
inc hl
|
2013-12-24 14:19:39 -08:00
|
|
|
|
cp -1
|
|
|
|
|
jr z, .next
|
2013-05-08 00:27:46 -07:00
|
|
|
|
cp c
|
2014-10-23 23:18:48 -07:00
|
|
|
|
jr nz, .next ; for the intended effect, this should be “jr nz, .loop”
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
2013-12-24 14:19:39 -08:00
|
|
|
|
jr c, .max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
|
|
|
|
sla b
|
|
|
|
|
ret nc
|
|
|
|
|
|
2013-12-24 14:19:39 -08:00
|
|
|
|
.max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld b, $ff
|
|
|
|
|
ret
|
|
|
|
|
|
2013-12-24 14:19:39 -08:00
|
|
|
|
.next
|
2013-05-08 00:27:46 -07:00
|
|
|
|
dec d
|
2013-12-24 14:19:39 -08:00
|
|
|
|
jr nz, .loop
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ret
|
|
|
|
|
|
2014-10-23 23:18:48 -07:00
|
|
|
|
LevelBallMultiplier:
|
|
|
|
|
; multiply catch rate by 8 if player mon level / 4 > enemy mon level
|
|
|
|
|
; multiply catch rate by 4 if player mon level / 2 > enemy mon level
|
|
|
|
|
; multiply catch rate by 2 if player mon level > enemy mon level
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, [BattleMonLevel]
|
|
|
|
|
ld c, a
|
|
|
|
|
ld a, [EnemyMonLevel]
|
|
|
|
|
cp c
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ret nc ; if player is lower level, we're done here
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
2014-08-13 19:42:58 -07:00
|
|
|
|
jr c, .max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
|
|
|
|
srl c
|
|
|
|
|
cp c
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ret nc ; if player/2 is lower level, we're done here
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
2014-08-13 19:42:58 -07:00
|
|
|
|
jr c, .max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
|
|
|
|
srl c
|
|
|
|
|
cp c
|
2014-10-23 23:18:48 -07:00
|
|
|
|
ret nc ; if player/4 is lower level, we're done here
|
2013-05-08 00:27:46 -07:00
|
|
|
|
sla b
|
|
|
|
|
ret nc
|
|
|
|
|
|
2014-08-13 19:42:58 -07:00
|
|
|
|
.max
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld b, $ff
|
|
|
|
|
ret
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
UnknownText_0xedab: ; 0xedab
|
|
|
|
|
; It dodged the thrown BALL! This #MON can't be caught!
|
|
|
|
|
text_jump UnknownText_0x1c5a5a
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedb0
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedb0: ; 0xedb0
|
|
|
|
|
; You missed the #MON!
|
|
|
|
|
text_jump UnknownText_0x1c5a90
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedb5
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedb5: ; 0xedb5
|
|
|
|
|
; Oh no! The #MON broke free!
|
|
|
|
|
text_jump UnknownText_0x1c5aa6
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedba
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedba: ; 0xedba
|
|
|
|
|
; Aww! It appeared to be caught!
|
|
|
|
|
text_jump UnknownText_0x1c5ac3
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedbf
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedbf: ; 0xedbf
|
|
|
|
|
; Aargh! Almost had it!
|
|
|
|
|
text_jump UnknownText_0x1c5ae3
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedc4
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedc4: ; 0xedc4
|
|
|
|
|
; Shoot! It was so close too!
|
|
|
|
|
text_jump UnknownText_0x1c5afa
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedc9
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedc9: ; 0xedc9
|
|
|
|
|
; Gotcha! @ was caught!@ @
|
|
|
|
|
text_jump UnknownText_0x1c5b17
|
|
|
|
|
start_asm
|
|
|
|
|
; 0xedce
|
|
|
|
|
|
|
|
|
|
Functionedce: ; edce
|
|
|
|
|
call WaitSFX
|
|
|
|
|
push bc
|
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
|
call PlayMusic
|
|
|
|
|
call DelayFrame
|
|
|
|
|
ld de, MUSIC_CAPTURE
|
|
|
|
|
call PlayMusic
|
|
|
|
|
pop bc
|
|
|
|
|
ld hl, UnknownText_0xede6
|
|
|
|
|
ret
|
|
|
|
|
; ede6
|
|
|
|
|
|
|
|
|
|
UnknownText_0xede6: ; 0xede6
|
|
|
|
|
; @
|
|
|
|
|
text_jump UnknownText_0x1c5b35
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedeb
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedeb: ; 0xedeb
|
|
|
|
|
; was sent to BILL's PC.
|
|
|
|
|
text_jump UnknownText_0x1c5b38
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedf0
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedf0: ; 0xedf0
|
|
|
|
|
; 's data was newly added to the #DEX.@ @
|
|
|
|
|
text_jump UnknownText_0x1c5b53
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedf5
|
|
|
|
|
|
|
|
|
|
UnknownText_0xedf5: ; 0xedf5
|
|
|
|
|
; Give a nickname to @ ?
|
|
|
|
|
text_jump UnknownText_0x1c5b7f
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xedfa
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-10-01 21:53:35 -07:00
|
|
|
|
Functionedfa: ; edfa (3:6dfa)
|
|
|
|
|
callba Function2715c
|
|
|
|
|
ret
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2014-04-28 13:43:11 -07:00
|
|
|
|
TownMap: ; ee01
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function91ae1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; ee08
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bicycle: ; ee08
|
2015-07-18 20:45:39 -07:00
|
|
|
|
callba BikeFunction
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; ee0f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MoonStone:
|
|
|
|
|
FireStone:
|
|
|
|
|
Thunderstone:
|
|
|
|
|
WaterStone:
|
|
|
|
|
LeafStone:
|
|
|
|
|
SunStone: ; ee0f
|
|
|
|
|
ld b, $5
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp c, .asm_ee38
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, PartyMon1Item - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
|
|
|
|
|
ld a, [hl]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp EVERSTONE
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr z, .asm_ee35
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, $1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1e9], a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function421d8
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd268]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_ee35
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
|
|
|
|
jp Functionf795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_ee35
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call WontHaveAnyEffectMessage
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_ee38
|
2013-05-07 23:02:15 -07:00
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; ee3d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HpUp:
|
|
|
|
|
Protein:
|
|
|
|
|
Iron:
|
|
|
|
|
Carbos:
|
|
|
|
|
Calcium: ; ee3d
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp c, Functionee9f
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functioneef5
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functioneed9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, PartyMon1StatExp - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp 100
|
|
|
|
|
jr nc, Functionee83
|
|
|
|
|
|
|
|
|
|
add 10
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld [hl], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionee8c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functioneed9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, Strings_eeab
|
2013-05-07 23:02:15 -07:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld h, [hl]
|
|
|
|
|
ld l, a
|
|
|
|
|
ld de, StringBuffer2
|
|
|
|
|
ld bc, $000d
|
|
|
|
|
call CopyBytes
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf780
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xeea6
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld c, $2
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba ChangeHappiness
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionee83: ; ee83
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, WontHaveAnyEffectText
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jp ClearPalettes
|
|
|
|
|
; ee8c
|
|
|
|
|
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionee8c: ; ee8c
|
|
|
|
|
ld a, PartyMon1MaxHP - PartyMon1
|
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld d, h
|
|
|
|
|
ld e, l
|
|
|
|
|
ld a, PartyMon1HPExp - 1 - PartyMon1
|
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld b, $1
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef_jump Functione167
|
2013-12-24 14:11:52 -08:00
|
|
|
|
; ee9f
|
|
|
|
|
|
|
|
|
|
Functionee9f: ; ee9f
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp ClearPalettes
|
|
|
|
|
; eea6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UnknownText_0xeea6: ; 0xeea6
|
|
|
|
|
; 's @ rose.
|
|
|
|
|
text_jump UnknownText_0x1c5b9a
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xeeab
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Strings_eeab: ; eeab
|
|
|
|
|
dw .health
|
|
|
|
|
dw .attack
|
|
|
|
|
dw .defense
|
|
|
|
|
dw .speed
|
|
|
|
|
dw .special
|
|
|
|
|
|
|
|
|
|
.health db "HEALTH@"
|
|
|
|
|
.attack db "ATTACK@"
|
|
|
|
|
.defense db "DEFENSE@"
|
|
|
|
|
.speed db "SPEED@"
|
|
|
|
|
.special db "SPECIAL@"
|
|
|
|
|
; eed9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functioneed9: ; eed9
|
|
|
|
|
ld a, [CurItem]
|
|
|
|
|
ld hl, Table_eeeb
|
|
|
|
|
.next
|
|
|
|
|
cp [hl]
|
|
|
|
|
inc hl
|
|
|
|
|
jr z, .asm_eee6
|
|
|
|
|
inc hl
|
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.asm_eee6
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld c, a
|
|
|
|
|
ld b, 0
|
|
|
|
|
ret
|
|
|
|
|
; eeeb
|
|
|
|
|
|
|
|
|
|
Table_eeeb: ; eeeb
|
2014-06-12 18:32:42 -07:00
|
|
|
|
db HP_UP, PartyMon1HPExp - PartyMon1StatExp
|
|
|
|
|
db PROTEIN, PartyMon1AtkExp - PartyMon1StatExp
|
|
|
|
|
db IRON, PartyMon1DefExp - PartyMon1StatExp
|
|
|
|
|
db CARBOS, PartyMon1SpdExp - PartyMon1StatExp
|
|
|
|
|
db CALCIUM, PartyMon1SpcExp - PartyMon1StatExp
|
2013-12-24 14:11:52 -08:00
|
|
|
|
; eef5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functioneef5: ; eef5
|
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
|
ld [CurSpecies], a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, PartyMon1Level - PartyMon1
|
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld [CurPartyLevel], a
|
|
|
|
|
call GetBaseData
|
|
|
|
|
ld a, [CurPartyMon]
|
2014-06-12 18:32:42 -07:00
|
|
|
|
ld hl, PartyMonNicknames
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call GetNick
|
|
|
|
|
ret
|
|
|
|
|
; 0xef14
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RareCandy: ; ef14
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp c, Functionee9f
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functioneef5
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, PartyMon1Level - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
|
|
|
|
|
ld a, [hl]
|
2014-06-03 14:07:10 -07:00
|
|
|
|
cp MAX_LEVEL
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp nc, Functionee83
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
inc a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ld [CurPartyLevel], a
|
|
|
|
|
push de
|
|
|
|
|
ld d, a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function50e47
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
pop de
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1Exp - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
|
|
|
|
|
ld a, [hMultiplicand]
|
|
|
|
|
ld [hli], a
|
|
|
|
|
ld a, [$ffb5]
|
|
|
|
|
ld [hli], a
|
|
|
|
|
ld a, [$ffb6]
|
|
|
|
|
ld [hl], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1MaxHP - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hli]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld c, [hl]
|
|
|
|
|
push bc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionee8c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1MaxHP + 1 - PartyMon1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
|
|
|
|
|
pop bc
|
|
|
|
|
ld a, [hld]
|
|
|
|
|
sub c
|
|
|
|
|
ld c, a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
sbc b
|
|
|
|
|
ld b, a
|
|
|
|
|
dec hl
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
add c
|
|
|
|
|
ld [hld], a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
adc b
|
|
|
|
|
ld [hl], a
|
2015-07-19 01:58:31 -07:00
|
|
|
|
callba LevelUpHappinessMod
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, $f8
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf24a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
xor a
|
|
|
|
|
ld [MonType], a
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef Function5084a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2014-06-04 01:10:56 -07:00
|
|
|
|
hlcoord 9, 0
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld b, 10
|
|
|
|
|
ld c, 9
|
|
|
|
|
call TextBox
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2014-06-04 01:10:56 -07:00
|
|
|
|
hlcoord 11, 1
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld bc, $0004
|
2015-02-11 13:15:38 -08:00
|
|
|
|
predef PrintTempMonStats
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 15:35:26 -08:00
|
|
|
|
call Functiona80
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
xor a
|
|
|
|
|
ld [MonType], a
|
|
|
|
|
ld a, [CurPartySpecies]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef LearnLevelMoves
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1e9], a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function421d8
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; efad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HealPowder: ; efad
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp c, Functionf29e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionefda
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
cp $0
|
|
|
|
|
jr nz, .asm_efc9
|
|
|
|
|
ld c, $f
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba ChangeHappiness
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call LooksBitterMessage
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, $0
|
|
|
|
|
|
|
|
|
|
.asm_efc9
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; efcc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Antidote:
|
|
|
|
|
BurnHeal:
|
|
|
|
|
IceHeal:
|
|
|
|
|
Awakening:
|
|
|
|
|
ParlyzHeal:
|
|
|
|
|
FullHeal:
|
|
|
|
|
Psncureberry:
|
|
|
|
|
Przcureberry:
|
|
|
|
|
BurntBerry:
|
|
|
|
|
IceBerry:
|
|
|
|
|
MintBerry:
|
|
|
|
|
Miracleberry: ; efcc
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
|
|
|
|
jp c, Functionf29e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionefd4: ; efd4
|
|
|
|
|
call Functionefda
|
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; efda
|
|
|
|
|
|
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
Functionefda: ; efda (3:6fda)
|
|
|
|
|
call Functionf30d
|
|
|
|
|
ld a, $1
|
|
|
|
|
ret z
|
|
|
|
|
call Functionf058
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1Status - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and c
|
|
|
|
|
jr nz, .asm_eff4
|
|
|
|
|
call Functionf009
|
|
|
|
|
ld a, $1
|
|
|
|
|
ret nc
|
|
|
|
|
ld b, $f9
|
|
|
|
|
.asm_eff4
|
|
|
|
|
xor a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ld a, b
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [PartyMenuActionText], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf030
|
|
|
|
|
call Functionf780
|
|
|
|
|
call Functionf279
|
|
|
|
|
call Functionf795
|
|
|
|
|
ld a, $0
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf009: ; f009 (3:7009)
|
|
|
|
|
call Functionf2a6
|
|
|
|
|
jr nc, .asm_f01c
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [PlayerSubStatus3]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
bit 7, a
|
|
|
|
|
jr z, .asm_f01c
|
|
|
|
|
ld a, c
|
|
|
|
|
cp $ff
|
|
|
|
|
jr nz, .asm_f01c
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
.asm_f01c
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf01e: ; f01e (3:701e)
|
|
|
|
|
call Functionf2a6
|
|
|
|
|
ret nc
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hli]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [BattleMonHP], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld a, [hld]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [BattleMonHP + 1], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf030: ; f030 (3:7030)
|
|
|
|
|
call Functionf2a6
|
|
|
|
|
ret nc
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [BattleMonStatus], a
|
|
|
|
|
ld hl, PlayerSubStatus5
|
2013-10-01 16:59:16 -07:00
|
|
|
|
res 0, [hl]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, PlayerSubStatus1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
res 0, [hl]
|
|
|
|
|
call Functionf058
|
|
|
|
|
ld a, c
|
|
|
|
|
cp $ff
|
|
|
|
|
jr nz, .asm_f04f
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, PlayerSubStatus3
|
2013-10-01 16:59:16 -07:00
|
|
|
|
res 7, [hl]
|
|
|
|
|
.asm_f04f
|
|
|
|
|
push bc
|
2013-12-31 01:10:49 -08:00
|
|
|
|
callba Function365d7
|
2013-10-01 16:59:16 -07:00
|
|
|
|
pop bc
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf058: ; f058 (3:7058)
|
|
|
|
|
push hl
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [CurItem]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, Table_f071
|
|
|
|
|
ld bc, 3
|
|
|
|
|
.next
|
2013-10-01 16:59:16 -07:00
|
|
|
|
cp [hl]
|
|
|
|
|
jr z, .asm_f068
|
|
|
|
|
add hl, bc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jr .next
|
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
.asm_f068
|
|
|
|
|
inc hl
|
|
|
|
|
ld b, [hl]
|
|
|
|
|
inc hl
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld c, a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp %11111111
|
2013-10-01 16:59:16 -07:00
|
|
|
|
pop hl
|
|
|
|
|
ret
|
|
|
|
|
; f071 (3:7071)
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Table_f071: ; f071
|
|
|
|
|
; item, party menu action text, status
|
|
|
|
|
db ANTIDOTE, $f0, 1 << PSN
|
|
|
|
|
db BURN_HEAL, $f1, 1 << BRN
|
|
|
|
|
db ICE_HEAL, $f2, 1 << FRZ
|
|
|
|
|
db AWAKENING, $f3, SLP
|
|
|
|
|
db PARLYZ_HEAL, $f4, 1 << PAR
|
|
|
|
|
db FULL_HEAL, $f6, %11111111
|
|
|
|
|
db FULL_RESTORE, $f6, %11111111
|
|
|
|
|
db HEAL_POWDER, $f6, %11111111
|
|
|
|
|
db PSNCUREBERRY, $f0, 1 << PSN
|
|
|
|
|
db PRZCUREBERRY, $f4, 1 << PAR
|
|
|
|
|
db BURNT_BERRY, $f2, 1 << FRZ
|
|
|
|
|
db ICE_BERRY, $f1, 1 << BRN
|
|
|
|
|
db MINT_BERRY, $f3, SLP
|
|
|
|
|
db MIRACLEBERRY, $f6, %11111111
|
|
|
|
|
db -1, 0, 0
|
|
|
|
|
; f09e
|
2013-10-01 16:59:16 -07:00
|
|
|
|
|
|
|
|
|
Functionf09e: ; f09e (3:709e)
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, Jumptable_f0a3
|
|
|
|
|
rst JumpTable
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Jumptable_f0a3: ; f0a3 (3:70a3)
|
|
|
|
|
dw Functionf2a2
|
|
|
|
|
dw Functionf299
|
|
|
|
|
dw Functionf29e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RevivalHerb: ; f0a9
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
|
|
|
|
jp c, Functionf29e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf0d6
|
|
|
|
|
cp 0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_f0c5
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld c, $11
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba ChangeHappiness
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call LooksBitterMessage
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f0c5
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f0c8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Revive:
|
|
|
|
|
MaxRevive: ; f0c8
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
|
|
|
|
jp c, Functionf29e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf0d6
|
|
|
|
|
jp Functionf09e
|
|
|
|
|
; f0d6
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionf0d6: ; f0d6
|
|
|
|
|
call Functionf30d
|
|
|
|
|
ld a, 1
|
|
|
|
|
ret nz
|
|
|
|
|
ld a, [IsInBattle]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_f104
|
|
|
|
|
|
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
|
ld c, a
|
|
|
|
|
ld d, 0
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wc6fc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, CHECK_FLAG
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef FlagPredef
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, c
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_f104
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
|
ld c, a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wc664
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, SET_FLAG
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef FlagPredef
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
|
|
|
|
.asm_f104
|
|
|
|
|
xor a
|
|
|
|
|
ld [Danger], a
|
|
|
|
|
ld a, [CurItem]
|
|
|
|
|
cp REVIVE
|
|
|
|
|
jr z, .asm_f114
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf2c3
|
|
|
|
|
jr .asm_f117
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_f114
|
|
|
|
|
call Functionf2ba
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_f117
|
|
|
|
|
call Functionf1db
|
|
|
|
|
ld a, $f7
|
|
|
|
|
ld [PartyMenuActionText], a
|
|
|
|
|
call Functionf279
|
|
|
|
|
call Functionf795
|
|
|
|
|
ld a, 0
|
|
|
|
|
ret
|
|
|
|
|
; f128
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
FullRestore: ; f128
|
|
|
|
|
ld b, 1
|
|
|
|
|
call Functionf1f9
|
|
|
|
|
jp c, Functionf29e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf30d
|
|
|
|
|
jp z, Functionf299
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf31b
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr c, .asm_f13e
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionefd4
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f13e
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf144
|
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f144
|
|
|
|
|
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionf144: ; f144
|
|
|
|
|
xor a
|
|
|
|
|
ld [Danger], a
|
|
|
|
|
call Functionf2c3
|
|
|
|
|
ld a, PartyMon1Status - PartyMon1
|
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
xor a
|
|
|
|
|
ld [hli], a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
call Functionf030
|
|
|
|
|
call Functionf01e
|
|
|
|
|
call Functionf1db
|
|
|
|
|
ld a, $f5
|
|
|
|
|
ld [PartyMenuActionText], a
|
|
|
|
|
call Functionf279
|
|
|
|
|
call Functionf795
|
|
|
|
|
ld a, 0
|
|
|
|
|
ret
|
|
|
|
|
; f16a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BitterBerry: ; f16a
|
|
|
|
|
ld hl, PlayerSubStatus3
|
2013-12-24 14:11:52 -08:00
|
|
|
|
bit SUBSTATUS_CONFUSED, [hl]
|
|
|
|
|
ld a, 1
|
|
|
|
|
jr z, .done
|
|
|
|
|
|
|
|
|
|
res SUBSTATUS_CONFUSED, [hl]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
xor a
|
|
|
|
|
ld [hBattleTurn], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, ConfusedNoMoreText
|
2013-08-31 00:54:02 -07:00
|
|
|
|
call StdBattleTextBox
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.done
|
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f186
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MaxPotion:
|
|
|
|
|
HyperPotion:
|
|
|
|
|
SuperPotion:
|
|
|
|
|
Potion:
|
|
|
|
|
FreshWater:
|
|
|
|
|
SodaPop:
|
|
|
|
|
Lemonade:
|
|
|
|
|
MoomooMilk:
|
|
|
|
|
Ragecandybar:
|
|
|
|
|
BerryJuice:
|
|
|
|
|
Berry:
|
|
|
|
|
GoldBerry: ; f186
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1a9
|
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f18c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Energypowder: ; f18c
|
|
|
|
|
ld c, $f
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jr Functionf192
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f190
|
|
|
|
|
|
|
|
|
|
EnergyRoot: ; f190
|
|
|
|
|
ld c, $10
|
|
|
|
|
; f192
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionf192: ; f192
|
2013-05-07 23:02:15 -07:00
|
|
|
|
push bc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1a9
|
2013-05-07 23:02:15 -07:00
|
|
|
|
pop bc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp 0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr nz, .asm_f1a6
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
callba ChangeHappiness
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call LooksBitterMessage
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f1a6
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf09e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f1a9
|
|
|
|
|
|
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
Functionf1a9: ; f1a9 (3:71a9)
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, 1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf1f9
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 2
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf30d
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret z
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf31b
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret nc
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [Danger], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf395
|
|
|
|
|
call Functionf2d1
|
|
|
|
|
call Functionf01e
|
|
|
|
|
call Functionf1db
|
|
|
|
|
ld a, $f5
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [PartyMenuActionText], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf279
|
|
|
|
|
call Functionf795
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, 0
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf1db: ; f1db (3:71db)
|
|
|
|
|
push de
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld de, SFX_POTION
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call WaitPlaySFX
|
|
|
|
|
pop de
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [CurPartyMon]
|
2014-06-04 01:10:56 -07:00
|
|
|
|
hlcoord 11, 0
|
2014-08-13 19:42:58 -07:00
|
|
|
|
ld bc, SCREEN_WIDTH * 2
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call AddNTimes
|
|
|
|
|
ld a, $2
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd10a], a
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef_jump Functionc6e0
|
2013-10-01 16:59:16 -07:00
|
|
|
|
|
|
|
|
|
Functionf1f9: ; f1f9 (3:71f9)
|
|
|
|
|
call Functionf20b
|
|
|
|
|
ret c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [CurPartySpecies]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp EGG
|
2013-10-01 16:59:16 -07:00
|
|
|
|
jr nz, .asm_f209
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call CantUseOnEggMessage
|
2013-10-01 16:59:16 -07:00
|
|
|
|
scf
|
|
|
|
|
ret
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
.asm_f209
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf20b: ; f20b (3:720b)
|
|
|
|
|
ld a, b
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [PartyMenuActionText], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
push bc
|
|
|
|
|
call WhiteBGMap
|
|
|
|
|
call Functionf21c
|
|
|
|
|
pop bc
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf21c: ; f21c (3:721c)
|
2013-10-01 18:55:40 -07:00
|
|
|
|
callba Function5004f
|
|
|
|
|
callba Function50405
|
|
|
|
|
callba Function503e0
|
|
|
|
|
callba WritePartyMenuTilemap
|
|
|
|
|
callba PrintPartyMenuText
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call WaitBGMap
|
|
|
|
|
call Function32f9
|
|
|
|
|
call DelayFrame
|
2013-10-01 18:55:40 -07:00
|
|
|
|
callba PartyMenuSelect
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf24a: ; f24a (3:724a)
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [PartyMenuActionText], a
|
|
|
|
|
ld a, [CurPartySpecies]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
push af
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [CurPartyMon]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
push af
|
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
push bc
|
2013-10-01 18:55:40 -07:00
|
|
|
|
callba WritePartyMenuTilemap
|
|
|
|
|
callba Function50566
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call WaitBGMap
|
|
|
|
|
call Function32f9
|
|
|
|
|
call DelayFrame
|
|
|
|
|
pop bc
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
pop af
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [CurPartyMon], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
pop af
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [CurPartySpecies], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf279: ; f279 (3:7279)
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
ld hl, TileMap
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld bc, TileMapEnd - TileMap
|
|
|
|
|
ld a, " "
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call ByteFill
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [PartyMenuActionText]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf24a
|
|
|
|
|
ld a, $1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [hBGMapMode], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld c, $32
|
|
|
|
|
call DelayFrames
|
|
|
|
|
jp Functiona80
|
|
|
|
|
|
|
|
|
|
Functionf299: ; f299 (3:7299)
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call WontHaveAnyEffectMessage
|
2013-10-01 16:59:16 -07:00
|
|
|
|
jr Functionf2a2
|
|
|
|
|
|
|
|
|
|
Functionf29e: ; f29e (3:729e)
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
|
|
|
|
|
Functionf2a2: ; f2a2 (3:72a2)
|
|
|
|
|
call ClearPalettes
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf2a6: ; f2a6 (3:72a6)
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [IsInBattle]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
and a
|
|
|
|
|
ret z
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [CurPartyMon]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
push hl
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, CurBattleMon
|
2013-10-01 16:59:16 -07:00
|
|
|
|
cp [hl]
|
|
|
|
|
pop hl
|
|
|
|
|
jr nz, .asm_f2b8
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
.asm_f2b8
|
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf2ba: ; f2ba (3:72ba)
|
|
|
|
|
call Functionf36f
|
|
|
|
|
srl d
|
|
|
|
|
rr e
|
|
|
|
|
jr asm_f2c6
|
|
|
|
|
|
|
|
|
|
Functionf2c3: ; f2c3 (3:72c3)
|
|
|
|
|
call Functionf36f
|
|
|
|
|
asm_f2c6: ; f2c6 (3:72c6)
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld [hl], d
|
|
|
|
|
inc hl
|
|
|
|
|
ld [hl], e
|
|
|
|
|
jp Functionf328
|
|
|
|
|
|
|
|
|
|
Functionf2d1: ; f2d1 (3:72d1)
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP + 1 - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
add e
|
|
|
|
|
ld [hld], a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
adc d
|
|
|
|
|
ld [hl], a
|
|
|
|
|
jr c, .asm_f2f5
|
|
|
|
|
call Functionf328
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP + 1 - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld d, h
|
|
|
|
|
ld e, l
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1MaxHP + 1 - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [de]
|
|
|
|
|
sub [hl]
|
|
|
|
|
dec de
|
|
|
|
|
dec hl
|
|
|
|
|
ld a, [de]
|
|
|
|
|
sbc [hl]
|
|
|
|
|
jr c, .asm_f2f8
|
|
|
|
|
.asm_f2f5
|
|
|
|
|
call Functionf2c3
|
|
|
|
|
.asm_f2f8
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf2f9: ; f2f9 (3:72f9)
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP + 1 - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
sub e
|
|
|
|
|
ld [hld], a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
sbc d
|
|
|
|
|
ld [hl], a
|
|
|
|
|
jr nc, .asm_f309
|
|
|
|
|
xor a
|
|
|
|
|
ld [hld], a
|
|
|
|
|
ld [hl], a
|
|
|
|
|
.asm_f309
|
|
|
|
|
call Functionf328
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf30d: ; f30d (3:730d)
|
|
|
|
|
push de
|
|
|
|
|
call Functionf35f
|
|
|
|
|
call Functionf348
|
|
|
|
|
call Functionf356
|
|
|
|
|
ld a, d
|
|
|
|
|
or e
|
|
|
|
|
pop de
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf31b: ; f31b (3:731b)
|
|
|
|
|
call Functionf356
|
|
|
|
|
ld h, d
|
|
|
|
|
ld l, e
|
|
|
|
|
call Functionf36f
|
|
|
|
|
ld a, l
|
|
|
|
|
sub e
|
|
|
|
|
ld a, h
|
|
|
|
|
sbc d
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf328: ; f328 (3:7328)
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hli]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1ef], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld a, [hl]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1ee], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
; f336 (3:7336)
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionf336: ; f336
|
|
|
|
|
ld a, d
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1ef], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld a, e
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1ee], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ret
|
|
|
|
|
; f33f
|
|
|
|
|
|
|
|
|
|
Functionf33f: ; f33f
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd1ef]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld d, a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd1ee]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld e, a
|
|
|
|
|
ret
|
|
|
|
|
; f348
|
2013-10-01 16:59:16 -07:00
|
|
|
|
|
|
|
|
|
Functionf348: ; f348 (3:7348)
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1HP - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hli]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1ed], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld a, [hl]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd1ec], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf356: ; f356 (3:7356)
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd1ed]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld d, a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd1ec]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld e, a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf35f: ; f35f (3:735f)
|
|
|
|
|
push hl
|
2015-02-11 13:14:56 -08:00
|
|
|
|
ld a, PartyMon1MaxHP - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hli]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [Buffer2], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld a, [hl]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [Buffer1], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
pop hl
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf36f: ; f36f (3:736f)
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [Buffer2]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld d, a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [Buffer1]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld e, a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf378: ; f378 (3:7378)
|
|
|
|
|
push bc
|
2014-12-28 18:44:23 -08:00
|
|
|
|
ld a, PartyMon1MaxHP - PartyMon1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
ld a, [hli]
|
2014-12-28 18:44:23 -08:00
|
|
|
|
ld [hDividend + 0], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld a, [hl]
|
2014-12-28 18:44:23 -08:00
|
|
|
|
ld [hDividend + 1], a
|
|
|
|
|
ld a, 5
|
|
|
|
|
ld [hDivisor], a
|
|
|
|
|
ld b, 2
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Divide
|
2014-12-28 18:44:23 -08:00
|
|
|
|
ld a, [hQuotient + 1]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld d, a
|
2014-12-28 18:44:23 -08:00
|
|
|
|
ld a, [hQuotient + 2]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld e, a
|
|
|
|
|
pop bc
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf395: ; f395 (3:7395)
|
|
|
|
|
push hl
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [CurItem]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, Tablef3af
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld d, a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.next
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld a, [hli]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp -1
|
2013-10-01 16:59:16 -07:00
|
|
|
|
jr z, .asm_f3a9
|
|
|
|
|
cp d
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jr z, .done
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-10-01 16:59:16 -07:00
|
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jr .next
|
|
|
|
|
|
2013-10-01 16:59:16 -07:00
|
|
|
|
.asm_f3a9
|
|
|
|
|
scf
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.done
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ld e, [hl]
|
|
|
|
|
inc hl
|
|
|
|
|
ld d, [hl]
|
|
|
|
|
pop hl
|
|
|
|
|
ret
|
|
|
|
|
; f3af (3:73af)
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Tablef3af: ; f3af
|
|
|
|
|
dbw FRESH_WATER, 50
|
|
|
|
|
dbw SODA_POP, 60
|
|
|
|
|
dbw LEMONADE, 80
|
|
|
|
|
dbw HYPER_POTION, 200
|
|
|
|
|
dbw SUPER_POTION, 50
|
|
|
|
|
dbw POTION, 20
|
|
|
|
|
dbw MAX_POTION, 999
|
|
|
|
|
dbw FULL_RESTORE, 999
|
|
|
|
|
dbw MOOMOO_MILK, 100
|
|
|
|
|
dbw BERRY, 10
|
|
|
|
|
dbw GOLD_BERRY, 30
|
|
|
|
|
dbw ENERGYPOWDER, 50
|
|
|
|
|
dbw ENERGY_ROOT, 200
|
|
|
|
|
dbw RAGECANDYBAR, 20
|
|
|
|
|
dbw BERRY_JUICE, 20
|
|
|
|
|
dbw -1, 0
|
|
|
|
|
; f3df
|
2013-10-01 16:59:16 -07:00
|
|
|
|
|
|
|
|
|
Functionf3df: ; f3df (3:73df)
|
2014-12-28 18:44:23 -08:00
|
|
|
|
; Softboiled/Milk Drink in the field
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd0d8]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
dec a
|
|
|
|
|
ld b, a
|
|
|
|
|
call Functionf419
|
|
|
|
|
jr c, .asm_f413
|
|
|
|
|
ld a, b
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [CurPartyMon], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf30d
|
|
|
|
|
call Functionf378
|
|
|
|
|
call Functionf2f9
|
|
|
|
|
push bc
|
|
|
|
|
call Functionf1db
|
|
|
|
|
pop bc
|
|
|
|
|
call Functionf378
|
|
|
|
|
ld a, c
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [CurPartyMon], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf30d
|
|
|
|
|
call Functionf2d1
|
|
|
|
|
call Functionf1db
|
|
|
|
|
ld a, $f5
|
|
|
|
|
call Functionf24a
|
|
|
|
|
call Functiona36
|
|
|
|
|
.asm_f413
|
|
|
|
|
ld a, b
|
|
|
|
|
inc a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0d8], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
Functionf419: ; f419 (3:7419)
|
|
|
|
|
push bc
|
|
|
|
|
ld a, $1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [PartyMenuActionText], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf21c
|
|
|
|
|
pop bc
|
|
|
|
|
jr c, .asm_f43e
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd0d8]
|
2013-10-01 16:59:16 -07:00
|
|
|
|
dec a
|
|
|
|
|
ld c, a
|
|
|
|
|
ld a, b
|
|
|
|
|
cp c
|
|
|
|
|
jr z, .asm_f440
|
|
|
|
|
ld a, c
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [CurPartyMon], a
|
2013-10-01 16:59:16 -07:00
|
|
|
|
call Functionf30d
|
|
|
|
|
jr z, .asm_f440
|
|
|
|
|
call Functionf31b
|
|
|
|
|
jr nc, .asm_f440
|
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
.asm_f43e
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
.asm_f440
|
|
|
|
|
push bc
|
2013-12-24 15:35:26 -08:00
|
|
|
|
ld hl, UnknownText_0xf44a
|
2015-07-18 20:45:39 -07:00
|
|
|
|
call MenuTextBoxBackup
|
2013-10-01 16:59:16 -07:00
|
|
|
|
pop bc
|
|
|
|
|
jr Functionf419
|
|
|
|
|
; f44a (3:744a)
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
UnknownText_0xf44a: ; 0xf44a
|
|
|
|
|
; That can't be used on this #MON.
|
|
|
|
|
text_jump UnknownText_0x1c5bac
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf44f
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
EscapeRope: ; f44f
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2015-07-18 20:45:39 -07:00
|
|
|
|
callba EscapeRopeFunction
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd0ec]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp 1
|
|
|
|
|
call z, Functionf795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f462
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SuperRepel: ; f462
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, 200
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr Function_0xf46c
|
|
|
|
|
; f466
|
|
|
|
|
|
|
|
|
|
MaxRepel: ; f466
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, 250
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr Function_0xf46c
|
|
|
|
|
; f466
|
|
|
|
|
|
|
|
|
|
Repel: ; f46a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, 100
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f46c
|
|
|
|
|
|
|
|
|
|
Function_0xf46c: ; f46c
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wdca1]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xf47d
|
|
|
|
|
jp nz, PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, b
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wdca1], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f47d
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
UnknownText_0xf47d: ; 0xf47d
|
|
|
|
|
; The REPEL used earlier is still in effect.
|
|
|
|
|
text_jump UnknownText_0x1c5bcd
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf482
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XAccuracy: ; f482
|
|
|
|
|
ld hl, PlayerSubStatus4
|
2014-08-13 19:42:58 -07:00
|
|
|
|
bit SUBSTATUS_X_ACCURACY, [hl]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp nz, WontHaveAnyEffect_NotUsedMessage
|
2014-08-13 19:42:58 -07:00
|
|
|
|
set SUBSTATUS_X_ACCURACY, [hl]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f48f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PokeDoll: ; f48f
|
|
|
|
|
ld a, [IsInBattle]
|
|
|
|
|
dec a
|
|
|
|
|
jr nz, .asm_f4a6
|
|
|
|
|
inc a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd232], a
|
|
|
|
|
ld a, [wd0ee]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and $c0
|
|
|
|
|
or $2
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ee], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f4a6
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f4ab
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GuardSpec: ; f4ab
|
|
|
|
|
ld hl, PlayerSubStatus4
|
|
|
|
|
bit 1, [hl]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp nz, WontHaveAnyEffect_NotUsedMessage
|
2013-05-07 23:02:15 -07:00
|
|
|
|
set 1, [hl]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f4b8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DireHit: ; f4b8
|
|
|
|
|
ld hl, PlayerSubStatus4
|
|
|
|
|
bit 2, [hl]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp nz, WontHaveAnyEffect_NotUsedMessage
|
2013-05-07 23:02:15 -07:00
|
|
|
|
set 2, [hl]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f4c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XAttack:
|
|
|
|
|
XDefend:
|
|
|
|
|
XSpeed:
|
|
|
|
|
XSpecial: ; f4c5
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf789
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [CurItem]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, Tablef504
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f4ce
|
|
|
|
|
cp [hl]
|
|
|
|
|
jr z, .asm_f4d5
|
2015-07-20 19:18:18 -07:00
|
|
|
|
rept 2
|
2013-05-07 23:02:15 -07:00
|
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
|
endr
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr .asm_f4ce
|
|
|
|
|
|
|
|
|
|
.asm_f4d5
|
|
|
|
|
inc hl
|
|
|
|
|
ld b, [hl]
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBattleTurn], a
|
|
|
|
|
ld [AttackMissed], a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [EffectFailed], a
|
2013-12-31 01:10:49 -08:00
|
|
|
|
callba Function361ef
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call WaitSFX
|
|
|
|
|
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba BattleCommand8c
|
|
|
|
|
callba BattleCommand8e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [CurBattleMon]
|
|
|
|
|
ld [CurPartyMon], a
|
|
|
|
|
ld c, $3
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba ChangeHappiness
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f504
|
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Tablef504: ; f504
|
2014-06-23 12:45:30 -07:00
|
|
|
|
db X_ATTACK, ATTACK
|
|
|
|
|
db X_DEFEND, DEFENSE
|
|
|
|
|
db X_SPEED, SPEED
|
|
|
|
|
db X_SPECIAL, SP_ATTACK
|
2013-12-24 14:11:52 -08:00
|
|
|
|
; f50c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
2014-04-28 13:43:11 -07:00
|
|
|
|
PokeFlute: ; f50c
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [IsInBattle]
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_f512
|
|
|
|
|
.asm_f512
|
2014-06-23 12:45:30 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd002], a
|
2014-06-23 12:45:30 -07:00
|
|
|
|
|
|
|
|
|
ld b, $ff ^ SLP
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld hl, PartyMon1Status
|
2014-06-23 12:45:30 -07:00
|
|
|
|
call .Functionf554
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [IsInBattle]
|
2014-06-23 12:45:30 -07:00
|
|
|
|
cp WILD_BATTLE
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr z, .asm_f52b
|
|
|
|
|
ld hl, OTPartyMon1Status
|
2014-06-23 12:45:30 -07:00
|
|
|
|
call .Functionf554
|
2013-05-07 23:02:15 -07:00
|
|
|
|
.asm_f52b
|
2014-06-23 12:45:30 -07:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld hl, BattleMonStatus
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and b
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ld hl, EnemyMonStatus
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and b
|
|
|
|
|
ld [hl], a
|
2014-06-23 12:45:30 -07:00
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd002]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
and a
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld hl, UnknownText_0xf56c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp z, PrintText
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld hl, UnknownText_0xf576
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [Danger]
|
|
|
|
|
and $80
|
|
|
|
|
jr nz, .asm_f54e
|
|
|
|
|
.asm_f54e
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld hl, UnknownText_0xf571
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
2014-06-23 12:45:30 -07:00
|
|
|
|
.Functionf554
|
|
|
|
|
ld de, PartyMon2 - PartyMon1
|
|
|
|
|
ld c, PARTY_LENGTH
|
2013-05-08 00:27:46 -07:00
|
|
|
|
|
2014-06-23 12:45:30 -07:00
|
|
|
|
.loop
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
2014-06-23 12:45:30 -07:00
|
|
|
|
and SLP
|
2013-05-08 00:27:46 -07:00
|
|
|
|
jr z, .asm_f564
|
2014-06-23 12:45:30 -07:00
|
|
|
|
ld a, 1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd002], a
|
2013-05-08 00:27:46 -07:00
|
|
|
|
.asm_f564
|
|
|
|
|
pop af
|
|
|
|
|
and b
|
|
|
|
|
ld [hl], a
|
|
|
|
|
add hl, de
|
|
|
|
|
dec c
|
2014-06-23 12:45:30 -07:00
|
|
|
|
jr nz, .loop
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ret
|
|
|
|
|
; f56c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UnknownText_0xf56c: ; 0xf56c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
; Played the # FLUTE. Now, that's a catchy tune!
|
2013-12-01 14:54:09 -08:00
|
|
|
|
text_jump UnknownText_0x1c5bf9
|
2013-05-08 00:27:46 -07:00
|
|
|
|
db "@"
|
|
|
|
|
; 0xf571
|
|
|
|
|
|
|
|
|
|
UnknownText_0xf571: ; 0xf571
|
2013-12-24 14:11:52 -08:00
|
|
|
|
; All sleeping #MON woke up.
|
2013-12-01 14:54:09 -08:00
|
|
|
|
text_jump UnknownText_0x1c5c28
|
2013-05-08 00:27:46 -07:00
|
|
|
|
db "@"
|
|
|
|
|
; 0xf576
|
|
|
|
|
|
|
|
|
|
UnknownText_0xf576: ; 0xf576
|
2013-12-24 14:11:52 -08:00
|
|
|
|
; played the # FLUTE.@ @
|
2013-12-01 14:54:09 -08:00
|
|
|
|
text_jump UnknownText_0x1c5c44
|
2013-05-08 00:27:46 -07:00
|
|
|
|
start_asm
|
|
|
|
|
; 0xf57b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Function_0xf57b: ; f57b
|
|
|
|
|
ld a, [IsInBattle]
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_f58c
|
|
|
|
|
|
|
|
|
|
push de
|
|
|
|
|
ld de, SFX_POKEFLUTE
|
|
|
|
|
call WaitPlaySFX
|
|
|
|
|
call WaitSFX
|
|
|
|
|
pop de
|
|
|
|
|
|
|
|
|
|
.asm_f58c
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Function13e0
|
2013-05-08 00:27:46 -07:00
|
|
|
|
; f58f
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BlueCard: ; f58f
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld hl, .bluecardtext
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Function2012
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
.bluecardtext
|
2013-12-01 14:54:09 -08:00
|
|
|
|
text_jump UnknownText_0x1c5c5e
|
2013-05-08 00:27:46 -07:00
|
|
|
|
db "@"
|
|
|
|
|
; f59a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CoinCase: ; f59a
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld hl, .coincasetext
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Function2012
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
.coincasetext
|
2013-12-01 14:54:09 -08:00
|
|
|
|
text_jump UnknownText_0x1c5c7b
|
2013-05-08 00:27:46 -07:00
|
|
|
|
db "@"
|
|
|
|
|
; f5a5
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OldRod: ; f5a5
|
|
|
|
|
ld e, $0
|
|
|
|
|
jr Function_0xf5b1
|
|
|
|
|
; f5a9
|
|
|
|
|
|
|
|
|
|
GoodRod: ; f5a9
|
|
|
|
|
ld e, $1
|
|
|
|
|
jr Function_0xf5b1
|
|
|
|
|
; f5ad
|
|
|
|
|
|
|
|
|
|
SuperRod: ; f5ad
|
|
|
|
|
ld e, $2
|
|
|
|
|
jr Function_0xf5b1
|
|
|
|
|
; f5b1
|
|
|
|
|
|
|
|
|
|
Function_0xf5b1: ; f5b1
|
2015-07-18 20:45:39 -07:00
|
|
|
|
callba FishFunction
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f5b8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Itemfinder: ; f5b8
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function12580
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f5bf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MaxElixer:
|
|
|
|
|
PpUp:
|
|
|
|
|
Ether:
|
|
|
|
|
MaxEther:
|
|
|
|
|
Elixer:
|
|
|
|
|
Mysteryberry: ; f5bf
|
|
|
|
|
ld a, [CurItem]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd002], a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f5c5
|
|
|
|
|
ld b, $1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf1f9
|
|
|
|
|
jp c, Functionf6e0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f5cd
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd002]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp MAX_ELIXER
|
|
|
|
|
jp z, Functionf6af
|
|
|
|
|
cp ELIXER
|
|
|
|
|
jp z, Functionf6af
|
|
|
|
|
|
|
|
|
|
ld hl, UnknownText_0xf725
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd002]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp PP_UP
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr z, .asm_f5e7
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xf72a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
.asm_f5e7
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
ld a, [CurMoveNum]
|
|
|
|
|
push af
|
|
|
|
|
xor a
|
|
|
|
|
ld [CurMoveNum], a
|
|
|
|
|
ld a, $2
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd235], a
|
2013-10-01 17:47:54 -07:00
|
|
|
|
callba Function3e4bc
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
pop bc
|
|
|
|
|
ld a, b
|
|
|
|
|
ld [CurMoveNum], a
|
|
|
|
|
jr nz, .asm_f5c5
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, PartyMon1Moves
|
|
|
|
|
ld bc, PartyMon2 - PartyMon1
|
|
|
|
|
call Functionf963
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
push hl
|
|
|
|
|
ld a, [hl]
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call GetMoveName
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call CopyName1
|
|
|
|
|
|
|
|
|
|
pop hl
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd002]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp PP_UP
|
|
|
|
|
jp nz, Functionf6a7
|
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp $a6
|
|
|
|
|
jr z, .asm_f62f
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ld bc, $0015
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp $c0
|
|
|
|
|
jr c, .asm_f637
|
|
|
|
|
|
|
|
|
|
.asm_f62f
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xf72f
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
jr .asm_f5cd
|
|
|
|
|
|
|
|
|
|
.asm_f637
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
add $40
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ld a, $1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf84c
|
|
|
|
|
call Functionf780
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld hl, UnknownText_0xf734
|
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionf64c: ; f64c
|
|
|
|
|
call ClearPalettes
|
|
|
|
|
jp Functionf795
|
|
|
|
|
; f652
|
|
|
|
|
|
|
|
|
|
Functionf652: ; f652
|
|
|
|
|
ld a, [IsInBattle]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_f66c
|
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [CurBattleMon]
|
|
|
|
|
cp b
|
|
|
|
|
jr nz, .asm_f66c
|
|
|
|
|
ld a, [PlayerSubStatus5]
|
|
|
|
|
bit 3, a
|
|
|
|
|
jr nz, .asm_f66c
|
|
|
|
|
call .asm_f677
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_f66c
|
|
|
|
|
call Functionf780
|
|
|
|
|
ld hl, UnknownText_0xf739
|
|
|
|
|
call PrintText
|
|
|
|
|
jr Functionf64c
|
|
|
|
|
|
|
|
|
|
.asm_f677
|
|
|
|
|
ld a, [CurPartyMon]
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld hl, PartyMon1Moves
|
|
|
|
|
ld bc, PartyMon2 - PartyMon1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call AddNTimes
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld de, BattleMonMoves
|
|
|
|
|
ld b, NUM_MOVES
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_f688
|
|
|
|
|
ld a, [de]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_f6a6
|
|
|
|
|
cp [hl]
|
|
|
|
|
jr nz, .asm_f6a1
|
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
push bc
|
2014-06-10 23:08:07 -07:00
|
|
|
|
rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves
|
2013-12-24 14:11:52 -08:00
|
|
|
|
inc de
|
2014-06-10 23:08:07 -07:00
|
|
|
|
endr
|
|
|
|
|
ld bc, PartyMon1PP - PartyMon1Moves
|
2013-12-24 14:11:52 -08:00
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld [de], a
|
|
|
|
|
pop bc
|
|
|
|
|
pop de
|
|
|
|
|
pop hl
|
|
|
|
|
|
|
|
|
|
.asm_f6a1
|
|
|
|
|
inc hl
|
|
|
|
|
inc de
|
|
|
|
|
dec b
|
|
|
|
|
jr nz, .asm_f688
|
|
|
|
|
|
|
|
|
|
.asm_f6a6
|
|
|
|
|
ret
|
|
|
|
|
; f6a7
|
|
|
|
|
|
|
|
|
|
Functionf6a7: ; f6a7
|
|
|
|
|
call Functionf6e8
|
|
|
|
|
jr nz, Functionf652
|
|
|
|
|
jp Functionf6dd
|
|
|
|
|
; f6af
|
|
|
|
|
|
|
|
|
|
Functionf6af: ; f6af
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wcfa9
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld [hli], a
|
|
|
|
|
ld [hl], a
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld b, NUM_MOVES
|
2013-12-24 14:11:52 -08:00
|
|
|
|
.asm_f6b7
|
|
|
|
|
push bc
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld hl, PartyMon1Moves
|
|
|
|
|
ld bc, PartyMon2 - PartyMon1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf963
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_f6ce
|
2014-06-10 23:08:07 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf6e8
|
|
|
|
|
jr z, .asm_f6ce
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wcfaa
|
2013-12-24 14:11:52 -08:00
|
|
|
|
inc [hl]
|
|
|
|
|
|
|
|
|
|
.asm_f6ce
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wcfa9
|
2013-12-24 14:11:52 -08:00
|
|
|
|
inc [hl]
|
|
|
|
|
pop bc
|
|
|
|
|
dec b
|
|
|
|
|
jr nz, .asm_f6b7
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wcfaa]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
and a
|
|
|
|
|
jp nz, Functionf652
|
|
|
|
|
|
|
|
|
|
Functionf6dd: ; f6dd
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call WontHaveAnyEffectMessage
|
2013-12-24 14:11:52 -08:00
|
|
|
|
|
|
|
|
|
Functionf6e0: ; f6e0
|
2013-05-07 23:02:15 -07:00
|
|
|
|
call ClearPalettes
|
2013-12-24 14:11:52 -08:00
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ret
|
|
|
|
|
; f6e8
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
Functionf6e8: ; f6e8
|
|
|
|
|
xor a
|
|
|
|
|
ld [MonType], a
|
|
|
|
|
call Functionf8ec
|
|
|
|
|
ld hl, PartyMon1PP
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld bc, PartyMon2 - PartyMon1
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf963
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd265]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld b, a
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and $3f
|
|
|
|
|
cp b
|
|
|
|
|
jr nc, .asm_f723
|
|
|
|
|
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd002]
|
2013-12-24 14:11:52 -08:00
|
|
|
|
cp MAX_ELIXER
|
|
|
|
|
jr z, .asm_f71d
|
|
|
|
|
cp MAX_ETHER
|
|
|
|
|
jr z, .asm_f71d
|
|
|
|
|
|
|
|
|
|
ld c, 5
|
|
|
|
|
cp MYSTERYBERRY
|
|
|
|
|
jr z, .asm_f715
|
2014-06-10 23:08:07 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
ld c, 10
|
|
|
|
|
|
|
|
|
|
.asm_f715
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and $3f
|
|
|
|
|
add c
|
|
|
|
|
cp b
|
|
|
|
|
jr nc, .asm_f71d
|
|
|
|
|
ld b, a
|
|
|
|
|
|
|
|
|
|
.asm_f71d
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and $c0
|
|
|
|
|
or b
|
|
|
|
|
ld [hl], a
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.asm_f723
|
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
; f725
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
UnknownText_0xf725: ; 0xf725
|
|
|
|
|
; Raise the PP of which move?
|
|
|
|
|
text_jump UnknownText_0x1c5c8a
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf72a
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
UnknownText_0xf72a: ; 0xf72a
|
|
|
|
|
; Restore the PP of which move?
|
|
|
|
|
text_jump UnknownText_0x1c5ca7
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf72f
|
|
|
|
|
|
|
|
|
|
UnknownText_0xf72f: ; 0xf72f
|
|
|
|
|
; 's PP is maxed out.
|
|
|
|
|
text_jump UnknownText_0x1c5cc6
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf734
|
|
|
|
|
|
|
|
|
|
UnknownText_0xf734: ; 0xf734
|
|
|
|
|
; 's PP increased.
|
|
|
|
|
text_jump UnknownText_0x1c5cdd
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf739
|
|
|
|
|
|
|
|
|
|
UnknownText_0xf739: ; 0xf739
|
|
|
|
|
; PP was restored.
|
|
|
|
|
text_jump UnknownText_0x1c5cf1
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf73e
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Squirtbottle: ; f73e
|
2013-08-03 13:19:29 -07:00
|
|
|
|
callba _Squirtbottle
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CardKey: ; f745
|
2013-08-03 13:19:29 -07:00
|
|
|
|
callba _CardKey
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f74c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasementKey: ; f74c
|
2013-08-03 13:19:29 -07:00
|
|
|
|
callba _BasementKey
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f753
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SacredAsh: ; f753
|
2013-08-03 13:19:29 -07:00
|
|
|
|
callba _SacredAsh
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd0ec]
|
2013-05-07 23:02:15 -07:00
|
|
|
|
cp $1
|
|
|
|
|
ret nz
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call Functionf795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
ret
|
|
|
|
|
; f763
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NormalBox: ; f763
|
|
|
|
|
ld c, $2c
|
|
|
|
|
jr Function_0xf769
|
|
|
|
|
; f767
|
|
|
|
|
|
|
|
|
|
GorgeousBox: ; f767
|
|
|
|
|
ld c, $2b
|
|
|
|
|
; f769
|
|
|
|
|
|
|
|
|
|
Function_0xf769: ; f769
|
2015-07-17 14:17:10 -07:00
|
|
|
|
callba SetSpecificDecorationFlag
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
ld hl, UnknownText_0xf778
|
2013-12-24 14:11:52 -08:00
|
|
|
|
call PrintText
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 14:11:52 -08:00
|
|
|
|
jp Functionf795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f778
|
|
|
|
|
|
2013-05-08 00:27:46 -07:00
|
|
|
|
UnknownText_0xf778: ; 0xf778
|
2013-12-01 14:54:09 -08:00
|
|
|
|
text_jump UnknownText_0x1c5d03
|
2013-05-08 00:27:46 -07:00
|
|
|
|
db "@"
|
|
|
|
|
; 0xf77d
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Brightpowder:
|
|
|
|
|
Item19:
|
|
|
|
|
LuckyPunch:
|
|
|
|
|
MetalPowder:
|
|
|
|
|
Nugget:
|
|
|
|
|
Item2D:
|
|
|
|
|
Item32:
|
|
|
|
|
ExpShare:
|
|
|
|
|
SilverLeaf:
|
|
|
|
|
RedScale:
|
|
|
|
|
Secretpotion:
|
|
|
|
|
SSTicket:
|
|
|
|
|
MysteryEgg:
|
|
|
|
|
ClearBell:
|
|
|
|
|
SilverWing:
|
|
|
|
|
QuickClaw:
|
|
|
|
|
GoldLeaf:
|
|
|
|
|
SoftSand:
|
|
|
|
|
SharpBeak:
|
|
|
|
|
PoisonBarb:
|
|
|
|
|
KingsRock:
|
|
|
|
|
RedApricorn:
|
|
|
|
|
Tinymushroom:
|
|
|
|
|
BigMushroom:
|
|
|
|
|
Silverpowder:
|
|
|
|
|
BluApricorn:
|
|
|
|
|
Item5A:
|
|
|
|
|
AmuletCoin:
|
|
|
|
|
YlwApricorn:
|
|
|
|
|
GrnApricorn:
|
|
|
|
|
CleanseTag:
|
|
|
|
|
MysticWater:
|
|
|
|
|
Twistedspoon:
|
|
|
|
|
WhtApricorn:
|
|
|
|
|
Blackbelt:
|
|
|
|
|
BlkApricorn:
|
|
|
|
|
Item64:
|
|
|
|
|
PnkApricorn:
|
|
|
|
|
Blackglasses:
|
|
|
|
|
Slowpoketail:
|
|
|
|
|
PinkBow:
|
|
|
|
|
Stick:
|
|
|
|
|
SmokeBall:
|
|
|
|
|
Nevermeltice:
|
|
|
|
|
Magnet:
|
|
|
|
|
Pearl:
|
|
|
|
|
BigPearl:
|
|
|
|
|
Everstone:
|
|
|
|
|
SpellTag:
|
|
|
|
|
GsBall:
|
|
|
|
|
MiracleSeed:
|
|
|
|
|
ThickClub:
|
|
|
|
|
FocusBand:
|
|
|
|
|
Item78:
|
|
|
|
|
HardStone:
|
|
|
|
|
LuckyEgg:
|
|
|
|
|
MachinePart:
|
|
|
|
|
EggTicket:
|
|
|
|
|
LostItem:
|
|
|
|
|
Stardust:
|
|
|
|
|
StarPiece:
|
|
|
|
|
Pass:
|
|
|
|
|
Item87:
|
|
|
|
|
Item88:
|
|
|
|
|
Item89:
|
|
|
|
|
Charcoal:
|
|
|
|
|
ScopeLens:
|
|
|
|
|
Item8D:
|
|
|
|
|
Item8E:
|
|
|
|
|
MetalCoat:
|
|
|
|
|
DragonFang:
|
|
|
|
|
Item91:
|
|
|
|
|
Leftovers:
|
|
|
|
|
Item93:
|
|
|
|
|
Item94:
|
|
|
|
|
Item95:
|
|
|
|
|
DragonScale:
|
|
|
|
|
BerserkGene:
|
|
|
|
|
Item99:
|
|
|
|
|
Item9A:
|
|
|
|
|
Item9B:
|
|
|
|
|
FlowerMail:
|
|
|
|
|
ItemA2:
|
|
|
|
|
LightBall:
|
|
|
|
|
PolkadotBow:
|
|
|
|
|
ItemAB:
|
|
|
|
|
UpGrade:
|
|
|
|
|
ItemB0:
|
|
|
|
|
RainbowWing:
|
|
|
|
|
ItemB3: ; f77d
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp IsntTheTimeMessage
|
2013-05-07 23:02:15 -07:00
|
|
|
|
; f780
|
|
|
|
|
|
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
Functionf780: ; f780
|
|
|
|
|
push de
|
|
|
|
|
ld de, SFX_FULL_HEAL
|
|
|
|
|
call WaitPlaySFX
|
|
|
|
|
pop de
|
|
|
|
|
ret
|
|
|
|
|
; f789
|
|
|
|
|
|
|
|
|
|
Functionf789: ; f789
|
|
|
|
|
ld hl, UsedItemText
|
|
|
|
|
call PrintText
|
|
|
|
|
call Functionf780
|
|
|
|
|
call Functiona80
|
|
|
|
|
; fallthrough
|
|
|
|
|
; f795
|
2013-05-07 23:02:15 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
Functionf795: ; f795
|
|
|
|
|
ld hl, NumItems
|
|
|
|
|
ld a, 1
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd10c], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp TossItem
|
|
|
|
|
; f7a0
|
|
|
|
|
|
|
|
|
|
Functionf7a0: ; f7a0
|
|
|
|
|
call Functionedfa
|
|
|
|
|
ld de, ANIM_THROW_POKE_BALL
|
|
|
|
|
ld a, e
|
|
|
|
|
ld [FXAnimIDLo], a
|
|
|
|
|
ld a, d
|
|
|
|
|
ld [FXAnimIDHi], a
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wc689], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld [hBattleTurn], a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wcfca], a
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef PlayBattleAnim
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, BlockedTheBallText
|
|
|
|
|
call PrintText
|
|
|
|
|
ld hl, DontBeAThiefText
|
|
|
|
|
call PrintText
|
|
|
|
|
jr Functionf795
|
|
|
|
|
; f7ca
|
|
|
|
|
|
|
|
|
|
WontHaveAnyEffect_NotUsedMessage: ; f7ca
|
|
|
|
|
ld hl, WontHaveAnyEffectText
|
|
|
|
|
call PrintText
|
|
|
|
|
|
2014-06-10 23:08:07 -07:00
|
|
|
|
; Item wasn't used.
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, $2
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ret
|
|
|
|
|
; f7d6
|
|
|
|
|
|
|
|
|
|
LooksBitterMessage: ; f7d6
|
|
|
|
|
ld hl, LooksBitterText
|
|
|
|
|
jp PrintText
|
|
|
|
|
; f7dc
|
|
|
|
|
|
|
|
|
|
Ball_BoxIsFullMessage: ; f7dc
|
|
|
|
|
ld hl, Ball_BoxIsFullText
|
|
|
|
|
call PrintText
|
|
|
|
|
|
2014-06-10 23:08:07 -07:00
|
|
|
|
; Item wasn't used.
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, $2
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ret
|
|
|
|
|
; f7e8
|
|
|
|
|
|
|
|
|
|
CantUseOnEggMessage: ; f7e8
|
|
|
|
|
ld hl, CantUseOnEggText
|
|
|
|
|
jr CantUseItemMessage
|
|
|
|
|
|
|
|
|
|
IsntTheTimeMessage: ; f7ed
|
|
|
|
|
ld hl, IsntTheTimeText
|
|
|
|
|
jr CantUseItemMessage
|
|
|
|
|
|
|
|
|
|
WontHaveAnyEffectMessage: ; f7f2
|
|
|
|
|
ld hl, WontHaveAnyEffectText
|
|
|
|
|
jr CantUseItemMessage
|
|
|
|
|
|
|
|
|
|
BelongsToSomeoneElseMessage: ; f7f7
|
|
|
|
|
ld hl, BelongsToSomeoneElseText
|
|
|
|
|
jr CantUseItemMessage
|
|
|
|
|
|
|
|
|
|
CyclingIsntAllowedMessage: ; f7fc
|
|
|
|
|
ld hl, CyclingIsntAllowedText
|
|
|
|
|
jr CantUseItemMessage
|
|
|
|
|
|
|
|
|
|
CantGetOnYourBikeMessage: ; f801
|
|
|
|
|
ld hl, CantGetOnYourBikeText
|
|
|
|
|
|
|
|
|
|
CantUseItemMessage: ; f804
|
|
|
|
|
; Item couldn't be used.
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd0ec], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
jp PrintText
|
|
|
|
|
; f80b
|
|
|
|
|
|
|
|
|
|
LooksBitterText: ; 0xf80b
|
|
|
|
|
; It looks bitter…
|
|
|
|
|
text_jump UnknownText_0x1c5d3e
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf810
|
|
|
|
|
|
|
|
|
|
CantUseOnEggText: ; 0xf810
|
|
|
|
|
; That can't be used on an EGG.
|
|
|
|
|
text_jump UnknownText_0x1c5d50
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf815
|
|
|
|
|
|
|
|
|
|
IsntTheTimeText: ; 0xf815
|
|
|
|
|
; OAK: ! This isn't the time to use that!
|
|
|
|
|
text_jump UnknownText_0x1c5d6e
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf81a
|
|
|
|
|
|
|
|
|
|
BelongsToSomeoneElseText: ; 0xf81a
|
|
|
|
|
; That belongs to someone else!
|
|
|
|
|
text_jump UnknownText_0x1c5d97
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf81f
|
|
|
|
|
|
|
|
|
|
WontHaveAnyEffectText: ; 0xf81f
|
|
|
|
|
; It won't have any effect.
|
|
|
|
|
text_jump UnknownText_0x1c5db6
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf824
|
|
|
|
|
|
|
|
|
|
BlockedTheBallText: ; 0xf824
|
|
|
|
|
; The trainer blocked the BALL!
|
|
|
|
|
text_jump UnknownText_0x1c5dd0
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf829
|
|
|
|
|
|
|
|
|
|
DontBeAThiefText: ; 0xf829
|
|
|
|
|
; Don't be a thief!
|
|
|
|
|
text_jump UnknownText_0x1c5def
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf82e
|
|
|
|
|
|
|
|
|
|
CyclingIsntAllowedText: ; 0xf82e
|
|
|
|
|
; Cycling isn't allowed here.
|
|
|
|
|
text_jump UnknownText_0x1c5e01
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf833
|
|
|
|
|
|
|
|
|
|
CantGetOnYourBikeText: ; 0xf833
|
|
|
|
|
; Can't get on your @ now.
|
|
|
|
|
text_jump UnknownText_0x1c5e1d
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf838
|
|
|
|
|
|
|
|
|
|
Ball_BoxIsFullText: ; 0xf838
|
|
|
|
|
; The #MON BOX is full. That can't be used now.
|
|
|
|
|
text_jump UnknownText_0x1c5e3a
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf83d
|
|
|
|
|
|
|
|
|
|
UsedItemText: ; 0xf83d
|
|
|
|
|
; used the@ .
|
|
|
|
|
text_jump UnknownText_0x1c5e68
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf842
|
|
|
|
|
|
|
|
|
|
GotOnTheItemText: ; 0xf842
|
|
|
|
|
; got on the@ .
|
|
|
|
|
text_jump UnknownText_0x1c5e7b
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf847
|
|
|
|
|
|
|
|
|
|
GotOffTheItemText: ; 0xf847
|
|
|
|
|
; got off@ the @ .
|
|
|
|
|
text_jump UnknownText_0x1c5e90
|
|
|
|
|
db "@"
|
|
|
|
|
; 0xf84c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functionf84c: ; f84c
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld a, PartyMon1Moves - PartyMon1
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
push hl
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld de, Buffer1
|
2014-06-16 11:20:01 -07:00
|
|
|
|
predef FillPP
|
2013-12-24 22:42:41 -08:00
|
|
|
|
pop hl
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld bc, PartyMon1PP - PartyMon1Moves
|
2013-12-24 22:42:41 -08:00
|
|
|
|
add hl, bc
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld de, Buffer1
|
|
|
|
|
ld b, 0
|
2013-12-24 22:42:41 -08:00
|
|
|
|
.asm_f864
|
|
|
|
|
inc b
|
|
|
|
|
ld a, b
|
2014-06-10 23:08:07 -07:00
|
|
|
|
cp NUM_MOVES + 1
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ret z
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd265]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
dec a
|
|
|
|
|
jr nz, .asm_f876
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wcfa9]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
inc a
|
|
|
|
|
cp b
|
|
|
|
|
jr nz, .asm_f87d
|
|
|
|
|
|
|
|
|
|
.asm_f876
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and $c0
|
|
|
|
|
ld a, [de]
|
|
|
|
|
call nz, Functionf881
|
|
|
|
|
|
|
|
|
|
.asm_f87d
|
|
|
|
|
inc hl
|
|
|
|
|
inc de
|
|
|
|
|
jr .asm_f864
|
|
|
|
|
; f881
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functionf881: ; f881
|
|
|
|
|
push bc
|
|
|
|
|
ld a, [de]
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld [hDividend + 3], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
xor a
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld [hDividend], a
|
|
|
|
|
ld [hDividend + 1], a
|
|
|
|
|
ld [hDividend + 2], a
|
|
|
|
|
ld a, 5
|
|
|
|
|
ld [hDivisor], a
|
|
|
|
|
ld b, 4
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call Divide
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
ld b, a
|
|
|
|
|
swap a
|
|
|
|
|
and $f
|
|
|
|
|
srl a
|
|
|
|
|
srl a
|
|
|
|
|
ld c, a
|
|
|
|
|
and a
|
|
|
|
|
jr z, .asm_f8b6
|
|
|
|
|
.asm_f8a3
|
|
|
|
|
ld a, [$ffb6]
|
|
|
|
|
cp $8
|
|
|
|
|
jr c, .asm_f8ab
|
|
|
|
|
ld a, $7
|
|
|
|
|
|
|
|
|
|
.asm_f8ab
|
|
|
|
|
add b
|
|
|
|
|
ld b, a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd265]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
dec a
|
|
|
|
|
jr z, .asm_f8b6
|
|
|
|
|
dec c
|
|
|
|
|
jr nz, .asm_f8a3
|
|
|
|
|
|
|
|
|
|
.asm_f8b6
|
|
|
|
|
ld [hl], b
|
|
|
|
|
pop bc
|
|
|
|
|
ret
|
|
|
|
|
; f8b9
|
|
|
|
|
|
|
|
|
|
Functionf8b9: ; f8b9
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld a, PartyMon1PP - PartyMon1
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
push hl
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld a, PartyMon1Moves - PartyMon1
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call GetPartyParamLocation
|
|
|
|
|
pop de
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wcfa9], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld [MonType], a
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld c, NUM_MOVES
|
2014-06-16 22:52:59 -07:00
|
|
|
|
.loop
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, [hli]
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
push hl
|
|
|
|
|
push de
|
|
|
|
|
push bc
|
|
|
|
|
call Functionf8ec
|
|
|
|
|
pop bc
|
|
|
|
|
pop de
|
|
|
|
|
ld a, [de]
|
|
|
|
|
and $c0
|
|
|
|
|
ld b, a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wd265]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
add b
|
|
|
|
|
ld [de], a
|
|
|
|
|
inc de
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, wcfa9
|
2013-12-24 22:42:41 -08:00
|
|
|
|
inc [hl]
|
|
|
|
|
pop hl
|
|
|
|
|
dec c
|
2014-06-16 22:52:59 -07:00
|
|
|
|
jr nz, .loop
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ret
|
|
|
|
|
; f8ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functionf8ec: ; f8ec
|
2014-06-16 22:52:59 -07:00
|
|
|
|
ld a, [StringBuffer1 + 0]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
push af
|
2014-06-16 22:52:59 -07:00
|
|
|
|
ld a, [StringBuffer1 + 1]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
push af
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, [MonType]
|
|
|
|
|
and a
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, PartyMon1Moves
|
|
|
|
|
ld bc, PartyMon2 - PartyMon1
|
|
|
|
|
jr z, .asm_f91a
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, OTPartyMon1Moves
|
|
|
|
|
dec a
|
|
|
|
|
jr z, .asm_f91a
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, TempMonMoves
|
|
|
|
|
dec a
|
|
|
|
|
jr z, .asm_f915
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, TempMonMoves
|
|
|
|
|
dec a
|
|
|
|
|
jr z, .asm_f915
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld hl, BattleMonMoves
|
|
|
|
|
|
|
|
|
|
.asm_f915
|
|
|
|
|
call Functionf969
|
|
|
|
|
jr .asm_f91d
|
|
|
|
|
|
|
|
|
|
.asm_f91a
|
|
|
|
|
call Functionf963
|
|
|
|
|
|
|
|
|
|
.asm_f91d
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
dec a
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
push hl
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld hl, Moves + MOVE_PP
|
|
|
|
|
ld bc, MOVE_LENGTH
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call AddNTimes
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld a, BANK(Moves)
|
2013-12-24 22:42:41 -08:00
|
|
|
|
call GetFarByte
|
|
|
|
|
ld b, a
|
|
|
|
|
ld de, StringBuffer1
|
|
|
|
|
ld [de], a
|
|
|
|
|
pop hl
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
push bc
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld bc, PartyMon1PP - PartyMon1Moves
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, [MonType]
|
|
|
|
|
cp WILDMON
|
|
|
|
|
jr nz, .asm_f942
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld bc, EnemyMonPP - EnemyMonMoves
|
2013-12-24 22:42:41 -08:00
|
|
|
|
.asm_f942
|
|
|
|
|
add hl, bc
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and $c0
|
|
|
|
|
pop bc
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
or b
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld hl, StringBuffer1 + 1
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld [hl], a
|
|
|
|
|
xor a
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld a, b
|
|
|
|
|
call Functionf881
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
and $3f
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld [wd265], a
|
2014-06-16 22:52:59 -07:00
|
|
|
|
|
2013-12-24 22:42:41 -08:00
|
|
|
|
pop af
|
2014-06-16 22:52:59 -07:00
|
|
|
|
ld [StringBuffer1 + 1], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
pop af
|
2014-06-16 22:52:59 -07:00
|
|
|
|
ld [StringBuffer1 + 0], a
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ret
|
|
|
|
|
; f963
|
|
|
|
|
|
|
|
|
|
Functionf963: ; f963
|
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
|
call AddNTimes
|
|
|
|
|
|
|
|
|
|
Functionf969: ; f969
|
2015-02-10 15:32:30 -08:00
|
|
|
|
ld a, [wcfa9]
|
2013-12-24 22:42:41 -08:00
|
|
|
|
ld c, a
|
2014-06-10 23:08:07 -07:00
|
|
|
|
ld b, 0
|
2013-12-24 22:42:41 -08:00
|
|
|
|
add hl, bc
|
|
|
|
|
ret
|
|
|
|
|
; f971
|