More MAX_LEVEL use.

This commit is contained in:
yenatch
2014-06-03 14:07:10 -07:00
parent 99fbe3147b
commit 20444d2f63
5 changed files with 65 additions and 63 deletions

View File

@@ -7296,6 +7296,7 @@ Function3ee27: ; 3ee27
Function3ee3b: ; 3ee3b Function3ee3b: ; 3ee3b
; Give experience.
ld a, [InLinkBattle] ld a, [InLinkBattle]
and a and a
ret nz ret nz
@@ -7329,7 +7330,7 @@ Function3ee3b: ; 3ee3b
add hl, bc add hl, bc
ld d, h ld d, h
ld e, l ld e, l
ld hl, EnemyMonType2 ld hl, EnemyMonBaseStats - 1
push bc push bc
ld c, $5 ld c, $5
.asm_3ee7c .asm_3ee7c
@@ -7403,20 +7404,20 @@ Function3ee3b: ; 3ee3b
jr z, .asm_3eee2 jr z, .asm_3eee2
.asm_3eedd .asm_3eedd
call Function3f106 call DoubleExp
ld a, $1 ld a, $1
.asm_3eee2 .asm_3eee2
ld [$d088], a ld [$d088], a
ld a, [IsInBattle] ld a, [IsInBattle]
dec a dec a
call nz, Function3f106 call nz, DoubleExp
push bc push bc
ld a, $1 ld a, PartyMon1Item - PartyMon1
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hl] ld a, [hl]
cp $7e cp LUCKY_EGG
call z, Function3f106 call z, DoubleExp
ld a, [$ffb6] ld a, [$ffb6]
ld [$d087], a ld [$d087], a
ld a, [$ffb5] ld a, [$ffb5]
@@ -7464,7 +7465,7 @@ Function3ee3b: ; 3ee3b
ld [CurSpecies], a ld [CurSpecies], a
call GetBaseData call GetBaseData
push bc push bc
ld d, $64 ld d, MAX_LEVEL
callab Function50e47 callab Function50e47
pop bc pop bc
ld hl, $000a ld hl, $000a
@@ -7497,10 +7498,10 @@ Function3ee3b: ; 3ee3b
call Predef call Predef
callab Function50e1b callab Function50e1b
pop bc pop bc
ld hl, $001f ld hl, PartyMon1Level - PartyMon1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp $64 cp MAX_LEVEL
jp nc, .asm_3f0b9 jp nc, .asm_3f0b9
cp d cp d
jp z, .asm_3f0b9 jp z, .asm_3f0b9
@@ -7510,7 +7511,7 @@ Function3ee3b: ; 3ee3b
ld a, d ld a, d
ld [CurPartyLevel], a ld [CurPartyLevel], a
ld [hl], a ld [hl], a
ld hl, $0000 ld hl, PartyMon1Species - PartyMon1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [CurSpecies], a ld [CurSpecies], a
@@ -7704,7 +7705,7 @@ Function3f0d4: ; 3f0d4
ret ret
; 3f106 ; 3f106
Function3f106: ; 3f106 DoubleExp: ; 3f106
push bc push bc
ld a, [$ffb5] ld a, [$ffb5]
ld b, a ld b, a
@@ -7791,7 +7792,7 @@ Function3f136: ; 3f136
ld [hl], a ld [hl], a
.asm_3f186 .asm_3f186
ld d, $64 ld d, MAX_LEVEL
callab Function50e47 callab Function50e47
ld a, [hMultiplicand] ld a, [hMultiplicand]
ld b, a ld b, a

View File

@@ -1,8 +1,10 @@
; name length ; strings
PLAYER_NAME_LENGTH EQU 8 PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11 PKMN_NAME_LENGTH EQU 11
NAME_LENGTH EQU 11 NAME_LENGTH EQU 11
LV_CHAR EQU $6e
; boxes ; boxes
NUM_BOXES EQU 14 NUM_BOXES EQU 14

View File

@@ -1829,7 +1829,7 @@ PrintLevel:: ; 382d
; Print TempMonLevel at hl ; Print TempMonLevel at hl
ld a, [TempMonLevel] ld a, [TempMonLevel]
ld [hl], $6e ; ":L" ld [hl], LV_CHAR
inc hl inc hl
; How many digits? ; How many digits?
@@ -1845,7 +1845,7 @@ PrintLevel:: ; 382d
Function383d:: ; 383d Function383d:: ; 383d
; Print :L and all 3 digits ; Print :L and all 3 digits
ld [hl], $6e ld [hl], LV_CHAR
inc hl inc hl
ld c, 3 ld c, 3
; 3842 ; 3842

