Clarify contest heart tiles

This commit is contained in:
GriffinR 2021-06-21 13:48:03 -04:00
parent a21ceb2e3c
commit 810b51f96c
3 changed files with 29 additions and 19 deletions

View File

@ -4,6 +4,7 @@
#define APPLAUSE_METER_SIZE 5
#define CONTEST_NUM_APPEALS 5
#define CONTEST_LAST_APPEAL (CONTEST_NUM_APPEALS - 1)
#define MAX_CONTEST_MOVE_HEARTS 8
#define LINK_CONTEST_FLAG_IS_LINK (1 << 0)
#define LINK_CONTEST_FLAG_IS_WIRELESS (1 << 1)

View File

@ -258,6 +258,11 @@ enum {
#define TAG_BLINK_EFFECT_CONTESTANT2 0x80EA
#define TAG_BLINK_EFFECT_CONTESTANT3 0x80EB
#define TILE_FILLED_APPEAL_HEART 0x5012
#define TILE_FILLED_JAM_HEART 0x5014
#define TILE_EMPTY_APPEAL_HEART 0x5035
#define TILE_EMPTY_JAM_HEART 0x5036
enum {
SLIDER_HEART_ANIM_NORMAL,
SLIDER_HEART_ANIM_DISAPPEAR,
@ -3203,27 +3208,25 @@ static void PrintContestMoveDescription(u16 a)
ContestBG_FillBoxWithIncrementingTile(0, categoryTile, 0x0b, 0x1f, 0x05, 0x01, 0x11, 0x01);
ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01);
// Appeal hearts
if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF)
numHearts = 0;
else
numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10;
if (numHearts > 8)
numHearts = 8;
// Filled-in hearts
ContestBG_FillBoxWithTile(0, 0x5035, 0x15, 0x1f, 0x08, 0x01, 0x11);
// Empty hearts
ContestBG_FillBoxWithTile(0, 0x5012, 0x15, 0x1f, numHearts, 0x01, 0x11);
if (numHearts > MAX_CONTEST_MOVE_HEARTS)
numHearts = MAX_CONTEST_MOVE_HEARTS;
ContestBG_FillBoxWithTile(0, TILE_EMPTY_APPEAL_HEART, 0x15, 0x1f, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11);
ContestBG_FillBoxWithTile(0, TILE_FILLED_APPEAL_HEART, 0x15, 0x1f, numHearts, 0x01, 0x11);
// Jam hearts
if (gContestEffects[gContestMoves[a].effect].jam == 0xFF)
numHearts = 0;
else
numHearts = gContestEffects[gContestMoves[a].effect].jam / 10;
if (numHearts > 8)
numHearts = 8;
// Filled-in hearts
ContestBG_FillBoxWithTile(0, 0x5036, 0x15, 0x20, 0x08, 0x01, 0x11);
// Empty hearts
ContestBG_FillBoxWithTile(0, 0x5014, 0x15, 0x20, numHearts, 0x01, 0x11);
if (numHearts > MAX_CONTEST_MOVE_HEARTS)
numHearts = MAX_CONTEST_MOVE_HEARTS;
ContestBG_FillBoxWithTile(0, TILE_EMPTY_JAM_HEART, 0x15, 0x20, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11);
ContestBG_FillBoxWithTile(0, TILE_FILLED_JAM_HEART, 0x15, 0x20, numHearts, 0x01, 0x11);
FillWindowPixelBuffer(WIN_MOVE_DESCRIPTION, PIXEL_FILL(0));
Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[a].effect]);

View File

@ -119,6 +119,11 @@ enum
SPRITE_ARR_ID_COUNT = SPRITE_ARR_ID_MOVE_SELECTOR2 + MOVE_SELECTOR_SPRITES_COUNT
};
#define TILE_EMPTY_APPEAL_HEART 0x1039
#define TILE_FILLED_APPEAL_HEART 0x103A
#define TILE_FILLED_JAM_HEART 0x103C
#define TILE_EMPTY_JAM_HEART 0x103D
static EWRAM_DATA struct PokemonSummaryScreenData
{
/*0x00*/ union {
@ -2645,29 +2650,30 @@ static void DrawContestMoveHearts(u16 move)
if (move != MOVE_NONE)
{
// Draw appeal hearts
u8 effectValue = gContestEffects[gContestMoves[move].effect].appeal;
if (effectValue != 0xFF)
effectValue /= 10;
for (i = 0; i < 8; i++)
for (i = 0; i < MAX_CONTEST_MOVE_HEARTS; i++)
{
if (effectValue != 0xFF && i < effectValue)
tilemap[(i / 4 * 32) + (i & 3) + 0x1E6] = 0x103A;
tilemap[(i / 4 * 32) + (i & 3) + 0x1E6] = TILE_FILLED_APPEAL_HEART;
else
tilemap[(i / 4 * 32) + (i & 3) + 0x1E6] = 0x1039;
tilemap[(i / 4 * 32) + (i & 3) + 0x1E6] = TILE_EMPTY_APPEAL_HEART;
}
// Draw jam hearts
effectValue = gContestEffects[gContestMoves[move].effect].jam;
if (effectValue != 0xFF)
effectValue /= 10;
for (i = 0; i < 8; i++)
for (i = 0; i < MAX_CONTEST_MOVE_HEARTS; i++)
{
if (effectValue != 0xFF && i < effectValue)
tilemap[(i / 4 * 32) + (i & 3) + 0x226] = 0x103C;
tilemap[(i / 4 * 32) + (i & 3) + 0x226] = TILE_FILLED_JAM_HEART;
else
tilemap[(i / 4 * 32) + (i & 3) + 0x226] = 0x103D;
tilemap[(i / 4 * 32) + (i & 3) + 0x226] = TILE_EMPTY_JAM_HEART;
}
}
}