summaryrefslogtreecommitdiff
path: root/engine/npctrade.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/npctrade.asm')
-rwxr-xr-xengine/npctrade.asm45
1 files changed, 16 insertions, 29 deletions
diff --git a/engine/npctrade.asm b/engine/npctrade.asm
index 1455dce62..40f6dd638 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
@@ -83,9 +75,9 @@ 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
@@ -109,7 +101,7 @@ TradeFlagAction: ; fcc4a
ld hl, wTradeFlags
ld a, [wJumptableIndex]
ld c, a
- predef FlagPredef
+ 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
@@ -214,7 +206,7 @@ DoNPCTrade: ; fcc63
call CopyTradeName
ld hl, PartyMonNicknames
- ld bc, PKMN_NAME_LENGTH
+ ld bc, MON_NAME_LENGTH
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonNickname
call CopyTradeName
@@ -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