Enable GF move names by default

In contests, even FONT_NARROWER isn't sufficient to prevent clipping in
all cases. e.g. Stomping Tantrum clips. We have decided to accept that
cost to make the rest of the user experience better, but downstream
projects that don't like that trade-off can either a) alter the contest
UI, or b) set B_EXPANDED_MOVE_NAMES to FALSE.
This commit is contained in:
Martin Griffin 2024-04-06 13:00:30 +01:00
parent 738fade50a
commit a1d2460372
24 changed files with 173 additions and 64 deletions

View File

@ -214,7 +214,7 @@
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
#define B_SHOW_CATEGORY_ICON TRUE // If set to TRUE, it will show an icon in the summary showing the move's category.
#define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations.
#define B_EXPANDED_MOVE_NAMES FALSE // If set to TRUE, move names are increased from 12 characters to 16 characters.
#define B_EXPANDED_MOVE_NAMES TRUE // If set to FALSE, move names are decreased from 16 characters to 12 characters.
#define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles.
#define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option

7
include/config/test.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef GUARD_CONFIG_TEST_H
#define GUARD_CONFIG_TEST_H
#undef B_EXPANDED_MOVE_NAMES
#define B_EXPANDED_MOVE_NAMES TRUE
#endif // GUARD_CONFIG_TEST_H

View File

@ -170,4 +170,8 @@
#define CONNECTION_DIVE 5
#define CONNECTION_EMERGE 6
#if TESTING
#include "config/test.h"
#endif
#endif // GUARD_CONSTANTS_GLOBAL_H

View File

@ -3949,6 +3949,14 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
printerTemplate.bgColor = textInfo[windowId].bgColor;
printerTemplate.shadowColor = textInfo[windowId].shadowColor;
if (B_WIN_MOVE_NAME_1 <= windowId && windowId <= B_WIN_MOVE_NAME_4)
{
// We cannot check the actual width of the window because
// B_WIN_MOVE_NAME_1 and B_WIN_MOVE_NAME_3 are 16 wide for
// Z-move details.
printerTemplate.fontId = GetFontIdToFit(text, printerTemplate.fontId, printerTemplate.letterSpacing, 8 * TILE_WIDTH);
}
if (printerTemplate.x == 0xFF)
{
u32 width = GetBattleWindowTemplatePixelWidth(gBattleScripting.windowsType, windowId);

View File

@ -1085,6 +1085,12 @@ static const s8 sContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGO
}
};
static void CopyMoveNameToFit(u8 *dest, u32 move)
{
u8 *end = StringCopy(dest, GetMoveName(move));
WrapFontIdToFit(dest, end, FONT_NORMAL, 84);
}
static void TaskDummy1(u8 taskId)
{
}
@ -1636,7 +1642,7 @@ static void Task_ShowMoveSelectScreen(u8 taskId)
moveNameBuffer = StringCopy(moveNameBuffer, GetMoveName(move));
FillWindowPixelBuffer(i + MOVE_WINDOWS_START, PIXEL_FILL(0));
Contest_PrintTextToBg0WindowAt(i + MOVE_WINDOWS_START, moveName, 5, 1, FONT_NARROW);
Contest_PrintTextToBg0WindowAt(i + MOVE_WINDOWS_START, moveName, 5, 1, GetFontIdToFit(moveName, FONT_NARROW, 0, WindowWidthPx(i + MOVE_WINDOWS_START) - 11));
}
DrawMoveSelectArrow(eContest.playerMoveChoice);
@ -2295,7 +2301,7 @@ static void Task_DoAppeals(u8 taskId)
if (eContestantStatus[contestant].overrideCategoryExcitementMod)
{
r3 = 1;
StringCopy(gStringVar3, GetMoveName(eContestantStatus[contestant].currMove));
CopyMoveNameToFit(gStringVar3, eContestantStatus[contestant].currMove);
}
else
{
@ -2430,7 +2436,7 @@ static void Task_DoAppeals(u8 taskId)
ContestClearGeneralTextWindow();
StringCopy(gStringVar3, gContestMons[eContestExcitement.freezer].nickname);
StringCopy(gStringVar1, gContestMons[contestant].nickname);
StringCopy(gStringVar2, GetMoveName(eContestantStatus[contestant].currMove));
CopyMoveNameToFit(gStringVar2, eContestantStatus[contestant].currMove);
StringExpandPlaceholders(gStringVar4, gText_CrowdContinuesToWatchMon);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].tState = APPEALSTATE_PRINT_MON_MOVE_IGNORED_MSG;
@ -2456,7 +2462,7 @@ static void Task_DoAppeals(u8 taskId)
eContestantStatus[contestant].hasJudgesAttention = FALSE;
StartStopFlashJudgeAttentionEye(contestant);
StringCopy(gStringVar1, gContestMons[contestant].nickname);
StringCopy(gStringVar2, GetMoveName(eContestantStatus[contestant].currMove));
CopyMoveNameToFit(gStringVar2, eContestantStatus[contestant].currMove);
StringExpandPlaceholders(gStringVar4, gText_MonWasTooNervousToMove);
Contest_StartTextPrinter(gStringVar4, TRUE);
gTasks[taskId].tState = APPEALSTATE_WAIT_TOO_NERVOUS_MSG;

