More constants in use for dynamism

This commit is contained in:
W1serV1ser committed 2022-03-23 11:55:08 -07:00
1 parent 52c4a9c868
commit 8ee84b5843
1 file changed
+23 -21
+23 -21
View File
@@ -3779,11 +3779,13 @@ static void SparklePokeballCallback(struct Sprite *sprite)
player->fixedPriority = FALSE;
// Shift the location of the sparkle, depending on which way the follower will be facing
// Gen 3 OBJ_EVENT_GFX constants are 25 too high due to OLD_UNOWN constants.
#ifndef POKEMON_EXPANSION
// Gen 3+ OBJ_EVENT_GFX constants are 25 too high due to OLD_UNOWN constants.
if (gSaveBlock2Ptr->follower.graphicsId > OBJ_EVENT_GFX_CELEBI)
graphicsId = gSaveBlock2Ptr->follower.graphicsId - 239 - 25;
graphicsId = gSaveBlock2Ptr->follower.graphicsId - OBJ_EVENT_GFX_BULBASAUR - 25;
else
graphicsId = gSaveBlock2Ptr->follower.graphicsId - 239;
#endif
graphicsId = gSaveBlock2Ptr->follower.graphicsId - OBJ_EVENT_GFX_BULBASAUR;
switch(gObjectEvents[gPlayerAvatar.objectEventId].facingDirection)
{
@@ -3824,7 +3826,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
if (IsBigSprite(follower->graphicsId))
{
// North sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3837,7 +3839,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// NorthEast sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3850,7 +3852,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// East sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3863,7 +3865,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// SouthEast sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3876,7 +3878,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// South sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3889,7 +3891,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// SouthWest sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3902,7 +3904,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// West sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3915,7 +3917,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// NorthWest sparkle
spriteId = CreateObjectGraphicsSprite(501, &BigSparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &BigSparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3930,7 +3932,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
else
{
// North sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3942,7 +3944,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// NorthEast sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3954,7 +3956,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// East sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3966,7 +3968,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// SouthEast sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3978,7 +3980,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// South sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -3990,7 +3992,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// SouthWest sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -4002,7 +4004,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// West sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -4014,7 +4016,7 @@ static void SparklePokeballCallback(struct Sprite *sprite)
}
// NorthWest sparkle
spriteId = CreateObjectGraphicsSprite(501, &SparkleCallback, x, y, 0);
spriteId = CreateObjectGraphicsSprite(OBJ_EVENT_GFX_EXPANDING_SPARKLE, &SparkleCallback, x, y, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
@@ -4126,7 +4128,7 @@ void FollowerPokeballSparkle(void)
player->fixedPriority = TRUE;
SeekSpriteAnim(&gSprites[follower->spriteId], 0);
ObjectEventForceSetHeldMovement(follower, 0xA5);
ObjectEventForceSetHeldMovement(follower, MOVEMENT_ACTION_FOLLOWING_POKEMON_GROW);
}
}
@@ -4134,7 +4136,7 @@ void FollowerIntoPokeball(void)
{
if (gObjectEvents[gSaveBlock2Ptr->follower.objId].invisible == FALSE && gSaveBlock2Ptr->follower.comeOutDoorStairs == 0 && gSaveBlock2Ptr->follower.inProgress)
{
ObjectEventForceSetHeldMovement(&gObjectEvents[gSaveBlock2Ptr->follower.objId], 0xA4);
ObjectEventForceSetHeldMovement(&gObjectEvents[gSaveBlock2Ptr->follower.objId], MOVEMENT_ACTION_FOLLOWING_POKEMON_SHRINK);
gSpecialVar_Unused_0x8014 = 1;
}
}