Merge pull request #70 from cawtds/add-dexnav
ported dexnav from e-expansion
|
|
@ -1368,3 +1368,4 @@ Text_TestMsg::
|
|||
.include "data/text/new_game_intro.inc"
|
||||
.include "data/text/pokedude.inc"
|
||||
.include "data/scripts/follower.inc"
|
||||
.include "data/scripts/dexnav.inc"
|
||||
|
|
|
|||
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
|
||||
|
|
@ -33,7 +33,7 @@ NAMINGGFXDIR := graphics/naming_screen
|
|||
WALLPAPERGFXDIR := graphics/pokemon_storage/wallpapers
|
||||
JPCONTESTGFXDIR := graphics/contest/japanese
|
||||
|
||||
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
|
||||
types := none normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
|
||||
contest_types := cool beauty cute smart tough
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ u16 GetBgAttribute(u8 bg, u8 attributeId);
|
|||
u32 ChangeBgX(u8 bg, u32 value, u8 op);
|
||||
u32 GetBgX(u8 bg);
|
||||
u32 ChangeBgY(u8 bg, u32 value, u8 op);
|
||||
u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op);
|
||||
s32 ChangeBgY_ScreenOff(u32 bg, s32 value, u8 op);
|
||||
u32 GetBgY(u8 bg);
|
||||
void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle);
|
||||
u8 AdjustBgMosaic(u8 value, u8 mode);
|
||||
|
|
|
|||
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 DN_FLAG_SEARCHING 0 // Searching for mon
|
||||
#define DN_FLAG_DEXNAV_GET 0 // DexNav shows in start menu
|
||||
#define DN_FLAG_DETECTOR_MODE 0 // Allow player to find hidden mons
|
||||
#define DN_VAR_SPECIES 0 // Registered DexNav species
|
||||
#define DN_VAR_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
|
||||
|
|
@ -24,9 +24,9 @@ enum FieldEffect
|
|||
FLDEFF_JUMP_SMALL_SPLASH,
|
||||
FLDEFF_LONG_GRASS,
|
||||
FLDEFF_JUMP_LONG_GRASS,
|
||||
FLDEFF_UNUSED_GRASS,
|
||||
FLDEFF_UNUSED_GRASS_2,
|
||||
FLDEFF_UNUSED_SAND,
|
||||
FLDEFF_SHAKING_GRASS,
|
||||
FLDEFF_SHAKING_LONG_GRASS,
|
||||
FLDEFF_SAND_HOLE,
|
||||
FLDEFF_UNUSED_WATER_SURFACING,
|
||||
FLDEFF_BERRY_TREE_GROWTH_SPARKLE,
|
||||
FLDEFF_DEEP_SAND_FOOTPRINTS,
|
||||
|
|
@ -84,6 +84,7 @@ enum FieldEffect
|
|||
FLDEFF_SNOW_TRACKS_SLITHER,
|
||||
FLDEFF_SNOW_TRACKS_SPOT,
|
||||
FLDEFF_SNOW_TRACKS_BUG,
|
||||
FLDEFF_CAVE_DUST,
|
||||
FLDEFF_COUNT,
|
||||
};
|
||||
|
||||
|
|
@ -95,5 +96,6 @@ enum FieldEffect
|
|||
#define FLDEFF_PAL_TAG_POKEBALL_TRAIL 0x1009
|
||||
#define FLDEFF_PAL_TAG_ASH 0x100D
|
||||
#define FLDEFF_PAL_TAG_SMALL_SPARKLE 0x100F
|
||||
#define FLDEFF_PAL_TAG_CAVE_DUST 0x1012
|
||||
|
||||
#endif // GUARD_CONSTANTS_FIELD_EFFECTS_H
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@
|
|||
#define GAME_STAT_ENTERED_HOT_SPRINGS 49
|
||||
#define GAME_STAT_NUM_UNION_ROOM_BATTLES 50
|
||||
#define GAME_STAT_BERRY_CRUSH_POINTS 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/item.h"
|
||||
#include "config/pokemon.h"
|
||||
#include "config/overworld.h"
|
||||
#include "config/dexnav.h"
|
||||
#include "config/ai.h"
|
||||
|
||||
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
|
||||
|
|
|
|||
|
|
@ -33,5 +33,6 @@ bool8 ShouldEggHatch(void);
|
|||
u8 GetEggCyclesToSubtract(void);
|
||||
u8 GetEggMovesBySpecies(u16 species, u16 *eggMoves);
|
||||
void StorePokemonInDaycare(struct Pokemon *mon, struct DaycareMon *daycareMon);
|
||||
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(void);
|
||||
void ResetDexNavSearch(void);
|
||||
bool8 TryFindHiddenPokemon(void);
|
||||
u32 CalculateDexNavShinyRolls(void);
|
||||
void IncrementDexNavChain(void);
|
||||
|
||||
extern u16 gDexNavSpecies;
|
||||
|
||||
#endif // GUARD_DEXNAV_H
|
||||
|
|
@ -223,6 +223,7 @@ u8 GetJumpSpecialMovementAction(u32 direction);
|
|||
void EnableObjectGroundEffectsByXY(s16 x, s16 y);
|
||||
void MoveObjectEventToMapCoords(struct ObjectEvent *objectEvent, s16 x, s16 y);
|
||||
u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
|
||||
bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y);
|
||||
u16 GetObjectPaletteTag(u8 paletteIndex);
|
||||
void SetSpritePosToMapCoords(s16 x, s16 y, s16 *x2, s16 *y2);
|
||||
void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible);
|
||||
|
|
|
|||
|
|
@ -1299,4 +1299,12 @@ extern const u8 TradeCenter_EventScript_Chair1[];
|
|||
extern const u8 TradeCenter_ConfirmLeaveRoom[];
|
||||
extern const u8 TradeCenter_TerminateLink[];
|
||||
|
||||
// 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
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ extern const struct SpritePalette gSpritePalette_GeneralFieldEffect1Winter;
|
|||
extern const struct SpritePalette gSpritePalette_GeneralFieldEffect2;
|
||||
extern const struct SpritePalette gSpritePalette_Ash;
|
||||
extern const struct SpritePalette gSpritePalette_SmallSparkle;
|
||||
extern const struct SpritePalette gSpritePalette_CaveDust;
|
||||
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium;
|
||||
|
|
@ -59,6 +60,7 @@ extern const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle;
|
|||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SlitherTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_BugTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SpotTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_CaveDust;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SnowFootprints;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SnowBikeTireTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SnowSlitherTracks;
|
||||
|
|
@ -70,6 +72,8 @@ bool8 FieldEffectActiveListContains(enum FieldEffect fldeff);
|
|||
void CreateTeleportFieldEffectTask(void);
|
||||
void FieldEffectActiveListRemove(enum FieldEffect fldeff);
|
||||
void StartEscapeRopeFieldEffect(void);
|
||||
void FieldEffectFreeGraphicsResources(struct Sprite *sprite);
|
||||
void FieldEff_CaveDust(void);
|
||||
void FieldEffectStop(struct Sprite *sprite, enum FieldEffect fldeff);
|
||||
u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buffer);
|
||||
void FieldCB_FallWarpExit(void);
|
||||
|
|
@ -108,8 +112,8 @@ u32 FldEff_Splash(void);
|
|||
u32 FldEff_JumpSmallSplash(void);
|
||||
u32 FldEff_LongGrass(void);
|
||||
u32 FldEff_JumpLongGrass(void);
|
||||
u32 FldEff_UnusedGrass(void);
|
||||
u32 FldEff_UnusedGrass2(void);
|
||||
u32 FldEff_ShakingGrass(void);
|
||||
u32 FldEff_ShakingGrass2(void);
|
||||
u32 FldEff_UnusedSand(void);
|
||||
u32 FldEff_UnusedWaterSurfacing(void);
|
||||
u32 FldEff_BerryTreeGrowthSparkle(void);
|
||||
|
|
@ -158,5 +162,6 @@ u32 FldEff_SnowTracksSlither(void);
|
|||
u32 FldEff_SnowTracksSlither(void);
|
||||
u32 FldEff_SnowTracksBug(void);
|
||||
u32 FldEff_SnowTracksSpot(void);
|
||||
u32 FldEff_CaveDust(void);
|
||||
|
||||
#endif //GUARD_FIELD_EFFECTS_H
|
||||
|
|
|
|||
|
|
@ -376,7 +376,8 @@ struct PlayerAvatar
|
|||
{
|
||||
/*0x00*/ u8 flags;
|
||||
/*0x01*/ u8 transitionFlags; // used to be bike, but it's not that in Emerald and probably isn't here either. maybe 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;
|
||||
|
|
|
|||
|
|
@ -225,6 +225,10 @@ 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;
|
||||
};
|
||||
|
||||
extern struct SaveBlock3 *gSaveBlock3Ptr;
|
||||
|
|
|
|||
|
|
@ -4913,6 +4913,8 @@ extern const u16 gFogPalette[];
|
|||
extern const u32 gPartyMenuPokeball_Gfx[];
|
||||
extern const u32 gPartyMenuPokeball_Pal[];
|
||||
extern const u32 gPartyMenuPokeballSmall_Gfx[];
|
||||
extern const u32 gMoveTypes_Gfx[];
|
||||
extern const u32 gMoveTypes_Pal[];
|
||||
extern const u32 gStatusGfx_Icons[];
|
||||
extern const u32 gStatusPal_Icons[];
|
||||
extern const u32 gPartyMenuBg_Gfx[];
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ u32 ComputeWhiteOutMoneyLoss(void);
|
|||
void SetLastHealLocationWarp(u8 healLocaionId);
|
||||
void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum);
|
||||
void CB2_ReturnToFieldFromDiploma(void);
|
||||
void CB2_Overworld(void);
|
||||
void CB2_OverworldBasic(void);
|
||||
void CB2_NewGame(void);
|
||||
bool8 IsMapTypeOutdoors(u8 mapType);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include "main.h"
|
||||
|
||||
extern const u8 gNotDoneYetDescription[];
|
||||
extern const struct SpriteTemplate gSpriteTemplate_MoveTypes;
|
||||
extern const struct CompressedSpriteSheet gSpriteSheet_MoveTypes;
|
||||
extern const struct CompressedSpriteSheet gSpriteSheet_CategoryIcons;
|
||||
extern const struct SpritePalette gSpritePal_CategoryIcons;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_CategoryIcons;
|
||||
|
|
|
|||
|
|
@ -628,6 +628,7 @@ extern const u8 gText_MenuOption[];
|
|||
extern const u8 gText_MenuExit[];
|
||||
extern const u8 gText_MenuRetire[];
|
||||
extern const u8 gText_MenuSafariStats[];
|
||||
extern const u8 gText_MenuDexNav[];
|
||||
extern const u8 gStartMenuDesc_Pokedex[];
|
||||
extern const u8 gStartMenuDesc_Pokemon[];
|
||||
extern const u8 gStartMenuDesc_Bag[];
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ void DrawTextBorderOuter(u8 windowId, u16 tileStart, u8 palette);
|
|||
void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum);
|
||||
void LoadHelpMessageWindowGfx(u8 windowId, u16 destOffset, u8 palIdx);
|
||||
void LoadSignpostWindowGfx(u8 windowId, u16 destOffset, u8 palIdx);
|
||||
void LoadDexNavWindowGfx(u8 windowId, u16 destOffset, u8 palOffset);
|
||||
void LoadStdWindowTiles(u8 windowId, u16 destOffset);
|
||||
void LoadQuestLogWindowTiles(u8 windowId, u16 destOffset);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,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
|
||||
|
||||
|
|
@ -33,6 +34,7 @@ struct WildPokemonHeader
|
|||
const struct WildPokemonInfo *landMonsInfo;
|
||||
const struct WildPokemonInfo *waterMonsInfo;
|
||||
const struct WildPokemonInfo *rockSmashMonsInfo;
|
||||
const struct WildPokemonInfo *hiddenMonsInfo;
|
||||
const struct WildPokemonInfo *fishingMonsInfo;
|
||||
};
|
||||
|
||||
|
|
@ -58,5 +60,11 @@ void ResetEncounterRateModifiers(void);
|
|||
bool8 TryStandardWildEncounter(u32 currMetatileAttrs);
|
||||
bool8 TryDoDoubleWildBattle(void);
|
||||
u32 CalculateChainFishingShinyRolls(void);
|
||||
void CreateWildMon(u16 species, u8 level, u8 unownSlot);
|
||||
u16 GetCurrentMapWildMonHeaderId(void);
|
||||
u8 ChooseWildMonIndex_Land(void);
|
||||
u8 ChooseWildMonIndex_WaterRock(void);
|
||||
u8 ChooseHiddenMonIndex(void);
|
||||
bool32 MapHasNoEncounterData(void);
|
||||
|
||||
#endif // GUARD_WILD_ENCOUNTER_H
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "data.h"
|
||||
#include "debug.h"
|
||||
#include "decompress.h"
|
||||
// #include "dexnav.h"
|
||||
#include "dexnav.h"
|
||||
#include "dma3.h"
|
||||
#include "event_data.h"
|
||||
#include "evolution_scene.h"
|
||||
|
|
@ -5346,6 +5346,15 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
|
|||
{
|
||||
gIsFishingEncounter = FALSE;
|
||||
gIsSurfingEncounter = FALSE;
|
||||
if (gDexNavSpecies && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
|
||||
{
|
||||
IncrementDexNavChain();
|
||||
TryIncrementSpeciesSearchLevel();
|
||||
}
|
||||
else
|
||||
gSaveBlock3Ptr->dexNavChain = 0;
|
||||
|
||||
gDexNavSpecies = SPECIES_NONE;
|
||||
ResetSpriteData();
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_RECORDED_LINK
|
||||
|
|
|
|||
71
src/bg.c
|
|
@ -736,6 +736,77 @@ u32 ChangeBgY(u8 bg, u32 value, u8 op)
|
|||
return sGpuBgConfigs2[bg].bg_y;
|
||||
}
|
||||
|
||||
s32 ChangeBgY_ScreenOff(u32 bg, s32 value, u8 op)
|
||||
{
|
||||
u32 mode;
|
||||
u16 temp1;
|
||||
u16 temp2;
|
||||
|
||||
if (IsInvalidBg(bg) || !GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case BG_COORD_SET:
|
||||
default:
|
||||
sGpuBgConfigs2[bg].bg_y = value;
|
||||
break;
|
||||
case BG_COORD_ADD:
|
||||
sGpuBgConfigs2[bg].bg_y += value;
|
||||
break;
|
||||
case BG_COORD_SUB:
|
||||
sGpuBgConfigs2[bg].bg_y -= value;
|
||||
break;
|
||||
}
|
||||
|
||||
mode = GetBgMode();
|
||||
|
||||
switch (bg)
|
||||
{
|
||||
case 0:
|
||||
temp1 = sGpuBgConfigs2[0].bg_y >> 0x8;
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, temp1);
|
||||
break;
|
||||
case 1:
|
||||
temp1 = sGpuBgConfigs2[1].bg_y >> 0x8;
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG1VOFS, temp1);
|
||||
break;
|
||||
case 2:
|
||||
if (mode == 0)
|
||||
{
|
||||
temp1 = sGpuBgConfigs2[2].bg_y >> 0x8;
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG2VOFS, temp1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
temp1 = sGpuBgConfigs2[2].bg_y >> 0x10;
|
||||
temp2 = sGpuBgConfigs2[2].bg_y & 0xFFFF;
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_H, temp1);
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_L, temp2);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (mode == 0)
|
||||
{
|
||||
temp1 = sGpuBgConfigs2[3].bg_y >> 0x8;
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG3VOFS, temp1);
|
||||
}
|
||||
else if (mode == 2)
|
||||
{
|
||||
temp1 = sGpuBgConfigs2[3].bg_y >> 0x10;
|
||||
temp2 = sGpuBgConfigs2[3].bg_y & 0xFFFF;
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_H, temp1);
|
||||
SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_L, temp2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return sGpuBgConfigs2[bg].bg_y;
|
||||
}
|
||||
|
||||
u32 GetBgY(u8 bg)
|
||||
{
|
||||
if (IsInvalidBg32(bg) != FALSE)
|
||||
|
|
|
|||
|
|
@ -1523,3 +1523,24 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle =
|
|||
};
|
||||
|
||||
const struct SpritePalette gSpritePalette_SmallSparkle = { .data = gFieldEffectPal_SmallSparkle, .tag = FLDEFF_PAL_TAG_SMALL_SPARKLE };
|
||||
|
||||
// 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};
|
||||
|
||||
|
|
|
|||
|
|
@ -371,3 +371,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");
|
||||
|
|
|
|||
|
|
@ -683,7 +683,7 @@ static const u8 *const sDescriptionStringTable[] =
|
|||
};
|
||||
|
||||
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 =
|
||||
{
|
||||
|
|
@ -720,14 +720,14 @@ static const union AnimCmd *const sSpriteAnimTable_HeldItem[] =
|
|||
sSpriteAnim_HeldMail,
|
||||
};
|
||||
|
||||
static const struct SpriteSheet sSpriteSheet_HeldItem =
|
||||
const struct SpriteSheet gSpriteSheet_HeldItem =
|
||||
{
|
||||
sHeldItemGfx, sizeof(sHeldItemGfx), 0xD750
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalette_HeldItem =
|
||||
{
|
||||
sHeldItemPalette, 0xD750
|
||||
gHeldItemPalette, 0xD750
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_HeldItem =
|
||||
|
|
|
|||
|
|
@ -73,6 +73,17 @@ const struct WildPokemonInfo {{ encounter.base_label }}_FishingMonsInfo = { {{en
|
|||
#endif
|
||||
{% endif %}
|
||||
|
||||
{% 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 }}[] =
|
||||
|
|
@ -90,6 +101,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 %},
|
||||
},
|
||||
{% if contains(encounter.base_label, "FireRed") or contains(encounter.base_label, "LeafGreen") %}
|
||||
#endif
|
||||
|
|
@ -102,6 +114,7 @@ const struct WildPokemonHeader {{ wild_encounter_group.label }}[] =
|
|||
.waterMonsInfo = NULL,
|
||||
.rockSmashMonsInfo = NULL,
|
||||
.fishingMonsInfo = NULL,
|
||||
.hiddenMonsInfo = NULL,
|
||||
},
|
||||
};
|
||||
## endfor
|
||||
|
|
|
|||
|
|
@ -62,7 +62,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);
|
||||
|
||||
static void Task_EggHatch(u8 taskID);
|
||||
|
|
@ -1023,7 +1022,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;
|
||||
|
|
|
|||
2690
src/dexnav.c
Normal file
|
|
@ -96,7 +96,6 @@ static void ResetObjectEventFldEffData(struct ObjectEvent *);
|
|||
static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *);
|
||||
static u8 FindObjectEventPaletteIndexByTag(u16);
|
||||
static bool8 ObjectEventDoesElevationMatch(struct ObjectEvent *, u8);
|
||||
static bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y);
|
||||
static bool8 AreElevationsCompatible(u8 a, u8 b);
|
||||
static void ObjectCB_CameraObject(struct Sprite *);
|
||||
static void CameraObject_0(struct Sprite *);
|
||||
|
|
@ -10053,7 +10052,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 "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "event_scripts.h"
|
||||
|
|
@ -120,7 +121,7 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
|
|||
input->pressedAButton = TRUE;
|
||||
if (newKeys & B_BUTTON)
|
||||
input->pressedBButton = TRUE;
|
||||
if (newKeys & R_BUTTON)
|
||||
if (newKeys & R_BUTTON && !FlagGet(DN_FLAG_SEARCHING))
|
||||
input->pressedRButton = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -302,11 +303,18 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
|||
ShowStartMenu();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (input->tookStep && TryFindHiddenPokemon())
|
||||
return TRUE;
|
||||
|
||||
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
|
||||
{
|
||||
gFieldInputRecord.pressedSelectButton = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (input->pressedRButton && TryStartDexNavSearch())
|
||||
return TRUE;
|
||||
|
||||
if(input->input_field_1_2 && DEBUG_OVERWORLD_MENU && !DEBUG_OVERWORLD_IN_MENU)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ static const u32 (*const sFieldEffectFuncs[FLDEFF_COUNT]) (void) =
|
|||
[FLDEFF_JUMP_SMALL_SPLASH] = FldEff_JumpSmallSplash,
|
||||
[FLDEFF_LONG_GRASS] = FldEff_LongGrass,
|
||||
[FLDEFF_JUMP_LONG_GRASS] = FldEff_JumpLongGrass,
|
||||
[FLDEFF_UNUSED_GRASS] = FldEff_UnusedGrass,
|
||||
[FLDEFF_UNUSED_GRASS_2] = FldEff_UnusedGrass2,
|
||||
[FLDEFF_UNUSED_SAND] = FldEff_UnusedSand,
|
||||
[FLDEFF_SHAKING_GRASS] = FldEff_ShakingGrass,
|
||||
[FLDEFF_SHAKING_LONG_GRASS] = FldEff_ShakingGrass2,
|
||||
[FLDEFF_SAND_HOLE] = FldEff_UnusedSand,
|
||||
[FLDEFF_UNUSED_WATER_SURFACING] = FldEff_UnusedWaterSurfacing,
|
||||
[FLDEFF_BERRY_TREE_GROWTH_SPARKLE] = FldEff_BerryTreeGrowthSparkle,
|
||||
[FLDEFF_DEEP_SAND_FOOTPRINTS] = FldEff_DeepSandFootprints,
|
||||
|
|
@ -150,6 +150,7 @@ static const u32 (*const sFieldEffectFuncs[FLDEFF_COUNT]) (void) =
|
|||
[FLDEFF_SNOW_TRACKS_SLITHER] = FldEff_SnowTracksSlither,
|
||||
[FLDEFF_SNOW_TRACKS_BUG] = FldEff_SnowTracksBug,
|
||||
[FLDEFF_SNOW_TRACKS_SPOT] = FldEff_SnowTracksSpot,
|
||||
[FLDEFF_CAVE_DUST] = FldEff_CaveDust,
|
||||
};
|
||||
static const struct OamData sNewGameOakOamAttributes = {
|
||||
.y = 0,
|
||||
|
|
@ -463,7 +464,7 @@ void FieldEffectScript_LoadPal(const struct SpritePalette * spritePalette)
|
|||
ApplyGlobalFieldPaletteTint(IndexOfSpritePaletteTag(spritePalette->tag));
|
||||
}
|
||||
|
||||
static void FieldEffectFreeGraphicsResources(struct Sprite *sprite)
|
||||
void FieldEffectFreeGraphicsResources(struct Sprite *sprite)
|
||||
{
|
||||
u16 tileStart = sprite->sheetTileStart;
|
||||
u8 paletteNum = sprite->oam.paletteNum;
|
||||
|
|
@ -3762,6 +3763,22 @@ static void Task_MoveDeoxysRock_Step(u8 taskId)
|
|||
}
|
||||
}
|
||||
|
||||
u32 FldEff_CaveDust(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_CaveDust);
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_CaveDust, gFieldEffectArguments[0], gFieldEffectArguments[1], 0xFF);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
gSprites[spriteId].data[0] = 22;
|
||||
}
|
||||
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
static void Task_DestroyDeoxysRock(u8 taskId);
|
||||
static void DestroyDeoxysRockEffect_CameraShake(s16 *data, u8 taskId);
|
||||
static void DestroyDeoxysRockEffect_RockFragments(s16 *data, u8 taskId);
|
||||
|
|
|
|||
|
|
@ -386,6 +386,28 @@ void UpdateShadowFieldEffect(struct Sprite *sprite)
|
|||
#undef sMapGroup
|
||||
#undef sYOffset
|
||||
|
||||
static const struct SpritePalette* GetGeneralFieldPalette1()
|
||||
{
|
||||
if (OW_SEASONS)
|
||||
{
|
||||
switch (gLoadedSeason)
|
||||
{
|
||||
case SEASON_SPRING:
|
||||
default:
|
||||
return &gSpritePalette_GeneralFieldEffect1;
|
||||
case SEASON_SUMMER:
|
||||
return &gSpritePalette_GeneralFieldEffect1Summer;
|
||||
case SEASON_AUTUMN:
|
||||
return &gSpritePalette_GeneralFieldEffect1Autumn;
|
||||
case SEASON_WINTER:
|
||||
return &gSpritePalette_GeneralFieldEffect1Winter;
|
||||
|
||||
}
|
||||
}
|
||||
return &gSpritePalette_GeneralFieldEffect1;
|
||||
}
|
||||
|
||||
|
||||
u32 FldEff_TallGrass(void)
|
||||
{
|
||||
s16 x;
|
||||
|
|
@ -402,19 +424,15 @@ u32 FldEff_TallGrass(void)
|
|||
case SEASON_SPRING:
|
||||
default:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_TallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1;
|
||||
break;
|
||||
case SEASON_SUMMER:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_TallGrassSummer;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1Summer;
|
||||
break;
|
||||
case SEASON_AUTUMN:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_TallGrassAutumn;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1Autumn;
|
||||
break;
|
||||
case SEASON_WINTER:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_TallGrassWinter;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1Winter;
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
@ -422,8 +440,8 @@ u32 FldEff_TallGrass(void)
|
|||
else
|
||||
{
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_TallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1;
|
||||
}
|
||||
spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
x = gFieldEffectArguments[0];
|
||||
|
|
@ -506,19 +524,15 @@ u32 FldEff_JumpTallGrass(void)
|
|||
case SEASON_SPRING:
|
||||
default:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1;
|
||||
break;
|
||||
case SEASON_SUMMER:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1Summer;
|
||||
break;
|
||||
case SEASON_AUTUMN:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1Autumn;
|
||||
break;
|
||||
case SEASON_WINTER:
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1Winter;
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
@ -526,8 +540,8 @@ u32 FldEff_JumpTallGrass(void)
|
|||
else
|
||||
{
|
||||
spriteTemplate = &gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
spritePalette = &gSpritePalette_GeneralFieldEffect1;
|
||||
}
|
||||
spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
|
|
@ -567,8 +581,9 @@ u32 FldEff_LongGrass(void)
|
|||
s16 y;
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
|
||||
|
|
@ -633,8 +648,9 @@ u32 FldEff_JumpLongGrass(void)
|
|||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_JumpLongGrass, gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
|
|
@ -654,8 +670,9 @@ u32 FldEff_ShortGrass(void)
|
|||
struct ObjectEvent * objectEvent;
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_ShortGrass, 0, 0, 0);
|
||||
|
|
@ -1095,8 +1112,9 @@ u32 FldEff_Ripple(void)
|
|||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_Ripple, gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
|
|
@ -1114,8 +1132,9 @@ u32 FldEff_HotSpringsWater(void)
|
|||
struct ObjectEvent * objectEvent;
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_HotSpringsWater, 0, 0, 0);
|
||||
|
|
@ -1154,12 +1173,13 @@ void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite)
|
|||
}
|
||||
}
|
||||
|
||||
u32 FldEff_UnusedGrass(void)
|
||||
u32 FldEff_ShakingGrass(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_UnusedGrass, gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
|
|
@ -1167,17 +1187,18 @@ u32 FldEff_UnusedGrass(void)
|
|||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNUSED_GRASS;
|
||||
sprite->data[0] = FLDEFF_SHAKING_GRASS;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_UnusedGrass2(void)
|
||||
u32 FldEff_ShakingGrass2(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(&gFieldEffectObjectTemplate_UnusedGrass2, gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
|
|
@ -1185,9 +1206,9 @@ u32 FldEff_UnusedGrass2(void)
|
|||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNUSED_GRASS_2;
|
||||
sprite->data[0] = FLDEFF_SHAKING_LONG_GRASS;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_UnusedSand(void)
|
||||
|
|
@ -1203,9 +1224,9 @@ u32 FldEff_UnusedSand(void)
|
|||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNUSED_SAND;
|
||||
sprite->data[0] = FLDEFF_SAND_HOLE;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_UnusedWaterSurfacing(void)
|
||||
|
|
@ -1223,7 +1244,7 @@ u32 FldEff_UnusedWaterSurfacing(void)
|
|||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNUSED_WATER_SURFACING;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
void StartAshFieldEffect(s16 x, s16 y, u16 metatileId, s16 d)
|
||||
|
|
@ -1243,8 +1264,9 @@ u32 FldEff_Ash(void)
|
|||
s16 y;
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
const struct SpritePalette *spritePalette = GetGeneralFieldPalette1();
|
||||
|
||||
FieldEffectScript_LoadFadedPal(&gSpritePalette_GeneralFieldEffect1);
|
||||
FieldEffectScript_LoadFadedPal(spritePalette);
|
||||
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
|
|
@ -1596,7 +1618,7 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
|
|||
UpdateSpritePaletteByTemplate(&gFieldEffectObjectTemplate_Sparkle, sprite);
|
||||
sprite->sWaitFldEff = FLDEFF_BERRY_TREE_GROWTH_SPARKLE;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u32 FldEff_TreeDisguise(void)
|
||||
|
|
@ -1714,7 +1736,7 @@ u32 FldEff_Sparkle(void)
|
|||
gSprites[spriteId].oam.priority = gFieldEffectArguments[2];
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
}
|
||||
return 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
void UpdateSparkleFieldEffect(struct Sprite *sprite)
|
||||
|
|
|
|||
|
|
@ -521,11 +521,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(DN_FLAG_SEARCHING) && (heldKeys & A_BUTTON))
|
||||
{
|
||||
gPlayerAvatar.creeping = TRUE;
|
||||
PlayerWalkSlow(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Same speed as running
|
||||
PlayerWalkFast(direction);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -539,6 +548,11 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
|
|||
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH;
|
||||
return;
|
||||
}
|
||||
else if (FlagGet(DN_FLAG_SEARCHING) && (heldKeys & A_BUTTON))
|
||||
{
|
||||
gPlayerAvatar.creeping = TRUE;
|
||||
PlayerWalkSlow(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PlayerIsMovingOnRockStairs(direction))
|
||||
|
|
|
|||
|
|
@ -1479,6 +1479,9 @@ const u32 gBerryCrush_TextWindows_Tilemap[] = INCBIN_U32("graphics/berry_crush/t
|
|||
const u16 gCategoryIcons_Pal[] = INCBIN_U16("graphics/interface/category_icons.gbapal");
|
||||
const u32 gCategoryIcons_Gfx[] = INCBIN_U32("graphics/interface/category_icons.4bpp.lz");
|
||||
|
||||
const u32 gMoveTypes_Gfx[] = INCBIN_U32("graphics/types/move_types.4bpp.lz");
|
||||
const u32 gMoveTypes_Pal[] = INCBIN_U32("graphics/types/move_types.gbapal.lz");
|
||||
|
||||
// New Battle anims Particles
|
||||
const u32 gBattleAnimSpriteGfx_WhiteStreak[] = INCBIN_U32("graphics/battle_anims/sprites/white_streak.4bpp.lz");
|
||||
const u32 gBattleAnimSpritePal_WhiteStreak[] = INCBIN_U32("graphics/battle_anims/sprites/white_streak.gbapal.lz");
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
// this file's functions
|
||||
static void ResetMiniGamesResults(void);
|
||||
static void ResetItemFlags(void);
|
||||
static void ResetDexNav(void);
|
||||
|
||||
// EWRAM vars
|
||||
EWRAM_DATA bool8 gDifferentSaveFile = FALSE;
|
||||
|
|
@ -158,6 +159,7 @@ void NewGameInitData(void)
|
|||
StringCopy(gSaveBlock1Ptr->rivalName, rivalName);
|
||||
ResetTrainerTowerResults();
|
||||
ResetItemFlags();
|
||||
ResetDexNav();
|
||||
}
|
||||
|
||||
static void ResetMiniGamesResults(void)
|
||||
|
|
@ -174,3 +176,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "cable_club.h"
|
||||
#include "clock.h"
|
||||
#include "credits.h"
|
||||
#include "dexnav.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "event_scripts.h"
|
||||
|
|
@ -140,7 +141,6 @@ static void SetDefaultFlashLevel(void);
|
|||
static void Overworld_TryMapConnectionMusicTransition(void);
|
||||
static void ChooseAmbientCrySpecies(void);
|
||||
|
||||
static void CB2_Overworld(void);
|
||||
static void CB2_LoadMap2(void);
|
||||
static void CB2_LoadMapOnReturnToFieldCableClub(void);
|
||||
static void CB2_ReturnToFieldLocal(void);
|
||||
|
|
@ -779,6 +779,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
|||
LoadObjEventTemplatesFromHeader();
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetDexNavSearch();
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
MapResetTrainerRematches(mapGroup, mapNum);
|
||||
|
|
@ -815,8 +816,9 @@ static void LoadMapFromWarp(bool32 unused)
|
|||
|
||||
TrySetMapSaveWarpStatus();
|
||||
ClearTempFieldEventData();
|
||||
ResetDexNavSearch();
|
||||
// reset hours override on every warp
|
||||
sHoursOverride = 0;
|
||||
sHoursOverride = 0;
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
MapResetTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum);
|
||||
|
|
@ -1653,7 +1655,7 @@ void CB2_OverworldBasic(void)
|
|||
OverworldBasic();
|
||||
}
|
||||
|
||||
static void CB2_Overworld(void)
|
||||
void CB2_Overworld(void)
|
||||
{
|
||||
bool32 fading = !!gPaletteFade.active;
|
||||
if (fading)
|
||||
|
|
|
|||
|
|
@ -2968,7 +2968,7 @@ static void ShowOrHideHeldItemSprite(u16 item, struct PartyMenuBox *menuBox)
|
|||
|
||||
void LoadHeldItemIcons(void)
|
||||
{
|
||||
LoadSpriteSheet(&sSpriteSheet_HeldItem);
|
||||
LoadSpriteSheet(&gSpriteSheet_HeldItem);
|
||||
LoadSpritePalette(&sSpritePalette_HeldItem);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "battle_tower.h"
|
||||
#include "battle_z_move.h"
|
||||
#include "data.h"
|
||||
// #include "dexnav.h"
|
||||
#include "dexnav.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "evolution_scene.h"
|
||||
|
|
@ -1323,8 +1323,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();
|
||||
if (gDexNavSpecies)
|
||||
totalRerolls += CalculateDexNavShinyRolls();
|
||||
|
||||
while (GET_SHINY_VALUE(value, personality) >= SHINY_ODDS && totalRerolls > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@
|
|||
#include "constants/battle_move_effects.h"
|
||||
#include "constants/sound.h"
|
||||
|
||||
#define TAG_MOVE_TYPES 30002
|
||||
#define TAG_CATEGORY_ICONS 30004
|
||||
|
||||
// needs conflicting header to match (curIndex is s8 in the function, but has to be defined as u8 here)
|
||||
extern s16 SeekToNextMonInBox(struct BoxPokemon * boxMons, u8 curIndex, u8 maxIndex, u8 flags);
|
||||
|
||||
|
|
@ -965,8 +968,6 @@ static const u16 * const sHpBarPals[] =
|
|||
sPokeSummary_HpBarPalRed,
|
||||
};
|
||||
|
||||
#define TAG_CATEGORY_ICONS 30004
|
||||
|
||||
static const struct OamData sOamData_CategoryIcons =
|
||||
{
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
|
|
@ -1023,6 +1024,172 @@ const struct SpriteTemplate gSpriteTemplate_CategoryIcons =
|
|||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_MoveTypes =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x16),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(32x16),
|
||||
.tileNum = 0,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0,
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeNone[] = {
|
||||
ANIMCMD_FRAME(TYPE_NONE * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeNormal[] = {
|
||||
ANIMCMD_FRAME(TYPE_NORMAL * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeFighting[] = {
|
||||
ANIMCMD_FRAME(TYPE_FIGHTING * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeFlying[] = {
|
||||
ANIMCMD_FRAME(TYPE_FLYING * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypePoison[] = {
|
||||
ANIMCMD_FRAME(TYPE_POISON * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeGround[] = {
|
||||
ANIMCMD_FRAME(TYPE_GROUND * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeRock[] = {
|
||||
ANIMCMD_FRAME(TYPE_ROCK * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeBug[] = {
|
||||
ANIMCMD_FRAME(TYPE_BUG * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeGhost[] = {
|
||||
ANIMCMD_FRAME(TYPE_GHOST * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeSteel[] = {
|
||||
ANIMCMD_FRAME(TYPE_STEEL * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeMystery[] = {
|
||||
ANIMCMD_FRAME(TYPE_MYSTERY * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeFire[] = {
|
||||
ANIMCMD_FRAME(TYPE_FIRE * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeWater[] = {
|
||||
ANIMCMD_FRAME(TYPE_WATER * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeGrass[] = {
|
||||
ANIMCMD_FRAME(TYPE_GRASS * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeElectric[] = {
|
||||
ANIMCMD_FRAME(TYPE_ELECTRIC * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypePsychic[] = {
|
||||
ANIMCMD_FRAME(TYPE_PSYCHIC * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeIce[] = {
|
||||
ANIMCMD_FRAME(TYPE_ICE * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeDragon[] = {
|
||||
ANIMCMD_FRAME(TYPE_DRAGON * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeDark[] = {
|
||||
ANIMCMD_FRAME(TYPE_DARK * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeFairy[] = {
|
||||
ANIMCMD_FRAME(TYPE_FAIRY * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_TypeStellar[] = {
|
||||
ANIMCMD_FRAME(TYPE_STELLAR * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_CategoryCool[] = {
|
||||
ANIMCMD_FRAME((CONTEST_CATEGORY_COOL + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_CategoryBeauty[] = {
|
||||
ANIMCMD_FRAME((CONTEST_CATEGORY_BEAUTY + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_CategoryCute[] = {
|
||||
ANIMCMD_FRAME((CONTEST_CATEGORY_CUTE + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_CategorySmart[] = {
|
||||
ANIMCMD_FRAME((CONTEST_CATEGORY_SMART + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd sSpriteAnim_CategoryTough[] = {
|
||||
ANIMCMD_FRAME((CONTEST_CATEGORY_TOUGH + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
|
||||
ANIMCMD_END
|
||||
};
|
||||
static const union AnimCmd *const sSpriteAnimTable_MoveTypes[NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT] = {
|
||||
[TYPE_NONE] = sSpriteAnim_TypeNone,
|
||||
[TYPE_NORMAL] = sSpriteAnim_TypeNormal,
|
||||
[TYPE_FIGHTING] = sSpriteAnim_TypeFighting,
|
||||
[TYPE_FLYING] = sSpriteAnim_TypeFlying,
|
||||
[TYPE_POISON] = sSpriteAnim_TypePoison,
|
||||
[TYPE_GROUND] = sSpriteAnim_TypeGround,
|
||||
[TYPE_ROCK] = sSpriteAnim_TypeRock,
|
||||
[TYPE_BUG] = sSpriteAnim_TypeBug,
|
||||
[TYPE_GHOST] = sSpriteAnim_TypeGhost,
|
||||
[TYPE_STEEL] = sSpriteAnim_TypeSteel,
|
||||
[TYPE_MYSTERY] = sSpriteAnim_TypeMystery,
|
||||
[TYPE_FIRE] = sSpriteAnim_TypeFire,
|
||||
[TYPE_WATER] = sSpriteAnim_TypeWater,
|
||||
[TYPE_GRASS] = sSpriteAnim_TypeGrass,
|
||||
[TYPE_ELECTRIC] = sSpriteAnim_TypeElectric,
|
||||
[TYPE_PSYCHIC] = sSpriteAnim_TypePsychic,
|
||||
[TYPE_ICE] = sSpriteAnim_TypeIce,
|
||||
[TYPE_DRAGON] = sSpriteAnim_TypeDragon,
|
||||
[TYPE_DARK] = sSpriteAnim_TypeDark,
|
||||
[TYPE_FAIRY] = sSpriteAnim_TypeFairy,
|
||||
[TYPE_STELLAR] = sSpriteAnim_TypeStellar,
|
||||
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_COOL] = sSpriteAnim_CategoryCool,
|
||||
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_BEAUTY] = sSpriteAnim_CategoryBeauty,
|
||||
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_CUTE] = sSpriteAnim_CategoryCute,
|
||||
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_SMART] = sSpriteAnim_CategorySmart,
|
||||
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_TOUGH] = sSpriteAnim_CategoryTough,
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gSpriteSheet_MoveTypes =
|
||||
{
|
||||
.data = gMoveTypes_Gfx,
|
||||
.size = (NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT) * 0x100,
|
||||
.tag = TAG_MOVE_TYPES
|
||||
};
|
||||
const struct SpriteTemplate gSpriteTemplate_MoveTypes =
|
||||
{
|
||||
.tileTag = TAG_MOVE_TYPES,
|
||||
.paletteTag = TAG_MOVE_TYPES,
|
||||
.oam = &sOamData_MoveTypes,
|
||||
.anims = sSpriteAnimTable_MoveTypes,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
|
||||
#define FREE_AND_SET_NULL_IF_SET(ptr) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "debug.h"
|
||||
#include "dexnav.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "overworld.h"
|
||||
#include "link.h"
|
||||
|
|
@ -35,6 +36,7 @@
|
|||
#include "rtc.h"
|
||||
#include "save_menu_util.h"
|
||||
#include "help_system.h"
|
||||
#include "wild_encounter.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/field_weather.h"
|
||||
|
||||
|
|
@ -50,6 +52,7 @@ enum StartMenuOption
|
|||
STARTMENU_RETIRE,
|
||||
STARTMENU_PLAYER2,
|
||||
STARTMENU_DEBUG,
|
||||
STARTMENU_DEXNAV,
|
||||
MAX_STARTMENU_ITEMS
|
||||
};
|
||||
|
||||
|
|
@ -92,6 +95,7 @@ static bool8 StartMenuExitCallback(void);
|
|||
static bool8 StartMenuSafariZoneRetireCallback(void);
|
||||
static bool8 StartMenuLinkPlayerCallback(void);
|
||||
static bool8 StartMenuDebugCallback(void);
|
||||
static bool8 StartMenuDexNavCallback(void);
|
||||
static bool8 StartCB_Save1(void);
|
||||
static bool8 StartCB_Save2(void);
|
||||
static void StartMenu_PrepareForSave(void);
|
||||
|
|
@ -130,6 +134,7 @@ static const struct MenuAction sStartMenuActionTable[] = {
|
|||
[STARTMENU_RETIRE] = {gText_MenuRetire, {.u8_void = StartMenuSafariZoneRetireCallback}},
|
||||
[STARTMENU_PLAYER2] = {gText_MenuPlayer, {.u8_void = StartMenuLinkPlayerCallback}},
|
||||
[STARTMENU_DEBUG] = {sText_MenuDebug, {.u8_void = StartMenuDebugCallback}},
|
||||
[STARTMENU_DEXNAV] = {gText_MenuDexNav, {.u8_void = StartMenuDexNavCallback}},
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sTimeWindowTemplate = {
|
||||
|
|
@ -251,6 +256,8 @@ static void SetUpStartMenu_NormalField(void)
|
|||
{
|
||||
if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE)
|
||||
AppendToStartMenuItems(STARTMENU_POKEDEX);
|
||||
if (DN_FLAG_DEXNAV_GET != 0 && FlagGet(DN_FLAG_DEXNAV_GET))
|
||||
AppendToStartMenuItems(STARTMENU_DEXNAV);
|
||||
if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)
|
||||
AppendToStartMenuItems(STARTMENU_POKEMON);
|
||||
AppendToStartMenuItems(STARTMENU_BAG);
|
||||
|
|
@ -537,6 +544,9 @@ static bool8 StartCB_HandleInput(void)
|
|||
PlaySE(SE_SELECT);
|
||||
if (!StartMenuPokedexSanityCheck())
|
||||
return FALSE;
|
||||
if (sStartMenuOrder[sStartMenuCursorPos] == STARTMENU_DEXNAV
|
||||
&& MapHasNoEncounterData())
|
||||
return FALSE;
|
||||
sStartMenuCallback = sStartMenuActionTable[sStartMenuOrder[sStartMenuCursorPos]].func.u8_void;
|
||||
StartMenu_FadeScreenIfLeavingOverworld();
|
||||
return FALSE;
|
||||
|
|
@ -567,7 +577,7 @@ static void StartMenu_FadeScreenIfLeavingOverworld(void)
|
|||
|
||||
static bool8 StartMenuPokedexSanityCheck(void)
|
||||
{
|
||||
if (sStartMenuActionTable[sStartMenuOrder[sStartMenuCursorPos]].func.u8_void == StartMenuPokedexCallback && GetNationalPokedexCount(0) == 0)
|
||||
if (sStartMenuActionTable[sStartMenuOrder[sStartMenuCursorPos]].func.u8_void == StartMenuPokedexCallback && GetNationalPokedexCount(FLAG_GET_SEEN) == 0)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1153,3 +1163,9 @@ void AppendToList(u8 *list, u8 *cursor, u8 newEntry)
|
|||
list[*cursor] = newEntry;
|
||||
(*cursor)++;
|
||||
}
|
||||
|
||||
static bool8 StartMenuDexNavCallback(void)
|
||||
{
|
||||
CreateTask(Task_OpenDexNavFromStartMenu, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ const u8 gText_MenuSave[] = _("SAVE");
|
|||
const u8 gText_MenuOption[] = _("OPTION");
|
||||
const u8 gText_MenuExit[] = _("EXIT");
|
||||
const u8 gText_MenuRetire[] = _("RETIRE");
|
||||
const u8 gText_MenuDexNav[] = _("DEXNAV");
|
||||
const u8 gText_MenuSafariStats[] = _("{STR_VAR_1}/{STR_VAR_2}\nBALLS {STR_VAR_3}");
|
||||
const u8 gText_MenuTime[] = _("Time: {STR_VAR_1}:{STR_VAR_2}");
|
||||
const u8 gText_MenuDay[] = _("{STR_VAR_1} Day {STR_VAR_2}");
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ static const struct TextWindowGraphics sWindowFrames[] = {
|
|||
{.tiles = sTextWindowFrame10_Gfx, .pal = sTextWindowFrame10_Pal},
|
||||
};
|
||||
|
||||
static const u16 sTextWindowDexNavFrame[] = INCBIN_U16("graphics/text_window/dexnav_pal.gbapal");
|
||||
static const struct TextWindowGraphics sDexNavWindowFrame = {sTextWindowFrame1_Gfx, sTextWindowDexNavFrame};
|
||||
|
||||
const struct TextWindowGraphics *GetUserWindowGraphics(u8 id)
|
||||
{
|
||||
if (id >= ARRAY_COUNT(sWindowFrames))
|
||||
|
|
@ -198,3 +201,9 @@ const u16 *GetTextWindowPalette(u8 id)
|
|||
else
|
||||
return sTextWindowPalettes[id];
|
||||
}
|
||||
|
||||
void LoadDexNavWindowGfx(u8 windowId, u16 destOffset, u8 palOffset)
|
||||
{
|
||||
LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), sDexNavWindowFrame.tiles, 0x120, destOffset);
|
||||
LoadPalette(sDexNavWindowFrame.pal, palOffset, 32);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void DisableWildEncounters(bool8 state)
|
|||
sWildEncountersDisabled = state;
|
||||
}
|
||||
|
||||
static u8 ChooseWildMonIndex_Land(void)
|
||||
u8 ChooseWildMonIndex_Land(void)
|
||||
{
|
||||
u8 wildMonIndex = 0;
|
||||
bool8 swap = FALSE;
|
||||
|
|
@ -131,7 +131,7 @@ static u8 ChooseWildMonIndex_Land(void)
|
|||
return wildMonIndex;
|
||||
}
|
||||
|
||||
static u8 ChooseWildMonIndex_WaterRock(void)
|
||||
u8 ChooseWildMonIndex_WaterRock(void)
|
||||
{
|
||||
u8 wildMonIndex = 0;
|
||||
bool8 swap = FALSE;
|
||||
|
|
@ -257,7 +257,7 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon, u8 wildMonIn
|
|||
}
|
||||
}
|
||||
|
||||
static u16 GetCurrentMapWildMonHeaderId(void)
|
||||
u16 GetCurrentMapWildMonHeaderId(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ u8 PickWildMonNature(void)
|
|||
return Random() % NUM_NATURES;
|
||||
}
|
||||
|
||||
static void CreateWildMon(u16 species, u8 level, u8 slot)
|
||||
void CreateWildMon(u16 species, u8 level, u8 unownSlot)
|
||||
{
|
||||
u32 personality;
|
||||
s8 chamber;
|
||||
|
|
@ -342,7 +342,7 @@ static void CreateWildMon(u16 species, u8 level, u8 slot)
|
|||
|
||||
if (species == SPECIES_UNOWN) {
|
||||
chamber = gSaveBlock1Ptr->location.mapNum - MAP_NUM(SEVEN_ISLAND_TANOBY_RUINS_MONEAN_CHAMBER);
|
||||
unownLetter = sUnownLetterSlots[chamber][slot];
|
||||
unownLetter = sUnownLetterSlots[chamber][unownSlot];
|
||||
}
|
||||
|
||||
if (checkCuteCharm
|
||||
|
|
@ -1104,3 +1104,24 @@ bool8 TryDoDoubleWildBattle(void)
|
|||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||