diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml new file mode 100644 index 000000000..7a04bf329 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -0,0 +1,49 @@ +name: ⚔️ Battle Engine mechanical bugs 🐛 +description: File a bug report related to battle mechanic, be it moves, abilities and/or items. +labels: ["bug", "status: unconfirmed", "category: battle-mechanic"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of pokeemerald-expansion are you using as a base? + options: + - 1.5.0 (Default) + - upcoming (Edge) + - 1.4.3 + - 1.4.2 + - 1.4.1 + - 1.4.0 + - pre-1.4.0 + validations: + required: true + - type: input + id: upcomingversion + attributes: + label: Upcoming Version + description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. + validations: + required: false + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml new file mode 100644 index 000000000..ef03b5547 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -0,0 +1,49 @@ +name: 🧠 Battle AI bugs 🐛 +description: File a bug report related to battle AI. +labels: ["bug", "status: unconfirmed", "category: battle-ai"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of pokeemerald-expansion are you using as a base? + options: + - 1.5.0 (Default) + - upcoming (Edge) + - 1.4.3 + - 1.4.2 + - 1.4.1 + - 1.4.0 + - pre-1.4.0 + validations: + required: true + - type: input + id: upcomingversion + attributes: + label: Upcoming Version + description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. + validations: + required: false + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/03_feature_requests.yaml b/.github/ISSUE_TEMPLATE/03_feature_requests.yaml new file mode 100644 index 000000000..79e85709f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_feature_requests.yaml @@ -0,0 +1,27 @@ +name: 🙏 Feature Request 🙏 +description: Do you want a feature to be added to the Expansion? Let us know! +labels: ["feature-request"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml new file mode 100644 index 000000000..a1ff7e0c4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -0,0 +1,49 @@ +name: 💾 Other errors 🖥️ +description: Everything else that doesn't fit in the above categories. +labels: ["bug", "status: unconfirmed"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of pokeemerald-expansion are you using as a base? + options: + - 1.5.0 (Default) + - upcoming (Edge) + - 1.4.3 + - 1.4.2 + - 1.4.1 + - 1.4.0 + - pre-1.4.0 + validations: + required: true + - type: input + id: upcomingversion + attributes: + label: Upcoming Version + description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. + validations: + required: false + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..9dc46b6e3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Rom-Hacking Hideout's Discord server! + url: https://discord.gg/6CzjAG6GZk + about: You can follow the development of pokeemerald-expansion and be notified of new releases :) \ No newline at end of file diff --git a/include/test_runner.h b/include/test_runner.h index 27b0d5977..91f6f8f43 100644 --- a/include/test_runner.h +++ b/include/test_runner.h @@ -17,6 +17,8 @@ void TestRunner_Battle_AfterLastTurn(void); void TestRunner_Battle_CheckBattleRecordActionType(u32 battlerId, u32 recordIndex, u32 actionType); +u32 TestRunner_Battle_GetForcedAbility(u32 side, u32 partyIndex); + #else #define TestRunner_Battle_RecordAbilityPopUp(...) (void)0 @@ -28,6 +30,8 @@ void TestRunner_Battle_CheckBattleRecordActionType(u32 battlerId, u32 recordInde #define TestRunner_Battle_CheckBattleRecordActionType(...) (void)0 +#define TestRunner_Battle_GetForcedAbility(...) (u32)0 + #endif #endif diff --git a/src/battle_main.c b/src/battle_main.c index 270447a0e..f082fb210 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3302,6 +3302,15 @@ void SwitchInClearSetData(void) // Clear selected party ID so Revival Blessing doesn't get confused. gSelectedMonPartyId = PARTY_SIZE; + // Allow for illegal abilities within tests. + if (gTestRunnerEnabled) + { + u32 side = GetBattlerSide(gActiveBattler); + u32 partyIndex = gBattlerPartyIndexes[gActiveBattler]; + if (TestRunner_Battle_GetForcedAbility(side, partyIndex)) + gBattleMons[i].ability = gBattleStruct->overwrittenAbilities[i] = TestRunner_Battle_GetForcedAbility(side, partyIndex); + } + Ai_UpdateSwitchInData(gActiveBattler); } @@ -3794,6 +3803,18 @@ static void TryDoEventsBeforeFirstTurn(void) } } + // Allow for illegal abilities within tests. + if (gTestRunnerEnabled && gBattleStruct->switchInAbilitiesCounter == 0) + { + for (i = 0; i < gBattlersCount; ++i) + { + u32 side = GetBattlerSide(i); + u32 partyIndex = gBattlerPartyIndexes[i]; + if (TestRunner_Battle_GetForcedAbility(side, partyIndex)) + gBattleMons[i].ability = gBattleStruct->overwrittenAbilities[i] = TestRunner_Battle_GetForcedAbility(side, partyIndex); + } + } + if (gBattleStruct->switchInAbilitiesCounter == 0) { for (i = 0; i < gBattlersCount; i++) diff --git a/test/test_battle.h b/test/test_battle.h index 205c69919..bd8061f42 100644 --- a/test/test_battle.h +++ b/test/test_battle.h @@ -574,6 +574,7 @@ struct BattleTestData struct Pokemon *currentMon; u8 gender; u8 nature; + u16 forcedAbilities[NUM_BATTLE_SIDES][PARTY_SIZE]; u8 currentMonIndexes[MAX_BATTLERS_COUNT]; u8 turnState; diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index d1feaee02..a30c1e960 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -1090,7 +1090,11 @@ void Ability_(u32 sourceLine, u32 ability) break; } } - INVALID_IF(i == NUM_ABILITY_SLOTS, "%S cannot have %S", gSpeciesNames[species], gAbilityNames[ability]); + // Store forced ability to be set when the battle starts if invalid. + if (i == NUM_ABILITY_SLOTS) + { + DATA.forcedAbilities[DATA.currentSide][DATA.currentPartyIndex] = ability; + } } void Level_(u32 sourceLine, u32 level) @@ -1774,3 +1778,8 @@ void ValidateFinally(u32 sourceLine) return; INVALID_IF(STATE->parametersCount == 0, "FINALLY without PARAMETRIZE"); } + +u32 TestRunner_Battle_GetForcedAbility(u32 side, u32 partyIndex) +{ + return DATA.forcedAbilities[side][partyIndex]; +}