ref: fa1e93a870bf385c104959318ceefea750be3559
parent: 2172461a60604d4ae1dfbcca9159ba91531cf328
author: yenatch <[email protected]>
date: Tue Dec 24 13:35:26 EST 2013
evolution prerequisites and no more incbins in item effects
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -474,7 +474,7 @@
call CloseSRAM
- ld hl, $6deb
+ ld hl, UnknownText_0xedeb
call PrintText
call Function4b6
@@ -486,7 +486,7 @@
jr .asm_ebe2
.asm_ebd9
- ld hl, $6dc9
+ ld hl, UnknownText_0xedc9
.asm_ebdc
call PrintText
@@ -701,41 +701,39 @@
ld a, [TempEnemyMonSpecies]
dec a
ld c, a
- ld b, $0
- ld hl, $65b1
+ ld b, 0
+ ld hl, EvosAttacksPointers
add hl, bc
add hl, bc
- ld a, $10
+ ld a, BANK(EvosAttacksPointers)
call GetFarHalfword
-
pop bc
+
push bc
- ld a, $10
+ ld a, BANK(EvosAttacks)
call GetFarByte
-
- cp $2
+ cp EVOLVE_ITEM
pop bc
ret nz
+
inc hl
inc hl
inc hl
+
push bc
- ld a, $10
+ ld a, BANK(EvosAttacks)
call GetFarByte
-
- cp $a
+ cp MOON_STONE + 2 ; BURN_HEAL
pop bc
ret nz
- sla b
- jr c, .asm_ed0f
sla b
- jr nc, .asm_ed11
-
-.asm_ed0f
+ jr c, .max
+ sla b
+ jr nc, .done
+.max
ld b, $ff
-
-.asm_ed11
+.done
ret
; ed12
@@ -1200,9 +1198,9 @@
call Predef
ld hl, $c4a9
- ld b, $a
- ld c, $9
- call $0fe8
+ ld b, 10
+ ld c, 9
+ call TextBox
ld hl, $c4bf
ld bc, $0004
@@ -1209,7 +1207,7 @@
ld a, $28
call Predef
- call $0a80
+ call Functiona80
xor a
ld [MonType], a
@@ -2019,7 +2017,7 @@
ret
.asm_f440
push bc
- ld hl, $744a
+ ld hl, UnknownText_0xf44a
call Function1d67
pop bc
jr Functionf419
--- a/main.asm
+++ b/main.asm
@@ -40721,28 +40721,35 @@
push bc
push de
ld hl, PartyCount
+
push hl
-asm_421f5
+
+Function421f5: ; 421f5
ld hl, CurPartyMon
inc [hl]
+
pop hl
+
inc hl
ld a, [hl]
cp $ff
jp z, Function423ff
+
ld [MagikarpLength], a
+
push hl
ld a, [CurPartyMon]
ld c, a
ld hl, EvolvableFlags
- ld b, $2
+ ld b, 2
call Function42577
ld a, c
and a
- jp z, asm_421f5
+ jp z, Function421f5
+
ld a, [MagikarpLength]
dec a
- ld b, $0
+ ld b, 0
ld c, a
ld hl, EvosAttacksPointers
add hl, bc
@@ -40750,6 +40757,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
+
push hl
xor a
ld [MonType], a
@@ -40756,94 +40764,120 @@
ld a, $1f
call Predef
pop hl
+
.asm_42230
ld a, [hli]
and a
- jr z, asm_421f5
+ jr z, Function421f5
+
ld b, a
- cp $3
- jr z, .asm_422ae
+
+ cp EVOLVE_TRADE
+ jr z, .trade
+
ld a, [InLinkBattle]
and a
jp nz, .asm_423f9
+
ld a, b
- cp $2
- jp z, .asm_422d5
+ cp EVOLVE_ITEM
+ jp z, .item
+
ld a, [$d1e9]
and a
jp nz, .asm_423f9
+
ld a, b
- cp $1
- jp z, .asm_422ee
- cp $4
- jr z, .asm_42283
+ cp EVOLVE_LEVEL
+ jp z, .level
+
+ cp EVOLVE_HAPPINESS
+ jr z, .happiness
+
+
+; EVOLVE_STAT
ld a, [TempMonLevel]
cp [hl]
jp c, .asm_423f8
+
call Function42461
jp z, .asm_423f8
+
push hl
ld de, TempMonAtk
ld hl, TempMonDef
- ld c, $2
+ ld c, 2
call StringCmp
- ld a, $3
+ ld a, ATK_EQ_DEF
jr z, .asm_4227a
- ld a, $2
+ ld a, ATK_LT_DEF
jr c, .asm_4227a
- ld a, $1
-
+ ld a, ATK_GT_DEF
.asm_4227a
pop hl
+
inc hl
cp [hl]
jp nz, .asm_423f9
+
inc hl
jr .asm_422fd
-.asm_42283
+
+.happiness
ld a, [TempMonHappiness]
- cp $dc
+ cp 220
jp c, .asm_423f9
+
call Function42461
jp z, .asm_423f9
+
ld a, [hli]
- cp $1
+ cp TR_ANYTIME
jr z, .asm_422fd
- cp $2
+ cp TR_MORNDAY
jr z, .asm_422a4
+
+; TR_NITE
ld a, [TimeOfDay]
- cp $2
+ cp NITE
jp nz, .asm_423fa
jr .asm_422fd
.asm_422a4
ld a, [TimeOfDay]
- cp $2
+ cp NITE
jp z, .asm_423fa
jr .asm_422fd
-.asm_422ae
+
+.trade
ld a, [InLinkBattle]
and a
jp z, .asm_423f9
+
call Function42461
jp z, .asm_423f9
+
ld a, [hli]
ld b, a
inc a
jr z, .asm_422fd
+
ld a, [InLinkBattle]
cp $1
jp z, .asm_423fa
+
ld a, [TempMonItem]
cp b
jp nz, .asm_423fa
+
xor a
ld [TempMonItem], a
jr .asm_422fd
-.asm_422d5
+
+.item
ld a, [hli]
ld b, a
ld a, [CurItem]
@@ -40858,7 +40892,8 @@
jp nz, .asm_423fa
jr .asm_422fd
-.asm_422ee
+
+.level
ld a, [hli]
ld b, a
ld a, [TempMonLevel]
@@ -40872,7 +40907,9 @@
ld [CurPartyLevel], a
ld a, $1
ld [$d268], a
+
push hl
+
ld a, [hl]
ld [Buffer2], a
ld a, [CurPartyMon]
@@ -40879,26 +40916,34 @@
ld hl, PartyMon1Nickname
call GetNick
call CopyName1
- ld hl, $6482
+ ld hl, UnknownText_0x42482
call PrintText
- ld c, $32
+
+ ld c, 50
call DelayFrames
+
xor a
ld [hBGMapMode], a
ld hl, TileMap
- ld bc, $0c14
+ lb bc, 12, 20
call ClearBox
+
ld a, $1
ld [hBGMapMode], a
call ClearSprites
+
callba EvolutionAnimation
+
push af
call ClearSprites
pop af
jp c, Function42454
- ld hl, $6473
+
+ ld hl, UnknownText_0x42473
call PrintText
+
pop hl
+
ld a, [hl]
ld [CurSpecies], a
ld [TempMonSpecies], a
@@ -40905,28 +40950,34 @@
ld [Buffer2], a
ld [$d265], a
call GetPokemonName
+
push hl
- ld hl, $6478
+ ld hl, UnknownText_0x42478
call PrintTextBoxText
callba Function106094
+
ld de, MUSIC_NONE
call PlayMusic
ld de, SFX_CAUGHT_MON
call PlaySFX
call WaitSFX
- ld c, $28
+
+ ld c, 40
call DelayFrames
+
call ClearTileMap
call Function42414
call GetBaseData
+
ld hl, $d118
ld de, TempMonMaxHP
ld b, $1
- ld a, $c
+ ld a, PREDEF_FILLSTATS
call Predef
+
ld a, [CurPartyMon]
- ld hl, PartyMon1Species
- ld bc, $0030
+ ld hl, PartyMons
+ ld bc, PartyMon2 - PartyMon1
call AddNTimes
ld e, l
ld d, h
@@ -40949,9 +41000,11 @@
ld a, [hl]
adc b
ld [hl], a
+
ld hl, TempMonSpecies
ld bc, $0030
call CopyBytes
+
ld a, [CurSpecies]
ld [$d265], a
xor a
@@ -40960,11 +41013,13 @@
ld a, [$d265]
dec a
call SetSeenAndCaughtMon
+
ld a, [$d265]
- cp $c9
+ cp UNOWN
jr nz, .asm_423ec
+
ld hl, TempMonDVs
- ld a, $2d
+ ld a, PREDEF_GET_UNOWN_LETTER
call Predef
callab Functionfba18
@@ -40976,7 +41031,7 @@
push hl
ld l, e
ld h, d
- jp asm_421f5
+ jp Function421f5
; 423f8
.asm_423f8
@@ -40988,7 +41043,7 @@
jp .asm_42230
; 423fe
-INCBIN "baserom.gbc",$423fe,$423ff - $423fe
+INCBIN "baserom.gbc", $423fe, $423ff - $423fe
Function423ff: ; 423ff
@@ -41023,7 +41078,7 @@
cp [hl]
inc hl
ret nz
- cp $50
+ cp "@"
jr nz, .asm_4242b
ld a, [CurPartyMon]
ld bc, $000b
@@ -41040,11 +41095,11 @@
; 42454
Function42454: ; 42454
- ld hl, $647d
+ ld hl, UnknownText_0x4247d
call PrintText
call ClearTileMap
pop hl
- jp asm_421f5
+ jp Function421f5
; 42461
Function42461: ; 42461
@@ -41051,15 +41106,37 @@
push hl
ld a, [CurPartyMon]
ld hl, PartyMon1Item
- ld bc, $0030
+ ld bc, PartyMon2 - PartyMon1
call AddNTimes
ld a, [hl]
- cp $70
+ cp EVERSTONE
pop hl
ret
; 42473
-INCBIN "baserom.gbc",$42473,$42487 - $42473
+UnknownText_0x42473: ; 0x42473
+ ; Congratulations! Your @ @
+ text_jump UnknownText_0x1c4b92
+ db "@"
+; 0x42478
+
+UnknownText_0x42478: ; 0x42478
+ ; evolved into @ !
+ text_jump UnknownText_0x1c4baf
+ db "@"
+; 0x4247d
+
+UnknownText_0x4247d: ; 0x4247d
+ ; Huh? @ stopped evolving!
+ text_jump UnknownText_0x1c4bc5
+ db "@"
+; 0x42482
+
+UnknownText_0x42482: ; 0x42482
+ ; What? @ is evolving!
+ text_jump UnknownText_0x1c4be3
+ db "@"
+; 0x42487
Function42487: ; 42487
--- a/stats/evos_attacks.asm
+++ b/stats/evos_attacks.asm
@@ -1,3 +1,5 @@
+EvosAttacks:
+
BulbasaurEvosAttacks:
db EVOLVE_LEVEL,16,IVYSAUR
db 0 ; no more evolutions