View File

@ -109,7 +109,7 @@ struct ListBuffer1 {
};
struct ListBuffer2 {
u8 name[MAX_POCKET_ITEMS][ITEM_NAME_LENGTH + 10];
u8 name[MAX_POCKET_ITEMS][max(ITEM_NAME_LENGTH, MOVE_NAME_LENGTH + 3) + 10];
};
struct TempWallyBag {
@ -905,10 +905,19 @@ static void LoadBagItemListBuffers(u8 pocketId)
static void GetItemName(u8 *dest, u16 itemId)
{
u32 fontId;
switch (gBagPosition.pocket)
{
case TMHM_POCKET:
StringCopy(gStringVar2, GetMoveName(ItemIdToBattleMoveId(itemId)));
fontId = GetFontIdToFit(gStringVar2, FONT_NARROW, 0, 73);
if (fontId != FONT_NARROW)
{
gStringVar2[0] = EXT_CTRL_CODE_BEGIN;
gStringVar2[1] = EXT_CTRL_CODE_FONT;
gStringVar2[2] = fontId;
StringCopy(&gStringVar2[3], GetMoveName(ItemIdToBattleMoveId(itemId)));
}
if (itemId >= ITEM_HM01)
{
// Get HM number

View File

@ -186,7 +186,8 @@ static const struct ListMenuTemplate sMoveRelearnerMovesListTemplate =
.itemVerticalPadding = 0,
.scrollMultiple = LIST_NO_MULTIPLE_SCROLL,
.fontId = FONT_NORMAL,
.cursorKind = CURSOR_BLACK_ARROW
.cursorKind = CURSOR_BLACK_ARROW,
.textNarrowWidth = 68,
};
//--------------

View File

@ -2800,12 +2800,23 @@ static void ResetWindows(void)
sMonSummaryScreen->windowIds[i] = WINDOW_NONE;
}
static void PrintTextOnWindow(u8 windowId, const u8 *string, u8 x, u8 y, u8 lineSpacing, u8 colorId)
static void PrintTextOnWindowWithFont(u8 windowId, const u8 *string, u8 x, u8 y, u8 lineSpacing, u8 colorId, u32 fontId)
{
if (DECAP_ENABLED && DECAP_MIRRORING && !DECAP_SUMMARY)
AddTextPrinterParameterized4(windowId, FONT_NORMAL, x, y, 0, lineSpacing, sTextColors[colorId], 0, MirrorPtr(string));
AddTextPrinterParameterized4(windowId, fontId, x, y, 0, lineSpacing, sTextColors[colorId], 0, MirrorPtr(string));
else
AddTextPrinterParameterized4(windowId, FONT_NORMAL, x, y, 0, lineSpacing, sTextColors[colorId], 0, string);
AddTextPrinterParameterized4(windowId, fontId, x, y, 0, lineSpacing, sTextColors[colorId], 0, string);
}
static void PrintTextOnWindow(u8 windowId, const u8 *string, u8 x, u8 y, u8 lineSpacing, u8 colorId)
{
PrintTextOnWindowWithFont(windowId, string, x, y, lineSpacing, colorId, FONT_NORMAL);
}
static void PrintTextOnWindowToFit(u8 windowId, const u8 *string, u8 x, u8 y, u8 lineSpacing, u8 colorId)
{
u32 fontId = GetFontIdToFit(string, FONT_NORMAL, 0, WindowWidthPx(windowId));
PrintTextOnWindowWithFont(windowId, string, x, y, lineSpacing, colorId, fontId);
}
static void PrintMonInfo(void)
@ -3626,7 +3637,7 @@ static void PrintMoveNameAndPP(u8 moveIndex)
if (move != 0)
{
pp = CalculatePPWithBonus(move, summary->ppBonuses, moveIndex);
PrintTextOnWindow(moveNameWindowId, GetMoveName(move), 0, moveIndex * 16 + 1, 0, 1);
PrintTextOnWindowToFit(moveNameWindowId, GetMoveName(move), 0, moveIndex * 16 + 1, 0, 1);
ConvertIntToDecimalStringN(gStringVar1, summary->pp[moveIndex], STR_CONV_MODE_RIGHT_ALIGN, 2);
ConvertIntToDecimalStringN(gStringVar2, pp, STR_CONV_MODE_RIGHT_ALIGN, 2);
DynamicPlaceholderTextUtil_Reset();
@ -3794,9 +3805,9 @@ static void PrintNewMoveDetailsOrCancelText(void)
u16 move = sMonSummaryScreen->newMove;
if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES)
PrintTextOnWindow(windowId1, GetMoveName(move), 0, 65, 0, 6);
PrintTextOnWindowToFit(windowId1, GetMoveName(move), 0, 65, 0, 6);
else
PrintTextOnWindow(windowId1, GetMoveName(move), 0, 65, 0, 5);
PrintTextOnWindowToFit(windowId1, GetMoveName(move), 0, 65, 0, 5);
ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].pp, STR_CONV_MODE_RIGHT_ALIGN, 2);
DynamicPlaceholderTextUtil_Reset();

