summaryrefslogtreecommitdiff
path: root/engine/npctrade.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/npctrade.asm')
-rwxr-xr-xengine/npctrade.asm51
1 files changed, 19 insertions, 32 deletions
diff --git a/engine/npctrade.asm b/engine/npctrade.asm
index 1455dce62..7e3fa4683 100755
--- a/engine/npctrade.asm
+++ b/engine/npctrade.asm
@@ -1,11 +1,3 @@
-; Trade dialogs
- const_def
- const TRADE_INTRO
- const TRADE_CANCEL
- const TRADE_WRONG
- const TRADE_COMPLETE
- const TRADE_AFTER
-
NPCTrade:: ; fcba8
ld a, e
ld [wJumptableIndex], a
@@ -67,7 +59,7 @@ NPCTrade:: ; fcba8
push af
ld a, [wcf64]
push af
- predef TradeAnimation
+ predef Predef_TradeAnimation
pop af
ld [wcf64], a
pop af
@@ -83,17 +75,17 @@ CheckTradeGender: ; fcc23
ld e, TRADE_GENDER
call GetTradeAttribute
ld a, [hl]
- and a
+ and a ; TRADE_EITHER_GENDER
jr z, .matching
- cp 1
+ cp TRADE_MALE_ONLY
jr z, .check_male
- farcall GetGender
+ farcall Predef_GetGender
jr nz, .not_matching
jr .matching
.check_male
- farcall GetGender
+ farcall Predef_GetGender
jr z, .not_matching
.matching
@@ -109,7 +101,7 @@ TradeFlagAction: ; fcc4a
ld hl, wTradeFlags
ld a, [wJumptableIndex]
ld c, a
- predef FlagPredef
+ predef Predef_SmallFarFlagAction
ld a, c
and a
ret
@@ -178,10 +170,10 @@ DoNPCTrade: ; fcc63
ld e, TRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
- cp 3
- ld a, 1
+ cp TRADE_DIALOG_GIRL
+ ld a, CAUGHT_BY_GIRL
jr c, .okay
- ld a, 2
+ ld a, CAUGHT_BY_BOY
.okay
ld [wOTTrademonCaughtData], a
@@ -196,7 +188,7 @@ DoNPCTrade: ; fcc63
ld [MonType], a
ld [wPokemonWithdrawDepositParameter], a
callfar RemoveMonFromPartyOrBox
- predef TryAddMonToParty
+ predef Predef_TryAddMonToParty
ld e, TRADE_DIALOG
call GetTradeAttribute
@@ -332,8 +324,7 @@ CopyTradeName: ; fcdf4
ret
; fcdfb
-Functionfcdfb: ; fcdfb
-; unreferenced
+Unreferenced_Functionfcdfb: ; fcdfb
ld bc, 4
call CopyBytes
ld a, "@"
@@ -341,8 +332,7 @@ Functionfcdfb: ; fcdfb
ret
; fce05
-Functionfce05: ; fce05
-; unreferenced
+Unreferenced_Functionfce05: ; fce05
ld bc, 3
call CopyBytes
ld a, "@"
@@ -400,7 +390,7 @@ GetTradeMonNames: ; fce1b
and a
ret z
- cp 1
+ cp TRADE_MALE_ONLY
ld a, "♂"
jr z, .done
ld a, "♀"
@@ -433,31 +423,28 @@ PrintTradeText: ; fcf38
; fcf53
TradeTexts: ; fcf53
-; intro
+; entries correspond to TRADE_* × TRADE_DIALOG_* constants
+; TRADE_INTRO
dw TradeIntroText1
dw TradeIntroText2
dw TradeIntroText3
dw TradeIntroText4
-
-; cancel
+; TRADE_CANCEL
dw TradeCancelText1
dw TradeCancelText2
dw TradeCancelText3
dw TradeCancelText4
-
-; wrong mon
+; TRADE_WRONG
dw TradeWrongText1
dw TradeWrongText2
dw TradeWrongText3
dw TradeWrongText4
-
-; completed
+; TRADE_COMPLETE
dw TradeCompleteText1
dw TradeCompleteText2
dw TradeCompleteText3
dw TradeCompleteText4
-
-; after
+; TRADE_AFTER
dw TradeAfterText1
dw TradeAfterText2
dw TradeAfterText3