From 3c3ce38378792223e95dd1e2a0e8f7e69336baef Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:18:08 +0200 Subject: [PATCH 1/9] Remove one redundant call of SetAiLogicDataForTurn in DoBattleIntro (#5491) This is already run at the end of `TryDoEventsBeforeFirstTurn` which makes the first calc redundant. I've had this removed in my project for a while and didn't notice any problems --- src/battle_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/battle_main.c b/src/battle_main.c index e0ec3023ec..df39e745ac 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3750,7 +3750,6 @@ static void DoBattleIntro(void) gBattleStruct->eventsBeforeFirstTurnState = 0; gBattleStruct->switchInBattlerCounter = 0; gBattleStruct->overworldWeatherDone = FALSE; - SetAiLogicDataForTurn(AI_DATA); // get assumed abilities, hold effects, etc of all battlers Ai_InitPartyStruct(); // Save mons party counts, and first 2/4 mons on the battlefield. // Try to set a status to start the battle with From 8d2d62273bd0d3565c4edb211ae4cf6a6b35b258 Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:36:01 +0100 Subject: [PATCH 2/9] Updated ability popups for Skill Swap, Mummy/Lingering Aroma, Worry Seed, Simple Beam, fix Doodle/Role Play bugs (#5493) * Updated ability popups of Skill Swap, Mummy/Lingering Aroma, Worry Seed, Simple Beam, Fix Doodle and Role Play issues * More Doodle fixes * Add tests * Fix Doodle not activating if partner is fainted and its ability cannot be suppressed * Fix tests compile * Commander cantBeOverwritten * Add battle script for Overwrite then Regular ability --- data/battle_scripts_1.s | 94 +++++++++++++--------- src/battle_message.c | 4 +- src/battle_script_commands.c | 12 ++- src/battle_util.c | 3 +- src/data/abilities.h | 1 + test/battle/ability/mummy.c | 12 +-- test/battle/move_effect/doodle.c | 40 +++++++++- test/battle/move_effect/role_play.c | 74 ++++++++++++++--- test/battle/move_effect/simple_beam.c | 74 +++++++++++++++++ test/battle/move_effect/skill_swap.c | 111 ++++++++++++++++++++++++++ test/battle/move_effect/worry_seed.c | 74 +++++++++++++++++ 11 files changed, 432 insertions(+), 67 deletions(-) create mode 100644 test/battle/move_effect/simple_beam.c create mode 100644 test/battle/move_effect/skill_swap.c create mode 100644 test/battle/move_effect/worry_seed.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 94f5736317..fa56c3ff7a 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -214,27 +214,25 @@ BattleScript_EffectDoodle:: attackcanceler attackstring ppreduce + trycopyability BS_ATTACKER, BattleScript_ButItFailed attackanimation waitanimation setbyte gBattleCommunication, 0 + goto BattleScript_EffectDoodle_AfterCopy BattleScript_EffectDoodle_CopyAbility: - trycopyability BS_ATTACKER, BattleScript_ButItFailed + trycopyability BS_ATTACKER, BattleScript_MoveEnd +BattleScript_EffectDoodle_AfterCopy: .if B_ABILITY_POP_UP == TRUE - setbyte sFIXED_ABILITY_POPUP, TRUE - showabilitypopup BS_ATTACKER - pause 60 - sethword sABILITY_OVERWRITE, 0 - updateabilitypopup BS_ATTACKER - pause 20 - destroyabilitypopup - pause 40 + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUpOverwriteThenNormal .endif + recordability BS_ATTACKER printstring STRINGID_PKMNCOPIEDFOE waitmessage B_WAIT_TIME_LONG switchinabilities BS_ATTACKER jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd addbyte gBattleCommunication, 1 - jumpifnoally BS_TARGET, BattleScript_MoveEnd + jumpifnoally BS_ATTACKER, BattleScript_MoveEnd setallytonextattacker BattleScript_EffectDoodle_CopyAbility goto BattleScript_MoveEnd @@ -2346,6 +2344,11 @@ BattleScript_EffectSimpleBeam:: setabilitysimple BS_TARGET, BattleScript_ButItFailed attackanimation waitanimation +.if B_ABILITY_POP_UP == TRUE + copybyte gBattlerAbility, gBattlerTarget + call BattleScript_AbilityPopUpOverwriteThenNormal +.endif + recordability BS_TARGET printstring STRINGID_PKMNACQUIREDSIMPLE waitmessage B_WAIT_TIME_LONG trytoclearprimalweather @@ -2444,11 +2447,17 @@ BattleScript_EffectWorrySeed:: tryworryseed BattleScript_ButItFailed attackanimation waitanimation +.if B_ABILITY_POP_UP == TRUE + copybyte gBattlerAbility, gBattlerTarget + call BattleScript_AbilityPopUpOverwriteThenNormal +.endif + recordability BS_TARGET printstring STRINGID_PKMNACQUIREDABILITY waitmessage B_WAIT_TIME_LONG trytoclearprimalweather tryrevertweatherform flushtextbox + tryendneutralizinggas BS_TARGET goto BattleScript_MoveEnd BattleScript_EffectPowerSplit:: @@ -5034,15 +5043,10 @@ BattleScript_EffectRolePlay:: attackanimation waitanimation .if B_ABILITY_POP_UP == TRUE - setbyte sFIXED_ABILITY_POPUP, TRUE - showabilitypopup BS_ATTACKER - pause 60 - sethword sABILITY_OVERWRITE, 0 - updateabilitypopup BS_ATTACKER - pause 20 - destroyabilitypopup - pause 40 + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUpOverwriteThenNormal .endif + recordability BS_ATTACKER printstring STRINGID_PKMNCOPIEDFOE waitmessage B_WAIT_TIME_LONG switchinabilities BS_ATTACKER @@ -5185,12 +5189,17 @@ BattleScript_EffectSkillSwap:: tryswapabilities BattleScript_ButItFailed attackanimation waitanimation + jumpiftargetally BattleScript_EffectSkillSwap_AfterAbilityPopUp .if B_ABILITY_POP_UP == TRUE - call BattleScript_AbilityPopUpTarget - pause 20 copybyte gBattlerAbility, gBattlerAttacker - call BattleScript_AbilityPopUp + call BattleScript_AbilityPopUpOverwriteThenNormal + copybyte gBattlerAbility, gBattlerTarget + copyhword sABILITY_OVERWRITE, gLastUsedAbility + call BattleScript_AbilityPopUpOverwriteThenNormal .endif +BattleScript_EffectSkillSwap_AfterAbilityPopUp: + recordability BS_ATTACKER + recordability BS_TARGET printstring STRINGID_PKMNSWAPPEDABILITIES waitmessage B_WAIT_TIME_LONG .if B_SKILL_SWAP >= GEN_4 @@ -7605,6 +7614,18 @@ BattleScript_AbilityPopUpScripting: sethword sABILITY_OVERWRITE, 0 return +BattleScript_AbilityPopUpOverwriteThenNormal: + setbyte sFIXED_ABILITY_POPUP, TRUE + showabilitypopup BS_ABILITY_BATTLER + pause 60 + sethword sABILITY_OVERWRITE, 0 + updateabilitypopup BS_ABILITY_BATTLER + pause 20 + recordability BS_ABILITY_BATTLER + destroyabilitypopup + pause 40 + return + BattleScript_SpeedBoostActivates:: statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_SpeedBoostActivatesEnd call BattleScript_AbilityPopUp @@ -8366,33 +8387,30 @@ BattleScript_CursedBodyActivates:: return BattleScript_MummyActivates:: - call BattleScript_AbilityPopUp +.if B_ABILITY_POP_UP == TRUE + call BattleScript_AbilityPopUpTarget + setbyte sFIXED_ABILITY_POPUP, TRUE + copybyte gBattlerAbility, gBattlerAttacker + copyhword sABILITY_OVERWRITE, gLastUsedAbility + call BattleScript_AbilityPopUpOverwriteThenNormal +.endif + recordability BS_TARGET + recordability BS_ATTACKER printstring STRINGID_ATTACKERACQUIREDABILITY waitmessage B_WAIT_TIME_LONG return BattleScript_WanderingSpiritActivates:: .if B_ABILITY_POP_UP == TRUE - setbyte sFIXED_ABILITY_POPUP, TRUE + copybyte gBattlerAbility, gBattlerTarget sethword sABILITY_OVERWRITE, ABILITY_WANDERING_SPIRIT - showabilitypopup BS_TARGET - pause 60 - sethword sABILITY_OVERWRITE, 0 - updateabilitypopup BS_TARGET - pause 20 - destroyabilitypopup - pause 40 + call BattleScript_AbilityPopUpOverwriteThenNormal copybyte gBattlerAbility, gBattlerAttacker - setbyte sFIXED_ABILITY_POPUP, TRUE copyhword sABILITY_OVERWRITE, gLastUsedAbility - showabilitypopup BS_ATTACKER - pause 60 - sethword sABILITY_OVERWRITE, 0 - updateabilitypopup BS_ATTACKER - pause 20 - destroyabilitypopup - pause 40 + call BattleScript_AbilityPopUpOverwriteThenNormal .endif + recordability BS_TARGET + recordability BS_ATTACKER printstring STRINGID_SWAPPEDABILITIES waitmessage B_WAIT_TIME_LONG switchinabilities BS_ATTACKER diff --git a/src/battle_message.c b/src/battle_message.c index ecb2932124..52c6dec6ae 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -640,7 +640,7 @@ static const u8 sText_HealingWishCameTrue[] = _("The healing wish came true\nfor static const u8 sText_HealingWishHealed[] = _("{B_ATK_NAME_WITH_PREFIX} regained health!"); static const u8 sText_LunarDanceCameTrue[] = _("{B_ATK_NAME_WITH_PREFIX} became cloaked\nin mystical moonlight!"); static const u8 sText_CursedBodyDisabled[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1} was disabled\nby {B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}!"); -static const u8 sText_AttackerAquiredAbility[] = _("{B_ATK_NAME_WITH_PREFIX} acquired\n{B_LAST_ABILITY}!"); +static const u8 sText_AttackerAcquiredAbility[] = _("{B_ATK_NAME_WITH_PREFIX} acquired\n{B_ATK_ABILITY}!"); static const u8 sText_TargetStatWontGoHigher[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwon't go higher!"); static const u8 sText_PkmnMoveBouncedViaAbility[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_CURRENT_MOVE} was\nbounced back by {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY}!"); static const u8 sText_ImposterTransform[] = _("{B_ATK_NAME_WITH_PREFIX} transformed into\n{B_DEF_NAME_WITH_PREFIX} using {B_LAST_ABILITY}!"); @@ -1477,7 +1477,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_HEALINGWISHHEALED - BATTLESTRINGS_TABLE_START] = sText_HealingWishHealed, [STRINGID_LUNARDANCECAMETRUE - BATTLESTRINGS_TABLE_START] = sText_LunarDanceCameTrue, [STRINGID_CUSEDBODYDISABLED - BATTLESTRINGS_TABLE_START] = sText_CursedBodyDisabled, - [STRINGID_ATTACKERACQUIREDABILITY - BATTLESTRINGS_TABLE_START] = sText_AttackerAquiredAbility, + [STRINGID_ATTACKERACQUIREDABILITY - BATTLESTRINGS_TABLE_START] = sText_AttackerAcquiredAbility, [STRINGID_TARGETABILITYSTATLOWER - BATTLESTRINGS_TABLE_START] = sText_TargetAbilityLoweredStat, [STRINGID_TARGETSTATWONTGOHIGHER - BATTLESTRINGS_TABLE_START] = sText_TargetStatWontGoHigher, [STRINGID_PKMNMOVEBOUNCEDABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnMoveBouncedViaAbility, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ba372d1c54..618164dd18 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9782,6 +9782,7 @@ static void Cmd_various(void) if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; + gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerTarget].ability; gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_SIMPLE; gBattlescriptCurrInstr = cmd->nextInstr; } @@ -14369,7 +14370,7 @@ static void Cmd_trycopyability(void) if (gBattleMons[battler].ability == defAbility || defAbility == ABILITY_NONE || gAbilitiesInfo[gBattleMons[battler].ability].cantBeSuppressed - || gAbilitiesInfo[gBattleMons[BATTLE_PARTNER(battler)].ability].cantBeSuppressed + || (IsBattlerAlive(BATTLE_PARTNER(battler)) && gAbilitiesInfo[gBattleMons[BATTLE_PARTNER(battler)].ability].cantBeSuppressed && gMovesInfo[gCurrentMove].effect == EFFECT_DOODLE) || gAbilitiesInfo[defAbility].cantBeCopied) { gBattlescriptCurrInstr = cmd->failInstr; @@ -14565,9 +14566,11 @@ static void Cmd_tryswapabilities(void) } else { - u16 abilityAtk = gBattleMons[gBattlerAttacker].ability; - gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; - gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = abilityAtk; + if (GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)) + gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerAttacker].ability; + gLastUsedAbility = gBattleMons[gBattlerTarget].ability; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gBattleMons[gBattlerAttacker].ability; + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gLastUsedAbility; gBattlescriptCurrInstr = cmd->nextInstr; } @@ -15859,6 +15862,7 @@ static void Cmd_tryworryseed(void) } else { + gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerTarget].ability; gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_INSOMNIA; gBattlescriptCurrInstr = cmd->nextInstr; } diff --git a/src/battle_util.c b/src/battle_util.c index b572acc7c1..e5d8c5f041 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5546,7 +5546,8 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 break; } - gLastUsedAbility = gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; + gLastUsedAbility = gBattleMons[gBattlerAttacker].ability; + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MummyActivates; effect++; diff --git a/src/data/abilities.h b/src/data/abilities.h index a85f114fec..ba768a0a51 100644 --- a/src/data/abilities.h +++ b/src/data/abilities.h @@ -2273,6 +2273,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] = .cantBeSwapped = TRUE, .cantBeTraced = TRUE, .cantBeSuppressed = TRUE, + .cantBeOverwritten = TRUE, }, [ABILITY_ELECTROMORPHOSIS] = diff --git a/test/battle/ability/mummy.c b/test/battle/ability/mummy.c index ed80a178e6..74461ec2ee 100644 --- a/test/battle/ability/mummy.c +++ b/test/battle/ability/mummy.c @@ -70,19 +70,19 @@ SINGLE_BATTLE_TEST("Mummy doesn't replace abilities that can't be suppressed") PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } - PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } - PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; } + PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; } - PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; } PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } - PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } + PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; } + PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; } + PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; } PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; } PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; } - PARAMETRIZE { species = SPECIES_CALYREX_SHADOW_RIDER; ability = ABILITY_AS_ONE_SHADOW_RIDER; } - PARAMETRIZE { species = SPECIES_CALYREX_ICE_RIDER; ability = ABILITY_AS_ONE_ICE_RIDER; } GIVEN { PLAYER(SPECIES_YAMASK); diff --git a/test/battle/move_effect/doodle.c b/test/battle/move_effect/doodle.c index bf7e208646..ba7729a895 100644 --- a/test/battle/move_effect/doodle.c +++ b/test/battle/move_effect/doodle.c @@ -35,8 +35,8 @@ DOUBLE_BATTLE_TEST("Doodle can't copy a banned ability") } WHEN { TURN { MOVE(playerLeft, MOVE_DOODLE, target: opponentLeft); } } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerLeft); NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerLeft); MESSAGE("Wynaut copied Foe Great Tusk's Protosynthesis!"); MESSAGE("Wynaut copied Foe Great Tusk's Protosynthesis!"); } @@ -56,7 +56,7 @@ DOUBLE_BATTLE_TEST("Doodle fails if user has a banned Ability") } WHEN { TURN { MOVE(playerLeft, MOVE_DOODLE, target: opponentLeft); } } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerLeft); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerLeft); MESSAGE("But it failed!"); } THEN { EXPECT(playerLeft->ability == ABILITY_GULP_MISSILE); @@ -74,10 +74,44 @@ DOUBLE_BATTLE_TEST("Doodle fails if partner has a banned Ability") } WHEN { TURN { MOVE(playerLeft, MOVE_DOODLE, target: opponentLeft); } } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerLeft); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerLeft); MESSAGE("But it failed!"); } THEN { EXPECT(playerLeft->ability == ABILITY_SHADOW_TAG); EXPECT(playerRight->ability == ABILITY_GULP_MISSILE); } } + +DOUBLE_BATTLE_TEST("Doodle fails if ally's ability can't be suppressed") +{ + u32 species, ability; + + PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } + PARAMETRIZE { species = SPECIES_DARMANITAN; ability = ABILITY_ZEN_MODE; } + PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } + PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; } + PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } + PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; } + PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; } + PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } + PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } + PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } + PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; } + PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; } + PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; } + PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; } + PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(species) { Ability(ability); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_DOODLE, target: playerLeft); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, opponentLeft); + MESSAGE("But it failed!"); + } +} diff --git a/test/battle/move_effect/role_play.c b/test/battle/move_effect/role_play.c index 46452ec3ff..ab0d801ee9 100644 --- a/test/battle/move_effect/role_play.c +++ b/test/battle/move_effect/role_play.c @@ -1,25 +1,65 @@ #include "global.h" #include "test/battle.h" -// Technically also covers Skill Swap and Doodle since both moves use the same command as Role Play ASSUMPTIONS { ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY); } -SINGLE_BATTLE_TEST("Role Play fails if target has a banned ability") +SINGLE_BATTLE_TEST("Role Play copies target's ability") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + }WHEN { + TURN { MOVE(player, MOVE_ROLE_PLAY); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, player); + ABILITY_POPUP(player, ABILITY_TELEPATHY); + } THEN { + EXPECT_EQ(player->ability, ABILITY_BLAZE); + EXPECT_EQ(opponent->ability, ABILITY_BLAZE); + } +} + +DOUBLE_BATTLE_TEST("Role Play copies target's current ability even if it changed during that turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + OPPONENT(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); } + OPPONENT(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_ROLE_PLAY, target: opponentLeft); MOVE(opponentRight, MOVE_ROLE_PLAY, target: playerLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, playerLeft); + ABILITY_POPUP(playerLeft, ABILITY_TELEPATHY); + if (MOVE_ROLE_PLAY == MOVE_DOODLE) + ABILITY_POPUP(playerRight, ABILITY_BLAZE); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, opponentRight); + ABILITY_POPUP(opponentRight, ABILITY_TORRENT); + NOT ABILITY_POPUP(opponentLeft, ABILITY_OVERGROW); // Already has ability (Doodle) + } THEN { + EXPECT_EQ(playerLeft->ability, ABILITY_OVERGROW); + if (MOVE_ROLE_PLAY == MOVE_DOODLE) + EXPECT_EQ(playerRight->ability, ABILITY_OVERGROW); + EXPECT_EQ(opponentLeft->ability, ABILITY_OVERGROW); + EXPECT_EQ(opponentRight->ability, ABILITY_OVERGROW); + } +} + +SINGLE_BATTLE_TEST("Role Play and Doodle fail if target's ability can't be copied'") { u32 species, ability; PARAMETRIZE { species = SPECIES_SHEDINJA; ability = ABILITY_WONDER_GUARD; } PARAMETRIZE { species = SPECIES_CASTFORM; ability = ABILITY_FORECAST; } - PARAMETRIZE { species = SPECIES_CHERRIM; ability = ABILITY_FLOWER_GIFT; } PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } + PARAMETRIZE { species = SPECIES_CHERRIM; ability = ABILITY_FLOWER_GIFT; } PARAMETRIZE { species = SPECIES_ZORUA; ability = ABILITY_ILLUSION; } PARAMETRIZE { species = SPECIES_DARMANITAN; ability = ABILITY_ZEN_MODE; } - PARAMETRIZE { species = SPECIES_DITTO; ability = ABILITY_IMPOSTER; } PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } - PARAMETRIZE { species = SPECIES_MUK_ALOLAN; ability = ABILITY_POWER_OF_ALCHEMY; } + PARAMETRIZE { species = SPECIES_MUK_ALOLA; ability = ABILITY_POWER_OF_ALCHEMY; } PARAMETRIZE { species = SPECIES_PASSIMIAN; ability = ABILITY_RECEIVER; } PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } @@ -38,29 +78,34 @@ SINGLE_BATTLE_TEST("Role Play fails if target has a banned ability") PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } OPPONENT(species) { Ability(ability); } } WHEN { - TURN { MOVE(player,MOVE_ROLE_PLAY); } + TURN { MOVE(player, MOVE_ROLE_PLAY); } + TURN { MOVE(player, MOVE_DOODLE); } } SCENE { NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, player); MESSAGE("But it failed!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, player); + MESSAGE("But it failed!"); } } -SINGLE_BATTLE_TEST("Role Play fails if user has a banned ability") +SINGLE_BATTLE_TEST("Role Play fails if user's ability can't be suppressed") { u32 species, ability; PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } PARAMETRIZE { species = SPECIES_DARMANITAN; ability = ABILITY_ZEN_MODE; } PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } - PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } - PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; } + PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; } - PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } - PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; } - PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } + PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } + PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; } + PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; } + PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; } PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; } PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; } @@ -68,9 +113,12 @@ SINGLE_BATTLE_TEST("Role Play fails if user has a banned ability") PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } OPPONENT(species) { Ability(ability); } } WHEN { - TURN { MOVE(opponent,MOVE_ROLE_PLAY); } + TURN { MOVE(opponent, MOVE_ROLE_PLAY); } + TURN { MOVE(opponent, MOVE_DOODLE); } } SCENE { NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, opponent); MESSAGE("But it failed!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, opponent); + MESSAGE("But it failed!"); } } diff --git a/test/battle/move_effect/simple_beam.c b/test/battle/move_effect/simple_beam.c new file mode 100644 index 0000000000..e91bf0b8ce --- /dev/null +++ b/test/battle/move_effect/simple_beam.c @@ -0,0 +1,74 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_SIMPLE_BEAM].effect == EFFECT_SIMPLE_BEAM); +} + +SINGLE_BATTLE_TEST("Simple Beam replaces target's ability with Simple") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + }WHEN { + TURN { MOVE(player, MOVE_SIMPLE_BEAM); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SIMPLE_BEAM, player); + ABILITY_POPUP(opponent, ABILITY_BLAZE); + } THEN { + EXPECT_EQ(opponent->ability, ABILITY_SIMPLE); + } +} + +DOUBLE_BATTLE_TEST("Simple Beam fails if the target already has Simple") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + OPPONENT(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); } + OPPONENT(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SIMPLE_BEAM, target: opponentLeft); MOVE(playerRight, MOVE_SIMPLE_BEAM, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SIMPLE_BEAM, playerLeft); + ABILITY_POPUP(opponentLeft, ABILITY_OVERGROW); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SIMPLE_BEAM, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_SIMPLE); + } + } THEN { + EXPECT_EQ(opponentLeft->ability, ABILITY_SIMPLE); + } +} + +SINGLE_BATTLE_TEST("Simple Beam fails if target has an ability that can't be overwritten") +{ + u32 species, ability; + + PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } + PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } + PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; } + PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } + PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; } + PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; } + PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } + PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } + PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } + PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; } + PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; } + PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; } + PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; } + PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(species) { Ability(ability); } + } WHEN { + TURN { MOVE(player, MOVE_SIMPLE_BEAM); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SIMPLE_BEAM, player); + MESSAGE("But it failed!"); + } +} diff --git a/test/battle/move_effect/skill_swap.c b/test/battle/move_effect/skill_swap.c new file mode 100644 index 0000000000..5f2196fe7e --- /dev/null +++ b/test/battle/move_effect/skill_swap.c @@ -0,0 +1,111 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); +} + +SINGLE_BATTLE_TEST("Skill Swap swaps user and target's abilities") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + }WHEN { + TURN { MOVE(player, MOVE_SKILL_SWAP); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, player); + ABILITY_POPUP(player, ABILITY_TELEPATHY); + ABILITY_POPUP(opponent, ABILITY_BLAZE); + } THEN { + EXPECT_EQ(player->ability, ABILITY_BLAZE); + EXPECT_EQ(opponent->ability, ABILITY_TELEPATHY); + } +} + +DOUBLE_BATTLE_TEST("Skill Swap only swaps user's ability with target's ability") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + OPPONENT(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); } + OPPONENT(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SKILL_SWAP, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, playerLeft); + ABILITY_POPUP(playerLeft, ABILITY_TELEPATHY); + ABILITY_POPUP(opponentLeft, ABILITY_OVERGROW); + } THEN { + EXPECT_EQ(playerLeft->ability, ABILITY_OVERGROW); + EXPECT_EQ(playerRight->ability, ABILITY_BLAZE); + EXPECT_EQ(opponentLeft->ability, ABILITY_TELEPATHY); + EXPECT_EQ(opponentRight->ability, ABILITY_TORRENT); + } +} + +DOUBLE_BATTLE_TEST("Skill Swap doesn't display ability popups when swapping with an ally") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + OPPONENT(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); } + OPPONENT(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SKILL_SWAP, target: playerRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, playerLeft); + NONE_OF { + ABILITY_POPUP(playerLeft, ABILITY_TELEPATHY); + ABILITY_POPUP(playerRight, ABILITY_BLAZE); + } + } THEN { + EXPECT_EQ(playerLeft->ability, ABILITY_BLAZE); + EXPECT_EQ(playerRight->ability, ABILITY_TELEPATHY); + } +} + +SINGLE_BATTLE_TEST("Skill Swap fails if user or target has an ability that can't be swapped") +{ + u32 species, ability; + + PARAMETRIZE { species = SPECIES_SHEDINJA; ability = ABILITY_WONDER_GUARD; } + PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } + PARAMETRIZE { species = SPECIES_ZORUA; ability = ABILITY_ILLUSION; } + PARAMETRIZE { species = SPECIES_DARMANITAN; ability = ABILITY_ZEN_MODE; } + PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } + PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; } + PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } + PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; } + PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; } + PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } + PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } + PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } + PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_KOFFING; ability = ABILITY_NEUTRALIZING_GAS; } + PARAMETRIZE { species = SPECIES_MORPEKO; ability = ABILITY_HUNGER_SWITCH; } + PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; } + PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; } + PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; } + PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; } + PARAMETRIZE { species = SPECIES_GREAT_TUSK; ability = ABILITY_PROTOSYNTHESIS; } + PARAMETRIZE { species = SPECIES_IRON_TREADS; ability = ABILITY_QUARK_DRIVE; } + PARAMETRIZE { species = SPECIES_OGERPON_TEAL_MASK_TERA; ability = ABILITY_EMBODY_ASPECT_TEAL_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_HEARTHFLAME_MASK_TERA; ability = ABILITY_EMBODY_ASPECT_HEARTHFLAME_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_WELLSPRING_MASK_TERA; ability = ABILITY_EMBODY_ASPECT_WELLSPRING_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_CORNERSTONE_MASK_TERA; ability = ABILITY_EMBODY_ASPECT_CORNERSTONE_MASK; } + PARAMETRIZE { species = SPECIES_TERAPAGOS_TERASTAL; ability = ABILITY_TERA_SHELL; } + PARAMETRIZE { species = SPECIES_TERAPAGOS_STELLAR; ability = ABILITY_TERAFORM_ZERO; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(species) { Ability(ability); } + } WHEN { + TURN { MOVE(player, MOVE_SKILL_SWAP); MOVE(opponent, MOVE_SKILL_SWAP); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, player); + MESSAGE("But it failed!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, opponent); + MESSAGE("But it failed!"); + } +} diff --git a/test/battle/move_effect/worry_seed.c b/test/battle/move_effect/worry_seed.c new file mode 100644 index 0000000000..3e74c883e7 --- /dev/null +++ b/test/battle/move_effect/worry_seed.c @@ -0,0 +1,74 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_WORRY_SEED].effect == EFFECT_WORRY_SEED); +} + +SINGLE_BATTLE_TEST("Worry Seed replaces target's ability with Insomnia") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + }WHEN { + TURN { MOVE(player, MOVE_WORRY_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WORRY_SEED, player); + ABILITY_POPUP(opponent, ABILITY_BLAZE); + } THEN { + EXPECT_EQ(opponent->ability, ABILITY_INSOMNIA); + } +} + +DOUBLE_BATTLE_TEST("Worry Seed fails if the target already has Insomnia") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); } + OPPONENT(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); } + OPPONENT(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_WORRY_SEED, target: opponentLeft); MOVE(playerRight, MOVE_WORRY_SEED, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WORRY_SEED, playerLeft); + ABILITY_POPUP(opponentLeft, ABILITY_OVERGROW); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WORRY_SEED, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_INSOMNIA); + } + } THEN { + EXPECT_EQ(opponentLeft->ability, ABILITY_INSOMNIA); + } +} + +SINGLE_BATTLE_TEST("Worry Seed fails if target has an ability that can't be overwritten") +{ + u32 species, ability; + + PARAMETRIZE { species = SPECIES_ARCEUS; ability = ABILITY_MULTITYPE; } + PARAMETRIZE { species = SPECIES_AEGISLASH; ability = ABILITY_STANCE_CHANGE; } + PARAMETRIZE { species = SPECIES_MINIOR; ability = ABILITY_SHIELDS_DOWN; } + PARAMETRIZE { species = SPECIES_WISHIWASHI; ability = ABILITY_SCHOOLING; } + PARAMETRIZE { species = SPECIES_MIMIKYU; ability = ABILITY_DISGUISE; } + PARAMETRIZE { species = SPECIES_GRENINJA_BATTLE_BOND; ability = ABILITY_BATTLE_BOND; } + PARAMETRIZE { species = SPECIES_ZYGARDE; ability = ABILITY_POWER_CONSTRUCT; } + PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; } + PARAMETRIZE { species = SPECIES_SILVALLY; ability = ABILITY_RKS_SYSTEM; } + PARAMETRIZE { species = SPECIES_CRAMORANT; ability = ABILITY_GULP_MISSILE; } + PARAMETRIZE { species = SPECIES_EISCUE; ability = ABILITY_ICE_FACE; } + PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; } + PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; } + PARAMETRIZE { species = SPECIES_PALAFIN_ZERO; ability = ABILITY_ZERO_TO_HERO; } + PARAMETRIZE { species = SPECIES_TATSUGIRI; ability = ABILITY_COMMANDER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); } + OPPONENT(species) { Ability(ability); } + } WHEN { + TURN { MOVE(player, MOVE_WORRY_SEED); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WORRY_SEED, player); + MESSAGE("But it failed!"); + } +} From 8890500b770d4712b2456d1addefbe0b44993793 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Thu, 10 Oct 2024 14:26:46 -0500 Subject: [PATCH 3/9] Fix P_FRIENDSHIP_EVO_THRESHOLD not checking for Gen 8 (#5503) --- src/pokemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pokemon.c b/src/pokemon.c index 0583939a85..356ca64ac2 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -60,7 +60,7 @@ #include "constants/weather.h" #include "wild_encounter.h" -#define FRIENDSHIP_EVO_THRESHOLD ((P_FRIENDSHIP_EVO_THRESHOLD >= GEN_9) ? 160 : 220) +#define FRIENDSHIP_EVO_THRESHOLD ((P_FRIENDSHIP_EVO_THRESHOLD >= GEN_8) ? 160 : 220) struct SpeciesItem { From cac815164af74818671b6e8c6756d654ff867406 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Fri, 11 Oct 2024 12:14:14 +0200 Subject: [PATCH 4/9] Cleanup extraneous function in header (#5506) --- include/battle_anim.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/battle_anim.h b/include/battle_anim.h index 6ff7e9ff22..36b21bc012 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -347,7 +347,6 @@ extern const union AnimCmd *const gAnims_WaterPulseBubble[]; // battle_anim_flying.c void DestroyAnimSpriteAfterTimer(struct Sprite *sprite); -void sub_810E2C8(struct Sprite *sprite); void AnimAirWaveCrescent(struct Sprite *sprite); void AnimFlyBallUp(struct Sprite *sprite); void AnimFlyBallAttack(struct Sprite *sprite); From b5c884504c2ebee68804a614bc764a53ae565f6f Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 11 Oct 2024 19:49:24 +0200 Subject: [PATCH 5/9] Fix negative mutation value (#5504) --- src/berry.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/berry.c b/src/berry.c index 9f187bd1e2..b1e29be6db 100644 --- a/src/berry.c +++ b/src/berry.c @@ -2384,6 +2384,8 @@ static u8 GetTreeMutationValue(u8 id) myMutation.asField.a = tree->mutationA; myMutation.asField.b = tree->mutationB; myMutation.asField.unused = 0; + if (myMutation.value == 0) // no mutation + return 0; return sBerryMutations[myMutation.value - 1][2]; #else return 0; From ef462d9d9b74121b7c75cbae5dd9001828e434f2 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Thu, 3 Oct 2024 00:41:04 -0400 Subject: [PATCH 6/9] meta: `remote_build` no longer untracks new files after build --- remote_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remote_build.sh b/remote_build.sh index 835520290d..300ac51ba5 100644 --- a/remote_build.sh +++ b/remote_build.sh @@ -25,7 +25,8 @@ git push build --force-with-lease if [[ $retVal -eq 0 ]]; then commit_msg=$(git log -1 --pretty=%B) if [[ "$commit_msg" == "$temp_commit_msg" ]]; then - git reset "$old_head" &>/dev/null + # Keep i(N)tent to add + git reset --mixed -N "$old_head" &>/dev/null fi fi set -x From d80190fe105eee12bbf74ae29647ac909084d35c Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:45:40 -0400 Subject: [PATCH 7/9] fix: Dig in Sealed Chamber no longer freezes follower. Fixed #5482 rhh --- data/scripts/field_move_scripts.inc | 18 ++++++++++++++++++ include/event_scripts.h | 1 + src/braille_puzzles.c | 1 - src/fldeff_dig.c | 7 +++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/data/scripts/field_move_scripts.inc b/data/scripts/field_move_scripts.inc index e15115f826..dc161eb560 100644 --- a/data/scripts/field_move_scripts.inc +++ b/data/scripts/field_move_scripts.inc @@ -376,6 +376,24 @@ EventScript_EndSurface:: releaseall end +EventScript_DigCommon: + callfunc ScrFunc_IsFollowerFieldMoveUser + .2byte VAR_0x8004 + setfieldeffectargument 3, VAR_0x8004 @ skip pose if true + dofieldeffect FLDEFF_USE_DIG + waitstate +EventScript_DigSealedChamber:: @ fallthrough + setflag FLAG_SAFE_FOLLOWER_MOVEMENT + call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove + callnative DoBrailleDigEffect + releaseall + end + +@ Use Dig from party menu +EventScript_UseDig:: + lockall + goto EventScript_DigCommon + Text_CantDive: .string "The sea is deep here. A POKéMON\n" .string "may be able to go underwater.$" diff --git a/include/event_scripts.h b/include/event_scripts.h index 2fa4468c74..ff920d62ae 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -404,6 +404,7 @@ extern const u8 EventScript_FailSweetScent[]; extern const u8 EventScript_UseFlash[]; extern const u8 EventScript_UseCut[]; extern const u8 EventScript_UseRockSmash[]; +extern const u8 EventScript_UseDig[]; //player pc extern const u8 LittlerootTown_BrendansHouse_2F_EventScript_TurnOffPlayerPC[]; diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index ab0f610fd7..757cac43b8 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -87,7 +87,6 @@ void DoBrailleDigEffect(void) DrawWholeMapView(); PlaySE(SE_BANG); FlagSet(FLAG_SYS_BRAILLE_DIG); - UnlockPlayerFieldControls(); } bool8 CheckRelicanthWailord(void) diff --git a/src/fldeff_dig.c b/src/fldeff_dig.c index c3ab989cd8..63eb848bf2 100644 --- a/src/fldeff_dig.c +++ b/src/fldeff_dig.c @@ -1,11 +1,13 @@ #include "global.h" #include "braille_puzzles.h" +#include "event_scripts.h" #include "field_effect.h" #include "field_player_avatar.h" #include "fldeff.h" #include "item_use.h" #include "overworld.h" #include "party_menu.h" +#include "script.h" #include "sprite.h" #include "constants/field_effects.h" @@ -31,8 +33,8 @@ bool8 SetUpFieldMove_Dig(void) static void FieldCallback_Dig(void) { Overworld_ResetStateAfterDigEscRope(); - FieldEffectStart(FLDEFF_USE_DIG); gFieldEffectArguments[0] = GetCursorSelectionMonId(); + ScriptContext_SetupScript(EventScript_UseDig); } bool8 FldEff_UseDig(void) @@ -53,7 +55,8 @@ static void StartDigFieldEffect(void) FieldEffectActiveListRemove(FLDEFF_USE_DIG); if (ShouldDoBrailleDigEffect()) { - DoBrailleDigEffect(); + // EventScript_DigSealedChamber handles DoBrailleDigEffect call + ScriptContext_Enable(); } else { From 743dc4d7654170468fcae277217a783438a9033f Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Sat, 12 Oct 2024 12:37:11 -0500 Subject: [PATCH 8/9] Add text fitting tests for move, ability, item, and pokedex descriptions (#5505) --- src/data/abilities.h | 6 +- src/data/items.h | 150 +++++++++--------- src/data/moves_info.h | 30 ++-- .../pokemon/species_info/gen_2_families.h | 4 +- .../pokemon/species_info/gen_3_families.h | 6 +- .../pokemon/species_info/gen_4_families.h | 16 +- .../pokemon/species_info/gen_5_families.h | 22 +-- .../pokemon/species_info/gen_6_families.h | 20 +-- .../pokemon/species_info/gen_7_families.h | 18 +-- .../pokemon/species_info/gen_8_families.h | 30 ++-- .../pokemon/species_info/gen_9_families.h | 12 +- .../pokemon/species_info/shared_dex_text.h | 12 +- test/text.c | 51 ++++++ 13 files changed, 212 insertions(+), 165 deletions(-) diff --git a/src/data/abilities.h b/src/data/abilities.h index ba768a0a51..5c28e17c05 100644 --- a/src/data/abilities.h +++ b/src/data/abilities.h @@ -1550,7 +1550,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] = [ABILITY_SLUSH_RUSH] = { .name = _("Slush Rush"), - .description = COMPOUND_STRING("Raises Speed in Hail or Snow."), + .description = COMPOUND_STRING("Raises Speed in Hail/Snow."), .aiRating = 5, }, @@ -2573,7 +2573,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] = [ABILITY_TERA_SHELL] = { .name = _("Tera Shell"), - .description = COMPOUND_STRING("Resistant to types at full HP."), + .description = COMPOUND_STRING("Resists all at full HP."), .aiRating = 10, .cantBeCopied = TRUE, .cantBeSwapped = TRUE, @@ -2588,7 +2588,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] = #else .name = _("TeraformZero"), #endif - .description = COMPOUND_STRING("Removes weather and terrain."), + .description = COMPOUND_STRING("Zeroes weather and terrain."), .aiRating = 10, .cantBeCopied = TRUE, .cantBeSwapped = TRUE, diff --git a/src/data/items.h b/src/data/items.h index 75629d579f..bffe48d725 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -538,9 +538,9 @@ const struct Item gItemsInfo[] = .name = _("Sport Ball"), .price = (I_PRICE < GEN_3 || I_PRICE >= GEN_9) ? 0 : 300, .description = COMPOUND_STRING( - "A special Ball used\n" - "in the Bug-Catching\n" - "Contest."), + "A special Ball\n" + "used in the Bug-\n" + "Catching Contest."), .pocket = POCKET_POKE_BALLS, .type = ITEM_USE_BAG_MENU, .battleUsage = EFFECT_ITEM_THROW_BALL, @@ -3176,9 +3176,9 @@ const struct Item gItemsInfo[] = .name = _("Jaw Fossil"), .price = (I_PRICE >= GEN_7) ? 7000: 1000, .description = COMPOUND_STRING( - "A piece of a prehis-\n" - "toric Pokémon's\n" - "large jaw."), + "A piece of a\n" + "prehistoric Poké-\n" + "mon's large jaw."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -3192,9 +3192,9 @@ const struct Item gItemsInfo[] = .name = _("Sail Fossil"), .price = (I_PRICE >= GEN_7) ? 7000: 1000, .description = COMPOUND_STRING( - "A piece of a prehis-\n" - "toric Pokémon's\n" - "skin sail."), + "A piece of a\n" + "prehistoric Poké-\n" + "mon's skin sail."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -4169,8 +4169,8 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 2000 * TREASURE_FACTOR : 2100, .description = COMPOUND_STRING( "Loved by a certain\n" - "Pokémon. Imbued with\n" - "spiritual energy."), + "Pokémon. Imbued\n" + "with spirit energy."), .pocket = POCKET_ITEMS, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, @@ -4186,8 +4186,8 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 3000 : ((I_PRICE >= GEN_7) ? 2000 : 500), .description = COMPOUND_STRING( "A mysterious scale\n" - "that evolves certain\n" - "Pokémon. It shines."), + "that evolves a\n" + "certain Pokémon."), .pocket = POCKET_ITEMS, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, @@ -4220,8 +4220,8 @@ const struct Item gItemsInfo[] = .name = _("Sachet"), .price = (I_PRICE >= GEN_7) ? 2000 * TREASURE_FACTOR : 2100, .description = COMPOUND_STRING( - "A sachet filled with\n" - "perfumes loved by\n" + "A sachet of strong\n" + "perfumes, loved by\n" "a certain Pokémon."), .pocket = POCKET_ITEMS, .type = EVO_HELD_ITEM_TYPE, @@ -4237,9 +4237,9 @@ const struct Item gItemsInfo[] = .name = _("Oval Stone"), .price = (I_PRICE >= GEN_7) ? 2000 : 2100, .description = COMPOUND_STRING( - "Makes a certain\n" - "Pokémon evolve. It's\n" - "shaped like an egg."), + "Peculiar stone\n" + "that evolves a\n" + "certain Pokémon."), .pocket = POCKET_ITEMS, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, @@ -4749,8 +4749,8 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_PLATE, .holdEffectParam = 20, .description = COMPOUND_STRING( - "A stone tablet that\n" - "boosts the power of\n" + "A tablet that ups\n" + "the power of\n" "Fairy-type moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4945,7 +4945,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_MEMORY, .holdEffectParam = 0, .description = COMPOUND_STRING( - "A disc with Fighting\n" + "Disc with Fighting\n" "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, @@ -7053,9 +7053,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 1000 : 10, .holdEffect = HOLD_EFFECT_QUICK_POWDER, .description = COMPOUND_STRING( - "An item to be held\n" - "by Ditto. This odd\n" - "powder boosts Speed."), + "A hold item that\n" + "raises the Speed\n" + "of Ditto."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -7132,9 +7132,9 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_ADAMANT_ORB, .holdEffectParam = 20, .description = COMPOUND_STRING( - "Boosts the power of\n" - "Dialga's Dragon and\n" - "Steel-type moves."), + "Powers up Dialga's\n" + "Dragon and Steel-\n" + "type moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -7150,9 +7150,9 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_LUSTROUS_ORB, .holdEffectParam = 20, .description = COMPOUND_STRING( - "Boosts the power of\n" - "Palkia's Dragon and\n" - "Water-type moves."), + "Powers up Palkia's\n" + "Dragon and Water-\n" + "type moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -7168,7 +7168,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_GRISEOUS_ORB, .holdEffectParam = 20, .description = COMPOUND_STRING( - "Powers up Giratina's\n" + "Boosts Giratina's\n" "Dragon and Ghost-\n" "type moves."), .pocket = POCKET_ITEMS, @@ -8107,9 +8107,9 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_CELL_BATTERY, .holdEffectParam = 0, .description = COMPOUND_STRING( - "Raises Atk if the\n" - "holder is hit by an\n" - "Electric-type move."), + "Raises Attack if\n" + "the holder is hit by\n" + "an Electric move."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8454,8 +8454,8 @@ const struct Item gItemsInfo[] = .holdEffectParam = 10, .description = COMPOUND_STRING( "A headband that\n" - "boosts the power of\n" - "physical moves."), + "boosts the power\n" + "of physical moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8525,9 +8525,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 50000 : ((I_PRICE >= GEN_7) ? 4000 : 200), .holdEffect = HOLD_EFFECT_LIFE_ORB, .description = COMPOUND_STRING( - "Boosts the power of\n" - "moves at the cost\n" - "of some HP per turn."), + "Boosts move power\n" + "but holder loses HP\n" + "with each attack."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8614,9 +8614,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 20000 : ((I_PRICE >= GEN_7) ? 4000 : 200), .holdEffect = HOLD_EFFECT_IRON_BALL, .description = COMPOUND_STRING( - "Cuts Speed and lets\n" - "Flying-types be hit\n" - "by Ground moves."), + "Cuts Speed and\n" + "becomes vulnerable\n" + "to Ground moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8663,9 +8663,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 10000 : ((I_PRICE >= GEN_7) ? 4000 : 200), .holdEffect = HOLD_EFFECT_BLACK_SLUDGE, .description = COMPOUND_STRING( - "Gradually restores\n" - "HP of Poison-types.\n" - "Damages others."), + "Restores HP for\n" + "Poison-types.\n" + "Damages all others."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8680,9 +8680,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 10000 : ((I_PRICE >= GEN_7) ? 4000 : 200), .holdEffect = HOLD_EFFECT_GRIP_CLAW, .description = COMPOUND_STRING( - "Makes binding moves\n" - "used by the holder\n" - "go on for 7 turns."), + "A held item that\n" + "extends binding\n" + "moves like Wrap."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8698,8 +8698,8 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_STICKY_BARB, .description = COMPOUND_STRING( "Damages the holder\n" - "each turn. May latch\n" - "on to foes."), + "each turn. May\n" + "latch on to foes."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8714,9 +8714,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 20000 : ((I_PRICE >= GEN_7) ? 4000 : 100), .holdEffect = HOLD_EFFECT_SHED_SHELL, .description = COMPOUND_STRING( - "Enables the holder\n" - "to switch out of\n" - "battle without fail."), + "Allows the holder\n" + "to switch out\n" + "without fail."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8733,7 +8733,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 30, .description = COMPOUND_STRING( "A held item that\n" - "boosts the power of\n" + "ups the power of\n" "HP-stealing moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -8837,9 +8837,9 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_AIR_BALLOON, .holdEffectParam = 0, .description = COMPOUND_STRING( - "Elevates the holder\n" - "in the air. If hit,\n" - "this item will burst."), + "Makes the holder\n" + "float but bursts\n" + "if hit by an attack."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8873,9 +8873,9 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_RING_TARGET, .holdEffectParam = 0, .description = COMPOUND_STRING( - "Moves that wouldn't\n" - "have effect will\n" - "land on its holder."), + "Moves that usually\n" + "have no effect will\n" + "hit the holder."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8927,9 +8927,9 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_WEAKNESS_POLICY, .holdEffectParam = 0, .description = COMPOUND_STRING( - "If hit by a Super\n" - "Effective move, ups\n" - "Atk and Sp. Atk."), + "If hit by a super-\n" + "effective move,\n" + "ups Atk and Sp. Atk."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -8980,9 +8980,9 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_9) ? 5000 : ((I_PRICE >= GEN_8) ? 4000 : 300), .holdEffect = HOLD_EFFECT_ADRENALINE_ORB, .description = COMPOUND_STRING( - "Boosts Speed if the\n" - "user is intimidated,\n" - "but only one time."), + "This orb boosts\n" + "Speed if the holder\n" + "is intimidated."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -13042,9 +13042,9 @@ const struct Item gItemsInfo[] = .price = 20000, .holdEffect = HOLD_EFFECT_COVERT_CLOAK, .description = COMPOUND_STRING( - "Protects the holder\n" - "from secondary\n" - "move effects."), + "Protects holder\n" + "from additional\n" + "effects of moves."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -14009,11 +14009,11 @@ const struct Item gItemsInfo[] = .description = COMPOUND_STRING( #if B_X_ITEMS_BUFF >= GEN_7 "Sharply raises\n" - "offenses & defenses\n" + "offense & defense\n" "during one battle."), #else - "Raises offenses\n" - "and defenses during\n" + "Raises offense\n" + "and defense during\n" "one battle."), #endif .pocket = POCKET_ITEMS, @@ -14068,9 +14068,9 @@ const struct Item gItemsInfo[] = .name = _("Pokéshi Doll"), .price = 2000, .description = COMPOUND_STRING( - "A wooden toy carved\n" - "in the image of a\n" - "Pokémon. Can be sold."), + "A wooden toy\n" + "resembling a Poké-.\n" + "mon. Can be sold."), .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, diff --git a/src/data/moves_info.h b/src/data/moves_info.h index cb23dcf5af..478f0dc426 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -14198,8 +14198,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = HANDLE_EXPANDED_MOVE_NAME("ParabolcChrg", "Parabolic Charge"), .description = COMPOUND_STRING( - "Damages adjacent Pokémon and\n" - "heals up by half of it."), + "Damages adjacent Pokémon\n" + "and heals up by half of it."), .effect = EFFECT_ABSORB, .power = B_UPDATED_MOVE_DATA >= GEN_7 ? 65 : 50, .type = TYPE_ELECTRIC, @@ -16757,7 +16757,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Plasma Fists"), .description = COMPOUND_STRING( "Hits with electrical fists.\n" - "Normal moves become Electric."), + "Normal moves turn Electric."), .effect = EFFECT_PLASMA_FISTS, .power = 100, .type = TYPE_ELECTRIC, @@ -17116,8 +17116,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = HANDLE_EXPANDED_MOVE_NAME("DynamxCannon", "Dynamax Cannon"), .description = COMPOUND_STRING( - "Fires a strong beam. Deals\n" - "2x damage to Dynamaxed foes."), + "Unleashes core energy.\n" + "2x against Dynamaxed foes."), .effect = EFFECT_DYNAMAX_DOUBLE_DMG, .power = 100, .type = TYPE_DRAGON, @@ -18637,8 +18637,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = HANDLE_EXPANDED_MOVE_NAME("GlacialLance", "Glacial Lance"), .description = COMPOUND_STRING( - "Strikes by hurling a blizzard-\n" - "cloaked icicle lance at foes."), + "Hurls a blizzard-cloaked\n" + "icicle lance at foes."), .effect = EFFECT_HIT, .power = B_UPDATED_MOVE_DATA >= GEN_9 ? 120 : 130, .type = TYPE_ICE, @@ -18659,8 +18659,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = HANDLE_EXPANDED_MOVE_NAME("AstrlBarrage", "Astral Barrage"), .description = COMPOUND_STRING( - "Strikes by sending a frightful\n" - "amount of ghosts at foes."), + "Sends a frightful amount\n" + "of small ghosts at foes."), .effect = EFFECT_HIT, .power = 120, .type = TYPE_GHOST, @@ -20381,8 +20381,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = COMPOUND_STRING("Electro Shot"), .description = COMPOUND_STRING( - "Absorbs electricity in one turn,\n" - "then attacks next turn."), + "Gathers electricity, then\n" + "fires a high-voltage shot."), .effect = EFFECT_TWO_TURNS_ATTACK, .power = 130, .type = TYPE_ELECTRIC, @@ -20404,8 +20404,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = HANDLE_EXPANDED_MOVE_NAME("TeraStarstrm", "Tera Starstorm"), .description = COMPOUND_STRING( - "Damages all opponents if user is\n" - "Stellar form Terapagos."), + "In Terapagos's Stellar\n" + "Form, it hits all foes."), .effect = EFFECT_TERA_STARSTORM, .power = 120, .type = TYPE_NORMAL, @@ -20552,8 +20552,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = HANDLE_EXPANDED_MOVE_NAME("AllurngVoice", "Alluring Voice"), .description = COMPOUND_STRING( - "Confuses the target if their\n" - "stats were boosted this turn."), + "Confuses foe if its stats\n" + "were boosted this turn."), .effect = EFFECT_HIT, .power = 80, .type = TYPE_FAIRY, diff --git a/src/data/pokemon/species_info/gen_2_families.h b/src/data/pokemon/species_info/gen_2_families.h index 5dcabda292..530c92f411 100644 --- a/src/data/pokemon/species_info/gen_2_families.h +++ b/src/data/pokemon/species_info/gen_2_families.h @@ -3990,8 +3990,8 @@ const struct SpeciesInfo gSpeciesInfoGen2[] = .weight = 474, .description = COMPOUND_STRING( "A recent study uncovered that the\n" - "number of segments a\n" - "Dudunsparce's body has is determined by the\n" + "number of segments a Dudunsparce's\n" + "body has is determined by the\n" "Pokémon's genes."), .pokemonScale = 356, .pokemonOffset = 17, diff --git a/src/data/pokemon/species_info/gen_3_families.h b/src/data/pokemon/species_info/gen_3_families.h index 8a23bb05fd..d0bc37e5fc 100644 --- a/src/data/pokemon/species_info/gen_3_families.h +++ b/src/data/pokemon/species_info/gen_3_families.h @@ -4570,9 +4570,9 @@ const struct SpeciesInfo gSpeciesInfoGen3[] = .weight = 315, .description = COMPOUND_STRING( "It uses its amped-up willpower to create\n" - "additional arms for itself. The more it has\n" - "trained its spirit, the more realistic and\n" - "dexterous these self-created arms become."), + "additional arms for itself. The more it\n" + "has trained its spirit, the more realistic\n" + "and dexterous these arms become."), .pokemonScale = 298, .pokemonOffset = 5, .trainerScale = 256, diff --git a/src/data/pokemon/species_info/gen_4_families.h b/src/data/pokemon/species_info/gen_4_families.h index c0fdd1ecec..c88dd71ddd 100644 --- a/src/data/pokemon/species_info/gen_4_families.h +++ b/src/data/pokemon/species_info/gen_4_families.h @@ -561,10 +561,10 @@ const struct SpeciesInfo gSpeciesInfoGen4[] = .height = 17, .weight = 845, .description = COMPOUND_STRING( - "The three horns that extend from its beak\n" - "attest to its power. It avoids unnecessary\n" - "disputes, but it will decimate anything\n" - "that threatens its pride."), + "The three horns that extend from its\n" + "beak attest to its power. It avoids\n" + "unnecessary disputes, but it will decimate\n" + "anything that threatens its pride."), .pokemonScale = 259, .pokemonOffset = 0, .trainerScale = 290, @@ -4873,10 +4873,10 @@ const struct SpeciesInfo gSpeciesInfoGen4[] = .height = 3, .weight = 3, .description = COMPOUND_STRING( - "If the convection microwave oven is not\n" - "working properly, then the Rotom inhabiting\n" - "it will become lethargic. It will gleefully\n" - "burn your favorite outfit in mischief."), + "If the convection microwave oven is\n" + "not working properly, then the Rotom\n" + "inhabiting it will become lethargic. It\n" + "makes mischief by turning up the heat."), .pokemonScale = 530, .pokemonOffset = 13, .trainerScale = 256, diff --git a/src/data/pokemon/species_info/gen_5_families.h b/src/data/pokemon/species_info/gen_5_families.h index e8907999fe..50ee5b1fec 100644 --- a/src/data/pokemon/species_info/gen_5_families.h +++ b/src/data/pokemon/species_info/gen_5_families.h @@ -10333,10 +10333,10 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .height = 14, .weight = 580, .description = COMPOUND_STRING( - "It draws in air through its tail, transforms\n" - "it into fire, and uses it like a tongue.\n" - "They burn through Durant's steel bodies\n" - "and consume their insides."), + "It draws in air through its tail,\n" + "transforms it into fire, and uses it like\n" + "a tongue. They burn through Durant's steel\n" + "bodies and consume their insides."), .pokemonScale = 265, .pokemonOffset = 2, .trainerScale = 262, @@ -11154,10 +11154,10 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .height = 30, .weight = 610, .description = COMPOUND_STRING( - "It pulverizes foes into\n" - "nothingness with showers of devastatingly\n" - "powerful lightning bolts launched from\n" - "the string of orbs on its tail."), + "It pulverizes foes into nothingness\n" + "with showers of devastatingly\n" + "powerful lightning bolts launched\n" + "from the string of orbs on its tail."), .pokemonScale = 268, .pokemonOffset = 2, .trainerScale = 271, @@ -11348,9 +11348,9 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .height = 15, .weight = 680, .description = COMPOUND_STRING( - "The energy that comes pouring from its tail\n" - "increases the nutrition in the soil, making\n" - "crops grow to great size. It has been\n" + "The energy that comes pouring from its\n" + "tail increases the nutrition in the soil,\n" + "granting bountiful crops. It has been\n" "hailed as “The Guardian of the Fields.”"), .pokemonScale = 268, .pokemonOffset = 2, diff --git a/src/data/pokemon/species_info/gen_6_families.h b/src/data/pokemon/species_info/gen_6_families.h index 5946ac5c44..ac77faa806 100644 --- a/src/data/pokemon/species_info/gen_6_families.h +++ b/src/data/pokemon/species_info/gen_6_families.h @@ -640,11 +640,7 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .categoryName = _("Ninja"), .height = 15, .weight = 400, - .description = COMPOUND_STRING( - "It appears and vanishes with a ninja's\n" - "grace. It toys with its enemies using swift\n" - "movements, while slicing them with throwing\n" - "stars made of compressed water."), + .description = gGreninjaPokedexText, .pokemonScale = 268, .pokemonOffset = 2, .trainerScale = 271, @@ -1806,8 +1802,8 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = { FLORGES_MISC_INFO(Red, 0), .description = COMPOUND_STRING( - "This Pokémon creates an\n" - "impressive flower garden in its territory. It\n" + "This Pokémon creates an impressive\n" + "flower garden in its territory. It\n" "draws forth the power of the red\n" "flowers around its neck."), }, @@ -4213,8 +4209,8 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .height = 17, .weight = 3341, .description = COMPOUND_STRING( - "It loathes solitude and is\n" - "extremely clingy-it will fume and run riot if\n" + "It loathes solitude and is extremely\n" + "clingy--it will fume and run riot if\n" "those dearest to it ever leave its\n" "side."), .pokemonScale = 261, @@ -5239,9 +5235,9 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .weight = 850, .description = COMPOUND_STRING( "They fly around on moonless nights and\n" - "attack careless prey. The ultrasonic waves\n" - "it emits from its ears can reduce a large\n" - "boulder to pebbles."), + "attack careless prey. The ultrasonic\n" + "waves it emits from its ears can reduce\n" + "a large boulder to pebbles."), .pokemonScale = 268, .pokemonOffset = 2, .trainerScale = 271, diff --git a/src/data/pokemon/species_info/gen_7_families.h b/src/data/pokemon/species_info/gen_7_families.h index dfee119ed5..d69b362104 100644 --- a/src/data/pokemon/species_info/gen_7_families.h +++ b/src/data/pokemon/species_info/gen_7_families.h @@ -3823,8 +3823,8 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .height = 5, .weight = 700, .description = COMPOUND_STRING( - "It takes control of anyone who puts a hand\n" - "in its mouth, to add to the accumulation\n" + "It takes control of anyone who puts a\n" + "hand in its mouth, to add to the pile\n" "of its sand-mound body. This Pokémon\n" "embodies the grudges of the departed."), .pokemonScale = 432, @@ -6208,10 +6208,10 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .height = 38, .weight = 4600, .description = COMPOUND_STRING( - "This is its form while it is\n" - "devouring the light of Solgaleo. It pounces\n" - "on foes and then slashes them with\n" - "the claws on its four limbs and back."), + "This is its form while it is devouring\n" + "the light of Solgaleo. It pounces on\n" + "foes and then slashes them with the\n" + "claws on its four limbs and back."), .pokemonScale = 256, .pokemonOffset = 3, .trainerScale = 369, @@ -6974,9 +6974,9 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .height = 25, .weight = 800, .description = COMPOUND_STRING( - "Revered long ago for its capacity to create\n" - "iron from nothing, for some reason it has\n" - "come back to life after 3,000 years."), + "Revered long ago for its capacity to\n" + "create iron from nothing, for some reason\n" + "it has come back to life after 3,000 years."), .pokemonScale = 257, .pokemonOffset = 10, .trainerScale = 423, diff --git a/src/data/pokemon/species_info/gen_8_families.h b/src/data/pokemon/species_info/gen_8_families.h index 3f8257d966..46057b3847 100644 --- a/src/data/pokemon/species_info/gen_8_families.h +++ b/src/data/pokemon/species_info/gen_8_families.h @@ -885,8 +885,8 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .description = COMPOUND_STRING( "It will bravely challenge any opponent,\n" "no matter how powerful. This Pokémon\n" - "benefits from every battle--even a defeat\n" - "increases its strength a bit."), + "benefits from every battle--even a\n" + "defeat increases its strength a bit."), .pokemonScale = 682, .pokemonOffset = 24, .trainerScale = 256, @@ -1318,8 +1318,8 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .height = 140, .weight = 0, .description = COMPOUND_STRING( - "Its brain has grown to a\n" - "gargantuan size, as has the rest of its body.\n" + "Its brain has grown to a gargantuan\n" + "size, as has the rest of its body.\n" "This Pokémon's intellect and\n" "psychic abilities are overpowering."), .pokemonScale = 491, @@ -3621,9 +3621,9 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .weight = 0, .description = COMPOUND_STRING( "The heat that comes off a\n" - "Gigantamax Centiskorch may destabilize air\n" - "currents. Sometimes it can even\n" - "cause storms."), + "Gigantamax Centiskorch may\n" + "destabilize air currents. Sometimes\n" + "it can even cause storms."), .pokemonScale = 275, .pokemonOffset = 7, .trainerScale = 256, @@ -4294,9 +4294,9 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .weight = 55, .description = COMPOUND_STRING( "Through its nose, it sucks in the\n" - "emanations produced by people and Pokémon\n" - "when they feel annoyed. It thrives off\n" - "this negative energy."), + "emanations produced by people and\n" + "Pokémon when they feel annoyed. It\n" + "thrives off this negative energy."), .pokemonScale = 491, .pokemonOffset = 12, .trainerScale = 256, @@ -5577,9 +5577,9 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .height = 230, .weight = 0, .description = COMPOUND_STRING( - "After this Pokémon has\n" - "Gigantamaxed, its massive nose can utterly\n" - "demolish large structures with a single\n" + "After this Pokémon has Gigantamaxed,\n" + "its massive nose can utterly demolish\n" + "large structures with a single\n" "smashing blow."), .pokemonScale = 275, .pokemonOffset = 7, @@ -6255,8 +6255,8 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .weight = 1100, .description = COMPOUND_STRING( "Known as a legendary hero, this Pokémon\n" - "absorbs metal particles, transforming them\n" - "into a weapon it uses to battle."), + "absorbs metal particles, transforming\n" + "them into a weapon it uses to battle."), .pokemonScale = 275, .pokemonOffset = 7, .trainerScale = 256, diff --git a/src/data/pokemon/species_info/gen_9_families.h b/src/data/pokemon/species_info/gen_9_families.h index 5a616bf4ff..6638676a8d 100644 --- a/src/data/pokemon/species_info/gen_9_families.h +++ b/src/data/pokemon/species_info/gen_9_families.h @@ -1019,8 +1019,8 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .height = 3, .weight = 25, .description = COMPOUND_STRING( - "The pads of its paws are\n" - "electricity-discharging organs. Pawmi fires\n" + "The pads of its paws are electricity-\n" + "discharging organs. Pawmi fires\n" "electricity from its forepaws while\n" "standing unsteadily on its hind legs."), .pokemonScale = 356, @@ -3939,8 +3939,8 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .height = 13, .weight = 602, .description = COMPOUND_STRING( - "This Pokémon changes its\n" - "appearance if it hears its allies calling for\n" + "This Pokémon changes its appearance\n" + "if it hears its allies calling for\n" "help. Palafin will never show\n" "anybody its moment of transformation."), .pokemonScale = 356, @@ -4002,8 +4002,8 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .weight = 974, .description = COMPOUND_STRING( "This Pokémon's ancient genes have\n" - "awakened. It is now so\n" - "extraordinarily strong that it can easily lift a\n" + "awakened. It is now so extraordinarily\n" + "strong that it can easily lift a\n" "cruise ship with one fin."), .pokemonScale = 356, .pokemonOffset = 17, diff --git a/src/data/pokemon/species_info/shared_dex_text.h b/src/data/pokemon/species_info/shared_dex_text.h index 0c591bd811..bf7e12aefb 100644 --- a/src/data/pokemon/species_info/shared_dex_text.h +++ b/src/data/pokemon/species_info/shared_dex_text.h @@ -73,9 +73,9 @@ const u8 gGenesectPokedexText[] = _( // Gen 6 families const u8 gGreninjaPokedexText[] = _( "It appears and vanishes with a ninja's\n" - "grace. It toys with its enemies using swift\n" - "movements, while slicing them with throwing\n" - "stars made of compressed water."); + "grace. It toys with its enemies using\n" + "swift movements, while slicing them with\n" + "throwing stars made of compressed water."); const u8 gScatterbugPokedexText[] = _( "When under attack from bird Pokémon,\n" @@ -207,7 +207,7 @@ const u8 gKommoOPokedexText[] = _( // Gen 8 families const u8 gAlcremieVanillaCreamPokedexText[] = _( "If Alcremie is content, the secreted cream\n" - "from its hands becomes sweeter and richer." + "from its hands becomes sweeter and richer.\n" "When it trusts a Trainer, it will treat\n" "them to berries it's decorated with cream."); @@ -279,8 +279,8 @@ const u8 gOgerponWellspringMaskPokedexText[] = _( const u8 gOgerponHearthflameMaskPokedexText[] = _( "This form is the most aggressive,\n" - "bombarding enemies with the\n" - "intensity of flames blazing within a hearth."); + "bombarding enemies with the intensity\n" + "of flames blazing within a hearth."); const u8 gOgerponCornerstoneMaskPokedexText[] = _( "In this form, it draws on the power\n" diff --git a/test/text.c b/test/text.c index 0e6900edad..7713784198 100644 --- a/test/text.c +++ b/test/text.c @@ -79,6 +79,18 @@ TEST("Move names fit on Move Relearner Screen") EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); } +TEST("Move descriptions fit on Pokemon Summary Screen") +{ + u32 i; + const u32 fontId = FONT_NORMAL, widthPx = 152; + u32 move = MOVE_NONE; + for (i = 1; i < MOVES_COUNT; i++) + { + PARAMETRIZE_LABEL("%S", gMovesInfo[i].description) { move = i; } + } + EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].description, 0), widthPx); +} + TEST("Item names fit on Bag Screen (list)") { u32 i; @@ -272,6 +284,18 @@ TEST("Item names fit on Shop Screen") EXPECT_LE(GetStringWidth(fontId, gItemsInfo[item].name, 0), widthPx); } +TEST("Item descriptions fit on Bag and Shop Screen") +{ + u32 i; + const u32 fontId = FONT_NORMAL, widthPx = 102; + u32 item = ITEM_NONE; + for (i = 1; i < ITEMS_COUNT; i++) + { + PARAMETRIZE_LABEL("%S", gItemsInfo[i].description) { item = i; } + } + EXPECT_LE(GetStringWidth(fontId, gItemsInfo[item].description, 0), widthPx); +} + TEST("Species names fit on Battle Screen HP box") { u32 i, genderWidthPx; @@ -520,6 +544,21 @@ TEST("Species names fit on Battle Screen HP box for vanilla mons with the defaul EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0), widthPx); } +TEST("Species dex entries fit on Pokedex Screen") +{ + u32 i; + const u32 fontId = FONT_NORMAL, widthPx = 224; + u32 species = SPECIES_NONE; + for (i = 1; i < NUM_SPECIES; i++) + { + if (IsSpeciesEnabled(i)) + { + PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].description) { species = i; } + } + } + EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].description, 0), widthPx); +} + TEST("Ability names fit on Pokemon Summary Screen") { u32 i; @@ -544,6 +583,18 @@ TEST("Ability names fit on Ability Pop-Up") EXPECT_LE(GetStringWidth(fontId, gAbilitiesInfo[ability].name, 0), widthPx); } +TEST("Ability descriptions fit on Pokemon Summary Screen") +{ + u32 i; + const u32 fontId = FONT_NORMAL, widthPx = 146; + u32 ability = ABILITY_NONE; + for (i = 1; i < ABILITIES_COUNT; i++) + { + PARAMETRIZE_LABEL("%S", gAbilitiesInfo[i].description) { ability = i; } + } + EXPECT_LE(GetStringWidth(fontId, gAbilitiesInfo[ability].description, 0), widthPx); +} + TEST("Type names fit on Battle Screen") { u32 i; From a01f9b4708f35a0a97541450c1f703c73967d70c Mon Sep 17 00:00:00 2001 From: aronson Date: Sat, 12 Oct 2024 13:41:26 -0500 Subject: [PATCH 9/9] Align EWRAM and IWRAM data-filled sections to 4 bytes (#5512) --- ld_script.ld | 2 ++ ld_script_modern.ld | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ld_script.ld b/ld_script.ld index a0c069c965..6c8467a002 100644 --- a/ld_script.ld +++ b/ld_script.ld @@ -18,6 +18,7 @@ SECTIONS { { __ewram_start = .; *(.ewram*) + . = ALIGN(4); __ewram_end = .; } > EWRAM @@ -38,6 +39,7 @@ SECTIONS { { __iwram_start = .; *(.iwram*); + . = ALIGN(4); __iwram_end = .; } > IWRAM diff --git a/ld_script_modern.ld b/ld_script_modern.ld index fd35a1ca31..11e53db63d 100644 --- a/ld_script_modern.ld +++ b/ld_script_modern.ld @@ -19,6 +19,7 @@ SECTIONS { { __ewram_start = .; *(.ewram*) + . = ALIGN(4); __ewram_end = .; } > EWRAM @@ -34,6 +35,7 @@ SECTIONS { { __iwram_start = .; *(.iwram*); + . = ALIGN(4); __iwram_end = .; } > IWRAM