View File

@ -167,12 +167,12 @@ DOUBLE_BATTLE_TEST("Wind Power activates correctly for every battler with the ab
HP_BAR(playerLeft);
if (abilityLeft == ABILITY_WIND_POWER) {
ABILITY_POPUP(playerLeft, ABILITY_WIND_POWER);
MESSAGE("Being hit by PetalBlizzrd charged Wattrel with power!");
MESSAGE("Being hit by Petal Blizzard charged Wattrel with power!");
}
HP_BAR(playerRight);
if (abilityRight == ABILITY_WIND_POWER) {
ABILITY_POPUP(playerRight, ABILITY_WIND_POWER);
MESSAGE("Being hit by PetalBlizzrd charged Wattrel with power!");
MESSAGE("Being hit by Petal Blizzard charged Wattrel with power!");
}
HP_BAR(opponentRight);
NOT HP_BAR(opponentLeft);

View File

@ -109,7 +109,7 @@ SINGLE_BATTLE_TEST("Damage calculation matches Gen5+ (Marshadow vs Mawile)")
}
}
SCENE{
MESSAGE("Marshadow used SpectrlThief!");
MESSAGE("Marshadow used Spectral Thief!");
HP_BAR(opponent, captureDamage: &dmg);
}
THEN{

View File

@ -834,9 +834,9 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Mindstorm sets up Psychic Terrain")
TURN { MOVE(opponent, MOVE_EXTREME_SPEED); MOVE(player, MOVE_PSYCHIC, dynamax: TRUE); }
TURN { MOVE(opponent, MOVE_EXTREME_SPEED); MOVE(player, MOVE_PSYCHIC); }
} SCENE {
MESSAGE("Foe Wobbuffet used ExtremeSpeed!");
MESSAGE("Foe Wobbuffet used Extreme Speed!");
MESSAGE("Wobbuffet used Max Mindstorm!");
MESSAGE("Foe Wobbuffet cannot use ExtremeSpeed!");
MESSAGE("Foe Wobbuffet cannot use Extreme Speed!");
MESSAGE("Wobbuffet used Max Mindstorm!");
}
}

View File

@ -422,11 +422,7 @@ SINGLE_BATTLE_TEST("(TERA) Revelation Dance uses a Terastallized Pokemon's Tera
} WHEN {
TURN { MOVE(player, MOVE_REVELATION_DANCE, tera: TRUE); }
} SCENE {
#if B_EXPANDED_MOVE_NAMES == TRUE
MESSAGE("Oricorio used Revelation Dance!");
#else
MESSAGE("Oricorio used RvlationDnce!");
#endif
MESSAGE("It doesn't affect Foe Gengar…");
NOT { HP_BAR(opponent); }
}
@ -547,11 +543,7 @@ SINGLE_BATTLE_TEST("(TERA) Revelation Dance uses a Stellar-type Pokemon's base t
} WHEN {
TURN { MOVE(player, MOVE_REVELATION_DANCE, tera: TRUE); }
} SCENE {
#if B_EXPANDED_MOVE_NAMES == TRUE
MESSAGE("Oricorio used Revelation Dance!");
#else
MESSAGE("Oricorio used RvlationDnce!");
#endif
MESSAGE("It doesn't affect Foe Gumshoos…");
NOT { HP_BAR(opponent); }
}

