diff --git a/graphics/object_events/pics/misc/animated_ball.png b/graphics/object_events/pics/misc/animated_ball.png index 534e66c7b4..03216113ba 100644 Binary files a/graphics/object_events/pics/misc/animated_ball.png and b/graphics/object_events/pics/misc/animated_ball.png differ diff --git a/graphics/object_events/pics/misc/ball_beast.png b/graphics/object_events/pics/misc/ball_beast.png new file mode 100644 index 0000000000..f3733d11ae Binary files /dev/null and b/graphics/object_events/pics/misc/ball_beast.png differ diff --git a/graphics/object_events/pics/misc/ball_cherish.png b/graphics/object_events/pics/misc/ball_cherish.png new file mode 100644 index 0000000000..a93cab30c5 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_cherish.png differ diff --git a/graphics/object_events/pics/misc/ball_dive.png b/graphics/object_events/pics/misc/ball_dive.png new file mode 100644 index 0000000000..1349ffa3ff Binary files /dev/null and b/graphics/object_events/pics/misc/ball_dive.png differ diff --git a/graphics/object_events/pics/misc/ball_dream.png b/graphics/object_events/pics/misc/ball_dream.png new file mode 100644 index 0000000000..875e72a702 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_dream.png differ diff --git a/graphics/object_events/pics/misc/ball_dusk.png b/graphics/object_events/pics/misc/ball_dusk.png new file mode 100644 index 0000000000..824557003d Binary files /dev/null and b/graphics/object_events/pics/misc/ball_dusk.png differ diff --git a/graphics/object_events/pics/misc/ball_fast.png b/graphics/object_events/pics/misc/ball_fast.png new file mode 100644 index 0000000000..3e3ca467ea Binary files /dev/null and b/graphics/object_events/pics/misc/ball_fast.png differ diff --git a/graphics/object_events/pics/misc/ball_friend.png b/graphics/object_events/pics/misc/ball_friend.png new file mode 100644 index 0000000000..f22d7f78a2 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_friend.png differ diff --git a/graphics/object_events/pics/misc/ball_great.png b/graphics/object_events/pics/misc/ball_great.png new file mode 100644 index 0000000000..5a70a505fe Binary files /dev/null and b/graphics/object_events/pics/misc/ball_great.png differ diff --git a/graphics/object_events/pics/misc/ball_heal.png b/graphics/object_events/pics/misc/ball_heal.png new file mode 100644 index 0000000000..bcb2272e51 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_heal.png differ diff --git a/graphics/object_events/pics/misc/ball_heavy.png b/graphics/object_events/pics/misc/ball_heavy.png new file mode 100644 index 0000000000..5b28410694 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_heavy.png differ diff --git a/graphics/object_events/pics/misc/ball_level.png b/graphics/object_events/pics/misc/ball_level.png new file mode 100644 index 0000000000..9050ad5588 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_level.png differ diff --git a/graphics/object_events/pics/misc/ball_love.png b/graphics/object_events/pics/misc/ball_love.png new file mode 100644 index 0000000000..9584b6c797 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_love.png differ diff --git a/graphics/object_events/pics/misc/ball_lure.png b/graphics/object_events/pics/misc/ball_lure.png new file mode 100644 index 0000000000..f3f6c1ffd9 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_lure.png differ diff --git a/graphics/object_events/pics/misc/ball_luxury.png b/graphics/object_events/pics/misc/ball_luxury.png new file mode 100644 index 0000000000..f04e816cb3 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_luxury.png differ diff --git a/graphics/object_events/pics/misc/ball_master.png b/graphics/object_events/pics/misc/ball_master.png new file mode 100644 index 0000000000..1db9b71fba Binary files /dev/null and b/graphics/object_events/pics/misc/ball_master.png differ diff --git a/graphics/object_events/pics/misc/ball_moon.png b/graphics/object_events/pics/misc/ball_moon.png new file mode 100644 index 0000000000..f13f34e769 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_moon.png differ diff --git a/graphics/object_events/pics/misc/ball_nest.png b/graphics/object_events/pics/misc/ball_nest.png new file mode 100644 index 0000000000..48a409183b Binary files /dev/null and b/graphics/object_events/pics/misc/ball_nest.png differ diff --git a/graphics/object_events/pics/misc/ball_net.png b/graphics/object_events/pics/misc/ball_net.png new file mode 100644 index 0000000000..186d76650e Binary files /dev/null and b/graphics/object_events/pics/misc/ball_net.png differ diff --git a/graphics/object_events/pics/misc/ball_park.png b/graphics/object_events/pics/misc/ball_park.png new file mode 100644 index 0000000000..5cc3f1a9b0 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_park.png differ diff --git a/graphics/object_events/pics/misc/ball_premier.png b/graphics/object_events/pics/misc/ball_premier.png new file mode 100644 index 0000000000..8876cfe22d Binary files /dev/null and b/graphics/object_events/pics/misc/ball_premier.png differ diff --git a/graphics/object_events/pics/misc/ball_quick.png b/graphics/object_events/pics/misc/ball_quick.png new file mode 100644 index 0000000000..0f6c64b1b1 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_quick.png differ diff --git a/graphics/object_events/pics/misc/ball_repeat.png b/graphics/object_events/pics/misc/ball_repeat.png new file mode 100644 index 0000000000..36186b094c Binary files /dev/null and b/graphics/object_events/pics/misc/ball_repeat.png differ diff --git a/graphics/object_events/pics/misc/ball_safari.png b/graphics/object_events/pics/misc/ball_safari.png new file mode 100644 index 0000000000..f73846a9b8 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_safari.png differ diff --git a/graphics/object_events/pics/misc/ball_sport.png b/graphics/object_events/pics/misc/ball_sport.png new file mode 100644 index 0000000000..1c32d2609c Binary files /dev/null and b/graphics/object_events/pics/misc/ball_sport.png differ diff --git a/graphics/object_events/pics/misc/ball_strange.png b/graphics/object_events/pics/misc/ball_strange.png new file mode 100644 index 0000000000..ee09679dc2 Binary files /dev/null and b/graphics/object_events/pics/misc/ball_strange.png differ diff --git a/graphics/object_events/pics/misc/ball_timer.png b/graphics/object_events/pics/misc/ball_timer.png new file mode 100644 index 0000000000..878d6ea5ba Binary files /dev/null and b/graphics/object_events/pics/misc/ball_timer.png differ diff --git a/graphics/object_events/pics/misc/ball_ultra.png b/graphics/object_events/pics/misc/ball_ultra.png new file mode 100644 index 0000000000..171281666f Binary files /dev/null and b/graphics/object_events/pics/misc/ball_ultra.png differ diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 0397e2409a..9e56392fe6 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -285,6 +285,10 @@ // will display correctly under bridges, etc. #define LARGE_OW_SUPPORT TRUE +// Followers will emerge from the pokeball they are stored in, +// instead of a normal pokeball +#define OW_MON_POKEBALLS TRUE + #define SHADOW_SIZE_S 0 #define SHADOW_SIZE_M 1 #define SHADOW_SIZE_L 2 diff --git a/spritesheet_rules.mk b/spritesheet_rules.mk index 438f517c97..902eb1c892 100644 --- a/spritesheet_rules.mk +++ b/spritesheet_rules.mk @@ -1938,5 +1938,8 @@ $(OBJEVENTGFXDIR)/pokemon/deoxys.4bpp: %.4bpp: %.png $(MISCGFXDIR)/emotes.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 2 -mheight 2 +# All pokeballs are 16x32 +$(OBJEVENTGFXDIR)/misc/ball_%.4bpp: $(OBJEVENTGFXDIR)/misc/ball_%.png ; $(GFX) $< $@ -mwidth 2 -mheight 4 + graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 2 -mheight 4 diff --git a/src/data/object_events/object_event_graphics.h b/src/data/object_events/object_event_graphics.h index 3d37376682..3a658aa15e 100755 --- a/src/data/object_events/object_event_graphics.h +++ b/src/data/object_events/object_event_graphics.h @@ -343,6 +343,55 @@ const u32 gObjectEventPic_Noland[] = INCBIN_U32("graphics/object_events/pics/peo const u32 gObjectEventPic_Lucy[] = INCBIN_U32("graphics/object_events/pics/people/frontier_brains/lucy.4bpp"); const u32 gObjectEventPic_Brandon[] = INCBIN_U32("graphics/object_events/pics/people/frontier_brains/brandon.4bpp"); const u32 gObjectEventPic_AnimatedBall[] = INCBIN_U32("graphics/object_events/pics/misc/animated_ball.4bpp"); + +#if OW_MON_POKEBALLS +// Vanilla +const u32 gObjectEventPic_MasterBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_master.4bpp"); +const u32 gObjectEventPic_UltraBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_ultra.4bpp"); +const u32 gObjectEventPic_GreatBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_great.4bpp"); +const u32 gObjectEventPic_SafariBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_safari.4bpp"); +const u32 gObjectEventPic_NetBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_net.4bpp"); +const u32 gObjectEventPic_DiveBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_dive.4bpp"); +const u32 gObjectEventPic_NestBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_nest.4bpp"); +const u32 gObjectEventPic_RepeatBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_repeat.4bpp"); +const u32 gObjectEventPic_TimerBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_timer.4bpp"); +const u32 gObjectEventPic_LuxuryBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_luxury.4bpp"); +const u32 gObjectEventPic_PremierBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_premier.4bpp"); +// Gen IV/Sinnoh +#ifdef ITEM_DUSK_BALL +const u32 gObjectEventPic_DuskBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_dusk.4bpp"); +const u32 gObjectEventPic_HealBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_heal.4bpp"); +const u32 gObjectEventPic_QuickBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_quick.4bpp"); +const u32 gObjectEventPic_CherishBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_cherish.4bpp"); +#endif +#ifdef ITEM_PARK_BALL +const u32 gObjectEventPic_ParkBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_park.4bpp"); +#endif +// Gen II/Johto Apricorns +#ifdef ITEM_FAST_BALL +const u32 gObjectEventPic_FastBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_fast.4bpp"); +const u32 gObjectEventPic_LevelBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_level.4bpp"); +const u32 gObjectEventPic_LureBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_lure.4bpp"); +const u32 gObjectEventPic_HeavyBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_heavy.4bpp"); +const u32 gObjectEventPic_LoveBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_love.4bpp"); +const u32 gObjectEventPic_FriendBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_friend.4bpp"); +const u32 gObjectEventPic_MoonBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_moon.4bpp"); +const u32 gObjectEventPic_SportBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_sport.4bpp"); +#endif +// Gen V +#ifdef ITEM_DREAM_BALL +const u32 gObjectEventPic_DreamBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_dream.4bpp"); +#endif +// Gen VII +#ifdef ITEM_BEAST_BALL +const u32 gObjectEventPic_BeastBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_beast.4bpp"); +#endif +// Gen VIII +#ifdef ITEM_STRANGE_BALL +const u32 gObjectEventPic_StrangeBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_strange.4bpp"); +#endif +#endif + const u32 gObjectEventPic_Bulbasaur[] = INCBIN_U32("graphics/object_events/pics/pokemon/bulbasaur.4bpp"); const u32 gObjectEventPic_Ivysaur[] = INCBIN_U32("graphics/object_events/pics/pokemon/ivysaur.4bpp"); const u32 gObjectEventPic_Venusaur[] = INCBIN_U32("graphics/object_events/pics/pokemon/venusaur.4bpp"); @@ -788,3 +837,40 @@ const u16 gObjectEventPal_HoOh[] = INCBIN_U16("graphics/object_events/palettes/h const u16 gObjectEventPal_Lugia[] = INCBIN_U16("graphics/object_events/palettes/lugia.gbapal"); const u16 gObjectEventPaletteEmotes[] = INCBIN_U16("graphics/misc/emotes.gbapal"); + +#if OW_MON_POKEBALLS +// Palettes are small, so always include all of the palettes (no #ifdef) +// Vanilla +const u16 gObjectEventPal_MasterBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_master.gbapal"); +const u16 gObjectEventPal_UltraBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_ultra.gbapal"); +const u16 gObjectEventPal_GreatBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_great.gbapal"); +const u16 gObjectEventPal_SafariBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_safari.gbapal"); +const u16 gObjectEventPal_NetBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_net.gbapal"); +const u16 gObjectEventPal_DiveBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_dive.gbapal"); +const u16 gObjectEventPal_NestBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_nest.gbapal"); +const u16 gObjectEventPal_RepeatBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_repeat.gbapal"); +const u16 gObjectEventPal_TimerBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_timer.gbapal"); +const u16 gObjectEventPal_LuxuryBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_luxury.gbapal"); +const u16 gObjectEventPal_PremierBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_premier.gbapal"); +// Gen IV/Sinnoh +const u16 gObjectEventPal_DuskBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_dusk.gbapal"); +const u16 gObjectEventPal_HealBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_heal.gbapal"); +const u16 gObjectEventPal_QuickBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_quick.gbapal"); +const u16 gObjectEventPal_CherishBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_cherish.gbapal"); +const u16 gObjectEventPal_ParkBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_park.gbapal"); +// Gen II/Johto Apricorns +const u16 gObjectEventPal_FastBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_fast.gbapal"); +const u16 gObjectEventPal_LevelBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_level.gbapal"); +const u16 gObjectEventPal_LureBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_lure.gbapal"); +const u16 gObjectEventPal_HeavyBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_heavy.gbapal"); +const u16 gObjectEventPal_LoveBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_love.gbapal"); +const u16 gObjectEventPal_FriendBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_friend.gbapal"); +const u16 gObjectEventPal_MoonBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_moon.gbapal"); +const u16 gObjectEventPal_SportBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_sport.gbapal"); +// Gen V +const u16 gObjectEventPal_DreamBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_dream.gbapal"); +// Gen VII +const u16 gObjectEventPal_BeastBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_beast.gbapal"); +// Gen VIII +const u16 gObjectEventPal_StrangeBall[] = INCBIN_U16("graphics/object_events/pics/misc/ball_strange.gbapal"); +#endif diff --git a/src/data/object_events/object_event_graphics_info_followers.h b/src/data/object_events/object_event_graphics_info_followers.h index eb53f60d2c..6eeccde765 100644 --- a/src/data/object_events/object_event_graphics_info_followers.h +++ b/src/data/object_events/object_event_graphics_info_followers.h @@ -422,3 +422,71 @@ const struct ObjectEventGraphicsInfo gCastformObjectGraphics[] = { {0xFFFF, OBJ_EVENT_PAL_TAG_CASTFORM_RAINY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_CastformRainy, gDummySpriteAffineAnimTable}, {0xFFFF, OBJ_EVENT_PAL_TAG_CASTFORM_SNOWY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_CastformSnowy, gDummySpriteAffineAnimTable}, }; + +#if OW_MON_POKEBALLS + +#define POKEBALL_GFX_INFO(NAME) \ + [BALL_##NAME] = { \ + .tileTag = TAG_NONE, \ + .paletteTag = OBJ_EVENT_PAL_TAG_BALL_##NAME, \ + .size = 256, \ + .width = 16, \ + .height = 32, \ + .shadowSize = SHADOW_SIZE_M, \ + .inanimate = TRUE, \ + .oam = &gObjectEventBaseOam_16x32, \ + .subspriteTables = sOamTables_16x32, \ + .anims = sAnimTable_Following, \ + .images = sPicTable_Ball_##NAME, \ + .affineAnims = gDummySpriteAffineAnimTable, \ + } + + +const struct ObjectEventGraphicsInfo gPokeballGraphics[POKEBALL_COUNT] = { + // Vanilla + POKEBALL_GFX_INFO(MASTER), + POKEBALL_GFX_INFO(ULTRA), + POKEBALL_GFX_INFO(GREAT), + POKEBALL_GFX_INFO(SAFARI), + POKEBALL_GFX_INFO(NET), + POKEBALL_GFX_INFO(DIVE), + POKEBALL_GFX_INFO(NEST), + POKEBALL_GFX_INFO(REPEAT), + POKEBALL_GFX_INFO(TIMER), + POKEBALL_GFX_INFO(LUXURY), + POKEBALL_GFX_INFO(PREMIER), + // Gen IV/Sinnoh pokeballs + #ifdef ITEM_DUSK_BALL + POKEBALL_GFX_INFO(DUSK), + POKEBALL_GFX_INFO(HEAL), + POKEBALL_GFX_INFO(QUICK), + POKEBALL_GFX_INFO(CHERISH), + #endif + #ifdef ITEM_PARK_BALL + POKEBALL_GFX_INFO(PARK), + #endif + // Gen II/Johto Apricorn pokeballs + #ifdef ITEM_FAST_BALL + POKEBALL_GFX_INFO(FAST), + POKEBALL_GFX_INFO(LEVEL), + POKEBALL_GFX_INFO(LURE), + POKEBALL_GFX_INFO(HEAVY), + POKEBALL_GFX_INFO(LOVE), + POKEBALL_GFX_INFO(FRIEND), + POKEBALL_GFX_INFO(MOON), + POKEBALL_GFX_INFO(SPORT), + #endif + // Gen V + #ifdef ITEM_DREAM_BALL + POKEBALL_GFX_INFO(DREAM), + #endif + // Gen VII + #ifdef ITEM_BEAST_BALL + POKEBALL_GFX_INFO(BEAST), + #endif + // Gen VIII + #ifdef ITEM_STRANGE_BALL + POKEBALL_GFX_INFO(STRANGE), + #endif +}; +#endif diff --git a/src/data/object_events/object_event_pic_tables.h b/src/data/object_events/object_event_pic_tables.h index 975694de11..bcd5f64e90 100755 --- a/src/data/object_events/object_event_pic_tables.h +++ b/src/data/object_events/object_event_pic_tables.h @@ -1987,9 +1987,136 @@ static const struct SpriteFrameImage sPicTable_AnimatedBall[] = { overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 2), overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 3), overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 4), - overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 5), + overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 0), }; +#if OW_MON_POKEBALLS + +#define POKEBALL_PIC_FRAMES(name) \ + overworld_frame(gObjectEventPic_##name##Ball, 2, 4, 0), \ + overworld_frame(gObjectEventPic_##name##Ball, 2, 4, 1), \ + overworld_frame(gObjectEventPic_##name##Ball, 2, 4, 2), \ + overworld_frame(gObjectEventPic_##name##Ball, 2, 4, 3), \ + overworld_frame(gObjectEventPic_##name##Ball, 2, 4, 4), \ + overworld_frame(gObjectEventPic_##name##Ball, 2, 4, 0) + + +static const struct SpriteFrameImage sPicTable_Ball_MASTER[] = { + POKEBALL_PIC_FRAMES(Master), +}; + +static const struct SpriteFrameImage sPicTable_Ball_ULTRA[] = { + POKEBALL_PIC_FRAMES(Ultra), +}; + +static const struct SpriteFrameImage sPicTable_Ball_GREAT[] = { + POKEBALL_PIC_FRAMES(Great), +}; + +static const struct SpriteFrameImage sPicTable_Ball_SAFARI[] = { + POKEBALL_PIC_FRAMES(Safari), +}; + +static const struct SpriteFrameImage sPicTable_Ball_NET[] = { + POKEBALL_PIC_FRAMES(Net), +}; + +static const struct SpriteFrameImage sPicTable_Ball_DIVE[] = { + POKEBALL_PIC_FRAMES(Dive), +}; + +static const struct SpriteFrameImage sPicTable_Ball_NEST[] = { + POKEBALL_PIC_FRAMES(Nest), +}; + +static const struct SpriteFrameImage sPicTable_Ball_REPEAT[] = { + POKEBALL_PIC_FRAMES(Repeat), +}; + +static const struct SpriteFrameImage sPicTable_Ball_TIMER[] = { + POKEBALL_PIC_FRAMES(Timer), +}; + +static const struct SpriteFrameImage sPicTable_Ball_LUXURY[] = { + POKEBALL_PIC_FRAMES(Luxury), +}; + +static const struct SpriteFrameImage sPicTable_Ball_PREMIER[] = { + POKEBALL_PIC_FRAMES(Premier), +}; + +// Gen IV/Sinnoh +#ifdef ITEM_DUSK_BALL +static const struct SpriteFrameImage sPicTable_Ball_DUSK[] = { + POKEBALL_PIC_FRAMES(Dusk), +}; +static const struct SpriteFrameImage sPicTable_Ball_HEAL[] = { + POKEBALL_PIC_FRAMES(Heal), +}; +static const struct SpriteFrameImage sPicTable_Ball_QUICK[] = { + POKEBALL_PIC_FRAMES(Quick), +}; +static const struct SpriteFrameImage sPicTable_Ball_CHERISH[] = { + POKEBALL_PIC_FRAMES(Cherish), +}; +#endif +#ifdef ITEM_PARK_BALL +static const struct SpriteFrameImage sPicTable_Ball_PARK[] = { + POKEBALL_PIC_FRAMES(Park), +}; +#endif + +// Gen II/Johto Apricorns +#ifdef ITEM_FAST_BALL +static const struct SpriteFrameImage sPicTable_Ball_FAST[] = { + POKEBALL_PIC_FRAMES(Fast), +}; +static const struct SpriteFrameImage sPicTable_Ball_LEVEL[] = { + POKEBALL_PIC_FRAMES(Level), +}; +static const struct SpriteFrameImage sPicTable_Ball_LURE[] = { + POKEBALL_PIC_FRAMES(Lure), +}; +static const struct SpriteFrameImage sPicTable_Ball_HEAVY[] = { + POKEBALL_PIC_FRAMES(Heavy), +}; +static const struct SpriteFrameImage sPicTable_Ball_LOVE[] = { + POKEBALL_PIC_FRAMES(Love), +}; +static const struct SpriteFrameImage sPicTable_Ball_FRIEND[] = { + POKEBALL_PIC_FRAMES(Friend), +}; +static const struct SpriteFrameImage sPicTable_Ball_MOON[] = { + POKEBALL_PIC_FRAMES(Moon), +}; +static const struct SpriteFrameImage sPicTable_Ball_SPORT[] = { + POKEBALL_PIC_FRAMES(Sport), +}; +#endif + +// Gen V +#ifdef ITEM_DREAM_BALL +static const struct SpriteFrameImage sPicTable_Ball_DREAM[] = { + POKEBALL_PIC_FRAMES(Dream), +}; +#endif + +// Gen VII +#ifdef ITEM_BEAST_BALL +static const struct SpriteFrameImage sPicTable_Ball_BEAST[] = { + POKEBALL_PIC_FRAMES(Beast), +}; +#endif + +// Gen VIII +#ifdef ITEM_STRANGE_BALL +static const struct SpriteFrameImage sPicTable_Ball_STRANGE[] = { + POKEBALL_PIC_FRAMES(Strange), +}; +#endif + +#endif + static const struct SpriteFrameImage sPicTable_Bulbasaur[] = { overworld_frame(gObjectEventPic_Bulbasaur, 4, 4, 0), overworld_frame(gObjectEventPic_Bulbasaur, 4, 4, 1), diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 6d498aee5f..0c2116437f 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1,5 +1,6 @@ #include "global.h" #include "malloc.h" +#include "battle_anim.h" #include "battle_pyramid.h" #include "battle_script_commands.h" #include "berry.h" @@ -23,6 +24,7 @@ #include "overworld.h" #include "palette.h" #include "pokemon.h" +#include "pokeball.h" #include "random.h" #include "region_map.h" #include "script.h" @@ -483,6 +485,41 @@ const u8 gInitialMovementTypeFacingDirections[] = { #define OBJ_EVENT_PAL_TAG_CASTFORM_SUNNY 0x1125 #define OBJ_EVENT_PAL_TAG_CASTFORM_RAINY 0x1126 #define OBJ_EVENT_PAL_TAG_CASTFORM_SNOWY 0x1127 +#if OW_MON_POKEBALLS +// Vanilla +#define OBJ_EVENT_PAL_TAG_BALL_MASTER 0x1150 +#define OBJ_EVENT_PAL_TAG_BALL_ULTRA 0x1151 +#define OBJ_EVENT_PAL_TAG_BALL_GREAT 0x1152 +#define OBJ_EVENT_PAL_TAG_BALL_SAFARI 0x1153 +#define OBJ_EVENT_PAL_TAG_BALL_NET 0x1154 +#define OBJ_EVENT_PAL_TAG_BALL_DIVE 0x1155 +#define OBJ_EVENT_PAL_TAG_BALL_NEST 0x1156 +#define OBJ_EVENT_PAL_TAG_BALL_REPEAT 0x1157 +#define OBJ_EVENT_PAL_TAG_BALL_TIMER 0x1158 +#define OBJ_EVENT_PAL_TAG_BALL_LUXURY 0x1159 +#define OBJ_EVENT_PAL_TAG_BALL_PREMIER 0x115A +// Gen IV/Sinnoh +#define OBJ_EVENT_PAL_TAG_BALL_DUSK 0x115B +#define OBJ_EVENT_PAL_TAG_BALL_HEAL 0x115C +#define OBJ_EVENT_PAL_TAG_BALL_QUICK 0x115D +#define OBJ_EVENT_PAL_TAG_BALL_CHERISH 0x115E +#define OBJ_EVENT_PAL_TAG_BALL_PARK 0x115F +// Gen II/Johto Apricorns +#define OBJ_EVENT_PAL_TAG_BALL_FAST 0x1160 +#define OBJ_EVENT_PAL_TAG_BALL_LEVEL 0x1161 +#define OBJ_EVENT_PAL_TAG_BALL_LURE 0x1162 +#define OBJ_EVENT_PAL_TAG_BALL_HEAVY 0x1163 +#define OBJ_EVENT_PAL_TAG_BALL_LOVE 0x1164 +#define OBJ_EVENT_PAL_TAG_BALL_FRIEND 0x1165 +#define OBJ_EVENT_PAL_TAG_BALL_MOON 0x1166 +#define OBJ_EVENT_PAL_TAG_BALL_SPORT 0x1167 +// Gen V +#define OBJ_EVENT_PAL_TAG_BALL_DREAM 0x1168 +// Gen VII +#define OBJ_EVENT_PAL_TAG_BALL_BEAST 0x1169 +// Gen VIII +#define OBJ_EVENT_PAL_TAG_BALL_STRANGE 0x116A +#endif #define OBJ_EVENT_PAL_TAG_EMOTES 0x8002 // Not a real OW palette tag; used for the white flash applied to followers #define OBJ_EVENT_PAL_TAG_WHITE (OBJ_EVENT_PAL_TAG_NONE - 1) @@ -536,6 +573,53 @@ static const struct SpritePalette sObjectEventSpritePalettes[] = { {gObjectEventPal_CastformSunny, OBJ_EVENT_PAL_TAG_CASTFORM_SUNNY}, {gObjectEventPal_CastformRainy, OBJ_EVENT_PAL_TAG_CASTFORM_RAINY}, {gObjectEventPal_CastformSnowy, OBJ_EVENT_PAL_TAG_CASTFORM_SNOWY}, + #if OW_MON_POKEBALLS + // Vanilla + {gObjectEventPal_MasterBall, OBJ_EVENT_PAL_TAG_BALL_MASTER}, + {gObjectEventPal_UltraBall, OBJ_EVENT_PAL_TAG_BALL_ULTRA}, + {gObjectEventPal_GreatBall, OBJ_EVENT_PAL_TAG_BALL_GREAT}, + {gObjectEventPal_SafariBall, OBJ_EVENT_PAL_TAG_BALL_SAFARI}, + {gObjectEventPal_NetBall, OBJ_EVENT_PAL_TAG_BALL_NET}, + {gObjectEventPal_DiveBall, OBJ_EVENT_PAL_TAG_BALL_DIVE}, + {gObjectEventPal_NestBall, OBJ_EVENT_PAL_TAG_BALL_NEST}, + {gObjectEventPal_RepeatBall, OBJ_EVENT_PAL_TAG_BALL_REPEAT}, + {gObjectEventPal_TimerBall, OBJ_EVENT_PAL_TAG_BALL_TIMER}, + {gObjectEventPal_LuxuryBall, OBJ_EVENT_PAL_TAG_BALL_LUXURY}, + {gObjectEventPal_PremierBall, OBJ_EVENT_PAL_TAG_BALL_PREMIER}, + // Gen IV/Sinnoh pokeballs + #ifdef ITEM_DUSK_BALL + {gObjectEventPal_DuskBall, OBJ_EVENT_PAL_TAG_BALL_DUSK}, + {gObjectEventPal_HealBall, OBJ_EVENT_PAL_TAG_BALL_HEAL}, + {gObjectEventPal_QuickBall, OBJ_EVENT_PAL_TAG_BALL_QUICK}, + {gObjectEventPal_CherishBall, OBJ_EVENT_PAL_TAG_BALL_CHERISH}, + #endif + #ifdef ITEM_PARK_BALL + {gObjectEventPal_ParkBall, OBJ_EVENT_PAL_TAG_BALL_PARK}, + #endif + // Gen II/Johto Apricorn pokeballs + #ifdef ITEM_FAST_BALL + {gObjectEventPal_FastBall, OBJ_EVENT_PAL_TAG_BALL_FAST}, + {gObjectEventPal_LevelBall, OBJ_EVENT_PAL_TAG_BALL_LEVEL}, + {gObjectEventPal_LureBall, OBJ_EVENT_PAL_TAG_BALL_LURE}, + {gObjectEventPal_HeavyBall, OBJ_EVENT_PAL_TAG_BALL_HEAVY}, + {gObjectEventPal_LoveBall, OBJ_EVENT_PAL_TAG_BALL_LOVE}, + {gObjectEventPal_FriendBall, OBJ_EVENT_PAL_TAG_BALL_FRIEND}, + {gObjectEventPal_MoonBall, OBJ_EVENT_PAL_TAG_BALL_MOON}, + {gObjectEventPal_SportBall, OBJ_EVENT_PAL_TAG_BALL_SPORT}, + #endif + // Gen V + #ifdef ITEM_DREAM_BALL + {gObjectEventPal_DreamBall, OBJ_EVENT_PAL_TAG_BALL_DREAM}, + #endif + // Gen VII + #ifdef ITEM_BEAST_BALL + {gObjectEventPal_BeastBall, OBJ_EVENT_PAL_TAG_BALL_BEAST}, + #endif + // Gen VIII + #ifdef ITEM_STRANGE_BALL + {gObjectEventPal_StrangeBall, OBJ_EVENT_PAL_TAG_BALL_STRANGE}, + #endif + #endif {gObjectEventPaletteEmotes, OBJ_EVENT_PAL_TAG_EMOTES}, {NULL, OBJ_EVENT_PAL_TAG_NONE}, }; @@ -6669,6 +6753,26 @@ static u8 LoadFillColorPalette(u16 color, u16 paletteTag, struct Sprite *sprite) return UpdateSpritePalette(&dynamicPalette, sprite); } +static void ObjectEventSetPokeballGfx(struct ObjectEvent *objEvent) { + #if OW_MON_POKEBALLS + u32 ball = BALL_POKE; + if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER) { + struct Pokemon *mon = GetFirstLiveMon(); + if (mon) + ball = ItemIdToBallId(GetMonData(mon, MON_DATA_POKEBALL)); + } + + if (ball != BALL_POKE && ball < POKEBALL_COUNT) { + const struct ObjectEventGraphicsInfo *info = &gPokeballGraphics[ball]; + if (info->tileTag == TAG_NONE) { + ObjectEventSetGraphics(objEvent, info); + return; + } + } + #endif + ObjectEventSetGraphicsId(objEvent, OBJ_EVENT_GFX_ANIMATED_BALL); +} + bool8 MovementAction_ExitPokeball_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 direction = gObjectEvents[gPlayerAvatar.objectEventId].facingDirection; objectEvent->invisible = FALSE; @@ -6682,7 +6786,7 @@ bool8 MovementAction_ExitPokeball_Step0(struct ObjectEvent *objectEvent, struct sprite->data[6] = 1; // slow speed } sprite->data[6] |= (direction == DIR_EAST ? 1 : 0) << 4; - ObjectEventSetGraphicsId(objectEvent, OBJ_EVENT_GFX_ANIMATED_BALL); + ObjectEventSetPokeballGfx(objectEvent); objectEvent->inanimate = FALSE; return MovementAction_ExitPokeball_Step1(objectEvent, sprite); } @@ -6801,7 +6905,7 @@ bool8 MovementAction_EnterPokeball_Step1(struct ObjectEvent *objectEvent, struct sprite->affineAnimEnded = TRUE; FreeSpriteOamMatrix(sprite); sprite->oam.affineMode = ST_OAM_AFFINE_OFF; - ObjectEventSetGraphicsId(objectEvent, OBJ_EVENT_GFX_ANIMATED_BALL); + ObjectEventSetPokeballGfx(objectEvent); objectEvent->inanimate = FALSE; } return FALSE;