summaryrefslogtreecommitdiff
path: root/engine/evolve.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/evolve.asm')
-rwxr-xr-xengine/evolve.asm120
1 files changed, 60 insertions, 60 deletions
diff --git a/engine/evolve.asm b/engine/evolve.asm
index 2e72320d4..5fb5aff46 100755
--- a/engine/evolve.asm
+++ b/engine/evolve.asm
@@ -1,8 +1,8 @@
EvolvePokemon: ; 421d8
- ld hl, EvolvableFlags
+ ld hl, wEvolvableFlags
xor a
ld [hl], a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld b, SET_FLAG
call EvoFlagAction
@@ -10,16 +10,16 @@ EvolveAfterBattle: ; 421e6
xor a
ld [wMonTriedToEvolve], a
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
push hl
push bc
push de
- ld hl, PartyCount
+ ld hl, wPartyCount
push hl
EvolveAfterBattle_MasterLoop
- ld hl, CurPartyMon
+ ld hl, wCurPartyMon
inc [hl]
pop hl
@@ -32,9 +32,9 @@ EvolveAfterBattle_MasterLoop
ld [wEvolutionOldSpecies], a
push hl
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
- ld hl, EvolvableFlags
+ ld hl, wEvolvableFlags
ld b, CHECK_FLAG
call EvoFlagAction
ld a, c
@@ -54,7 +54,7 @@ EvolveAfterBattle_MasterLoop
push hl
xor a
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
pop hl
@@ -89,7 +89,7 @@ EvolveAfterBattle_MasterLoop
; EVOLVE_STAT
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
cp [hl]
jp c, .dont_evolve_1
@@ -97,8 +97,8 @@ EvolveAfterBattle_MasterLoop
jp z, .dont_evolve_1
push hl
- ld de, TempMonAttack
- ld hl, TempMonDefense
+ ld de, wTempMonAttack
+ ld hl, wTempMonDefense
ld c, 2
call StringCmp
ld a, ATK_EQ_DEF
@@ -118,7 +118,7 @@ EvolveAfterBattle_MasterLoop
.happiness
- ld a, [TempMonHappiness]
+ ld a, [wTempMonHappiness]
cp HAPPINESS_TO_EVOLVE
jp c, .dont_evolve_2
@@ -132,13 +132,13 @@ EvolveAfterBattle_MasterLoop
jr z, .happiness_daylight
; TR_NITE
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp NITE_F
jp nz, .dont_evolve_3
jr .proceed
.happiness_daylight
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp NITE_F
jp z, .dont_evolve_3
jr .proceed
@@ -161,19 +161,19 @@ EvolveAfterBattle_MasterLoop
cp LINK_TIMECAPSULE
jp z, .dont_evolve_3
- ld a, [TempMonItem]
+ ld a, [wTempMonItem]
cp b
jp nz, .dont_evolve_3
xor a
- ld [TempMonItem], a
+ ld [wTempMonItem], a
jr .proceed
.item
ld a, [hli]
ld b, a
- ld a, [CurItem]
+ ld a, [wCurItem]
cp b
jp nz, .dont_evolve_3
@@ -189,15 +189,15 @@ EvolveAfterBattle_MasterLoop
.level
ld a, [hli]
ld b, a
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
cp b
jp c, .dont_evolve_3
call IsMonHoldingEverstone
jp z, .dont_evolve_3
.proceed
- ld a, [TempMonLevel]
- ld [CurPartyLevel], a
+ ld a, [wTempMonLevel]
+ ld [wCurPartyLevel], a
ld a, $1
ld [wMonTriedToEvolve], a
@@ -205,8 +205,8 @@ EvolveAfterBattle_MasterLoop
ld a, [hl]
ld [wEvolutionNewSpecies], a
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
call CopyName1
ld hl, Text_WhatEvolving
@@ -238,8 +238,8 @@ EvolveAfterBattle_MasterLoop
pop hl
ld a, [hl]
- ld [CurSpecies], a
- ld [TempMonSpecies], a
+ ld [wCurSpecies], a
+ ld [wTempMonSpecies], a
ld [wEvolutionNewSpecies], a
ld [wd265], a
call GetPokemonName
@@ -262,13 +262,13 @@ EvolveAfterBattle_MasterLoop
call UpdateSpeciesNameIfNotNicknamed
call GetBaseData
- ld hl, TempMonExp + 2
- ld de, TempMonMaxHP
+ ld hl, wTempMonExp + 2
+ ld de, wTempMonMaxHP
ld b, $1
predef CalcPkmnStats
- ld a, [CurPartyMon]
- ld hl, PartyMons
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld e, l
@@ -278,14 +278,14 @@ EvolveAfterBattle_MasterLoop
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, TempMonMaxHP + 1
+ ld hl, wTempMonMaxHP + 1
ld a, [hld]
sub c
ld c, a
ld a, [hl]
sbc b
ld b, a
- ld hl, TempMonHP + 1
+ ld hl, wTempMonHP + 1
ld a, [hl]
add c
ld [hld], a
@@ -293,14 +293,14 @@ EvolveAfterBattle_MasterLoop
adc b
ld [hl], a
- ld hl, TempMonSpecies
+ ld hl, wTempMonSpecies
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
ld [wd265], a
xor a
- ld [MonType], a
+ ld [wMonType], a
call LearnLevelMoves
ld a, [wd265]
dec a
@@ -310,14 +310,14 @@ EvolveAfterBattle_MasterLoop
cp UNOWN
jr nz, .skip_unown
- ld hl, TempMonDVs
+ ld hl, wTempMonDVs
predef GetUnownLetter
callfar UpdateUnownDex
.skip_unown
pop de
pop hl
- ld a, [TempMonSpecies]
+ ld a, [wTempMonSpecies]
ld [hl], a
push hl
ld l, e
@@ -352,15 +352,15 @@ EvolveAfterBattle_MasterLoop
; 42414
UpdateSpeciesNameIfNotNicknamed: ; 42414
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
push af
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
ld [wd265], a
call GetPokemonName
pop af
- ld [CurSpecies], a
- ld hl, StringBuffer1
- ld de, StringBuffer2
+ ld [wCurSpecies], a
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer2
.loop
ld a, [de]
inc de
@@ -370,15 +370,15 @@ UpdateSpeciesNameIfNotNicknamed: ; 42414
cp "@"
jr nz, .loop
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, MON_NAME_LENGTH
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call AddNTimes
push hl
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
pop de
ld bc, MON_NAME_LENGTH
jp CopyBytes
@@ -394,8 +394,8 @@ CancelEvolution: ; 42454
IsMonHoldingEverstone: ; 42461
push hl
- ld a, [CurPartyMon]
- ld hl, PartyMon1Item
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
@@ -431,7 +431,7 @@ Text_WhatEvolving: ; 0x42482
LearnLevelMoves: ; 42487
ld a, [wd265]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
dec a
ld b, 0
ld c, a
@@ -453,15 +453,15 @@ LearnLevelMoves: ; 42487
jr z, .done
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp b
ld a, [hli]
jr nz, .find_move
push hl
ld d, a
- ld hl, PartyMon1Moves
- ld a, [CurPartyMon]
+ ld hl, wPartyMon1Moves
+ ld a, [wCurPartyMon]
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -489,21 +489,21 @@ LearnLevelMoves: ; 42487
jr .find_move
.done
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
ret
; 424e1
FillMoves: ; 424e1
-; Fill in moves at de for CurPartySpecies at CurPartyLevel
+; Fill in moves at de for wCurPartySpecies at wCurPartyLevel
push hl
push de
push bc
ld hl, EvosAttacksPointers
ld b, 0
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
add a
rl b
@@ -527,7 +527,7 @@ FillMoves: ; 424e1
and a
jp z, .done
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp b
jp c, .done
ld a, [wEvolutionOldSpecies]
@@ -567,7 +567,7 @@ FillMoves: ; 424e1
and a
jr z, .ShiftedMove
push de
- ld bc, PartyMon1PP - (PartyMon1Moves + NUM_MOVES - 1)
+ ld bc, wPartyMon1PP - (wPartyMon1Moves + NUM_MOVES - 1)
add hl, bc
ld d, h
ld e, l
@@ -627,9 +627,9 @@ EvoFlagAction: ; 42577
; 42581
GetPreEvolution: ; 42581
-; Find the first mon to evolve into CurPartySpecies.
+; Find the first mon to evolve into wCurPartySpecies.
-; Return carry and the new species in CurPartySpecies
+; Return carry and the new species in wCurPartySpecies
; if a pre-evolution is found.
ld c, 0
@@ -644,14 +644,14 @@ GetPreEvolution: ; 42581
.loop2 ; For each evolution...
ld a, [hli]
and a
- jr z, .no_evolve ; If we jump, this Pokemon does not evolve into CurPartySpecies.
+ jr z, .no_evolve ; If we jump, this Pokemon does not evolve into wCurPartySpecies.
cp EVOLVE_STAT ; This evolution type has the extra parameter of stat comparison.
jr nz, .not_tyrogue
inc hl
.not_tyrogue
inc hl
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp [hl]
jr z, .found_preevo
inc hl
@@ -670,7 +670,7 @@ GetPreEvolution: ; 42581
.found_preevo
inc c
ld a, c
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
scf
ret
; 425b1