View File

@ -63,7 +63,7 @@ SINGLE_BATTLE_TEST("X Sp. Atk sharply raises battler's Sp. Attack stat", s16 dam
if (useItem) TURN { USE_ITEM(player, ITEM_X_SP_ATK); }
TURN { MOVE(player, MOVE_DISARMING_VOICE); }
} SCENE {
MESSAGE("Wobbuffet used DisrmngVoice!");
MESSAGE("Wobbuffet used Disarming Voice!");
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
if (B_X_ITEMS_BUFF >= GEN_7)
@ -87,7 +87,7 @@ SINGLE_BATTLE_TEST("X Sp. Def sharply raises battler's Sp. Defense stat", s16 da
if (useItem) TURN { USE_ITEM(player, ITEM_X_SP_DEF); }
TURN { MOVE(opponent, MOVE_DISARMING_VOICE); }
} SCENE {
MESSAGE("Foe Wobbuffet used DisrmngVoice!");
MESSAGE("Foe Wobbuffet used Disarming Voice!");
HP_BAR(player, captureDamage: &results[i].damage);
} FINALLY {
if (B_X_ITEMS_BUFF >= GEN_7)
@ -205,7 +205,7 @@ SINGLE_BATTLE_TEST("Max Mushrooms raises battler's Sp. Attack stat", s16 damage)
if (useItem) TURN { USE_ITEM(player, ITEM_MAX_MUSHROOMS); }
TURN { MOVE(player, MOVE_DISARMING_VOICE); }
} SCENE {
MESSAGE("Wobbuffet used DisrmngVoice!");
MESSAGE("Wobbuffet used Disarming Voice!");
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
@ -225,7 +225,7 @@ SINGLE_BATTLE_TEST("Max Mushrooms battler's Sp. Defense stat", s16 damage)
if (useItem) TURN { USE_ITEM(player, ITEM_MAX_MUSHROOMS); }
TURN { MOVE(opponent, MOVE_DISARMING_VOICE); }
} SCENE {
MESSAGE("Foe Wobbuffet used DisrmngVoice!");
MESSAGE("Foe Wobbuffet used Disarming Voice!");
HP_BAR(player, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.66), results[1].damage);

View File

@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Corrosive Gas destroys the target's item or fails if the tar
} WHEN {
TURN { MOVE(player, MOVE_CORROSIVE_GAS); }
} SCENE {
MESSAGE("Wobbuffet used CorrosiveGas!");
MESSAGE("Wobbuffet used Corrosive Gas!");
if (item == ITEM_POTION) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CORROSIVE_GAS, player);
MESSAGE("Wobbuffet corroded Foe Wobbuffet's Potion!");
@ -40,11 +40,11 @@ SINGLE_BATTLE_TEST("Corrosive Gas doesn't destroy the item of a Pokemon with the
} WHEN {
TURN { MOVE(player, MOVE_CORROSIVE_GAS); }
} SCENE {
MESSAGE("Wobbuffet used CorrosiveGas!");
MESSAGE("Wobbuffet used Corrosive Gas!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_CORROSIVE_GAS, player);
NOT MESSAGE("Wobbuffet corroded Foe Wobbuffet's Potion!");
ABILITY_POPUP(opponent, ABILITY_STICKY_HOLD);
MESSAGE("Foe Muk's Sticky Hold made CorrosiveGas ineffective!");
MESSAGE("Foe Muk's Sticky Hold made Corrosive Gas ineffective!");
} THEN {
EXPECT_EQ(opponent->item, ITEM_POISON_BARB);
}
@ -59,7 +59,7 @@ SINGLE_BATTLE_TEST("Items lost to Corrosive Gas cannot be restored by Recycle")
} WHEN {
TURN { MOVE(player, MOVE_CORROSIVE_GAS); MOVE(opponent, MOVE_RECYCLE); }
} SCENE {
MESSAGE("Wobbuffet used CorrosiveGas!");
MESSAGE("Wobbuffet used Corrosive Gas!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_CORROSIVE_GAS, player);
MESSAGE("Wobbuffet corroded Foe Wobbuffet's Oran Berry!");
MESSAGE("Foe Wobbuffet used Recycle!");
@ -93,7 +93,7 @@ DOUBLE_BATTLE_TEST("Corrosive Gas destroys foes and ally's items if they have on
} WHEN {
TURN { MOVE(playerRight, MOVE_CORROSIVE_GAS); }
} SCENE {
MESSAGE("Wynaut used CorrosiveGas!");
MESSAGE("Wynaut used Corrosive Gas!");
if (itemPlayerLeft == ITEM_CHERI_BERRY) {
MESSAGE("Wynaut corroded Wobbuffet's Cheri Berry!");
} else {

View File

@ -114,7 +114,7 @@ SINGLE_BATTLE_TEST("Fling - Item is lost even when there is no target")
TURN { MOVE(opponent, MOVE_SELF_DESTRUCT); MOVE(player, MOVE_FLING); SEND_OUT(opponent, 1); }
TURN { MOVE(player, MOVE_FLING); }
} SCENE {
MESSAGE("Foe Wobbuffet used SelfDestruct!");
MESSAGE("Foe Wobbuffet used Self-Destruct!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_SELF_DESTRUCT, opponent);
HP_BAR(player);
MESSAGE("Foe Wobbuffet fainted!");

View File

@ -35,7 +35,7 @@ SINGLE_BATTLE_TEST("Metronome's called powder move fails against Grass Types")
} SCENE {
MESSAGE("Wobbuffet used Metronome!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player);
MESSAGE("Wobbuffet used PoisonPowder!");
MESSAGE("Wobbuffet used Poison Powder!");
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POISON_POWDER, player);
MESSAGE("It doesn't affect Foe Tangela…");
NOT STATUS_ICON(opponent, poison: TRUE);

View File

@ -35,7 +35,7 @@ SINGLE_BATTLE_TEST("Psychic Noise is blocked by Soundproof")
TURN { MOVE(player, MOVE_PSYCHIC_NOISE); MOVE(opponent, MOVE_RECOVER); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_SOUNDPROOF);
MESSAGE("Foe Voltorb's Soundproof blocks PsychicNoise!");
MESSAGE("Foe Voltorb's Soundproof blocks Psychic Noise!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_RECOVER, opponent);
}
}

View File

@ -171,7 +171,7 @@ SINGLE_BATTLE_TEST("Reflect Type defaults to Normal type for the user's type1 an
HP_BAR(player);
MESSAGE("Foe Arcanine burned itself out!");
// Turn 2
MESSAGE("Wobbuffet used Forest'sCurs!");
MESSAGE("Wobbuffet used Forest's Curse!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_FORESTS_CURSE, player);
MESSAGE("Grass type was added to Foe Arcanine!");
// Turn 3

View File

@ -5,12 +5,6 @@
// behaviors. These have been tested in-game, in double, in multi, and in link battles. AI will always
// revive their first fainted party member in order.
#if B_EXPANDED_MOVE_NAMES
#define REVIVAL_BLESSING "Revival Blessing"
#else
#define REVIVAL_BLESSING "RevivlBlesng"
#endif
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_REVIVAL_BLESSING].effect == EFFECT_REVIVAL_BLESSING);
@ -26,7 +20,7 @@ SINGLE_BATTLE_TEST("Revival Blessing revives a chosen fainted party member for t
} WHEN {
TURN { MOVE(player, MOVE_REVIVAL_BLESSING); SEND_OUT(player, 2); }
} SCENE {
MESSAGE("Wobbuffet used " REVIVAL_BLESSING "!");
MESSAGE("Wobbuffet used Revival Blessing!");
MESSAGE("Wynaut was revived and is ready to fight again!");
}
}
@ -41,7 +35,7 @@ SINGLE_BATTLE_TEST("Revival Blessing revives a fainted party member for an oppon
} WHEN {
TURN { MOVE(opponent, MOVE_REVIVAL_BLESSING); SEND_OUT(opponent, 1); }
} SCENE {
MESSAGE("Foe Raichu used " REVIVAL_BLESSING "!");
MESSAGE("Foe Raichu used Revival Blessing!");
MESSAGE("Pichu was revived and is ready to fight again!");
}
}
@ -54,7 +48,7 @@ SINGLE_BATTLE_TEST("Revival Blessing fails if no party members are fainted")
} WHEN {
TURN { MOVE(player, MOVE_REVIVAL_BLESSING); }
} SCENE {
MESSAGE("Wobbuffet used " REVIVAL_BLESSING "!");
MESSAGE("Wobbuffet used Revival Blessing!");
MESSAGE("But it failed!");
}
}
@ -82,10 +76,10 @@ TO_DO_BATTLE_TEST("Revival Blessing cannot revive a partner's party member");
// TURN { MOVE(user, MOVE_REVIVAL_BLESSING); }
// } SCENE {
// if (user == opponentLeft) {
// MESSAGE("Foe Wobbuffet used " REVIVAL_BLESSING "!");
// MESSAGE("Foe Wobbuffet used Revival Blessing!");
// MESSAGE("But it failed!");
// } else {
// MESSAGE("Foe Wynaut used " REVIVAL_BLESSING "!");
// MESSAGE("Foe Wynaut used Revival Blessing!");
// MESSAGE("Wynaut was revived and is ready to fight again!");
// }
// }
@ -108,7 +102,7 @@ TO_DO_BATTLE_TEST("Revived battlers still lose their turn");
// } SCENE {
// MESSAGE("Wobbuffet used Tackle!");
// MESSAGE("Foe Wynaut fainted!");
// MESSAGE("Foe Wobbuffet used " REVIVAL_BLESSING "!");
// MESSAGE("Foe Wobbuffet used Revival Blessing!");
// MESSAGE("Wynaut was revived and is ready to fight again!");
// NOT { MESSAGE("Wynaut used Celebrate!"); }
// }

