Adds Dexnav (#4818)
@ -1151,3 +1151,4 @@ EventScript_VsSeekerChargingDone::
|
||||
.include "data/scripts/follower.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 SE_PIN
|
||||
applymovement OBJ_EVENT_ID_PLAYER Common_Movement_ExclamationMark
|
||||
waitmovement 0
|
||||
waitse
|
||||
dowildbattle
|
||||
release
|
||||
end
|
||||
|
||||
EventScript_NotFoundNearby::
|
||||
msgbox sText_NotFoundNearby, MSGBOX_SIGN
|
||||
end
|
||||
|
||||
EventScript_MovedTooFast::
|
||||
msgbox sText_TryMovingSlower, MSGBOX_SIGN
|
||||
end
|
||||
|
||||
EventScript_PokemonGotAway::
|
||||
msgbox sText_PokemonGotAway, MSGBOX_SIGN
|
||||
end
|
||||
|
||||
EventScript_LostSignal::
|
||||
msgbox sText_LostSignal, MSGBOX_SIGN
|
||||
end
|
||||
|
||||
EventScript_TooDark::
|
||||
msgbox sText_TooDark, MSGBOX_SIGN
|
||||
end
|
||||
|
||||
sText_NotFoundNearby:
|
||||
.string "It couldn't be found nearby.\n"
|
||||
.string "Try looking in a different area!$"
|
||||
|
||||
sText_TryMovingSlower:
|
||||
.string "The Pokémon got away!\n"
|
||||
.string "Try moving more slowly.$"
|
||||
|
||||
sText_PokemonGotAway:
|
||||
.string "The Pokémon got away!$"
|
||||
|
||||
sText_LostSignal:
|
||||
.string "There is no reaction.\n"
|
||||
.string "The signal was lost!$"
|
||||
|
||||
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
|
||||
72
include/config/dexnav.h
Normal file
@ -0,0 +1,72 @@
|
||||
#ifndef GUARD_CONFIG_DEXNAV_H
|
||||
#define GUARD_CONFIG_DEXNAV_H
|
||||
|
||||
#define DEXNAV_ENABLED FALSE // Whether or not DexNav is enabled. If TRUE, flags/vars below must all be non-zero
|
||||
#define USE_DEXNAV_SEARCH_LEVELS FALSE /* WARNING: POSSIBLY EXCEEDS SAVEBLOCK SPACE! REQUIRES 1 BYTE PER SPECIES */
|
||||
|
||||
// Flag/var defines
|
||||
#define FLAG_SYS_DEXNAV_SEARCH 0 // Searching for mon
|
||||
#define FLAG_SYS_DEXNAV_GET 0 // DexNav shows in start menu
|
||||
#define FLAG_SYS_DETECTOR_MODE 0 // Allow player to find hidden mons
|
||||
#define VAR_DEXNAV_SPECIES 0 // Registered DexNav species
|
||||
#define VAR_DEXNAV_STEP_COUNTER 0 // Steps for finding hidden pokemon
|
||||
|
||||
// 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 chain value
|
||||
|
||||
// hidden pokemon options - an approximation of values to due to lack of available data
|
||||
#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://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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "config/caps.h"
|
||||
#include "config/pokemon.h"
|
||||
#include "config/overworld.h"
|
||||
#include "config/dexnav.h"
|
||||
|
||||
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
|
||||
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.
|
||||
|
||||
@ -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
|
||||
|
||||
77
include/dexnav.h
Normal file
@ -0,0 +1,77 @@
|
||||
#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 HELD_ITEM_TAG 0xd750
|
||||
|
||||
// DexNav search variable
|
||||
#define DEXNAV_MASK_SPECIES 0x3FFF // First 14 bits
|
||||
#define DEXNAV_MASK_ENVIRONMENT 0xC000 // Last two bit
|
||||
|
||||
void EndDexNavSearch(u8 taskId);
|
||||
void Task_OpenDexNavFromStartMenu(u8 taskId);
|
||||
bool8 TryStartDexNavSearch(void);
|
||||
void TryIncrementSpeciesSearchLevel(u16 dexNum);
|
||||
void ResetDexNavSearch(void);
|
||||
bool8 TryFindHiddenPokemon(void);
|
||||
u32 CalculateDexNavShinyRolls(void);
|
||||
void IncrementDexNavChain(void);
|
||||
|
||||
extern bool8 gDexNavBattle;
|
||||
|
||||
#endif // GUARD_DEXNAV_H
|
||||
@ -316,6 +316,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 *);
|
||||
|
||||
@ -653,5 +653,13 @@ extern const u8 Common_Movement_FollowerSafeEnd[];
|
||||
extern const u8 EventScript_CancelMessageBox[];
|
||||
extern const u8 Common_EventScript_ShowPokemonCenterSign[];
|
||||
extern const u8 Common_EventScript_ShowPokemartSign[];
|
||||
// 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,7 @@ 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
|
||||
|
||||
@ -323,7 +323,8 @@ struct PlayerAvatar
|
||||
{
|
||||
/*0x00*/ u8 flags;
|
||||
/*0x01*/ u8 transitionFlags; // used to be named bike, but its definitely not that. seems to be some transition flags
|
||||
/*0x02*/ u8 runningState; // this is a static running state. 00 is not moving, 01 is turn direction, 02 is moving.
|
||||
/*0x02*/ u8 runningState:7; // this is a static running state. 00 is not moving, 01 is turn direction, 02 is moving.
|
||||
u8 creeping:1;
|
||||
/*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;
|
||||
|
||||
@ -211,7 +211,11 @@ struct SaveBlock3
|
||||
#if OW_SHOW_ITEM_DESCRIPTIONS == OW_ITEM_DESCRIPTIONS_FIRST_TIME
|
||||
u8 itemFlags[ITEM_FLAGS_COUNT];
|
||||
#endif
|
||||
};
|
||||
#if USE_DEXNAV_SEARCH_LEVELS == TRUE
|
||||
u8 dexNavSearchLevels[NUM_SPECIES];
|
||||
#endif
|
||||
u8 dexNavChain;
|
||||
}; /* max size 1624 bytes */
|
||||
|
||||
extern struct SaveBlock3 *gSaveBlock3Ptr;
|
||||
|
||||
|
||||
@ -27,6 +27,9 @@ extern MainCallback gPostMenuFieldCallback;
|
||||
extern u8 gSelectedOrderFromParty[MAX_FRONTIER_PARTY_SIZE];
|
||||
extern u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2];
|
||||
|
||||
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
|
||||
|
||||
@ -176,6 +176,7 @@ enum RandomTag
|
||||
RNG_RANDOM_TARGET,
|
||||
RNG_AI_PREDICT_ABILITY,
|
||||
RNG_HEALER,
|
||||
RNG_DEXNAV_ENCOUNTER_LEVEL,
|
||||
};
|
||||
|
||||
#define RandomWeighted(tag, ...) \
|
||||
|
||||
@ -209,6 +209,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[];
|
||||
|
||||
@ -25,5 +25,6 @@ void rbox_fill_rectangle(u8 windowId);
|
||||
const u16 *GetTextWindowPalette(u8 id);
|
||||
const u16 *GetOverworldTextboxPalettePtr(void);
|
||||
void LoadSignPostWindowFrameGfx(void);
|
||||
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;
|
||||
};
|
||||
|
||||
@ -43,5 +44,11 @@ bool8 UpdateRepelCounter(void);
|
||||
bool8 TryDoDoubleWildBattle(void);
|
||||
bool8 StandardWildEncounter_Debug(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
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include "data.h"
|
||||
#include "debug.h"
|
||||
#include "decompress.h"
|
||||
#include "dexnav.h"
|
||||
#include "dma3.h"
|
||||
#include "event_data.h"
|
||||
#include "evolution_scene.h"
|
||||
@ -5688,6 +5689,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");
|
||||
|
||||
@ -838,7 +838,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 =
|
||||
{
|
||||
@ -875,14 +875,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()
|
||||
@ -751,7 +750,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;
|
||||
|
||||
2688
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 void CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(u16 graphicsId, u16 movementType, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables);
|
||||
|
||||
@ -9580,7 +9579,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"
|
||||
@ -91,7 +92,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;
|
||||
@ -116,6 +117,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))
|
||||
@ -222,8 +225,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(input->input_field_1_2 && DEBUG_OVERWORLD_MENU && !DEBUG_OVERWORLD_IN_MENU)
|
||||
{
|
||||
|
||||
@ -3932,6 +3932,21 @@ static void Task_MoveDeoxysRock(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
@ -665,11 +665,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;
|
||||
PlayerWalkSlow(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
// speed 2 is fast, same speed as running
|
||||
PlayerWalkFast(direction);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -684,6 +693,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;
|
||||
PlayerWalkSlow(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction))
|
||||
|
||||
@ -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[];
|
||||
@ -52,6 +53,7 @@ static void ClearFrontierRecord(void);
|
||||
static void WarpToTruck(void);
|
||||
static void ResetMiniGamesRecords(void);
|
||||
static void ResetItemFlags(void);
|
||||
static void ResetDexNav(void);
|
||||
|
||||
EWRAM_DATA bool8 gDifferentSaveFile = FALSE;
|
||||
EWRAM_DATA bool8 gEnableContestDebugging = FALSE;
|
||||
@ -206,6 +208,7 @@ void NewGameInitData(void)
|
||||
ResetTrainerHillResults();
|
||||
ResetContestLinkResults();
|
||||
ResetItemFlags();
|
||||
ResetDexNav();
|
||||
}
|
||||
|
||||
static void ResetMiniGamesRecords(void)
|
||||
@ -222,3 +225,11 @@ static void ResetItemFlags(void)
|
||||
memset(&gSaveBlock3Ptr->itemFlags, 0, sizeof(gSaveBlock3Ptr->itemFlags));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ResetDexNav(void)
|
||||
{
|
||||
#if USE_DEXNAV_SEARCH_LEVELS == TRUE
|
||||
memset(gSaveBlock3Ptr->dexNavSearchLevels, 0, sizeof(gSaveBlock3Ptr->dexNavSearchLevels));
|
||||
#endif
|
||||
gSaveBlock3Ptr->dexNavChain = 0;
|
||||
}
|
||||
|
||||
@ -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"
|
||||
@ -838,6 +839,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
LoadObjEventTemplatesFromHeader();
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetDexNavSearch();
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
#if FREE_MATCH_CALL == FALSE
|
||||
@ -902,6 +904,7 @@ static void LoadMapFromWarp(bool32 a1)
|
||||
CheckLeftFriendsSecretBase();
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetDexNavSearch();
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
#if FREE_MATCH_CALL == FALSE
|
||||
|
||||
@ -4259,7 +4259,7 @@ static void ShowOrHideHeldItemSprite(u16 item, struct PartyMenuBox *menuBox)
|
||||
|
||||
void LoadHeldItemIcons(void)
|
||||
{
|
||||
LoadSpriteSheet(&sSpriteSheet_HeldItem);
|
||||
LoadSpriteSheet(&gSpriteSheet_HeldItem);
|
||||
LoadSpritePalette(&sSpritePalette_HeldItem);
|
||||
}
|
||||
|
||||
|
||||
@ -12,6 +12,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"
|
||||
@ -1162,6 +1163,8 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
||||
totalRerolls += 1;
|
||||
if (I_FISHING_CHAIN && gIsFishingEncounter)
|
||||
totalRerolls += CalculateChainFishingShinyRolls();
|
||||
if (gDexNavBattle)
|
||||
totalRerolls += CalculateDexNavShinyRolls();
|
||||
|
||||
while (GET_SHINY_VALUE(value, personality) >= SHINY_ODDS && 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 (FLAG_SYS_DEXNAV_GET != 0 && 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)
|
||||
{
|
||||
@ -1485,3 +1491,9 @@ void AppendToList(u8 *list, u8 *pos, u8 newEntry)
|
||||
list[*pos] = newEntry;
|
||||
(*pos)++;
|
||||
}
|
||||
|
||||
static bool8 StartMenuDexNavCallback(void)
|
||||
{
|
||||
CreateTask(Task_OpenDexNavFromStartMenu, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1023,6 +1023,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");
|
||||
|
||||
@ -82,6 +82,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)
|
||||
{
|
||||
@ -202,3 +205,9 @@ 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);
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ static void FeebasSeedRng(u16 seed)
|
||||
}
|
||||
|
||||
// LAND_WILD_COUNT
|
||||
static u8 ChooseWildMonIndex_Land(void)
|
||||
u8 ChooseWildMonIndex_Land(void)
|
||||
{
|
||||
u8 wildMonIndex = 0;
|
||||
bool8 swap = FALSE;
|
||||
@ -227,7 +227,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;
|
||||
@ -354,7 +354,7 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon, u8 wildMonIn
|
||||
}
|
||||
}
|
||||
|
||||
static u16 GetCurrentMapWildMonHeaderId(void)
|
||||
u16 GetCurrentMapWildMonHeaderId(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
@ -417,7 +417,7 @@ u8 PickWildMonNature(void)
|
||||
return Random() % NUM_NATURES;
|
||||
}
|
||||
|
||||
static void CreateWildMon(u16 species, u8 level)
|
||||
void CreateWildMon(u16 species, u8 level)
|
||||
{
|
||||
bool32 checkCuteCharm = TRUE;
|
||||
|
||||
@ -1134,3 +1134,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);
|
||||
}
|
||||
|
||||