From beeca545aa8dfc1c38f826f5b8ecbba84f6624b3 Mon Sep 17 00:00:00 2001 From: RavePossum <145081120+ravepossum@users.noreply.github.com> Date: Sun, 15 Dec 2024 09:10:42 -0500 Subject: [PATCH 01/16] Fix HGSS dex sort orders working incorrectly (#5790) --- src/pokedex_plus_hgss.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pokedex_plus_hgss.c b/src/pokedex_plus_hgss.c index 74b57fa3a50b..8782044769c6 100644 --- a/src/pokedex_plus_hgss.c +++ b/src/pokedex_plus_hgss.c @@ -2560,11 +2560,11 @@ static void CreatePokedexList(u8 dexMode, u8 order) } break; case ORDER_ALPHABETICAL: - for (i = 0; i < NUM_SPECIES - 1; i++) + for (i = 0; i < NATIONAL_DEX_COUNT; i++) { temp_dexNum = gPokedexOrder_Alphabetical[i]; - if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_SEEN)) + if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_SEEN)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2578,7 +2578,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Weight[i]; - if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2592,7 +2592,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Weight[i]; - if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2606,7 +2606,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Height[i]; - if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2620,7 +2620,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Height[i]; - if (NationalToHoennOrder(temp_dexNum) <= temp_dexCount && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if ((!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; From c7a2ef337197ae1acfd6cd3cf8577b6b4a904a4f Mon Sep 17 00:00:00 2001 From: iriv24 <40581123+iriv24@users.noreply.github.com> Date: Sun, 15 Dec 2024 10:04:06 -0500 Subject: [PATCH 02/16] Prevent Key Items that open other menus from causing a crash if registered and used from the field (#5810) --- src/item_use.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/item_use.c b/src/item_use.c index c04d9b99114f..c9be4f5caad4 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1400,9 +1400,17 @@ void ItemUseOutOfBattle_ZygardeCube(u8 taskId) void ItemUseOutOfBattle_Fusion(u8 taskId) { - gItemUseCB = ItemUseCB_Fusion; - gTasks[taskId].data[0] = FALSE; - SetUpItemUseCallback(taskId); + if (!gTasks[taskId].tUsingRegisteredKeyItem) + { + gItemUseCB = ItemUseCB_Fusion; + gTasks[taskId].data[0] = FALSE; + SetUpItemUseCallback(taskId); + } + else + { + // TODO: handle key items with callbacks to menus allow to be used by registering them. + DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem); + } } void Task_UseHoneyOnField(u8 taskId) @@ -1552,10 +1560,18 @@ static void ItemUseOnFieldCB_TownMap(u8 taskId) void ItemUseOutOfBattle_TownMap(u8 taskId) { - sItemUseOnFieldCB = ItemUseOnFieldCB_TownMap; - gFieldCallback = FieldCB_UseItemOnField; - gBagMenu->newScreenCallback = CB2_ReturnToField; - Task_FadeAndCloseBagMenu(taskId); + if (!gTasks[taskId].tUsingRegisteredKeyItem) + { + sItemUseOnFieldCB = ItemUseOnFieldCB_TownMap; + gFieldCallback = FieldCB_UseItemOnField; + gBagMenu->newScreenCallback = CB2_ReturnToField; + Task_FadeAndCloseBagMenu(taskId); + } + else + { + // TODO: handle key items with callbacks to menus allow to be used by registering them. + DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem); + } } #undef tUsingRegisteredKeyItem From 39bc916ca82879a86e33b4ee197575cac390c5d9 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 15 Dec 2024 12:04:30 -0300 Subject: [PATCH 03/16] Fix website not showing the "How to add mon" 1.10 tutorial (#5813) --- docs/SUMMARY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 597534e318e8..21584f3ad758 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -12,6 +12,7 @@ - [How to add a new move](tutorials/how_to_new_move.md) - [How to add a new trainer class](tutorials/how_to_trainer_class.md) - [How to add a new Pokémon]() + - [v1.10.x](tutorials/how_to_new_pokemon_1_10_0.md) - [v1.9.x](tutorials/how_to_new_pokemon_1_9_0.md) - [v1.8.x](tutorials/how_to_new_pokemon_1_8_0.md) - [v1.7.x](tutorials/how_to_new_pokemon_1_7_0.md) From 12f199c641996798c852492230fc1b8c59df5bd3 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:54:50 +0100 Subject: [PATCH 04/16] Fixes absorb still draining HP when flinched (#5814) --- src/battle_script_commands.c | 4 +++- test/battle/move_effect/absorb.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 12a2e215bffc..f37a18b2edc2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5674,7 +5674,9 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_ABSORB: - if (gMovesInfo[gCurrentMove].effect == EFFECT_ABSORB) + if (gMovesInfo[gCurrentMove].effect == EFFECT_ABSORB + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && TARGET_TURN_DAMAGED) { if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && gMovesInfo[gCurrentMove].healingMove) { diff --git a/test/battle/move_effect/absorb.c b/test/battle/move_effect/absorb.c index d046876b1b25..f06c970585c6 100644 --- a/test/battle/move_effect/absorb.c +++ b/test/battle/move_effect/absorb.c @@ -125,4 +125,20 @@ SINGLE_BATTLE_TEST("Draining Kiss recovers 75% of the damage dealt") } } +SINGLE_BATTLE_TEST("Absorb does not drain any HP if user flinched") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_FAKE_OUT); MOVE(player, MOVE_ABSORB); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ABSORB, player); + MESSAGE("The opposing Wobbuffet had its energy drained!"); + } + } +} + TO_DO_BATTLE_TEST("Absorb recovers 50% of the damage dealt to a Substitute"); From 99ba36b446c79c4b671077c966a71eeacfc9c446 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:47:37 +0100 Subject: [PATCH 05/16] Fixes Tidy Up (#5819) --- data/battle_scripts_1.s | 6 ++++++ src/battle_script_commands.c | 4 ++-- test/battle/move_effect/tidy_up.c | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 1eb74cea3151..2441b9547d00 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -134,7 +134,11 @@ BattleScript_EffectTidyUp:: pause B_WAIT_TIME_MED ppreduce waitstate + saveattacker + savetarget trytidyup FALSE, BattleScript_EffectTidyUpDoMoveAnimation + restoreattacker + restoretarget goto BattleScript_EffectDragonDanceFromStatUp BattleScript_EffectTidyUpDoMoveAnimation:: @@ -143,6 +147,8 @@ BattleScript_EffectTidyUpDoMoveAnimation:: trytidyup TRUE, NULL printstring STRINGID_TIDYINGUPCOMPLETE waitmessage B_WAIT_TIME_LONG + restoreattacker + restoretarget goto BattleScript_EffectDragonDanceFromStatUp BattleScript_EffectUpperHand:: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f37a18b2edc2..1d03cf3f5612 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8839,8 +8839,8 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear) static bool32 TryTidyUpClear(u32 battlerAtk, bool32 clear) { - s32 i; - u8 saveBattler = gBattlerAttacker; + u32 i; + u32 saveBattler = gBattlerAttacker; for (i = 0; i < NUM_BATTLE_SIDES; i++) { diff --git a/test/battle/move_effect/tidy_up.c b/test/battle/move_effect/tidy_up.c index 986e9a2ba39c..fcb78ba962c3 100644 --- a/test/battle/move_effect/tidy_up.c +++ b/test/battle/move_effect/tidy_up.c @@ -99,3 +99,24 @@ AI_SINGLE_BATTLE_TEST("AI will try to remove hazards if slower then target even TURN { EXPECT_MOVE(opponent, MOVE_TIDY_UP); } } } + +SINGLE_BATTLE_TEST("Tidy Up raises Attack and Speed by one after clearing hazards on opposing field") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STEALTH_ROCK); } + TURN { MOVE(player, MOVE_TIDY_UP); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STEALTH_ROCK, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TIDY_UP, player); + MESSAGE("Tidying up complete!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's Attack rose!"); + MESSAGE("Wobbuffet's Speed rose!"); + } THEN { + EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 1); + } +} From 11bc9bd2f2c9067b2de21f8a902902febbba2809 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:39:34 -0500 Subject: [PATCH 06/16] Ally Switch extra battlerId tracking (#5823) Co-authored-by: ghoulslash --- src/battle_anim_effects_1.c | 77 +++++++++++++++++++++++++++ test/battle/move_effect/ally_switch.c | 74 +++++++++++++++++++++++++ test/battle/move_effect/sticky_web.c | 28 ++++++++++ 3 files changed, 179 insertions(+) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index d5efe499ebab..1d50cee3d110 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -6642,6 +6642,79 @@ static void ReloadBattlerSprites(u32 battler, struct Pokemon *party) } } +static void TrySwapSkyDropTargets(u32 battlerAtk, u32 battlerPartner) +{ + u32 i, temp; + + // battlerAtk is using Ally Switch + // check if our partner is the target of sky drop + // If so, change that index to battlerAtk + for (i = 0; i < gBattlersCount; i++) { + if (gBattleStruct->skyDropTargets[i] == battlerPartner) { + gBattleStruct->skyDropTargets[i] = battlerAtk; + break; + } + } + + // Then swap our own sky drop targets with the partner in case our partner is mid-skydrop + SWAP(gBattleStruct->skyDropTargets[battlerAtk], gBattleStruct->skyDropTargets[battlerPartner], temp); +} + +#define TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, side, field) \ + if (gSideTimers[side].field == battlerAtk) \ + gSideTimers[side].field = battlerPartner; \ + else if (gSideTimers[side].field == battlerPartner) \ + gSideTimers[side].field = battlerAtk; + +static void TrySwapStickyWebBattlerId(u32 battlerAtk, u32 battlerPartner) +{ + u32 atkSide = GetBattlerSide(battlerAtk); + u32 oppSide = GetBattlerSide(BATTLE_OPPOSITE(battlerAtk)); + + // not all of these are needed to be swapped, but are done so to be robust to anything in the future that might care about them + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, reflectBattlerId); + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, lightscreenBattlerId); + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, mistBattlerId); + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, safeguardBattlerId); + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, auroraVeilBattlerId); + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, tailwindBattlerId); + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, atkSide, luckyChantBattlerId); + + // if we've set sticky web on the opposing side, need to swap stickyWebBattlerId for mirror armor + TRY_SIDE_TIMER_BATTLER_ID_SWAP(battlerAtk, battlerPartner, oppSide, stickyWebBattlerId); +} +#undef TRY_SIDE_TIMER_BATTLER_ID_SWAP + +static void TrySwapWishBattlerIds(u32 battlerAtk, u32 battlerPartner) +{ + u32 i, temp; + u32 oppSide = GetBattlerSide(BATTLE_OPPOSITE(battlerAtk)); + + // if used future sight on opposing side, properly track who used it + if (gSideStatuses[oppSide] & SIDE_STATUS_FUTUREATTACK) { + for (i = 0; i < gBattlersCount; i++) { + if (IsAlly(i,battlerAtk)) + continue; // only on opposing side + if (gWishFutureKnock.futureSightBattlerIndex[i] == battlerAtk) { + // if target was attacked with future sight from us, now they'll be the partner slot + gWishFutureKnock.futureSightBattlerIndex[i] = battlerPartner; + gWishFutureKnock.futureSightPartyIndex[i] = gBattlerPartyIndexes[battlerPartner]; + break; + } else if (gWishFutureKnock.futureSightBattlerIndex[i] == battlerPartner) { + gWishFutureKnock.futureSightBattlerIndex[i] = battlerAtk; + gWishFutureKnock.futureSightPartyIndex[i] = gBattlerPartyIndexes[battlerAtk]; + break; + } + } + } + + // swap wish party indices + if (gWishFutureKnock.wishCounter[battlerAtk] > 0 + || gWishFutureKnock.wishCounter[battlerPartner] > 0) { + SWAP(gWishFutureKnock.wishPartyId[battlerAtk], gWishFutureKnock.wishPartyId[battlerPartner], temp); + } +} + static void AnimTask_AllySwitchDataSwap(u8 taskId) { s32 i, j; @@ -6692,6 +6765,10 @@ static void AnimTask_AllySwitchDataSwap(u8 taskId) SwitchTwoBattlersInParty(battlerAtk, battlerPartner); SWAP(gBattlerPartyIndexes[battlerAtk], gBattlerPartyIndexes[battlerPartner], temp); + TrySwapSkyDropTargets(battlerAtk, battlerPartner); + TrySwapStickyWebBattlerId(battlerAtk, battlerPartner); + TrySwapWishBattlerIds(battlerAtk, battlerPartner); + // For Snipe Shot and abilities Stalwart/Propeller Tail - keep the original target. for (i = 0; i < MAX_BATTLERS_COUNT; i++) { diff --git a/test/battle/move_effect/ally_switch.c b/test/battle/move_effect/ally_switch.c index c7aa52d7c51e..974730f120fc 100644 --- a/test/battle/move_effect/ally_switch.c +++ b/test/battle/move_effect/ally_switch.c @@ -203,5 +203,79 @@ DOUBLE_BATTLE_TEST("Ally Switch works if ally used two-turn move like Dig") } } +DOUBLE_BATTLE_TEST("Ally switch swaps sky drop targets if being used by partner") +{ + u8 visibility; + GIVEN { + ASSUME(gMovesInfo[MOVE_SKY_DROP].effect == EFFECT_SKY_DROP); + PLAYER(SPECIES_FEAROW) { Speed(100); } + PLAYER(SPECIES_XATU) { Speed(150); } + OPPONENT(SPECIES_ARON) { Speed(25); Ability(ABILITY_STURDY); } + OPPONENT(SPECIES_WYNAUT) { Speed(30); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_SKY_DROP, target: opponentLeft); } + TURN { MOVE(playerRight, MOVE_ALLY_SWITCH); SKIP_TURN(playerLeft); MOVE(opponentRight, MOVE_MUD_SPORT); MOVE(opponentLeft, MOVE_IRON_DEFENSE); } + } SCENE { + MESSAGE("Fearow used Sky Drop!"); + MESSAGE("Fearow took the opposing Aron into the sky!"); + // turn 2 + MESSAGE("Xatu used Ally Switch!"); + MESSAGE("Xatu and Fearow switched places!"); + MESSAGE("Fearow used Sky Drop!"); + HP_BAR(opponentLeft); + MESSAGE("The opposing Wynaut used Mud Sport!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MUD_SPORT, opponentRight); + MESSAGE("The opposing Aron used Iron Defense!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_IRON_DEFENSE, opponentLeft); + } THEN { + // all battlers should be visible + visibility = gBattleSpritesDataPtr->battlerData[0].invisible; + EXPECT_EQ(visibility, 0); + visibility = gBattleSpritesDataPtr->battlerData[1].invisible; + EXPECT_EQ(visibility, 0); + visibility = gBattleSpritesDataPtr->battlerData[2].invisible; + EXPECT_EQ(visibility, 0); + visibility = gBattleSpritesDataPtr->battlerData[3].invisible; + EXPECT_EQ(visibility, 0); + } +} + +DOUBLE_BATTLE_TEST("Ally switch swaps opposing sky drop targets if partner is being held in the air") +{ + u8 visibility; + GIVEN { + ASSUME(gMovesInfo[MOVE_SKY_DROP].effect == EFFECT_SKY_DROP); + PLAYER(SPECIES_ARON) { Speed(25); Ability(ABILITY_STURDY); } + PLAYER(SPECIES_WYNAUT) { Speed(30); } + OPPONENT(SPECIES_FEAROW) { Speed(100); } + OPPONENT(SPECIES_XATU) { Speed(150); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_SKY_DROP, target: playerLeft); } + TURN { MOVE(opponentRight, MOVE_ALLY_SWITCH); SKIP_TURN(opponentLeft); MOVE(playerRight, MOVE_MUD_SPORT); MOVE(playerLeft, MOVE_IRON_DEFENSE); } + } SCENE { + MESSAGE("The opposing Fearow used Sky Drop!"); + MESSAGE("The opposing Fearow took Aron into the sky!"); + // turn 2 + MESSAGE("The opposing Xatu used Ally Switch!"); + MESSAGE("The opposing Xatu and the opposing Fearow switched places!"); + MESSAGE("The opposing Fearow used Sky Drop!"); + HP_BAR(playerLeft); + MESSAGE("Wynaut used Mud Sport!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MUD_SPORT, playerRight); + MESSAGE("Aron used Iron Defense!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_IRON_DEFENSE, playerLeft); + } THEN { + // all battlers should be visible + visibility = gBattleSpritesDataPtr->battlerData[0].invisible; + EXPECT_EQ(visibility, 0); + visibility = gBattleSpritesDataPtr->battlerData[1].invisible; + EXPECT_EQ(visibility, 0); + visibility = gBattleSpritesDataPtr->battlerData[2].invisible; + EXPECT_EQ(visibility, 0); + visibility = gBattleSpritesDataPtr->battlerData[3].invisible; + EXPECT_EQ(visibility, 0); + } +} + // Triple Battles required to test //TO_DO_BATTLE_TEST("Ally Switch fails if the user is in the middle of the field in a Triple Battle"); diff --git a/test/battle/move_effect/sticky_web.c b/test/battle/move_effect/sticky_web.c index f1fff0fd1ef2..e99368aa7d8d 100644 --- a/test/battle/move_effect/sticky_web.c +++ b/test/battle/move_effect/sticky_web.c @@ -271,3 +271,31 @@ SINGLE_BATTLE_TEST("Sticky Web is placed on the correct side after Memento") MESSAGE("A sticky web has been laid out on the ground around your team!"); } } + +DOUBLE_BATTLE_TEST("Sticky Web setter has their speed lowered with Mirror Armor even after Ally Switch") +{ + GIVEN { + PLAYER(SPECIES_SQUIRTLE); + PLAYER(SPECIES_CHARMANDER); + PLAYER(SPECIES_CORVIKNIGHT) { Ability(ABILITY_MIRROR_ARMOR); Item(ITEM_IRON_BALL); } // Iron Ball, so that flying type Corviknight is affected by Sticky Web. + OPPONENT(SPECIES_CATERPIE); + OPPONENT(SPECIES_NATU); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_STICKY_WEB); } + TURN { MOVE(opponentRight, MOVE_ALLY_SWITCH); } + TURN { SWITCH(playerRight, 2); } + } SCENE { + // Turn 1 - set up sticky web + ANIMATION(ANIM_TYPE_MOVE, MOVE_STICKY_WEB, opponentLeft); + MESSAGE("A sticky web has been laid out on the ground around your team!"); + // Turn 2 - ally switch + MESSAGE("The opposing Natu used Ally Switch!"); + // turn 3 - send our corviknight + SEND_IN_MESSAGE("Corviknight"); + MESSAGE("Corviknight was caught in a sticky web!"); + ABILITY_POPUP(playerRight, ABILITY_MIRROR_ARMOR); + // sticky web setter - caterpie (now opponentRight) gets speed lowered + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + MESSAGE("The opposing Caterpie's Speed fell!"); + } +} From 8f59d9c94fcd29163b5c03ebc2389aef4ea8de79 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:39:32 +0100 Subject: [PATCH 07/16] Fixes Shed Tail substitute health (#5826) --- src/battle_script_commands.c | 5 ++++- test/battle/move_effect/shed_tail.c | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1d03cf3f5612..7d342b0b733b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12638,7 +12638,10 @@ static void Cmd_setsubstitute(void) gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE; gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED; - gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage; + if (factor == 2) + gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage / 2; + else + gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE; gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE; } diff --git a/test/battle/move_effect/shed_tail.c b/test/battle/move_effect/shed_tail.c index 51d7652460af..6e337f4fe71f 100644 --- a/test/battle/move_effect/shed_tail.c +++ b/test/battle/move_effect/shed_tail.c @@ -99,3 +99,26 @@ AI_SINGLE_BATTLE_TEST("AI will use Shed Tail to pivot to another mon while in da TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_SHED_TAIL); } } } + +SINGLE_BATTLE_TEST("Shed Tail creates a Substitute with 1/4 of user maximum health") +{ + u32 hp; + PARAMETRIZE { hp = 160; } + PARAMETRIZE { hp = 164; } + + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument == 40); + ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); + PLAYER(SPECIES_BULBASAUR) { MaxHP(hp); } + PLAYER(SPECIES_BULBASAUR); + OPPONENT(SPECIES_CHARMANDER); + } WHEN { + TURN { MOVE(player, MOVE_SHED_TAIL); MOVE(opponent, MOVE_DRAGON_RAGE); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHED_TAIL, player); + if (hp == 160) + MESSAGE("Bulbasaur's substitute faded!"); + else + NOT MESSAGE("Bulbasaur's substitute faded!"); + } +} From f4a0cc0055b4117d2f8b90da3cfc573be70be0a9 Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:51:03 +0000 Subject: [PATCH 08/16] Adds Thief/Covet config to send stolen item to bag and Pickup config to pickup user's item in wild battles (#5829) --- include/config/battle.h | 2 + src/battle_script_commands.c | 34 +++-- src/battle_util.c | 2 +- test/battle/ability/pickup.c | 19 ++- .../battle/move_effect_secondary/steal_item.c | 129 ++++++++++++++++++ 5 files changed, 174 insertions(+), 12 deletions(-) create mode 100644 test/battle/move_effect_secondary/steal_item.c diff --git a/include/config/battle.h b/include/config/battle.h index f38be8949cf6..db3e6dcc77ff 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -154,6 +154,7 @@ #define B_ABILITY_TRIGGER_CHANCE GEN_LATEST // In Gen3, Shed Skin, Cute Charm, Flame Body, Static and Poison Point have a 1/3 chance to trigger. In Gen 4+ it's 30%. // In Gen3, Effect Spore has a 10% chance to sleep, poison or paralyze, with an equal chance. // In Gen4, it's 30%. In Gen5+ it has 11% to sleep, 9% chance to poison and 10% chance to paralyze. +#define B_PICKUP_WILD GEN_LATEST // In Gen9+, Pickup allows its user to pickup its own used item at the end of the turn in wild battles. // Item settings #define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore HP activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. @@ -163,6 +164,7 @@ #define B_MENTAL_HERB GEN_LATEST // In Gen5+, the Mental Herb cures Taunt, Encore, Torment, Heal Block, and Disable in addition to Infatuation from before. #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. #define B_RETURN_STOLEN_NPC_ITEMS GEN_LATEST // In Gen5+, Thief and Covet no longer steal items from NPCs. +#define B_STEAL_WILD_ITEMS GEN_LATEST // In Gen9, Thief and Covet steal a wild pokemon's item and send it to the bag. Before Gen9, the stolen item would be held by the Thief/Covet user. #define B_RESTORE_HELD_BATTLE_ITEMS GEN_LATEST // In Gen9, all non-berry items are restored after battle. #define B_SOUL_DEW_BOOST GEN_LATEST // In Gens3-6, Soul Dew boosts Latis' Sp. Atk and Sp. Def. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead. #define B_NET_BALL_MODIFIER GEN_LATEST // In Gen7+, Net Ball's catch multiplier is x5 instead of x3. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7d342b0b733b..1bbef2958646 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2852,17 +2852,26 @@ static void CheckSetUnburden(u8 battler) void StealTargetItem(u8 battlerStealer, u8 battlerItem) { gLastUsedItem = gBattleMons[battlerItem].item; - gBattleMons[battlerItem].item = 0; + gBattleMons[battlerItem].item = ITEM_NONE; - RecordItemEffectBattle(battlerItem, 0); - RecordItemEffectBattle(battlerStealer, ItemId_GetHoldEffect(gLastUsedItem)); - gBattleMons[battlerStealer].item = gLastUsedItem; + if (B_STEAL_WILD_ITEMS >= GEN_9 + && !(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_PALACE)) + && MoveHasAdditionalEffect(gCurrentMove, MOVE_EFFECT_STEAL_ITEM) + && battlerStealer == gBattlerAttacker) // ensure that Pickpocket isn't activating this + { + AddBagItem(gLastUsedItem, 1); + } + else + { + RecordItemEffectBattle(battlerStealer, ItemId_GetHoldEffect(gLastUsedItem)); + gBattleMons[battlerStealer].item = gLastUsedItem; + gBattleResources->flags->flags[battlerStealer] &= ~RESOURCE_FLAG_UNBURDEN; + BtlController_EmitSetMonData(battlerStealer, BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem); // set attacker item + MarkBattlerForControllerExec(battlerStealer); + } + RecordItemEffectBattle(battlerItem, ITEM_NONE); CheckSetUnburden(battlerItem); - gBattleResources->flags->flags[battlerStealer] &= ~RESOURCE_FLAG_UNBURDEN; - - BtlController_EmitSetMonData(battlerStealer, BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem); // set attacker item - MarkBattlerForControllerExec(battlerStealer); BtlController_EmitSetMonData(battlerItem, BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[battlerItem].item); // remove target item MarkBattlerForControllerExec(battlerItem); @@ -3544,8 +3553,13 @@ void SetMoveEffect(bool32 primary, bool32 certain) else { StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker steals target item - gBattleMons[gBattlerAttacker].item = ITEM_NONE; // Item assigned later on with thief (see MOVEEND_CHANGED_ITEMS) - gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later + + if (!(B_STEAL_WILD_ITEMS >= GEN_9 + && !(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_PALACE)))) + { + gBattleMons[gBattlerAttacker].item = ITEM_NONE; // Item assigned later on with thief (see MOVEEND_CHANGED_ITEMS) + gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later + } BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_ItemSteal; } diff --git a/src/battle_util.c b/src/battle_util.c index d2f5314742ed..def2742a1b7b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -11557,7 +11557,7 @@ u16 GetUsedHeldItem(u32 battler) bool32 CantPickupItem(u32 battler) { // Used by RandomUniformExcept() for RNG_PICKUP - if (battler == gBattlerAttacker && gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_LINK)) + if (battler == gBattlerAttacker && (B_PICKUP_WILD < GEN_9 || gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_LINK))) return TRUE; return !(IsBattlerAlive(battler) && GetUsedHeldItem(battler) && gBattleStruct->canPickupItem & (1u << battler)); } diff --git a/test/battle/ability/pickup.c b/test/battle/ability/pickup.c index 927e1b346855..a6dabb66cc91 100644 --- a/test/battle/ability/pickup.c +++ b/test/battle/ability/pickup.c @@ -23,7 +23,24 @@ SINGLE_BATTLE_TEST("Pickup grants an item used by another Pokémon") } } -SINGLE_BATTLE_TEST("Pickup doesn't grant the user their item") +WILD_BATTLE_TEST("Pickup grants an item used by itself in wild battles (Gen 9)") +{ + GIVEN { + ASSUME(B_PICKUP_WILD >= GEN_9); + PLAYER(SPECIES_ZIGZAGOON) { Ability(ABILITY_PICKUP); MaxHP(100); HP(51); Item(ITEM_SITRUS_BERRY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_PICKUP); + MESSAGE("Zigzagoon found one Sitrus Berry!"); + } THEN { + EXPECT_EQ(player->item, ITEM_SITRUS_BERRY); + } +} + +SINGLE_BATTLE_TEST("Pickup doesn't grant the user their item outside wild battles") { GIVEN { PLAYER(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect_secondary/steal_item.c b/test/battle/move_effect_secondary/steal_item.c new file mode 100644 index 000000000000..8a4ae931d299 --- /dev/null +++ b/test/battle/move_effect_secondary/steal_item.c @@ -0,0 +1,129 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(MoveHasAdditionalEffect(MOVE_THIEF, MOVE_EFFECT_STEAL_ITEM) == TRUE); + ASSUME(MoveHasAdditionalEffect(MOVE_COVET, MOVE_EFFECT_STEAL_ITEM) == TRUE); +} + +SINGLE_BATTLE_TEST("Thief and Covet steal target's held item") +{ + u32 move; + PARAMETRIZE { move = MOVE_THIEF; } + PARAMETRIZE { move = MOVE_COVET; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); + } THEN { + EXPECT_EQ(player->item, ITEM_HYPER_POTION); + EXPECT_EQ(opponent->item, ITEM_NONE); + } +} + +SINGLE_BATTLE_TEST("Thief and Covet steal player's held item if opponent is a trainer") +{ + u32 move; + PARAMETRIZE { move = MOVE_THIEF; } + PARAMETRIZE { move = MOVE_COVET; } + GIVEN { + ASSUME(B_TRAINERS_KNOCK_OFF_ITEMS == TRUE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, player); + } THEN { + EXPECT_EQ(opponent->item, ITEM_HYPER_POTION); + EXPECT_EQ(player->item, ITEM_NONE); + } +} + +WILD_BATTLE_TEST("Thief and Covet don't steal player's held item if opponent is a wild mon") +{ + u32 move; + PARAMETRIZE { move = MOVE_THIEF; } + PARAMETRIZE { move = MOVE_COVET; } + GIVEN { + ASSUME(B_TRAINERS_KNOCK_OFF_ITEMS == TRUE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player); + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, player); + } THEN { + EXPECT_EQ(player->item, ITEM_HYPER_POTION); + EXPECT_EQ(opponent->item, ITEM_NONE); + } +} + +SINGLE_BATTLE_TEST("Thief and Covet don't steal target's held item if user is holding an item") +{ + u32 move; + PARAMETRIZE { move = MOVE_THIEF; } + PARAMETRIZE { move = MOVE_COVET; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_POTION); } + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); + } THEN { + EXPECT_EQ(player->item, ITEM_POTION); + EXPECT_EQ(opponent->item, ITEM_HYPER_POTION); + } +} + +SINGLE_BATTLE_TEST("Thief and Covet don't steal target's held item if target has no item") +{ + u32 move; + PARAMETRIZE { move = MOVE_THIEF; } + PARAMETRIZE { move = MOVE_COVET; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); + } +} + +// Test can't currently verify if the item is sent to Bag +WILD_BATTLE_TEST("Thief and Covet steal target's held item and it's added to Bag in wild battles (Gen 9)") +{ + u32 move; + PARAMETRIZE { move = MOVE_THIEF; } + PARAMETRIZE { move = MOVE_COVET; } + GIVEN { + ASSUME(B_STEAL_WILD_ITEMS >= GEN_9); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); + } THEN { + EXPECT_EQ(player->item, ITEM_NONE); + EXPECT_EQ(opponent->item, ITEM_NONE); + } +} From 6bba281360f0a1a0b03007e1154eb0c47a20396a Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:54:42 +0000 Subject: [PATCH 09/16] Fixes Clear Amulet displaying the wrong battler and Starting Status displaying the wrong message (#5831) --- src/battle_message.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 76b9fde5cc3f..7841c18eacb9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -707,7 +707,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_NOONEWILLBEABLETORUNAWAY] = COMPOUND_STRING("No one will be able to run away during the next turn!"), [STRINGID_DESTINYKNOTACTIVATES] = COMPOUND_STRING("{B_SCR_NAME_WITH_PREFIX} fell in love because of the {B_LAST_ITEM}!"), [STRINGID_CLOAKEDINAFREEZINGLIGHT] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} became cloaked in a freezing light!"), - [STRINGID_CLEARAMULETWONTLOWERSTATS] = COMPOUND_STRING("The effects of the {B_LAST_ITEM} held by {B_DEF_NAME_WITH_PREFIX2} prevents its stats from being lowered!"), + [STRINGID_CLEARAMULETWONTLOWERSTATS] = COMPOUND_STRING("The effects of the {B_LAST_ITEM} held by {B_SCR_NAME_WITH_PREFIX2} prevents its stats from being lowered!"), [STRINGID_FERVENTWISHREACHED] = COMPOUND_STRING("{B_ATK_TRAINER_NAME}'s fervent wish has reached {B_ATK_NAME_WITH_PREFIX2}!"), [STRINGID_AIRLOCKACTIVATES] = COMPOUND_STRING("The effects of the weather disappeared."), [STRINGID_PRESSUREENTERS] = COMPOUND_STRING("{B_SCR_NAME_WITH_PREFIX} is exerting its pressure!"), @@ -1286,7 +1286,10 @@ const u16 gWeatherStartsStringIds[] = const u16 gTerrainStartsStringIds[] = { - STRINGID_MISTSWIRLSAROUND, STRINGID_ELECTRICCURRENTISRUNNING, STRINGID_ISCOVEREDWITHGRASS, STRINGID_SEEMSWEIRD, + [B_MSG_TERRAIN_SET_MISTY] = STRINGID_MISTSWIRLSAROUND, + [B_MSG_TERRAIN_SET_ELECTRIC] = STRINGID_ELECTRICCURRENTISRUNNING, + [B_MSG_TERRAIN_SET_PSYCHIC] = STRINGID_SEEMSWEIRD, + [B_MSG_TERRAIN_SET_GRASSY] = STRINGID_ISCOVEREDWITHGRASS, }; const u16 gPrimalWeatherBlocksStringIds[] = From b22a867e119268e898e18dfb47cfc5f7bf308c89 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:12:01 +0100 Subject: [PATCH 10/16] Fixes Room Service (#5827) --- data/battle_scripts_1.s | 2 +- src/battle_script_commands.c | 5 +++- test/battle/hold_effect/room_service.c | 33 ++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 test/battle/hold_effect/room_service.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 2441b9547d00..d8eb279661e0 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9101,7 +9101,7 @@ BattleScript_BerryStatRaiseEnd2:: BattleScript_BerryStatRaiseEnd2_AbilityPopup: call BattleScript_AbilityPopUp BattleScript_BerryStatRaiseEnd2_Anim: - statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_BerryStatRaiseEnd2_End + statbuffchange STAT_CHANGE_ALLOW_PTR | MOVE_EFFECT_AFFECTS_USER, BattleScript_BerryStatRaiseEnd2_End setgraphicalstatchangevalues playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1 setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1bbef2958646..a157d938a3e2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -11934,7 +11934,10 @@ static void Cmd_statbuffchange(void) const u8 *ptrBefore = gBattlescriptCurrInstr; const u8 *failInstr = cmd->failInstr; - if (ChangeStatBuffs(GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger), GET_STAT_BUFF_ID(gBattleScripting.statChanger), flags, failInstr) == STAT_CHANGE_WORKED) + if (ChangeStatBuffs(GET_STAT_BUFF_VALUE_WITH_SIGN(gBattleScripting.statChanger), + GET_STAT_BUFF_ID(gBattleScripting.statChanger), + flags, + failInstr) == STAT_CHANGE_WORKED) gBattlescriptCurrInstr = cmd->nextInstr; else if (gBattlescriptCurrInstr == ptrBefore) // Prevent infinite looping. gBattlescriptCurrInstr = failInstr; diff --git a/test/battle/hold_effect/room_service.c b/test/battle/hold_effect/room_service.c new file mode 100644 index 000000000000..04b6450e0510 --- /dev/null +++ b/test/battle/hold_effect/room_service.c @@ -0,0 +1,33 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gItemsInfo[ITEM_ROOM_SERVICE].holdEffect == HOLD_EFFECT_ROOM_SERVICE); +} + +SINGLE_BATTLE_TEST("Room Serive decreases the holder's seep by one stage") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); + ASSUME(gMovesInfo[MOVE_TRICK_ROOM].effect == EFFECT_TRICK_ROOM); + ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); Item(ITEM_ROOM_SERVICE); } + OPPONENT(SPECIES_WYNAUT) { HP(1); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(player, MOVE_TRICK_ROOM); } + TURN { MOVE(player, MOVE_EXPLOSION); SEND_OUT(player, 1); SEND_OUT(opponent, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TRICK_ROOM, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player); + HP_BAR(opponent); + MESSAGE("2 sent out Wynaut!"); + ABILITY_POPUP(player, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + } THEN { + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); + } +} From a797e901b25a793441b1b20644025bf23cebaa7c Mon Sep 17 00:00:00 2001 From: AERDU Date: Fri, 20 Dec 2024 08:46:58 +0000 Subject: [PATCH 11/16] B_LAST_USED_BALL and .importance (#5834) --- src/battle_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index def2742a1b7b..5644696776a8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -569,7 +569,8 @@ void HandleAction_ThrowBall(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; gLastUsedItem = gBallToDisplay; - RemoveBagItem(gLastUsedItem, 1); + if (!ItemId_GetImportance(gLastUsedItem)) + RemoveBagItem(gLastUsedItem, 1); gBattlescriptCurrInstr = BattleScript_BallThrow; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } From 4ac9dea30e60d6e82d4eec8988e92b7fc74f829b Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:11:18 +0000 Subject: [PATCH 12/16] Fixes Quash-affected battlers having the wrong order for End Turn effects (#5838) --- src/battle_anim_effects_1.c | 1 + src/battle_util.c | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 1d50cee3d110..da0faed03277 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -6757,6 +6757,7 @@ static void AnimTask_AllySwitchDataSwap(u8 taskId) break; } SWAP(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], temp); + SWAP(gActionsByTurnOrder[i], gActionsByTurnOrder[j], temp); break; } } diff --git a/src/battle_util.c b/src/battle_util.c index 5644696776a8..0776b6e392fa 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1679,17 +1679,12 @@ u8 DoFieldEndTurnEffects(void) switch (gBattleStruct->turnCountersTracker) { case ENDTURN_ORDER: - for (i = 0; i < gBattlersCount; i++) - { - gBattlerByTurnOrder[i] = i; - } for (i = 0; i < gBattlersCount - 1; i++) { s32 j; for (j = i + 1; j < gBattlersCount; j++) { - if (!gProtectStructs[i].quash - && !gProtectStructs[j].quash + if (!(gProtectStructs[i].quash && gProtectStructs[j].quash) && GetWhichBattlerFaster(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE) == -1) SwapTurnOrder(i, j); } From e579333427db46576d44c759ff803ced2bc3b11d Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Fri, 20 Dec 2024 11:23:51 +0100 Subject: [PATCH 13/16] Egg cycle length fix (#5828) Co-authored-by: Hedara Co-authored-by: Bassoonian --- include/config/pokemon.h | 2 +- include/global.h | 3 +-- src/daycare.c | 8 +++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index 23015614c0bc..259ad3c117de 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -55,7 +55,7 @@ #define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen. #define P_TM_LITERACY GEN_LATEST // Since Gen 6, TM illiterate Pokémon can learn TMs that teach moves that are in their level-up learnsets. #define P_CAN_FORGET_HIDDEN_MOVE FALSE // If TRUE, Pokémon can forget any move, even if it is a Hidden Move. -#define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before. +#define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before. Previous Gens have some varied step counts around 255. #define P_ONLY_OBTAINABLE_SHINIES FALSE // If TRUE, Pokémon encountered in the Battle Pyramid won't be shiny. #define P_NO_SHINIES_WITHOUT_POKEBALLS FALSE // If TRUE, Pokémon encountered when the player is out of Poké Balls won't be shiny #define P_SHOW_DYNAMIC_TYPES FALSE // If TRUE, all moves with dynamic type changes will be reflected as their current type in battle/summary screens instead of just select ones like in vanilla. diff --git a/include/global.h b/include/global.h index 5846f09359d0..687281eaa7d8 100644 --- a/include/global.h +++ b/include/global.h @@ -815,8 +815,7 @@ struct DayCare { struct DaycareMon mons[DAYCARE_MON_COUNT]; u32 offspringPersonality; - u8 stepCounter; - //u8 padding[3]; + u32 stepCounter; }; struct LilycoveLadyQuiz diff --git a/src/daycare.c b/src/daycare.c index 013e0b05ba99..912537af567a 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1154,11 +1154,17 @@ static bool8 TryProduceOrHatchEgg(struct DayCare *daycare) } // Try to hatch Egg - if (++daycare->stepCounter == ((P_EGG_CYCLE_LENGTH >= GEN_8) ? 127 : 255)) + daycare->stepCounter++; + if (((P_EGG_CYCLE_LENGTH <= GEN_3 || P_EGG_CYCLE_LENGTH == GEN_7) && daycare->stepCounter >= 256) + || (P_EGG_CYCLE_LENGTH == GEN_4 && daycare->stepCounter >= 255) + || ((P_EGG_CYCLE_LENGTH == GEN_5 || P_EGG_CYCLE_LENGTH == GEN_6) && daycare->stepCounter >= 257) + || (P_EGG_CYCLE_LENGTH >= GEN_8 && daycare->stepCounter >= 128)) { u32 eggCycles; u8 toSub = GetEggCyclesToSubtract(); + daycare->stepCounter = 0; + for (i = 0; i < gPlayerPartyCount; i++) { if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) From 5cc0b35d81c657fefb8fc82ad683d7e17766a096 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 20 Dec 2024 12:20:46 +0100 Subject: [PATCH 14/16] Replace power checks with IS_MOVE_STATUS (#5820) Co-authored-by: Eduardo Quezada --- include/battle.h | 6 +++--- src/battle_ai_main.c | 8 ++++---- src/battle_ai_switch_items.c | 14 +++++++------- src/battle_ai_util.c | 4 ++-- src/battle_arena.c | 4 ++-- src/battle_dome.c | 4 ++-- src/battle_main.c | 2 +- src/battle_script_commands.c | 4 ++-- src/battle_util.c | 6 +++--- test/battle/ability/anger_shell.c | 4 ++-- test/battle/ability/battle_bond.c | 2 +- test/battle/ability/berserk.c | 4 ++-- test/battle/ability/desolate_land.c | 4 ++-- test/battle/ability/electromorphosis.c | 6 +++--- test/battle/ability/frisk.c | 4 ++-- test/battle/ability/innards_out.c | 6 +++--- test/battle/ability/magician.c | 2 +- test/battle/ability/primordial_sea.c | 4 ++-- test/battle/ability/rattled.c | 8 ++++---- test/battle/ability/stamina.c | 4 ++-- test/battle/ability/weak_armor.c | 4 ++-- test/battle/ability/wind_power.c | 8 ++++---- test/battle/form_change/primal_reversion.c | 6 +++--- test/battle/move_effect/charge.c | 4 ++-- 24 files changed, 61 insertions(+), 61 deletions(-) diff --git a/include/battle.h b/include/battle.h index 37f23596411f..f0571d747e53 100644 --- a/include/battle.h +++ b/include/battle.h @@ -843,9 +843,9 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER #define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects. #define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type. -#define IS_MOVE_PHYSICAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) -#define IS_MOVE_SPECIAL(move)(GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL) -#define IS_MOVE_STATUS(move)(gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) +#define IS_MOVE_PHYSICAL(move) (GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) +#define IS_MOVE_SPECIAL(move) (GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL) +#define IS_MOVE_STATUS(move) (gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) #define IS_MOVE_RECOIL(move)(gMovesInfo[move].recoil > 0 || gMovesInfo[move].effect == EFFECT_RECOIL_IF_MISS) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 3c031de092c7..d245be8cd50f 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -433,7 +433,7 @@ static void SetBattlerAiMovesData(struct AiLogicData *aiData, u32 battlerAtk, u3 if (move != 0 && move != 0xFFFF - //&& gMovesInfo[move].power != 0 /* we want to get effectiveness and accuracy of status moves */ + //&& !IS_MOVE_STATUS(gMovesInfo[move]) /* we want to get effectiveness and accuracy of status moves */ && !(aiData->moveLimitations[battlerAtk] & (1u << moveIndex))) { dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, TRUE, weather, rollType); @@ -2607,8 +2607,8 @@ static s32 AI_TryToFaint(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)) return score; - if (gMovesInfo[move].power == 0) - return score; // can't make anything faint with no power + if (IS_MOVE_STATUS(move)) + return score; // status moves aren't accounted here if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, movesetIndex, 0) && gMovesInfo[move].effect != EFFECT_EXPLOSION) { @@ -4916,7 +4916,7 @@ static s32 AI_PreferBatonPass(u32 battlerAtk, u32 battlerDef, u32 move, s32 scor { if (IS_TARGETING_PARTNER(battlerAtk, battlerDef) || CountUsablePartyMons(battlerAtk) == 0 - || gMovesInfo[move].power != 0 + || !IS_MOVE_STATUS(move) || !HasMoveEffect(battlerAtk, EFFECT_BATON_PASS) || IsBattlerTrapped(battlerAtk, TRUE)) return score; diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 47f5cae7408e..b41daa741b07 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -122,8 +122,8 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler) hasStatusMove = TRUE; } - // Only check damage if move has power - if (gMovesInfo[aiMove].power != 0) + // Only check damage if it's a damaging move + if (!IS_MOVE_STATUS(aiMove)) { // Check if mon has a super effective move if (AI_GetMoveEffectiveness(aiMove, battler, opposingBattler) >= AI_EFFECTIVENESS_x2) @@ -156,7 +156,7 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler) for (i = 0; i < MAX_MON_MOVES; i++) { playerMove = gBattleMons[opposingBattler].moves[i]; - if (playerMove != MOVE_NONE && gMovesInfo[playerMove].power != 0) + if (playerMove != MOVE_NONE && !IS_MOVE_STATUS(playerMove)) { damageTaken = AI_CalcDamage(playerMove, opposingBattler, battler, &effectiveness, FALSE, weather, DMG_ROLL_HIGHEST).expected; if (damageTaken > maxDamageTaken) @@ -1238,7 +1238,7 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva for (j = 0; j < MAX_MON_MOVES; j++) { aiMove = AI_DATA->switchinCandidate.battleMon.moves[j]; - if (aiMove != MOVE_NONE && gMovesInfo[aiMove].power != 0) + if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove)) { aiMove = GetMonData(&party[i], MON_DATA_MOVE1 + j); dmg = AI_CalcPartyMonDamage(aiMove, battler, opposingBattler, AI_DATA->switchinCandidate.battleMon, TRUE, rollType); @@ -1694,7 +1694,7 @@ static s32 GetMaxDamagePlayerCouldDealToSwitchin(u32 battler, u32 opposingBattle for (i = 0; i < MAX_MON_MOVES; i++) { playerMove = gBattleMons[opposingBattler].moves[i]; - if (playerMove != MOVE_NONE && gMovesInfo[playerMove].power != 0) + if (playerMove != MOVE_NONE && !IS_MOVE_STATUS(playerMove)) { damageTaken = AI_CalcPartyMonDamage(playerMove, opposingBattler, battler, battleMon, FALSE, DMG_ROLL_HIGHEST); if (damageTaken > maxDamageTaken) @@ -1822,7 +1822,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId, { aiMove = AI_DATA->switchinCandidate.battleMon.moves[j]; - if (aiMove != MOVE_NONE && gMovesInfo[aiMove].power != 0) + if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove)) { if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_CONSERVATIVE) damageDealt = AI_CalcPartyMonDamage(aiMove, battler, opposingBattler, AI_DATA->switchinCandidate.battleMon, TRUE, DMG_ROLL_LOWEST); @@ -1852,7 +1852,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId, } // Check for mon with resistance and super effective move for best type matchup mon with effective move - if (aiMove != MOVE_NONE && gMovesInfo[aiMove].power != 0) + if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove)) { if (typeMatchup < bestResistEffective) { diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index c033061dc9e6..267fc476c245 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2378,7 +2378,7 @@ bool32 HasDamagingMove(u32 battlerId) for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gMovesInfo[moves[i]].power != 0) + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !IS_MOVE_STATUS(moves[i])) return TRUE; } @@ -2393,7 +2393,7 @@ bool32 HasDamagingMoveOfType(u32 battlerId, u32 type) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && gMovesInfo[moves[i]].type == type && gMovesInfo[moves[i]].power != 0) + && !IS_MOVE_STATUS(moves[i]].type == type && gMovesInfo[moves[i])) return TRUE; } diff --git a/src/battle_arena.c b/src/battle_arena.c index b292ff883709..8868a4246e97 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -360,7 +360,7 @@ void BattleArena_AddMindPoints(u8 battler) // All moves with power != 0 give 1 point, with the following exceptions: // - Counter, Mirror Coat, and Bide give 0 points // - Fake Out subtracts 1 point -// All moves with power == 0 give 0 points, with the following exceptions: +// All status moves give 0 points, with the following exceptions: // - Protect, Detect, and Endure subtract 1 point if (gMovesInfo[gCurrentMove].effect == EFFECT_FIRST_TURN_ONLY @@ -369,7 +369,7 @@ void BattleArena_AddMindPoints(u8 battler) { gBattleStruct->arenaMindPoints[battler]--; } - else if (gMovesInfo[gCurrentMove].power != 0 + else if (!IS_MOVE_STATUS(gCurrentMove) && gMovesInfo[gCurrentMove].effect != EFFECT_COUNTER && gMovesInfo[gCurrentMove].effect != EFFECT_MIRROR_COAT && gMovesInfo[gCurrentMove].effect != EFFECT_METAL_BURST diff --git a/src/battle_dome.c b/src/battle_dome.c index 1d7933329083..8b376c7e752b 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -4326,7 +4326,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) allocatedArray[k] = IsDomeStatusMoveEffect(move); break; case MOVE_POINTS_DMG: - allocatedArray[k] = (gMovesInfo[move].power != 0) ? 1 : 0; + allocatedArray[k] = (!IS_MOVE_STATUS(move)) ? 1 : 0; break; case MOVE_POINTS_DEF: allocatedArray[k] = IsDomeDefensiveMoveEffect(gMovesInfo[move].effect) ? 1 : 0; @@ -5108,7 +5108,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun moveIds[i * MAX_MON_MOVES + j] = gFacilityTrainerMons[DOME_MONS[winnerTournamentId][i]].moves[j]; movePower = gMovesInfo[moveIds[i * MAX_MON_MOVES + j]].power; - if (movePower == 0) + if (IS_MOVE_STATUS(moveIds[i * MAX_MON_MOVES + j])) movePower = 40; else if (movePower == 1) movePower = 60; diff --git a/src/battle_main.c b/src/battle_main.c index 075dd3dd3c78..332f6c461eab 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4839,7 +4839,7 @@ s8 GetMovePriority(u32 battler, u16 move) s8 priority; u16 ability = GetBattlerAbility(battler); - if (GetActiveGimmick(battler) == GIMMICK_Z_MOVE && gMovesInfo[move].power != 0) + if (GetActiveGimmick(battler) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(move)) move = GetUsableZMove(battler, move); priority = gMovesInfo[move].priority; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a157d938a3e2..2279b3536961 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5727,7 +5727,7 @@ static void Cmd_moveend(void) && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED - && gMovesInfo[gCurrentMove].power != 0 + && !IS_MOVE_STATUS(gCurrentMove) && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { SET_STATCHANGER(STAT_ATK, 1, FALSE); @@ -8694,7 +8694,7 @@ static void Cmd_useitemonopponent(void) static bool32 HasAttackerFaintedTarget(void) { if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && gMovesInfo[gCurrentMove].power != 0 + && !IS_MOVE_STATUS(gCurrentMove) && (gLastHitBy[gBattlerTarget] == 0xFF || gLastHitBy[gBattlerTarget] == gBattlerAttacker) && gBattleStruct->moveTarget[gBattlerAttacker] == gBattlerTarget && gBattlerTarget != gBattlerAttacker diff --git a/src/battle_util.c b/src/battle_util.c index 0776b6e392fa..4484fe254a4f 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -225,7 +225,7 @@ void HandleAction_UseMove(void) } else if (IsDoubleBattle() && gSideTimers[side].followmeTimer == 0 - && (gMovesInfo[gCurrentMove].power != 0 || (moveTarget != MOVE_TARGET_USER && moveTarget != MOVE_TARGET_ALL_BATTLERS)) + && (!IS_MOVE_STATUS(gCurrentMove) || (moveTarget != MOVE_TARGET_USER && moveTarget != MOVE_TARGET_ALL_BATTLERS)) && ((GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_STORM_DRAIN && moveType == TYPE_WATER))) { @@ -5693,7 +5693,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 case ABILITY_COLOR_CHANGE: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && move != MOVE_STRUGGLE - && gMovesInfo[move].power != 0 + && !IS_MOVE_STATUS(move) && TARGET_TURN_DAMAGED && !IS_BATTLER_OF_TYPE(battler, moveType) && moveType != TYPE_STELLAR @@ -8647,7 +8647,7 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) return TRUE; else if (gProtectStructs[battlerDef].spikyShielded) return TRUE; - else if (gProtectStructs[battlerDef].kingsShielded && gMovesInfo[move].power != 0) + else if (gProtectStructs[battlerDef].kingsShielded && !IS_MOVE_STATUS(move)) return TRUE; else if (gProtectStructs[battlerDef].maxGuarded) return TRUE; diff --git a/test/battle/ability/anger_shell.c b/test/battle/ability/anger_shell.c index c5b490216b2f..cf28fad28c07 100644 --- a/test/battle/ability/anger_shell.c +++ b/test/battle/ability/anger_shell.c @@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Anger Shell activates only if the target had more than 50% o PARAMETRIZE { hp = 254; activates = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_KLAWF) { Ability(ABILITY_ANGER_SHELL); MaxHP(maxHp); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -41,7 +41,7 @@ SINGLE_BATTLE_TEST("Anger Shell lowers Def/Sp.Def by 1 and raises Atk/Sp.Atk/Spd { u16 maxHp = 500; GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_KLAWF) { Ability(ABILITY_ANGER_SHELL); MaxHP(maxHp); HP(maxHp / 2 + 1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/battle_bond.c b/test/battle/ability/battle_bond.c index f61a6d171c44..ef2b2753b3b4 100644 --- a/test/battle/ability/battle_bond.c +++ b/test/battle/ability/battle_bond.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WATER_GUN].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_WATER_GUN)); } SINGLE_BATTLE_TEST("Battle Bond does not transform species other than Greninja") diff --git a/test/battle/ability/berserk.c b/test/battle/ability/berserk.c index 3bf269e1eef1..7d7f905170ee 100644 --- a/test/battle/ability/berserk.c +++ b/test/battle/ability/berserk.c @@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Berserk activates only if the target had more than 50% of it PARAMETRIZE { hp = 254; activates = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_DRAMPA) { Ability(ABILITY_BERSERK); MaxHP(maxHp); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -37,7 +37,7 @@ SINGLE_BATTLE_TEST("Berserk raises Sp.Atk by 1") { u16 maxHp = 500; GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_DRAMPA) { Ability(ABILITY_BERSERK); MaxHP(maxHp); HP(maxHp / 2 + 1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/desolate_land.c b/test/battle/ability/desolate_land.c index 06d604e8fcec..18fe76b0c905 100644 --- a/test/battle/ability/desolate_land.c +++ b/test/battle/ability/desolate_land.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WATER_GUN].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_WATER_GUN)); ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); } @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves") DOUBLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves and prints the message only once with moves hitting multiple targets") { GIVEN { - ASSUME(gMovesInfo[MOVE_SURF].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_SURF)); ASSUME(gMovesInfo[MOVE_SURF].type == TYPE_WATER); ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_GROUDON) {Item(ITEM_RED_ORB); {Speed(5);}} diff --git a/test/battle/ability/electromorphosis.c b/test/battle/ability/electromorphosis.c index 094b2843bfea..0f0ac1c39a1f 100644 --- a/test/battle/ability/electromorphosis.c +++ b/test/battle/ability/electromorphosis.c @@ -10,11 +10,11 @@ SINGLE_BATTLE_TEST("Electromorphosis sets up Charge when hit by any move") PARAMETRIZE {move = MOVE_GUST; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); - ASSUME(gMovesInfo[MOVE_GUST].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IS_MOVE_STATUS(MOVE_GUST)); ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_THUNDER_SHOCK)); ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); PLAYER(SPECIES_BELLIBOLT) { Ability(ABILITY_ELECTROMORPHOSIS); Speed(10); } diff --git a/test/battle/ability/frisk.c b/test/battle/ability/frisk.c index 3c892329c3b4..28bd477a35dc 100644 --- a/test/battle/ability/frisk.c +++ b/test/battle/ability/frisk.c @@ -42,7 +42,7 @@ DOUBLE_BATTLE_TEST("Frisk triggers for player in a Double Battle after switching PARAMETRIZE { target = playerRight; } GIVEN { - ASSUME(gMovesInfo[MOVE_POUND].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_POUND)); PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_FURRET) { Ability(ABILITY_FRISK); }; @@ -65,7 +65,7 @@ DOUBLE_BATTLE_TEST("Frisk triggers for opponent in a Double Battle after switchi PARAMETRIZE { target = opponentRight; } GIVEN { - ASSUME(gMovesInfo[MOVE_POUND].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_POUND)); PLAYER(SPECIES_WYNAUT) { Item(ITEM_POTION); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET) { HP(1); } diff --git a/test/battle/ability/innards_out.c b/test/battle/ability/innards_out.c index bc59bcfa0bb0..5837b98d1f68 100644 --- a/test/battle/ability/innards_out.c +++ b/test/battle/ability/innards_out.c @@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Innards Out deal dmg on fainting equal to the amount of dmg PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(70); SpAttack(1000); } OPPONENT(SPECIES_WOBBUFFET); - ASSUME(gMovesInfo[MOVE_PSYCHIC].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_PSYCHIC)); ASSUME(gMovesInfo[MOVE_PSYCHIC].category == DAMAGE_CATEGORY_SPECIAL); } WHEN { TURN { MOVE(opponent, MOVE_PSYCHIC); SEND_OUT(player, 1); if (hp == 100) { SEND_OUT(opponent, 1); } } @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("Innards Out does not trigger after Gastro Acid has been used PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); - ASSUME(gMovesInfo[MOVE_PSYCHIC].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_PSYCHIC)); ASSUME(gMovesInfo[MOVE_GASTRO_ACID].effect == EFFECT_GASTRO_ACID); } WHEN { TURN { MOVE(opponent, MOVE_GASTRO_ACID); } @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Innards Out does not damage Magic Guard Pokemon") PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_CLEFABLE) { Ability(ABILITY_MAGIC_GUARD); } - ASSUME(gMovesInfo[MOVE_PSYCHIC].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_PSYCHIC)); } WHEN { TURN { MOVE(opponent, MOVE_PSYCHIC); SEND_OUT(player, 1); } } SCENE { diff --git a/test/battle/ability/magician.c b/test/battle/ability/magician.c index a951c2f97348..14e553a76330 100644 --- a/test/battle/ability/magician.c +++ b/test/battle/ability/magician.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Magician does not get self-damage recoil after stealing Life { GIVEN { ASSUME(gItemsInfo[ITEM_LIFE_ORB].holdEffect == HOLD_EFFECT_LIFE_ORB); - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_DELPHOX) { Ability(ABILITY_MAGICIAN); Item(ITEM_NONE); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIFE_ORB); } } WHEN { diff --git a/test/battle/ability/primordial_sea.c b/test/battle/ability/primordial_sea.c index 643dca161cef..01ed892874a4 100644 --- a/test/battle/ability/primordial_sea.c +++ b/test/battle/ability/primordial_sea.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_EMBER].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_EMBER)); ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); } @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves") DOUBLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves and prints the message only once with moves hitting multiple targets") { GIVEN { - ASSUME(gMovesInfo[MOVE_ERUPTION].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_ERUPTION)); ASSUME(gMovesInfo[MOVE_ERUPTION].type == TYPE_FIRE); ASSUME(gMovesInfo[MOVE_ERUPTION].target == MOVE_TARGET_BOTH); PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB); {Speed(5);}} diff --git a/test/battle/ability/rattled.c b/test/battle/ability/rattled.c index 5d3e47db3363..da8157d28af7 100644 --- a/test/battle/ability/rattled.c +++ b/test/battle/ability/rattled.c @@ -4,13 +4,13 @@ ASSUMPTIONS { ASSUME(gMovesInfo[MOVE_FURY_CUTTER].type == TYPE_BUG); - ASSUME(gMovesInfo[MOVE_FURY_CUTTER].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_FURY_CUTTER)); ASSUME(gMovesInfo[MOVE_FEINT_ATTACK].type == TYPE_DARK); - ASSUME(gMovesInfo[MOVE_FEINT_ATTACK].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_FEINT_ATTACK)); ASSUME(gMovesInfo[MOVE_SHADOW_PUNCH].type == TYPE_GHOST); - ASSUME(gMovesInfo[MOVE_SHADOW_PUNCH].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_SHADOW_PUNCH)); ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); } SINGLE_BATTLE_TEST("Rattled boosts speed by 1 when hit by Bug, Dark or Ghost type move") diff --git a/test/battle/ability/stamina.c b/test/battle/ability/stamina.c index 527026284c0d..f5b89bb86b8c 100644 --- a/test/battle/ability/stamina.c +++ b/test/battle/ability/stamina.c @@ -24,8 +24,8 @@ SINGLE_BATTLE_TEST("Stamina raises Defense by 1 when hit by a move") PARAMETRIZE {move = MOVE_GUST; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); - ASSUME(gMovesInfo[MOVE_GUST].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IS_MOVE_STATUS(MOVE_GUST)); ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_STAMINA); } diff --git a/test/battle/ability/weak_armor.c b/test/battle/ability/weak_armor.c index 7fd7e10ef7d4..0d264e7ff93d 100644 --- a/test/battle/ability/weak_armor.c +++ b/test/battle/ability/weak_armor.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); - ASSUME(gMovesInfo[MOVE_GUST].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IS_MOVE_STATUS(MOVE_GUST)); ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); ASSUME(B_WEAK_ARMOR_SPEED >= GEN_7); diff --git a/test/battle/ability/wind_power.c b/test/battle/ability/wind_power.c index 6ccf896eaac7..a62fa9c47a60 100644 --- a/test/battle/ability/wind_power.c +++ b/test/battle/ability/wind_power.c @@ -3,13 +3,13 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_THUNDERBOLT)); ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); - ASSUME(gMovesInfo[MOVE_AIR_CUTTER].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IS_MOVE_STATUS(MOVE_AIR_CUTTER)); ASSUME(gMovesInfo[MOVE_AIR_CUTTER].target == MOVE_TARGET_BOTH); ASSUME(gMovesInfo[MOVE_AIR_CUTTER].windMove == TRUE); - ASSUME(gMovesInfo[MOVE_PETAL_BLIZZARD].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_PETAL_BLIZZARD)); ASSUME(gMovesInfo[MOVE_PETAL_BLIZZARD].target == MOVE_TARGET_FOES_AND_ALLY); ASSUME(gMovesInfo[MOVE_PETAL_BLIZZARD].windMove == TRUE); ASSUME(gMovesInfo[MOVE_TACKLE].windMove == FALSE); diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index 72e2a7e3c696..d4e682e8de78 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -120,7 +120,7 @@ DOUBLE_BATTLE_TEST("Primal reversion's order is determined by Speed - player fas SINGLE_BATTLE_TEST("Primal reversion happens after a mon is sent out after a mon is fainted") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET) {HP(1); } PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } OPPONENT(SPECIES_WOBBUFFET); @@ -156,7 +156,7 @@ SINGLE_BATTLE_TEST("Primal reversion happens after a mon is switched in") SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Eject Button") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); ASSUME(gItemsInfo[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON); PLAYER(SPECIES_WOBBUFFET) {Item(ITEM_EJECT_BUTTON); } PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } @@ -177,7 +177,7 @@ SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Eject B SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Red Card") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); ASSUME(gItemsInfo[ITEM_RED_CARD].holdEffect == HOLD_EFFECT_RED_CARD); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } diff --git a/test/battle/move_effect/charge.c b/test/battle/move_effect/charge.c index f95a1379933b..b057fa4753ad 100644 --- a/test/battle/move_effect/charge.c +++ b/test/battle/move_effect/charge.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_THUNDERBOLT)); ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); } @@ -115,7 +115,7 @@ SINGLE_BATTLE_TEST("Charge's effect is removed regardless if the next move is El GIVEN { ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { From 742f7a4875f2e83ab86c605825aedaae4a5dd1cf Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:24:23 +0000 Subject: [PATCH 15/16] Fixes Cotton Down and Gulp Missile not interacting correctly with stat reduction prevention effects (#5841) --- data/battle_scripts_1.s | 16 ++++----- test/battle/ability/cotton_down.c | 34 ++++++++++++++++++ test/battle/ability/gulp_missile.c | 57 ++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 9 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d8eb279661e0..3e1888b0316d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1218,7 +1218,6 @@ BattleScript_StrengthSapLower: playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG - goto BattleScript_StrengthSapHp @ Drain HP without lowering a stat BattleScript_StrengthSapHp: jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_StrengthSapManipulateDmg @@ -6396,18 +6395,14 @@ BattleScript_GulpMissileGulping:: datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER jumpiffainted BS_ATTACKER, TRUE, BattleScript_GulpMissileNoSecondEffectGulping - jumpifholdeffect BS_ATTACKER, HOLD_EFFECT_CLEAR_AMULET, BattleScript_GulpMissileNoSecondEffectGulping - jumpifability BS_ATTACKER, ABILITY_CLEAR_BODY, BattleScript_GulpMissileNoSecondEffectGulping - jumpifability BS_ATTACKER, ABILITY_FULL_METAL_BODY, BattleScript_GulpMissileNoSecondEffectGulping - jumpifability BS_ATTACKER, ABILITY_WHITE_SMOKE, BattleScript_GulpMissileNoSecondEffectGulping - jumpifflowerveilattacker BattleScript_GulpMissileNoSecondEffectGulping BattleScript_GulpMissileNoDmgGulping: handleformchange BS_TARGET, 0 playanimation BS_TARGET, B_ANIM_FORM_CHANGE waitanimation swapattackerwithtarget @ to make gStatDownStringIds down below print the right battler setstatchanger STAT_DEF, 1, TRUE - statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_GulpMissileGorgingTargetDefenseCantGoLower + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_GulpMissileGulpingEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_GulpMissileGulpingTargetDefenseCantGoLower setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds @@ -6419,9 +6414,11 @@ BattleScript_GulpMissileNoSecondEffectGulping: playanimation BS_TARGET, B_ANIM_FORM_CHANGE waitanimation return -BattleScript_GulpMissileGorgingTargetDefenseCantGoLower: +BattleScript_GulpMissileGulpingTargetDefenseCantGoLower: printstring STRINGID_STATSWONTDECREASE waitmessage B_WAIT_TIME_LONG +BattleScript_GulpMissileGulpingEnd: + swapattackerwithtarget @ restore the battlers, just in case return BattleScript_SeedSowerActivates:: @@ -7152,7 +7149,8 @@ BattleScript_CottonDownLoop: jumpiffainted BS_TARGET, TRUE, BattleScript_CottonDownLoopIncrement setstatchanger STAT_SPEED, 1, TRUE jumpifbyteequal gBattlerTarget, gEffectBattler, BattleScript_CottonDownLoopIncrement - statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED, BattleScript_CottonDownTargetSpeedCantGoLower + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_CottonDownLoopIncrement + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_CottonDownTargetSpeedCantGoLower setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds diff --git a/test/battle/ability/cotton_down.c b/test/battle/ability/cotton_down.c index 4d0dab9dccbe..02a0f18f638c 100644 --- a/test/battle/ability/cotton_down.c +++ b/test/battle/ability/cotton_down.c @@ -62,3 +62,37 @@ DOUBLE_BATTLE_TEST("Cotton Down drops speed by one of all other battlers on the EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); } } + +DOUBLE_BATTLE_TEST("Cotton Down correctly gets blocked by stat reduction preventing abilities") +{ + GIVEN { + PLAYER(SPECIES_METAGROSS) { Ability(ABILITY_CLEAR_BODY); } + PLAYER(SPECIES_WYNAUT) { Item(ITEM_CLEAR_AMULET); } + OPPONENT(SPECIES_ELDEGOSS) { Ability(ABILITY_COTTON_DOWN); } + OPPONENT(SPECIES_CORVIKNIGHT) { Ability(ABILITY_MIRROR_ARMOR); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft); + ABILITY_POPUP(opponentLeft, ABILITY_COTTON_DOWN); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + MESSAGE("Metagross's Speed fell!"); + } + ABILITY_POPUP(playerLeft, ABILITY_CLEAR_BODY); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Wynaut's Speed fell!"); + } + MESSAGE("The effects of the Clear Amulet held by Wynaut prevents its stats from being lowered!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + MESSAGE("The opposing Corviknight's Speed fell!"); + } + ABILITY_POPUP(opponentRight, ABILITY_MIRROR_ARMOR); + } THEN { + EXPECT_EQ(playerLeft->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); + EXPECT_EQ(playerRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); + EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); + } +} diff --git a/test/battle/ability/gulp_missile.c b/test/battle/ability/gulp_missile.c index f5e1fd9d9d7d..189702a4bef9 100644 --- a/test/battle/ability/gulp_missile.c +++ b/test/battle/ability/gulp_missile.c @@ -92,6 +92,7 @@ SINGLE_BATTLE_TEST("(Gulp Missile) Transformed Cramorant deal 1/4 of damage oppo MESSAGE("The opposing Wobbuffet's Defense fell!"); } THEN { EXPECT_EQ(gulpMissileDamage, opponent->maxHP / 4); + EXPECT_EQ(opponent->statStages[STAT_DEF], DEFAULT_STAT_STAGE - 1); } } @@ -133,3 +134,59 @@ SINGLE_BATTLE_TEST("(Gulp Missile) triggers even if the user is fainted by oppos STATUS_ICON(opponent, paralysis: TRUE); } } + +SINGLE_BATTLE_TEST("(Gulp Missile) Transformed Cramorant Gulping lowers defense but is prevented by stat reduction preventing abilities") +{ + u32 species, ability; + PARAMETRIZE { species = SPECIES_METAGROSS; ability = ABILITY_CLEAR_BODY; } + PARAMETRIZE { species = SPECIES_CORVIKNIGHT; ability = ABILITY_MIRROR_ARMOR; } + PARAMETRIZE { species = SPECIES_CHATOT; ability = ABILITY_BIG_PECKS; } + GIVEN { + PLAYER(SPECIES_CRAMORANT) { Ability(ABILITY_GULP_MISSILE); } + OPPONENT(species) { Ability(ability); } + } WHEN { + TURN { MOVE(player, MOVE_SURF); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, player); + HP_BAR(opponent); + ABILITY_POPUP(player, ABILITY_GULP_MISSILE); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + ABILITY_POPUP(player, ABILITY_GULP_MISSILE); + ABILITY_POPUP(opponent, ability); + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + } THEN { + EXPECT_EQ(opponent->statStages[STAT_DEF], DEFAULT_STAT_STAGE); + } +} + +SINGLE_BATTLE_TEST("(Gulp Missile) Transformed Cramorant Gulping lowers defense and still triggers other effects after") +{ + // Make sure attacker and target are correct after triggering the ability + u32 ability; + PARAMETRIZE { ability = ABILITY_INFILTRATOR; } + PARAMETRIZE { ability = ABILITY_CLEAR_BODY; } + GIVEN { + ASSUME(gMovesInfo[MOVE_TACKLE].makesContact == TRUE); + PLAYER(SPECIES_CRAMORANT) { Ability(ABILITY_GULP_MISSILE); Item(ITEM_ROCKY_HELMET); } + OPPONENT(SPECIES_DRAGAPULT) { Ability(ability); } + } WHEN { + TURN { MOVE(player, MOVE_SURF); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, player); + HP_BAR(opponent); + ABILITY_POPUP(player, ABILITY_GULP_MISSILE); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + ABILITY_POPUP(player, ABILITY_GULP_MISSILE); + HP_BAR(opponent); + if (ability == ABILITY_INFILTRATOR) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("The opposing Dragapult's Defense fell!"); + } else { + ABILITY_POPUP(opponent, ABILITY_CLEAR_BODY); + } + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + HP_BAR(opponent); + } +} From 9a0b5756ca7b773b2b5fc86097e9f30ed4d80243 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 20 Dec 2024 18:25:18 -0300 Subject: [PATCH 16/16] Fix "PlantCloak" references (#5821) --- src/data/graphics/pokemon.h | 32 ++++++++--------- .../object_event_pic_tables_followers.h | 8 ++--- src/data/pokemon/level_up_learnsets/gen_1.h | 2 +- src/data/pokemon/level_up_learnsets/gen_2.h | 2 +- src/data/pokemon/level_up_learnsets/gen_3.h | 2 +- src/data/pokemon/level_up_learnsets/gen_4.h | 2 +- src/data/pokemon/level_up_learnsets/gen_5.h | 2 +- src/data/pokemon/level_up_learnsets/gen_6.h | 2 +- src/data/pokemon/level_up_learnsets/gen_7.h | 2 +- src/data/pokemon/level_up_learnsets/gen_8.h | 2 +- src/data/pokemon/level_up_learnsets/gen_9.h | 2 +- .../pokemon/species_info/gen_4_families.h | 36 +++++++++---------- src/data/pokemon/teachable_learnsets.h | 2 +- 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index 8801942e5361..726a0414f45b 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -14459,11 +14459,11 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ #endif //P_FAMILY_SHIELDON #if P_FAMILY_BURMY - const u32 gMonFrontPic_BurmyPlantCloak[] = INCBIN_U32("graphics/pokemon/burmy/anim_front.4bpp.lz"); - const u32 gMonPalette_BurmyPlantCloak[] = INCBIN_U32("graphics/pokemon/burmy/normal.gbapal.lz"); - const u32 gMonBackPic_BurmyPlantCloak[] = INCBIN_U32("graphics/pokemon/burmy/back.4bpp.lz"); - const u32 gMonShinyPalette_BurmyPlantCloak[] = INCBIN_U32("graphics/pokemon/burmy/shiny.gbapal.lz"); - const u8 gMonIcon_BurmyPlantCloak[] = INCBIN_U8("graphics/pokemon/burmy/icon.4bpp"); + const u32 gMonFrontPic_BurmyPlant[] = INCBIN_U32("graphics/pokemon/burmy/anim_front.4bpp.lz"); + const u32 gMonPalette_BurmyPlant[] = INCBIN_U32("graphics/pokemon/burmy/normal.gbapal.lz"); + const u32 gMonBackPic_BurmyPlant[] = INCBIN_U32("graphics/pokemon/burmy/back.4bpp.lz"); + const u32 gMonShinyPalette_BurmyPlant[] = INCBIN_U32("graphics/pokemon/burmy/shiny.gbapal.lz"); + const u8 gMonIcon_BurmyPlant[] = INCBIN_U8("graphics/pokemon/burmy/icon.4bpp"); #if P_FOOTPRINTS const u8 gMonFootprint_Burmy[] = INCBIN_U8("graphics/pokemon/burmy/footprint.1bpp"); #endif //P_FOOTPRINTS @@ -14481,24 +14481,24 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u8 gMonIcon_BurmyTrash[] = INCBIN_U8("graphics/pokemon/burmy/trash/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - const u32 gObjectEventPic_BurmyPlantCloak[] = INCBIN_COMP("graphics/pokemon/burmy/overworld.4bpp"); + const u32 gObjectEventPic_BurmyPlant[] = INCBIN_COMP("graphics/pokemon/burmy/overworld.4bpp"); const u32 gObjectEventPic_BurmySandy[] = INCBIN_COMP("graphics/pokemon/burmy/sandy/overworld.4bpp"); const u32 gObjectEventPic_BurmyTrash[] = INCBIN_COMP("graphics/pokemon/burmy/trash/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - const u32 gOverworldPalette_BurmyPlantCloak[] = INCBIN_U32("graphics/pokemon/burmy/overworld_normal.gbapal.lz"); + const u32 gOverworldPalette_BurmyPlant[] = INCBIN_U32("graphics/pokemon/burmy/overworld_normal.gbapal.lz"); const u32 gOverworldPalette_BurmySandy[] = INCBIN_U32("graphics/pokemon/burmy/sandy/overworld_normal.gbapal.lz"); const u32 gOverworldPalette_BurmyTrash[] = INCBIN_U32("graphics/pokemon/burmy/trash/overworld_normal.gbapal.lz"); - const u32 gShinyOverworldPalette_BurmyPlantCloak[] = INCBIN_U32("graphics/pokemon/burmy/overworld_shiny.gbapal.lz"); + const u32 gShinyOverworldPalette_BurmyPlant[] = INCBIN_U32("graphics/pokemon/burmy/overworld_shiny.gbapal.lz"); const u32 gShinyOverworldPalette_BurmySandy[] = INCBIN_U32("graphics/pokemon/burmy/sandy/overworld_shiny.gbapal.lz"); const u32 gShinyOverworldPalette_BurmyTrash[] = INCBIN_U32("graphics/pokemon/burmy/trash/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS - const u32 gMonFrontPic_WormadamPlantCloak[] = INCBIN_U32("graphics/pokemon/wormadam/anim_front.4bpp.lz"); - const u32 gMonPalette_WormadamPlantCloak[] = INCBIN_U32("graphics/pokemon/wormadam/normal.gbapal.lz"); - const u32 gMonBackPic_WormadamPlantCloak[] = INCBIN_U32("graphics/pokemon/wormadam/back.4bpp.lz"); - const u32 gMonShinyPalette_WormadamPlantCloak[] = INCBIN_U32("graphics/pokemon/wormadam/shiny.gbapal.lz"); - const u8 gMonIcon_WormadamPlantCloak[] = INCBIN_U8("graphics/pokemon/wormadam/icon.4bpp"); + const u32 gMonFrontPic_WormadamPlant[] = INCBIN_U32("graphics/pokemon/wormadam/anim_front.4bpp.lz"); + const u32 gMonPalette_WormadamPlant[] = INCBIN_U32("graphics/pokemon/wormadam/normal.gbapal.lz"); + const u32 gMonBackPic_WormadamPlant[] = INCBIN_U32("graphics/pokemon/wormadam/back.4bpp.lz"); + const u32 gMonShinyPalette_WormadamPlant[] = INCBIN_U32("graphics/pokemon/wormadam/shiny.gbapal.lz"); + const u8 gMonIcon_WormadamPlant[] = INCBIN_U8("graphics/pokemon/wormadam/icon.4bpp"); #if P_FOOTPRINTS const u8 gMonFootprint_Wormadam[] = INCBIN_U8("graphics/pokemon/wormadam/footprint.1bpp"); #endif //P_FOOTPRINTS @@ -14516,14 +14516,14 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u8 gMonIcon_WormadamTrash[] = INCBIN_U8("graphics/pokemon/wormadam/trash/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - const u32 gObjectEventPic_WormadamPlantCloak[] = INCBIN_COMP("graphics/pokemon/wormadam/overworld.4bpp"); + const u32 gObjectEventPic_WormadamPlant[] = INCBIN_COMP("graphics/pokemon/wormadam/overworld.4bpp"); const u32 gObjectEventPic_WormadamSandy[] = INCBIN_COMP("graphics/pokemon/wormadam/sandy/overworld.4bpp"); const u32 gObjectEventPic_WormadamTrash[] = INCBIN_COMP("graphics/pokemon/wormadam/trash/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - const u32 gOverworldPalette_WormadamPlantCloak[] = INCBIN_U32("graphics/pokemon/wormadam/overworld_normal.gbapal.lz"); + const u32 gOverworldPalette_WormadamPlant[] = INCBIN_U32("graphics/pokemon/wormadam/overworld_normal.gbapal.lz"); const u32 gOverworldPalette_WormadamSandy[] = INCBIN_U32("graphics/pokemon/wormadam/sandy/overworld_normal.gbapal.lz"); const u32 gOverworldPalette_WormadamTrash[] = INCBIN_U32("graphics/pokemon/wormadam/trash/overworld_normal.gbapal.lz"); - const u32 gShinyOverworldPalette_WormadamPlantCloak[] = INCBIN_U32("graphics/pokemon/wormadam/overworld_shiny.gbapal.lz"); + const u32 gShinyOverworldPalette_WormadamPlant[] = INCBIN_U32("graphics/pokemon/wormadam/overworld_shiny.gbapal.lz"); const u32 gShinyOverworldPalette_WormadamSandy[] = INCBIN_U32("graphics/pokemon/wormadam/sandy/overworld_shiny.gbapal.lz"); const u32 gShinyOverworldPalette_WormadamTrash[] = INCBIN_U32("graphics/pokemon/wormadam/trash/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES diff --git a/src/data/object_events/object_event_pic_tables_followers.h b/src/data/object_events/object_event_pic_tables_followers.h index 276e8fcf6540..07193cedc785 100644 --- a/src/data/object_events/object_event_pic_tables_followers.h +++ b/src/data/object_events/object_event_pic_tables_followers.h @@ -3136,8 +3136,8 @@ static const struct SpriteFrameImage sPicTable_Bastiodon[] = { #endif //P_FAMILY_SHIELDON #if P_FAMILY_BURMY -static const struct SpriteFrameImage sPicTable_BurmyPlantCloak[] = { - overworld_ascending_frames(gObjectEventPic_BurmyPlantCloak, 4, 4), +static const struct SpriteFrameImage sPicTable_BurmyPlant[] = { + overworld_ascending_frames(gObjectEventPic_BurmyPlant, 4, 4), }; static const struct SpriteFrameImage sPicTable_BurmySandy[] = { overworld_ascending_frames(gObjectEventPic_BurmySandy, 4, 4), @@ -3145,8 +3145,8 @@ static const struct SpriteFrameImage sPicTable_BurmySandy[] = { static const struct SpriteFrameImage sPicTable_BurmyTrash[] = { overworld_ascending_frames(gObjectEventPic_BurmyTrash, 4, 4), }; -static const struct SpriteFrameImage sPicTable_WormadamPlantCloak[] = { - overworld_ascending_frames(gObjectEventPic_WormadamPlantCloak, 4, 4), +static const struct SpriteFrameImage sPicTable_WormadamPlant[] = { + overworld_ascending_frames(gObjectEventPic_WormadamPlant, 4, 4), }; static const struct SpriteFrameImage sPicTable_WormadamSandy[] = { overworld_ascending_frames(gObjectEventPic_WormadamSandy, 4, 4), diff --git a/src/data/pokemon/level_up_learnsets/gen_1.h b/src/data/pokemon/level_up_learnsets/gen_1.h index 8470b1b14ea1..f1e7cd32ff82 100644 --- a/src/data/pokemon/level_up_learnsets/gen_1.h +++ b/src/data/pokemon/level_up_learnsets/gen_1.h @@ -7717,7 +7717,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE(10, MOVE_PROTECT), LEVEL_UP_MOVE(15, MOVE_BUG_BITE), diff --git a/src/data/pokemon/level_up_learnsets/gen_2.h b/src/data/pokemon/level_up_learnsets/gen_2.h index 0f39631c4fa1..3d74d70b23b6 100644 --- a/src/data/pokemon/level_up_learnsets/gen_2.h +++ b/src/data/pokemon/level_up_learnsets/gen_2.h @@ -7961,7 +7961,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE(10, MOVE_PROTECT), LEVEL_UP_MOVE(15, MOVE_BUG_BITE), diff --git a/src/data/pokemon/level_up_learnsets/gen_3.h b/src/data/pokemon/level_up_learnsets/gen_3.h index 81e6d06b4661..cedd09b308f5 100644 --- a/src/data/pokemon/level_up_learnsets/gen_3.h +++ b/src/data/pokemon/level_up_learnsets/gen_3.h @@ -8187,7 +8187,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE(10, MOVE_PROTECT), LEVEL_UP_MOVE(15, MOVE_BUG_BITE), diff --git a/src/data/pokemon/level_up_learnsets/gen_4.h b/src/data/pokemon/level_up_learnsets/gen_4.h index 5c9f6872b51a..4b302539b2c8 100644 --- a/src/data/pokemon/level_up_learnsets/gen_4.h +++ b/src/data/pokemon/level_up_learnsets/gen_4.h @@ -9461,7 +9461,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE(10, MOVE_PROTECT), LEVEL_UP_MOVE(15, MOVE_BUG_BITE), diff --git a/src/data/pokemon/level_up_learnsets/gen_5.h b/src/data/pokemon/level_up_learnsets/gen_5.h index cb99b6375d48..2403f17b966f 100644 --- a/src/data/pokemon/level_up_learnsets/gen_5.h +++ b/src/data/pokemon/level_up_learnsets/gen_5.h @@ -9920,7 +9920,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE(10, MOVE_PROTECT), LEVEL_UP_MOVE(15, MOVE_BUG_BITE), diff --git a/src/data/pokemon/level_up_learnsets/gen_6.h b/src/data/pokemon/level_up_learnsets/gen_6.h index 32e5849cdaec..c5a3a39acfd7 100644 --- a/src/data/pokemon/level_up_learnsets/gen_6.h +++ b/src/data/pokemon/level_up_learnsets/gen_6.h @@ -10382,7 +10382,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE(10, MOVE_PROTECT), LEVEL_UP_MOVE(15, MOVE_BUG_BITE), diff --git a/src/data/pokemon/level_up_learnsets/gen_7.h b/src/data/pokemon/level_up_learnsets/gen_7.h index f88e4bcba71b..77d2fc2debde 100644 --- a/src/data/pokemon/level_up_learnsets/gen_7.h +++ b/src/data/pokemon/level_up_learnsets/gen_7.h @@ -10610,7 +10610,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), diff --git a/src/data/pokemon/level_up_learnsets/gen_8.h b/src/data/pokemon/level_up_learnsets/gen_8.h index 67d263c85960..65b557a486ed 100644 --- a/src/data/pokemon/level_up_learnsets/gen_8.h +++ b/src/data/pokemon/level_up_learnsets/gen_8.h @@ -10633,7 +10633,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), diff --git a/src/data/pokemon/level_up_learnsets/gen_9.h b/src/data/pokemon/level_up_learnsets/gen_9.h index 9f6985bc9aba..0bdfbe1eb3ec 100644 --- a/src/data/pokemon/level_up_learnsets/gen_9.h +++ b/src/data/pokemon/level_up_learnsets/gen_9.h @@ -10291,7 +10291,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { LEVEL_UP_END }; -static const struct LevelUpMove sWormadamPlantCloakLevelUpLearnset[] = { +static const struct LevelUpMove sWormadamPlantLevelUpLearnset[] = { LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), diff --git a/src/data/pokemon/species_info/gen_4_families.h b/src/data/pokemon/species_info/gen_4_families.h index b84284de2905..be0cfba99e65 100644 --- a/src/data/pokemon/species_info/gen_4_families.h +++ b/src/data/pokemon/species_info/gen_4_families.h @@ -1656,29 +1656,29 @@ const struct SpeciesInfo gSpeciesInfoGen4[] = .pokemonOffset = 24, .trainerScale = 256, .trainerOffset = 0, - .frontPic = gMonFrontPic_BurmyPlantCloak, + .frontPic = gMonFrontPic_BurmyPlant, .frontPicSize = MON_COORDS_SIZE(32, 56), .frontPicYOffset = 13, .frontAnimFrames = sAnims_Burmy, .frontAnimId = ANIM_V_STRETCH, .enemyMonElevation = 10, - .backPic = gMonBackPic_BurmyPlantCloak, + .backPic = gMonBackPic_BurmyPlant, .backPicSize = MON_COORDS_SIZE(40, 56), .backPicYOffset = 6, .backAnimId = BACK_ANIM_H_SHAKE, - .palette = gMonPalette_BurmyPlantCloak, - .shinyPalette = gMonShinyPalette_BurmyPlantCloak, - .iconSprite = gMonIcon_BurmyPlantCloak, + .palette = gMonPalette_BurmyPlant, + .shinyPalette = gMonShinyPalette_BurmyPlant, + .iconSprite = gMonIcon_BurmyPlant, .iconPalIndex = 1, SHADOW(-1, 8, SHADOW_SIZE_S) FOOTPRINT(Burmy) OVERWORLD( - sPicTable_BurmyPlantCloak, + sPicTable_BurmyPlant, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, - gOverworldPalette_BurmyPlantCloak, - gShinyOverworldPalette_BurmyPlantCloak + gOverworldPalette_BurmyPlant, + gShinyOverworldPalette_BurmyPlant ) .tmIlliterate = TRUE, .levelUpLearnset = sBurmyLevelUpLearnset, @@ -1858,32 +1858,32 @@ const struct SpeciesInfo gSpeciesInfoGen4[] = .pokemonOffset = 13, .trainerScale = 256, .trainerOffset = 0, - .frontPic = gMonFrontPic_WormadamPlantCloak, + .frontPic = gMonFrontPic_WormadamPlant, .frontPicSize = MON_COORDS_SIZE(48, 56), .frontPicYOffset = 10, .frontAnimFrames = sAnims_Wormadam, .frontAnimId = ANIM_SWING_CONVEX_FAST_SHORT, .enemyMonElevation = 8, - .backPic = gMonBackPic_WormadamPlantCloak, + .backPic = gMonBackPic_WormadamPlant, .backPicSize = MON_COORDS_SIZE(56, 64), .backPicYOffset = 2, .backAnimId = BACK_ANIM_V_SHAKE, - .palette = gMonPalette_WormadamPlantCloak, - .shinyPalette = gMonShinyPalette_WormadamPlantCloak, - .iconSprite = gMonIcon_WormadamPlantCloak, + .palette = gMonPalette_WormadamPlant, + .shinyPalette = gMonShinyPalette_WormadamPlant, + .iconSprite = gMonIcon_WormadamPlant, .iconPalIndex = 1, SHADOW(0, 9, SHADOW_SIZE_S) FOOTPRINT(Wormadam) OVERWORLD( - sPicTable_WormadamPlantCloak, + sPicTable_WormadamPlant, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, - gOverworldPalette_WormadamPlantCloak, - gShinyOverworldPalette_WormadamPlantCloak + gOverworldPalette_WormadamPlant, + gShinyOverworldPalette_WormadamPlant ) - .levelUpLearnset = sWormadamPlantCloakLevelUpLearnset, - .teachableLearnset = sWormadamPlantCloakTeachableLearnset, + .levelUpLearnset = sWormadamPlantLevelUpLearnset, + .teachableLearnset = sWormadamPlantTeachableLearnset, .formSpeciesIdTable = sWormadamFormSpeciesIdTable, }, diff --git a/src/data/pokemon/teachable_learnsets.h b/src/data/pokemon/teachable_learnsets.h index 46354db5a0d8..b0755d6039e0 100644 --- a/src/data/pokemon/teachable_learnsets.h +++ b/src/data/pokemon/teachable_learnsets.h @@ -18903,7 +18903,7 @@ static const u16 sBurmyTeachableLearnset[] = { MOVE_UNAVAILABLE, }; -static const u16 sWormadamPlantCloakTeachableLearnset[] = { +static const u16 sWormadamPlantTeachableLearnset[] = { MOVE_ATTRACT, MOVE_BULLET_SEED, MOVE_DIG,