summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-01-31 21:16:57 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2018-01-31 21:16:57 -0500
commit7d6e82ef1c8c3eccdc630e85af1d687eaa612ad6 (patch)
tree0d911d62e313e22825273421466cda2d9308cbd4
parentb04f41da98c9457c1200fdfe1c49ab20af86e3fa (diff)
NPC trade constants don't all just start with TRADE_
-rw-r--r--constants.asm2
-rw-r--r--constants/npc_trade_constants.asm44
-rw-r--r--constants/npctrade_constants.asm43
-rw-r--r--constants/script_constants.asm1
-rw-r--r--data/events/npc_trades.asm14
-rwxr-xr-xengine/events/npc_trade.asm (renamed from engine/npctrade.asm)72
-rw-r--r--main.asm2
-rw-r--r--maps/BlackthornEmysHouse.asm2
-rw-r--r--maps/BurnedTower1F.asm24
-rw-r--r--maps/GoldenrodDeptStore5F.asm2
-rw-r--r--maps/OlivineTimsHouse.asm2
-rw-r--r--maps/PewterPokecenter1F.asm2
-rw-r--r--maps/PowerPlant.asm2
-rw-r--r--maps/Route14.asm2
-rw-r--r--maps/VioletKylesHouse.asm2
15 files changed, 109 insertions, 107 deletions
diff --git a/constants.asm b/constants.asm
index 0fafcb03f..27c425f8e 100644
--- a/constants.asm
+++ b/constants.asm
@@ -33,7 +33,7 @@ INCLUDE "constants/mobile_constants.asm"
INCLUDE "constants/move_constants.asm"
INCLUDE "constants/move_effect_constants.asm"
INCLUDE "constants/music_constants.asm"
-INCLUDE "constants/npctrade_constants.asm"
+INCLUDE "constants/npc_trade_constants.asm"
INCLUDE "constants/phone_constants.asm"
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/pokemon_data_constants.asm"
diff --git a/constants/npc_trade_constants.asm b/constants/npc_trade_constants.asm
new file mode 100644
index 000000000..653ce3555
--- /dev/null
+++ b/constants/npc_trade_constants.asm
@@ -0,0 +1,44 @@
+ ; npctrade struct members (see data/events/npc_trades.asm)
+NPCTRADE_DIALOG EQU 0 ; db
+NPCTRADE_GIVEMON EQU 1 ; db
+NPCTRADE_GETMON EQU 2 ; db
+NPCTRADE_NICK EQU 3 ; ds MON_NAME_LENGTH
+NPCTRADE_DVS EQU 14 ; dw
+NPCTRADE_ITEM EQU 16 ; db
+NPCTRADE_OT_ID EQU 17 ; dw
+NPCTRADE_OT_NAME EQU 19 ; ds NAME_LENGTH
+NPCTRADE_GENDER EQU 30 ; db
+NPCTRADE_PADDING EQU 31 ; db
+
+; NPCTrades indexes (see data/events/npc_trades.asm)
+ const_def
+ const NPC_TRADE_MIKE ; 0
+ const NPC_TRADE_KYLE ; 1
+ const NPC_TRADE_TIM ; 2
+ const NPC_TRADE_EMY ; 3
+ const NPC_TRADE_CHRIS ; 4
+ const NPC_TRADE_KIM ; 5
+ const NPC_TRADE_FOREST ; 6
+
+; trade gender limits
+ const_def
+ const TRADE_GENDER_EITHER
+ const TRADE_GENDER_MALE
+ const TRADE_GENDER_FEMALE
+
+; TradeTexts indexes (see engine/events/npc_trade.asm)
+
+; trade dialogs
+ const_def
+ const TRADE_DIALOG_INTRO
+ const TRADE_DIALOG_CANCEL
+ const TRADE_DIALOG_WRONG
+ const TRADE_DIALOG_COMPLETE
+ const TRADE_DIALOG_AFTER
+
+; trade dialog sets
+ const_def
+ const TRADE_DIALOGSET_COLLECTOR
+ const TRADE_DIALOGSET_HAPPY
+ const TRADE_DIALOGSET_NEWBIE
+ const TRADE_DIALOGSET_GIRL
diff --git a/constants/npctrade_constants.asm b/constants/npctrade_constants.asm
deleted file mode 100644
index cb7508b11..000000000
--- a/constants/npctrade_constants.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-; npctrade struct members (see data/events/npc_trades.asm)
-TRADE_DIALOG EQU 0
-TRADE_GIVEMON EQU 1
-TRADE_GETMON EQU 2
-TRADE_NICK EQU 3
-TRADE_DVS EQU 14
-TRADE_ITEM EQU 16
-TRADE_OT_ID EQU 17
-TRADE_OT_NAME EQU 19
-TRADE_GENDER EQU 30
-TRADE_PADDING EQU 31
-
-; NPCTrades indexes (see data/events/npc_trades.asm)
- const_def
- const NPCTRADE_MIKE ; 0
- const NPCTRADE_KYLE ; 1
- const NPCTRADE_TIM ; 2
- const NPCTRADE_EMY ; 3
- const NPCTRADE_CHRIS ; 4
- const NPCTRADE_KIM ; 5
- const NPCTRADE_FOREST ; 6
-
-; trade gender limits
-TRADE_EITHER_GENDER EQU 0
-TRADE_MALE_ONLY EQU 1
-TRADE_FEMALE_ONLY EQU 2
-
-; TradeTexts indexes (see engine/npctrade.asm)
-
-; trade dialogs
- const_def
- const TRADE_INTRO
- const TRADE_CANCEL
- const TRADE_WRONG
- const TRADE_COMPLETE
- const TRADE_AFTER
-
-; trade dialog sets
- const_def
- const TRADE_DIALOG_COLLECTOR
- const TRADE_DIALOG_HAPPY
- const TRADE_DIALOG_NEWBIE
- const TRADE_DIALOG_GIRL
diff --git a/constants/script_constants.asm b/constants/script_constants.asm
index 4ffdb6c16..c2de2b04f 100644
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -91,6 +91,7 @@ RETVAR_EXECUTE EQU (2 << 6)
NUM_PLAYER_EVENTS EQU const_value
+; bg_event types
; TryBGEvent arguments (see engine/events.asm)
const_def
const BGEVENT_READ
diff --git a/data/events/npc_trades.asm b/data/events/npc_trades.asm
index d16670984..b019baf7a 100644
--- a/data/events/npc_trades.asm
+++ b/data/events/npc_trades.asm
@@ -8,11 +8,11 @@ ENDM
NPCTrades: ; fce58
; entries correspond to NPCTRADE_* constants
- npctrade TRADE_DIALOG_COLLECTOR, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, 37460, "MIKE@@@@@@@", TRADE_EITHER_GENDER
- npctrade TRADE_DIALOG_COLLECTOR, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, 48926, "KYLE@@@@@@@", TRADE_EITHER_GENDER
- npctrade TRADE_DIALOG_HAPPY, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, 29189, "TIM@@@@@@@@", TRADE_EITHER_GENDER
- npctrade TRADE_DIALOG_GIRL, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, 00283, "EMY@@@@@@@@", TRADE_FEMALE_ONLY
- npctrade TRADE_DIALOG_NEWBIE, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, 15616, "CHRIS@@@@@@", TRADE_EITHER_GENDER
- npctrade TRADE_DIALOG_GIRL, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, 26491, "KIM@@@@@@@@", TRADE_EITHER_GENDER
- npctrade TRADE_DIALOG_COLLECTOR, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, 50082, "FOREST@@@@@", TRADE_EITHER_GENDER
+ npctrade TRADE_DIALOGSET_COLLECTOR, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, 37460, "MIKE@@@@@@@", TRADE_GENDER_EITHER
+ npctrade TRADE_DIALOGSET_COLLECTOR, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, 48926, "KYLE@@@@@@@", TRADE_GENDER_EITHER
+ npctrade TRADE_DIALOGSET_HAPPY, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, 29189, "TIM@@@@@@@@", TRADE_GENDER_EITHER
+ npctrade TRADE_DIALOGSET_GIRL, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, 00283, "EMY@@@@@@@@", TRADE_GENDER_FEMALE
+ npctrade TRADE_DIALOGSET_NEWBIE, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, 15616, "CHRIS@@@@@@", TRADE_GENDER_EITHER
+ npctrade TRADE_DIALOGSET_GIRL, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, 26491, "KIM@@@@@@@@", TRADE_GENDER_EITHER
+ npctrade TRADE_DIALOGSET_COLLECTOR, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, 50082, "FOREST@@@@@", TRADE_GENDER_EITHER
; fcf38
diff --git a/engine/npctrade.asm b/engine/events/npc_trade.asm
index fa2792934..3adcb4038 100755
--- a/engine/npctrade.asm
+++ b/engine/events/npc_trade.asm
@@ -4,31 +4,31 @@ NPCTrade:: ; fcba8
call Trade_GetDialog
ld b, CHECK_FLAG
call TradeFlagAction
- ld a, TRADE_AFTER
+ ld a, TRADE_DIALOG_AFTER
jr nz, .done
- ld a, TRADE_INTRO
+ ld a, TRADE_DIALOG_INTRO
call PrintTradeText
call YesNoBox
- ld a, TRADE_CANCEL
+ ld a, TRADE_DIALOG_CANCEL
jr c, .done
; Select givemon from party
ld b, PARTYMENUACTION_GIVE_MON
farcall SelectTradeOrDayCareMon
- ld a, TRADE_CANCEL
+ ld a, TRADE_DIALOG_CANCEL
jr c, .done
- ld e, TRADE_GIVEMON
+ ld e, NPCTRADE_GIVEMON
call GetTradeAttribute
ld a, [CurPartySpecies]
cp [hl]
- ld a, TRADE_WRONG
+ ld a, TRADE_DIALOG_WRONG
jr nz, .done
call CheckTradeGender
- ld a, TRADE_WRONG
+ ld a, TRADE_DIALOG_WRONG
jr c, .done
ld b, SET_FLAG
@@ -46,7 +46,7 @@ NPCTrade:: ; fcba8
call RestartMapMusic
- ld a, TRADE_COMPLETE
+ ld a, TRADE_DIALOG_COMPLETE
.done
call PrintTradeText
@@ -72,14 +72,14 @@ CheckTradeGender: ; fcc23
xor a
ld [MonType], a
- ld e, TRADE_GENDER
+ ld e, NPCTRADE_GENDER
call GetTradeAttribute
ld a, [hl]
- and a ; TRADE_EITHER_GENDER
+ and a ; TRADE_GENDER_EITHER
jr z, .matching
- cp TRADE_MALE_ONLY
+ cp TRADE_GENDER_MALE
jr z, .check_male
-
+ ; TRADE_GENDER_FEMALE
farcall GetGender
jr nz, .not_matching
jr .matching
@@ -108,7 +108,7 @@ TradeFlagAction: ; fcc4a
; fcc59
Trade_GetDialog: ; fcc59
- ld e, TRADE_DIALOG
+ ld e, NPCTRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
ld [wcf64], a
@@ -116,12 +116,12 @@ Trade_GetDialog: ; fcc59
; fcc63
DoNPCTrade: ; fcc63
- ld e, TRADE_GIVEMON
+ ld e, NPCTRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
ld [wPlayerTrademonSpecies], a
- ld e, TRADE_GETMON
+ ld e, NPCTRADE_GETMON
call GetTradeAttribute
ld a, [hl]
ld [wOTTrademonSpecies], a
@@ -167,10 +167,10 @@ DoNPCTrade: ; fcc63
ld a, c
ld [wPlayerTrademonCaughtData], a
- ld e, TRADE_DIALOG
+ ld e, NPCTRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
- cp TRADE_DIALOG_GIRL
+ cp TRADE_DIALOGSET_GIRL
ld a, CAUGHT_BY_GIRL
jr c, .okay
ld a, CAUGHT_BY_BOY
@@ -190,17 +190,17 @@ DoNPCTrade: ; fcc63
callfar RemoveMonFromPartyOrBox
predef TryAddMonToParty
- ld e, TRADE_DIALOG
+ ld e, NPCTRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
- cp TRADE_COMPLETE
+ cp TRADE_DIALOG_COMPLETE
ld b, RESET_FLAG
jr c, .incomplete
ld b, SET_FLAG
.incomplete
farcall SetGiftPartyMonCaughtData
- ld e, TRADE_NICK
+ ld e, NPCTRADE_NICK
call GetTradeAttribute
ld de, wOTTrademonNickname
call CopyTradeName
@@ -211,7 +211,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonNickname
call CopyTradeName
- ld e, TRADE_OT_NAME
+ ld e, NPCTRADE_OT_NAME
call GetTradeAttribute
push hl
ld de, wOTTrademonOTName
@@ -226,7 +226,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonOTName
call CopyTradeName
- ld e, TRADE_DVS
+ ld e, NPCTRADE_DVS
call GetTradeAttribute
ld de, wOTTrademonDVs
call Trade_CopyTwoBytes
@@ -237,7 +237,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonDVs
call Trade_CopyTwoBytes
- ld e, TRADE_OT_ID
+ ld e, NPCTRADE_OT_ID
call GetTradeAttribute
ld de, wOTTrademonID + 1
call Trade_CopyTwoBytesReverseEndian
@@ -248,7 +248,7 @@ DoNPCTrade: ; fcc63
ld hl, wOTTrademonID
call Trade_CopyTwoBytes
- ld e, TRADE_ITEM
+ ld e, NPCTRADE_ITEM
call GetTradeAttribute
push hl
ld hl, PartyMon1Item
@@ -359,7 +359,7 @@ Trade_CopyTwoBytesReverseEndian: ; fce15
; fce1b
GetTradeMonNames: ; fce1b
- ld e, TRADE_GETMON
+ ld e, NPCTRADE_GETMON
call GetTradeAttribute
ld a, [hl]
call GetTradeMonName
@@ -367,7 +367,7 @@ GetTradeMonNames: ; fce1b
ld de, StringBuffer2
call CopyTradeName
- ld e, TRADE_GIVEMON
+ ld e, NPCTRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
call GetTradeMonName
@@ -383,16 +383,16 @@ GetTradeMonNames: ; fce1b
dec hl
push hl
- ld e, TRADE_GENDER
+ ld e, NPCTRADE_GENDER
call GetTradeAttribute
ld a, [hl]
pop hl
- and a
+ and a ; TRADE_GENDER_EITHER
ret z
-
- cp TRADE_MALE_ONLY
+ cp TRADE_GENDER_MALE
ld a, "♂"
jr z, .done
+ ; TRADE_GENDER_FEMALE
ld a, "♀"
.done
ld [hli], a
@@ -423,28 +423,28 @@ PrintTradeText: ; fcf38
; fcf53
TradeTexts: ; fcf53
-; entries correspond to TRADE_* × TRADE_DIALOG_* constants
-; TRADE_INTRO
+; entries correspond to TRADE_DIALOG_* × TRADE_DIALOGSET_* constants
+; TRADE_DIALOG_INTRO
dw TradeIntroText1
dw TradeIntroText2
dw TradeIntroText3
dw TradeIntroText4
-; TRADE_CANCEL
+; TRADE_DIALOG_CANCEL
dw TradeCancelText1
dw TradeCancelText2
dw TradeCancelText3
dw TradeCancelText4
-; TRADE_WRONG
+; TRADE_DIALOG_WRONG
dw TradeWrongText1
dw TradeWrongText2
dw TradeWrongText3
dw TradeWrongText4
-; TRADE_COMPLETE
+; TRADE_DIALOG_COMPLETE
dw TradeCompleteText1
dw TradeCompleteText2
dw TradeCompleteText3
dw TradeCompleteText4
-; TRADE_AFTER
+; TRADE_DIALOG_AFTER
dw TradeAfterText1
dw TradeAfterText2
dw TradeAfterText3
diff --git a/main.asm b/main.asm
index 50b4c6f0b..724a55492 100644
--- a/main.asm
+++ b/main.asm
@@ -462,7 +462,7 @@ INCLUDE "engine/battle/misc.asm"
SECTION "bank3F", ROMX
INCLUDE "engine/tileset_anims.asm"
-INCLUDE "engine/npctrade.asm"
+INCLUDE "engine/events/npc_trade.asm"
INCLUDE "engine/events/mom_phone.asm"
diff --git a/maps/BlackthornEmysHouse.asm b/maps/BlackthornEmysHouse.asm
index 8e9d9af23..956a8944b 100644
--- a/maps/BlackthornEmysHouse.asm
+++ b/maps/BlackthornEmysHouse.asm
@@ -9,7 +9,7 @@ BlackthornEmysHouse_MapScripts:
Emy:
faceplayer
opentext
- trade NPCTRADE_EMY
+ trade NPC_TRADE_EMY
waitbutton
closetext
end
diff --git a/maps/BurnedTower1F.asm b/maps/BurnedTower1F.asm
index 4c8f5e912..02b959381 100644
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -281,18 +281,18 @@ BurnedTower1F_MapEvents:
db 14 ; warp events
warp_event 9, 15, 13, ECRUTEAK_CITY
warp_event 10, 15, 13, ECRUTEAK_CITY
- warp_event 10, 9, 1, BURNED_TOWER_B1F
- warp_event 5, 5, 1, BURNED_TOWER_B1F
- warp_event 5, 6, 1, BURNED_TOWER_B1F
- warp_event 4, 6, 1, BURNED_TOWER_B1F
- warp_event 15, 4, 2, BURNED_TOWER_B1F
- warp_event 15, 5, 2, BURNED_TOWER_B1F
- warp_event 10, 7, 3, BURNED_TOWER_B1F
- warp_event 5, 14, 4, BURNED_TOWER_B1F
- warp_event 4, 14, 4, BURNED_TOWER_B1F
- warp_event 14, 14, 5, BURNED_TOWER_B1F
- warp_event 15, 14, 5, BURNED_TOWER_B1F
- warp_event 7, 15, 6, BURNED_TOWER_B1F
+ warp_event 10, 9, 1, BURNED_TOWER_B1F
+ warp_event 5, 5, 1, BURNED_TOWER_B1F
+ warp_event 5, 6, 1, BURNED_TOWER_B1F
+ warp_event 4, 6, 1, BURNED_TOWER_B1F
+ warp_event 15, 4, 2, BURNED_TOWER_B1F
+ warp_event 15, 5, 2, BURNED_TOWER_B1F
+ warp_event 10, 7, 3, BURNED_TOWER_B1F
+ warp_event 5, 14, 4, BURNED_TOWER_B1F
+ warp_event 4, 14, 4, BURNED_TOWER_B1F
+ warp_event 14, 14, 5, BURNED_TOWER_B1F
+ warp_event 15, 14, 5, BURNED_TOWER_B1F
+ warp_event 7, 15, 6, BURNED_TOWER_B1F
db 1 ; coord events
coord_event 11, 9, 1, BurnedTowerRivalBattleScript
diff --git a/maps/GoldenrodDeptStore5F.asm b/maps/GoldenrodDeptStore5F.asm
index 31f5c0e3f..4572e53a6 100644
--- a/maps/GoldenrodDeptStore5F.asm
+++ b/maps/GoldenrodDeptStore5F.asm
@@ -124,7 +124,7 @@ GoldenrodDeptStore5FLassScript:
Mike:
faceplayer
opentext
- trade NPCTRADE_MIKE
+ trade NPC_TRADE_MIKE
waitbutton
closetext
end
diff --git a/maps/OlivineTimsHouse.asm b/maps/OlivineTimsHouse.asm
index 83ce60ddc..0b9381cc0 100644
--- a/maps/OlivineTimsHouse.asm
+++ b/maps/OlivineTimsHouse.asm
@@ -9,7 +9,7 @@ OlivineTimsHouse_MapScripts:
Tim:
faceplayer
opentext
- trade NPCTRADE_TIM
+ trade NPC_TRADE_TIM
waitbutton
closetext
end
diff --git a/maps/PewterPokecenter1F.asm b/maps/PewterPokecenter1F.asm
index 83a065116..c3d73a0ab 100644
--- a/maps/PewterPokecenter1F.asm
+++ b/maps/PewterPokecenter1F.asm
@@ -30,7 +30,7 @@ PewterPokecenter1FBugCatcherScript:
Chris:
faceplayer
opentext
- trade NPCTRADE_CHRIS
+ trade NPC_TRADE_CHRIS
waitbutton
closetext
end
diff --git a/maps/PowerPlant.asm b/maps/PowerPlant.asm
index c5305e61f..1ecdc7656 100644
--- a/maps/PowerPlant.asm
+++ b/maps/PowerPlant.asm
@@ -189,7 +189,7 @@ UnknownScript_0x188ec5:
Forest:
faceplayer
opentext
- trade NPCTRADE_FOREST
+ trade NPC_TRADE_FOREST
waitbutton
closetext
end
diff --git a/maps/Route14.asm b/maps/Route14.asm
index ab862d46a..6d04456b0 100644
--- a/maps/Route14.asm
+++ b/maps/Route14.asm
@@ -12,7 +12,7 @@ Route14_MapScripts:
Kim:
faceplayer
opentext
- trade NPCTRADE_KIM
+ trade NPC_TRADE_KIM
waitbutton
closetext
end
diff --git a/maps/VioletKylesHouse.asm b/maps/VioletKylesHouse.asm
index 288b8cbb2..09078a49f 100644
--- a/maps/VioletKylesHouse.asm
+++ b/maps/VioletKylesHouse.asm
@@ -13,7 +13,7 @@ VioletKylesHousePokefanMScript:
Kyle:
faceplayer
opentext
- trade NPCTRADE_KYLE
+ trade NPC_TRADE_KYLE
waitbutton
closetext
end