View File

@ -58,7 +58,7 @@ SINGLE_BATTLE_TEST("Semi-invulnerable moves make the user semi-invulnerable turn
break;
case MOVE_PHANTOM_FORCE:
NOT MESSAGE("Wobbuffet vanished instantly!");
MESSAGE("Wobbuffet used PhantomForce!");
MESSAGE("Wobbuffet used Phantom Force!");
break;
case MOVE_SHADOW_FORCE:
NOT MESSAGE("Wobbuffet vanished instantly!");
@ -112,7 +112,7 @@ SINGLE_BATTLE_TEST("Semi-invulnerable moves make the user semi-invulnerable turn
MESSAGE("Wobbuffet used Dive!");
break;
case MOVE_PHANTOM_FORCE:
MESSAGE("Wobbuffet used PhantomForce!");
MESSAGE("Wobbuffet used Phantom Force!");
break;
case MOVE_SHADOW_FORCE:
MESSAGE("Wobbuffet used Shadow Force!");
@ -163,7 +163,7 @@ SINGLE_BATTLE_TEST("Semi-invulnerable moves don't need to charge with Power Herb
break;
case MOVE_PHANTOM_FORCE:
NOT MESSAGE("Wobbuffet vanished instantly!");
MESSAGE("Wobbuffet used PhantomForce!");
MESSAGE("Wobbuffet used Phantom Force!");
break;
case MOVE_SHADOW_FORCE:
NOT MESSAGE("Wobbuffet vanished instantly!");
@ -215,7 +215,7 @@ SINGLE_BATTLE_TEST("Semi-invulnerable moves don't need to charge with Power Herb
MESSAGE("Wobbuffet used Dive!");
break;
case MOVE_PHANTOM_FORCE:
MESSAGE("Wobbuffet used PhantomForce!");
MESSAGE("Wobbuffet used Phantom Force!");
break;
case MOVE_SHADOW_FORCE:
MESSAGE("Wobbuffet used Shadow Force!");

View File

@ -10,7 +10,7 @@ SINGLE_BATTLE_TEST("Electric Terrain protects grounded battlers from falling asl
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); MOVE(opponent, MOVE_SPORE); }
TURN { MOVE(player, MOVE_SPORE); }
} SCENE {
MESSAGE("Wobbuffet used ElctrcTrrain!");
MESSAGE("Wobbuffet used Electric Terrain!");
MESSAGE("Foe Claydol used Spore!");
MESSAGE("Wobbuffet surrounds itself with electrified terrain!");
MESSAGE("Wobbuffet used Spore!");
@ -51,7 +51,7 @@ SINGLE_BATTLE_TEST("Electric Terrain increases power of Electric-type moves by 3
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); }
TURN { MOVE(player, MOVE_THUNDER_SHOCK); }
} SCENE {
MESSAGE("Wobbuffet used ThunderShock!");
MESSAGE("Wobbuffet used Thunder Shock!");
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
if (B_TERRAIN_TYPE_BOOST >= GEN_8)

View File

@ -10,7 +10,7 @@ SINGLE_BATTLE_TEST("Misty Terrain protects grounded battlers from non-volatile s
TURN { MOVE(player, MOVE_MISTY_TERRAIN); MOVE(opponent, MOVE_TOXIC); }
TURN { MOVE(player, MOVE_TOXIC); }
} SCENE {
MESSAGE("Wobbuffet used MistyTerrain!");
MESSAGE("Wobbuffet used Misty Terrain!");
MESSAGE("Foe Claydol used Toxic!");
MESSAGE("Wobbuffet surrounds itself with a protective mist!");
NOT { STATUS_ICON(opponent, badPoison: TRUE); }

View File

@ -10,7 +10,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain protects grounded battlers from priority mov
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_QUICK_ATTACK); MOVE(opponent, MOVE_QUICK_ATTACK); }
} SCENE {
MESSAGE("Claydol used PsychcTrrain!");
MESSAGE("Claydol used Psychic Terrain!");
MESSAGE("Claydol cannot use Quick Attack!");
NOT { HP_BAR(opponent); }
MESSAGE("Foe Wobbuffet used Quick Attack!");
@ -69,7 +69,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target the
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_RECOVER); }
} SCENE {
MESSAGE("Sableye used PsychcTrrain!");
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Recover!");
HP_BAR(player);
}
@ -84,7 +84,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target all
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_HAZE); }
} SCENE {
MESSAGE("Sableye used PsychcTrrain!");
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Haze!");
}
}
@ -98,7 +98,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target all
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_SPIKES); }
} SCENE {
MESSAGE("Sableye used PsychcTrrain!");
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Spikes!");
}
}
@ -114,7 +114,7 @@ DOUBLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target all
TURN { MOVE(playerLeft, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(playerLeft, MOVE_HEAL_PULSE, target: playerRight); }
} SCENE {
MESSAGE("Sableye used PsychcTrrain!");
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Heal Pulse!");
}
}
@ -128,7 +128,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority field moves")
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_SUNNY_DAY); }
} SCENE {
MESSAGE("Sableye used PsychcTrrain!");
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Sunny Day!");
}
}

