From 6ebe45e41fa4d939f5a9f44e05eaf64512b59018 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 25 Jan 2018 22:19:24 -0500 Subject: [PATCH] Move event data to data/events/ --- constants/item_data_constants.asm | 36 +++--------- constants/menu_constants.asm | 26 +++++++++ constants/pokemon_constants.asm | 7 +++ data/{ => events}/bug_contest_flags.asm | 0 data/{ => events}/bug_contest_winners.asm | 0 data/{ => events}/collision_stdscripts.asm | 0 data/{ => events}/elevator_floors.asm | 0 data/{ => events}/field_move_blocks.asm | 0 data/events/happiness_chances.asm | 12 ++++ data/{ => events}/happiness_changes.asm | 0 data/events/magikarp_lengths.asm | 21 +++++++ data/{ => events}/npc_trades.asm | 0 data/{ => events}/odd_eggs.asm | 0 data/events/pokedex_ratings.asm | 24 ++++++++ data/{ => events}/unown_walls.asm | 0 data/items/pocket_names.asm | 11 ++++ data/phone/non_trainer_names.asm | 16 ++++++ data/phone/special_calls.asm | 16 +++--- data/pokemon/unown_words.asm | 67 ++++++++++++++++++++++ data/sprites/player_sprites.asm | 13 +++++ data/unown_words.asm | 67 ---------------------- engine/events/bug_contest/contest_2.asm | 2 +- engine/events/bug_contest/judging.asm | 2 +- engine/events/elevator.asm | 2 +- engine/events/happiness_egg.asm | 2 +- engine/events/magikarp.asm | 23 +------- engine/events/odd_egg.asm | 2 +- engine/events/overworld.asm | 2 +- engine/events/prof_oaks_pc.asm | 22 +------ engine/events/special.asm | 19 ++---- engine/events/std_collision.asm | 2 +- engine/events/unown_walls.asm | 2 +- engine/items.asm | 7 ++- engine/npctrade.asm | 2 +- engine/overworld.asm | 19 +----- engine/party_menu.asm | 1 + engine/phone/phone.asm | 16 +----- engine/pokedex/unown_dex.asm | 2 +- engine/select_menu.asm | 2 + engine/variables.asm | 2 +- 40 files changed, 242 insertions(+), 205 deletions(-) rename data/{ => events}/bug_contest_flags.asm (100%) rename data/{ => events}/bug_contest_winners.asm (100%) rename data/{ => events}/collision_stdscripts.asm (100%) rename data/{ => events}/elevator_floors.asm (100%) rename data/{ => events}/field_move_blocks.asm (100%) create mode 100644 data/events/happiness_chances.asm rename data/{ => events}/happiness_changes.asm (100%) create mode 100644 data/events/magikarp_lengths.asm rename data/{ => events}/npc_trades.asm (100%) rename data/{ => events}/odd_eggs.asm (100%) create mode 100644 data/events/pokedex_ratings.asm rename data/{ => events}/unown_walls.asm (100%) create mode 100644 data/items/pocket_names.asm create mode 100644 data/phone/non_trainer_names.asm create mode 100644 data/pokemon/unown_words.asm create mode 100644 data/sprites/player_sprites.asm delete mode 100644 data/unown_words.asm diff --git a/constants/item_data_constants.asm b/constants/item_data_constants.asm index b3a35d72b..495469e02 100644 --- a/constants/item_data_constants.asm +++ b/constants/item_data_constants.asm @@ -18,14 +18,18 @@ const_value set 1 ; item menu types ; UseItem.dw indexes (see engine/pack.asm) +; UseRegisteredItem.SwitchTo indexes (see engine/select_menu.asm) ITEMMENU_NOUSE EQU 0 ITEMMENU_CURRENT EQU 4 ITEMMENU_PARTY EQU 5 ITEMMENU_CLOSE EQU 6 ; item actions -CANT_SELECT EQU 1 << 6 -CANT_TOSS EQU 1 << 7 +CANT_SELECT_F EQU 6 +CANT_TOSS_F EQU 7 + +CANT_SELECT EQU 1 << CANT_SELECT_F +CANT_TOSS EQU 1 << CANT_TOSS_F ; pack pockets @@ -34,7 +38,7 @@ CANT_TOSS EQU 1 << 7 const BALL_POCKET ; 1 const KEY_ITEM_POCKET ; 2 const TM_HM_POCKET ; 3 -NUM_POCKETS EQU const_value +- 1 +NUM_POCKETS EQU const_value MAX_ITEMS EQU 20 MAX_BALLS EQU 12 @@ -170,29 +174,3 @@ const_value set 70 const MART_MT_MOON const MART_INDIGO_PLATEAU const MART_UNDERGROUND - - -; PartyMenuQualityPointers indexes (see data/party_menu_qualities.asm) - const_def - const PARTYMENUACTION_CHOOSE_POKEMON - const PARTYMENUACTION_HEALING_ITEM - const PARTYMENUACTION_SWITCH - const PARTYMENUACTION_TEACH_TMHM - const PARTYMENUACTION_MOVE - const PARTYMENUACTION_EVO_STONE - const PARTYMENUACTION_GIVE_MON - const PARTYMENUACTION_GIVE_MON_FEMALE ; unused - const PARTYMENUACTION_GIVE_ITEM - const PARTYMENUACTION_MOBILE ; mobile -; PrintPartyMenuActionText arguments (see engine/party_menu.asm) -const_value set $f0 - const PARTYMENUTEXT_HEAL_PSN - const PARTYMENUTEXT_HEAL_BRN - const PARTYMENUTEXT_HEAL_FRZ - const PARTYMENUTEXT_HEAL_SLP - const PARTYMENUTEXT_HEAL_PAR - const PARTYMENUTEXT_HEAL_HP - const PARTYMENUTEXT_HEAL_ALL - const PARTYMENUTEXT_REVIVE - const PARTYMENUTEXT_LEVEL_UP - const PARTYMENUTEXT_HEAL_CONFUSION diff --git a/constants/menu_constants.asm b/constants/menu_constants.asm index 8f1257593..08f584ff1 100644 --- a/constants/menu_constants.asm +++ b/constants/menu_constants.asm @@ -69,3 +69,29 @@ NUM_MONMENU_ITEMS EQU 8 ; start/select menu return values HMENURETURN_SCRIPT EQU %10000000 HMENURETURN_ASM EQU %11111111 + + +; PartyMenuQualityPointers indexes (see data/party_menu_qualities.asm) + const_def + const PARTYMENUACTION_CHOOSE_POKEMON + const PARTYMENUACTION_HEALING_ITEM + const PARTYMENUACTION_SWITCH + const PARTYMENUACTION_TEACH_TMHM + const PARTYMENUACTION_MOVE + const PARTYMENUACTION_EVO_STONE + const PARTYMENUACTION_GIVE_MON + const PARTYMENUACTION_GIVE_MON_FEMALE ; unused + const PARTYMENUACTION_GIVE_ITEM + const PARTYMENUACTION_MOBILE ; mobile +; PrintPartyMenuActionText arguments (see engine/party_menu.asm) +const_value set $f0 + const PARTYMENUTEXT_HEAL_PSN + const PARTYMENUTEXT_HEAL_BRN + const PARTYMENUTEXT_HEAL_FRZ + const PARTYMENUTEXT_HEAL_SLP + const PARTYMENUTEXT_HEAL_PAR + const PARTYMENUTEXT_HEAL_HP + const PARTYMENUTEXT_HEAL_ALL + const PARTYMENUTEXT_REVIVE + const PARTYMENUTEXT_LEVEL_UP + const PARTYMENUTEXT_HEAL_CONFUSION diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index f3d03b3a0..8b3b45100 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -277,6 +277,13 @@ NUM_POKEMON EQU const_value +- 1 const MON_FE ; fe ; Unown forms +; indexes for: +; - UnownWords (see data/pokemon/unown_words.asm) +; - UnownPicPointers (see data/pokemon/unown_pic_pointers.asm) +; - UnownAnimationPointers (see gfx/pokemon/unown_anim_pointers.asm) +; - UnownAnimationIdlePointers (see gfx/pokemon/unown_idle_pointers.asm) +; - UnownBitmasksPointers (see gfx/pokemon/unown_bitmask_pointers.asm) +; - UnownFramesPointers (see gfx/pokemon/unown_frame_pointers.asm) const_value set 1 const UNOWN_A ; 1 const UNOWN_B ; 2 diff --git a/data/bug_contest_flags.asm b/data/events/bug_contest_flags.asm similarity index 100% rename from data/bug_contest_flags.asm rename to data/events/bug_contest_flags.asm diff --git a/data/bug_contest_winners.asm b/data/events/bug_contest_winners.asm similarity index 100% rename from data/bug_contest_winners.asm rename to data/events/bug_contest_winners.asm diff --git a/data/collision_stdscripts.asm b/data/events/collision_stdscripts.asm similarity index 100% rename from data/collision_stdscripts.asm rename to data/events/collision_stdscripts.asm diff --git a/data/elevator_floors.asm b/data/events/elevator_floors.asm similarity index 100% rename from data/elevator_floors.asm rename to data/events/elevator_floors.asm diff --git a/data/field_move_blocks.asm b/data/events/field_move_blocks.asm similarity index 100% rename from data/field_move_blocks.asm rename to data/events/field_move_blocks.asm diff --git a/data/events/happiness_chances.asm b/data/events/happiness_chances.asm new file mode 100644 index 000000000..22a7395d9 --- /dev/null +++ b/data/events/happiness_chances.asm @@ -0,0 +1,12 @@ +HappinessData_YoungerHaircutBrother: ; 7459 + db $4c, 2, HAPPINESS_YOUNGCUT1 ; 30% chance + db $80, 3, HAPPINESS_YOUNGCUT2 ; 20% chance + db $ff, 4, HAPPINESS_YOUNGCUT3 ; 50% chance + +HappinessData_OlderHaircutBrother: ; 7462 + db $9a, 2, HAPPINESS_OLDERCUT1 ; 60% chance + db $4c, 3, HAPPINESS_OLDERCUT2 ; 10% chance + db $ff, 4, HAPPINESS_OLDERCUT3 ; 30% chance + +HappinessData_DaisysGrooming: ; 746b + db $ff, 2, HAPPINESS_GROOMING ; 99.6% chance diff --git a/data/happiness_changes.asm b/data/events/happiness_changes.asm similarity index 100% rename from data/happiness_changes.asm rename to data/events/happiness_changes.asm diff --git a/data/events/magikarp_lengths.asm b/data/events/magikarp_lengths.asm new file mode 100644 index 000000000..a631ef719 --- /dev/null +++ b/data/events/magikarp_lengths.asm @@ -0,0 +1,21 @@ +MagikarpLengths: ; fbca8 +; [wMagikarpLength] = z * 100 + (bc - x) / y +; First argument is the bc threshold as well as x. +; Second argument is y. +; In reality, due to the bug at .BCLessThanDE, +; the threshold is determined by only register b. + dwb 110, 1 ; not used unless the bug is fixed + dwb 310, 2 + dwb 710, 4 + dwb 2710, 20 + dwb 7710, 50 + dwb 17710, 100 + dwb 32710, 150 + dwb 47710, 150 + dwb 57710, 100 + dwb 62710, 50 + dwb 64710, 20 + dwb 65210, 5 + dwb 65410, 2 + dwb 65510, 1 ; not used +; fbcd2 diff --git a/data/npc_trades.asm b/data/events/npc_trades.asm similarity index 100% rename from data/npc_trades.asm rename to data/events/npc_trades.asm diff --git a/data/odd_eggs.asm b/data/events/odd_eggs.asm similarity index 100% rename from data/odd_eggs.asm rename to data/events/odd_eggs.asm diff --git a/data/events/pokedex_ratings.asm b/data/events/pokedex_ratings.asm new file mode 100644 index 000000000..be23c401f --- /dev/null +++ b/data/events/pokedex_ratings.asm @@ -0,0 +1,24 @@ +OakRatings: ; 0x2667f +; if you caught at most this many, play this sound, load this text +; (text is defined in engine/events/prof_oaks_pc.asm) + dbww 9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01 + dbww 19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02 + dbww 34, SFX_DEX_FANFARE_20_49, OakRating03 + dbww 49, SFX_DEX_FANFARE_20_49, OakRating04 + dbww 64, SFX_DEX_FANFARE_50_79, OakRating05 + dbww 79, SFX_DEX_FANFARE_50_79, OakRating06 + dbww 94, SFX_DEX_FANFARE_80_109, OakRating07 + dbww 109, SFX_DEX_FANFARE_80_109, OakRating08 + dbww 124, SFX_CAUGHT_MON, OakRating09 + dbww 139, SFX_CAUGHT_MON, OakRating10 + dbww 154, SFX_DEX_FANFARE_140_169, OakRating11 + dbww 169, SFX_DEX_FANFARE_140_169, OakRating12 + dbww 184, SFX_DEX_FANFARE_170_199, OakRating13 + dbww 199, SFX_DEX_FANFARE_170_199, OakRating14 + dbww 214, SFX_DEX_FANFARE_200_229, OakRating15 + dbww 229, SFX_DEX_FANFARE_200_229, OakRating16 + dbww 239, SFX_DEX_FANFARE_230_PLUS, OakRating17 + dbww 248, SFX_DEX_FANFARE_230_PLUS, OakRating18 + dbww 255, SFX_DEX_FANFARE_230_PLUS, OakRating19 + ; 0x266de + \ No newline at end of file diff --git a/data/unown_walls.asm b/data/events/unown_walls.asm similarity index 100% rename from data/unown_walls.asm rename to data/events/unown_walls.asm diff --git a/data/items/pocket_names.asm b/data/items/pocket_names.asm new file mode 100644 index 000000000..880e08fe3 --- /dev/null +++ b/data/items/pocket_names.asm @@ -0,0 +1,11 @@ +ItemPocketNames: +; entries correspond to item type constants + dw .Item + dw .Key + dw .Ball + dw .TM + +.Item: db "ITEM POCKET@" +.Key: db "KEY POCKET@" +.Ball: db "BALL POCKET@" +.TM: db "TM POCKET@" diff --git a/data/phone/non_trainer_names.asm b/data/phone/non_trainer_names.asm new file mode 100644 index 000000000..184a93113 --- /dev/null +++ b/data/phone/non_trainer_names.asm @@ -0,0 +1,16 @@ +NonTrainerCallerNames: ; 903d6 +; entries correspond to PHONECONTACT_* constants + dw .none + dw .mom + dw .bikeshop + dw .bill + dw .elm + dw .buena + +.none: db "----------@" +.mom: db "MOM:@" +.bill: db "BILL:@" +.elm: db "PROF.ELM:@" +.bikeshop: db "BIKE SHOP:@" +.buena: db "BUENA: DISC JOCKEY@" +; 90423 diff --git a/data/phone/special_calls.asm b/data/phone/special_calls.asm index 03c27743a..5dba36fc9 100644 --- a/data/phone/special_calls.asm +++ b/data/phone/special_calls.asm @@ -7,12 +7,12 @@ ENDM SpecialPhoneCallList: ; 90627 ; entries correspond to SPECIALCALL_* constants - specialcall SpecialCallOnlyWhenOutside, PHONE_ELM, ElmPhoneScript2 - specialcall SpecialCallOnlyWhenOutside, PHONE_ELM, ElmPhoneScript2 - specialcall SpecialCallOnlyWhenOutside, PHONE_ELM, ElmPhoneScript2 - specialcall SpecialCallOnlyWhenOutside, PHONE_ELM, ElmPhoneScript2 - specialcall SpecialCallWhereverYouAre, PHONE_ELM, ElmPhoneScript2 - specialcall SpecialCallWhereverYouAre, PHONE_OAK, BikeShopPhoneScript - specialcall SpecialCallWhereverYouAre, PHONE_MOM, MomPhoneLectureScript - specialcall SpecialCallOnlyWhenOutside, PHONE_ELM, ElmPhoneScript2 + specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2 + specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2 + specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2 + specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2 + specialcall SpecialCallWhereverYouAre, PHONECONTACT_ELM, ElmPhoneScript2 + specialcall SpecialCallWhereverYouAre, PHONECONTACT_BIKESHOP, BikeShopPhoneScript + specialcall SpecialCallWhereverYouAre, PHONECONTACT_MOM, MomPhoneLectureScript + specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2 ; 90657 diff --git a/data/pokemon/unown_words.asm b/data/pokemon/unown_words.asm new file mode 100644 index 000000000..4283d3708 --- /dev/null +++ b/data/pokemon/unown_words.asm @@ -0,0 +1,67 @@ +unownword: MACRO +x = 1 + rept STRLEN(\1) + db STRSUB(\1, x, 1) - $40 +x = x + 1 + endr + db -1 +ENDM + +UnownWords: ; fba5a +; entries correspond to UNOWN_* form constants + dw UnownWordA + dw UnownWordA + dw UnownWordB + dw UnownWordC + dw UnownWordD + dw UnownWordE + dw UnownWordF + dw UnownWordG + dw UnownWordH + dw UnownWordI + dw UnownWordJ + dw UnownWordK + dw UnownWordL + dw UnownWordM + dw UnownWordN + dw UnownWordO + dw UnownWordP + dw UnownWordQ + dw UnownWordR + dw UnownWordS + dw UnownWordT + dw UnownWordU + dw UnownWordV + dw UnownWordW + dw UnownWordX + dw UnownWordY + dw UnownWordZ +; fba90 + +UnownWordA: unownword "ANGRY" +UnownWordB: unownword "BEAR" +UnownWordC: unownword "CHASE" +UnownWordD: unownword "DIRECT" +UnownWordE: unownword "ENGAGE" +UnownWordF: unownword "FIND" +UnownWordG: unownword "GIVE" +UnownWordH: unownword "HELP" +UnownWordI: unownword "INCREASE" +UnownWordJ: unownword "JOIN" +UnownWordK: unownword "KEEP" +UnownWordL: unownword "LAUGH" +UnownWordM: unownword "MAKE" +UnownWordN: unownword "NUZZLE" +UnownWordO: unownword "OBSERVE" +UnownWordP: unownword "PERFORM" +UnownWordQ: unownword "QUICKEN" +UnownWordR: unownword "REASSURE" +UnownWordS: unownword "SEARCH" +UnownWordT: unownword "TELL" +UnownWordU: unownword "UNDO" +UnownWordV: unownword "VANISH" +UnownWordW: unownword "WANT" +UnownWordX: unownword "XXXXX" +UnownWordY: unownword "YIELD" +UnownWordZ: unownword "ZOOM" +; fbb32 diff --git a/data/sprites/player_sprites.asm b/data/sprites/player_sprites.asm new file mode 100644 index 000000000..89eb6e831 --- /dev/null +++ b/data/sprites/player_sprites.asm @@ -0,0 +1,13 @@ +ChrisStateSprites: + db PLAYER_NORMAL, SPRITE_CHRIS + db PLAYER_BIKE, SPRITE_CHRIS_BIKE + db PLAYER_SURF, SPRITE_SURF + db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU + db -1 ; end + +KrisStateSprites: + db PLAYER_NORMAL, SPRITE_KRIS + db PLAYER_BIKE, SPRITE_KRIS_BIKE + db PLAYER_SURF, SPRITE_SURF + db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU + db -1 ; end diff --git a/data/unown_words.asm b/data/unown_words.asm deleted file mode 100644 index ea8c4b2a8..000000000 --- a/data/unown_words.asm +++ /dev/null @@ -1,67 +0,0 @@ -unownword: MACRO -x = 1 - rept STRLEN(\1) - db STRSUB(\1, x, 1) - $40 -x = x + 1 - endr - db -1 -ENDM - -UnownWords: ; fba5a -; entries correspond to Unown forms - dw UnownWord1 - dw UnownWord1 - dw UnownWord2 - dw UnownWord3 - dw UnownWord4 - dw UnownWord5 - dw UnownWord6 - dw UnownWord7 - dw UnownWord8 - dw UnownWord9 - dw UnownWord10 - dw UnownWord11 - dw UnownWord12 - dw UnownWord13 - dw UnownWord14 - dw UnownWord15 - dw UnownWord16 - dw UnownWord17 - dw UnownWord18 - dw UnownWord19 - dw UnownWord20 - dw UnownWord21 - dw UnownWord22 - dw UnownWord23 - dw UnownWord24 - dw UnownWord25 - dw UnownWord26 -; fba90 - -UnownWord1: unownword "ANGRY" -UnownWord2: unownword "BEAR" -UnownWord3: unownword "CHASE" -UnownWord4: unownword "DIRECT" -UnownWord5: unownword "ENGAGE" -UnownWord6: unownword "FIND" -UnownWord7: unownword "GIVE" -UnownWord8: unownword "HELP" -UnownWord9: unownword "INCREASE" -UnownWord10: unownword "JOIN" -UnownWord11: unownword "KEEP" -UnownWord12: unownword "LAUGH" -UnownWord13: unownword "MAKE" -UnownWord14: unownword "NUZZLE" -UnownWord15: unownword "OBSERVE" -UnownWord16: unownword "PERFORM" -UnownWord17: unownword "QUICKEN" -UnownWord18: unownword "REASSURE" -UnownWord19: unownword "SEARCH" -UnownWord20: unownword "TELL" -UnownWord21: unownword "UNDO" -UnownWord22: unownword "VANISH" -UnownWord23: unownword "WANT" -UnownWord24: unownword "XXXXX" -UnownWord25: unownword "YIELD" -UnownWord26: unownword "ZOOM" -; fbb32 diff --git a/engine/events/bug_contest/contest_2.asm b/engine/events/bug_contest/contest_2.asm index 80f0bda97..56afefb72 100755 --- a/engine/events/bug_contest/contest_2.asm +++ b/engine/events/bug_contest/contest_2.asm @@ -74,7 +74,7 @@ CheckBugContestContestantFlag: ; 139ed ret ; 139fe -INCLUDE "data/bug_contest_flags.asm" +INCLUDE "data/events/bug_contest_flags.asm" ContestDropOffMons: ; 13a12 ld hl, PartyMon1HP diff --git a/engine/events/bug_contest/judging.asm b/engine/events/bug_contest/judging.asm index e9659707b..6c8d7e82d 100755 --- a/engine/events/bug_contest/judging.asm +++ b/engine/events/bug_contest/judging.asm @@ -134,7 +134,7 @@ LoadContestantName: ; 13730 ; 13783 -INCLUDE "data/bug_contest_winners.asm" +INCLUDE "data/events/bug_contest_winners.asm" ; 13807 diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm index fba2cb0ef..6138ca6bd 100755 --- a/engine/events/elevator.asm +++ b/engine/events/elevator.asm @@ -229,4 +229,4 @@ FloorToString: ; 13575 ret ; 13583 -INCLUDE "data/elevator_floors.asm" +INCLUDE "data/events/elevator_floors.asm" diff --git a/engine/events/happiness_egg.asm b/engine/events/happiness_egg.asm index f5055f512..7300d0938 100755 --- a/engine/events/happiness_egg.asm +++ b/engine/events/happiness_egg.asm @@ -103,7 +103,7 @@ ChangeHappiness: ; 71c2 ret -INCLUDE "data/happiness_changes.asm" +INCLUDE "data/events/happiness_changes.asm" StepHappiness:: ; 725a diff --git a/engine/events/magikarp.asm b/engine/events/magikarp.asm index bb86a98ab..b0f327d07 100644 --- a/engine/events/magikarp.asm +++ b/engine/events/magikarp.asm @@ -189,7 +189,7 @@ CalcMagikarpLength: ; fbbfc .no - ld hl, .Lengths + ld hl, MagikarpLengths ld a, 2 ld [wd265], a @@ -308,26 +308,7 @@ CalcMagikarpLength: ; fbbfc ret ; fbca8 -.Lengths: ; fbca8 -; [wMagikarpLength] = z * 100 + (bc - x) / y -; First argument is the bc threshold as well as x. -; Second argument is y. -; In reality, due to the bug at .BCLessThanDE, the threshold is determined by only register b. - dwb 110, 1 ; not used unless the bug is fixed - dwb 310, 2 - dwb 710, 4 - dwb 2710, 20 - dwb 7710, 50 - dwb 17710, 100 - dwb 32710, 150 - dwb 47710, 150 - dwb 57710, 100 - dwb 62710, 50 - dwb 64710, 20 - dwb 65210, 5 - dwb 65410, 2 - dwb 65510, 1 ; not used -; fbcd2 +INCLUDE "data/events/magikarp_lengths.asm" diff --git a/engine/events/odd_egg.asm b/engine/events/odd_egg.asm index da8d21d60..004165289 100644 --- a/engine/events/odd_egg.asm +++ b/engine/events/odd_egg.asm @@ -93,4 +93,4 @@ _GiveOddEgg: ; 1fb4b6 .Odd: db "ODD@@@@@@@@@" -INCLUDE "data/odd_eggs.asm" +INCLUDE "data/events/odd_eggs.asm" diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 576c6eebf..713457b68 100755 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -277,7 +277,7 @@ CheckOverworldTileArrays: ; c840 ret -INCLUDE "data/field_move_blocks.asm" +INCLUDE "data/events/field_move_blocks.asm" OWFlash: ; c8ac diff --git a/engine/events/prof_oaks_pc.asm b/engine/events/prof_oaks_pc.asm index 69949940b..4104279a2 100755 --- a/engine/events/prof_oaks_pc.asm +++ b/engine/events/prof_oaks_pc.asm @@ -98,27 +98,7 @@ endr ld l, a ret -OakRatings: ; 0x2667f -; if you caught at most this many, play this sound, load this text - dbww 9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01 - dbww 19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02 - dbww 34, SFX_DEX_FANFARE_20_49, OakRating03 - dbww 49, SFX_DEX_FANFARE_20_49, OakRating04 - dbww 64, SFX_DEX_FANFARE_50_79, OakRating05 - dbww 79, SFX_DEX_FANFARE_50_79, OakRating06 - dbww 94, SFX_DEX_FANFARE_80_109, OakRating07 - dbww 109, SFX_DEX_FANFARE_80_109, OakRating08 - dbww 124, SFX_CAUGHT_MON, OakRating09 - dbww 139, SFX_CAUGHT_MON, OakRating10 - dbww 154, SFX_DEX_FANFARE_140_169, OakRating11 - dbww 169, SFX_DEX_FANFARE_140_169, OakRating12 - dbww 184, SFX_DEX_FANFARE_170_199, OakRating13 - dbww 199, SFX_DEX_FANFARE_170_199, OakRating14 - dbww 214, SFX_DEX_FANFARE_200_229, OakRating15 - dbww 229, SFX_DEX_FANFARE_200_229, OakRating16 - dbww 239, SFX_DEX_FANFARE_230_PLUS, OakRating17 - dbww 248, SFX_DEX_FANFARE_230_PLUS, OakRating18 - dbww 255, SFX_DEX_FANFARE_230_PLUS, OakRating19 +INCLUDE "data/events/pokedex_ratings.asm" OakPCText1: ; 0x266de text_jump _OakPCText1 diff --git a/engine/events/special.asm b/engine/events/special.asm index ecb75c8ea..08231f9ac 100755 --- a/engine/events/special.asm +++ b/engine/events/special.asm @@ -156,15 +156,15 @@ BillsGrandfather: ; 73f7 ret YoungerHaircutBrother: ; 7413 - ld hl, Data_YoungerHaircutBrother + ld hl, HappinessData_YoungerHaircutBrother jr HaircutOrGrooming OlderHaircutBrother: ; 7418 - ld hl, Data_OlderHaircutBrother + ld hl, HappinessData_OlderHaircutBrother jr HaircutOrGrooming DaisysGrooming: ; 741d - ld hl, Data_DaisysGrooming + ld hl, HappinessData_DaisysGrooming ; fallthrough HaircutOrGrooming: ; 7420 @@ -213,18 +213,7 @@ HaircutOrGrooming: ; 7420 ld [ScriptVar], a ret -Data_YoungerHaircutBrother: ; 7459 - db $4c, 2, HAPPINESS_YOUNGCUT1 ; 30% chance - db $80, 3, HAPPINESS_YOUNGCUT2 ; 20% chance - db $ff, 4, HAPPINESS_YOUNGCUT3 ; 50% chance - -Data_OlderHaircutBrother: ; 7462 - db $9a, 2, HAPPINESS_OLDERCUT1 ; 60% chance - db $4c, 3, HAPPINESS_OLDERCUT2 ; 10% chance - db $ff, 4, HAPPINESS_OLDERCUT3 ; 30% chance - -Data_DaisysGrooming: ; 746b - db $ff, 2, HAPPINESS_GROOMING ; 99.6% chance +INCLUDE "data/events/happiness_chances.asm" CopyPokemonName_Buffer1_Buffer3: ; 746e ld hl, StringBuffer1 diff --git a/engine/events/std_collision.asm b/engine/events/std_collision.asm index 79dbc71f1..775f7c10c 100644 --- a/engine/events/std_collision.asm +++ b/engine/events/std_collision.asm @@ -23,7 +23,7 @@ CheckFacingTileForStdScript:: ; 1365b xor a ret -INCLUDE "data/collision_stdscripts.asm" +INCLUDE "data/events/collision_stdscripts.asm" Script_JumpStdFromRAM: ; 0x1369a jump wJumpStdScriptBuffer diff --git a/engine/events/unown_walls.asm b/engine/events/unown_walls.asm index e09d18fe8..91b1d11f3 100644 --- a/engine/events/unown_walls.asm +++ b/engine/events/unown_walls.asm @@ -153,7 +153,7 @@ DisplayUnownWords: ; 8ae68 ret ; 8aebc -INCLUDE "data/unown_walls.asm" +INCLUDE "data/events/unown_walls.asm" _DisplayUnownWords_FillAttr: ; 8aee9 ld a, [de] diff --git a/engine/items.asm b/engine/items.asm index 503a76c6b..120756764 100755 --- a/engine/items.asm +++ b/engine/items.asm @@ -11,6 +11,7 @@ _ReceiveItem:: ; d1d5 ret .Pockets: ; d1e9 +; entries correspond to item types dw .Item dw .KeyItem dw .Ball @@ -51,6 +52,7 @@ _TossItem:: ; d20d ret .Pockets: +; entries correspond to item types dw .Item dw .KeyItem dw .Ball @@ -93,6 +95,7 @@ _CheckItem:: ; d244 ret .Pockets: +; entries correspond to item types dw .Item dw .KeyItem dw .Ball @@ -492,7 +495,7 @@ _CheckTossableItem:: ; d427 ; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be removed from the bag. ld a, ITEMATTR_PERMISSIONS call GetItemAttr - bit 7, a + bit CANT_TOSS_F, a jr nz, ItemAttr_ReturnCarry and a ret @@ -501,7 +504,7 @@ CheckSelectableItem: ; d432 ; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be selected. ld a, ITEMATTR_PERMISSIONS call GetItemAttr - bit 6, a + bit CANT_SELECT_F, a jr nz, ItemAttr_ReturnCarry and a ret diff --git a/engine/npctrade.asm b/engine/npctrade.asm index 40f6dd638..fa2792934 100755 --- a/engine/npctrade.asm +++ b/engine/npctrade.asm @@ -401,7 +401,7 @@ GetTradeMonNames: ; fce1b ; fce58 -INCLUDE "data/npc_trades.asm" +INCLUDE "data/events/npc_trades.asm" PrintTradeText: ; fcf38 diff --git a/engine/overworld.asm b/engine/overworld.asm index 32ef356e5..88356877c 100755 --- a/engine/overworld.asm +++ b/engine/overworld.asm @@ -60,14 +60,14 @@ RefreshSprites:: ; 14168 GetPlayerSprite: ; 14183 ; Get Chris or Kris's sprite. - ld hl, .Chris + ld hl, ChrisStateSprites ld a, [wPlayerSpriteSetupFlags] bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a jr nz, .go ld a, [wPlayerGender] bit PLAYERGENDER_FEMALE_F, a jr z, .go - ld hl, .Kris + ld hl, KrisStateSprites .go ld a, [PlayerState] @@ -95,20 +95,7 @@ GetPlayerSprite: ; 14183 ld [PlayerObjectSprite], a ret -.Chris: - db PLAYER_NORMAL, SPRITE_CHRIS - db PLAYER_BIKE, SPRITE_CHRIS_BIKE - db PLAYER_SURF, SPRITE_SURF - db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU - db -1 ; end - -.Kris: - db PLAYER_NORMAL, SPRITE_KRIS - db PLAYER_BIKE, SPRITE_KRIS_BIKE - db PLAYER_SURF, SPRITE_SURF - db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU - db -1 ; end -; 141c9 +INCLUDE "data/sprites/player_sprites.asm" AddMapSprites: ; 141c9 diff --git a/engine/party_menu.asm b/engine/party_menu.asm index 5ef9b50de..a048eb5b7 100644 --- a/engine/party_menu.asm +++ b/engine/party_menu.asm @@ -839,6 +839,7 @@ PrintPartyMenuActionText: ; 50566 ; 5057b .MenuActionTexts: ; 5057b +; entries correspond to PARTYMENUTEXT_* constants dw .Text_CuredOfPoison dw .Text_BurnWasHealed dw .Text_Defrosted diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index f402e9102..54ec224d7 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -704,21 +704,7 @@ GetCallerName: ; 903a9 (24:43a9) ret ; 903d6 (24:43d6) -NonTrainerCallerNames: ; 903d6 - dw .none - dw .mom - dw .bikeshop - dw .bill - dw .elm - dw .buena - -.none db "----------@" -.mom db "MOM:@" -.bill db "BILL:@" -.elm db "PROF.ELM:@" -.bikeshop db "BIKE SHOP:@" -.buena db "BUENA: DISC JOCKEY@" -; 90423 +INCLUDE "data/phone/non_trainer_names.asm" Phone_GetTrainerName: ; 90423 (24:4423) push hl diff --git a/engine/pokedex/unown_dex.asm b/engine/pokedex/unown_dex.asm index dc6db9dc6..40138735d 100755 --- a/engine/pokedex/unown_dex.asm +++ b/engine/pokedex/unown_dex.asm @@ -49,4 +49,4 @@ PrintUnownWord: ; fba2e (3e:7a2e) ; fba5a (3e:7a5a) -INCLUDE "data/unown_words.asm" +INCLUDE "data/pokemon/unown_words.asm" diff --git a/engine/select_menu.asm b/engine/select_menu.asm index e92c3ee50..114c16e06 100755 --- a/engine/select_menu.asm +++ b/engine/select_menu.asm @@ -33,6 +33,7 @@ CheckRegisteredItem: ; 13345 ret .Pockets: +; entries correspond to *_POCKET constants dw .CheckItem dw .CheckBall dw .CheckKeyItem @@ -127,6 +128,7 @@ UseRegisteredItem: ; 133c3 ret .SwitchTo: +; entries correspond to ITEMMENU_* constants dw .CantUse dw .NoFunction dw .NoFunction diff --git a/engine/variables.asm b/engine/variables.asm index 56c49f085..2897cc986 100755 --- a/engine/variables.asm +++ b/engine/variables.asm @@ -54,7 +54,7 @@ _GetVarAction:: ; 80648 (20:4648) dwb MapGroup, RETVAR_STRBUF2 dwb MapNumber, RETVAR_STRBUF2 dwb .UnownCaught, RETVAR_EXECUTE - dwb wEnvironment, RETVAR_STRBUF2 + dwb wEnvironment, RETVAR_STRBUF2 dwb .BoxFreeSpace, RETVAR_EXECUTE dwb wBugContestMinsRemaining, RETVAR_STRBUF2 dwb XCoord, RETVAR_STRBUF2