diff --git a/README.md b/README.md index c3648a0443..893678a2dc 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ This is a fork of the [matching decompilation](https://github.com/pret/pokeemera This fork tries to maintain vanilla compatibility whenever possible. It doesn't increase the size of any save data structure or the object event structure. -There are several branches, each with one main feature: +There are several branches, each with one main feature (and sometimes some extra stuff): **followers** branch: * [HGSS-style pokémon followers](https://bulbapedia.bulbagarden.net/wiki/Walking_Pok%C3%A9mon#Pok.C3.A9mon_HeartGold_and_SoulSilver) for all 386 pokémon, including emotes, the 28 Unown forms and a majority of follower messages. * Dynamic overworld palettes & reflections compatible with vanilla berry trees. -* Function to change a pokemon's nature while preserving most properties of its PID. -* Function to detect newer emulators/new GBA hardware. +* PID (but not legitimacy) preserving Pokémon nature-changing function +* Function to detect modern emulators/GBA hardware. **icons** branch: * Everything from the **followers** branch. @@ -28,6 +28,11 @@ There are several branches, each with one main feature: * WIP interframe-blended lamp lights at night, i.e in Rustboro. * HGSS-style alpha-blended shadows for object events. +Additional branches to mention: + +* `followers-expanded-id` - like `followers`, but includes backwards-compatible 16-bit graphics IDs for object events. +* `lighting-expanded-id` - like the above but for `lighting`. + To set up the repository, see [INSTALL.md](INSTALL.md). ## See also diff --git a/src/contest_util.c b/src/contest_util.c index c2b226a180..76a9fd2dfd 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -2505,6 +2505,12 @@ void SetLinkContestPlayerGfx(void) } } +// copied from event_object_movement +#define OBJ_EVENT_PAL_TAG_BRENDAN 0x1100 +#define OBJ_EVENT_PAL_TAG_MAY 0x1110 +#define OBJ_EVENT_PAL_TAG_RS_BRENDAN 0x1122 +#define OBJ_EVENT_PAL_TAG_RS_MAY 0x1123 + void LoadLinkContestPlayerPalettes(void) { int i; @@ -2513,28 +2519,28 @@ void LoadLinkContestPlayerPalettes(void) struct Sprite *sprite; static const u8 sContestantLocalIds[CONTESTANT_COUNT] = { 3, 4, 5, 14 }; - gReservedSpritePaletteCount = 12; + // gReservedSpritePaletteCount = 12; + // TODO: Does dynamically allocating link player palettes break link contests? if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) { for (i = 0; i < gNumLinkContestPlayers; i++) { objectEventId = GetObjectEventIdByLocalIdAndMap(sContestantLocalIds[i], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); sprite = &gSprites[gObjectEvents[objectEventId].spriteId]; - sprite->oam.paletteNum = 6 + i; version = (u8)gLinkPlayers[i].version; if (version == VERSION_RUBY || version == VERSION_SAPPHIRE) { if (gLinkPlayers[i].gender == MALE) - LoadPalette(gObjectEventPal_RubySapphireBrendan, OBJ_PLTT_ID(6 + i), PLTT_SIZE_4BPP); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_RS_BRENDAN); else - LoadPalette(gObjectEventPal_RubySapphireMay, OBJ_PLTT_ID(6 + i), PLTT_SIZE_4BPP); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_RS_MAY); } else { if (gLinkPlayers[i].gender == MALE) - LoadPalette(gObjectEventPal_Brendan, OBJ_PLTT_ID(6 + i), PLTT_SIZE_4BPP); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_BRENDAN); else - LoadPalette(gObjectEventPal_May, OBJ_PLTT_ID(6 + i), PLTT_SIZE_4BPP); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_MAY); } } } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 690cfd790b..a82f7f7ead 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -5066,6 +5066,11 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri ClearObjectEventMovement(objectEvent, sprite); if (objectEvent->invisible) { // Animate exiting pokeball + // Player is jumping, but follower is invisible + if (PlayerGetCopyableMovement() == COPY_MOVE_JUMP2) { + sprite->sTypeFuncId = 0; // return to shadowing state + return FALSE; + } MoveObjectEventToMapCoords(objectEvent, targetX, targetY); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_EXIT_POKEBALL); objectEvent->singleMovementActive = 1;