View File

@@ -1352,7 +1352,7 @@ RareCandy: ; ef14
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hl] ld a, [hl]
cp 100 cp MAX_LEVEL
jp nc, Functionee83 jp nc, Functionee83
inc a inc a

View File

@@ -22210,15 +22210,15 @@ Function13a47: ; 13a47
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
cp $7 cp 6 + 1
jr c, .asm_13a54 jr c, .asm_13a54
ld a, $6 ld a, 6
ld [hl], a ld [hl], a
.asm_13a54 .asm_13a54
inc hl inc hl
ld b, a ld b, a
ld c, $0 ld c, 0
.asm_13a58 .asm_13a58
ld a, [hl] ld a, [hl]
and a and a
@@ -22229,13 +22229,13 @@ Function13a47: ; 13a47
jr c, .asm_13a73 jr c, .asm_13a73
.asm_13a64 .asm_13a64
ld [hl], $eb ld [hl], SMEARGLE
push hl push hl
push bc push bc
ld a, c ld a, c
ld hl, PartyMon1 ld hl, PartyMon1Species
call GetPartyLocation call GetPartyLocation
ld [hl], $eb ld [hl], SMEARGLE
pop bc pop bc
pop hl pop hl
@@ -22248,7 +22248,7 @@ Function13a47: ; 13a47
ld hl, PartyMon1 ld hl, PartyMon1
ld a, [PartyCount] ld a, [PartyCount]
ld d, a ld d, a
ld e, $0 ld e, 0
.asm_13a83 .asm_13a83
push de push de
push hl push hl
@@ -22261,35 +22261,34 @@ Function13a47: ; 13a47
jr c, .asm_13a9c jr c, .asm_13a9c
.asm_13a8f .asm_13a8f
ld [hl], $eb ld [hl], SMEARGLE
push de push de
ld d, $0 ld d, 0
ld hl, PartySpecies ld hl, PartySpecies
add hl, de add hl, de
pop de pop de
ld a, $eb ld a, SMEARGLE
ld [hl], a ld [hl], a
.asm_13a9c .asm_13a9c
ld [CurSpecies], a ld [CurSpecies], a
call GetBaseData call GetBaseData
ld hl, $001f ld hl, PartyMon1Level - PartyMon1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp $2 cp 2
ld a, $2 ld a, 2
jr c, .asm_13ab4 jr c, .asm_13ab4
ld a, [hl] ld a, [hl]
cp $64 cp MAX_LEVEL
jr c, .asm_13ab5 jr c, .asm_13ab5
ld a, $64 ld a, MAX_LEVEL
.asm_13ab4 .asm_13ab4
ld [hl], a ld [hl], a
.asm_13ab5 .asm_13ab5
ld [CurPartyLevel], a ld [CurPartyLevel], a
ld hl, $0024
ld hl, PartyMon1MaxHP - PartyMon1
add hl, bc add hl, bc
ld d, h ld d, h
ld e, l ld e, l
@@ -22299,16 +22298,16 @@ Function13a47: ; 13a47
ld a, $c ld a, $c
call Predef call Predef
pop hl pop hl
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
add hl, bc add hl, bc
pop de pop de
inc e inc e
dec d dec d
jr nz, .asm_13a83 jr nz, .asm_13a83
ld de, $de41 ld de, PartyMonNicknames
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
ld c, $0 ld c, 0
.asm_13adc .asm_13adc
push bc push bc
call Function13b71 call Function13b71
@@ -22321,11 +22320,11 @@ Function13a47: ; 13a47
push hl push hl
ld hl, PartySpecies ld hl, PartySpecies
push bc push bc
ld b, $0 ld b, 0
add hl, bc add hl, bc
pop bc pop bc
ld a, [hl] ld a, [hl]
cp $fd cp EGG
ld hl, String_13b6b ld hl, String_13b6b
jr z, .asm_13b06 jr z, .asm_13b06
ld [$d265], a ld [$d265], a
@@ -22342,10 +22341,10 @@ Function13a47: ; 13a47
inc c inc c
dec b dec b
jr nz, .asm_13adc jr nz, .asm_13adc
ld de, $ddff ld de, PartyMonOT
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
ld c, $0 ld c, 0
.asm_13b1b .asm_13b1b
push bc push bc
call Function13b71 call Function13b71
@@ -22364,12 +22363,13 @@ Function13a47: ; 13a47
inc c inc c
dec b dec b
jr nz, .asm_13b1b jr nz, .asm_13b1b
ld hl, $dce1
ld hl, PartyMon1Moves
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
.asm_13b40 .asm_13b40
push hl push hl
ld c, $4 ld c, NUM_MOVES
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_13b4b jr z, .asm_13b4b
@@ -22377,13 +22377,13 @@ Function13a47: ; 13a47
jr c, .asm_13b4d jr c, .asm_13b4d
.asm_13b4b .asm_13b4b
ld [hl], $1 ld [hl], POUND
.asm_13b4d .asm_13b4d
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_13b55 jr z, .asm_13b55
cp $fc cp NUM_ATTACKS + 1
jr c, .asm_13b5c jr c, .asm_13b5c
.asm_13b55 .asm_13b55
@@ -22401,7 +22401,7 @@ Function13a47: ; 13a47
.asm_13b60 .asm_13b60
pop hl pop hl
push bc push bc
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
add hl, bc add hl, bc
pop bc pop bc
dec b dec b
@@ -22415,11 +22415,11 @@ String_13b6b: ; 13b6b
Function13b71: ; 13b71 Function13b71: ; 13b71
push de push de
ld c, $1 ld c, 1
ld b, $6 ld b, 6
.asm_13b76 .asm_13b76
ld a, [de] ld a, [de]
cp $50 cp "@"
jr z, .asm_13b85 jr z, .asm_13b85
inc de inc de
inc c inc c
@@ -22427,7 +22427,7 @@ Function13b71: ; 13b71
jr nz, .asm_13b76 jr nz, .asm_13b76
dec c dec c
dec de dec de
ld a, $50 ld a, "@"
ld [de], a ld [de], a
.asm_13b85 .asm_13b85
@@ -59239,8 +59239,8 @@ Function50176: ; 50176
and a and a
ret z ret z
ld c, a ld c, a
ld b, $0 ld b, 0
ld hl, $c4d0 hlcoord 8, 2
.asm_50181 .asm_50181
push bc push bc
push hl push hl
@@ -59248,26 +59248,25 @@ Function50176: ; 50176
jr z, .asm_501a7 jr z, .asm_501a7
push hl push hl
ld a, b ld a, b
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
ld hl, PartyMon1Level ld hl, PartyMon1Level
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
pop hl pop hl
ld a, [de] ld a, [de]
cp $64 cp 100 ; This is distinct from MAX_LEVEL.
jr nc, .asm_501a1 jr nc, .asm_501a1
ld a, $6e ld a, LV_CHAR
ld [hli], a ld [hli], a
ld bc, $4102 ld bc, $4102
.asm_501a1 .asm_501a1
ld bc, $4103 ld bc, $4103
call PrintNum call PrintNum
.asm_501a7 .asm_501a7
pop hl pop hl
ld de, $0028 ld de, SCREEN_WIDTH * 2
add hl, de add hl, de
pop bc pop bc
inc b inc b
@@ -59281,7 +59280,7 @@ Function501b2: ; 501b2
and a and a
ret z ret z
ld c, a ld c, a
ld b, $0 ld b, 0
ld hl, $c4cd ld hl, $c4cd
.asm_501bd .asm_501bd
push bc push bc
@@ -59290,7 +59289,7 @@ Function501b2: ; 501b2
jr z, .asm_501d5 jr z, .asm_501d5
push hl push hl
ld a, b ld a, b
ld bc, $0030 ld bc, PartyMon2 - PartyMon1
ld hl, PartyMon1Status ld hl, PartyMon1Status
call AddNTimes call AddNTimes
ld e, l ld e, l
@@ -59300,7 +59299,7 @@ Function501b2: ; 501b2
.asm_501d5 .asm_501d5
pop hl pop hl
ld de, $0028 ld de, SCREEN_WIDTH * 2
add hl, de add hl, de
pop bc pop bc
inc b inc b
@@ -59314,7 +59313,7 @@ Function501e0: ; 501e0
and a and a
ret z ret z
ld c, a ld c, a
ld b, $0 ld b, 0
ld hl, $c4d4 ld hl, $c4d4
.asm_501eb .asm_501eb
push bc push bc
@@ -59324,7 +59323,7 @@ Function501e0: ; 501e0
push hl push hl
ld hl, PartySpecies ld hl, PartySpecies
ld e, b ld e, b
ld d, $0 ld d, 0
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [CurPartySpecies], a ld [CurPartySpecies], a
@@ -59336,7 +59335,7 @@ Function501e0: ; 501e0
.asm_5020a .asm_5020a
pop hl pop hl
ld de, $0028 ld de, SCREEN_WIDTH * 2
add hl, de add hl, de
pop bc pop bc
inc b inc b