diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index 6493f4c11b..33af7d9649 100644 --- a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.3 (Latest release) + - 1.7.4 (Latest release) - master (default when pulling, unreleased bugfixes) - upcoming (Edge) + - 1.7.3 - 1.7.2 - 1.7.1 - 1.7.0 diff --git a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml index 3fa2d2dfd5..cabfda4990 100644 --- a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -23,9 +23,11 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.2 (Latest release) + - 1.7.4 (Latest release) - master (default when pulling, unreleased bugfixes) - upcoming (Edge) + - 1.7.3 + - 1.7.2 - 1.7.1 - 1.7.0 - 1.6.2 diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml index e39eac4f56..33c85c15fb 100644 --- a/.github/ISSUE_TEMPLATE/04_other_errors.yaml +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.3 (Latest release) + - 1.7.4 (Latest release) - master (default when pulling, unreleased bugfixes) - upcoming (Edge) + - 1.7.3 - 1.7.2 - 1.7.1 - 1.7.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index d4805a5d40..f8e0c66e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Pokeemerald-Expansion Changelogs ## Version 1.7.x +### [Version 1.7.4](docs/changelogs/1.7.4.md) - Bugfix Release ### [Version 1.7.3](docs/changelogs/1.7.3.md) - Bugfix Release ### [Version 1.7.2](docs/changelogs/1.7.2.md) - Bugfix Release ### [Version 1.7.1](docs/changelogs/1.7.1.md) - Bugfix Release diff --git a/README.md b/README.md index 0804faf74f..dcb9861615 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple ## **How do I update my version of pokeemerald-expansion?** - If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. -- Once you have your remote set up, run the command `git pull RHH expansion/1.7.3`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.7.4`. ### Please consider crediting the entire [list of contributors](https://github.com/rh-hideout/pokeemerald-expansion/wiki/Credits) in your project, as they have all worked hard to develop this project :) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e2d696a081..537d92ba52 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5286,62 +5286,6 @@ BattleScript_EffectRecoilHP25:: incrementgamestat GAME_STAT_USED_STRUGGLE goto BattleScript_EffectHit -BattleScript_EffectTeeterDance:: - attackcanceler - attackstring - ppreduce - setbyte gBattlerTarget, 0 -BattleScript_TeeterDanceLoop:: - movevaluescleanup - jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_TeeterDanceLoopIncrement - jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_TeeterDanceOwnTempoPrevents - jumpifsubstituteblocks BattleScript_TeeterDanceSubstitutePrevents - jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_TeeterDanceAlreadyConfused - jumpifhasnohp BS_TARGET, BattleScript_TeeterDanceLoopIncrement - accuracycheck BattleScript_TeeterDanceMissed, ACC_CURR_MOVE - jumpifsafeguard BattleScript_TeeterDanceSafeguardProtected - attackanimation - waitanimation - seteffectprimary MOVE_EFFECT_CONFUSION - resultmessage - waitmessage B_WAIT_TIME_LONG -BattleScript_TeeterDanceDoMoveEndIncrement:: - moveendto MOVEEND_NEXT_TARGET -BattleScript_TeeterDanceLoopIncrement:: - addbyte gBattlerTarget, 1 - jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TeeterDanceLoop - end - -BattleScript_TeeterDanceOwnTempoPrevents:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNPREVENTSCONFUSIONWITH - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceSafeguardProtected:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNUSEDSAFEGUARD - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceSubstitutePrevents:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_BUTITFAILED - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceAlreadyConfused:: - setalreadystatusedmoveattempt BS_ATTACKER - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNALREADYCONFUSED - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceMissed:: - resultmessage - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - BattleScript_EffectMudSport:: BattleScript_EffectWaterSport:: attackcanceler diff --git a/docs/changelogs/1.7.4.md b/docs/changelogs/1.7.4.md new file mode 100644 index 0000000000..50556bec77 --- /dev/null +++ b/docs/changelogs/1.7.4.md @@ -0,0 +1,68 @@ +# Version 1.7.4 + +```md +## How to update +- If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.Y.Z`. +``` + +## 🧬 General 🧬 +### Fixed +* HGSS Dex fixes: + * Fixed inconsistent list tileset between capped and decapped modes by @ravepossum in https://github.com/rh-hideout/pokeemerald-expansion/pull/4126 + * Fixed screen select bar popping in too early for area screen by @ravepossum in https://github.com/rh-hideout/pokeemerald-expansion/pull/4094 +* Fixed Lotad/Seedot house using species weight instead of height by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4195 + +## 🐉 Pokémon 🐉 +### Fixed +* Fixed Ogerpon shiny palettes by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4165 +* Fixed Basculegion back sprite offset by @MelonSpeedruns in https://github.com/rh-hideout/pokeemerald-expansion/pull/4198 +* Fixed Greninja form animations by @MelonSpeedruns in https://github.com/rh-hideout/pokeemerald-expansion/pull/4198 +* Fixed compile error when `P_GEN_8_CROSS_EVOS` is enabled but not `P_GEN_9_CROSS_EVOS` due to Ursaluna's cry being labled as Gen 9 by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4210 +* Fixed Curly Tatsugiri and Green Plumage Squawkabilly icons not showing up properly in later versions of Porymap by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/4212 + +## ⚔️ Battle General ⚔️ ## +### Fixed +* Fixed disobedience not resetting multihit moves by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4133 +* Fixed switch in interactions with hold effects abilities by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4091 + * Download activating on an empty field. + * Intimidate activating on an empty field and not activating upon new opponent switching in. + * Primal Reversion not happening immediately upon switching in from U-turn. + * Held items not being triggered when switching in fron U-turn and Intimidate being triggered beforehand. +* Fixed LastUsedBall issues not being saved and DisplayBall not being shown by @Wesmaster in https://github.com/rh-hideout/pokeemerald-expansion/pull/4209 + +## 🤹 Moves 🤹 +### Fixed +* Fixed move animations crashing on some emulators because of division by zero by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4121 + * Flip Turn, Anchor Shot, Snipe Shot and Incinerate were affected by this. +* Fixed Eerie Spell consuming double PP and showing its message twice by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4127 +* Fixed Fairy Lock animation by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4111 + +## 🎭 Abilities 🎭 +### Added +* Added Gen 5+ config for Soundproof no longer preventing Uproar status by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4174 +### Fixed +* Fixed Mycelium Might speed calculation by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4146 +* Fixed Stench triggering on non-damaging attacks by @HungryPickle in https://github.com/rh-hideout/pokeemerald-expansion/pull/4159 +* Fixed Disguise not ending the battle in the correct form by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4167 +* Fixed Opportunist accumulating stat changes by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4168 + +## 🧶 Items 🧶 +### Fixed +* Kee Berry fixes by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4149 + * Fixed triggering if the holder does a physical attack instead of receiving it. + * Fixed it boosting the target's defense if the attacker holds a Kee Berry, while still displaying the boost animation for the holder. +* Fixed poison-healing items not reseting Toxic Counter by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4135 + +## 🧹 Other Cleanup 🧹 +### Changed +* Clean up space/tabs difference by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4163 +* Deleted a space by @cmy2008 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4194 + +## New Contributors +* @cmy2008 made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4194 +* @MelonSpeedruns made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4198 + +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.7.3...expansion/1.7.4 + + diff --git a/graphics/pokemon/squawkabilly/green_plumage/icon.png b/graphics/pokemon/squawkabilly/icon.png old mode 100755 new mode 100644 similarity index 100% rename from graphics/pokemon/squawkabilly/green_plumage/icon.png rename to graphics/pokemon/squawkabilly/icon.png diff --git a/graphics/pokemon/squawkabilly/green_plumage/normal.pal b/graphics/pokemon/squawkabilly/normal.pal similarity index 100% rename from graphics/pokemon/squawkabilly/green_plumage/normal.pal rename to graphics/pokemon/squawkabilly/normal.pal diff --git a/graphics/pokemon/squawkabilly/green_plumage/shiny.pal b/graphics/pokemon/squawkabilly/shiny.pal similarity index 100% rename from graphics/pokemon/squawkabilly/green_plumage/shiny.pal rename to graphics/pokemon/squawkabilly/shiny.pal diff --git a/graphics/pokemon/tatsugiri/curly/back.png b/graphics/pokemon/tatsugiri/back.png similarity index 100% rename from graphics/pokemon/tatsugiri/curly/back.png rename to graphics/pokemon/tatsugiri/back.png diff --git a/graphics/pokemon/tatsugiri/curly/front.png b/graphics/pokemon/tatsugiri/front.png similarity index 100% rename from graphics/pokemon/tatsugiri/curly/front.png rename to graphics/pokemon/tatsugiri/front.png diff --git a/graphics/pokemon/tatsugiri/curly/icon.png b/graphics/pokemon/tatsugiri/icon.png old mode 100755 new mode 100644 similarity index 100% rename from graphics/pokemon/tatsugiri/curly/icon.png rename to graphics/pokemon/tatsugiri/icon.png diff --git a/graphics/pokemon/tatsugiri/curly/normal.pal b/graphics/pokemon/tatsugiri/normal.pal similarity index 100% rename from graphics/pokemon/tatsugiri/curly/normal.pal rename to graphics/pokemon/tatsugiri/normal.pal diff --git a/graphics/pokemon/tatsugiri/curly/shiny.pal b/graphics/pokemon/tatsugiri/shiny.pal similarity index 100% rename from graphics/pokemon/tatsugiri/curly/shiny.pal rename to graphics/pokemon/tatsugiri/shiny.pal diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 1a2157bc37..ac7aea429b 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -136,7 +136,7 @@ bool32 HasSnatchAffectedMove(u32 battler); // status checks bool32 AI_CanBeBurned(u32 battler, u32 ability); bool32 AI_CanGetFrostbite(u32 battler, u32 ability); -bool32 AI_CanBeConfused(u32 battler, u32 ability); +bool32 AI_CanBeConfused(u32 battlerAtk, u32 battlerDef, u32 move, u32 ability); bool32 AI_CanSleep(u32 battler, u32 ability); bool32 IsBattlerIncapacitated(u32 battler, u32 ability); bool32 AI_CanPutToSleep(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 partnerMove); diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 7ce97b6ec3..319437c12f 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -681,7 +681,6 @@ extern const u8 BattleScript_EffectImprison[]; extern const u8 BattleScript_EffectRefresh[]; extern const u8 BattleScript_EffectGrudge[]; extern const u8 BattleScript_EffectSnatch[]; -extern const u8 BattleScript_EffectTeeterDance[]; extern const u8 BattleScript_EffectHitEscape[]; extern const u8 BattleScript_EffectMudSport[]; extern const u8 BattleScript_EffectTickle[]; diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 81ab42f51d..bd55b6954a 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -164,7 +164,6 @@ enum { EFFECT_GRUDGE, EFFECT_SNATCH, EFFECT_LOW_KICK, - EFFECT_TEETER_DANCE, EFFECT_HIT_ESCAPE, EFFECT_MUD_SPORT, EFFECT_WEATHER_BALL, diff --git a/include/constants/cries.h b/include/constants/cries.h index 40c6dafc1e..3213f62d3f 100644 --- a/include/constants/cries.h +++ b/include/constants/cries.h @@ -626,9 +626,9 @@ enum { #if P_FAMILY_TEDDIURSA CRY_TEDDIURSA, CRY_URSARING, -#if P_GEN_9_CROSS_EVOS +#if P_GEN_8_CROSS_EVOS CRY_URSALUNA, -#endif //P_GEN_9_CROSS_EVOS +#endif //P_GEN_8_CROSS_EVOS #endif //P_FAMILY_TEDDIURSA #if P_FAMILY_SLUGMA CRY_SLUGMA, diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 7e6cf52b26..63f262aeee 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -3,7 +3,7 @@ #define EXPANSION_VERSION_MAJOR 1 #define EXPANSION_VERSION_MINOR 7 -#define EXPANSION_VERSION_PATCH 3 +#define EXPANSION_VERSION_PATCH 4 // FALSE if this this version of Expansion is not a tagged commit, i.e. // it contains unreleased changes. diff --git a/sound/cry_tables.inc b/sound/cry_tables.inc index 383dd2512e..450b9ee584 100644 --- a/sound/cry_tables.inc +++ b/sound/cry_tables.inc @@ -623,9 +623,9 @@ gCryTable:: .if P_FAMILY_TEDDIURSA == TRUE cry Cry_Teddiursa cry Cry_Ursaring -.if P_GEN_9_CROSS_EVOS == TRUE +.if P_GEN_8_CROSS_EVOS == TRUE cry Cry_Ursaluna -.endif @ P_GEN_9_CROSS_EVOS +.endif @ P_GEN_8_CROSS_EVOS .endif @ P_FAMILY_TEDDIURSA .if P_FAMILY_SLUGMA == TRUE cry Cry_Slugma @@ -3049,9 +3049,9 @@ gCryTable_Reverse:: .if P_FAMILY_TEDDIURSA == TRUE cry_reverse Cry_Teddiursa cry_reverse Cry_Ursaring -.if P_GEN_9_CROSS_EVOS == TRUE +.if P_GEN_8_CROSS_EVOS == TRUE cry_reverse Cry_Ursaluna -.endif @ P_GEN_9_CROSS_EVOS +.endif @ P_GEN_8_CROSS_EVOS .endif @ P_FAMILY_TEDDIURSA .if P_FAMILY_SLUGMA == TRUE cry_reverse Cry_Slugma diff --git a/sound/direct_sound_data.inc b/sound/direct_sound_data.inc index d73504a1ff..cfe5a3b9bb 100644 --- a/sound/direct_sound_data.inc +++ b/sound/direct_sound_data.inc @@ -1844,11 +1844,11 @@ Cry_Teddiursa:: Cry_Ursaring:: .incbin "sound/direct_sound_samples/cries/ursaring.bin" -.if P_GEN_9_CROSS_EVOS == TRUE +.if P_GEN_8_CROSS_EVOS == TRUE .align 2 Cry_Ursaluna:: .incbin "sound/direct_sound_samples/cries/ursaluna.bin" -.endif @ P_GEN_9_CROSS_EVOS +.endif @ P_GEN_8_CROSS_EVOS .endif @ P_FAMILY_TEDDIURSA .if P_FAMILY_SLUGMA == TRUE diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 0e1e9aec11..2a0181d1d1 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1904,19 +1904,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (aiData->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->moveAccuracy[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] < 75) ADJUST_SCORE(-6); break; - case EFFECT_TEETER_DANCE: - if (((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move) && aiData->abilities[battlerDef] == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(battlerDef) && AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) - || (DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) - && ((gBattleMons[BATTLE_PARTNER(battlerDef)].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move) && aiData->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(BATTLE_PARTNER(battlerDef)) && AI_IsTerrainAffected(BATTLE_PARTNER(battlerDef), STATUS_FIELD_MISTY_TERRAIN)) - || (DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), move)))) - { - ADJUST_SCORE(-10); - } - break; case EFFECT_TRANSFORM: if (gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED || (gBattleMons[battlerDef].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE))) //Leave out Illusion b/c AI is supposed to be fooled @@ -2954,7 +2941,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_SWAGGER: if (gBattleMons[battlerAtkPartner].statStages[STAT_ATK] < MAX_STAT_STAGE && HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL) - && (!AI_CanBeConfused(battlerAtkPartner, TRUE) + && (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, TRUE) || atkPartnerHoldEffect == HOLD_EFFECT_CURE_CONFUSION || atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS)) { @@ -2964,7 +2951,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_FLATTER: if (gBattleMons[battlerAtkPartner].statStages[STAT_SPATK] < MAX_STAT_STAGE && HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_SPECIAL) - && (!AI_CanBeConfused(battlerAtkPartner, TRUE) + && (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, TRUE) || atkPartnerHoldEffect == HOLD_EFFECT_CURE_CONFUSION || atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS)) { @@ -4773,7 +4760,6 @@ static s32 AI_SetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 score case EFFECT_WILL_O_WISP: case EFFECT_INGRAIN: case EFFECT_IMPRISON: - case EFFECT_TEETER_DANCE: case EFFECT_TICKLE: case EFFECT_COSMIC_POWER: case EFFECT_BULK_UP: @@ -4858,7 +4844,6 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_MIRROR_COAT: case EFFECT_FOCUS_PUNCH: case EFFECT_REVENGE: - case EFFECT_TEETER_DANCE: case EFFECT_FILLET_AWAY: if (Random() & 1) ADJUST_SCORE(DECENT_EFFECT); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b77750f652..0eefbe4722 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1134,7 +1134,6 @@ bool32 IsConfusionMoveEffect(u32 moveEffect) case EFFECT_CONFUSE: case EFFECT_SWAGGER: case EFFECT_FLATTER: - case EFFECT_TEETER_DANCE: return TRUE; default: return FALSE; @@ -2600,25 +2599,27 @@ bool32 AI_CanParalyze(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, return TRUE; } -bool32 AI_CanBeConfused(u32 battler, u32 ability) +bool32 AI_CanBeConfused(u32 battlerAtk, u32 battlerDef, u32 move, u32 ability) { - if ((gBattleMons[battler].status2 & STATUS2_CONFUSION) - || (ability == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(battler) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN))) + if ((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + || (ability == ABILITY_OWN_TEMPO && !DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) + || (IsBattlerGrounded(battlerDef) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)) return FALSE; return TRUE; } bool32 AI_CanConfuse(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 battlerAtkPartner, u32 move, u32 partnerMove) { - if (!AI_CanBeConfused(battlerDef, defAbility) - || AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] == AI_EFFECTIVENESS_x0 - || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD - || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) - || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) - { + if (gMovesInfo[move].target == MOVE_TARGET_FOES_AND_ALLY + && AI_CanBeConfused(battlerAtk, battlerDef, move, defAbility) + && !AI_CanBeConfused(battlerAtk, BATTLE_PARTNER(battlerDef), move, AI_DATA->abilities[BATTLE_PARTNER(battlerDef)])) + return FALSE; + + if (!AI_CanBeConfused(battlerAtk, battlerDef, move, defAbility) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) return FALSE; - } return TRUE; } diff --git a/src/battle_interface.c b/src/battle_interface.c index ecd502c088..50de6945a8 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3468,9 +3468,14 @@ void TryAddLastUsedBallItemSprites(void) || (gLastThrownBall != 0 && !CheckBagHasItem(gLastThrownBall, 1))) { // we're out of the last used ball, so just set it to the first ball in the bag + u16 firstBall; + // we have to compact the bag first bc it is typically only compacted when you open it CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]); - gBallToDisplay = gBagPockets[BALLS_POCKET].itemSlots[0].itemId; + + firstBall = gBagPockets[BALLS_POCKET].itemSlots[0].itemId; + if (firstBall > ITEM_NONE) + gBallToDisplay = firstBall; } if (!CanThrowLastUsedBall()) diff --git a/src/battle_main.c b/src/battle_main.c index 3ae5289c58..28729be2a9 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4990,7 +4990,7 @@ static void TurnValuesCleanUp(bool8 var0) else { memset(&gProtectStructs[i], 0, sizeof(struct ProtectStruct)); - memset(&gQueuedStatBoosts[i], 0, sizeof(gQueuedStatBoosts)); + memset(&gQueuedStatBoosts[i], 0, sizeof(struct QueuedStatBoost)); if (gDisableStructs[i].isFirstTurn) gDisableStructs[i].isFirstTurn--; diff --git a/src/data/battle_move_effects.h b/src/data/battle_move_effects.h index 32438fa812..310eef23af 100644 --- a/src/data/battle_move_effects.h +++ b/src/data/battle_move_effects.h @@ -1052,12 +1052,6 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = .battleTvScore = 1, }, - [EFFECT_TEETER_DANCE] = - { - .battleScript = BattleScript_EffectTeeterDance, - .battleTvScore = 6, - }, - [EFFECT_HIT_ESCAPE] = { .battleScript = BattleScript_EffectHitEscape, diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index cfba08ba5b..7c89b1b519 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -12053,9 +12053,9 @@ const u8 gMonFootprint_QuestionMark[] = INCBIN_U8("graphics/pokemon/question_mar // const u8 gMonFootprint_Squawkabilly[] = INCBIN_U8("graphics/pokemon/squawkabilly/footprint.1bpp"); #endif //P_FOOTPRINTS - const u32 gMonPalette_SquawkabillyGreenPlumage[] = INCBIN_U32("graphics/pokemon/squawkabilly/green_plumage/normal.gbapal.lz"); - const u32 gMonShinyPalette_SquawkabillyGreenPlumage[] = INCBIN_U32("graphics/pokemon/squawkabilly/green_plumage/shiny.gbapal.lz"); - const u8 gMonIcon_SquawkabillyGreenPlumage[] = INCBIN_U8("graphics/pokemon/squawkabilly/green_plumage/icon.4bpp"); + const u32 gMonPalette_SquawkabillyGreenPlumage[] = INCBIN_U32("graphics/pokemon/squawkabilly/normal.gbapal.lz"); + const u32 gMonShinyPalette_SquawkabillyGreenPlumage[] = INCBIN_U32("graphics/pokemon/squawkabilly/shiny.gbapal.lz"); + const u8 gMonIcon_SquawkabillyGreenPlumage[] = INCBIN_U8("graphics/pokemon/squawkabilly/icon.4bpp"); const u32 gMonPalette_SquawkabillyBluePlumage[] = INCBIN_U32("graphics/pokemon/squawkabilly/blue_plumage/normal.gbapal.lz"); const u32 gMonShinyPalette_SquawkabillyBluePlumage[] = INCBIN_U32("graphics/pokemon/squawkabilly/blue_plumage/shiny.gbapal.lz"); @@ -12541,11 +12541,11 @@ const u8 gMonFootprint_QuestionMark[] = INCBIN_U8("graphics/pokemon/question_mar #endif //P_FAMILY_DONDOZO #if P_FAMILY_TATSUGIRI - const u32 gMonFrontPic_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/curly/front.4bpp.lz"); - const u32 gMonPalette_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/curly/normal.gbapal.lz"); - const u32 gMonBackPic_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/curly/back.4bpp.lz"); - const u32 gMonShinyPalette_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/curly/shiny.gbapal.lz"); - const u8 gMonIcon_TatsugiriCurly[] = INCBIN_U8("graphics/pokemon/tatsugiri/curly/icon.4bpp"); + const u32 gMonFrontPic_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/front.4bpp.lz"); + const u32 gMonPalette_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/normal.gbapal.lz"); + const u32 gMonBackPic_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/back.4bpp.lz"); + const u32 gMonShinyPalette_TatsugiriCurly[] = INCBIN_U32("graphics/pokemon/tatsugiri/shiny.gbapal.lz"); + const u8 gMonIcon_TatsugiriCurly[] = INCBIN_U8("graphics/pokemon/tatsugiri/icon.4bpp"); #if P_FOOTPRINTS // const u8 gMonFootprint_Tatsugiri[] = INCBIN_U8("graphics/pokemon/tatsugiri/footprint.1bpp"); #endif //P_FOOTPRINTS diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 958142a49e..6ecb89e24b 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -7314,7 +7314,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Confuses all Pokémon on\n" "the scene."), - .effect = EFFECT_TEETER_DANCE, + .effect = EFFECT_CONFUSE, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c new file mode 100644 index 0000000000..97435a2ea7 --- /dev/null +++ b/test/battle/ability/dancer.c @@ -0,0 +1,35 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Dancer can copy a dance move immediately after it was used and allow the user of Dancer to still use its move") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_QUIVER_DANCE].danceMove == TRUE); + PLAYER(SPECIES_WOBBUFFET) + OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); } + } WHEN { + TURN { MOVE(player, MOVE_QUIVER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUIVER_DANCE, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + ABILITY_POPUP(opponent, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUIVER_DANCE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); // Same turn + } +} + +SINGLE_BATTLE_TEST("Dancer can copy Teeter Dance") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_TEETER_DANCE].danceMove == TRUE); + PLAYER(SPECIES_WOBBUFFET) + OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); Item(ITEM_LUM_BERRY); } + } WHEN { + TURN { MOVE(player, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, player); + ABILITY_POPUP(opponent, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, opponent); + } +} diff --git a/test/battle/move_effect/confuse.c b/test/battle/move_effect/confuse.c new file mode 100644 index 0000000000..dcd843b2c6 --- /dev/null +++ b/test/battle/move_effect/confuse.c @@ -0,0 +1,58 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_TEETER_DANCE].effect == EFFECT_CONFUSE); +} + +SINGLE_BATTLE_TEST("Teeter Dance confuses target") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent); + MESSAGE("Foe Wobbuffet became confused!"); + } +} + +SINGLE_BATTLE_TEST("Teeter Dance confusion is blocked by Own Tempo") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); } + } WHEN { + TURN { MOVE(player, MOVE_TEETER_DANCE); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent); + MESSAGE("Foe Wobbuffet became confused!"); + } + } +} + +DOUBLE_BATTLE_TEST("Teeter Dance can confuse foes and allies") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerLeft, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, playerLeft); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponentLeft); + MESSAGE("Foe Wobbuffet became confused!"); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, playerRight); + MESSAGE("Wynaut became confused!"); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponentRight); + MESSAGE("Foe Wynaut became confused!"); + } +}