summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2015-07-12 23:36:56 -0700
committerYamaArashi <shadow962@live.com>2015-07-12 23:36:56 -0700
commitbcfca2e267a6ee023271d90e27e4a7fde06f66fc (patch)
tree1634bd88b2aab601344a6bdbf8e6a9ec7a3c62c2
parent4a8c9993ad182296131ef87111e1b6d6e2af4201 (diff)
movemon and removepokemon wram variables
-rw-r--r--constants/misc_constants.asm6
-rwxr-xr-xengine/cable_club.asm2
-rwxr-xr-xengine/in_game_trades.asm2
-rw-r--r--engine/menu/bills_pc.asm16
-rw-r--r--home.asm4
-rwxr-xr-xmain.asm58
-rwxr-xr-xscripts/daycarem.asm18
-rwxr-xr-xwram.asm11
8 files changed, 66 insertions, 51 deletions
diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm
index a96fc59f..8aac849e 100644
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -66,6 +66,12 @@ CANCELLED_MENU EQU 2 ; pressed B
CHOSE_FIRST_ITEM EQU 1
CHOSE_SECOND_ITEM EQU 2
+; move mon constants
+BOX_TO_PARTY EQU 0
+PARTY_TO_BOX EQU 1
+DAYCARE_TO_PARTY EQU 2
+PARTY_TO_DAYCARE EQU 3
+
; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01
diff --git a/engine/cable_club.asm b/engine/cable_club.asm
index be403fa6..c115ed4a 100755
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -793,7 +793,7 @@ TradeCenter_Trade:
ld a, [hl]
ld [wTradedPlayerMonSpecies], a
xor a
- ld [wcf95], a
+ ld [wRemoveMonFromBox], a
call RemovePokemon
ld a, [wTradingWhichEnemyMon]
ld c, a
diff --git a/engine/in_game_trades.asm b/engine/in_game_trades.asm
index 32b55002..3594a26e 100755
--- a/engine/in_game_trades.asm
+++ b/engine/in_game_trades.asm
@@ -131,7 +131,7 @@ InGameTrade_DoTrade: ; 71c07 (1c:5c07)
ld [wcf91],a
xor a
ld [wcc49],a
- ld [wcf95],a
+ ld [wRemoveMonFromBox],a
call RemovePokemon
ld a,$80
ld [wcc49],a
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index b4ac3680..530ab961 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -229,11 +229,11 @@ BillsPCDeposit:
ld a, [wcf91]
call GetCryData
call PlaySoundWaitForCurrent
- ld a, $1
- ld [wcf95], a
+ ld a, PARTY_TO_BOX
+ ld [wMoveMonType], a
call MoveMon
xor a
- ld [wcf95], a
+ ld [wRemoveMonFromBox], a
call RemovePokemon
call WaitForSoundToFinish
ld hl, wWhichTrade
@@ -281,11 +281,11 @@ Func_21618: ; 21618 (8:5618)
ld a, [wcf91]
call GetCryData
call PlaySoundWaitForCurrent
- xor a
- ld [wcf95], a
+ xor a ; BOX_TO_PARTY
+ ld [wMoveMonType], a
call MoveMon
- ld a, $1
- ld [wcf95], a
+ ld a, 1
+ ld [wRemoveMonFromBox], a
call RemovePokemon
call WaitForSoundToFinish
ld hl, MonIsTakenOutText
@@ -310,7 +310,7 @@ Func_21673: ; 21673 (8:5673)
and a
jr nz, .asm_21682
inc a
- ld [wcf95], a
+ ld [wRemoveMonFromBox], a
call RemovePokemon
call WaitForSoundToFinish
ld a, [wcf91]
diff --git a/home.asm b/home.asm
index b9041fef..51e10118 100644
--- a/home.asm
+++ b/home.asm
@@ -3599,8 +3599,8 @@ CopyDataUntil:: ; 3913 (0:3913)
; Function to remove a pokemon from the party or the current box.
; wWhichPokemon determines the pokemon.
-; [wcf95] == 0 specifies the party.
-; [wcf95] != 0 specifies the current box.
+; [wRemoveMonFromBox] == 0 specifies the party.
+; [wRemoveMonFromBox] != 0 specifies the current box.
RemovePokemon:: ; 391f (0:391f)
ld hl, _RemovePokemon
ld b, BANK(_RemovePokemon)
diff --git a/main.asm b/main.asm
index 3a79bdd6..54440e60 100755
--- a/main.asm
+++ b/main.asm
@@ -1916,7 +1916,7 @@ INCLUDE "engine/menu/players_pc.asm"
_RemovePokemon: ; 7b68 (1:7b68)
ld hl, wPartyCount
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7b74
ld hl, W_NUMINBOX
@@ -1939,7 +1939,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
jr nz, .asm_7b81
ld hl, wPartyMonOT
ld d, $5
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7b97
ld hl, wBoxMonOT
@@ -1958,7 +1958,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
ld bc, $b
add hl, bc
ld bc, wPartyMonNicks
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7bb8
ld bc, wBoxMonNicks
@@ -1966,7 +1966,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
call CopyDataUntil
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7bcd
ld hl, wBoxMons
@@ -1976,7 +1976,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
call AddNTimes
ld d, h
ld e, l
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7be4
ld bc, wBoxMon2 - wBoxMon1
@@ -1990,7 +1990,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
.asm_7beb
call CopyDataUntil
ld hl, wPartyMonNicks
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7bfa
ld hl, wBoxMonNicks
@@ -2003,7 +2003,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
ld bc, $b
add hl, bc
ld bc, wPokedexOwned
- ld a, [wcf95]
+ ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7c15
ld bc, wBoxMonNicksEnd
@@ -3867,12 +3867,12 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
ret ; return success
_MoveMon: ; f51e (3:751e)
- ld a, [wcf95]
+ ld a, [wMoveMonType]
and a
jr z, .checkPartyMonSlots
- cp $2
+ cp DAYCARE_TO_PARTY
jr z, .checkPartyMonSlots
- cp $3
+ cp PARTY_TO_DAYCARE
ld hl, wDayCareMon
jr z, .asm_f575
ld hl, W_NUMINBOX
@@ -3892,17 +3892,17 @@ _MoveMon: ; f51e (3:751e)
inc a
ld [hl], a ; increment number of mons in party/box
ld c, a
- ld b, $0
+ ld b, 0
add hl, bc
- ld a, [wcf95]
- cp $2
+ ld a, [wMoveMonType]
+ cp DAYCARE_TO_PARTY
ld a, [wDayCareMon]
jr z, .asm_f556
ld a, [wcf91]
.asm_f556
ld [hli], a ; write new mon ID
ld [hl], $ff ; write new sentinel
- ld a, [wcf95]
+ ld a, [wMoveMonType]
dec a
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1 ; $2c
@@ -3918,12 +3918,12 @@ _MoveMon: ; f51e (3:751e)
push hl
ld e, l
ld d, h
- ld a, [wcf95]
+ ld a, [wMoveMonType]
and a
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1 ; $21
jr z, .asm_f591
- cp $2
+ cp DAYCARE_TO_PARTY
ld hl, wDayCareMon
jr z, .asm_f597
ld hl, wPartyMons
@@ -3938,10 +3938,10 @@ _MoveMon: ; f51e (3:751e)
call CopyData
pop de
pop hl
- ld a, [wcf95]
+ ld a, [wMoveMonType]
and a
jr z, .asm_f5b4
- cp $2
+ cp DAYCARE_TO_PARTY
jr z, .asm_f5b4
ld bc, wBoxMon2 - wBoxMon1
add hl, bc
@@ -3951,8 +3951,8 @@ _MoveMon: ; f51e (3:751e)
inc de
ld [de], a
.asm_f5b4
- ld a, [wcf95]
- cp $3
+ ld a, [wMoveMonType]
+ cp PARTY_TO_DAYCARE
ld de, W_DAYCAREMONOT
jr z, .asm_f5d3
dec a
@@ -3968,11 +3968,11 @@ _MoveMon: ; f51e (3:751e)
ld e, l
.asm_f5d3
ld hl, wBoxMonOT
- ld a, [wcf95]
+ ld a, [wMoveMonType]
and a
jr z, .asm_f5e6
ld hl, W_DAYCAREMONOT
- cp $2
+ cp DAYCARE_TO_PARTY
jr z, .asm_f5ec
ld hl, wPartyMonOT
.asm_f5e6
@@ -3981,8 +3981,8 @@ _MoveMon: ; f51e (3:751e)
.asm_f5ec
ld bc, $b
call CopyData
- ld a, [wcf95]
- cp $3
+ ld a, [wMoveMonType]
+ cp PARTY_TO_DAYCARE
ld de, W_DAYCAREMONNAME
jr z, .asm_f611
dec a
@@ -3998,11 +3998,11 @@ _MoveMon: ; f51e (3:751e)
ld e, l
.asm_f611
ld hl, wBoxMonNicks
- ld a, [wcf95]
+ ld a, [wMoveMonType]
and a
jr z, .asm_f624
ld hl, W_DAYCAREMONNAME
- cp $2
+ cp DAYCARE_TO_PARTY
jr z, .asm_f62a
ld hl, wPartyMonNicks
.asm_f624
@@ -4012,10 +4012,10 @@ _MoveMon: ; f51e (3:751e)
ld bc, $b
call CopyData
pop hl
- ld a, [wcf95]
- cp $1
+ ld a, [wMoveMonType]
+ cp PARTY_TO_BOX
jr z, .asm_f664
- cp $3
+ cp PARTY_TO_DAYCARE
jr z, .asm_f664
push hl
srl a
diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm
index 83b9b3a7..f48584dc 100755
--- a/scripts/daycarem.asm
+++ b/scripts/daycarem.asm
@@ -45,13 +45,13 @@ DayCareMText1: ; 56254 (15:6254)
call GetPartyMonName
ld hl, DayCareMText_56419
call PrintText
- ld a, $1
+ ld a, 1
ld [W_DAYCARE_IN_USE], a
- ld a, $3
- ld [wcf95], a
+ ld a, PARTY_TO_DAYCARE
+ ld [wMoveMonType], a
call MoveMon
xor a
- ld [wcf95], a
+ ld [wRemoveMonFromBox], a
call RemovePokemon
ld a, [wcf91]
call PlayCry
@@ -163,21 +163,21 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
call DisplayTextBoxID
ld hl, DayCareMText_5644f
call PrintText
- ld a, $2
- ld [wcf95], a
+ ld a, DAYCARE_TO_PARTY
+ ld [wMoveMonType], a
call MoveMon
ld a, [wDayCareMonSpecies]
ld [wcf91], a
ld a, [wPartyCount]
dec a
push af
- ld bc, $002c
+ ld bc, wPartyMon2 - wPartyMon1
push bc
ld hl, wPartyMon1Moves
call AddNTimes
ld d, h
ld e, l
- ld a, $1
+ ld a, 1
ld [wHPBarMaxHP], a
predef WriteMonMoves
pop bc
@@ -186,7 +186,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
call AddNTimes
ld d, h
ld e, l
- ld bc, $0021
+ ld bc, wPartyMon1MaxHP - wPartyMon1HP
add hl, bc
ld a, [hli]
ld [de], a
diff --git a/wram.asm b/wram.asm
index 65681990..c5f06e53 100755
--- a/wram.asm
+++ b/wram.asm
@@ -851,7 +851,16 @@ wListMenuID:: ; cf94
; ID used by DisplayListMenuID
ds 1
-wcf95:: ds 1 ; used with RemovePokemon (BoxMons, Daycare, Trades, etc.)
+wRemoveMonFromBox:: ; cf95
+; if non-zero, RemovePokemon will remove the mon from the current box,
+; else it will remove the mon from the party
+
+wMoveMonType:: ; cf95
+; 0 = move from box to party
+; 1 = move from party to box
+; 2 = move from daycare to party
+; 3 = move from party to daycare
+ ds 1
wItemQuantity:: ; cf96
ds 1