merge in original dexnav code with some rhh specific tweaks
@ -1074,3 +1074,5 @@ EventScript_VsSeekerChargingDone::
|
||||
.include "data/text/frontier_brain.inc"
|
||||
.include "data/text/save.inc"
|
||||
.include "data/text/birch_speech.inc"
|
||||
.include "data/scripts/dexnav.inc"
|
||||
|
||||
|
||||
@ -25,9 +25,9 @@ gFieldEffectScriptPointers::
|
||||
.4byte gFieldEffectScript_JumpSmallSplash @ FLDEFF_JUMP_SMALL_SPLASH
|
||||
.4byte gFieldEffectScript_LongGrass @ FLDEFF_LONG_GRASS
|
||||
.4byte gFieldEffectScript_JumpLongGrass @ FLDEFF_JUMP_LONG_GRASS
|
||||
.4byte gFieldEffectScript_UnusedGrass @ FLDEFF_UNUSED_GRASS
|
||||
.4byte gFieldEffectScript_UnusedGrass2 @ FLDEFF_UNUSED_GRASS_2
|
||||
.4byte gFieldEffectScript_UnusedSand @ FLDEFF_UNUSED_SAND
|
||||
.4byte gFieldEffectScript_ShakingGrass @ FLDEFF_SHAKING_GRASS
|
||||
.4byte gFieldEffectScript_ShakingGrass2 @ FLDEFF_SHAKING_LONG_GRASS
|
||||
.4byte gFieldEffectScript_UnusedSand @ FLDEFF_SAND_HOLE
|
||||
.4byte gFieldEffectScript_WaterSurfacing @ FLDEFF_WATER_SURFACING
|
||||
.4byte gFieldEffectScript_BerryTreeGrowthSparkle @ FLDEFF_BERRY_TREE_GROWTH_SPARKLE
|
||||
.4byte gFieldEffectScript_DeepSandFootprints @ FLDEFF_DEEP_SAND_FOOTPRINTS
|
||||
@ -79,7 +79,8 @@ gFieldEffectScriptPointers::
|
||||
.4byte gFieldEffectScript_TracksSlither @ FLDEFF_TRACKS_SLITHER
|
||||
.4byte gFieldEffectScript_TracksBug @ FLDEFF_TRACKS_BUG
|
||||
.4byte gFieldEffectScript_TracksSpot @ FLDEFF_TRACKS_SPOT
|
||||
|
||||
.4byte gFieldEffectScript_CaveDust @ FLDEFF_CAVE_DUST
|
||||
|
||||
gFieldEffectScript_ExclamationMarkIcon1::
|
||||
field_eff_callnative FldEff_ExclamationMarkIcon
|
||||
field_eff_end
|
||||
@ -156,12 +157,12 @@ gFieldEffectScript_JumpLongGrass::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect1, FldEff_JumpLongGrass
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_UnusedGrass::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect1, FldEff_UnusedGrass
|
||||
gFieldEffectScript_ShakingGrass::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect1, FldEff_ShakingGrass
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_UnusedGrass2::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect1, FldEff_UnusedGrass2
|
||||
gFieldEffectScript_ShakingGrass2::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect1, FldEff_ShakingGrass2
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_UnusedSand::
|
||||
@ -374,3 +375,7 @@ gFieldEffectScript_TracksSpot::
|
||||
gFieldEffectScript_TracksSlither::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksSlither
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_CaveDust::
|
||||
field_eff_loadfadedpal_callnative gSpritePalette_CaveDust FldEff_CaveDust
|
||||
field_eff_end
|
||||
|
||||
47
data/scripts/dexnav.inc
Normal file
@ -0,0 +1,47 @@
|
||||
EventScript_StartDexNavBattle::
|
||||
lock
|
||||
playse 0x15
|
||||
applymovement OBJ_EVENT_ID_PLAYER Common_Movement_ExclamationMark
|
||||
waitmovement 0
|
||||
waitse
|
||||
dowildbattle
|
||||
release
|
||||
end
|
||||
|
||||
|
||||
EventScript_NotFoundNearby::
|
||||
msgbox sText_NotFoundNearby, MSGBOX_SIGN
|
||||
end
|
||||
sText_NotFoundNearby:
|
||||
.string "It couldn't be found nearby.\n"
|
||||
.string "Try looking in a different area!$"
|
||||
|
||||
|
||||
EventScript_MovedTooFast::
|
||||
msgbox sText_TryMovingSlower, MSGBOX_SIGN
|
||||
end
|
||||
sText_TryMovingSlower:
|
||||
.string "The Pokémon got away!\n"
|
||||
.string "Try moving more slowly.$"
|
||||
|
||||
|
||||
EventScript_PokemonGotAway::
|
||||
msgbox sText_PokemonGotAway, MSGBOX_SIGN
|
||||
end
|
||||
sText_PokemonGotAway:
|
||||
.string "The Pokémon got away!$"
|
||||
|
||||
|
||||
EventScript_LostSignal::
|
||||
msgbox sText_LostSignal, MSGBOX_SIGN
|
||||
end
|
||||
sText_LostSignal:
|
||||
.string "There is no reaction.\n"
|
||||
.string "The signal was lost!$"
|
||||
|
||||
|
||||
EventScript_TooDark::
|
||||
msgbox sText_TooDark, MSGBOX_SIGN
|
||||
end
|
||||
sText_TooDark:
|
||||
.string "It's too dark to search\nfor a Pokémon!$"
|
||||
BIN
graphics/dexnav/captured_all.png
Normal file
|
After Width: | Height: | Size: 157 B |
BIN
graphics/dexnav/cursor.png
Normal file
|
After Width: | Height: | Size: 172 B |
19
graphics/dexnav/gui.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
0 0 0
|
||||
255 255 255
|
||||
217 73 73
|
||||
4 4 4
|
||||
1 81 113
|
||||
1 121 193
|
||||
119 177 75
|
||||
93 97 101
|
||||
91 179 211
|
||||
153 32 32
|
||||
111 141 81
|
||||
173 173 173
|
||||
187 217 167
|
||||
75 147 189
|
||||
177 219 235
|
||||
105 22 22
|
||||
BIN
graphics/dexnav/gui_tilemap.bin
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
graphics/dexnav/gui_tiles.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
graphics/dexnav/hidden.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
graphics/dexnav/hidden_search.png
Normal file
|
After Width: | Height: | Size: 359 B |
BIN
graphics/dexnav/no_data.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
graphics/dexnav/owned_icon.png
Normal file
|
After Width: | Height: | Size: 159 B |
BIN
graphics/dexnav/star.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
graphics/dexnav/vision.png
Normal file
|
After Width: | Height: | Size: 242 B |
19
graphics/field_effects/palettes/cave_dust.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
255 1 255
|
||||
159 122 85
|
||||
207 189 157
|
||||
199 181 149
|
||||
114 88 61
|
||||
132 101 70
|
||||
199 173 141
|
||||
225 209 193
|
||||
189 165 133
|
||||
181 149 115
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
BIN
graphics/field_effects/pics/cave_dust.png
Normal file
|
After Width: | Height: | Size: 409 B |
19
graphics/text_window/dexnav_pal.pal
Normal file
@ -0,0 +1,19 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
16
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 6
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
46 46 46
|
||||
0 0 0
|
||||
255 255 255
|
||||
65
include/config/dexnav.h
Normal file
@ -0,0 +1,65 @@
|
||||
#ifndef GUARD_CONFIG_DEXNAV_H
|
||||
#define GUARD_CONFIG_DEXNAV_H
|
||||
|
||||
|
||||
#define USE_DEXNAV_SEARCH_LEVELS FALSE /* WARNING: EXCEEDS SAVEBLOCK SPACE! YOU WILL NEED TO FREE UP SPACE */
|
||||
|
||||
// search parameters
|
||||
#define DEXNAV_TIMEOUT 15 //15 seconds is the time out. Max of 1092 seconds allowed
|
||||
#define SNEAKING_PROXIMITY 4 //Tile amount
|
||||
#define CREEPING_PROXIMITY 2
|
||||
#define MAX_PROXIMITY 20
|
||||
|
||||
#define DEXNAV_CHAIN_MAX 100 // maximum valud of 255
|
||||
|
||||
//hidden pokemon options - no info so I just guessed at values
|
||||
#define HIDDEN_MON_STEP_COUNT 100 //look for hidden pokemon every x steps
|
||||
#define HIDDEN_MON_SEARCH_RATE 25 //x% chance of finding hidden pokemon every x steps
|
||||
#define HIDDEN_MON_PROBABILTY 15 //x% chance of finding hidden mon compared to regular encounter data
|
||||
|
||||
//// SEARCH PROBABILITIES
|
||||
// see https://m.bulbapedia.bulbagarden.net/wiki/DexNav#Benefits
|
||||
//Chance of encountering egg move at search levels
|
||||
#define SEARCHLEVEL0_MOVECHANCE 0
|
||||
#define SEARCHLEVEL5_MOVECHANCE 21
|
||||
#define SEARCHLEVEL10_MOVECHANCE 46
|
||||
#define SEARCHLEVEL25_MOVECHANCE 58
|
||||
#define SEARCHLEVEL50_MOVECHANCE 63
|
||||
#define SEARCHLEVEL100_MOVECHANCE 83
|
||||
//Chance of encountering Hidden Abilities at search levels
|
||||
#define SEARCHLEVEL0_ABILITYCHANCE 0
|
||||
#define SEARCHLEVEL5_ABILITYCHANCE 0
|
||||
#define SEARCHLEVEL10_ABILITYCHANCE 5
|
||||
#define SEARCHLEVEL25_ABILITYCHANCE 15
|
||||
#define SEARCHLEVEL50_ABILITYCHANCE 20
|
||||
#define SEARCHLEVEL100_ABILITYCHANCE 23
|
||||
//Chance of encountering held item
|
||||
#define SEARCHLEVEL0_ITEM 0
|
||||
#define SEARCHLEVEL5_ITEM 0
|
||||
#define SEARCHLEVEL10_ITEM 1
|
||||
#define SEARCHLEVEL25_ITEM 7
|
||||
#define SEARCHLEVEL50_ITEM 6
|
||||
#define SEARCHLEVEL100_ITEM 12
|
||||
//Chance of encountering one star potential
|
||||
#define SEARCHLEVEL0_ONESTAR 0
|
||||
#define SEARCHLEVEL5_ONESTAR 14
|
||||
#define SEARCHLEVEL10_ONESTAR 17
|
||||
#define SEARCHLEVEL25_ONESTAR 17
|
||||
#define SEARCHLEVEL50_ONESTAR 15
|
||||
#define SEARCHLEVEL100_ONESTAR 8
|
||||
//Chance of encountering two star potential
|
||||
#define SEARCHLEVEL0_TWOSTAR 0
|
||||
#define SEARCHLEVEL5_TWOSTAR 1
|
||||
#define SEARCHLEVEL10_TWOSTAR 9
|
||||
#define SEARCHLEVEL25_TWOSTAR 16
|
||||
#define SEARCHLEVEL50_TWOSTAR 17
|
||||
#define SEARCHLEVEL100_TWOSTAR 24
|
||||
//Chance of encountering three star potential
|
||||
#define SEARCHLEVEL0_THREESTAR 0
|
||||
#define SEARCHLEVEL5_THREESTAR 0
|
||||
#define SEARCHLEVEL10_THREESTAR 1
|
||||
#define SEARCHLEVEL25_THREESTAR 7
|
||||
#define SEARCHLEVEL50_THREESTAR 6
|
||||
#define SEARCHLEVEL100_THREESTAR 12
|
||||
|
||||
#endif // GUARD_CONFIG_DEXNAV_H
|
||||
@ -20,9 +20,9 @@
|
||||
#define FLDEFF_JUMP_SMALL_SPLASH 16
|
||||
#define FLDEFF_LONG_GRASS 17
|
||||
#define FLDEFF_JUMP_LONG_GRASS 18
|
||||
#define FLDEFF_UNUSED_GRASS 19
|
||||
#define FLDEFF_UNUSED_GRASS_2 20
|
||||
#define FLDEFF_UNUSED_SAND 21
|
||||
#define FLDEFF_SHAKING_GRASS 19
|
||||
#define FLDEFF_SHAKING_LONG_GRASS 20
|
||||
#define FLDEFF_SAND_HOLE 21
|
||||
#define FLDEFF_WATER_SURFACING 22
|
||||
#define FLDEFF_BERRY_TREE_GROWTH_SPARKLE 23
|
||||
#define FLDEFF_DEEP_SAND_FOOTPRINTS 24
|
||||
@ -75,6 +75,7 @@
|
||||
#define FLDEFF_TRACKS_SLITHER 70
|
||||
#define FLDEFF_TRACKS_SPOT 71
|
||||
#define FLDEFF_TRACKS_BUG 72
|
||||
#define FLDEFF_CAVE_DUST 73
|
||||
|
||||
#define FLDEFFOBJ_SHADOW_S 0
|
||||
#define FLDEFFOBJ_SHADOW_M 1
|
||||
@ -116,6 +117,7 @@
|
||||
#define FLDEFFOBJ_TRACKS_SLITHER 37
|
||||
#define FLDEFFOBJ_TRACKS_SPOT 38
|
||||
#define FLDEFFOBJ_TRACKS_BUG 39
|
||||
#define FLDEFFOBJ_CAVE_DUST 40
|
||||
|
||||
#define FLDEFF_PAL_TAG_CUT_GRASS 0x1000
|
||||
#define FLDEFF_PAL_TAG_SECRET_POWER_TREE 0x1003
|
||||
@ -129,5 +131,6 @@
|
||||
#define FLDEFF_PAL_TAG_SMALL_SPARKLE 0x100F
|
||||
#define FLDEFF_PAL_TAG_HOF_MONITOR 0x1010
|
||||
#define FLDEFF_PAL_TAG_UNKNOWN 0x1011
|
||||
#define FLDEFF_PAL_TAG_CAVE_DUST 0x1012
|
||||
|
||||
#endif // GUARD_FIELD_EFFECT_CONSTANTS_H
|
||||
|
||||
@ -1383,8 +1383,8 @@
|
||||
#define FLAG_IS_CHAMPION (SYSTEM_FLAGS + 0x1F) // Seems to be related to linking.
|
||||
#define FLAG_NURSE_UNION_ROOM_REMINDER (SYSTEM_FLAGS + 0x20)
|
||||
|
||||
#define FLAG_UNUSED_0x881 (SYSTEM_FLAGS + 0x21) // Unused Flag
|
||||
#define FLAG_UNUSED_0x882 (SYSTEM_FLAGS + 0x22) // Unused Flag
|
||||
#define FLAG_SYS_DEXNAV_SEARCH (SYSTEM_FLAGS + 0x21)
|
||||
#define FLAG_SHINY_CREATION (SYSTEM_FLAGS + 0x22) // force creation of a shiny mon
|
||||
#define FLAG_UNUSED_0x883 (SYSTEM_FLAGS + 0x23) // Unused Flag
|
||||
#define FLAG_UNUSED_0x884 (SYSTEM_FLAGS + 0x24) // Unused Flag
|
||||
#define FLAG_UNUSED_0x885 (SYSTEM_FLAGS + 0x25) // Unused Flag
|
||||
@ -1398,8 +1398,8 @@
|
||||
#define FLAG_SYS_SAFARI_MODE (SYSTEM_FLAGS + 0x2C)
|
||||
#define FLAG_SYS_CRUISE_MODE (SYSTEM_FLAGS + 0x2D)
|
||||
|
||||
#define FLAG_UNUSED_0x88E (SYSTEM_FLAGS + 0x2E) // Unused Flag
|
||||
#define FLAG_UNUSED_0x88F (SYSTEM_FLAGS + 0x2F) // Unused Flag
|
||||
#define FLAG_SYS_DETECTOR_MODE (SYSTEM_FLAGS + 0x2E) // allow player to find hidden mons
|
||||
#define FLAG_SYS_DEXNAV_GET (SYSTEM_FLAGS + 0x2F) // dexnav shows in start menu
|
||||
|
||||
#define FLAG_SYS_TV_HOME (SYSTEM_FLAGS + 0x30)
|
||||
#define FLAG_SYS_TV_WATCH (SYSTEM_FLAGS + 0x31)
|
||||
|
||||
@ -53,8 +53,9 @@
|
||||
#define GAME_STAT_ENTERED_HOT_SPRINGS 49
|
||||
#define GAME_STAT_NUM_UNION_ROOM_BATTLES 50
|
||||
#define GAME_STAT_PLAYED_BERRY_CRUSH 51
|
||||
#define GAME_STAT_DEXNAV_SCANNED 52
|
||||
|
||||
#define NUM_USED_GAME_STATS 52
|
||||
#define NUM_USED_GAME_STATS 53
|
||||
#define NUM_GAME_STATS 64
|
||||
|
||||
#endif // GUARD_CONSTANTS_GAME_STAT_H
|
||||
|
||||
@ -264,8 +264,8 @@
|
||||
#define VAR_ROXANNE_CALL_STEP_COUNTER 0x40F4
|
||||
#define VAR_SCOTT_BF_CALL_STEP_COUNTER 0x40F5
|
||||
#define VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER 0x40F6
|
||||
#define VAR_UNUSED_0x40F7 0x40F7 // Unused Var
|
||||
#define VAR_UNUSED_0x40F8 0x40F8 // Unused Var
|
||||
#define VAR_DEXNAV_SPECIES 0x40F7 // Registered dexnav species
|
||||
#define VAR_DEXNAV_STEP_COUNTER 0x40F8 // steps for finding hidden pokemon
|
||||
#define VAR_UNUSED_0x40F9 0x40F9 // Unused Var
|
||||
#define VAR_UNUSED_0x40FA 0x40FA // Unused Var
|
||||
#define VAR_UNUSED_0x40FB 0x40FB // Unused Var
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#define WATER_WILD_COUNT 5
|
||||
#define ROCK_WILD_COUNT 5
|
||||
#define FISH_WILD_COUNT 10
|
||||
#define HIDDEN_WILD_COUNT 3
|
||||
|
||||
#define NUM_ALTERING_CAVE_TABLES 9
|
||||
|
||||
|
||||
@ -34,5 +34,6 @@ void ShowDaycareLevelMenu(void);
|
||||
void ChooseSendDaycareMon(void);
|
||||
u8 GetEggMovesBySpecies(u16 species, u16 *eggMoves);
|
||||
bool8 SpeciesCanLearnEggMove(u16 species, u16 move);
|
||||
u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves);
|
||||
|
||||
#endif // GUARD_DAYCARE_H
|
||||
|
||||
80
include/dexnav.h
Normal file
@ -0,0 +1,80 @@
|
||||
#ifndef GUARD_DEXNAV_H
|
||||
#define GUARD_DEXNAV_H
|
||||
|
||||
#include "config/dexnav.h"
|
||||
|
||||
// GUI Info
|
||||
#define ROW_WATER 0
|
||||
#define ROW_LAND_TOP 1
|
||||
#define ROW_LAND_BOT 2
|
||||
#define ROW_HIDDEN 3
|
||||
#define ROWS_COUNT 4
|
||||
|
||||
#define ROW_WATER_ICON_X 30
|
||||
#define ROW_WATER_ICON_Y 35
|
||||
|
||||
#define ROW_LAND_ICON_X 20
|
||||
#define ROW_LAND_TOP_ICON_Y 72
|
||||
#define ROW_LAND_BOT_ICON_Y (ROW_LAND_TOP_ICON_Y + 28)
|
||||
|
||||
#define ROW_HIDDEN_ICON_X 52
|
||||
#define ROW_HIDDEN_ICON_Y 138
|
||||
|
||||
#define ENCOUNTER_TYPE_LAND 0
|
||||
#define ENCOUNTER_TYPE_WATER 1
|
||||
#define ENCOUNTER_TYPE_HIDDEN 2 //get from species
|
||||
|
||||
#define COL_WATER_COUNT 5
|
||||
#define COL_LAND_COUNT 6
|
||||
#define COL_HIDDEN_COUNT 3
|
||||
|
||||
#define COL_WATER_MAX (COL_WATER_COUNT - 1)
|
||||
#define COL_LAND_MAX (COL_LAND_COUNT - 1)
|
||||
#define COL_HIDDEN_MAX (COL_HIDDEN_COUNT - 1)
|
||||
|
||||
// SEARCH INFO
|
||||
#define SCANSTART_X 0
|
||||
#define SCANSTART_Y 0
|
||||
#define SCANSIZE_X 12
|
||||
#define SCANSIZE_Y 12
|
||||
|
||||
#define SPECIES_INFO_Y 5
|
||||
#define TYPE_ICONS_Y (SPECIES_INFO_Y + 24)
|
||||
#define SEARCH_LEVEL_Y (TYPE_ICONS_Y + 24)
|
||||
#define HA_INFO_Y (SEARCH_LEVEL_Y + 24)
|
||||
#define CHAIN_BONUS_Y (HA_INFO_Y + 24)
|
||||
|
||||
#define MON_LEVEL_NONEXISTENT 255 //if mon not in area GetEncounterLevel returns this to exit the search
|
||||
|
||||
// gui tags
|
||||
#define ICON_PAL_TAG 56000
|
||||
#define ICON_GFX_TAG 55130
|
||||
#define SELECTION_CURSOR_TAG 0x4005
|
||||
#define CAPTURED_ALL_TAG 0x4002
|
||||
|
||||
//search tags
|
||||
#define OWNED_ICON_TAG 0x4003
|
||||
#define HIDDEN_SEARCH_TAG SELECTION_CURSOR_TAG
|
||||
#define HIDDEN_MON_ICON_TAG 0x4006
|
||||
#define LIT_STAR_TILE_TAG 0x4010
|
||||
//#define SIGHT_TAG 0x5424
|
||||
#define HELD_ITEM_TAG 0xd750
|
||||
|
||||
// dexnav search variable
|
||||
#define DEXNAV_MASK_SPECIES 0x3FFF //first 14 bits
|
||||
#define DEXNAV_MASK_ENVIRONMENT 0xC000 //last two bit
|
||||
|
||||
//funcs
|
||||
void EndDexNavSearch(u8 taskId);
|
||||
void Task_OpenDexNavFromStartMenu(u8 taskId);
|
||||
bool8 TryStartDexnavSearch(void);
|
||||
void TryIncrementSpeciesSearchLevel(u16 dexNum);
|
||||
void ResetDexNavSearch(void);
|
||||
bool8 TryFindHiddenPokemon(void);
|
||||
bool8 DexNavTryMakeShinyMon(void);
|
||||
void IncrementDexNavChain(void);
|
||||
|
||||
//ewram
|
||||
extern bool8 gDexnavBattle;
|
||||
|
||||
#endif //GUARD_DEXNAV_H
|
||||
@ -305,6 +305,7 @@ u8 GetJumpMovementAction(u32);
|
||||
u8 GetJump2MovementAction(u32);
|
||||
u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
|
||||
u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
|
||||
bool8 IsElevationMismatchAt(u8, s16, s16);
|
||||
|
||||
u8 MovementType_WanderAround_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementType_WanderAround_Step1(struct ObjectEvent *, struct Sprite *);
|
||||
|
||||
@ -647,4 +647,13 @@ extern const u8 EventScript_VsSeekerChargingDone[];
|
||||
extern const u8 Common_Movement_FollowerSafeStart[];
|
||||
extern const u8 Common_Movement_FollowerSafeEnd[];
|
||||
|
||||
// Dexnav
|
||||
extern const u8 EventScript_StartDexNavBattle[];
|
||||
extern const u8 EventScript_NotFoundNearby[];
|
||||
extern const u8 EventScript_PokemonGotAway[];
|
||||
extern const u8 EventScript_LostSignal[];
|
||||
extern const u8 EventScript_TooDark[];
|
||||
extern const u8 EventScript_MovedTooFast[];
|
||||
|
||||
|
||||
#endif // GUARD_EVENT_SCRIPTS_H
|
||||
|
||||
@ -11,7 +11,7 @@ struct FieldInput
|
||||
bool8 heldDirection2:1;
|
||||
bool8 tookStep:1;
|
||||
bool8 pressedBButton:1;
|
||||
bool8 input_field_1_0:1;
|
||||
bool8 pressedRButton:1;
|
||||
bool8 input_field_1_1:1;
|
||||
bool8 input_field_1_2:1;
|
||||
bool8 input_field_1_3:1;
|
||||
|
||||
@ -48,5 +48,8 @@ void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b);
|
||||
void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId);
|
||||
u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority);
|
||||
void StartEscapeRopeFieldEffect(void);
|
||||
void FieldEffectFreeGraphicsResources(struct Sprite *sprite);
|
||||
void FieldEff_CaveDust(void);
|
||||
|
||||
|
||||
#endif // GUARD_FIELD_EFFECTS_H
|
||||
|
||||
@ -322,7 +322,8 @@ struct PlayerAvatar
|
||||
/*0x02*/ u8 runningState; // this is a static running state. 00 is not moving, 01 is turn direction, 02 is moving.
|
||||
/*0x03*/ u8 tileTransitionState; // this is a transition running state: 00 is not moving, 01 is transition between tiles, 02 means you are on the frame in which you have centered on a tile but are about to keep moving, even if changing directions. 2 is also used for a ledge hop, since you are transitioning.
|
||||
/*0x04*/ u8 spriteId;
|
||||
/*0x05*/ u8 objectEventId;
|
||||
/*0x05*/ u8 objectEventId:7;
|
||||
u8 creeping:1;
|
||||
/*0x06*/ bool8 preventStep;
|
||||
/*0x07*/ u8 gender;
|
||||
/*0x08*/ u8 acroBikeState; // 00 is normal, 01 is turning, 02 is standing wheelie, 03 is hopping wheelie
|
||||
|
||||
@ -169,7 +169,11 @@ struct UCoords32
|
||||
|
||||
struct SaveBlock3
|
||||
{
|
||||
};
|
||||
#if USE_DEXNAV_SEARCH_LEVELS == TRUE
|
||||
u8 dexNavSearchLevels[ROUND_BITS_TO_BYTES(NUM_SPECIES)];
|
||||
#endif
|
||||
u8 dexNavChain;
|
||||
}; /* max size 1624 bytes */
|
||||
|
||||
extern struct SaveBlock3 *gSaveBlock3Ptr;
|
||||
|
||||
|
||||
@ -26,6 +26,10 @@ extern u8 gSelectedMonPartyId;
|
||||
extern MainCallback gPostMenuFieldCallback;
|
||||
extern u8 gSelectedOrderFromParty[MAX_FRONTIER_PARTY_SIZE];
|
||||
extern u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2];
|
||||
extern const struct SpriteSheet sSpriteSheet_HeldItem;
|
||||
|
||||
extern const struct SpriteSheet gSpriteSheet_HeldItem;
|
||||
extern const u16 gHeldItemPalette[];
|
||||
|
||||
extern void (*gItemUseCB)(u8, TaskFunc);
|
||||
extern const struct SpriteTemplate gSpriteTemplate_StatusIcons;
|
||||
|
||||
@ -24,5 +24,6 @@ void LoadMonIconPalettePersonality(u16 species, u32 personality);
|
||||
void SpriteCB_MonIcon(struct Sprite *sprite);
|
||||
void SetPartyHPBarSprite(struct Sprite *sprite, u8 animNum);
|
||||
u8 GetMonIconPaletteIndexFromSpecies(u16 species);
|
||||
void SafeFreeMonIconPalette(u16 species);
|
||||
|
||||
#endif // GUARD_POKEMON_ICON_H
|
||||
|
||||
@ -190,6 +190,7 @@ enum RandomTag
|
||||
RNG_FICKLE_BEAM,
|
||||
RNG_AI_ABILITY,
|
||||
RNG_SHELL_SIDE_ARM,
|
||||
RNG_DEXNAV_ENCOUNTER_LEVEL,
|
||||
};
|
||||
|
||||
#define RandomWeighted(tag, ...) \
|
||||
|
||||
@ -256,6 +256,7 @@ extern const u8 gText_MenuOption[];
|
||||
extern const u8 gText_MenuExit[];
|
||||
extern const u8 gText_MenuRetire[];
|
||||
extern const u8 gText_MenuRest[];
|
||||
extern const u8 gText_MenuDexNav[];
|
||||
extern const u8 gText_Floor1[];
|
||||
extern const u8 gText_Floor2[];
|
||||
extern const u8 gText_Floor3[];
|
||||
|
||||
@ -24,4 +24,7 @@ void rbox_fill_rectangle(u8 windowId);
|
||||
const u16 *GetTextWindowPalette(u8 id);
|
||||
const u16 *GetOverworldTextboxPalettePtr(void);
|
||||
|
||||
//NEW
|
||||
void LoadDexNavWindowGfx(u8 windowId, u16 destOffset, u8 palOffset);
|
||||
|
||||
#endif // GUARD_TEXT_WINDOW_H
|
||||
|
||||
@ -23,6 +23,7 @@ struct WildPokemonHeader
|
||||
const struct WildPokemonInfo *landMonsInfo;
|
||||
const struct WildPokemonInfo *waterMonsInfo;
|
||||
const struct WildPokemonInfo *rockSmashMonsInfo;
|
||||
const struct WildPokemonInfo *hiddenMonsInfo;
|
||||
const struct WildPokemonInfo *fishingMonsInfo;
|
||||
};
|
||||
|
||||
@ -45,5 +46,11 @@ bool8 StandardWildEncounter_Debug(void);
|
||||
void ResetChainFishingDexNavStreak(void);
|
||||
bool32 IsCurrentEncounterFishing(void);
|
||||
u32 CalculateChainFishingShinyRolls(void);
|
||||
void CreateWildMon(u16 species, u8 level);
|
||||
u16 GetCurrentMapWildMonHeaderId(void);
|
||||
u8 ChooseWildMonIndex_Land(void);
|
||||
u8 ChooseWildMonIndex_WaterRock(void);
|
||||
u8 ChooseHiddenMonIndex(void);
|
||||
bool32 MapHasNoEncounterData(void);
|
||||
|
||||
#endif // GUARD_WILD_ENCOUNTER_H
|
||||
|
||||
@ -360,6 +360,7 @@ SECTIONS {
|
||||
src/international_string_util.o(.text);
|
||||
src/pokemon_sprite_visualizer.o(.text);
|
||||
src/expansion_intro.o(.text);
|
||||
src/dexnav.o(.text);
|
||||
} > ROM =0
|
||||
|
||||
script_data :
|
||||
@ -728,6 +729,7 @@ SECTIONS {
|
||||
data/sound_data.o(.rodata);
|
||||
src/pokemon_sprite_visualizer.o(.rodata);
|
||||
src/expansion_intro.o(.rodata);
|
||||
src/dexnav.o(.rodata);
|
||||
} > ROM =0
|
||||
|
||||
song_data :
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#include "data.h"
|
||||
#include "debug.h"
|
||||
#include "decompress.h"
|
||||
#include "dexnav.h"
|
||||
#include "dma3.h"
|
||||
#include "event_data.h"
|
||||
#include "evolution_scene.h"
|
||||
@ -5559,6 +5560,12 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
|
||||
{
|
||||
gIsFishingEncounter = FALSE;
|
||||
gIsSurfingEncounter = FALSE;
|
||||
if (gDexnavBattle && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
|
||||
IncrementDexNavChain();
|
||||
else
|
||||
gSaveBlock3Ptr->dexNavChain = 0;
|
||||
|
||||
gDexnavBattle = FALSE;
|
||||
ResetSpriteData();
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_RECORDED_LINK
|
||||
|
||||
@ -38,6 +38,7 @@ extern const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SlitherTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_BugTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SpotTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_CaveDust;
|
||||
|
||||
const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
|
||||
[FLDEFFOBJ_SHADOW_S] = &gFieldEffectObjectTemplate_ShadowSmall,
|
||||
@ -80,4 +81,5 @@ const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
|
||||
[FLDEFFOBJ_TRACKS_SLITHER] = &gFieldEffectObjectTemplate_SlitherTracks,
|
||||
[FLDEFFOBJ_TRACKS_SPOT] = &gFieldEffectObjectTemplate_SpotTracks,
|
||||
[FLDEFFOBJ_TRACKS_BUG] = &gFieldEffectObjectTemplate_BugTracks,
|
||||
[FLDEFFOBJ_CAVE_DUST] = &gFieldEffectObjectTemplate_CaveDust,
|
||||
};
|
||||
|
||||
@ -1336,3 +1336,23 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza = {
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalette_Unused = {gObjectEventPal_Npc3, FLDEFF_PAL_TAG_UNKNOWN};
|
||||
|
||||
// cave dust
|
||||
static const struct SpriteFrameImage sPicTable_CaveDust[] =
|
||||
{
|
||||
overworld_frame(gFieldEffectObjectPic_CaveDust, 2, 2, 0),
|
||||
overworld_frame(gFieldEffectObjectPic_CaveDust, 2, 2, 1),
|
||||
overworld_frame(gFieldEffectObjectPic_CaveDust, 2, 2, 2),
|
||||
overworld_frame(gFieldEffectObjectPic_CaveDust, 2, 2, 3),
|
||||
};
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_CaveDust = {
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = FLDEFF_PAL_TAG_CAVE_DUST,
|
||||
.oam = &gObjectEventBaseOam_16x16,
|
||||
.anims = sAnimTable_WaterSurfacing,
|
||||
.images = sPicTable_CaveDust,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = WaitFieldEffectSpriteAnim,
|
||||
};
|
||||
|
||||
const struct SpritePalette gSpritePalette_CaveDust = {gFieldEffectObjectPalette_CaveDust, FLDEFF_PAL_TAG_CAVE_DUST};
|
||||
|
||||
@ -454,3 +454,6 @@ const u16 gObjectEventPal_BeastBall[] = INCBIN_U16("graphics/object_events/pics/
|
||||
const u16 gObjectEventPal_StrangeBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_strange.gbapal");
|
||||
#endif //ITEM_STRANGE_BALL
|
||||
#endif //OW_FOLLOWERS_POKEBALLS
|
||||
|
||||
const u32 gFieldEffectObjectPic_CaveDust[] = INCBIN_U32("graphics/field_effects/pics/cave_dust.4bpp");
|
||||
const u16 gFieldEffectObjectPalette_CaveDust[] = INCBIN_U16("graphics/field_effects/palettes/cave_dust.gbapal");
|
||||
|
||||
@ -836,7 +836,7 @@ static const u8 *const sUnionRoomTradeMessages[] =
|
||||
};
|
||||
|
||||
static const u32 sHeldItemGfx[] = INCBIN_U32("graphics/party_menu/hold_icons.4bpp");
|
||||
static const u16 sHeldItemPalette[] = INCBIN_U16("graphics/party_menu/hold_icons.gbapal");
|
||||
const u16 gHeldItemPalette[] = INCBIN_U16("graphics/party_menu/hold_icons.gbapal");
|
||||
|
||||
static const struct OamData sOamData_HeldItem =
|
||||
{
|
||||
@ -873,14 +873,14 @@ static const union AnimCmd *const sSpriteAnimTable_HeldItem[] =
|
||||
sSpriteAnim_HeldMail,
|
||||
};
|
||||
|
||||
static const struct SpriteSheet sSpriteSheet_HeldItem =
|
||||
const struct SpriteSheet gSpriteSheet_HeldItem =
|
||||
{
|
||||
.data = sHeldItemGfx, .size = sizeof(sHeldItemGfx), .tag = TAG_HELD_ITEM
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalette_HeldItem =
|
||||
{
|
||||
.data = sHeldItemPalette, .tag = TAG_HELD_ITEM
|
||||
.data = gHeldItemPalette, .tag = TAG_HELD_ITEM
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_HeldItem =
|
||||
|
||||
@ -64,8 +64,19 @@ const struct WildPokemon {{ encounter.base_label }}_FishingMons[] =
|
||||
|
||||
const struct WildPokemonInfo {{ encounter.base_label }}_FishingMonsInfo = { {{encounter.fishing_mons.encounter_rate}}, {{ encounter.base_label }}_FishingMons };
|
||||
{% endif %}
|
||||
## endfor
|
||||
|
||||
{% if existsIn(encounter, "hidden_mons") %}
|
||||
const struct WildPokemon {{ encounter.base_label }}_HiddenMons[] =
|
||||
{
|
||||
## for wild_mon in encounter.hidden_mons.mons
|
||||
{ {{ wild_mon.min_level }}, {{ wild_mon.max_level }}, {{ wild_mon.species }} },
|
||||
## endfor
|
||||
};
|
||||
|
||||
const struct WildPokemonInfo {{ encounter.base_label }}_HiddenMonsInfo = { {{encounter.hidden_mons.encounter_rate}}, {{ encounter.base_label }}_HiddenMons };
|
||||
{% endif %}
|
||||
|
||||
## endfor
|
||||
const struct WildPokemonHeader {{ wild_encounter_group.label }}[] =
|
||||
{
|
||||
## for encounter in wild_encounter_group.encounters
|
||||
@ -76,6 +87,7 @@ const struct WildPokemonHeader {{ wild_encounter_group.label }}[] =
|
||||
.waterMonsInfo = {% if existsIn(encounter, "water_mons") %}&{{ encounter.base_label }}_WaterMonsInfo{% else %}NULL{% endif %},
|
||||
.rockSmashMonsInfo = {% if existsIn(encounter, "rock_smash_mons") %}&{{ encounter.base_label }}_RockSmashMonsInfo{% else %}NULL{% endif %},
|
||||
.fishingMonsInfo = {% if existsIn(encounter, "fishing_mons") %}&{{ encounter.base_label }}_FishingMonsInfo{% else %}NULL{% endif %},
|
||||
.hiddenMonsInfo = {% if existsIn(encounter, "hidden_mons") %}&{{ encounter.base_label }}_HiddenMonsInfo{% else %}NULL{% endif %},
|
||||
},
|
||||
## endfor
|
||||
{
|
||||
@ -85,6 +97,7 @@ const struct WildPokemonHeader {{ wild_encounter_group.label }}[] =
|
||||
.waterMonsInfo = NULL,
|
||||
.rockSmashMonsInfo = NULL,
|
||||
.fishingMonsInfo = NULL,
|
||||
.hiddenMonsInfo = NULL,
|
||||
},
|
||||
};
|
||||
## endfor
|
||||
|
||||
@ -33,7 +33,6 @@ static void ClearDaycareMonMail(struct DaycareMail *mail);
|
||||
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
|
||||
static void DaycarePrintMonInfo(u8 windowId, u32 daycareSlotId, u8 y);
|
||||
static u8 ModifyBreedingScoreForOvalCharm(u8 score);
|
||||
static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves);
|
||||
static u16 GetEggSpecies(u16 species);
|
||||
|
||||
// RAM buffers used to assist with BuildEggMoveset()
|
||||
@ -772,7 +771,7 @@ static void InheritAbility(struct Pokemon *egg, struct BoxPokemon *father, struc
|
||||
|
||||
// Counts the number of egg moves a Pokémon learns and stores the moves in
|
||||
// the given array.
|
||||
static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves)
|
||||
u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves)
|
||||
{
|
||||
u16 numEggMoves;
|
||||
u16 species;
|
||||
|
||||
2741
src/dexnav.c
Normal file
@ -200,7 +200,6 @@ static bool8 GetFollowerInfo(u16 *species, u8 *form, u8 *shiny);
|
||||
static u8 LoadDynamicFollowerPalette(u16 species, u8 form, bool32 shiny);
|
||||
static const struct ObjectEventGraphicsInfo *SpeciesToGraphicsInfo(u16 species, u8 form);
|
||||
static bool8 NpcTakeStep(struct Sprite *);
|
||||
static bool8 IsElevationMismatchAt(u8, s16, s16);
|
||||
static bool8 AreElevationsCompatible(u8, u8);
|
||||
static u16 PackGraphicsId(const struct ObjectEventTemplate *template);
|
||||
static void CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(u16 graphicsId, u16 movementType, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables);
|
||||
@ -9201,7 +9200,7 @@ static void SetObjectEventSpriteOamTableForLongGrass(struct ObjectEvent *objEven
|
||||
sprite->subspriteTableNum = 5;
|
||||
}
|
||||
|
||||
static bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y)
|
||||
bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y)
|
||||
{
|
||||
u8 mapElevation;
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include "coord_event_weather.h"
|
||||
#include "daycare.h"
|
||||
#include "debug.h"
|
||||
#include "dexnav.h"
|
||||
#include "faraway_island.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
@ -84,7 +85,7 @@ void FieldClearPlayerInput(struct FieldInput *input)
|
||||
input->heldDirection2 = FALSE;
|
||||
input->tookStep = FALSE;
|
||||
input->pressedBButton = FALSE;
|
||||
input->input_field_1_0 = FALSE;
|
||||
input->pressedRButton = FALSE;
|
||||
input->input_field_1_1 = FALSE;
|
||||
input->input_field_1_2 = FALSE;
|
||||
input->input_field_1_3 = FALSE;
|
||||
@ -109,6 +110,8 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
|
||||
input->pressedAButton = TRUE;
|
||||
if (newKeys & B_BUTTON)
|
||||
input->pressedBButton = TRUE;
|
||||
if (newKeys & R_BUTTON && !FlagGet(FLAG_SYS_DEXNAV_SEARCH))
|
||||
input->pressedRButton = TRUE;
|
||||
}
|
||||
|
||||
if (heldKeys & (DPAD_UP | DPAD_DOWN | DPAD_LEFT | DPAD_RIGHT))
|
||||
@ -198,8 +201,15 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
ShowStartMenu();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (input->tookStep && TryFindHiddenPokemon())
|
||||
return TRUE;
|
||||
|
||||
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
|
||||
return TRUE;
|
||||
|
||||
if (input->pressedRButton && TryStartDexnavSearch())
|
||||
return TRUE;
|
||||
|
||||
#if DEBUG_OVERWORLD_MENU == TRUE && DEBUG_OVERWORLD_IN_MENU == FALSE
|
||||
if (input->input_field_1_2)
|
||||
|
||||
@ -3926,6 +3926,22 @@ static void Task_MoveDeoxysRock(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// new
|
||||
u8 FldEff_CaveDust(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_CAVE_DUST], gFieldEffectArguments[0], gFieldEffectArguments[1], 0xFF);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
gSprites[spriteId].data[0] = 22;
|
||||
}
|
||||
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
#undef tState
|
||||
#undef tSpriteId
|
||||
#undef tTargetX
|
||||
|
||||
@ -1015,7 +1015,7 @@ void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite)
|
||||
#undef sPrevX
|
||||
#undef sPrevY
|
||||
|
||||
u32 FldEff_UnusedGrass(void)
|
||||
u32 FldEff_ShakingGrass(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
@ -1026,12 +1026,13 @@ u32 FldEff_UnusedGrass(void)
|
||||
struct Sprite *sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->sWaitFldEff = FLDEFF_UNUSED_GRASS;
|
||||
sprite->sWaitFldEff = FLDEFF_SHAKING_GRASS;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_UnusedGrass2(void)
|
||||
u32 FldEff_ShakingGrass2(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
@ -1042,9 +1043,10 @@ u32 FldEff_UnusedGrass2(void)
|
||||
struct Sprite *sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->sWaitFldEff = FLDEFF_UNUSED_GRASS_2;
|
||||
sprite->sWaitFldEff = FLDEFF_SHAKING_LONG_GRASS;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_UnusedSand(void)
|
||||
@ -1058,9 +1060,9 @@ u32 FldEff_UnusedSand(void)
|
||||
struct Sprite *sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->sWaitFldEff = FLDEFF_UNUSED_SAND;
|
||||
sprite->sWaitFldEff = FLDEFF_SAND_HOLE;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_WaterSurfacing(void)
|
||||
@ -1076,7 +1078,8 @@ u32 FldEff_WaterSurfacing(void)
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->sWaitFldEff = FLDEFF_WATER_SURFACING;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
// Sprite data for FLDEFF_ASH
|
||||
@ -1474,7 +1477,7 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
|
||||
UpdateSpritePaletteByTemplate(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], sprite);
|
||||
sprite->sWaitFldEff = FLDEFF_BERRY_TREE_GROWTH_SPARKLE;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
// Sprite data for FLDEFF_TREE_DISGUISE / FLDEFF_MOUNTAIN_DISGUISE / FLDEFF_SAND_DISGUISE
|
||||
@ -1602,7 +1605,7 @@ u32 FldEff_Sparkle(void)
|
||||
gSprites[spriteId].oam.priority = gFieldEffectArguments[2];
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
void UpdateSparkleFieldEffect(struct Sprite *sprite)
|
||||
@ -1866,27 +1869,3 @@ static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 elevatio
|
||||
}
|
||||
}
|
||||
|
||||
// Unused, duplicates of data in event_object_movement.c
|
||||
static const s8 sFigure8XOffsets[FIGURE_8_LENGTH] = {
|
||||
1, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 1, 2, 2, 1, 2,
|
||||
2, 1, 2, 2, 1, 2, 1, 1,
|
||||
2, 1, 1, 2, 1, 1, 2, 1,
|
||||
1, 2, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 1, 1, 1, 0, 1, 1, 0,
|
||||
1, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
static const s8 sFigure8YOffsets[FIGURE_8_LENGTH] = {
|
||||
0, 0, 1, 0, 0, 1, 0, 0,
|
||||
1, 0, 1, 1, 0, 1, 1, 0,
|
||||
1, 1, 0, 1, 1, 0, 1, 1,
|
||||
0, 0, 1, 0, 0, 1, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -1, 0, 0, -1, 0, 0,
|
||||
-1, 0, -1, -1, 0, -1, -1, 0,
|
||||
-1, -1, -1, -1, -1, -1, -1, -2,
|
||||
};
|
||||
|
||||
@ -155,6 +155,9 @@ static bool32 IsMetatileBlocking(s16, s16, u32);
|
||||
static bool32 IsMetatileLand(s16, s16, u32);
|
||||
|
||||
static u8 TrySpinPlayerForWarp(struct ObjectEvent *, s16 *);
|
||||
static void PlayerGoSlow(u8 direction);
|
||||
|
||||
// .rodata
|
||||
|
||||
static bool8 (*const sForcedMovementTestFuncs[NUM_FORCED_MOVEMENTS])(u8) =
|
||||
{
|
||||
@ -642,11 +645,20 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gPlayerAvatar.creeping = FALSE;
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
|
||||
{
|
||||
// same speed as running
|
||||
PlayerWalkFast(direction);
|
||||
if (FlagGet(FLAG_SYS_DEXNAV_SEARCH) && (heldKeys & A_BUTTON))
|
||||
{
|
||||
gPlayerAvatar.creeping = TRUE;
|
||||
PlayerGoSlow(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
// speed 2 is fast, same speed as running
|
||||
PlayerWalkFast(direction);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -657,6 +669,11 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
|
||||
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH;
|
||||
return;
|
||||
}
|
||||
else if (FlagGet(FLAG_SYS_DEXNAV_SEARCH) && (heldKeys & A_BUTTON))
|
||||
{
|
||||
gPlayerAvatar.creeping = TRUE;
|
||||
PlayerGoSlow(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerWalkNormal(direction);
|
||||
@ -967,6 +984,12 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement)
|
||||
}
|
||||
}
|
||||
|
||||
// slow
|
||||
static void PlayerGoSlow(u8 direction)
|
||||
{
|
||||
PlayerSetAnimId(GetWalkSlowMovementAction(direction), 2);
|
||||
}
|
||||
|
||||
void PlayerWalkNormal(u8 direction)
|
||||
{
|
||||
PlayerSetAnimId(GetWalkNormalMovementAction(direction), COPY_MOVE_WALK);
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
#include "berry_powder.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "union_room_chat.h"
|
||||
#include "constants/map_groups.h"
|
||||
#include "constants/items.h"
|
||||
|
||||
extern const u8 EventScript_ResetAllMapFlags[];
|
||||
@ -204,6 +205,10 @@ void NewGameInitData(void)
|
||||
WipeTrainerNameRecords();
|
||||
ResetTrainerHillResults();
|
||||
ResetContestLinkResults();
|
||||
#if USE_DEXNAV_SEARCH_LEVELS == TRUE
|
||||
memset(gSaveBlock3Ptr->dexNavSearchLevels, 0, sizeof(gSaveBlock3Ptr->dexNavSearchLevels));
|
||||
#endif
|
||||
gSaveBlock3Ptr->dexNavChain = 0;
|
||||
}
|
||||
|
||||
static void ResetMiniGamesRecords(void)
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include "bg.h"
|
||||
#include "cable_club.h"
|
||||
#include "clock.h"
|
||||
#include "dexnav.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "event_scripts.h"
|
||||
@ -823,6 +824,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
LoadObjEventTemplatesFromHeader();
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetDexNavSearch();
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
#if FREE_MATCH_CALL == FALSE
|
||||
@ -887,6 +889,7 @@ static void LoadMapFromWarp(bool32 a1)
|
||||
CheckLeftFriendsSecretBase();
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetDexNavSearch();
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
#if FREE_MATCH_CALL == FALSE
|
||||
|
||||
@ -4256,7 +4256,7 @@ static void ShowOrHideHeldItemSprite(u16 item, struct PartyMenuBox *menuBox)
|
||||
|
||||
void LoadHeldItemIcons(void)
|
||||
{
|
||||
LoadSpriteSheet(&sSpriteSheet_HeldItem);
|
||||
LoadSpriteSheet(&gSpriteSheet_HeldItem);
|
||||
LoadSpritePalette(&sSpritePalette_HeldItem);
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "data.h"
|
||||
#include "dexnav.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "evolution_scene.h"
|
||||
@ -1143,6 +1144,10 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
||||
{
|
||||
isShiny = TRUE;
|
||||
}
|
||||
else if (gDexnavBattle)
|
||||
{
|
||||
isShiny = DexNavTryMakeShinyMon();
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 totalRerolls = 0;
|
||||
|
||||
@ -44,6 +44,8 @@
|
||||
#include "trainer_card.h"
|
||||
#include "window.h"
|
||||
#include "union_room.h"
|
||||
#include "dexnav.h"
|
||||
#include "wild_encounter.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/songs.h"
|
||||
@ -65,6 +67,7 @@ enum
|
||||
MENU_ACTION_RETIRE_FRONTIER,
|
||||
MENU_ACTION_PYRAMID_BAG,
|
||||
MENU_ACTION_DEBUG,
|
||||
MENU_ACTION_DEXNAV
|
||||
};
|
||||
|
||||
// Save status
|
||||
@ -106,6 +109,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void);
|
||||
static bool8 StartMenuBattlePyramidRetireCallback(void);
|
||||
static bool8 StartMenuBattlePyramidBagCallback(void);
|
||||
static bool8 StartMenuDebugCallback(void);
|
||||
static bool8 StartMenuDexNavCallback(void);
|
||||
|
||||
// Menu callbacks
|
||||
static bool8 SaveStartCallback(void);
|
||||
@ -200,6 +204,7 @@ static const struct MenuAction sStartMenuItems[] =
|
||||
[MENU_ACTION_RETIRE_FRONTIER] = {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}},
|
||||
[MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}},
|
||||
[MENU_ACTION_DEBUG] = {sText_MenuDebug, {.u8_void = StartMenuDebugCallback}},
|
||||
[MENU_ACTION_DEXNAV] = {gText_MenuDexNav, {.u8_void = StartMenuDexNavCallback}},
|
||||
};
|
||||
|
||||
static const struct BgTemplate sBgTemplates_LinkBattleSave[] =
|
||||
@ -324,22 +329,20 @@ static void AddStartMenuAction(u8 action)
|
||||
}
|
||||
|
||||
static void BuildNormalStartMenu(void)
|
||||
{
|
||||
{
|
||||
if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEDEX);
|
||||
}
|
||||
|
||||
if (FlagGet(FLAG_SYS_DEXNAV_GET))
|
||||
AddStartMenuAction(MENU_ACTION_DEXNAV);
|
||||
|
||||
if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
}
|
||||
|
||||
AddStartMenuAction(MENU_ACTION_BAG);
|
||||
|
||||
if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_POKENAV);
|
||||
}
|
||||
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_SAVE);
|
||||
@ -638,7 +641,10 @@ static bool8 HandleStartMenuInput(void)
|
||||
if (GetNationalPokedexCount(FLAG_GET_SEEN) == 0)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sCurrentStartMenuActions[sStartMenuCursorPos] == MENU_ACTION_DEXNAV
|
||||
&& MapHasNoEncounterData())
|
||||
return FALSE;
|
||||
|
||||
gMenuCallback = sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void;
|
||||
|
||||
if (gMenuCallback != StartMenuSaveCallback
|
||||
@ -663,7 +669,7 @@ static bool8 HandleStartMenuInput(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 StartMenuPokedexCallback(void)
|
||||
bool8 StartMenuPokedexCallback(void)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@ -1484,3 +1490,9 @@ void AppendToList(u8 *list, u8 *pos, u8 newEntry)
|
||||
list[*pos] = newEntry;
|
||||
(*pos)++;
|
||||
}
|
||||
|
||||
static bool8 StartMenuDexNavCallback(void)
|
||||
{
|
||||
CreateTask(Task_OpenDexNavFromStartMenu, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1534,6 +1534,7 @@ const u8 gText_MenuOption[] = _("OPTION");
|
||||
const u8 gText_MenuExit[] = _("EXIT");
|
||||
const u8 gText_MenuRetire[] = _("RETIRE");
|
||||
const u8 gText_MenuRest[] = _("REST");
|
||||
const u8 gText_MenuDexNav[] = _("DEXNAV");
|
||||
const u8 gText_SafariBallStock[] = _("SAFARI BALLS\nStock: {STR_VAR_1}");
|
||||
const u8 gText_BattlePyramidFloor[] = _("Battle Pyramid\n{STR_VAR_1}");
|
||||
const u8 gText_Floor1[] = _("Floor 1");
|
||||
|
||||
@ -81,6 +81,9 @@ static const struct TilesPal sWindowFrames[WINDOW_FRAMES_COUNT] =
|
||||
{sTextWindowFrame20_Gfx, sTextWindowFrame20_Pal}
|
||||
};
|
||||
|
||||
static const u16 sTextWindowDexnavFrame[] = INCBIN_U16("graphics/text_window/dexnav_pal.gbapal");
|
||||
static const struct TilesPal sDexnavWindowFrame = {gTextWindowFrame1_Gfx, sTextWindowDexnavFrame};
|
||||
|
||||
// code
|
||||
const struct TilesPal *GetWindowFrameTilesPal(u8 id)
|
||||
{
|
||||
@ -195,3 +198,10 @@ void LoadUserWindowBorderGfxOnBg(u8 bg, u16 destOffset, u8 palOffset)
|
||||
LoadBgTiles(bg, sWindowFrames[gSaveBlock2Ptr->optionsWindowFrameType].tiles, 0x120, destOffset);
|
||||
LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->pal, palOffset, PLTT_SIZE_4BPP);
|
||||
}
|
||||
|
||||
void LoadDexNavWindowGfx(u8 windowId, u16 destOffset, u8 palOffset)
|
||||
{
|
||||
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), sDexnavWindowFrame.tiles, 0x120, destOffset);
|
||||
LoadPalette(sDexnavWindowFrame.pal, palOffset, 32);
|
||||
}
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ static void FeebasSeedRng(u16 seed)
|
||||
}
|
||||
|
||||
// LAND_WILD_COUNT
|
||||
static u8 ChooseWildMonIndex_Land(void)
|
||||
u8 ChooseWildMonIndex_Land(void)
|
||||
{
|
||||
u8 wildMonIndex = 0;
|
||||
bool8 swap = FALSE;
|
||||
@ -236,7 +236,7 @@ static u8 ChooseWildMonIndex_Land(void)
|
||||
}
|
||||
|
||||
// ROCK_WILD_COUNT / WATER_WILD_COUNT
|
||||
static u8 ChooseWildMonIndex_WaterRock(void)
|
||||
u8 ChooseWildMonIndex_WaterRock(void)
|
||||
{
|
||||
u8 wildMonIndex = 0;
|
||||
bool8 swap = FALSE;
|
||||
@ -363,7 +363,7 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon, u8 wildMonIn
|
||||
}
|
||||
}
|
||||
|
||||
static u16 GetCurrentMapWildMonHeaderId(void)
|
||||
u16 GetCurrentMapWildMonHeaderId(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
@ -426,7 +426,7 @@ u8 PickWildMonNature(void)
|
||||
return Random() % NUM_NATURES;
|
||||
}
|
||||
|
||||
static void CreateWildMon(u16 species, u8 level)
|
||||
void CreateWildMon(u16 species, u8 level)
|
||||
{
|
||||
bool32 checkCuteCharm = TRUE;
|
||||
|
||||
@ -1204,3 +1204,24 @@ bool8 StandardWildEncounter_Debug(void)
|
||||
DoStandardWildBattle_Debug();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 ChooseHiddenMonIndex(void)
|
||||
{
|
||||
#ifdef ENCOUNTER_CHANCE_HIDDEN_MONS_TOTAL
|
||||
u8 rand = Random() % ENCOUNTER_CHANCE_HIDDEN_MONS_TOTAL;
|
||||
|
||||
if (rand < ENCOUNTER_CHANCE_HIDDEN_MONS_SLOT_0)
|
||||
return 0;
|
||||
else if (rand >= ENCOUNTER_CHANCE_HIDDEN_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_HIDDEN_MONS_SLOT_1)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
#else
|
||||
return 0xFF;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool32 MapHasNoEncounterData(void)
|
||||
{
|
||||
return (GetCurrentMapWildMonHeaderId() == HEADER_NONE);
|
||||
}
|
||||
|
||||
@ -152,3 +152,4 @@
|
||||
.include "src/debug.o"
|
||||
.include "src/battle_controller_player.o"
|
||||
.include "src/pokedex_plus_hgss.o"
|
||||
.include "src/dexnav.o"
|
||||
|
||||