77
test/text.c Normal file
View File

@ -0,0 +1,77 @@
#include "global.h"
#include "test/test.h"
#include "item.h"
#include "text.h"
#include "constants/moves.h"
TEST("Move names fit on Pokemon Summary Screen")
{
u32 i;
const u32 fontId = FONT_NARROWER, widthPx = 72;
u32 move = MOVE_NONE;
for (i = 1; i < MOVES_COUNT; i++)
{
PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; }
}
EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx);
}
TEST("Move names fit on Battle Screen")
{
u32 i;
const u32 fontId = FONT_NARROWER, widthPx = 64;
u32 move = MOVE_NONE;
for (i = 1; i < MOVES_COUNT; i++)
{
PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; }
}
EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx);
}
TEST("Move names fit on Contest Screen")
{
u32 i;
const u32 fontId = FONT_NARROWER, widthPx = 61;
u32 move = MOVE_NONE;
for (i = 1; i < MOVES_COUNT; i++)
{
PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; }
}
// All moves explicitly listed here are too big to fit.
switch (move)
{
case MOVE_NATURES_MADNESS:
EXPECT_GT(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx);
break;
default:
EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx);
break;
}
}
TEST("Move names fit on TMs & HMs Bag Screen")
{
u32 i;
const u32 fontId = FONT_NARROWER, widthPx = 63;
u32 move = MOVE_NONE;
for (i = 1; i < ITEMS_COUNT; i++)
{
if (gItemsInfo[i].pocket == POCKET_TM_HM)
{
PARAMETRIZE_LABEL("%S", gMovesInfo[gItemsInfo[i].secondaryId].name) { move = gItemsInfo[i].secondaryId; }
}
}
EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx);
}
TEST("Move names fit on Move Relearner Screen")
{
u32 i;
const u32 fontId = FONT_NARROWER, widthPx = 72;
u32 move = MOVE_NONE;
for (i = 1; i < MOVES_COUNT; i++)
{
PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; }
}
EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx);
}