Merge pull request #1469 from GriffinRichards/fix-contesthearts

Clarify contest heart tiles
This commit is contained in:
PikalaxALT 2021-06-21 13:59:50 -04:00 committed by GitHub
commit e0b58592b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 19 deletions

View File

@ -4,6 +4,7 @@
#define APPLAUSE_METER_SIZE 5 #define APPLAUSE_METER_SIZE 5
#define CONTEST_NUM_APPEALS 5 #define CONTEST_NUM_APPEALS 5
#define CONTEST_LAST_APPEAL (CONTEST_NUM_APPEALS - 1) #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_LINK (1 << 0)
#define LINK_CONTEST_FLAG_IS_WIRELESS (1 << 1) #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_CONTESTANT2 0x80EA
#define TAG_BLINK_EFFECT_CONTESTANT3 0x80EB #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 { enum {
SLIDER_HEART_ANIM_NORMAL, SLIDER_HEART_ANIM_NORMAL,
SLIDER_HEART_ANIM_DISAPPEAR, 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, 0x0b, 0x1f, 0x05, 0x01, 0x11, 0x01);
ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01); ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01);
// Appeal hearts
if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF) if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF)
numHearts = 0; numHearts = 0;
else else
numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10; numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10;
if (numHearts > 8) if (numHearts > MAX_CONTEST_MOVE_HEARTS)
numHearts = 8; numHearts = MAX_CONTEST_MOVE_HEARTS;
// Filled-in hearts ContestBG_FillBoxWithTile(0, TILE_EMPTY_APPEAL_HEART, 0x15, 0x1f, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11);
ContestBG_FillBoxWithTile(0, 0x5035, 0x15, 0x1f, 0x08, 0x01, 0x11); ContestBG_FillBoxWithTile(0, TILE_FILLED_APPEAL_HEART, 0x15, 0x1f, numHearts, 0x01, 0x11);
// Empty hearts
ContestBG_FillBoxWithTile(0, 0x5012, 0x15, 0x1f, numHearts, 0x01, 0x11);
// Jam hearts
if (gContestEffects[gContestMoves[a].effect].jam == 0xFF) if (gContestEffects[gContestMoves[a].effect].jam == 0xFF)
numHearts = 0; numHearts = 0;
else else
numHearts = gContestEffects[gContestMoves[a].effect].jam / 10; numHearts = gContestEffects[gContestMoves[a].effect].jam / 10;
if (numHearts > 8) if (numHearts > MAX_CONTEST_MOVE_HEARTS)
numHearts = 8; numHearts = MAX_CONTEST_MOVE_HEARTS;
// Filled-in hearts ContestBG_FillBoxWithTile(0, TILE_EMPTY_JAM_HEART, 0x15, 0x20, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11);
ContestBG_FillBoxWithTile(0, 0x5036, 0x15, 0x20, 0x08, 0x01, 0x11); ContestBG_FillBoxWithTile(0, TILE_FILLED_JAM_HEART, 0x15, 0x20, numHearts, 0x01, 0x11);
// Empty hearts
ContestBG_FillBoxWithTile(0, 0x5014, 0x15, 0x20, numHearts, 0x01, 0x11);
FillWindowPixelBuffer(WIN_MOVE_DESCRIPTION, PIXEL_FILL(0)); FillWindowPixelBuffer(WIN_MOVE_DESCRIPTION, PIXEL_FILL(0));
Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[a].effect]); 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 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 static EWRAM_DATA struct PokemonSummaryScreenData
{ {
/*0x00*/ union { /*0x00*/ union {
@ -2645,29 +2650,30 @@ static void DrawContestMoveHearts(u16 move)
if (move != MOVE_NONE) if (move != MOVE_NONE)
{ {
// Draw appeal hearts
u8 effectValue = gContestEffects[gContestMoves[move].effect].appeal; u8 effectValue = gContestEffects[gContestMoves[move].effect].appeal;
if (effectValue != 0xFF) if (effectValue != 0xFF)
effectValue /= 10; effectValue /= 10;
for (i = 0; i < 8; i++) for (i = 0; i < MAX_CONTEST_MOVE_HEARTS; i++)
{ {
if (effectValue != 0xFF && i < effectValue) 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 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; effectValue = gContestEffects[gContestMoves[move].effect].jam;
if (effectValue != 0xFF) if (effectValue != 0xFF)
effectValue /= 10; effectValue /= 10;
for (i = 0; i < 8; i++) for (i = 0; i < MAX_CONTEST_MOVE_HEARTS; i++)
{ {
if (effectValue != 0xFF && i < effectValue) 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 else
tilemap[(i / 4 * 32) + (i & 3) + 0x226] = 0x103D; tilemap[(i / 4 * 32) + (i & 3) + 0x226] = TILE_EMPTY_JAM_HEART;
} }
} }
} }