Added new follower pokeballs & toggle.

Credit: shikashipx
This commit is contained in:
Ariel A 2024-01-21 16:56:45 -05:00
parent 630541c56b
commit b56158428e
34 changed files with 395 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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),

View file

@ -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;