From a4c473e73c4bacc8c60905f98741755455542da9 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 29 Aug 2025 10:11:32 +0200 Subject: [PATCH 1/6] Update README.md (#7639) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6c91a3ad84..93c6b3a913 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # About `pokeemerald-expansion` -![Gif that shows debugging functionality that is unique to pokeemerald-expansion such as rerolling Trainer Id, Cheat Start, PC from Debug Menu, Debug PC Fill, Pokemon Sprite Visualizer, Debug Warp to Map, and Battle Debug Menu](https://github.com/user-attachments/assets/cf9dfbee-4c6b-4bca-8e0a-07f116ef891c) ![Gif that shows overworld functionality that is unique to pokeemerald-expansion such as indoor running, BW2 style map popups, overworld followers, DNA Splicers, Gen 1 style fishing, OW Item descriptions, Quick Run from Battle, Use Last Ball, Wild Double Battles, and Catch from EXP](https://github.com/user-attachments/assets/383af243-0904-4d41-bced-721492fbc48e) ![Gif that shows off a number of modern Pokemon battle mechanics happening in the pokeemerald-expansion engine: 2 vs 1 battles, modern Pokemon, items, moves, abilities, fully customizable opponents and partners, Trainer Slides, and generational gimmicks](https://github.com/user-attachments/assets/50c576bc-415e-4d66-a38f-ad712f3316be) +![Gif that shows debugging functionality that is unique to pokeemerald-expansion such as rerolling Trainer ID, Cheat Start, PC from Debug Menu, Debug PC Fill, Pokémon Sprite Visualizer, Debug Warp to Map, and Battle Debug Menu](https://github.com/user-attachments/assets/cf9dfbee-4c6b-4bca-8e0a-07f116ef891c) ![Gif that shows overworld functionality that is unique to pokeemerald-expansion such as indoor running, BW2 style map popups, overworld followers, DNA Splicers, Gen 1 style fishing, OW Item descriptions, Quick Run from Battle, Use Last Ball, Wild Double Battles, and Catch from EXP](https://github.com/user-attachments/assets/383af243-0904-4d41-bced-721492fbc48e) ![Gif that shows off a number of modern Pokémon battle mechanics happening in the pokeemerald-expansion engine: 2 vs 1 battles, modern Pokémon, items, moves, abilities, fully customizable opponents and partners, Trainer Slides, and generational gimmicks](https://github.com/user-attachments/assets/50c576bc-415e-4d66-a38f-ad712f3316be) @@ -8,7 +8,7 @@ # [Features](FEATURES.md) -**`pokeemerald-expansion`** offers hundreds of features from various [core series Pokémon games](https://bulbapedia.bulbagarden.net/wiki/Core_series), along with popular quality-of-life enhancements designed to streamline development and improve the player experience. A full list of those featues can be found in [`FEATURES.md`](FEATURES.md). +**`pokeemerald-expansion`** offers hundreds of features from various [core series Pokémon games](https://bulbapedia.bulbagarden.net/wiki/Core_series), along with popular quality-of-life enhancements designed to streamline development and improve the player experience. A full list of those features can be found in [`FEATURES.md`](FEATURES.md). # [Credits](CREDITS.md) @@ -32,7 +32,7 @@ Please consider [crediting all contributors](CREDITS.md) involved in the project ❗❗ **Important**: Do not use GitHub's "Download Zip" option as it will not include commit history. This is necessary if you want to update or merge other feature branches. -If you're new to git and GitHub, [Team Aqua's Asset Repo](https://github.com/Pawkkie/Team-Aquas-Asset-Repo/) has a [guide on forking and cloning the repository](https://github.com/Pawkkie/Team-Aquas-Asset-Repo/wiki/The-Basics-of-GitHub). Then you can follow one of the following guides: +If you're new to git and GitHub, [Team Aqua's Asset Repo](https://github.com/Pawkkie/Team-Aquas-Asset-Repo/) has a [guide to forking and cloning the repository](https://github.com/Pawkkie/Team-Aquas-Asset-Repo/wiki/The-Basics-of-GitHub). Then you can follow one of the following guides: ## 📥 [Installing **`pokeemerald-expansion`**](INSTALL.md) ## 🏗️ [Building **`pokeemerald-expansion`**](INSTALL.md#Building-pokeemerald-expansion) @@ -50,4 +50,4 @@ If you are looking to [report a bug](CONTRIBUTING.md#Bug-Report), [open a pull r [![](https://dcbadge.limes.pink/api/server/6CzjAG6GZk)](https://discord.gg/6CzjAG6GZk) -Our community uses the [Rom Hacking Hideout (RHH) Discord server](https://discord.gg/6CzjAG6GZk) to communicate and organize. Most of our discussions take place there, and we welcome anybody to join us! +Our community uses the [ROM Hacking Hideout (RHH) Discord server](https://discord.gg/6CzjAG6GZk) to communicate and organize. Most of our discussions take place there, and we welcome anybody to join us! From 7302de4209491ed30d214f3d1ed2182b2f58bb47 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sat, 30 Aug 2025 11:22:02 +0200 Subject: [PATCH 2/6] Replace boolean multiplications with ternaries (#7653) Co-authored-by: Hedara --- src/battle_script_commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c08324b6e8..6845e760f4 100755 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1630,12 +1630,12 @@ s32 CalcCritChanceStage(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordA } else { - critChance = 2 * (gBattleMons[battlerAtk].volatiles.focusEnergy != 0) - + 1 * (gBattleMons[battlerAtk].volatiles.dragonCheer != 0) + critChance = (gBattleMons[battlerAtk].volatiles.focusEnergy != 0 ? 2 : 0) + + (gBattleMons[battlerAtk].volatiles.dragonCheer != 0 ? 1 : 0) + GetMoveCriticalHitStage(move) + GetHoldEffectCritChanceIncrease(battlerAtk, holdEffectAtk) - + 2 * (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(battlerAtk) == AFFECTION_FIVE_HEARTS) - + (abilityAtk == ABILITY_SUPER_LUCK) + + ((B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(battlerAtk) == AFFECTION_FIVE_HEARTS) ? 2 : 0) + + (abilityAtk == ABILITY_SUPER_LUCK ? 1 : 0) + gBattleStruct->bonusCritStages[gBattlerAttacker]; if (critChance >= ARRAY_COUNT(sCriticalHitOdds)) From 674cd136595cb5cd700c0bc869f0b85c75a227fa Mon Sep 17 00:00:00 2001 From: Frank DeBlasio <35279583+fdeblasio@users.noreply.github.com> Date: Sun, 31 Aug 2025 14:53:23 -0400 Subject: [PATCH 3/6] Added sortType to Douse Drive (#7664) --- src/data/items.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/data/items.h b/src/data/items.h index d86a610eb4..9927191d64 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -5033,6 +5033,7 @@ const struct Item gItemsInfo[] = "Techno Blast to\n" "Water-type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_DRIVE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, From 84f5aa6dae62da212efa2e8de11585bad189a031 Mon Sep 17 00:00:00 2001 From: surskitty Date: Mon, 1 Sep 2025 15:43:04 -0400 Subject: [PATCH 4/6] Helping Hand bugfix; used FOE instead of BATTLE_OPPOSITE. (#7659) --- src/battle_ai_main.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index ebbabf93c8..0623faf864 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1,3 +1,5 @@ +// Note that FOE specifically returns the left-side battler; BATTLE_OPPOSITE is the diagonal. + #include "global.h" #include "main.h" #include "malloc.h" @@ -3098,45 +3100,44 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) } else { - u32 ownHitsToKOFoe1 = GetBestNoOfHitsToKO(battlerAtk, FOE(battlerAtk), AI_ATTACKING); - u32 partnerHitsToKOFoe1 = GetBestNoOfHitsToKO(battlerAtkPartner, FOE(battlerAtk), AI_ATTACKING); - u32 ownHitsToKOFoe2 = GetBestNoOfHitsToKO(battlerAtk, FOE(battlerAtkPartner), AI_ATTACKING); - u32 partnerHitsToKOFoe2 = GetBestNoOfHitsToKO(battlerAtkPartner, FOE(battlerAtkPartner), AI_ATTACKING); + u32 ownHitsToKOFoe1 = GetBestNoOfHitsToKO(battlerAtk, BATTLE_OPPOSITE(battlerAtk), AI_ATTACKING); + u32 partnerHitsToKOFoe1 = GetBestNoOfHitsToKO(battlerAtkPartner, BATTLE_OPPOSITE(battlerAtk), AI_ATTACKING); + u32 ownHitsToKOFoe2 = GetBestNoOfHitsToKO(battlerAtk, BATTLE_OPPOSITE(battlerAtkPartner), AI_ATTACKING); + u32 partnerHitsToKOFoe2 = GetBestNoOfHitsToKO(battlerAtkPartner, BATTLE_OPPOSITE(battlerAtkPartner), AI_ATTACKING); if (hasTwoOpponents) { // Might be about to die - if (CanTargetFaintAi(FOE(battlerAtk), battlerAtk) && CanTargetFaintAi(FOE(battlerAtkPartner), battlerAtk) - && AI_IsSlower(battlerAtk, FOE(battlerAtk), move, predictedMove, DONT_CONSIDER_PRIORITY) - && AI_IsSlower(battlerAtk, FOE(battlerAtkPartner), move, predictedMove, DONT_CONSIDER_PRIORITY)) + if (CanTargetFaintAi(BATTLE_OPPOSITE(battlerAtk), battlerAtk) && CanTargetFaintAi(BATTLE_OPPOSITE(battlerAtkPartner), battlerAtk) + && AI_IsSlower(battlerAtk, BATTLE_OPPOSITE(battlerAtk), move, predictedMove, DONT_CONSIDER_PRIORITY) + && AI_IsSlower(battlerAtk, BATTLE_OPPOSITE(battlerAtkPartner), move, predictedMove, DONT_CONSIDER_PRIORITY)) ADJUST_SCORE(GOOD_EFFECT); if (ownHitsToKOFoe1 > partnerHitsToKOFoe1 && partnerHitsToKOFoe1 > 1 && ownHitsToKOFoe2 > partnerHitsToKOFoe2 && partnerHitsToKOFoe2 > 1) ADJUST_SCORE(GOOD_EFFECT); } - else if (IsBattlerAlive(FOE(battlerAtk))) + else if (IsBattlerAlive(BATTLE_OPPOSITE(battlerAtk))) { // Might be about to die - if (CanTargetFaintAi(FOE(battlerAtk), battlerAtk) - && AI_IsSlower(battlerAtk, FOE(battlerAtk), move, predictedMove, DONT_CONSIDER_PRIORITY)) + if (CanTargetFaintAi(BATTLE_OPPOSITE(battlerAtk), battlerAtk) + && AI_IsSlower(battlerAtk, BATTLE_OPPOSITE(battlerAtk), move, predictedMove, DONT_CONSIDER_PRIORITY)) ADJUST_SCORE(GOOD_EFFECT); if (ownHitsToKOFoe1 > partnerHitsToKOFoe1 && partnerHitsToKOFoe1 > 1) ADJUST_SCORE(GOOD_EFFECT); } - else if (IsBattlerAlive(FOE(battlerAtkPartner))) + else if (IsBattlerAlive(BATTLE_OPPOSITE(battlerAtkPartner))) { // Might be about to die - if (CanTargetFaintAi(FOE(battlerAtkPartner), battlerAtk) - && AI_IsSlower(battlerAtk, FOE(battlerAtkPartner), move, predictedMove, DONT_CONSIDER_PRIORITY)) + if (CanTargetFaintAi(BATTLE_OPPOSITE(battlerAtkPartner), battlerAtk) + && AI_IsSlower(battlerAtk, BATTLE_OPPOSITE(battlerAtkPartner), move, predictedMove, DONT_CONSIDER_PRIORITY)) ADJUST_SCORE(GOOD_EFFECT); if (ownHitsToKOFoe2 > partnerHitsToKOFoe2 && partnerHitsToKOFoe2 > 1) ADJUST_SCORE(GOOD_EFFECT); - } - + } } break; case EFFECT_PERISH_SONG: From cfcdd5f776857a28d2b23d6cf26f0ad56a26a0b9 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Tue, 2 Sep 2025 14:59:33 +0200 Subject: [PATCH 5/6] Fix crashing tests duplicating tests from another thread (#7683) Co-authored-by: Hedara --- test/test_runner.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_runner.c b/test/test_runner.c index fe9a5eccb6..218061d63f 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -235,6 +235,8 @@ top: } else { + // Cost must be assigned to the test that crashed, otherwise tests will be desynched + AssignCostToRunner(); gTestRunnerState.state = STATE_REPORT_RESULT; gTestRunnerState.result = TEST_RESULT_CRASH; } From 619ee562fad99e45cbfedbc6d7f629c3731bdb9c Mon Sep 17 00:00:00 2001 From: Hedara Date: Tue, 2 Sep 2025 15:18:41 +0200 Subject: [PATCH 6/6] Mark failing test that was masked --- test/battle/ai/ai_doubles.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/battle/ai/ai_doubles.c b/test/battle/ai/ai_doubles.c index fcef1f9d0a..b867eca087 100644 --- a/test/battle/ai/ai_doubles.c +++ b/test/battle/ai/ai_doubles.c @@ -621,6 +621,7 @@ AI_DOUBLE_BATTLE_TEST("AI uses Helping Hand if it's about to die") AI_DOUBLE_BATTLE_TEST("AI uses Helping Hand if the ally does notably more damage") { + KNOWN_FAILING; // Failure was masked by test runner issues GIVEN { ASSUME(GetMoveEffect(MOVE_HELPING_HAND) == EFFECT_HELPING_HAND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_OMNISCIENT);