Custom anim table follower macro & Farfetch'd example (#5309)

Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
hedara90 2024-09-13 15:30:01 +02:00 committed by GitHub
parent 3d8b73300a
commit 9633cefd11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 26 additions and 2 deletions

View File

@ -113,6 +113,7 @@ extern const struct OamData gObjectEventBaseOam_64x64;
extern const struct SubspriteTable sOamTables_32x32[];
extern const struct SubspriteTable sOamTables_64x64[];
extern const union AnimCmd *const sAnimTable_Following[];
extern const union AnimCmd *const sAnimTable_Following_Asym[];
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
extern const u8 gReflectionEffectPaletteMap[];

View File

@ -1173,7 +1173,7 @@ const union AnimCmd *const sAnimTable_Following[] = {
};
// Like the above, but has separate frames for facing right
static const union AnimCmd *const sAnimTable_Following_Asym[] = {
const union AnimCmd *const sAnimTable_Following_Asym[] = {
[ANIM_STD_FACE_SOUTH] = sAnim_FaceSouth,
[ANIM_STD_FACE_NORTH] = sAnim_FaceNorth2F,
[ANIM_STD_FACE_WEST] = sAnim_FaceWest2F,

View File

@ -46,8 +46,30 @@
.affineAnims = gDummySpriteAffineAnimTable, \
}, \
OVERWORLD_PAL(__VA_ARGS__)
#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...) \
.overworldData = { \
.tileTag = TAG_NONE, \
.paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \
.reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \
.size = (_size == SIZE_32x32 ? 512 : 2048), \
.width = (_size == SIZE_32x32 ? 32 : 64), \
.height = (_size == SIZE_32x32 ? 32 : 64), \
.paletteSlot = PALSLOT_NPC_1, \
.shadowSize = shadow, \
.inanimate = FALSE, \
.compressed = COMP, \
.tracks = _tracks, \
.oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \
.subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \
.anims = _anims, \
.images = picTable, \
.affineAnims = gDummySpriteAffineAnimTable, \
}, \
OVERWORLD_PAL(__VA_ARGS__)
#else
#define OVERWORLD(picTable, _size, shadow, _tracks, ...)
#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...)
#endif //OW_POKEMON_OBJECT_EVENTS
// Maximum value for a female Pokémon is 254 (MON_FEMALE) which is 100% female.

View File

@ -9515,11 +9515,12 @@ const struct SpeciesInfo gSpeciesInfoGen1[] =
.iconSprite = gMonIcon_Farfetchd,
.iconPalIndex = 1,
FOOTPRINT(Farfetchd)
OVERWORLD(
OVERWORLD_SET_ANIM(
sPicTable_Farfetchd,
SIZE_32x32,
SHADOW_SIZE_M,
TRACKS_NONE,
sAnimTable_Following_Asym,
gOverworldPalette_Farfetchd,
gShinyOverworldPalette_Farfetchd
)