Merge branch 'master' of https://github.com/pret/pokeemerald into ui-standardize

This commit is contained in:
GriffinR
2023-01-18 11:07:12 -05:00
1149 changed files with 44393 additions and 46317 deletions

View File

@@ -318,10 +318,17 @@ static const struct SpriteTemplate sHealthbarSpriteTemplates[MAX_BATTLERS_COUNT]
}
};
/* v-- Origin
[0 + ][1 ]
[ ][ ]
[ ][ ]
[______________][______] 96x40
[2 ][3 ][4 ]
*/
static const struct Subsprite sUnused_Subsprites_0[] =
{
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
@@ -337,7 +344,7 @@ static const struct Subsprite sUnused_Subsprites_0[] =
.priority = 1
},
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -362,10 +369,11 @@ static const struct Subsprite sUnused_Subsprites_0[] =
}
};
// This subsprite table has the same layout as above, but offset by 64 base tiles.
static const struct Subsprite sUnused_Subsprites_2[] =
{
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
@@ -381,7 +389,7 @@ static const struct Subsprite sUnused_Subsprites_2[] =
.priority = 1
},
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 32,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -406,10 +414,16 @@ static const struct Subsprite sUnused_Subsprites_2[] =
}
};
/* v-- Origin
[0 + ][1 ]
[ ][ ]
[ ][ ]
[ ][ ] 96x32
*/
static const struct Subsprite sUnused_Subsprites_1[] =
{
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
@@ -426,10 +440,11 @@ static const struct Subsprite sUnused_Subsprites_1[] =
}
};
// Same as above
static const struct Subsprite sUnused_Subsprites_3[] =
{
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 0,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
@@ -446,10 +461,13 @@ static const struct Subsprite sUnused_Subsprites_3[] =
}
};
/* v-- Origin
[0 + ][1 ] 64x8
*/
static const struct Subsprite sHealthBar_Subsprites_Player[] =
{
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -466,10 +484,14 @@ static const struct Subsprite sHealthBar_Subsprites_Player[] =
}
};
/* v-- Origin
[] [0 + ][1 ] 8x8 + 64x8
2^ ^--- Note 8px space
*/
static const struct Subsprite sHealthBar_Subsprites_Opponent[] =
{
{
.x = DISPLAY_WIDTH,
.x = -16,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -485,7 +507,7 @@ static const struct Subsprite sHealthBar_Subsprites_Opponent[] =
.priority = 1
},
{
.x = DISPLAY_WIDTH - 16,
.x = -32,
.y = 0,
.shape = SPRITE_SHAPE(8x8),
.size = SPRITE_SIZE(8x8),
@@ -507,11 +529,13 @@ static const struct SubspriteTable sHealthBar_SubspriteTables[] =
[B_SIDE_PLAYER] = {ARRAY_COUNT(sHealthBar_Subsprites_Player), sHealthBar_Subsprites_Player},
[B_SIDE_OPPONENT] = {ARRAY_COUNT(sHealthBar_Subsprites_Opponent), sHealthBar_Subsprites_Opponent}
};
/* v-- Origin
[0 ][1 ][2 ][3 ] 128x8
*/
static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] =
{
{
.x = 32 * 5,
.x = 32 * -3,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -519,7 +543,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] =
.priority = 1
},
{
.x = 32 * 6,
.x = 32 * -2,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -527,7 +551,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] =
.priority = 1
},
{
.x = 32 * 7,
.x = 32 * -1,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -544,10 +568,14 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Enter[] =
}
};
/* v-- Origin
[0 ][1 ][2 ][3 ][4 ][5 ] 192x8
^-- uses same tiles --^
*/
static const struct Subsprite sStatusSummaryBar_Subsprites_Exit[] =
{
{
.x = 32 * 5,
.x = 32 * -3,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -555,7 +583,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Exit[] =
.priority = 1
},
{
.x = 32 * 6,
.x = 32 * -2,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -563,7 +591,7 @@ static const struct Subsprite sStatusSummaryBar_Subsprites_Exit[] =
.priority = 1
},
{
.x = 32 * 7,
.x = 32 * -1,
.y = 0,
.shape = SPRITE_SHAPE(32x8),
.size = SPRITE_SIZE(32x8),
@@ -2171,9 +2199,9 @@ void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elem
species = GetMonData(mon, MON_DATA_SPECIES);
level = GetMonData(mon, MON_DATA_LEVEL);
exp = GetMonData(mon, MON_DATA_EXP);
currLevelExp = gExperienceTables[gBaseStats[species].growthRate][level];
currLevelExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
currExpBarValue = exp - currLevelExp;
maxExpBarValue = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLevelExp;
maxExpBarValue = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLevelExp;
SetBattleBarStruct(battlerId, healthboxSpriteId, maxExpBarValue, currExpBarValue, isDoubles);
MoveBattleBar(battlerId, healthboxSpriteId, EXP_BAR, 0);
}