diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index edebc1bbf0..9ffdc70fba 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.9.1 (Latest release) + - 1.9.2 (Latest release) - master (default, unreleased bugfixes) - upcoming (Edge) + - 1.9.1 - 1.9.0 - 1.8.6 - 1.8.5 diff --git a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml index dd3024230b..ce50b0bffd 100644 --- a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.9.1 (Latest release) + - 1.9.2 (Latest release) - master (default, unreleased bugfixes) - upcoming (Edge) + - 1.9.1 - 1.9.0 - 1.8.6 - 1.8.5 diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml index 29960c267b..c78093d60e 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.9.1 (Latest release) + - 1.9.2 (Latest release) - master (default, unreleased bugfixes) - upcoming (Edge) + - 1.9.1 - 1.9.0 - 1.8.6 - 1.8.5 diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2f38af1d..bb9fec3e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Pokeemerald-Expansion Changelogs ## 1.9.x +- **[Version 1.9.2](docs/changelogs/1.9.x/1.9.2.md) - 🧹 Bugfix Release** - **[Version 1.9.1](docs/changelogs/1.9.x/1.9.1.md) - 🧹 Bugfix Release** - **[Version 1.9.0](docs/changelogs/1.9.x/1.9.0.md) - ✨ Feature Release** diff --git a/README.md b/README.md index f09f5a7d90..37ea8336b7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ pokeemerald-expansion is a decomp hack base project based off pret's [pokeemeral If you use pokeemerald-expansion in your hack, please add RHH (Rom Hacking Hideout) to your credits list. Optionally, you can list the version used, so it can help players know what features to expect. You can phrase it as the following: ``` -Based off RHH's pokeemerald-expansion 1.9.1 https://github.com/rh-hideout/pokeemerald-expansion/ +Based off RHH's pokeemerald-expansion 1.9.2 https://github.com/rh-hideout/pokeemerald-expansion/ ``` ## What features are included? @@ -178,7 +178,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple - Check your current version. - You can check in the debug menu's `Utilities -> Expansion Version` option. - If the option is not available, you possibly have version 1.6.2 or older. In that case, please check the [changelogs](CHANGELOG.md) to determine your version based on the features available on your repository. -- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.8.4, use `git pull RHH expansion/1.8.4`). +- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.9.2, use `git pull RHH expansion/1.9.2`). - ***Important:*** If you are several versions behind, we recommend updating one minor version at a time, skipping directly to the latest patch version (eg, 1.5.3 -> 1.6.2 -> 1.7.4 and so on) - Alternatively, you can update to unreleased versions of the expansion. - ***master (stable):*** It contains unreleased **bugfixes** that will come in the next patch version. To merge, use `git pull RHH master`. diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 89a6a46830..34a6094522 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2105,15 +2105,15 @@ @ The rest of the arguments are the stat change values to each stat. @ For example, giving the first opponent +1 to atk and -2 to speed would be: settotemboost B_POSITION_OPPONENT_LEFT, 1, 0, -2 .macro settotemboost battler:req, atk=0,def=0,speed=0,spatk=0,spdef=0,acc=0,evas=0 - setvar VAR_0x8000, \battler - setvar VAR_0x8001, \atk - setvar VAR_0x8002, \def - setvar VAR_0x8003, \speed - setvar VAR_0x8004, \spatk - setvar VAR_0x8005, \spdef - setvar VAR_0x8006, \acc - setvar VAR_0x8007, \evas - special SetTotemBoost + callnative ScriptSetTotemBoost + .2byte \battler + .2byte \atk + .2byte \def + .2byte \speed + .2byte \spatk + .2byte \spdef + .2byte \acc + .2byte \evas .endm @ useful totem boost macros diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 14f9a3f592..98ac1bfda7 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -28451,7 +28451,7 @@ gBattleAnimGeneral_MegaEvolution:: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish @@ -28642,7 +28642,7 @@ General_PrimalReversion_Alpha: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish @@ -28669,7 +28669,7 @@ General_PrimalReversion_Omega: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish @@ -28705,7 +28705,7 @@ gBattleAnimGeneral_UltraBurst:: call LightThatBurnsTheSkyGreenSparks delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createsprite gUltraBurstSymbolSpriteTemplate, ANIM_ATTACKER, 0x0, 0x0, 0x0, 0x0, 0x0 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 04784ccdac..16168ca124 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3279,51 +3279,17 @@ BattleScript_RoarBlockedByDynamax: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_MultiHitLoop:: - jumpifhasnohp BS_ATTACKER, BattleScript_MultiHitEnd - jumpifhasnohp BS_TARGET, BattleScript_MultiHitPrintStrings - jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoMultiHit - jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_MultiHitPrintStrings -BattleScript_DoMultiHit:: - movevaluescleanup - copyhword sMOVE_EFFECT, sMULTIHIT_EFFECT - critcalc - damagecalc - jumpifmovehadnoeffect BattleScript_MultiHitNoMoreHits - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - multihitresultmessage - flushtextbox - addbyte sMULTIHIT_STRING + 4, 1 - moveendto MOVEEND_NEXT_TARGET - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings - decrementmultihit BattleScript_MultiHitLoop - goto BattleScript_MultiHitPrintStrings -BattleScript_MultiHitNoMoreHits:: - pause B_WAIT_TIME_SHORT BattleScript_MultiHitPrintStrings:: resultmessage waitmessage B_WAIT_TIME_LONG - jumpifmovehadnoeffect BattleScript_MultiHitEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG return -BattleScript_MultiHitEnd:: - setadditionaleffects - tryfaintmon BS_TARGET - moveendcase MOVEEND_SYNCHRONIZE_TARGET - moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES - end +BattleScript_ScaleShot:: + call BattleScript_MultiHitPrintStrings + goto BattleScript_DefDownSpeedUp BattleScript_EffectConversion:: attackcanceler @@ -7001,12 +6967,12 @@ BattleScript_WishMegaEvolution:: BattleScript_PrimalReversion:: call BattleScript_PrimalReversionRet - end2 + end3 BattleScript_PrimalReversionRestoreAttacker:: call BattleScript_PrimalReversionRet copybyte gBattlerAttacker, sSAVED_BATTLER - end2 + end3 BattleScript_PrimalReversionRet:: flushtextbox @@ -7715,15 +7681,11 @@ BattleScript_EmergencyExitWildNoPopUp:: BattleScript_TraceActivates:: pause B_WAIT_TIME_SHORT - call BattleScript_AbilityPopUp + call BattleScript_AbilityPopUpScripting printstring STRINGID_PKMNTRACED waitmessage B_WAIT_TIME_LONG settracedability BS_SCRIPTING switchinabilities BS_SCRIPTING - return - -BattleScript_TraceActivatesEnd3:: - call BattleScript_TraceActivates end3 BattleScript_ReceiverActivates:: @@ -9410,6 +9372,16 @@ BattleScript_ZMoveActivateStatus:: copybyte sSTATCHANGER, sSAVED_STAT_CHANGER return +BattleScript_ZMoveActivatePowder:: + flushtextbox + trytrainerslidezmovemsg + savetarget + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + setzeffect + restoretarget + goto BattleScript_MoveUsedPowder + BattleScript_ZEffectPrintString:: printfromtable gZEffectStringIds waitmessage B_WAIT_TIME_LONG @@ -10041,7 +10013,7 @@ BattleScript_BerserkGeneRet_End: BattleScript_BoosterEnergyEnd2:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1 - call BattleScript_AbilityPopUpTarget + call BattleScript_AbilityPopUpScripting printstring STRINGID_BOOSTERENERGYACTIVATES waitmessage B_WAIT_TIME_MED printstring STRINGID_STATWASHEIGHTENED diff --git a/data/specials.inc b/data/specials.inc index 044d794bc8..4d2bea3d33 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -534,7 +534,6 @@ gSpecials:: def_special RemoveRecordsWindow def_special CloseDeptStoreElevatorWindow def_special TrySetBattleTowerLinkType - def_special SetTotemBoost def_special TrySpecialOverworldEvo def_special GetNumberSprayStrength def_special GetSprayId diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 603fa225db..faeb069783 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -19,6 +19,8 @@ - [How to use the Testing System](./how_to_testing_system.md) - [Changelog](./CHANGELOG.md) - [1.9.x]() + - [Version 1.9.2](changelogs/1.9.x/1.9.2.md) + - [Version 1.9.1](changelogs/1.9.x/1.9.1.md) - [Version 1.9.0](changelogs/1.9.x/1.9.0.md) - [1.8.x]() - [Version 1.8.6](changelogs/1.8.x/1.8.6.md) diff --git a/docs/changelogs/1.9.x/1.9.0.md b/docs/changelogs/1.9.x/1.9.0.md index 0d39f109ed..b0815c6e2a 100644 --- a/docs/changelogs/1.9.x/1.9.0.md +++ b/docs/changelogs/1.9.x/1.9.0.md @@ -551,6 +551,6 @@ * @rayrobdod made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4727 * @innocenthedgehog made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4988 -**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.8.5...expansion/1.9.0 +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.8.6...expansion/1.9.0 diff --git a/docs/changelogs/1.9.x/1.9.1.md b/docs/changelogs/1.9.x/1.9.1.md index 8393727c2a..dfe8946bd9 100644 --- a/docs/changelogs/1.9.x/1.9.1.md +++ b/docs/changelogs/1.9.x/1.9.1.md @@ -120,14 +120,14 @@ * Improved 1.8 ⇒ 1.9 non-Competitive syntax migration instructions by @mrgriffin in [#5079](https://github.com/rh-hideout/pokeemerald-expansion/pull/5079) ## 📦 Branch Synchronisation 📦 -### pret +### pret's base pokeemerald * 5th of August in [#5098](https://github.com/rh-hideout/pokeemerald-expansion/pull/5098) * Fixed bottom half of Mt. Pyre not being labeled in PokeNav by @fdeblasio in [pret#2018](https://github.com/pret/pokeemerald/pull/2018) * 7th of August in [#5116](https://github.com/rh-hideout/pokeemerald-expansion/pull/5116) * Changed type1 and type2 to be consistent by @pkmnsnfrn in [pret#2021](https://github.com/pret/pokeemerald/pull/2021) * 14th of August in [#5165](https://github.com/rh-hideout/pokeemerald-expansion/pull/5165) * Fix type for offset in MapConnection by @GriffinRichards in [pret#2011](https://github.com/pret/pokeemerald/pull/2011) -### Followers +### merrp/aarant's followers * 7th of August in [#5110](https://github.com/rh-hideout/pokeemerald-expansion/pull/5110) * Fixed expanded OW IDs by @pkmnsnfrn in [aarant#38](https://github.com/aarant/pokeemerald/pull/38) * Fix two small text errors in follower dialogue by @Bassoonian in [aarant#39](https://github.com/aarant/pokeemerald/pull/39) diff --git a/docs/changelogs/1.9.x/1.9.2.md b/docs/changelogs/1.9.x/1.9.2.md new file mode 100644 index 0000000000..4d95fc95f9 --- /dev/null +++ b/docs/changelogs/1.9.x/1.9.2.md @@ -0,0 +1,202 @@ +# Version 1.9.2 + +```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.9.2`. +``` + +## 🌋 *REFACTORS* 🌋 +📜 = Uses a migration script. +* Remove unused `BattleScript_WindPowerActivatesEnd2` in [#5257](https://github.com/rh-hideout/pokeemerald-expansion/pull/5257) +* Refactored in-battle disobedience to fix bug in [#5245](https://github.com/rh-hideout/pokeemerald-expansion/pull/5245) + +## 💥 *Hardlock/Softlock/Crash/Compiling fixes* 💥 +* Fixed hardlock when Hyperspace Fury is used by Hoopa Unbound by @AlexOn1ine in [#5237](https://github.com/rh-hideout/pokeemerald-expansion/pull/5237) +* Fixed compile error when `OW_POKEMON_OBJECT_EVENTS` is `TRUE` but `P_HISUIAN_FORMS` is `FALSE` around Basculin by @hjk321 in [#5256](https://github.com/rh-hideout/pokeemerald-expansion/pull/5256) +* Fixed hardlock when the AI cannot choose moves due to its opponent having Wonder Guard by @Pawkkie and Wiz in [#5317](https://github.com/rh-hideout/pokeemerald-expansion/pull/5317) +* Fixed multiple Pledge move hardlocks + * Fixed potential hardlock when attempting to use Pledge moves on the same turn that the user would wake up by @PhallenTree in [#5330](https://github.com/rh-hideout/pokeemerald-expansion/pull/5330) + * Fixed hardlock when the opponent's combo doesn't happen when cancelled by sleep by @hedara90 and @PhallenTree in [#5339](https://github.com/rh-hideout/pokeemerald-expansion/pull/5339) + * Fixes hardlock when the opponent's combo doesn't happen when cancelled by freeze by @PhallenTree in [#5340](https://github.com/rh-hideout/pokeemerald-expansion/pull/5340) + * Fixed hardlock when the opponent's combo doesn't happen when cancelled by Powder by @hedara90 in [#5341](https://github.com/rh-hideout/pokeemerald-expansion/pull/5341) + +## 🧬 General 🧬 +### Fixed +* Fixed loading into the wrong version of a map after saving in areas with multiple layouts by @hedara90 in [#5347](https://github.com/rh-hideout/pokeemerald-expansion/pull/5347) + +## 🐉 Pokémon 🐉 +### Added +* Added `OVERWORLD_SET_ANIM` macro to allow using custom animation tables for Overworld Pokémon by @hedara90 in [#5309](https://github.com/rh-hideout/pokeemerald-expansion/pull/5309) + * Added asymetrical Farfetch'd sprites using a previously unused table from merrp's followers branch. +* Added unique sprites for overworld Pumpkaboo and Gourgeist forms by @hedara90 in [#5390](https://github.com/rh-hideout/pokeemerald-expansion/pull/5390) +* Added missing Sirfetch'd competitive alias (`SPECIES_SIRFETCH_D`) by @cawtds in [#5283](https://github.com/rh-hideout/pokeemerald-expansion/pull/5283) +* Added Paldean Wooper and Clodsire overworld sprites by @Cafeei in [#5277](https://github.com/rh-hideout/pokeemerald-expansion/pull/5277) +* Added missing Gen 9 Overworld sprites by @Liamjd14 in [#5304](https://github.com/rh-hideout/pokeemerald-expansion/pull/5304) + * Original sprites by Darkus_Shadow, Princess-Phoenix, shaderr31, Molfang62, CarmaNekko, EduarPokeN, Larryturbo, TyranitarDark and Anarlaurendil + * Sources: + * Normal: https://www.deviantart.com/darkusshadow/art/Gen-9-Paldea-Pokemon-Overworld-Sprites-967776690 + * Shiny: https://www.deviantart.com/darkusshadow/art/SHINY-Gen-9-Paldea-Pokemon-Overworld-Sprites-967779547 +* Added missing overworld sprites by @Liamjd14 in [#5336](https://github.com/rh-hideout/pokeemerald-expansion/pull/5336) + * **New Sprites:** + * Oricorio Pom Pom/Pa'U/Sensu, Zygarde 10%/Complete and Original Color Magearna + * Credits to: Princess-Phoenix, Larryturbo, Kidkatt, Zender1752 and SageDeoxys. + * Black/White Kyurem + * Credits to: Larryturbo. + * Shaymin Sky and Therian Tornadus/Thundurus/Landorus + * Credits to: @Liamjd14 + * **Using their base form's sprites** + * Totem Raticate/Mimikyu/Marowak and Partner Pikachu/Eevee +* Added Added asymmetrical overworld sprites by @Liamjd14 in [#5336](https://github.com/rh-hideout/pokeemerald-expansion/pull/5336) + * Slowbro (Galarian), Tinkatink, Tinkatuff, Tinkaton and Scovillain + * Enabled in `gSpeciesInfo` by @Liamjd14 in [#5385](https://github.com/rh-hideout/pokeemerald-expansion/pull/5385) +### Changed +* Improved Garganacl and Naclstack battle sprites by using the ones from @CyanSMP64's repo by @kittenchilly in [#5142](https://github.com/rh-hideout/pokeemerald-expansion/pull/5142) +* Improved both shiny Indeedee by @Cafeei in [#5285](https://github.com/rh-hideout/pokeemerald-expansion/pull/5285) +* Shiny Combusken now uses its Gen8+ palette by @Cafeei in [#5333](https://github.com/rh-hideout/pokeemerald-expansion/pull/5333) +### Fixed +* Reenabled unused female Indeedee overworld sprite by @Cafeei in [#5285](https://github.com/rh-hideout/pokeemerald-expansion/pull/5285) +* Fixed G-Max Corviknight and Centiskorch's expanded names by @PhallenTree in [#5296](https://github.com/rh-hideout/pokeemerald-expansion/pull/5296) +* Fixed G-Max Cinderace back sprite by @hedara90 in [#5295](https://github.com/rh-hideout/pokeemerald-expansion/pull/5295) +* Fixed Shiny Mothim' by @Cafeei in [#5333](https://github.com/rh-hideout/pokeemerald-expansion/pull/5333) +* Fixed multiple battle sprite issues by @kittenchilly in [#5142](https://github.com/rh-hideout/pokeemerald-expansion/pull/5142) + * **Sprite issues:** + * Bombirdier, Mega Absol/Aerodactyl/Latias/Latios/Salamence, Orthworm and Veluza. + * **Shiny issues:** + * Bombirdier, Kilowattrel, Landorus, Magearna, Mega Diancie/Medicham, Galarian Ponyta, Shroodle, Spidops and Wattrel. +* Fixed multiple overworld Pokémon sprites - Part 1 by @Cafeei in [#5241](https://github.com/rh-hideout/pokeemerald-expansion/pull/5241) + * **"Blinking pixels":** + * Dwebble, Krookodile, Servine, Throh and Vulpix. + * **Shiny Palettes** + * Crustle, Excadrill, Lillipup, Serperior, Servine, Sigilyph, Swoobat, Tranquil and Venipede. + * **Misc fixes:** + * Archen, Basculin, Blitzle, Crustle, Escavalier, Krokorok, Krookodile, Sawsbuck, secondary, Serperior, Snivy, Throh, Woobat, Zebstrika +* Fixed multiple overworld Pokémon sprites - Part 2 by @Cafeei in [#5333](https://github.com/rh-hideout/pokeemerald-expansion/pull/5333) + * **Palette Fixes:** + * Shiny Riolu/Snover, Oshawott, Kabutops, Shieldon, Kingler and Groudon. + * **Fixed "Blinking pixels":** + * Abomasnow, Aggron, Alakazam, Ariados, Articuno, Azumarill, Barboach, Bayleef, Bibarel, Blastoise, Celebi, Charmeleon, Cherrim, Chinchou, Cloyster, Corphish, Corsola, Crawdaunt, Cubone, Dewott, Doduo, Dusknoir, Electabuzz, Espeon, Exeggcute, Farfetch'd, Feraligatr, Flaafy, Flareon, Floatzel, Furret, Gastly, Girafarig, Giratina, Gligar, Gloom, Golbat, Grumpig, Hariyama, Heatran (just reduced), Hoppip, Jolteon, Jumpluff, Kricketot, Larvitar, Leafeon, Lileep, Lumineon, Luxio, Luxray, Machamp, Magneton, Mantine, Mantyke, Marowak, Meowth, Mesprit, Mew, Mewtwo, Mime Jr, Moltres, Numel, Oshawott, Phione, Pinsir, Politoed, Porygon-Z, Probopass, Quilava, Qwilfish, Rampardos, Rapidash, Regirock, Sceptile, Scizor, Seel, Shieldon, Shiftry, Slowking, Smoochum, Sneasel, Spheal, Steelix, Sudowoodo, Suicune, Swellow, Swinub, Tentacruel, Togekiss, Togepi, Vaporeon, Vibrava, Wartortle, Wooper, Yanma, Yanma, Yanmega, Zangoose, Zapdos, Zubat + * **Misc. Sprite Fixes**: Dewott, Misdreavus, Oshawott, Torkoal and Victini. +* Overworld sprite fixes by @Liamjd14 (with help from @hedara90 to solve conflicts) in [#5334](https://github.com/rh-hideout/pokeemerald-expansion/pull/5334) + * **Palette Fixes**: Shieldon. + * **Misc. Sprite Fixes** Torkoal. + * **"Blinking pixels":** + * Ambipom, Armaldo, Crawdaunt, Crobat, Donphan, Flaaffy, Flygon, Grovyle, Hoppip, Igglybuff, Illumise, Jumpluff, Ledian, Ledyba, Mamoswine, Mantine, Marshtomp, Meganium, Mightyena, Miltank, Numel, Prinplup, Raikou, Roserade, Skarmory, Skiploom, Spinarak, Staraptor, Stunky, Torkoal, Wooper, Xatu, Yanma +* Overworld Pokémon sprite changes by @Liamjd14 in [#5336](https://github.com/rh-hideout/pokeemerald-expansion/pull/5336) + * **Fixed "blinking pixels":** + * Alolan Graveler/Golem/Alolan/Ninetales + * Dawn Wings Necrozma + * Hisuian Growlithe/Arcanine + * Winter Sawsbuck + * **Added missing Shiny Palettes** + * Calyrex Ice/Shadow Rider, Origin Dialga/Palkia, White-Striped Basculin, Therian Enamorus and Low-Key Toxtricity. + * **Removed Gigantamax Low-Key Toxtricity using base Low-Key follower sprites.** + * **Fixed Shiny palettes** + * Alolan Marowak/Raichu, Eternal Flower Floette, Flabébé (All), Galarian Ponyta/Rapidash + * Typhlosion-Hisui follower shiny stomach color wrong - done + * **Other sprite/palette fixes** + * Alolan Exeggutor/Marowak/Persian/Raichu/Sandshrew, Hisuian Sligoo/Goodra and Winter Sawsbuck. +## ⚔️ Battle General ⚔️ ## +### Changed +* Updated Damage Category icons to match Gen6+ colors by @kittenchilly in [#5080](https://github.com/rh-hideout/pokeemerald-expansion/pull/5080) +### Fixed +* Fixed Slateport Battle Tent/Battle Factory issues by @SarnPoke in [#5281](https://github.com/rh-hideout/pokeemerald-expansion/pull/5281) + * Choosing the "SWAP" option no longer shows invalid Pokémon ("??????????"). + * Reloading after choosing "REST" no longer resets the player's challenge party to invalid Pokémon ("??????????"). +* Fixed Starting Status happening Wild Battles from a previous Trainer Battle by @PhallenTree in [#5248](https://github.com/rh-hideout/pokeemerald-expansion/pull/5248) +* Fixed bugged behavior caused by Z-Moves and disobedience by @hedara90 in [#5245](https://github.com/rh-hideout/pokeemerald-expansion/pull/5245) +* Fixed Entry Hazards targeting wrong side of the field if the opponent fainted by @PhallenTree in [#5262](https://github.com/rh-hideout/pokeemerald-expansion/pull/5262) +* Fixed being able to use multiple of the same Gimmick in Double Battles by @AgustinGDLV in [#5235](https://github.com/rh-hideout/pokeemerald-expansion/pull/5235) +* Fixed Terastallization not granting immunity to Tar Shot by @AlexOn1ine in [#5302](https://github.com/rh-hideout/pokeemerald-expansion/pull/5302) +* Fixed `Cmd_trainerslidein/out` using the incorrect function by @ghoulslash in [#5326](https://github.com/rh-hideout/pokeemerald-expansion/pull/5326) + * Cleanup by @hedara90 in [#5344](https://github.com/rh-hideout/pokeemerald-expansion/pull/5344) + +## 🤹 Moves 🤹 +### Added +* Added Charge's Gen 9 behavior via `B_CHARGE` config by @AlexOn1ine in [#5274](https://github.com/rh-hideout/pokeemerald-expansion/pull/5274) +* Added Powder's Gen 7+ behavior of not causing damage when under Heavy Rain via `B_POWDER_RAIN` by @PhallenTree in [#5370](https://github.com/rh-hideout/pokeemerald-expansion/pull/5370) +### Fixed +* Fixed move descriptions missing periods (Decorate, Collision Course, Electro Drift) by @Pawkkie and Kasen in [#5221](https://github.com/rh-hideout/pokeemerald-expansion/pull/5221) +* Fixed Confide not being blocked by Crafty Shield interaction by @hedara90 in [#5202](https://github.com/rh-hideout/pokeemerald-expansion/pull/5202) +* Fixed message for switch out moves by @kittenchilly in [#5258](https://github.com/rh-hideout/pokeemerald-expansion/pull/5258) +* Fixed Ice Fang's descriptions using the opposite of what they're supposed to do based on `B_USE_FROSTBITE` by @laserXdolphin in [#5273](https://github.com/rh-hideout/pokeemerald-expansion/pull/5273) +* Fixes to Instruct by @PhallenTree in [#5262](https://github.com/rh-hideout/pokeemerald-expansion/pull/5262) + * Fixed Instruct bypassing AtkCanceler checks (Instruct allowed the target to act while asleep, flinched, etc.) and its interaction with First Turn Only moves (Fake Out, First Impression, Mat Block). + * Fixed Instruct's animation using the attacker and target of the called move. +* Fixed Scale Shot's effect not activating if the opponent fainted before all hits finished by @AlexOn1ine in [#5292](https://github.com/rh-hideout/pokeemerald-expansion/pull/5292) +* Fixed Round not preserving turn order for non-Round users if there's a switch out at the beginning of the turn by @AlexOn1ine in [#5292](https://github.com/rh-hideout/pokeemerald-expansion/pull/5292) +* Fixed Max Moves ignoring absorbing abilities (+ test) by @PhallenTree in [#5296](https://github.com/rh-hideout/pokeemerald-expansion/pull/5296) +* Fixed attack string for Max Moves not being printed if it's blocked by Max Guard by @hedara90 in [#5312](https://github.com/rh-hideout/pokeemerald-expansion/pull/5312) +* Fixed some Pledge move combo issues by @PhallenTree in [#5330](https://github.com/rh-hideout/pokeemerald-expansion/pull/5330) + * Fixed Pledge move combos attempting to be executed multiple times in a turn, causing mons to decrement sleep timer multiple times during the turn or causing infinite loops. +* Fixed potential issue with custom non-sound moves that use `EFFECT_ATTACK_UP_USER_ALLY` or `EFFECT_PERISH_SONG` being blocked by Soundproof anyway by @AlexOn1ine in [#5301](https://github.com/rh-hideout/pokeemerald-expansion/pull/5301) +* Fixed Pledge combinations not being absorbed by absorption Abilities (Sap Sipper, Storm Drain, etc.) by @hedara90 in [#5364](https://github.com/rh-hideout/pokeemerald-expansion/pull/5364) +* Fixed Toxic Thread decreasing speed by 2 stages instead of 1 by @AsparagusEduardo in [#5369](https://github.com/rh-hideout/pokeemerald-expansion/pull/5369) +* Fixed Destiny Bond not working if the user was fainted by a multi-Hit move's non-first hit by @AlexOn1ine in [#5377](https://github.com/rh-hideout/pokeemerald-expansion/pull/5377) +* Fixed Powder interactions by @PhallenTree in [#5370](https://github.com/rh-hideout/pokeemerald-expansion/pull/5370) + * Fixed Magic Guard not protecting against Powder's secondary damage when using a Fire-type move. + * Fixed Fire/Water Pledge combination being cancelled by Powder. + * Fixed Fire Z-Moves not playing their animations and not granting their secondary effects when the user is under Powder's effect +* Fixed After You/Shell Trap not updating battlers' actions correctly by @PhallenTree in [#5384](https://github.com/rh-hideout/pokeemerald-expansion/pull/5384) + +## 🎭 Abilities 🎭 +### Fixed +* Fixed weather abilities not activating when Cloud Nine user leaves the field by @AlexOn1ine in [#5209](https://github.com/rh-hideout/pokeemerald-expansion/pull/5209) +* Fixed missing `break` for Poison Puppeteer's code by @u8-Salem in [#5243](https://github.com/rh-hideout/pokeemerald-expansion/pull/5243) +* Fixed Pokémon with Purifying Salt being poisoned by Toxic Spikes by @AlexOn1ine in [#5252](https://github.com/rh-hideout/pokeemerald-expansion/pull/5252) +* Fixed Parental Bond not affecting Snore by @hedara90 in [#5264](https://github.com/rh-hideout/pokeemerald-expansion/pull/5264) +* Fixed Tera Shift's description by @AsparagusEduardo in [#5351](https://github.com/rh-hideout/pokeemerald-expansion/pull/5351) + +## 🧶 Items 🧶 +### Fixed +* Fixed berries missing their timing after passive damage by @AlexOn1ine in [#5300](https://github.com/rh-hideout/pokeemerald-expansion/pull/5300) +* Fixed Micle Berry not increasing accuracy on the next turn by @AlexOn1ine in [#5358](https://github.com/rh-hideout/pokeemerald-expansion/pull/5358) + +## 🤖 Battle AI 🤖 +### Changed +* AI is encouraged to use "always crit" moves on partner with Anger Point by @SarnPoke in [#5244](https://github.com/rh-hideout/pokeemerald-expansion/pull/5244) +### Fixed +* Fixed AI not seeing the power of Max Moves by @AlexOn1ine in [#5299](https://github.com/rh-hideout/pokeemerald-expansion/pull/5299) +* Fixed minor wrong order in `AI_CalcDamage` that made Nature Power not be considered for Z-Moves by @AlexOn1ine in [#5155](https://github.com/rh-hideout/pokeemerald-expansion/pull/5155) +* Fixed AI not considering Tera Blast/Tera Storm by @AlexOn1ine in [#5155](https://github.com/rh-hideout/pokeemerald-expansion/pull/5155) +* Fixed `AI_IsMoveEffectInPlus` reading the incorrect stat for secondary effects that reduce stats by 2 stages by @ghoulslash and @Pawkkie in [#5366](https://github.com/rh-hideout/pokeemerald-expansion/pull/5366) + +## 🧹 Other Cleanup 🧹 +### Changed +* Remove unused `BattleScript_WindPowerActivatesEnd2` signature by @u8-Salem in [#5257](https://github.com/rh-hideout/pokeemerald-expansion/pull/5257) +* Replaced all usages of tabs in C files with spaces by @hedara90 in [#5261](https://github.com/rh-hideout/pokeemerald-expansion/pull/5261) +* Fixed missing `break`s in two `ENDTURN` cases by @ghoulslash in [#5350](https://github.com/rh-hideout/pokeemerald-expansion/pull/5350) +* `ShouldSwitchIfWonderGuard` cleanup by @Pawkkie in [#5383](https://github.com/rh-hideout/pokeemerald-expansion/pull/5383) + +## 🧪 Test Runner 🧪 +### Added +* Added missing Adaptability, Aerilate, Aftermath tests by @kittenchilly in [#5242](https://github.com/rh-hideout/pokeemerald-expansion/pull/5242) +* Added missing Disguise tests by @hedara90 in [#5249](https://github.com/rh-hideout/pokeemerald-expansion/pull/5249) +* Added some missing Instruct tests by @PhallenTree in [#5262](https://github.com/rh-hideout/pokeemerald-expansion/pull/5262) +* Added missing Powder tests by @PhallenTree in [#5370](https://github.com/rh-hideout/pokeemerald-expansion/pull/5370) +* Added `ShouldSwitchIfWonderGuard` AI tests by @Pawkkie in [#5383](https://github.com/rh-hideout/pokeemerald-expansion/pull/5383) +### Changed +* Moved `ASSUME`s to inside `GIVEN` blocks to prevent them from being added correctly to the totals in the test summary by @AsparagusEduardo in [#5308](https://github.com/rh-hideout/pokeemerald-expansion/pull/5308) + +## 📚 Documentation 📚 +### Fixed +* Fixed test system documentation saying that `make check TESTS="Spikes"` could be done with single quotes instead of double quotes by @AsparagusEduardo in [#5266](https://github.com/rh-hideout/pokeemerald-expansion/pull/5266) + +## 📦 Branch Synchronisation 📦 +### pret's base pokeemerald +* N/A +### merrp/aarant's followers +* Merrp merge (September 9th) by @AsparagusEduardo in [#5359](https://github.com/rh-hideout/pokeemerald-expansion/pull/5359) + * aarant#40 (discarded, as it was already part of the expansion) + * New features: + * [Static OW pokemon now bob while walking in place](https://github.com/rh-hideout/pokeemerald-expansion/commit/839cf2e79012e0fc9159af5ab9e6a497e86bbfa4) + * Toggled by `OW_FOLLOWERS_BOBBING`. + * [Added `OW_MON_WANDER_WALK` config option](https://github.com/rh-hideout/pokeemerald-expansion/commit/42d9f24c8472a67d742d9d9da106480c84514336) + * If true, OW pokemon with `MOVEMENT_TYPE_WANDER*` will walk-in-place in between steps. + +## New Contributors +* @laserXdolphin made their first contribution in [#5273](https://github.com/rh-hideout/pokeemerald-expansion/pull/5273) +* @Liamjd14 made their first contribution in [#5304](https://github.com/rh-hideout/pokeemerald-expansion/pull/5304) + +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.9.1...expansion/1.9.2 + diff --git a/docs/changelogs/template.md b/docs/changelogs/template.md index a40afebad3..fe4191f589 100644 --- a/docs/changelogs/template.md +++ b/docs/changelogs/template.md @@ -10,7 +10,7 @@ 📜 = Uses a migration script. * N/A -## 💥 *Softlock/Crash fixes* 💥 +## 💥 *Hardlock/Softlock/Crash/Compiling fixes* 💥 * N/A ## 🧬 General 🧬 @@ -122,6 +122,14 @@ ### Fixed * N/A +## 📚 Documentation 📚 +### Added +* N/A +### Changed +* N/A +### Fixed +* N/A + ## 📦 Branch Synchronisation 📦 ### pret's base pokeemerald * N/A @@ -135,3 +143,4 @@ **Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.Y.Z...expansion/1.Y.Z + diff --git a/graphics/pokemon/arcanine/hisuian/overworld.png b/graphics/pokemon/arcanine/hisuian/overworld.png index a3c67a34d3..ec9fb5d8f8 100644 Binary files a/graphics/pokemon/arcanine/hisuian/overworld.png and b/graphics/pokemon/arcanine/hisuian/overworld.png differ diff --git a/graphics/pokemon/basculin/white_striped/overworld_shiny.pal b/graphics/pokemon/basculin/white_striped/overworld_shiny.pal index b4e0639fc8..9f7acd3090 100644 --- a/graphics/pokemon/basculin/white_striped/overworld_shiny.pal +++ b/graphics/pokemon/basculin/white_striped/overworld_shiny.pal @@ -6,13 +6,13 @@ JASC-PAL 255 255 255 172 197 255 0 0 0 -32 139 65 +80 112 40 16 98 41 123 172 172 172 222 230 -41 189 90 +120 168 56 74 74 74 -90 90 90 +64 80 80 57 74 82 123 148 197 123 148 189 diff --git a/graphics/pokemon/calyrex/ice_rider/overworld.png b/graphics/pokemon/calyrex/ice_rider/overworld.png index 24b3b6215a..48952c59fa 100644 Binary files a/graphics/pokemon/calyrex/ice_rider/overworld.png and b/graphics/pokemon/calyrex/ice_rider/overworld.png differ diff --git a/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal b/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal index 9eb0730f23..4a45354c83 100644 --- a/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal +++ b/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal @@ -7,13 +7,13 @@ JASC-PAL 0 37 32 146 175 206 183 206 229 -0 75 65 +0 88 72 52 69 167 -66 119 111 +0 112 96 100 100 100 242 242 242 64 83 103 -216 215 206 +208 200 144 0 0 0 -169 160 155 +168 136 88 191 191 191 diff --git a/graphics/pokemon/calyrex/shadow_rider/overworld.png b/graphics/pokemon/calyrex/shadow_rider/overworld.png index bb8c91b2f3..8aa1a2247e 100644 Binary files a/graphics/pokemon/calyrex/shadow_rider/overworld.png and b/graphics/pokemon/calyrex/shadow_rider/overworld.png differ diff --git a/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal b/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal index 8114f67fe8..5454cdbe6e 100644 --- a/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal +++ b/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal @@ -8,7 +8,7 @@ JASC-PAL 246 242 246 65 64 74 32 36 65 -49 68 164 +0 75 65 213 210 205 0 32 24 148 174 205 diff --git a/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal b/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal index 8114f67fe8..61607ea95b 100644 --- a/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal +++ b/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal @@ -8,12 +8,12 @@ JASC-PAL 246 242 246 65 64 74 32 36 65 -49 68 164 -213 210 205 +0 88 72 +208 200 144 0 32 24 148 174 205 74 52 148 -172 161 156 +168 136 88 98 101 98 24 16 65 49 36 115 diff --git a/graphics/pokemon/dialga/origin/overworld_shiny.pal b/graphics/pokemon/dialga/origin/overworld_shiny.pal index e6bfc48201..24814df9df 100644 --- a/graphics/pokemon/dialga/origin/overworld_shiny.pal +++ b/graphics/pokemon/dialga/origin/overworld_shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -98 182 49 +0 40 128 0 0 0 65 129 255 189 32 16 246 80 65 57 121 180 -98 121 139 -32 64 106 -16 56 90 -24 64 106 +156 172 115 +8 106 123 +8 106 123 +8 148 156 189 202 222 -32 89 148 -139 161 180 -156 210 246 +8 148 156 +115 189 156 +156 246 148 16 16 16 24 40 49 diff --git a/graphics/pokemon/enamorus/overworld_shiny.pal b/graphics/pokemon/enamorus/overworld_shiny.pal index 88fa42851f..d1281fa883 100644 --- a/graphics/pokemon/enamorus/overworld_shiny.pal +++ b/graphics/pokemon/enamorus/overworld_shiny.pal @@ -4,16 +4,16 @@ JASC-PAL 41 165 49 0 0 0 164 133 41 -230 117 156 -189 60 90 -172 72 82 +230 131 164 +255 90 0 +189 82 106 238 234 255 32 36 32 57 60 57 205 202 222 -148 32 24 +164 24 24 255 198 57 16 16 16 -246 85 139 +255 139 238 82 80 90 115 48 57 diff --git a/graphics/pokemon/enamorus/therian/overworld.png b/graphics/pokemon/enamorus/therian/overworld.png index f588895eb2..c52037dfe4 100644 Binary files a/graphics/pokemon/enamorus/therian/overworld.png and b/graphics/pokemon/enamorus/therian/overworld.png differ diff --git a/graphics/pokemon/enamorus/therian/overworld_shiny.pal b/graphics/pokemon/enamorus/therian/overworld_shiny.pal index c799ddfb89..e650396bc8 100644 --- a/graphics/pokemon/enamorus/therian/overworld_shiny.pal +++ b/graphics/pokemon/enamorus/therian/overworld_shiny.pal @@ -6,14 +6,14 @@ JASC-PAL 118 50 58 232 232 248 200 200 216 -224 116 156 -174 74 87 +213 106 156 +213 65 57 16 16 16 243 46 46 -199 46 41 +74 74 74 147 33 30 -243 84 143 -187 62 94 +238 131 230 +203 0 128 247 238 76 255 197 60 0 0 0 diff --git a/graphics/pokemon/exeggutor/alolan/overworld.png b/graphics/pokemon/exeggutor/alolan/overworld.png index 6597515899..07e24d5c6c 100644 Binary files a/graphics/pokemon/exeggutor/alolan/overworld.png and b/graphics/pokemon/exeggutor/alolan/overworld.png differ diff --git a/graphics/pokemon/flabebe/blue_flower/overworld.png b/graphics/pokemon/flabebe/blue_flower/overworld.png index 02176b255c..cd98db3a57 100644 Binary files a/graphics/pokemon/flabebe/blue_flower/overworld.png and b/graphics/pokemon/flabebe/blue_flower/overworld.png differ diff --git a/graphics/pokemon/flabebe/blue_flower/overworld_shiny.pal b/graphics/pokemon/flabebe/blue_flower/overworld_shiny.pal index 4a019608b5..2ee9713e26 100644 --- a/graphics/pokemon/flabebe/blue_flower/overworld_shiny.pal +++ b/graphics/pokemon/flabebe/blue_flower/overworld_shiny.pal @@ -12,8 +12,8 @@ JASC-PAL 221 181 0 243 86 75 21 44 77 -69 66 127 +31 95 31 70 144 248 -154 149 228 +184 216 153 96 90 188 0 0 0 diff --git a/graphics/pokemon/flabebe/orange_flower/overworld.png b/graphics/pokemon/flabebe/orange_flower/overworld.png index af5fe1322d..482ff4f29e 100644 Binary files a/graphics/pokemon/flabebe/orange_flower/overworld.png and b/graphics/pokemon/flabebe/orange_flower/overworld.png differ diff --git a/graphics/pokemon/flabebe/orange_flower/overworld_shiny.pal b/graphics/pokemon/flabebe/orange_flower/overworld_shiny.pal index 678dd2b205..d5000f7234 100644 --- a/graphics/pokemon/flabebe/orange_flower/overworld_shiny.pal +++ b/graphics/pokemon/flabebe/orange_flower/overworld_shiny.pal @@ -12,8 +12,8 @@ JASC-PAL 221 181 0 243 86 75 171 61 1 -69 66 127 +31 95 31 253 145 59 -154 149 228 +184 216 153 96 90 188 0 0 0 diff --git a/graphics/pokemon/flabebe/overworld.png b/graphics/pokemon/flabebe/overworld.png index 922fed03cd..3ad946f5f8 100644 Binary files a/graphics/pokemon/flabebe/overworld.png and b/graphics/pokemon/flabebe/overworld.png differ diff --git a/graphics/pokemon/flabebe/overworld_shiny.pal b/graphics/pokemon/flabebe/overworld_shiny.pal index 4b3bd7e5c5..e9ea843e50 100644 --- a/graphics/pokemon/flabebe/overworld_shiny.pal +++ b/graphics/pokemon/flabebe/overworld_shiny.pal @@ -12,8 +12,8 @@ JASC-PAL 221 181 0 243 86 75 107 36 33 -96 90 188 -154 149 228 +31 95 31 +184 216 153 96 90 188 0 0 0 0 0 0 diff --git a/graphics/pokemon/flabebe/white_flower/overworld.png b/graphics/pokemon/flabebe/white_flower/overworld.png index 843d45c96d..35b4b2f358 100644 Binary files a/graphics/pokemon/flabebe/white_flower/overworld.png and b/graphics/pokemon/flabebe/white_flower/overworld.png differ diff --git a/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal b/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal index 66317d4037..43b725acc2 100644 --- a/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal +++ b/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal @@ -11,8 +11,8 @@ JASC-PAL 232 153 2 221 181 0 243 86 75 -69 66 127 -154 149 228 +31 95 31 +184 216 153 96 90 188 0 0 0 0 0 0 diff --git a/graphics/pokemon/flabebe/yellow_flower/overworld.png b/graphics/pokemon/flabebe/yellow_flower/overworld.png index d170322b18..b0f7a47f7a 100644 Binary files a/graphics/pokemon/flabebe/yellow_flower/overworld.png and b/graphics/pokemon/flabebe/yellow_flower/overworld.png differ diff --git a/graphics/pokemon/flabebe/yellow_flower/overworld_shiny.pal b/graphics/pokemon/flabebe/yellow_flower/overworld_shiny.pal index 04f701918c..5c527f5608 100644 --- a/graphics/pokemon/flabebe/yellow_flower/overworld_shiny.pal +++ b/graphics/pokemon/flabebe/yellow_flower/overworld_shiny.pal @@ -12,8 +12,8 @@ JASC-PAL 221 181 0 243 86 75 148 81 2 -69 66 127 +31 95 31 230 206 10 -154 149 228 +184 216 153 96 90 188 0 0 0 diff --git a/graphics/pokemon/floette/eternal_flower/overworld_shiny.pal b/graphics/pokemon/floette/eternal_flower/overworld_shiny.pal index 3917a8c5fc..2f377aa0ed 100644 --- a/graphics/pokemon/floette/eternal_flower/overworld_shiny.pal +++ b/graphics/pokemon/floette/eternal_flower/overworld_shiny.pal @@ -9,8 +9,8 @@ JASC-PAL 255 93 135 59 55 55 205 39 81 -25 105 88 -12 180 149 +127 63 79 +207 143 159 251 254 255 99 113 115 197 199 199 diff --git a/graphics/pokemon/golem/alolan/overworld.png b/graphics/pokemon/golem/alolan/overworld.png index d5d950f84d..b083d1df8a 100644 Binary files a/graphics/pokemon/golem/alolan/overworld.png and b/graphics/pokemon/golem/alolan/overworld.png differ diff --git a/graphics/pokemon/goodra/hisuian/overworld.png b/graphics/pokemon/goodra/hisuian/overworld.png index 5bc1d200c8..23f160b786 100644 Binary files a/graphics/pokemon/goodra/hisuian/overworld.png and b/graphics/pokemon/goodra/hisuian/overworld.png differ diff --git a/graphics/pokemon/gourgeist/large/overworld.png b/graphics/pokemon/gourgeist/large/overworld.png new file mode 100644 index 0000000000..e542ea4385 Binary files /dev/null and b/graphics/pokemon/gourgeist/large/overworld.png differ diff --git a/graphics/pokemon/gourgeist/overworld.png b/graphics/pokemon/gourgeist/overworld.png index f2184b2cfc..82e5a0595c 100644 Binary files a/graphics/pokemon/gourgeist/overworld.png and b/graphics/pokemon/gourgeist/overworld.png differ diff --git a/graphics/pokemon/gourgeist/small/overworld.png b/graphics/pokemon/gourgeist/small/overworld.png new file mode 100644 index 0000000000..cbbd3cca8a Binary files /dev/null and b/graphics/pokemon/gourgeist/small/overworld.png differ diff --git a/graphics/pokemon/gourgeist/super/overworld.png b/graphics/pokemon/gourgeist/super/overworld.png new file mode 100644 index 0000000000..d9494d1971 Binary files /dev/null and b/graphics/pokemon/gourgeist/super/overworld.png differ diff --git a/graphics/pokemon/graveler/alolan/overworld.png b/graphics/pokemon/graveler/alolan/overworld.png index 7ff3687da6..d1c9b50f17 100644 Binary files a/graphics/pokemon/graveler/alolan/overworld.png and b/graphics/pokemon/graveler/alolan/overworld.png differ diff --git a/graphics/pokemon/growlithe/hisuian/overworld.png b/graphics/pokemon/growlithe/hisuian/overworld.png index f9cb0ef6cc..fdacc91345 100644 Binary files a/graphics/pokemon/growlithe/hisuian/overworld.png and b/graphics/pokemon/growlithe/hisuian/overworld.png differ diff --git a/graphics/pokemon/kyurem/black/overworld.png b/graphics/pokemon/kyurem/black/overworld.png new file mode 100644 index 0000000000..2818f3b943 Binary files /dev/null and b/graphics/pokemon/kyurem/black/overworld.png differ diff --git a/graphics/pokemon/kyurem/black/overworld_normal.pal b/graphics/pokemon/kyurem/black/overworld_normal.pal new file mode 100644 index 0000000000..ee43680d4c --- /dev/null +++ b/graphics/pokemon/kyurem/black/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +255 18 128 +16 16 16 +40 40 40 +48 48 42 +56 56 56 +72 72 72 +71 86 86 +96 96 96 +248 232 8 +144 136 120 +239 173 74 +72 72 72 +136 152 144 +184 176 152 +179 204 187 +232 232 248 diff --git a/graphics/pokemon/kyurem/black/overworld_shiny.pal b/graphics/pokemon/kyurem/black/overworld_shiny.pal new file mode 100644 index 0000000000..b7782d0c29 --- /dev/null +++ b/graphics/pokemon/kyurem/black/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +125 146 158 +16 16 16 +40 40 40 +48 48 42 +57 62 66 +72 72 72 +71 86 86 +48 80 56 +240 64 180 +96 128 108 +194 52 146 +72 72 72 +173 228 247 +184 176 152 +122 147 201 +232 232 248 diff --git a/graphics/pokemon/kyurem/white/overworld.png b/graphics/pokemon/kyurem/white/overworld.png new file mode 100644 index 0000000000..d4651912d4 Binary files /dev/null and b/graphics/pokemon/kyurem/white/overworld.png differ diff --git a/graphics/pokemon/kyurem/white/overworld_normal.pal b/graphics/pokemon/kyurem/white/overworld_normal.pal new file mode 100644 index 0000000000..0f6dd354dc --- /dev/null +++ b/graphics/pokemon/kyurem/white/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +238 27 128 +16 16 16 +48 48 42 +62 62 66 +80 96 96 +96 96 96 +80 96 96 +232 232 248 +236 220 10 +144 136 120 +239 173 74 +136 152 144 +184 176 152 +182 207 190 +196 196 209 +232 232 248 diff --git a/graphics/pokemon/kyurem/white/overworld_shiny.pal b/graphics/pokemon/kyurem/white/overworld_shiny.pal new file mode 100644 index 0000000000..922002fe5b --- /dev/null +++ b/graphics/pokemon/kyurem/white/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +238 27 128 +16 16 16 +48 48 42 +62 62 66 +80 96 96 +48 75 81 +80 96 96 +232 232 248 +237 90 188 +90 115 128 +170 45 128 +122 147 200 +184 176 152 +196 203 240 +196 196 209 +232 232 248 diff --git a/graphics/pokemon/landorus/therian/overworld.png b/graphics/pokemon/landorus/therian/overworld.png new file mode 100644 index 0000000000..0f3b021957 Binary files /dev/null and b/graphics/pokemon/landorus/therian/overworld.png differ diff --git a/graphics/pokemon/landorus/therian/overworld_normal.pal b/graphics/pokemon/landorus/therian/overworld_normal.pal new file mode 100644 index 0000000000..68ee7e89de --- /dev/null +++ b/graphics/pokemon/landorus/therian/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +84 86 84 +109 127 139 +237 237 246 +198 198 211 +22 37 14 +142 85 23 +219 152 23 +246 131 142 +87 78 43 +212 99 49 +225 80 74 +38 37 38 +214 195 61 +0 0 0 +0 0 0 diff --git a/graphics/pokemon/landorus/therian/overworld_shiny.pal b/graphics/pokemon/landorus/therian/overworld_shiny.pal new file mode 100644 index 0000000000..36e4944980 --- /dev/null +++ b/graphics/pokemon/landorus/therian/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +103 64 40 +103 128 140 +237 237 246 +160 184 160 +22 37 14 +158 97 23 +248 160 40 +229 89 32 +38 37 38 +158 97 23 +229 89 32 +38 37 38 +214 195 61 +0 0 0 +0 0 0 diff --git a/graphics/pokemon/lycanroc/overworld.png b/graphics/pokemon/lycanroc/overworld.png index e625ff8250..5b8ebcb1f6 100644 Binary files a/graphics/pokemon/lycanroc/overworld.png and b/graphics/pokemon/lycanroc/overworld.png differ diff --git a/graphics/pokemon/lycanroc/overworld_normal.pal b/graphics/pokemon/lycanroc/overworld_normal.pal index 87f56c95fa..f75ed7c8f8 100644 --- a/graphics/pokemon/lycanroc/overworld_normal.pal +++ b/graphics/pokemon/lycanroc/overworld_normal.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 -255 255 255 +243 18 128 199 162 141 184 181 175 92 170 238 128 128 128 -88 146 214 +255 255 255 85 129 197 141 116 102 178 98 156 diff --git a/graphics/pokemon/lycanroc/overworld_shiny.pal b/graphics/pokemon/lycanroc/overworld_shiny.pal index 03f98160db..fe310eee21 100644 --- a/graphics/pokemon/lycanroc/overworld_shiny.pal +++ b/graphics/pokemon/lycanroc/overworld_shiny.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 -255 255 255 +243 18 128 136 168 200 184 181 175 92 170 238 128 128 128 -88 146 214 +255 255 240 85 129 197 96 120 176 248 152 136 diff --git a/graphics/pokemon/magearna/original_color/overworld.png b/graphics/pokemon/magearna/original_color/overworld.png new file mode 100644 index 0000000000..0e6c49271e Binary files /dev/null and b/graphics/pokemon/magearna/original_color/overworld.png differ diff --git a/graphics/pokemon/magearna/original_color/overworld_normal.pal b/graphics/pokemon/magearna/original_color/overworld_normal.pal new file mode 100644 index 0000000000..5a44a54707 --- /dev/null +++ b/graphics/pokemon/magearna/original_color/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +49 44 43 +179 74 68 +203 98 96 +179 74 68 +0 0 0 +232 227 162 +203 98 96 +186 177 108 +94 84 82 +70 153 169 +168 161 155 +239 229 115 +231 227 224 +186 177 108 +0 0 0 diff --git a/graphics/pokemon/magearna/original_color/overworld_shiny.pal b/graphics/pokemon/magearna/original_color/overworld_shiny.pal new file mode 100644 index 0000000000..167f426783 --- /dev/null +++ b/graphics/pokemon/magearna/original_color/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +49 44 43 +90 85 84 +216 120 144 +179 74 68 +0 0 0 +206 200 197 +135 129 126 +153 146 143 +105 93 91 +70 153 169 +168 161 155 +232 220 110 +206 200 197 +167 157 71 +0 0 0 diff --git a/graphics/pokemon/marowak/alolan/overworld.png b/graphics/pokemon/marowak/alolan/overworld.png index 07dc3ff981..655c37491e 100644 Binary files a/graphics/pokemon/marowak/alolan/overworld.png and b/graphics/pokemon/marowak/alolan/overworld.png differ diff --git a/graphics/pokemon/marowak/alolan/overworld_normal.pal b/graphics/pokemon/marowak/alolan/overworld_normal.pal index e8ff3de95a..8d978ff30d 100644 --- a/graphics/pokemon/marowak/alolan/overworld_normal.pal +++ b/graphics/pokemon/marowak/alolan/overworld_normal.pal @@ -7,13 +7,13 @@ JASC-PAL 72 72 72 0 0 0 216 224 224 -81 51 79 -50 142 66 -211 248 121 +48 48 80 +40 216 176 +160 248 240 52 35 51 -112 71 82 -4 107 56 -48 189 120 -137 86 133 -170 130 145 +112 64 80 +40 216 176 +24 168 136 +80 72 136 +168 128 144 172 229 196 diff --git a/graphics/pokemon/marowak/alolan/overworld_shiny.pal b/graphics/pokemon/marowak/alolan/overworld_shiny.pal index d421629675..e60d468280 100644 --- a/graphics/pokemon/marowak/alolan/overworld_shiny.pal +++ b/graphics/pokemon/marowak/alolan/overworld_shiny.pal @@ -7,13 +7,13 @@ JASC-PAL 72 72 72 0 0 0 216 224 224 -67 58 109 -50 142 66 -211 248 121 -54 49 81 -67 67 67 -4 107 56 -48 189 120 -101 87 164 -112 112 112 +96 64 136 +40 216 176 +160 248 240 +52 35 51 +40 32 32 +40 216 176 +24 168 136 +136 96 192 +64 48 48 172 229 196 diff --git a/graphics/pokemon/necrozma/dawn_wings/overworld.png b/graphics/pokemon/necrozma/dawn_wings/overworld.png index 3bae5a72f9..af658b2ebc 100644 Binary files a/graphics/pokemon/necrozma/dawn_wings/overworld.png and b/graphics/pokemon/necrozma/dawn_wings/overworld.png differ diff --git a/graphics/pokemon/ninetales/alolan/overworld.png b/graphics/pokemon/ninetales/alolan/overworld.png index 0abf5d6433..d13aa001d0 100644 Binary files a/graphics/pokemon/ninetales/alolan/overworld.png and b/graphics/pokemon/ninetales/alolan/overworld.png differ diff --git a/graphics/pokemon/ninetales/alolan/overworld_shiny.pal b/graphics/pokemon/ninetales/alolan/overworld_shiny.pal index dfb053a961..0336fd62a9 100644 --- a/graphics/pokemon/ninetales/alolan/overworld_shiny.pal +++ b/graphics/pokemon/ninetales/alolan/overworld_shiny.pal @@ -2,7 +2,7 @@ JASC-PAL 0100 16 152 208 160 -91 74 138 +112 80 112 0 0 0 178 178 219 230 225 246 diff --git a/graphics/pokemon/oricorio/pau/overworld.png b/graphics/pokemon/oricorio/pau/overworld.png new file mode 100644 index 0000000000..16674ed09b Binary files /dev/null and b/graphics/pokemon/oricorio/pau/overworld.png differ diff --git a/graphics/pokemon/oricorio/pau/overworld_normal.pal b/graphics/pokemon/oricorio/pau/overworld_normal.pal new file mode 100644 index 0000000000..2121618194 --- /dev/null +++ b/graphics/pokemon/oricorio/pau/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +32 32 32 +192 173 154 +252 234 216 +144 128 112 +104 59 68 +239 183 188 +184 142 145 +0 0 0 +191 137 141 +199 132 137 +242 106 141 +135 104 106 +237 243 238 +230 97 131 +255 190 197 diff --git a/graphics/pokemon/oricorio/pau/overworld_shiny.pal b/graphics/pokemon/oricorio/pau/overworld_shiny.pal new file mode 100644 index 0000000000..4a3a9d46d2 --- /dev/null +++ b/graphics/pokemon/oricorio/pau/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +32 32 32 +223 90 124 +252 152 158 +158 54 72 +104 59 68 +239 183 188 +202 86 116 +0 0 0 +252 152 158 +199 132 137 +254 236 199 +135 104 106 +237 243 238 +220 174 133 +254 236 199 diff --git a/graphics/pokemon/oricorio/pom_pom/overworld.png b/graphics/pokemon/oricorio/pom_pom/overworld.png new file mode 100644 index 0000000000..42f23c505b Binary files /dev/null and b/graphics/pokemon/oricorio/pom_pom/overworld.png differ diff --git a/graphics/pokemon/oricorio/pom_pom/overworld_normal.pal b/graphics/pokemon/oricorio/pom_pom/overworld_normal.pal new file mode 100644 index 0000000000..ca737b1387 --- /dev/null +++ b/graphics/pokemon/oricorio/pom_pom/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +0 0 0 +244 234 66 +175 167 45 +72 58 37 +240 224 112 +161 150 73 +215 201 100 +135 104 106 +105 101 27 +184 142 145 +237 243 238 +87 87 87 +237 183 187 +135 104 106 +255 237 191 diff --git a/graphics/pokemon/oricorio/pom_pom/overworld_shiny.pal b/graphics/pokemon/oricorio/pom_pom/overworld_shiny.pal new file mode 100644 index 0000000000..9b2793d012 --- /dev/null +++ b/graphics/pokemon/oricorio/pom_pom/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +0 0 0 +240 240 240 +207 207 207 +72 65 54 +240 224 112 +161 150 73 +215 201 100 +135 135 135 +135 135 135 +184 142 145 +237 243 238 +87 87 87 +246 190 194 +135 104 106 +255 237 191 diff --git a/graphics/pokemon/oricorio/sensu/overworld.png b/graphics/pokemon/oricorio/sensu/overworld.png new file mode 100644 index 0000000000..d321b78207 Binary files /dev/null and b/graphics/pokemon/oricorio/sensu/overworld.png differ diff --git a/graphics/pokemon/oricorio/sensu/overworld_normal.pal b/graphics/pokemon/oricorio/sensu/overworld_normal.pal new file mode 100644 index 0000000000..715bf69046 --- /dev/null +++ b/graphics/pokemon/oricorio/sensu/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +27 64 78 +210 249 248 +55 97 92 +240 230 248 +0 0 0 +162 232 232 +60 61 86 +169 171 225 +148 148 250 +184 142 145 +122 124 160 +246 190 194 +229 177 181 +135 104 106 +72 58 37 diff --git a/graphics/pokemon/oricorio/sensu/overworld_shiny.pal b/graphics/pokemon/oricorio/sensu/overworld_shiny.pal new file mode 100644 index 0000000000..85a6c623ba --- /dev/null +++ b/graphics/pokemon/oricorio/sensu/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +27 64 78 +131 131 241 +48 58 68 +240 230 248 +0 0 0 +148 148 250 +48 58 68 +169 197 225 +148 209 250 +184 142 145 +122 147 160 +246 190 194 +229 177 181 +135 104 106 +72 58 37 diff --git a/graphics/pokemon/palkia/origin/overworld.png b/graphics/pokemon/palkia/origin/overworld.png index e40c8c6a3f..65b6491cc2 100644 Binary files a/graphics/pokemon/palkia/origin/overworld.png and b/graphics/pokemon/palkia/origin/overworld.png differ diff --git a/graphics/pokemon/palkia/origin/overworld_normal.pal b/graphics/pokemon/palkia/origin/overworld_normal.pal index 8a6f0c4ab8..d437a74053 100644 --- a/graphics/pokemon/palkia/origin/overworld_normal.pal +++ b/graphics/pokemon/palkia/origin/overworld_normal.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -32 97 0 -0 0 0 -246 80 65 -172 161 180 -255 238 238 -246 161 156 -131 121 148 +115 197 164 +72 76 80 +248 248 248 +176 184 192 +200 216 232 +120 136 144 +136 120 144 16 16 16 -197 190 213 -246 194 189 -164 80 164 -205 137 197 -106 97 24 -222 218 246 -65 72 74 -82 80 90 +208 192 216 +232 216 248 +200 136 192 +240 80 64 +240 160 152 +232 216 248 +160 80 160 +104 96 24 diff --git a/graphics/pokemon/palkia/origin/overworld_shiny.pal b/graphics/pokemon/palkia/origin/overworld_shiny.pal index 8a6f0c4ab8..9d2cd643af 100644 --- a/graphics/pokemon/palkia/origin/overworld_shiny.pal +++ b/graphics/pokemon/palkia/origin/overworld_shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -32 97 0 -0 0 0 -246 80 65 -172 161 180 -255 238 238 -246 161 156 -131 121 148 +115 197 164 +72 76 80 +248 248 248 +191 175 192 +228 193 232 +137 125 144 +164 120 144 16 16 16 -197 190 213 -246 194 189 -164 80 164 -205 137 197 -106 97 24 -222 218 246 -65 72 74 -82 80 90 +217 183 216 +240 193 248 +224 128 186 +240 80 64 +240 160 152 +251 227 225 +164 120 144 +104 96 24 diff --git a/graphics/pokemon/persian/alolan/overworld.png b/graphics/pokemon/persian/alolan/overworld.png index 94b2269630..e97a048151 100644 Binary files a/graphics/pokemon/persian/alolan/overworld.png and b/graphics/pokemon/persian/alolan/overworld.png differ diff --git a/graphics/pokemon/ponyta/galarian/overworld.png b/graphics/pokemon/ponyta/galarian/overworld.png index 683780312b..1c37a3d1af 100644 Binary files a/graphics/pokemon/ponyta/galarian/overworld.png and b/graphics/pokemon/ponyta/galarian/overworld.png differ diff --git a/graphics/pokemon/ponyta/galarian/overworld_normal.pal b/graphics/pokemon/ponyta/galarian/overworld_normal.pal index 2889031392..d35f7c3b10 100644 --- a/graphics/pokemon/ponyta/galarian/overworld_normal.pal +++ b/graphics/pokemon/ponyta/galarian/overworld_normal.pal @@ -10,10 +10,10 @@ JASC-PAL 65 113 106 213 153 213 189 186 189 -246 226 172 +72 200 232 238 234 255 0 0 0 106 222 222 115 113 65 -230 186 230 +48 152 168 246 242 222 diff --git a/graphics/pokemon/ponyta/galarian/overworld_shiny.pal b/graphics/pokemon/ponyta/galarian/overworld_shiny.pal index 143612d3ea..b9846e29d7 100644 --- a/graphics/pokemon/ponyta/galarian/overworld_shiny.pal +++ b/graphics/pokemon/ponyta/galarian/overworld_shiny.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 152 208 160 -200 144 48 +199 171 123 131 121 90 32 32 32 192 216 200 -240 200 80 -66 149 97 -248 240 160 +240 219 158 +48 152 168 +247 244 203 189 186 189 -71 180 150 +72 200 232 238 234 255 0 0 0 -128 248 176 -72 88 72 -229 218 105 +106 222 222 +16 16 16 +48 152 168 232 248 240 diff --git a/graphics/pokemon/pumpkaboo/large/overworld.png b/graphics/pokemon/pumpkaboo/large/overworld.png new file mode 100644 index 0000000000..5c9d3e7f96 Binary files /dev/null and b/graphics/pokemon/pumpkaboo/large/overworld.png differ diff --git a/graphics/pokemon/pumpkaboo/overworld.png b/graphics/pokemon/pumpkaboo/overworld.png index 67542d25d9..07102d06aa 100644 Binary files a/graphics/pokemon/pumpkaboo/overworld.png and b/graphics/pokemon/pumpkaboo/overworld.png differ diff --git a/graphics/pokemon/pumpkaboo/small/overworld.png b/graphics/pokemon/pumpkaboo/small/overworld.png new file mode 100644 index 0000000000..975796f82a Binary files /dev/null and b/graphics/pokemon/pumpkaboo/small/overworld.png differ diff --git a/graphics/pokemon/pumpkaboo/super/overworld.png b/graphics/pokemon/pumpkaboo/super/overworld.png new file mode 100644 index 0000000000..4887049ed9 Binary files /dev/null and b/graphics/pokemon/pumpkaboo/super/overworld.png differ diff --git a/graphics/pokemon/raichu/alolan/overworld_shiny.pal b/graphics/pokemon/raichu/alolan/overworld_shiny.pal index 1d2eb4fe61..4ea7665b8b 100644 --- a/graphics/pokemon/raichu/alolan/overworld_shiny.pal +++ b/graphics/pokemon/raichu/alolan/overworld_shiny.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -112 105 18 -240 225 38 +144 88 40 +248 176 72 0 0 0 -81 54 41 -150 141 24 +168 104 64 +112 40 40 151 117 86 102 68 37 -123 87 56 +136 72 56 112 72 40 -255 239 225 +232 216 176 44 29 27 78 201 201 204 188 174 diff --git a/graphics/pokemon/rapidash/galarian/overworld.png b/graphics/pokemon/rapidash/galarian/overworld.png index 1271349061..f81fceb9b0 100644 Binary files a/graphics/pokemon/rapidash/galarian/overworld.png and b/graphics/pokemon/rapidash/galarian/overworld.png differ diff --git a/graphics/pokemon/rapidash/galarian/overworld_shiny.pal b/graphics/pokemon/rapidash/galarian/overworld_shiny.pal index fa425be9b7..71b5d50d48 100644 --- a/graphics/pokemon/rapidash/galarian/overworld_shiny.pal +++ b/graphics/pokemon/rapidash/galarian/overworld_shiny.pal @@ -4,16 +4,16 @@ JASC-PAL 152 208 160 18 2 31 0 24 96 -71 113 111 -107 220 217 -167 235 232 +32 128 120 +56 192 168 +128 224 200 62 62 62 -176 144 32 +176 160 104 245 243 220 -237 237 137 +224 220 175 255 255 255 0 0 0 -233 217 173 -248 248 208 +224 220 175 +247 247 228 232 232 248 230 223 160 diff --git a/graphics/pokemon/sandshrew/alolan/overworld.png b/graphics/pokemon/sandshrew/alolan/overworld.png index 8b6c58a669..1ca8f0e17d 100644 Binary files a/graphics/pokemon/sandshrew/alolan/overworld.png and b/graphics/pokemon/sandshrew/alolan/overworld.png differ diff --git a/graphics/pokemon/sawsbuck/winter/overworld.png b/graphics/pokemon/sawsbuck/winter/overworld.png index 29748fd3e9..7c742bdc7b 100644 Binary files a/graphics/pokemon/sawsbuck/winter/overworld.png and b/graphics/pokemon/sawsbuck/winter/overworld.png differ diff --git a/graphics/pokemon/scovillain/overworld.png b/graphics/pokemon/scovillain/overworld.png index a0dcf40433..6eb5fac3e4 100644 Binary files a/graphics/pokemon/scovillain/overworld.png and b/graphics/pokemon/scovillain/overworld.png differ diff --git a/graphics/pokemon/shaymin/sky/overworld.png b/graphics/pokemon/shaymin/sky/overworld.png new file mode 100644 index 0000000000..0ef9f6a09d Binary files /dev/null and b/graphics/pokemon/shaymin/sky/overworld.png differ diff --git a/graphics/pokemon/shaymin/sky/overworld_normal.pal b/graphics/pokemon/shaymin/sky/overworld_normal.pal new file mode 100644 index 0000000000..81840ca696 --- /dev/null +++ b/graphics/pokemon/shaymin/sky/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +88 88 112 +176 224 96 +120 168 48 +240 192 0 +240 128 168 +128 128 152 +184 56 56 +248 40 48 +48 152 72 +232 232 248 +168 168 208 +64 64 64 +104 128 0 +40 88 56 +0 0 0 diff --git a/graphics/pokemon/shaymin/sky/overworld_shiny.pal b/graphics/pokemon/shaymin/sky/overworld_shiny.pal new file mode 100644 index 0000000000..391cbc1791 --- /dev/null +++ b/graphics/pokemon/shaymin/sky/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +88 88 112 +136 208 192 +80 168 152 +240 192 0 +240 128 168 +128 128 152 +184 56 56 +248 40 48 +48 152 72 +232 232 248 +168 168 208 +64 64 64 +104 128 0 +56 104 96 +0 0 0 diff --git a/graphics/pokemon/sliggoo/hisuian/overworld.png b/graphics/pokemon/sliggoo/hisuian/overworld.png index 511b750d83..a195d82047 100644 Binary files a/graphics/pokemon/sliggoo/hisuian/overworld.png and b/graphics/pokemon/sliggoo/hisuian/overworld.png differ diff --git a/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal b/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal index 66b17f5ba2..875167548a 100644 --- a/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal +++ b/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal @@ -10,8 +10,8 @@ JASC-PAL 189 148 205 222 197 255 139 82 139 -0 0 0 -0 0 0 +96 156 144 +64 108 96 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal b/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal index d9dcb3cab2..3d0290753a 100644 --- a/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal +++ b/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal @@ -10,8 +10,8 @@ JASC-PAL 189 148 205 222 197 255 139 82 139 -0 0 0 -0 0 0 +170 171 96 +134 124 71 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/slowbro/galarian/overworld.png b/graphics/pokemon/slowbro/galarian/overworld.png index f62e2b3bdd..b618754adb 100644 Binary files a/graphics/pokemon/slowbro/galarian/overworld.png and b/graphics/pokemon/slowbro/galarian/overworld.png differ diff --git a/graphics/pokemon/thundurus/therian/overworld.png b/graphics/pokemon/thundurus/therian/overworld.png new file mode 100644 index 0000000000..e8b76b77a1 Binary files /dev/null and b/graphics/pokemon/thundurus/therian/overworld.png differ diff --git a/graphics/pokemon/thundurus/therian/overworld_normal.pal b/graphics/pokemon/thundurus/therian/overworld_normal.pal new file mode 100644 index 0000000000..30e45bed09 --- /dev/null +++ b/graphics/pokemon/thundurus/therian/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +77 77 99 +237 237 246 +44 43 44 +198 198 210 +22 38 14 +145 97 201 +164 140 247 +19 82 87 +96 185 218 +78 156 180 +107 192 222 +95 135 105 +168 152 48 +248 224 64 +0 0 0 diff --git a/graphics/pokemon/thundurus/therian/overworld_shiny.pal b/graphics/pokemon/thundurus/therian/overworld_shiny.pal new file mode 100644 index 0000000000..15920a815d --- /dev/null +++ b/graphics/pokemon/thundurus/therian/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +77 77 99 +237 237 246 +44 43 44 +198 198 210 +22 38 14 +144 32 176 +164 140 247 +24 40 72 +128 152 200 +72 96 136 +17 79 81 +128 152 200 +148 144 48 +248 200 112 +0 0 0 diff --git a/graphics/pokemon/tinkatink/overworld.png b/graphics/pokemon/tinkatink/overworld.png index 85e9bf94ee..bc04505233 100644 Binary files a/graphics/pokemon/tinkatink/overworld.png and b/graphics/pokemon/tinkatink/overworld.png differ diff --git a/graphics/pokemon/tinkaton/overworld.png b/graphics/pokemon/tinkaton/overworld.png index d34001d5cb..382f3b4200 100644 Binary files a/graphics/pokemon/tinkaton/overworld.png and b/graphics/pokemon/tinkaton/overworld.png differ diff --git a/graphics/pokemon/tinkatuff/overworld.png b/graphics/pokemon/tinkatuff/overworld.png index 451d70e030..e6800214b9 100644 Binary files a/graphics/pokemon/tinkatuff/overworld.png and b/graphics/pokemon/tinkatuff/overworld.png differ diff --git a/graphics/pokemon/tornadus/therian/overworld.png b/graphics/pokemon/tornadus/therian/overworld.png new file mode 100644 index 0000000000..9891fba57f Binary files /dev/null and b/graphics/pokemon/tornadus/therian/overworld.png differ diff --git a/graphics/pokemon/tornadus/therian/overworld_normal.pal b/graphics/pokemon/tornadus/therian/overworld_normal.pal new file mode 100644 index 0000000000..2e30907ae2 --- /dev/null +++ b/graphics/pokemon/tornadus/therian/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +81 81 82 +218 218 229 +22 37 14 +216 203 66 +140 124 69 +108 55 149 +128 72 168 +38 37 38 +89 223 46 +215 106 214 +63 168 40 +73 164 46 +216 56 40 +0 0 0 +0 0 0 diff --git a/graphics/pokemon/tornadus/therian/overworld_shiny.pal b/graphics/pokemon/tornadus/therian/overworld_shiny.pal new file mode 100644 index 0000000000..2dc9ab5e7e --- /dev/null +++ b/graphics/pokemon/tornadus/therian/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +38 37 38 +198 198 210 +22 37 14 +213 164 75 +186 116 43 +38 37 38 +72 64 119 +57 80 55 +104 160 24 +72 64 119 +71 144 42 +71 144 42 +216 56 40 +0 0 0 +0 0 0 diff --git a/graphics/pokemon/toxtricity/low_key/overworld_shiny.pal b/graphics/pokemon/toxtricity/low_key/overworld_shiny.pal index 4ffcb8ad61..b562ec57e3 100644 --- a/graphics/pokemon/toxtricity/low_key/overworld_shiny.pal +++ b/graphics/pokemon/toxtricity/low_key/overworld_shiny.pal @@ -4,11 +4,11 @@ JASC-PAL 128 128 128 33 46 49 0 0 0 -162 205 214 +144 216 240 26 14 32 -114 150 158 -152 83 187 -97 51 119 +112 152 216 +168 72 104 +112 64 72 255 255 255 132 98 147 167 141 178 diff --git a/graphics/pokemon/typhlosion/hisuian/overworld.png b/graphics/pokemon/typhlosion/hisuian/overworld.png index d98d720591..b289e6c033 100644 Binary files a/graphics/pokemon/typhlosion/hisuian/overworld.png and b/graphics/pokemon/typhlosion/hisuian/overworld.png differ diff --git a/graphics/pokemon/typhlosion/hisuian/overworld_shiny.pal b/graphics/pokemon/typhlosion/hisuian/overworld_shiny.pal index c4e051efca..95ef9e487f 100644 --- a/graphics/pokemon/typhlosion/hisuian/overworld_shiny.pal +++ b/graphics/pokemon/typhlosion/hisuian/overworld_shiny.pal @@ -6,12 +6,12 @@ JASC-PAL 238 98 230 246 74 106 246 90 164 -74 65 16 -180 180 123 +164 139 74 +255 255 255 0 0 0 24 57 74 57 98 123 -139 131 82 +213 197 115 57 139 172 222 222 172 238 238 255 diff --git a/graphics/pokemon/vulpix/alolan/overworld.png b/graphics/pokemon/vulpix/alolan/overworld.png index 2557ae0314..74211d12c3 100644 Binary files a/graphics/pokemon/vulpix/alolan/overworld.png and b/graphics/pokemon/vulpix/alolan/overworld.png differ diff --git a/graphics/pokemon/zygarde/10_percent/overworld.png b/graphics/pokemon/zygarde/10_percent/overworld.png new file mode 100644 index 0000000000..1b72c1eeef Binary files /dev/null and b/graphics/pokemon/zygarde/10_percent/overworld.png differ diff --git a/graphics/pokemon/zygarde/10_percent/overworld_normal.pal b/graphics/pokemon/zygarde/10_percent/overworld_normal.pal new file mode 100644 index 0000000000..d084071aa5 --- /dev/null +++ b/graphics/pokemon/zygarde/10_percent/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +0 0 0 +82 97 80 +55 65 54 +12 45 2 +21 26 21 +222 253 213 +138 217 32 +24 82 33 +41 49 40 +67 155 30 +21 26 21 +254 141 141 +41 49 40 +254 82 82 +0 0 0 diff --git a/graphics/pokemon/zygarde/10_percent/overworld_shiny.pal b/graphics/pokemon/zygarde/10_percent/overworld_shiny.pal new file mode 100644 index 0000000000..5ea188226b --- /dev/null +++ b/graphics/pokemon/zygarde/10_percent/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +29 29 29 +222 222 216 +162 162 152 +23 47 41 +29 29 29 +116 248 213 +68 216 176 +40 117 95 +29 29 29 +54 154 127 +0 0 0 +254 141 141 +136 136 136 +254 82 82 +0 0 0 diff --git a/graphics/pokemon/zygarde/complete/overworld.png b/graphics/pokemon/zygarde/complete/overworld.png new file mode 100644 index 0000000000..6b7303c36e Binary files /dev/null and b/graphics/pokemon/zygarde/complete/overworld.png differ diff --git a/graphics/pokemon/zygarde/complete/overworld_normal.pal b/graphics/pokemon/zygarde/complete/overworld_normal.pal new file mode 100644 index 0000000000..c70f440e11 --- /dev/null +++ b/graphics/pokemon/zygarde/complete/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +46 45 45 +8 8 8 +89 89 83 +25 22 22 +176 216 88 +59 58 58 +248 248 248 +120 144 64 +122 122 115 +16 15 15 +80 152 216 +232 64 88 +232 176 64 +144 208 248 +41 49 22 diff --git a/graphics/pokemon/zygarde/complete/overworld_shiny.pal b/graphics/pokemon/zygarde/complete/overworld_shiny.pal new file mode 100644 index 0000000000..9f9a249ea7 --- /dev/null +++ b/graphics/pokemon/zygarde/complete/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +86 84 84 +8 8 8 +197 197 187 +61 61 61 +90 194 166 +135 134 134 +248 248 248 +69 139 120 +235 235 230 +135 134 134 +80 152 216 +232 64 88 +232 176 64 +144 208 248 +23 47 41 diff --git a/include/battle.h b/include/battle.h index 7ccbcfbfe4..f1628ddd9b 100644 --- a/include/battle.h +++ b/include/battle.h @@ -93,7 +93,7 @@ struct ResourceFlags #define RESOURCE_FLAG_ROOST 0x2 #define RESOURCE_FLAG_UNBURDEN 0x4 #define RESOURCE_FLAG_UNUSED 0x8 -#define RESOURCE_FLAG_TRACED 0x10 +#define RESOURCE_FLAG_UNUSED_2 0x10 #define RESOURCE_FLAG_EMERGENCY_EXIT 0x20 #define RESOURCE_FLAG_NEUTRALIZING_GAS 0x40 #define RESOURCE_FLAG_ICE_FACE 0x80 @@ -184,9 +184,9 @@ struct ProtectStruct u32 powderSelfDmg:1; u32 usedThroatChopPreventedMove:1; u32 statRaised:1; - u32 usedMicleBerry:1; u32 usedCustapBerry:1; // also quick claw u32 touchedProtectLike:1; + u32 unused:1; // End of 32-bit bitfield u16 disableEjectPack:1; u16 statFell:1; @@ -366,11 +366,12 @@ struct AiLogicData u8 effectiveness[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex u8 moveAccuracy[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex u8 moveLimitations[MAX_BATTLERS_COUNT]; - bool8 shouldSwitchMon; // Because all available moves have no/little effect. Each bit per battler. + u8 shouldSwitchIfBadMoves; // Because all available moves have no/little effect. Each bit per battler. u8 monToSwitchId[MAX_BATTLERS_COUNT]; // ID of the mon to switch. bool8 weatherHasEffect; // The same as WEATHER_HAS_EFFECT. Stored here, so it's called only once. u8 mostSuitableMonId[MAX_BATTLERS_COUNT]; // Stores result of GetMostSuitableMonToSwitchInto, which decides which generic mon the AI would switch into if they decide to switch. This can be overruled by specific mons found in ShouldSwitch; the final resulting mon is stored in AI_monToSwitchIntoId. struct SwitchinCandidate switchinCandidate; // Struct used for deciding which mon to switch to in battle_ai_switch_items.c + u8 shouldSwitch; // Stores result of ShouldSwitch, which decides whether a mon should be switched out }; struct AI_ThinkingStruct @@ -768,6 +769,7 @@ struct BattleStruct u8 blunderPolicy:1; // should blunder policy activate u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky u8 bouncedMoveIsUsed:1; + u8 snatchedMoveIsUsed:1; u8 descriptionSubmenu:1; // For Move Description window in move selection screen u8 ackBallUseBtn:1; // Used for the last used ball feature u8 ballSwapped:1; // Used for the last used ball feature @@ -819,6 +821,7 @@ struct BattleStruct u32 stellarBoostFlags[NUM_BATTLE_SIDES]; // stored as a bitfield of flags for all types for each side u8 fickleBeamBoosted:1; u8 obedienceResult:3; + u8 usedMicleBerry; }; // The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider, diff --git a/include/battle_scripts.h b/include/battle_scripts.h index fb1e72af24..84c1b70cf4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -166,7 +166,6 @@ extern const u8 BattleScript_ItemSteal[]; extern const u8 BattleScript_DrizzleActivates[]; extern const u8 BattleScript_SpeedBoostActivates[]; extern const u8 BattleScript_TraceActivates[]; -extern const u8 BattleScript_TraceActivatesEnd3[]; extern const u8 BattleScript_RainDishActivates[]; extern const u8 BattleScript_SandstreamActivates[]; extern const u8 BattleScript_ShedSkinActivates[]; @@ -329,6 +328,7 @@ extern const u8 BattleScript_ProteanActivates[]; extern const u8 BattleScript_DazzlingProtected[]; extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; extern const u8 BattleScript_MoveUsedPowder[]; +extern const u8 BattleScript_ZMoveActivatePowder[]; extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[]; extern const u8 BattleScript_SelectingNotAllowedStuffCheeksInPalace[]; extern const u8 BattleScript_SelectingNotAllowedBelch[]; @@ -459,6 +459,7 @@ extern const u8 BattleScript_DefDownSpeedUp[]; extern const u8 BattleScript_AffectionBasedStatusHeal[]; extern const u8 BattleScript_AffectionBasedEndurance[]; extern const u8 BattleScript_SymbiosisActivates[]; +extern const u8 BattleScript_ScaleShot[]; extern const u8 BattleScript_MultiHitPrintStrings[]; extern const u8 BattleScript_RemoveFireType[]; extern const u8 BattleScript_TargetAbilityStatRaiseRet[]; diff --git a/include/battle_util.h b/include/battle_util.h index 82f49da525..c4727d8a12 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -256,7 +256,7 @@ bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect); bool32 MoveHasAdditionalEffectSelfArg(u32 move, u32 moveEffect, u32 argument); bool32 MoveHasChargeTurnAdditionalEffect(u32 move); bool32 CanTargetPartner(u32 battlerAtk, u32 battlerDef); -bool32 TargetFullyImmuneToCurrMove(u32 BattlerAtk, u32 battlerDef); +bool32 TargetFullyImmuneToCurrMove(u32 battlerAtk, u32 battlerDef); bool32 CanBeSlept(u32 battler, u32 ability); bool32 CanBePoisoned(u32 battlerAtk, u32 battlerDef, u32 defAbility); diff --git a/include/level_caps.h b/include/caps.h similarity index 68% rename from include/level_caps.h rename to include/caps.h index c455408079..f6dd61b632 100644 --- a/include/level_caps.h +++ b/include/caps.h @@ -1,5 +1,5 @@ -#ifndef GUARD_LEVEL_CAP_H -#define GUARD_LEVEL_CAP_H +#ifndef GUARD_CAPS_H +#define GUARD_CAPS_H #if B_EXP_CAP_TYPE != EXP_CAP_NONE && B_EXP_CAP_TYPE != EXP_CAP_HARD && B_EXP_CAP_TYPE != EXP_CAP_SOFT #error "Invalid choice for B_EXP_CAP_TYPE, must be of [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT]" @@ -14,7 +14,12 @@ #endif #endif +#if B_EV_CAP_TYPE != EV_CAP_NONE && B_EV_CAP_TYPE != EV_CAP_FLAG_LIST && B_EV_CAP_TYPE != EV_CAP_VARIABLE && B_EV_CAP_TYPE != EV_CAP_NO_GAIN +#error "Invalid choice for B_EV_CAP_TYPE, must be one of [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN]" +#endif + u32 GetCurrentLevelCap(void); u32 GetSoftLevelCapExpValue(u32 level, u32 expValue); +u32 GetCurrentEVCap(void); -#endif /* GUARD_LEVEL_CAP_H */ +#endif /* GUARD_CAPS_H */ diff --git a/include/config/battle.h b/include/config/battle.h index a60d9cdd9b..d280ff12b3 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -121,6 +121,9 @@ #define B_KNOCK_OFF_REMOVAL GEN_LATEST // In Gen5+, Knock Off removes the foe's item instead of rendering it unusable. #define B_HEAL_BELL_SOUNDPROOF GEN_LATEST // In Gen5, Heal Bell affects all mons with Soundproof. In Gen6-8 it affects inactive mons, but not battlers. In Gen9 it always affects the user. #define B_CHARGE GEN_LATEST // In Gen8-, Charge status is lost regardless of the typing of the next move. +#define B_POWDER_RAIN GEN_LATEST // In Gen7+, Powder doesn't damage the user of a Fire type move in heavy rain. +#define B_AFTER_YOU_TURN_ORDER GEN_LATEST // In Gen8+, After You doesn't fail if the turn order wouldn't change after use. +#define B_QUASH_TURN_ORDER GEN_LATEST // In Gen8+, Quash-affected battlers move according to speed order. Before Gen8, Quash-affected battlers move in the order they were affected by Quash. // Ability settings #define B_ABILITY_WEATHER GEN_LATEST // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability. @@ -162,7 +165,7 @@ #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. -#define B_DIVE_BALL_MODIFIER GEN_LATEST // In Gen4+, Dive Ball's effectiveness increases by when Surfing or Fishing. +#define B_DIVE_BALL_MODIFIER GEN_LATEST // In Gen4+, Dive Ball's effectiveness increases by x3.5 when Surfing or Fishing. #define B_NEST_BALL_MODIFIER GEN_LATEST // Nest Ball's formula varies depending on the Gen. See Cmd_handleballthrow. #define B_REPEAT_BALL_MODIFIER GEN_LATEST // In Gen7+, Repeat Ball's catch multiplier is x3.5 instead of x3. #define B_TIMER_BALL_MODIFIER GEN_LATEST // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1 diff --git a/include/config/level_caps.h b/include/config/caps.h similarity index 55% rename from include/config/level_caps.h rename to include/config/caps.h index e8d7b8818e..2debe442cf 100644 --- a/include/config/level_caps.h +++ b/include/config/caps.h @@ -1,7 +1,7 @@ -#ifndef GUARD_CONFIG_LEVEL_CAP_H -#define GUARD_CONFIG_LEVEL_CAP_H +#ifndef GUARD_CONFIG_CAPS_H +#define GUARD_CONFIG_CAPS_H -// Constants +// Level Cap Constants #define EXP_CAP_NONE 0 // Regular behavior, no level caps are applied #define EXP_CAP_HARD 1 // Pokémon with a level >= the level cap cannot gain any experience #define EXP_CAP_SOFT 2 // Pokémon with a level >= the level cap will gain reduced experience @@ -10,7 +10,7 @@ #define LEVEL_CAP_FLAG_LIST 1 // Level cap is chosen according to the first unset flag in `sLevelCapFlagMap` #define LEVEL_CAP_VARIABLE 2 // Level cap is chosen according to the contents of the event variable specified by B_LEVEL_CAP_VARIABLE -// Configs +// Level Cap Configs #define B_EXP_CAP_TYPE EXP_CAP_NONE // [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT] choose the type of level cap to apply #define B_LEVEL_CAP_TYPE LEVEL_CAP_NONE // [LEVEL_CAP_NONE, LEVEL_CAP_FLAG_LIST, LEVEL_CAP_VARIABLE] choose the method to derive the level cap #define B_LEVEL_CAP_VARIABLE 0 // event variable used to derive level cap if B_LEVEL_CAP_TYPE is set to LEVEL_CAP_VARIABLE @@ -18,4 +18,16 @@ #define B_RARE_CANDY_CAP FALSE // If set to true, Rare Candies can't be used to go over the level cap #define B_LEVEL_CAP_EXP_UP FALSE // If set to true, mons under level cap will receive more experience -#endif /* GUARD_CONFIG_LEVEL_CAP_H */ +// EV Cap Constants +#define EV_CAP_NONE 0 // Regular behavior, no EV caps are applied +#define EV_CAP_FLAG_LIST 1 // EV cap is chosen according to the first unset flag in `sEVCapFlagMap` +#define EV_CAP_VARIABLE 2 // EV cap is chosen according to the contents of the event variable specified by B_EV_CAP_VARIABLE +#define EV_CAP_NO_GAIN 3 // No EVs can be gained + +// EV Cap Configs +#define B_EV_CAP_TYPE EV_CAP_NONE // [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN] choose the type of EV cap to apply#define B_EV_CAP_VARIABLE 12 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE +#define B_EV_CAP_VARIABLE 8 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE + +#define B_EV_ITEMS_CAP FALSE // If set to true, EV-boosting items can't be used to go over the EV cap + +#endif /* GUARD_CONFIG_CAPS_H */ diff --git a/include/config/ev_caps.h b/include/config/ev_caps.h deleted file mode 100644 index 0513ff086e..0000000000 --- a/include/config/ev_caps.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef GUARD_CONFIG_EV_CAP_H -#define GUARD_CONFIG_EV_CAP_H - -// Constants for EV Cap Types -#define EV_CAP_NONE 0 // Regular behavior, no EV caps are applied -#define EV_CAP_FLAG_LIST 1 // EV cap is chosen according to the first unset flag in `sEVCapFlagMap` -#define EV_CAP_VARIABLE 2 // EV cap is chosen according to the contents of the event variable specified by B_EV_CAP_VARIABLE -#define EV_CAP_NO_GAIN 3 // No EVs can be gained - -// Configs for EV Cap -#define B_EV_CAP_TYPE EV_CAP_NONE // [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN] choose the type of EV cap to apply#define B_EV_CAP_VARIABLE 12 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE -#define B_EV_CAP_VARIABLE 8 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE - -#define B_EV_ITEMS_CAP FALSE // If set to true, EV-boosting items can't be used to go over the EV cap - -#endif /*GUARD_CONFIG_EV_CAP_H*/ diff --git a/include/config/general.h b/include/config/general.h index ac338a1f50..cff1432bb7 100644 --- a/include/config/general.h +++ b/include/config/general.h @@ -86,4 +86,5 @@ // Naming Screen #define AUTO_LOWERCASE_KEYBOARD GEN_LATEST // Starting in GEN_6, after entering the first uppercase character, the keyboard switches to lowercase letters. +#define SAVE_TYPE_ERROR_SCREEN FALSE // When enabled, this shows an error message when the game is loaded on a cart without a flash chip or on an emulator with the wrong save type setting instead of crashing. #endif // GUARD_CONFIG_GENERAL_H diff --git a/include/config/overworld.h b/include/config/overworld.h index ce4852e9e7..7439ebc5ad 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -52,6 +52,7 @@ // Compressed gfx are incompatible with non-power-of-two sprite sizes: // (You should not use 48x48 sprites/tables for compressed gfx) // 16x32, 32x32, 64x64 etc are fine +#define OW_MON_WANDER_WALK TRUE // If true, OW pokemon with MOVEMENT_TYPE_WANDER will walk-in-place in between steps. // Follower Pokémon #define OW_FOLLOWERS_ENABLED FALSE // Enables follower Pokémon, HGSS style. Requires OW_POKEMON_OBJECT_EVENTS. Note that additional scripting may be required for them to be fully supported! #define OW_FOLLOWERS_BOBBING TRUE // If true, follower pokemon will bob up and down during their idle & walking animations @@ -88,7 +89,7 @@ // Map pop-up config #define OW_POPUP_GENERATION GEN_3 // Different generations display location names in overworld pop-ups differently. - // Only choies are currently GEN_3 and GEN_5, all others will default to Gen3 pop-ups. + // Only choices are currently GEN_3 and GEN_5, all others will default to Gen3 pop-ups. // Gen5 map pop-up config // Constants diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 07853a69a8..8891ab27fb 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -281,6 +281,9 @@ #define OW_SPECIES(x) (((x)->graphicsId & OBJ_EVENT_GFX_SPECIES_MASK) - OBJ_EVENT_GFX_MON_BASE) #define OW_FORM(x) ((x)->graphicsId >> OBJ_EVENT_GFX_SPECIES_BITS) +// Whether Object Event is an OW pokemon +#define IS_OW_MON_OBJ(obj) ((obj)->graphicsId >= OBJ_EVENT_GFX_MON_BASE) + #define SHADOW_SIZE_S 0 #define SHADOW_SIZE_M 1 #define SHADOW_SIZE_L 2 diff --git a/include/constants/global.h b/include/constants/global.h index a4623c9d8b..89508e374d 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -5,10 +5,9 @@ #include "config/battle.h" #include "config/debug.h" #include "config/item.h" -#include "config/level_caps.h" +#include "config/caps.h" #include "config/pokemon.h" #include "config/overworld.h" -#include "config/ev_caps.h" // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 0f364d2462..a159102932 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -155,11 +155,12 @@ // Gen9 hold effects #define HOLD_EFFECT_ABILITY_SHIELD 175 #define HOLD_EFFECT_CLEAR_AMULET 176 -#define HOLD_EFFECT_MIRROR_HERB 177 // Not implemented. +#define HOLD_EFFECT_MIRROR_HERB 177 #define HOLD_EFFECT_PUNCHING_GLOVE 178 #define HOLD_EFFECT_COVERT_CLOAK 179 #define HOLD_EFFECT_LOADED_DICE 180 -#define HOLD_EFFECT_BOOSTER_ENERGY 181 // Not implemented. +#define HOLD_EFFECT_BOOSTER_ENERGY 181 +#define HOLD_EFFECT_OGERPON_MASK 182 // Gen2 hold effect #define HOLD_EFFECT_BERSERK_GENE 184 diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 73786bb3c3..f5a8f38506 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -236,10 +236,10 @@ #define MB_WIRELESS_BOX_RESULTS 0xE8 #define MB_TRAINER_HILL_TIMER 0xE9 #define MB_SKY_PILLAR_CLOSED_DOOR 0xEA -#define MB_UNUSED_EB 0xEB -#define MB_UNUSED_EC 0xEC -#define MB_UNUSED_ED 0xED -#define MB_UNUSED_EE 0xEE +#define MB_UP_RIGHT_STAIR_WARP 0xEB +#define MB_UP_LEFT_STAIR_WARP 0xEC +#define MB_DOWN_RIGHT_STAIR_WARP 0xED +#define MB_DOWN_LEFT_STAIR_WARP 0xEE #define MB_UNUSED_EF 0xEF #define NUM_METATILE_BEHAVIORS 0xF0 diff --git a/include/ev_caps.h b/include/ev_caps.h deleted file mode 100644 index 2b2dd0b02b..0000000000 --- a/include/ev_caps.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GUARD_EV_CAP_H -#define GUARD_EV_CAP_H - -#if B_EV_CAP_TYPE != EV_CAP_NONE && B_EV_CAP_TYPE != EV_CAP_FLAG_LIST && B_EV_CAP_TYPE != EV_CAP_VARIABLE && B_EV_CAP_TYPE != EV_CAP_NO_GAIN -#error "Invalid choice for B_EV_CAP_TYPE, must be one of [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN]" -#endif - -u32 GetCurrentEVCap(void); - -#endif /* GUARD_EV_CAP_H */ diff --git a/include/event_object_movement.h b/include/event_object_movement.h index ff90b8a1c0..22993cddd9 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -113,6 +113,7 @@ extern const struct OamData gObjectEventBaseOam_64x64; extern const struct SubspriteTable sOamTables_32x32[]; extern const struct SubspriteTable sOamTables_64x64[]; extern const union AnimCmd *const sAnimTable_Following[]; +extern const union AnimCmd *const sAnimTable_Following_Asym[]; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; extern const u8 gReflectionEffectPaletteMap[]; @@ -309,7 +310,7 @@ u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority); u8 MovementType_WanderAround_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_WanderAround_Step3(struct ObjectEvent *, struct Sprite *); +u8 MovementType_Wander_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step6(struct ObjectEvent *, struct Sprite *); @@ -332,14 +333,12 @@ u8 MovementType_LookAround_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_WanderUpAndDown_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step6(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_WanderLeftAndRight_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step6(struct ObjectEvent *, struct Sprite *); diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index 9b3aa6229e..3f120ffdeb 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -42,5 +42,7 @@ void DoOrbEffect(void); void FadeOutOrbEffect(void); void WriteFlashScanlineEffectBuffer(u8 flashLevel); bool8 IsPlayerStandingStill(void); +void DoStairWarp(u16 metatileBehavior, u16 delay); +bool32 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection); #endif // GUARD_FIELD_SCREEN_EFFECT_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index cc331d502f..a9b859209b 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -298,7 +298,7 @@ enum COLLISION_ISOLATED_HORIZONTAL_RAIL, COLLISION_VERTICAL_RAIL, COLLISION_HORIZONTAL_RAIL, - //sideways_stairs + COLLISION_STAIR_WARP, COLLISION_SIDEWAYS_STAIRS_TO_RIGHT, COLLISION_SIDEWAYS_STAIRS_TO_LEFT }; diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 2fd374a186..58eb83ea7b 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -148,9 +148,14 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); -bool32 MetatileBehavior_IsSignpost(u32); -bool32 MetatileBehavior_IsPokemonCenterSign(u32); -bool32 MetatileBehavior_IsPokeMartSign(u32); +bool8 MetatileBehavior_IsDirectionalUpRightStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalUpLeftStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalDownRightStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalDownLeftStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsSignpost(u32); +bool8 MetatileBehavior_IsPokemonCenterSign(u32); +bool8 MetatileBehavior_IsPokeMartSign(u32); bool8 MetatileBehavior_IsRockStairs(u8); bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8); bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8); diff --git a/include/overworld.h b/include/overworld.h index 3e9dbc30b6..28a4aa9277 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -51,6 +51,7 @@ extern void (*gFieldCallback)(void); extern bool8 (*gFieldCallback2)(void); extern u8 gLocalLinkPlayerId; extern u8 gFieldLinkPlayerCount; +extern bool8 gExitStairsMovementDisabled; extern const struct UCoords32 gDirectionToVectors[]; diff --git a/include/random.h b/include/random.h index b5ce987f39..6e210bcbb4 100644 --- a/include/random.h +++ b/include/random.h @@ -161,7 +161,8 @@ enum RandomTag RNG_TRACE, RNG_FICKLE_BEAM, RNG_AI_ABILITY, - RNG_AI_HASBADODDS, + RNG_AI_SWITCH_HASBADODDS, + RNG_AI_SWITCH_WONDER_GUARD, RNG_SHELL_SIDE_ARM, }; diff --git a/migration_scripts/README.md b/migration_scripts/README.md index 5ae26c1c0a..5ff925d8ef 100644 --- a/migration_scripts/README.md +++ b/migration_scripts/README.md @@ -11,7 +11,7 @@ These scripts exist to help developers make the transition between refactored sy All migration scripts require [`python3`](https://www.python.org/downloads/) to be installed. Migration scripts are executed by running the following commands from the root directory of a developer's project. ```bash -chmod +x migration_scripts/*.py ; #give permision to make the script executable +chmod +x migration_scripts/*.py ; #give permission to make the script executable python3 migration_scripts/*.py ; #run the migration script ``` diff --git a/spritesheet_rules.mk b/spritesheet_rules.mk index e97b1b5ffe..7855bf8d21 100644 --- a/spritesheet_rules.mk +++ b/spritesheet_rules.mk @@ -4413,6 +4413,60 @@ $(POKEMONGFXDIR)/tauros/paldean_combat_breed/overworld.4bpp: %.4bpp: %.png $(POKEMONGFXDIR)/ursaluna/bloodmoon/overworld.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 4 -mheight 4 +$(POKEMONGFXDIR)/shaymin/sky/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/oricorio/pom_pom/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/oricorio/pau/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/oricorio/sensu/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/zygarde/10_percent/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/zygarde/complete/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/magearna/original_color/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/kyurem/white/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/kyurem/black/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/tornadus/therian/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 8 -mheight 8 + +$(POKEMONGFXDIR)/thundurus/therian/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 8 -mheight 8 + +$(POKEMONGFXDIR)/landorus/therian/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/pumpkaboo/small/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/pumpkaboo/large/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/pumpkaboo/super/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/gourgeist/small/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/gourgeist/large/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/gourgeist/super/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + $(MISCGFXDIR)/emotes.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 2 -mheight 2 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index af6557e967..acc13a7378 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -504,12 +504,12 @@ static bool32 AI_SwitchMonIfSuitable(u32 battler, bool32 doubleBattle) if (doubleBattle) { u32 partner = BATTLE_PARTNER(battler); - if (AI_DATA->shouldSwitchMon & (1u << partner) && AI_DATA->monToSwitchId[partner] == monToSwitchId) + if (AI_DATA->shouldSwitchIfBadMoves & (1u << partner) && AI_DATA->monToSwitchId[partner] == monToSwitchId) { return FALSE; } } - AI_DATA->shouldSwitchMon |= 1 << battler; + AI_DATA->shouldSwitchIfBadMoves |= 1 << battler; AI_DATA->monToSwitchId[battler] = monToSwitchId; return TRUE; } @@ -3679,7 +3679,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) } break; case EFFECT_BATON_PASS: - if (ShouldSwitch(battlerAtk, FALSE) && (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE + if ((AI_DATA->shouldSwitch & (1u << battlerAtk)) && (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE || (gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_AQUA_RING | STATUS3_MAGNET_RISE | STATUS3_POWER_TRICK)) || AnyStatIsRaised(battlerAtk))) ADJUST_SCORE(BEST_EFFECT); @@ -4090,7 +4090,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(DECENT_EFFECT); // Force 'em out next turn break; default: - if (gMovesInfo[gCurrentMove].effect != EFFECT_BESTOW && aiData->items[battlerAtk] == ITEM_NONE) + if (gMovesInfo[move].effect != EFFECT_BESTOW && aiData->items[battlerAtk] == ITEM_NONE && aiData->items[battlerDef] != ITEM_NONE) { switch (aiData->holdEffects[battlerDef]) { diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index c33878465a..3f13a8c3f4 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -180,7 +180,7 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) && gBattleMons[battler].hp >= gBattleMons[battler].maxHP / 4))) { // 50% chance to stay in regardless - if (!RandomPercentage(RNG_AI_HASBADODDS, 50)) + if (!RandomPercentage(RNG_AI_SWITCH_HASBADODDS, 50)) return FALSE; // Switch mon out @@ -203,7 +203,7 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) return FALSE; // 50% chance to stay in regardless - if (!RandomPercentage(RNG_AI_HASBADODDS, 50)) + if (!RandomPercentage(RNG_AI_SWITCH_HASBADODDS, 50)) return FALSE; // Switch mon out @@ -218,9 +218,9 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) static bool32 ShouldSwitchIfAllBadMoves(u32 battler, bool32 emitResult) { - if (AI_DATA->shouldSwitchMon & (1u << battler)) + if (AI_DATA->shouldSwitchIfBadMoves & (1u << battler)) { - AI_DATA->shouldSwitchMon &= ~(1u << battler); + AI_DATA->shouldSwitchIfBadMoves &= ~(1u << battler); gBattleStruct->AI_monToSwitchIntoId[battler] = AI_DATA->monToSwitchId[battler]; if (emitResult) BtlController_EmitTwoReturnValues(battler, BUFFER_B, B_ACTION_SWITCH, 0); @@ -284,7 +284,7 @@ static bool32 ShouldSwitchIfWonderGuard(u32 battler, bool32 emitResult) move = GetMonData(&party[i], MON_DATA_MOVE1 + j); if (move != MOVE_NONE) { - if (AI_GetTypeEffectiveness(move, battler, opposingBattler) >= UQ_4_12(2.0) && Random() % 3 < 2) + if (AI_GetTypeEffectiveness(move, battler, opposingBattler) >= UQ_4_12(2.0) && (RandomPercentage(RNG_AI_SWITCH_WONDER_GUARD, 66) || ((AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_SMART_SWITCHING)))) { // We found a mon. gBattleStruct->AI_monToSwitchIntoId[battler] = i; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 3f08ace393..14f5c44ffc 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2699,10 +2699,8 @@ enum { bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 moveIndex) { bool32 hasStatBoost = AnyUsefulStatIsRaised(battlerAtk) || gBattleMons[battlerDef].statStages[STAT_EVASION] >= 9; //Significant boost in evasion for any class - bool32 shouldSwitch; u32 battlerToSwitch; - shouldSwitch = ShouldSwitch(battlerAtk, FALSE); battlerToSwitch = gBattleStruct->AI_monToSwitchIntoId[battlerAtk]; if (PartyBattlerShouldAvoidHazards(battlerAtk, battlerToSwitch)) @@ -2727,7 +2725,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 if (CanTargetFaintAi(battlerDef, battlerAtk)) return PIVOT; // Won't get the two turns, pivot - if (!IS_MOVE_STATUS(move) && (shouldSwitch + if (!IS_MOVE_STATUS(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) || (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH || (B_STURDY >= GEN_5 && defAbility == ABILITY_STURDY) || defAbility == ABILITY_MULTISCALE @@ -2742,7 +2740,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 || defAbility == ABILITY_SHADOW_SHIELD))) return PIVOT; // pivot to break sash/sturdy/multiscale - if (shouldSwitch) + if (AI_DATA->shouldSwitch & (1u << battlerAtk)) return PIVOT; /* TODO - check if switchable mon unafffected by/will remove hazards @@ -2813,7 +2811,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 else if (CanAIFaintTarget(battlerAtk, battlerDef, 2)) { // can knock out foe in 2 hits - if (IS_MOVE_STATUS(move) && (shouldSwitch //Damaging move + if (IS_MOVE_STATUS(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) //Damaging move //&& (switchScore >= SWITCHING_INCREASE_RESIST_ALL_MOVES + SWITCHING_INCREASE_KO_FOE //remove hazards || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)))) return DONT_PIVOT; // Pivot to break the sash diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 8c2d73ff80..1530fa37a5 100644 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2389,6 +2389,88 @@ void AnimTask_SwallowDeformMon(u8 taskId) } } +void AnimTask_HideSwapSprite(u8 taskId) +{ + int i, j; + u8 position; + struct BattleAnimBgData animBg; + u8 *dest; + u8 *src; + u16 *bgTilemap; + + u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker]; + + switch (gTasks[taskId].data[0]) + { + case 0: + gTasks[taskId].data[11] = gSprites[spriteId].x; // Save battler position + gSprites[spriteId].x = -64; // hide it from screen to avoid the blip/glitch effect when swapping the sprite. + gTasks[taskId].data[10] = gBattleAnimArgs[0]; + gTasks[taskId].data[0]++; + break; + case 1: + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gBattleAnimArgs[1]); + GetBgDataForTransform(&animBg, gBattleAnimAttacker); + + if (IsContest()) + position = 0; + else + position = GetBattlerPosition(gBattleAnimAttacker); + + src = gMonSpritesGfxPtr->spritesGfx[position]; + dest = animBg.bgTiles; + CpuCopy32(src, dest, MON_PIC_SIZE); + LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); + if (IsContest()) + { + if (IsSpeciesNotUnown(gContestResources->moveAnim->species) != IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies)) + { + bgTilemap = (u16 *)animBg.bgTilemap; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + u16 temp = bgTilemap[j + i * 0x20]; + bgTilemap[j + i * 0x20] = bgTilemap[(7 - j) + i * 0x20]; + bgTilemap[(7 - j) + i * 0x20] = temp; + } + } + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + bgTilemap[j + i * 0x20] ^= 0x400; + } + } + } + + if (IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies)) + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest; + else + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteOpponentSide; + + StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], BATTLER_AFFINE_NORMAL); + } + + gTasks[taskId].data[0]++; + break; + case 2: + gSprites[spriteId].x = gTasks[taskId].data[11]; // restores battler position + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + { + if (gTasks[taskId].data[10] == 0) + SetBattlerShadowSpriteCallback(gBattleAnimAttacker, gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies); + } + } + + DestroyAnimVisualTask(taskId); + break; + } +} + void AnimTask_TransformMon(u8 taskId) { int i, j; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index afff143266..cc5454ad54 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -41,7 +41,7 @@ #include "constants/songs.h" #include "constants/trainers.h" #include "constants/rgb.h" -#include "level_caps.h" +#include "caps.h" #include "menu.h" #include "pokemon_summary_screen.h" #include "type_icons.h" diff --git a/src/battle_controllers.c b/src/battle_controllers.c index c5d6e3ebdd..56a1b8e92f 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -2903,7 +2903,7 @@ void BtlController_HandleIntroTrainerBallThrow(u32 battler, u16 tagTrainerPal, c if (side == B_SIDE_PLAYER) { StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[battler]], SpriteCB_FreePlayerSpriteLoadMonSprite); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 1); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], ShouldDoSlideInAnim() ? 2 : 1); paletteNum = AllocSpritePalette(tagTrainerPal); LoadCompressedPalette(trainerPal, OBJ_PLTT_ID(paletteNum), PLTT_SIZE_4BPP); diff --git a/src/battle_debug.c b/src/battle_debug.c index a5421a932b..b03ef194f0 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -2430,6 +2430,7 @@ static const u8 sText_HoldEffectCovertCloak[] = _("Covert Cloak"); static const u8 sText_HoldEffectLoadedDice[] = _("Loaded Dice"); static const u8 sText_HoldEffectBoosterEnergy[] = _("Booster Energy"); static const u8 sText_HoldEffectBerserkGene[] = _("Berserk Gene"); +static const u8 sText_HoldEffectOgerponMask[] = _("Ogerpon Mask"); static const u8 *const sHoldEffectNames[] = { [HOLD_EFFECT_NONE] = sText_HoldEffectNone, @@ -2580,6 +2581,7 @@ static const u8 *const sHoldEffectNames[] = [HOLD_EFFECT_LOADED_DICE] = sText_HoldEffectLoadedDice, [HOLD_EFFECT_BOOSTER_ENERGY] = sText_HoldEffectBoosterEnergy, [HOLD_EFFECT_BERSERK_GENE] = sText_HoldEffectBerserkGene, + [HOLD_EFFECT_OGERPON_MASK] = sText_HoldEffectOgerponMask, }; static const u8 *GetHoldEffectName(u16 holdEffect) { diff --git a/src/battle_interface.c b/src/battle_interface.c index 4c17322b53..5c514a0d80 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -33,7 +33,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/items.h" -#include "level_caps.h" +#include "caps.h" enum { // Corresponds to gHealthboxElementsGfxTable (and the tables after it) in graphics.c diff --git a/src/battle_main.c b/src/battle_main.c index c7f6eeafda..92e1618fc7 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -44,6 +44,7 @@ #include "roamer.h" #include "safari_zone.h" #include "scanline_effect.h" +#include "script.h" #include "sound.h" #include "sprite.h" #include "string_util.h" @@ -4177,6 +4178,8 @@ static void HandleTurnActionSelectionState(void) if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) && (BattlerHasAi(battler) && !(gBattleTypeFlags & BATTLE_TYPE_PALACE))) { + if (ShouldSwitch(battler, FALSE)) + AI_DATA->shouldSwitch |= (1u << battler); if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_RISKY) // Risky AI switches aggressively even mid battle AI_DATA->mostSuitableMonId[battler] = GetMostSuitableMonToSwitchInto(battler, TRUE); else @@ -5184,15 +5187,15 @@ static bool32 TryDoMoveEffectsBeforeMoves(void) { gBattleStruct->focusPunchBattlers |= 1u << battlers[i]; gBattlerAttacker = battlers[i]; - switch (gChosenMoveByBattler[gBattlerAttacker]) + switch (gMovesInfo[gChosenMoveByBattler[gBattlerAttacker]].effect) { - case MOVE_FOCUS_PUNCH: + case EFFECT_FOCUS_PUNCH: BattleScriptExecute(BattleScript_FocusPunchSetUp); return TRUE; - case MOVE_BEAK_BLAST: + case EFFECT_BEAK_BLAST: BattleScriptExecute(BattleScript_BeakBlastSetUp); return TRUE; - case MOVE_SHELL_TRAP: + case EFFECT_SHELL_TRAP: BattleScriptExecute(BattleScript_ShellTrapSetUp); return TRUE; } @@ -6017,21 +6020,20 @@ void SetTypeBeforeUsingMove(u32 move, u32 battler) } } -// special to set a field's totem boost(s) -// inputs: -// var8000: battler -// var8001 - var8007: stat changes -void SetTotemBoost(void) +// Queues stat boosts for a given battler for totem battles +void ScriptSetTotemBoost(struct ScriptContext *ctx) { - u32 battler = gSpecialVar_0x8000; + u32 battler = VarGet(ScriptReadHalfword(ctx)); + u32 stat; u32 i; for (i = 0; i < (NUM_BATTLE_STATS - 1); i++) { - if (*(&gSpecialVar_0x8001 + i)) + stat = VarGet(ScriptReadHalfword(ctx)); + if (stat) { gQueuedStatBoosts[battler].stats |= (1 << i); - gQueuedStatBoosts[battler].statChanges[i] = *(&gSpecialVar_0x8001 + i); + gQueuedStatBoosts[battler].statChanges[i] = stat; gQueuedStatBoosts[battler].stats |= 0x80; // used as a flag for the "totem flared to life" script } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 283f42a23b..8b65b76cd0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -27,7 +27,7 @@ #include "bg.h" #include "string_util.h" #include "pokemon_icon.h" -#include "level_caps.h" +#include "caps.h" #include "m4a.h" #include "mail.h" #include "event_data.h" @@ -1401,6 +1401,7 @@ static void Cmd_attackcanceler(void) if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gMovesInfo[gCurrentMove].snatchAffected) { gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; + gBattleStruct->snatchedMoveIsUsed = TRUE; gBattleScripting.battler = gBattlerByTurnOrder[i]; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SnatchedMove; @@ -1689,9 +1690,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u break; } - if (gProtectStructs[battlerAtk].usedMicleBerry) + if (gBattleStruct->usedMicleBerry & 1u << battlerAtk) { - gProtectStructs[battlerAtk].usedMicleBerry = FALSE; if (atkAbility == ABILITY_RIPEN) calc = (calc * 140) / 100; // ripen gives 40% acc boost else @@ -4675,7 +4675,8 @@ static void MoveValuesCleanUp(void) gIsCriticalHit = FALSE; gBattleScripting.moveEffect = 0; gBattleCommunication[MISS_TYPE] = 0; - gHitMarker &= ~HITMARKER_DESTINYBOND; + if (!gMultiHitCounter) + gHitMarker &= ~HITMARKER_DESTINYBOND; gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; } @@ -5437,7 +5438,9 @@ static void Cmd_moveend(void) case MOVEEND_PROTECT_LIKE_EFFECT: if (gProtectStructs[gBattlerAttacker].touchedProtectLike) { - if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + if (gProtectStructs[gBattlerTarget].spikyShielded + && gMovesInfo[gCurrentMove].effect != EFFECT_COUNTER + && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; @@ -6019,13 +6022,11 @@ static void Cmd_moveend(void) gBattleScripting.multihitString[4]++; if (gMultiHitCounter == 0) { - if (gMovesInfo[gCurrentMove].argument == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) - { - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; - } BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + if (gMovesInfo[gCurrentMove].argument == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) + gBattlescriptCurrInstr = BattleScript_ScaleShot; + else + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; effect = TRUE; } else @@ -6276,22 +6277,23 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_DANCER: // Special case because it's so annoying - if (gMovesInfo[gCurrentMove].danceMove) + if (gMovesInfo[gCurrentMove].danceMove && !gBattleStruct->snatchedMoveIsUsed) { u32 battler, nextDancer = 0; - bool32 turnOnHitmarker = FALSE; + bool32 hasDancerTriggered = FALSE; for (battler = 0; battler < gBattlersCount; battler++) { if (gSpecialStatuses[battler].dancerUsedMove) { // in case a battler fails to act on a Dancer-called move - turnOnHitmarker = TRUE; + hasDancerTriggered = TRUE; break; } } if (!(gMoveResultFlags & (MOVE_RESULT_FAILED | MOVE_RESULT_DOESNT_AFFECT_FOE) + || (gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE && !hasDancerTriggered) || (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove && gBattleStruct->bouncedMoveIsUsed))) { // Dance move succeeds // Set target for other Dancer mons; set bit so that mon cannot activate Dancer off of its own move @@ -6305,8 +6307,6 @@ static void Cmd_moveend(void) { if (GetBattlerAbility(battler) == ABILITY_DANCER && !gSpecialStatuses[battler].dancerUsedMove) { - if (turnOnHitmarker) - gHitMarker |= HITMARKER_ATTACKSTRING_PRINTED; if (!nextDancer || (gBattleMons[battler].speed < gBattleMons[nextDancer & 0x3].speed)) nextDancer = battler | 0x4; } @@ -6406,7 +6406,6 @@ static void Cmd_moveend(void) DebugPrintfLevel(MGBA_LOG_WARN, "savedTargetCount is greater than 0! More calls to SaveBattlerTarget than RestoreBattlerTarget!"); // #endif } - gBattleStruct->targetsDone[gBattlerAttacker] = 0; gProtectStructs[gBattlerAttacker].targetAffected = FALSE; gProtectStructs[gBattlerAttacker].shellTrap = FALSE; @@ -6422,11 +6421,13 @@ static void Cmd_moveend(void) gBattleStruct->swapDamageCategory = FALSE; gBattleStruct->categoryOverride = FALSE; gBattleStruct->bouncedMoveIsUsed = FALSE; + gBattleStruct->snatchedMoveIsUsed = FALSE; gBattleStruct->enduredDamage = 0; gBattleStruct->additionalEffectsCounter = 0; gBattleStruct->poisonPuppeteerConfusion = FALSE; gBattleStruct->fickleBeamBoosted = FALSE; gBattleStruct->distortedTypeMatchups = 0; + gBattleStruct->usedMicleBerry &= ~(1u << gBattlerAttacker); if (gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) gBattleStruct->pledgeMove = FALSE; if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE) @@ -8927,29 +8928,40 @@ static bool32 ChangeOrderTargetAfterAttacker(void) { u32 i; u8 data[MAX_BATTLERS_COUNT]; + u8 actionsData[MAX_BATTLERS_COUNT]; - if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) - || GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) + if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) return FALSE; + if (GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) + return B_AFTER_YOU_TURN_ORDER >= GEN_8; - for (i = 0; i < gBattlersCount; i++) + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { data[i] = gBattlerByTurnOrder[i]; + actionsData[i] = gActionsByTurnOrder[i]; + } if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 2) { gBattlerByTurnOrder[1] = gBattlerTarget; + gActionsByTurnOrder[1] = actionsData[2]; gBattlerByTurnOrder[2] = data[1]; - gBattlerByTurnOrder[3] = data[3]; + gActionsByTurnOrder[2] = actionsData[1]; } else if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 3) { gBattlerByTurnOrder[1] = gBattlerTarget; + gActionsByTurnOrder[1] = actionsData[3]; gBattlerByTurnOrder[2] = data[1]; + gActionsByTurnOrder[2] = actionsData[1]; gBattlerByTurnOrder[3] = data[2]; + gActionsByTurnOrder[3] = actionsData[2]; } else // Attacker == 1, Target == 3 { gBattlerByTurnOrder[2] = gBattlerTarget; + gActionsByTurnOrder[2] = actionsData[3]; gBattlerByTurnOrder[3] = data[2]; + gActionsByTurnOrder[3] = actionsData[2]; } return TRUE; } @@ -11403,7 +11415,7 @@ static void Cmd_stockpiletohpheal(void) const u8 *failInstr = cmd->failInstr; - if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) + if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0 && !gBattleStruct->snatchedMoveIsUsed) { gBattlescriptCurrInstr = failInstr; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED; @@ -11419,14 +11431,22 @@ static void Cmd_stockpiletohpheal(void) } else { - gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); + if (gDisableStructs[gBattlerAttacker].stockpileCounter > 0) + { + gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); + gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; + gBattleStruct->moveEffect2 = MOVE_EFFECT_STOCKPILE_WORE_OFF; + } + else // Snatched move + { + gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleScripting.animTurn = 1; + } if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; - - gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; - gBattleStruct->moveEffect2 = MOVE_EFFECT_STOCKPILE_WORE_OFF; + gBattlescriptCurrInstr = cmd->nextInstr; gBattlerTarget = gBattlerAttacker; } @@ -16059,7 +16079,7 @@ void ApplyExperienceMultipliers(s32 *expAmount, u8 expGetterMonId, u8 faintedBat *expAmount = (*expAmount * 150) / 100; if (B_UNEVOLVED_EXP_MULTIPLIER >= GEN_6 && IsMonPastEvolutionLevel(&gPlayerParty[expGetterMonId])) *expAmount = (*expAmount * 4915) / 4096; - if (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(expGetterMonId) >= AFFECTION_FOUR_HEARTS) + if (B_AFFECTION_MECHANICS == TRUE && GetMonAffectionHearts(&gPlayerParty[expGetterMonId]) >= AFFECTION_FOUR_HEARTS) *expAmount = (*expAmount * 4915) / 4096; if (CheckBagHasItem(ITEM_EXP_CHARM, 1)) //is also for other exp boosting Powers if/when implemented *expAmount = (*expAmount * 150) / 100; @@ -16976,7 +16996,7 @@ void BS_TryActivateGulpMissile(void) void BS_TryQuash(void) { NATIVE_ARGS(const u8 *failInstr); - u32 i; + u32 i, j; // It's true if foe is faster, has a bigger priority, or switches if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) @@ -16987,20 +17007,18 @@ void BS_TryQuash(void) // If the above condition is not true, it means we are faster than the foe, so we can set the quash bit gProtectStructs[gBattlerTarget].quash = TRUE; - for (i = 0; i < gBattlersCount; i++) + + // this implementation assumes turn order is correct when using Quash + i = GetBattlerTurnOrderNum(gBattlerTarget); + for (j = i + 1; j < gBattlersCount; j++) { - 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 - && GetWhichBattlerFaster(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE) == -1) - SwapTurnOrder(i, j); - } + // Gen 7- config makes target go last so that the order of quash targets is kept for the correct turn order + // Gen 8+ config alters Turn Order of the target according to speed, dynamic speed should handle the rest + if (B_QUASH_TURN_ORDER < GEN_8 || GetWhichBattlerFaster(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE) == -1) + SwapTurnOrder(i, j); + else + break; + i++; } gBattlescriptCurrInstr = cmd->nextInstr; } diff --git a/src/battle_util.c b/src/battle_util.c index 83af21cdcf..e0e5fe2485 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3557,11 +3557,20 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) case CANCELLER_POWDER_STATUS: if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER) { - if (moveType == TYPE_FIRE) + u32 partnerMove = gBattleMons[BATTLE_PARTNER(gBattlerAttacker)].moves[gBattleStruct->chosenMovePositions[BATTLE_PARTNER(gBattlerAttacker)]]; + if ((moveType == TYPE_FIRE && !gBattleStruct->pledgeMove) + || (gCurrentMove == MOVE_FIRE_PLEDGE && partnerMove == MOVE_GRASS_PLEDGE) + || (gCurrentMove == MOVE_GRASS_PLEDGE && partnerMove == MOVE_FIRE_PLEDGE && gBattleStruct->pledgeMove)) { gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE; - gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; - gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD + && (B_POWDER_RAIN < GEN_7 || !IsBattlerWeatherAffected(gBattlerAttacker, B_WEATHER_RAIN_PRIMAL))) + gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + + if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE + || gBattleStruct->obedienceResult != OBEYS + || HasTrainerUsedGimmick(gBattlerAttacker, GIMMICK_Z_MOVE)) + gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; effect = 1; } @@ -3591,7 +3600,15 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) SetGimmickAsActivated(gBattlerAttacker, GIMMICK_Z_MOVE); gBattleScripting.battler = gBattlerAttacker; - if (gMovesInfo[gCurrentMove].category == DAMAGE_CATEGORY_STATUS) + if (gProtectStructs[gBattlerAttacker].powderSelfDmg) + { + if (!alreadyUsed) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivatePowder; + } + } + else if (gMovesInfo[gCurrentMove].category == DAMAGE_CATEGORY_STATUS) { if (!alreadyUsed) { @@ -4350,13 +4367,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (gSpecialStatuses[battler].switchInAbilityDone) break; - if (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_TRACED) - break; side = (BATTLE_OPPOSITE(GetBattlerPosition(battler))) & BIT_SIDE; target1 = GetBattlerAtPosition(side); target2 = GetBattlerAtPosition(side + BIT_FLANK); - gSpecialStatuses[battler].switchInAbilityDone = TRUE; if (IsDoubleBattle()) { if (!gAbilitiesInfo[gBattleMons[target1].ability].cantBeTraced && gBattleMons[target1].hp != 0 @@ -4375,11 +4389,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (effect != 0) { - BattleScriptPushCursorAndCallback(BattleScript_TraceActivatesEnd3); - gBattleResources->flags->flags[battler] &= ~RESOURCE_FLAG_TRACED; + BattleScriptPushCursorAndCallback(BattleScript_TraceActivates); gBattleStruct->tracedAbility[battler] = gLastUsedAbility = gBattleMons[chosenTarget].ability; RecordAbilityBattle(chosenTarget, gLastUsedAbility); // Record the opposing battler has this ability - battler = gBattlerAbility = gBattleScripting.battler = battler; + gBattlerAbility = battler; PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, chosenTarget, gBattlerPartyIndexes[chosenTarget]) PREPARE_ABILITY_BUFFER(gBattleTextBuff2, gLastUsedAbility) @@ -5196,7 +5209,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 break; case ABILITY_GOOD_AS_GOLD: if (IS_MOVE_STATUS(gCurrentMove) - && !(moveTarget & MOVE_TARGET_USER) && !(moveTarget & MOVE_TARGET_OPPONENTS_FIELD) && !(moveTarget & MOVE_TARGET_ALL_BATTLERS)) effect = 3; @@ -6056,7 +6068,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (IsBattlerAlive(battler) && (gMovesInfo[gCurrentMove].danceMove) && !gSpecialStatuses[battler].dancerUsedMove - && (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED) && gBattlerAttacker != battler) { // Set bit and save Dancer mon's original target @@ -6370,14 +6381,14 @@ bool32 TryPrimalReversion(u32 battler) { if (gBattlerAttacker == battler) { - BattleScriptExecute(BattleScript_PrimalReversion); + BattleScriptPushCursorAndCallback(BattleScript_PrimalReversion); } else { // edge case for scenarios like a switch-in after activated eject button gBattleScripting.savedBattler = gBattlerAttacker; gBattlerAttacker = battler; - BattleScriptExecute(BattleScript_PrimalReversionRestoreAttacker); + BattleScriptPushCursorAndCallback(BattleScript_PrimalReversionRestoreAttacker); } return TRUE; } @@ -6807,8 +6818,7 @@ static u8 TrySetMicleBerry(u32 battler, u32 itemId, bool32 end2) { if (HasEnoughHpToEatBerry(battler, 4, itemId)) { - gProtectStructs[battler].usedMicleBerry = TRUE; // battler's next attack has increased accuracy - + gBattleStruct->usedMicleBerry |= 1u << battler; if (end2) { BattleScriptExecute(BattleScript_MicleBerryActivateEnd2); @@ -8541,13 +8551,9 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) if (gProtectStructs[battlerDef].maxGuarded && IsMoveBlockedByMaxGuard(move)) return TRUE; - // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. - // This means extra logic is needed to handle Shell Side Arm. - if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST - && (gMovesInfo[move].makesContact - || (gMovesInfo[move].effect == EFFECT_SHELL_SIDE_ARM - && gBattleStruct->shellSideArmCategory[battlerAtk][battlerDef] == DAMAGE_CATEGORY_PHYSICAL)) - && !gProtectStructs[battlerDef].maxGuarded) // Max Guard cannot be bypassed by Unseen Fist + if (!gProtectStructs[battlerDef].maxGuarded // Max Guard cannot be bypassed by Unseen Fist + && IsMoveMakingContact(move, gBattlerAttacker) + && GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST) return FALSE; else if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_CRAFTY_SHIELD && IS_MOVE_STATUS(move)) @@ -8688,7 +8694,7 @@ u32 CountBattlerStatIncreases(u32 battler, bool32 countEvasionAcc) u32 GetMoveTargetCount(u32 move, u32 battlerAtk, u32 battlerDef) { - switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) + switch (GetBattlerMoveTargetType(battlerAtk, move)) { case MOVE_TARGET_BOTH: return !(gAbsentBattlerFlags & (1u << battlerDef)) @@ -9436,6 +9442,10 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32 if (gMovesInfo[move].punchingMove) modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); break; + case HOLD_EFFECT_OGERPON_MASK: + if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_OGERPON) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; } // Terastallization boosts weak, non-priority, non-multi hit moves after modifiers to 60 BP. @@ -11785,18 +11795,18 @@ bool32 CanTargetPartner(u32 battlerAtk, u32 battlerDef) && battlerDef != BATTLE_PARTNER(battlerAtk)); } -static inline bool32 DoesCurrentTargetHaveAbilityImmunity(void) +static inline bool32 DoesBattlerHaveAbilityImmunity(u32 battlerDef) { - return (AbilityBattleEffects(ABILITYEFFECT_WOULD_BLOCK, gBattlerTarget, 0, 0, 0) - || AbilityBattleEffects(ABILITYEFFECT_WOULD_ABSORB, gBattlerTarget, 0, 0, 0)); + return (AbilityBattleEffects(ABILITYEFFECT_WOULD_BLOCK, battlerDef, 0, 0, 0) + || AbilityBattleEffects(ABILITYEFFECT_WOULD_ABSORB, battlerDef, 0, 0, 0)); } -bool32 TargetFullyImmuneToCurrMove(u32 BattlerAtk, u32 battlerDef) +bool32 TargetFullyImmuneToCurrMove(u32 battlerAtk, u32 battlerDef) { - return ((CalcTypeEffectivenessMultiplier(gCurrentMove, GetMoveType(gCurrentMove), BattlerAtk, battlerDef, GetBattlerAbility(battlerDef), FALSE) == UQ_4_12(0.0)) - || IsBattlerProtected(BattlerAtk, battlerDef, gCurrentMove) + return ((CalcTypeEffectivenessMultiplier(gCurrentMove, GetMoveType(gCurrentMove), battlerAtk, battlerDef, GetBattlerAbility(battlerDef), FALSE) == UQ_4_12(0.0)) + || IsBattlerProtected(battlerAtk, battlerDef, gCurrentMove) || IsSemiInvulnerable(battlerDef, gCurrentMove) - || DoesCurrentTargetHaveAbilityImmunity()); + || DoesBattlerHaveAbilityImmunity(battlerDef)); } u32 GetMoveType(u32 move) diff --git a/src/level_caps.c b/src/caps.c similarity index 69% rename from src/level_caps.c rename to src/caps.c index 61b4c8dc8f..9c30e55527 100644 --- a/src/level_caps.c +++ b/src/caps.c @@ -1,7 +1,7 @@ #include "global.h" #include "battle.h" #include "event_data.h" -#include "level_caps.h" +#include "caps.h" #include "pokemon.h" @@ -81,3 +81,39 @@ u32 GetSoftLevelCapExpValue(u32 level, u32 expValue) return expValue; } } + +u32 GetCurrentEVCap(void) +{ + + static const u16 sEvCapFlagMap[][2] = { + // Define EV caps for each milestone + {FLAG_BADGE01_GET, 30}, + {FLAG_BADGE02_GET, 90}, + {FLAG_BADGE03_GET, 150}, + {FLAG_BADGE04_GET, 210}, + {FLAG_BADGE05_GET, 270}, + {FLAG_BADGE06_GET, 330}, + {FLAG_BADGE07_GET, 390}, + {FLAG_BADGE08_GET, 450}, + {FLAG_IS_CHAMPION, MAX_TOTAL_EVS}, + }; + + if (B_EV_CAP_TYPE == EV_CAP_FLAG_LIST) + { + for (u32 evCap = 0; evCap < ARRAY_COUNT(sEvCapFlagMap); evCap++) + { + if (!FlagGet(sEvCapFlagMap[evCap][0])) + return sEvCapFlagMap[evCap][1]; + } + } + else if (B_EV_CAP_TYPE == EV_CAP_VARIABLE) + { + return VarGet(B_EV_CAP_VARIABLE); + } + else if (B_EV_CAP_TYPE == EV_CAP_NO_GAIN) + { + return 0; + } + + return MAX_TOTAL_EVS; +} diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index e43fa7c565..a1c1a20108 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -11044,10 +11044,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/shiny.gbapal.lz"); const u8 gMonIcon_ShayminSky[] = INCBIN_U8("graphics/pokemon/shaymin/sky/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_ShayminSky[] = INCBIN_COMP("graphics/pokemon/shaymin/sky/overworld.4bpp"); + const u32 gObjectEventPic_ShayminSky[] = INCBIN_COMP("graphics/pokemon/shaymin/sky/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_SHAYMIN @@ -14077,10 +14077,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/shiny.gbapal.lz"); const u8 gMonIcon_TornadusTherian[] = INCBIN_U8("graphics/pokemon/tornadus/therian/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_TornadusTherian[] = INCBIN_COMP("graphics/pokemon/tornadus/therian/overworld.4bpp"); + const u32 gObjectEventPic_TornadusTherian[] = INCBIN_COMP("graphics/pokemon/tornadus/therian/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_TORNADUS @@ -14108,10 +14108,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/shiny.gbapal.lz"); const u8 gMonIcon_ThundurusTherian[] = INCBIN_U8("graphics/pokemon/thundurus/therian/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_ThundurusTherian[] = INCBIN_COMP("graphics/pokemon/thundurus/therian/overworld.4bpp"); + const u32 gObjectEventPic_ThundurusTherian[] = INCBIN_COMP("graphics/pokemon/thundurus/therian/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_THUNDURUS @@ -14175,10 +14175,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/shiny.gbapal.lz"); const u8 gMonIcon_LandorusTherian[] = INCBIN_U8("graphics/pokemon/landorus/therian/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_LandorusTherian[] = INCBIN_COMP("graphics/pokemon/landorus/therian/overworld.4bpp"); + const u32 gObjectEventPic_LandorusTherian[] = INCBIN_COMP("graphics/pokemon/landorus/therian/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_LANDORUS @@ -14238,10 +14238,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/shiny.gbapal.lz"); const u8 gMonIcon_KyuremWhite[] = INCBIN_U8("graphics/pokemon/kyurem/white/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_KyuremWhite[] = INCBIN_COMP("graphics/pokemon/kyurem/white/overworld.4bpp"); + const u32 gObjectEventPic_KyuremWhite[] = INCBIN_COMP("graphics/pokemon/kyurem/white/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -14251,10 +14251,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/shiny.gbapal.lz"); const u8 gMonIcon_KyuremBlack[] = INCBIN_U8("graphics/pokemon/kyurem/black/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_KyuremBlack[] = INCBIN_COMP("graphics/pokemon/kyurem/black/overworld.4bpp"); + const u32 gObjectEventPic_KyuremBlack[] = INCBIN_COMP("graphics/pokemon/kyurem/black/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FUSION_FORMS @@ -15812,9 +15812,9 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ #if OW_POKEMON_OBJECT_EVENTS const u32 gObjectEventPic_PumpkabooAverage[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/overworld.4bpp"); - // const u32 gObjectEventPic_PumpkabooSmall[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/small/overworld.4bpp"); - // const u32 gObjectEventPic_PumpkabooLarge[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/large/overworld.4bpp"); - // const u32 gObjectEventPic_PumpkabooSuper[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/super/overworld.4bpp"); + const u32 gObjectEventPic_PumpkabooSmall[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/small/overworld.4bpp"); + const u32 gObjectEventPic_PumpkabooLarge[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/large/overworld.4bpp"); + const u32 gObjectEventPic_PumpkabooSuper[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/super/overworld.4bpp"); #endif //OW_POKEMON_OBJECT_EVENTS const u32 gMonPalette_Gourgeist[] = INCBIN_U32("graphics/pokemon/gourgeist/normal.gbapal.lz"); @@ -15843,9 +15843,9 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ #if OW_POKEMON_OBJECT_EVENTS const u32 gObjectEventPic_GourgeistAverage[] = INCBIN_COMP("graphics/pokemon/gourgeist/overworld.4bpp"); - // const u32 gObjectEventPic_GourgeistSmall[] = INCBIN_COMP("graphics/pokemon/gourgeist/small/overworld.4bpp"); - // const u32 gObjectEventPic_GourgeistLarge[] = INCBIN_COMP("graphics/pokemon/gourgeist/large/overworld.4bpp"); - // const u32 gObjectEventPic_GourgeistSuper[] = INCBIN_COMP("graphics/pokemon/gourgeist/super/overworld.4bpp"); + const u32 gObjectEventPic_GourgeistSmall[] = INCBIN_COMP("graphics/pokemon/gourgeist/small/overworld.4bpp"); + const u32 gObjectEventPic_GourgeistLarge[] = INCBIN_COMP("graphics/pokemon/gourgeist/large/overworld.4bpp"); + const u32 gObjectEventPic_GourgeistSuper[] = INCBIN_COMP("graphics/pokemon/gourgeist/super/overworld.4bpp"); #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_PUMPKABOO @@ -16005,10 +16005,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/shiny.gbapal.lz"); const u8 gMonIcon_Zygarde10[] = INCBIN_U8("graphics/pokemon/zygarde/10_percent/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_Zygarde10[] = INCBIN_COMP("graphics/pokemon/zygarde/10_percent/overworld.4bpp"); + const u32 gObjectEventPic_Zygarde10[] = INCBIN_COMP("graphics/pokemon/zygarde/10_percent/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -16018,10 +16018,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/shiny.gbapal.lz"); const u8 gMonIcon_ZygardeComplete[] = INCBIN_U8("graphics/pokemon/zygarde/complete/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_ZygardeComplete[] = INCBIN_COMP("graphics/pokemon/zygarde/complete/overworld.4bpp"); + const u32 gObjectEventPic_ZygardeComplete[] = INCBIN_COMP("graphics/pokemon/zygarde/complete/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_ZYGARDE @@ -16464,10 +16464,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/shiny.gbapal.lz"); const u8 gMonIcon_OricorioPomPom[] = INCBIN_U8("graphics/pokemon/oricorio/pom_pom/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_OricorioPomPom[] = INCBIN_COMP("graphics/pokemon/oricorio/pom_pom/overworld.4bpp"); + const u32 gObjectEventPic_OricorioPomPom[] = INCBIN_COMP("graphics/pokemon/oricorio/pom_pom/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -16477,10 +16477,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/shiny.gbapal.lz"); const u8 gMonIcon_OricorioPau[] = INCBIN_U8("graphics/pokemon/oricorio/pau/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_OricorioPau[] = INCBIN_COMP("graphics/pokemon/oricorio/pau/overworld.4bpp"); + const u32 gObjectEventPic_OricorioPau[] = INCBIN_COMP("graphics/pokemon/oricorio/pau/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -16490,10 +16490,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/shiny.gbapal.lz"); const u8 gMonIcon_OricorioSensu[] = INCBIN_U8("graphics/pokemon/oricorio/sensu/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_OricorioSensu[] = INCBIN_COMP("graphics/pokemon/oricorio/sensu/overworld.4bpp"); + const u32 gObjectEventPic_OricorioSensu[] = INCBIN_COMP("graphics/pokemon/oricorio/sensu/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_ORICORIO @@ -17718,10 +17718,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/shiny.gbapal.lz"); const u8 gMonIcon_MagearnaOriginalColor[] = INCBIN_U8("graphics/pokemon/magearna/original_color/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_MagearnaOriginalColor[] = INCBIN_COMP("graphics/pokemon/magearna/original_color/overworld.4bpp"); + const u32 gObjectEventPic_MagearnaOriginalColor[] = INCBIN_COMP("graphics/pokemon/magearna/original_color/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_MAGEARNA diff --git a/src/data/items.h b/src/data/items.h index 27d9829899..4c56c015b9 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -13653,6 +13653,8 @@ const struct Item gItemsInfo[] = { .name = _("Cornerstone Mask"), .price = 0, + .holdEffect = HOLD_EFFECT_OGERPON_MASK, + .holdEffectParam = 20, .description = COMPOUND_STRING( "Allows Ogerpon to\n" "wield the Rock-\n" @@ -13668,6 +13670,8 @@ const struct Item gItemsInfo[] = { .name = _("Wellspring Mask"), .price = 0, + .holdEffect = HOLD_EFFECT_OGERPON_MASK, + .holdEffectParam = 20, .description = COMPOUND_STRING( "Allows Ogerpon to\n" "wield the Water-\n" @@ -13683,6 +13687,8 @@ const struct Item gItemsInfo[] = { .name = _("Hearthflame Mask"), .price = 0, + .holdEffect = HOLD_EFFECT_OGERPON_MASK, + .holdEffectParam = 20, .description = COMPOUND_STRING( "Allows Ogerpon to\n" "wield the Fire-\n" diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 6dac60de27..74e12c4e7a 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -1932,8 +1932,13 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = COMPOUND_STRING("Growth"), .description = COMPOUND_STRING( + #if B_GROWTH_STAT_RAISE >= GEN_5 + "Forces the body to grow,\n" + "raising Attack and Sp. Atk."), + #else "Forces the body to grow\n" "and heightens Sp. Atk."), + #endif .effect = B_GROWTH_STAT_RAISE >= GEN_5 ? EFFECT_GROWTH : EFFECT_SPECIAL_ATTACK_UP, .power = 0, .type = TYPE_NORMAL, diff --git a/src/data/object_events/movement_type_func_tables.h b/src/data/object_events/movement_type_func_tables.h index 749c14969c..35180f5b3c 100755 --- a/src/data/object_events/movement_type_func_tables.h +++ b/src/data/object_events/movement_type_func_tables.h @@ -2,7 +2,7 @@ u8 (*const gMovementTypeFuncs_WanderAround[])(struct ObjectEvent *, struct Sprit MovementType_WanderAround_Step0, MovementType_WanderAround_Step1, MovementType_WanderAround_Step2, - MovementType_WanderAround_Step3, + MovementType_Wander_Step3, MovementType_WanderAround_Step4, MovementType_WanderAround_Step5, MovementType_WanderAround_Step6, @@ -36,7 +36,7 @@ u8 (*const gMovementTypeFuncs_WanderUpAndDown[])(struct ObjectEvent *, struct Sp MovementType_WanderUpAndDown_Step0, MovementType_WanderUpAndDown_Step1, MovementType_WanderUpAndDown_Step2, - MovementType_WanderUpAndDown_Step3, + MovementType_Wander_Step3, MovementType_WanderUpAndDown_Step4, MovementType_WanderUpAndDown_Step5, MovementType_WanderUpAndDown_Step6, @@ -48,7 +48,7 @@ u8 (*const gMovementTypeFuncs_WanderLeftAndRight[])(struct ObjectEvent *, struct MovementType_WanderLeftAndRight_Step0, MovementType_WanderLeftAndRight_Step1, MovementType_WanderLeftAndRight_Step2, - MovementType_WanderLeftAndRight_Step3, + MovementType_Wander_Step3, MovementType_WanderLeftAndRight_Step4, MovementType_WanderLeftAndRight_Step5, MovementType_WanderLeftAndRight_Step6, diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index bde3c3b0d5..d6229e57c9 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -1173,7 +1173,7 @@ const union AnimCmd *const sAnimTable_Following[] = { }; // Like the above, but has separate frames for facing right -static const union AnimCmd *const sAnimTable_Following_Asym[] = { +const union AnimCmd *const sAnimTable_Following_Asym[] = { [ANIM_STD_FACE_SOUTH] = sAnim_FaceSouth, [ANIM_STD_FACE_NORTH] = sAnim_FaceNorth2F, [ANIM_STD_FACE_WEST] = sAnim_FaceWest2F, 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 1e20ef3798..6ad602a629 100644 --- a/src/data/object_events/object_event_pic_tables_followers.h +++ b/src/data/object_events/object_event_pic_tables_followers.h @@ -3078,9 +3078,9 @@ static const struct SpriteFrameImage sPicTable_Darkrai[] = { static const struct SpriteFrameImage sPicTable_ShayminLand[] = { overworld_ascending_frames(gObjectEventPic_ShayminLand, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_ShayminSky[] = { +static const struct SpriteFrameImage sPicTable_ShayminSky[] = { overworld_ascending_frames(gObjectEventPic_ShayminSky, 4, 4), -};*/ +}; #endif //P_FAMILY_SHAYMIN #if P_FAMILY_ARCEUS @@ -3914,9 +3914,9 @@ static const struct SpriteFrameImage sPicTable_Virizion[] = { static const struct SpriteFrameImage sPicTable_TornadusIncarnate[] = { overworld_ascending_frames(gObjectEventPic_TornadusIncarnate, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_TornadusTherian[] = { +static const struct SpriteFrameImage sPicTable_TornadusTherian[] = { overworld_ascending_frames(gObjectEventPic_TornadusTherian, 4, 4), -};*/ +}; #endif //P_FAMILY_TORNADUS #if P_FAMILY_THUNDURUS @@ -3924,9 +3924,9 @@ static const struct SpriteFrameImage sPicTable_TornadusIncarnate[] = { static const struct SpriteFrameImage sPicTable_ThundurusIncarnate[] = { overworld_ascending_frames(gObjectEventPic_ThundurusIncarnate, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_ThundurusTherian[] = { +static const struct SpriteFrameImage sPicTable_ThundurusTherian[] = { overworld_ascending_frames(gObjectEventPic_ThundurusTherian, 4, 4), -};*/ +}; #endif //P_FAMILY_THUNDURUS #if P_FAMILY_RESHIRAM @@ -3946,9 +3946,9 @@ static const struct SpriteFrameImage sPicTable_Zekrom[] = { static const struct SpriteFrameImage sPicTable_LandorusIncarnate[] = { overworld_ascending_frames(gObjectEventPic_LandorusIncarnate, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_LandorusTherian[] = { +static const struct SpriteFrameImage sPicTable_LandorusTherian[] = { overworld_ascending_frames(gObjectEventPic_LandorusTherian, 4, 4), -};*/ +}; #endif //P_FAMILY_LANDORUS #if P_FAMILY_ENAMORUS @@ -3965,12 +3965,12 @@ static const struct SpriteFrameImage sPicTable_Kyurem[] = { overworld_ascending_frames(gObjectEventPic_Kyurem, 4, 4), }; #if P_FUSION_FORMS -/*static const struct SpriteFrameImage sPicTable_KyuremWhite[] = { +static const struct SpriteFrameImage sPicTable_KyuremWhite[] = { overworld_ascending_frames(gObjectEventPic_KyuremWhite, 4, 4), }; static const struct SpriteFrameImage sPicTable_KyuremBlack[] = { overworld_ascending_frames(gObjectEventPic_KyuremBlack, 4, 4), -};*/ +}; #endif //P_FUSION_FORMS #endif //P_FAMILY_KYUREM @@ -4416,7 +4416,7 @@ static const struct SpriteFrameImage sPicTable_Trevenant[] = { static const struct SpriteFrameImage sPicTable_PumpkabooAverage[] = { overworld_ascending_frames(gObjectEventPic_PumpkabooAverage, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_PumpkabooSmall[] = { +static const struct SpriteFrameImage sPicTable_PumpkabooSmall[] = { overworld_ascending_frames(gObjectEventPic_PumpkabooSmall, 4, 4), }; static const struct SpriteFrameImage sPicTable_PumpkabooLarge[] = { @@ -4424,12 +4424,12 @@ static const struct SpriteFrameImage sPicTable_PumpkabooLarge[] = { }; static const struct SpriteFrameImage sPicTable_PumpkabooSuper[] = { overworld_ascending_frames(gObjectEventPic_PumpkabooSuper, 4, 4), -};*/ +}; static const struct SpriteFrameImage sPicTable_GourgeistAverage[] = { overworld_ascending_frames(gObjectEventPic_GourgeistAverage, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_GourgeistSmall[] = { +static const struct SpriteFrameImage sPicTable_GourgeistSmall[] = { overworld_ascending_frames(gObjectEventPic_GourgeistSmall, 4, 4), }; static const struct SpriteFrameImage sPicTable_GourgeistLarge[] = { @@ -4437,7 +4437,7 @@ static const struct SpriteFrameImage sPicTable_GourgeistLarge[] = { }; static const struct SpriteFrameImage sPicTable_GourgeistSuper[] = { overworld_ascending_frames(gObjectEventPic_GourgeistSuper, 4, 4), -};*/ +}; #endif //P_FAMILY_PUMPKABOO #if P_FAMILY_BERGMITE @@ -4484,12 +4484,12 @@ static const struct SpriteFrameImage sPicTable_Yveltal[] = { static const struct SpriteFrameImage sPicTable_Zygarde50[] = { overworld_ascending_frames(gObjectEventPic_Zygarde50, 4, 4), }; -//static const struct SpriteFrameImage sPicTable_Zygarde10[] = { -// overworld_ascending_frames(gObjectEventPic_Zygarde10, 4, 4), -//}; -//static const struct SpriteFrameImage sPicTable_ZygardeComplete[] = { -// overworld_ascending_frames(gObjectEventPic_ZygardeComplete, 4, 4), -//}; +static const struct SpriteFrameImage sPicTable_Zygarde10[] = { + overworld_ascending_frames(gObjectEventPic_Zygarde10, 4, 4), +}; +static const struct SpriteFrameImage sPicTable_ZygardeComplete[] = { + overworld_ascending_frames(gObjectEventPic_ZygardeComplete, 4, 4), +}; #endif //P_FAMILY_ZYGARDE @@ -4607,7 +4607,7 @@ static const struct SpriteFrameImage sPicTable_Crabominable[] = { static const struct SpriteFrameImage sPicTable_OricorioBaile[] = { overworld_ascending_frames(gObjectEventPic_OricorioBaile, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_OricorioPomPom[] = { +static const struct SpriteFrameImage sPicTable_OricorioPomPom[] = { overworld_ascending_frames(gObjectEventPic_OricorioPomPom, 4, 4), }; static const struct SpriteFrameImage sPicTable_OricorioPau[] = { @@ -4615,7 +4615,7 @@ static const struct SpriteFrameImage sPicTable_OricorioPau[] = { }; static const struct SpriteFrameImage sPicTable_OricorioSensu[] = { overworld_ascending_frames(gObjectEventPic_OricorioSensu, 4, 4), -};*/ +}; #endif //P_FAMILY_ORICORIO #if P_FAMILY_CUTIEFLY @@ -4967,9 +4967,9 @@ static const struct SpriteFrameImage sPicTable_NecrozmaDawnWings[] = { static const struct SpriteFrameImage sPicTable_Magearna[] = { overworld_ascending_frames(gObjectEventPic_Magearna, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_MagearnaOriginalColor[] = { +static const struct SpriteFrameImage sPicTable_MagearnaOriginalColor[] = { overworld_ascending_frames(gObjectEventPic_MagearnaOriginalColor, 4, 4), -};*/ +}; #endif //P_FAMILY_MAGEARNA #if P_FAMILY_MARSHADOW diff --git a/src/data/pokemon/species_info.h b/src/data/pokemon/species_info.h index b0945ed43f..e24f1b7cc6 100644 --- a/src/data/pokemon/species_info.h +++ b/src/data/pokemon/species_info.h @@ -54,8 +54,30 @@ .affineAnims = gDummySpriteAffineAnimTable, \ }, \ OVERWORLD_PAL(__VA_ARGS__) + +#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...) \ +.overworldData = { \ + .tileTag = TAG_NONE, \ + .paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \ + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \ + .size = (_size == SIZE_32x32 ? 512 : 2048), \ + .width = (_size == SIZE_32x32 ? 32 : 64), \ + .height = (_size == SIZE_32x32 ? 32 : 64), \ + .paletteSlot = PALSLOT_NPC_1, \ + .shadowSize = shadow, \ + .inanimate = FALSE, \ + .compressed = COMP, \ + .tracks = _tracks, \ + .oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \ + .subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \ + .anims = _anims, \ + .images = picTable, \ + .affineAnims = gDummySpriteAffineAnimTable, \ +}, \ + OVERWORLD_PAL(__VA_ARGS__) #else #define OVERWORLD(picTable, _size, shadow, _tracks, ...) +#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...) #endif //OW_POKEMON_OBJECT_EVENTS // Maximum value for a female Pokémon is 254 (MON_FEMALE) which is 100% female. diff --git a/src/data/pokemon/species_info/gen_1_families.h b/src/data/pokemon/species_info/gen_1_families.h index bb5ba4a0d4..6f5dfeb054 100644 --- a/src/data/pokemon/species_info/gen_1_families.h +++ b/src/data/pokemon/species_info/gen_1_families.h @@ -2121,6 +2121,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconPalIndex = 2, SHADOW(-4, 3, SHADOW_SIZE_L) FOOTPRINT(Raticate) + OVERWORLD( + sPicTable_RaticateAlolan, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_RaticateAlolan, + gShinyOverworldPalette_RaticateAlolan + ) .isTotem = TRUE, .isAlolanForm = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, @@ -3467,6 +3475,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = #endif SHADOW(-3, 5, SHADOW_SIZE_M) FOOTPRINT(Pikachu) + OVERWORLD( + sPicTable_Pikachu, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pikachu, + gShinyOverworldPalette_Pikachu + ) .cannotBeTraded = TRUE, .perfectIVCount = NUM_STATS, .levelUpLearnset = sPikachuLevelUpLearnset, @@ -9303,11 +9319,12 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconPalIndex = 0, SHADOW(-5, 9, SHADOW_SIZE_L) FOOTPRINT(Slowbro) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_SlowbroGalarian, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, + sAnimTable_Following_Asym, gOverworldPalette_SlowbroGalarian, gShinyOverworldPalette_SlowbroGalarian ) @@ -9647,11 +9664,12 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconPalIndex = 1, SHADOW(-3, 5, SHADOW_SIZE_M) FOOTPRINT(Farfetchd) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Farfetchd, SIZE_32x32, SHADOW_SIZE_M, TRACKS_NONE, + sAnimTable_Following_Asym, gOverworldPalette_Farfetchd, gShinyOverworldPalette_Farfetchd ) @@ -12026,6 +12044,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconPalIndex = 1, SHADOW(-2, 11, SHADOW_SIZE_M) FOOTPRINT(Marowak) + OVERWORLD( + sPicTable_MarowakAlolan, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_MarowakAlolan, + gShinyOverworldPalette_MarowakAlolan + ) .isTotem = TRUE, .isAlolanForm = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, @@ -15848,6 +15874,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = #endif SHADOW(-2, 2, SHADOW_SIZE_S) FOOTPRINT(Eevee) + OVERWORLD( + sPicTable_Eevee, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Eevee, + gShinyOverworldPalette_Eevee + ) .cannotBeTraded = TRUE, .perfectIVCount = NUM_STATS, .levelUpLearnset = sEeveeLevelUpLearnset, diff --git a/src/data/pokemon/species_info/gen_4_families.h b/src/data/pokemon/species_info/gen_4_families.h index c63d6f613b..da7eaee7e9 100644 --- a/src/data/pokemon/species_info/gen_4_families.h +++ b/src/data/pokemon/species_info/gen_4_families.h @@ -6461,6 +6461,14 @@ const struct SpeciesInfo gSpeciesInfoGen4[] = .iconPalIndex = 1, SHADOW(3, 7, SHADOW_SIZE_M) FOOTPRINT(Shaymin) + OVERWORLD( + sPicTable_ShayminSky, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_ShayminSky, + gShinyOverworldPalette_ShayminSky + ) .isMythical = TRUE, .isFrontierBanned = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, diff --git a/src/data/pokemon/species_info/gen_5_families.h b/src/data/pokemon/species_info/gen_5_families.h index 9445c57a43..dca0676af6 100644 --- a/src/data/pokemon/species_info/gen_5_families.h +++ b/src/data/pokemon/species_info/gen_5_families.h @@ -11226,6 +11226,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconPalIndex = 1, SHADOW(-5, 12, SHADOW_SIZE_L) FOOTPRINT(Tornadus) + OVERWORLD( + sPicTable_TornadusTherian, + SIZE_64x64, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_TornadusTherian, + gShinyOverworldPalette_TornadusTherian + ) .isLegendary = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, .levelUpLearnset = sTornadusLevelUpLearnset, @@ -11352,6 +11360,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconPalIndex = 0, SHADOW(5, 16, SHADOW_SIZE_M) FOOTPRINT(Thundurus) + OVERWORLD( + sPicTable_ThundurusTherian, + SIZE_64x64, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_ThundurusTherian, + gShinyOverworldPalette_ThundurusTherian + ) .isLegendary = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, .levelUpLearnset = sThundurusLevelUpLearnset, @@ -11609,6 +11625,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconPalIndex = 0, SHADOW(1, 11, SHADOW_SIZE_L) FOOTPRINT(Landorus) + OVERWORLD( + sPicTable_LandorusTherian, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_LandorusTherian, + gShinyOverworldPalette_LandorusTherian + ) .isLegendary = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, .levelUpLearnset = sLandorusLevelUpLearnset, @@ -11744,6 +11768,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconPalIndex = 0, SHADOW(-8, 14, SHADOW_SIZE_L) FOOTPRINT(Kyurem) + OVERWORLD( + sPicTable_KyuremWhite, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_KyuremWhite, + gShinyOverworldPalette_KyuremWhite + ) .isLegendary = TRUE, .cannotBeTraded = TRUE, .isFrontierBanned = TRUE, @@ -11809,6 +11841,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconPalIndex = 0, SHADOW(4, 14, SHADOW_SIZE_L) FOOTPRINT(Kyurem) + OVERWORLD( + sPicTable_KyuremBlack, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_KyuremBlack, + gShinyOverworldPalette_KyuremBlack + ) .isLegendary = TRUE, .cannotBeTraded = TRUE, .isFrontierBanned = TRUE, diff --git a/src/data/pokemon/species_info/gen_6_families.h b/src/data/pokemon/species_info/gen_6_families.h index 90e3d2d51e..ec81e16e7e 100644 --- a/src/data/pokemon/species_info/gen_6_families.h +++ b/src/data/pokemon/species_info/gen_6_families.h @@ -4621,6 +4621,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 2, SHADOW(-1, -1, SHADOW_SIZE_S) FOOTPRINT(Pumpkaboo) + OVERWORLD( + sPicTable_PumpkabooSmall, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pumpkaboo, + gShinyOverworldPalette_Pumpkaboo + ) .levelUpLearnset = sPumpkabooLevelUpLearnset, .teachableLearnset = sPumpkabooTeachableLearnset, .eggMoveLearnset = sPumpkabooEggMoveLearnset, @@ -4677,6 +4685,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 2, SHADOW(0, 2, SHADOW_SIZE_S) FOOTPRINT(Pumpkaboo) + OVERWORLD( + sPicTable_PumpkabooLarge, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pumpkaboo, + gShinyOverworldPalette_Pumpkaboo + ) .levelUpLearnset = sPumpkabooLevelUpLearnset, .teachableLearnset = sPumpkabooTeachableLearnset, .eggMoveLearnset = sPumpkabooEggMoveLearnset, @@ -4735,6 +4751,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 2, SHADOW(1, 4, SHADOW_SIZE_S) FOOTPRINT(Pumpkaboo) + OVERWORLD( + sPicTable_PumpkabooSuper, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pumpkaboo, + gShinyOverworldPalette_Pumpkaboo + ) .levelUpLearnset = sPumpkabooLevelUpLearnset, .teachableLearnset = sPumpkabooTeachableLearnset, .eggMoveLearnset = sPumpkabooEggMoveLearnset, @@ -4854,6 +4878,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 2, SHADOW(4, 9, SHADOW_SIZE_S) FOOTPRINT(Gourgeist) + OVERWORLD( + sPicTable_GourgeistSmall, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Gourgeist, + gShinyOverworldPalette_Gourgeist + ) .levelUpLearnset = sGourgeistLevelUpLearnset, .teachableLearnset = sGourgeistTeachableLearnset, .formSpeciesIdTable = sGourgeistFormSpeciesIdTable, @@ -4908,6 +4940,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 2, SHADOW(4, 12, SHADOW_SIZE_M) FOOTPRINT(Gourgeist) + OVERWORLD( + sPicTable_GourgeistLarge, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Gourgeist, + gShinyOverworldPalette_Gourgeist + ) .levelUpLearnset = sGourgeistLevelUpLearnset, .teachableLearnset = sGourgeistTeachableLearnset, .formSpeciesIdTable = sGourgeistFormSpeciesIdTable, @@ -4964,6 +5004,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 2, SHADOW(4, 14, SHADOW_SIZE_M) FOOTPRINT(Gourgeist) + OVERWORLD( + sPicTable_GourgeistSuper, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Gourgeist, + gShinyOverworldPalette_Gourgeist + ) .levelUpLearnset = sGourgeistLevelUpLearnset, .teachableLearnset = sGourgeistTeachableLearnset, .formSpeciesIdTable = sGourgeistFormSpeciesIdTable, @@ -5667,6 +5715,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 1, SHADOW(1, 11, SHADOW_SIZE_L) FOOTPRINT(Zygarde) + OVERWORLD( + sPicTable_Zygarde10, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Zygarde10, + gShinyOverworldPalette_Zygarde10 + ) .isLegendary = TRUE, .isFrontierBanned = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, @@ -5722,6 +5778,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 1, SHADOW(1, 11, SHADOW_SIZE_L) FOOTPRINT(Zygarde) + OVERWORLD( + sPicTable_Zygarde10, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Zygarde10, + gShinyOverworldPalette_Zygarde10 + ) .isLegendary = TRUE, .isFrontierBanned = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, @@ -5781,6 +5845,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconPalIndex = 1, SHADOW(-3, 13, SHADOW_SIZE_XL_BATTLE_ONLY) FOOTPRINT(Zygarde) + OVERWORLD( + sPicTable_ZygardeComplete, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_ZygardeComplete, + gShinyOverworldPalette_ZygardeComplete + ) .isLegendary = TRUE, .isFrontierBanned = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, diff --git a/src/data/pokemon/species_info/gen_7_families.h b/src/data/pokemon/species_info/gen_7_families.h index b328c2a716..2bbe9e646a 100644 --- a/src/data/pokemon/species_info/gen_7_families.h +++ b/src/data/pokemon/species_info/gen_7_families.h @@ -1507,6 +1507,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconPalIndex = 1, SHADOW(5, 8, SHADOW_SIZE_S) FOOTPRINT(Oricorio) + OVERWORLD( + sPicTable_OricorioPomPom, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_OricorioPomPom, + gShinyOverworldPalette_OricorioPomPom + ) .levelUpLearnset = sOricorioLevelUpLearnset, .teachableLearnset = sOricorioTeachableLearnset, .eggMoveLearnset = sOricorioEggMoveLearnset, @@ -1564,6 +1572,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconPalIndex = 1, SHADOW(-3, 11, SHADOW_SIZE_S) FOOTPRINT(Oricorio) + OVERWORLD( + sPicTable_OricorioPau, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_OricorioPau, + gShinyOverworldPalette_OricorioPau + ) .levelUpLearnset = sOricorioLevelUpLearnset, .teachableLearnset = sOricorioTeachableLearnset, .eggMoveLearnset = sOricorioEggMoveLearnset, @@ -1621,6 +1637,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconPalIndex = 0, SHADOW(7, 10, SHADOW_SIZE_S) FOOTPRINT(Oricorio) + OVERWORLD( + sPicTable_OricorioSensu, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_OricorioSensu, + gShinyOverworldPalette_OricorioSensu + ) .levelUpLearnset = sOricorioLevelUpLearnset, .teachableLearnset = sOricorioTeachableLearnset, .eggMoveLearnset = sOricorioEggMoveLearnset, @@ -4704,6 +4728,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconPalIndex = 1, SHADOW(-3, 1, SHADOW_SIZE_S) FOOTPRINT(Mimikyu) + OVERWORLD( + sPicTable_MimikyuDisguised, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_MimikyuDisguised, + gShinyOverworldPalette_MimikyuDisguised + ) .isTotem = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, .levelUpLearnset = sMimikyuLevelUpLearnset, @@ -6594,6 +6626,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconPalIndex = 0, SHADOW(-2, 14, SHADOW_SIZE_M) FOOTPRINT(Magearna) + OVERWORLD( + sPicTable_MagearnaOriginalColor, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_MagearnaOriginalColor, + gShinyOverworldPalette_MagearnaOriginalColor + ) .isMythical = TRUE, .isFrontierBanned = TRUE, .perfectIVCount = LEGENDARY_PERFECT_IV_COUNT, diff --git a/src/data/pokemon/species_info/gen_8_families.h b/src/data/pokemon/species_info/gen_8_families.h index b40b31a25d..d4473fa5d4 100644 --- a/src/data/pokemon/species_info/gen_8_families.h +++ b/src/data/pokemon/species_info/gen_8_families.h @@ -3517,14 +3517,6 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .iconPalIndex = 0, SHADOW(1, 10, SHADOW_SIZE_XL_BATTLE_ONLY) FOOTPRINT(Toxtricity) - OVERWORLD( - sPicTable_ToxtricityLowKey, - SIZE_32x32, - SHADOW_SIZE_M, - TRACKS_FOOT, - gOverworldPalette_ToxtricityLowKey, - gShinyOverworldPalette_ToxtricityLowKey - ) .isGigantamax = TRUE, .levelUpLearnset = sToxtricityLowKeyLevelUpLearnset, .teachableLearnset = sToxtricityLowKeyTeachableLearnset, diff --git a/src/data/pokemon/species_info/gen_9_families.h b/src/data/pokemon/species_info/gen_9_families.h index 922e57784b..427090cef6 100644 --- a/src/data/pokemon/species_info/gen_9_families.h +++ b/src/data/pokemon/species_info/gen_9_families.h @@ -3267,12 +3267,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconPalIndex = 1, SHADOW(6, 11, SHADOW_SIZE_M) FOOTPRINT(Scovillain) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Scovillain, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Scovillain, gShinyOverworldPalette_Scovillain ) @@ -3583,12 +3583,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconPalIndex = 1, SHADOW(-3, 1, SHADOW_SIZE_S) FOOTPRINT(Tinkatink) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Tinkatink, SIZE_32x32, SHADOW_SIZE_S, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Tinkatink, gShinyOverworldPalette_Tinkatink ) @@ -3647,12 +3647,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconPalIndex = 1, SHADOW(-4, 5, SHADOW_SIZE_L) FOOTPRINT(Tinkatuff) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Tinkatuff, SIZE_32x32, SHADOW_SIZE_S, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Tinkatuff, gShinyOverworldPalette_Tinkatuff ) @@ -3710,12 +3710,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconPalIndex = 1, SHADOW(-5, 15, SHADOW_SIZE_XL_BATTLE_ONLY) FOOTPRINT(Tinkaton) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Tinkaton, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Tinkaton, gShinyOverworldPalette_Tinkaton ) diff --git a/src/daycare.c b/src/daycare.c index e13f993c3f..7a31f15b27 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -3,7 +3,7 @@ #include "battle.h" #include "daycare.h" #include "string_util.h" -#include "level_caps.h" +#include "caps.h" #include "mail.h" #include "pokemon_storage_system.h" #include "event_data.h" diff --git a/src/ev_caps.c b/src/ev_caps.c deleted file mode 100644 index 8eb3531ca4..0000000000 --- a/src/ev_caps.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "global.h" -#include "battle.h" -#include "event_data.h" -#include "ev_caps.h" -#include "pokemon.h" - -u32 GetCurrentEVCap(void) -{ - - static const u16 sEvCapFlagMap[][2] = { - // Define EV caps for each milestone - {FLAG_BADGE01_GET, 30}, - {FLAG_BADGE02_GET, 90}, - {FLAG_BADGE03_GET, 150}, - {FLAG_BADGE04_GET, 210}, - {FLAG_BADGE05_GET, 270}, - {FLAG_BADGE06_GET, 330}, - {FLAG_BADGE07_GET, 390}, - {FLAG_BADGE08_GET, 450}, - {FLAG_IS_CHAMPION, MAX_TOTAL_EVS}, - }; - - if (B_EV_CAP_TYPE == EV_CAP_FLAG_LIST) - { - for (u32 evCap = 0; evCap < ARRAY_COUNT(sEvCapFlagMap); evCap++) - { - if (!FlagGet(sEvCapFlagMap[evCap][0])) - return sEvCapFlagMap[evCap][1]; - } - } - else if (B_EV_CAP_TYPE == EV_CAP_VARIABLE) - { - return VarGet(B_EV_CAP_VARIABLE); - } - else if (B_EV_CAP_TYPE == EV_CAP_NO_GAIN) - { - return 0; - } - - return MAX_TOTAL_EVS; -} diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 9052a60f32..93bd3ba7ea 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -112,6 +112,7 @@ static EWRAM_DATA struct LockedAnimObjectEvents *sLockedAnimObjectEvents = {0}; static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *, struct Sprite *); +static bool32 UpdateMonMoveInPlace(struct ObjectEvent *, struct Sprite *); static void SetMovementDelay(struct Sprite *, s16); static bool8 WaitForMovementDelay(struct Sprite *); static u8 GetCollisionInDirection(struct ObjectEvent *, u8); @@ -1405,7 +1406,7 @@ static u8 InitObjectEventStateFromTemplate(const struct ObjectEventTemplate *tem objectEvent->triggerGroundEffectsOnMove = TRUE; objectEvent->graphicsId = PackGraphicsId(template); SetObjectEventDynamicGraphicsId(objectEvent); - if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE) + if (IS_OW_MON_OBJ(objectEvent)) { if (template->script && template->script[0] == 0x7d) objectEvent->shiny = T1_READ_16(&template->script[2]) >> 15; @@ -1609,11 +1610,13 @@ u16 LoadSheetGraphicsInfo(const struct ObjectEventGraphicsInfo *info, u16 uuid, // Load, then free, in order to avoid displaying garbage data // before sprite's `sheetTileStart` is repointed tileStart = LoadCompressedSpriteSheetByTemplate(&template, TILE_SIZE_4BPP << sheetSpan); - if (oldTiles) { + if (oldTiles) + { FieldEffectFreeTilesIfUnused(oldTiles); // We weren't able to load the sheet; // retry (after having freed), and set sprite to invisible until done - if (tileStart <= 0) { + if (tileStart <= 0) + { if (sprite) sprite->invisible = TRUE; tileStart = LoadCompressedSpriteSheetByTemplate(&template, TILE_SIZE_4BPP << sheetSpan); @@ -1683,6 +1686,12 @@ static u8 TrySetupObjectEventSprite(const struct ObjectEventTemplate *objectEven objectEvent->graphicsId -= SPECIES_SHINY_TAG; } + if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) + { + objectEvent->shiny = TRUE; + objectEvent->graphicsId -= SPECIES_SHINY_TAG; + } + spriteId = CreateSprite(spriteTemplate, 0, 0, 0); if (spriteId == MAX_SPRITES) { @@ -1720,7 +1729,7 @@ static u16 PackGraphicsId(const struct ObjectEventTemplate *template) u32 form = 0; // set form based on template's script, // if first command is bufferspeciesname - if (graphicsId >= OBJ_EVENT_GFX_MON_BASE) + if (IS_OW_MON_OBJ(template)) { if (template->script && template->script[0] == 0x7d) { @@ -3523,13 +3532,20 @@ bool8 MovementType_WanderAround_Step2(struct ObjectEvent *objectEvent, struct Sp return TRUE; } -bool8 MovementType_WanderAround_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// common; used by all MovementType_Wander*_Step3 +bool8 MovementType_Wander_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (WaitForMovementDelay(sprite)) { + // resets a mid-movement sprite + ClearObjectEventMovement(objectEvent, sprite); sprite->sTypeFuncId = 4; return TRUE; } + else if (OW_MON_WANDER_WALK == TRUE && IS_OW_MON_OBJ(objectEvent)) + { + UpdateMonMoveInPlace(objectEvent, sprite); + } return FALSE; } @@ -3855,16 +3871,6 @@ bool8 MovementType_WanderUpAndDown_Step2(struct ObjectEvent *objectEvent, struct return TRUE; } -bool8 MovementType_WanderUpAndDown_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - if (WaitForMovementDelay(sprite)) - { - sprite->sTypeFuncId = 4; - return TRUE; - } - return FALSE; -} - bool8 MovementType_WanderUpAndDown_Step4(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 direction; @@ -3923,16 +3929,6 @@ bool8 MovementType_WanderLeftAndRight_Step2(struct ObjectEvent *objectEvent, str return TRUE; } -bool8 MovementType_WanderLeftAndRight_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - if (WaitForMovementDelay(sprite)) - { - sprite->sTypeFuncId = 4; - return TRUE; - } - return FALSE; -} - bool8 MovementType_WanderLeftAndRight_Step4(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 direction; @@ -5405,7 +5401,7 @@ bool8 MovementType_FollowPlayer_Active(struct ObjectEvent *objectEvent, struct S // Animate entering pokeball ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_ENTER_POKEBALL); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; // movement action sets state to 0 return TRUE; } @@ -5419,7 +5415,7 @@ bool8 MovementType_FollowPlayer_Moving(struct ObjectEvent *objectEvent, struct S { objectEvent->movementActionId = MOVEMENT_ACTION_NONE; sprite->sActionFuncId = 0; - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; if (sprite->sTypeFuncId) // restore nonzero state sprite->sTypeFuncId = 1; } @@ -5432,25 +5428,35 @@ bool8 MovementType_FollowPlayer_Moving(struct ObjectEvent *objectEvent, struct S return FALSE; } -bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) +// single function for updating an OW mon's walk-in-place movements +static bool32 UpdateMonMoveInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (!objectEvent->singleMovementActive) { // walk in place ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection)); - sprite->sTypeFuncId = 1; - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; return TRUE; } else if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { // finish movement action - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; } else if (OW_FOLLOWERS_BOBBING == TRUE && (sprite->data[3] & 7) == 2) { sprite->y2 ^= -1; } + return FALSE; +} + +bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) +{ + if (UpdateMonMoveInPlace(objectEvent, sprite)) + { + sprite->sTypeFuncId = 1; + return TRUE; + } UpdateFollowerTransformEffect(objectEvent, sprite); return FALSE; } @@ -5487,7 +5493,7 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri } MoveObjectEventToMapCoords(objectEvent, targetX, targetY); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_EXIT_POKEBALL); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; if (OW_FOLLOWERS_BOBBING == TRUE) sprite->y2 = 0; @@ -5534,7 +5540,28 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri } } sprite->sActionFuncId = 0; - objectEvent->singleMovementActive = 1; + if (GetLedgeJumpDirection(x, y, direction) != DIR_NONE) + { + // InitJumpRegular will set the proper speed + ObjectEventSetSingleMovement(objectEvent, sprite, GetJump2MovementAction(direction)); + } + else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_DASH)) + { + // Set follow speed according to player's speed + ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFastMovementAction(direction)); + } + else if (PlayerGetCopyableMovement() == COPY_MOVE_JUMP2) + { + // If *player* jumps, make step take twice as long + ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkSlowMovementAction(direction)); + } + else + { + ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(direction)); + if (OW_FOLLOWERS_BOBBING == TRUE) + sprite->y2 = -1; + } + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; return TRUE; } @@ -5708,6 +5735,13 @@ bool8 MovementType_MoveInPlace_Step1(struct ObjectEvent *objectEvent, struct Spr { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) sprite->sTypeFuncId = 0; + // similar to UpdateMonMoveInPlace + else if (OW_FOLLOWERS_BOBBING == TRUE + && IS_OW_MON_OBJ(objectEvent) + && (sprite->data[3] & 7) == 2) + { + sprite->y2 ^= 1; + } return FALSE; } @@ -10434,15 +10468,18 @@ static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite) static void SetMovementDelay(struct Sprite *sprite, s16 timer) { - sprite->data[3] = timer; + sprite->data[3] = timer; // kept for legacy reasons + sprite->data[7] = timer; // actual timer } static bool8 WaitForMovementDelay(struct Sprite *sprite) { - if (--sprite->data[3] == 0) + if (--sprite->data[7] == 0) + { + sprite->data[3] = 0; // reset animation timer return TRUE; - else - return FALSE; + } + return FALSE; } void SetAndStartSpriteAnim(struct Sprite *sprite, u8 animNum, u8 animCmdIndex) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 01914a8169..51952c3627 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -783,17 +783,39 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior) return FALSE; } +static void StorePlayerStateAndSetupWarp(struct MapPosition *position, s32 warpEventId) +{ + StoreInitialPlayerAvatarState(); + SetupWarp(&gMapHeader, warpEventId, position); +} + static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction) { - s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); + s32 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); + u32 delay; - if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != WARP_ID_NONE) + if (warpEventId == WARP_ID_NONE) + return FALSE; + + if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE) { - StoreInitialPlayerAvatarState(); - SetupWarp(&gMapHeader, warpEventId, position); + StorePlayerStateAndSetupWarp(position, warpEventId); DoWarp(); return TRUE; } + else if (IsDirectionalStairWarpMetatileBehavior(metatileBehavior, direction) == TRUE) + { + delay = 0; + if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_BIKE) + { + SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); + delay = 12; + } + + StorePlayerStateAndSetupWarp(position, warpEventId); + DoStairWarp(metatileBehavior, delay); + return TRUE; + } return FALSE; } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 3c2b65a3b2..5f1710dbff 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -6,6 +6,7 @@ #include "field_camera.h" #include "field_effect.h" #include "field_effect_helpers.h" +#include "field_screen_effect.h" #include "field_player_avatar.h" #include "fieldmap.h" #include "menu.h" @@ -651,6 +652,10 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) PlayerNotOnBikeCollideWithFarawayIslandMew(direction); return; } + else if (collision == COLLISION_STAIR_WARP) + { + PlayerFaceDirection(direction); + } else { u8 adjustedCollision = collision - COLLISION_STOP_SURFING; @@ -694,7 +699,9 @@ static u8 CheckForPlayerAvatarCollision(u8 direction) x = playerObjEvent->currentCoords.x; y = playerObjEvent->currentCoords.y; - + if (IsDirectionalStairWarpMetatileBehavior(MapGridGetMetatileBehaviorAt(x, y), direction)) + return COLLISION_STAIR_WARP; + MoveCoords(direction, &x, &y); return CheckForObjectEventCollision(playerObjEvent, x, y, direction, MapGridGetMetatileBehaviorAt(x, y)); } diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index e39a0c6c1f..073c92f3e0 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -51,6 +51,14 @@ static void Task_WarpAndLoadMap(u8 taskId); static void Task_DoDoorWarp(u8 taskId); static void Task_EnableScriptAfterMusicFade(u8 taskId); +static void ExitStairsMovement(s16*, s16*, s16*, s16*, s16*); +static void GetStairsMovementDirection(u32, s16*, s16*); +static void Task_ExitStairs(u8); +static bool8 WaitStairExitMovementFinished(s16*, s16*, s16*, s16*, s16*); +static void UpdateStairsMovement(s16, s16, s16*, s16*, s16*); +static void Task_StairWarp(u8); +static void ForceStairsMovement(u32, s16*, s16*); + // data[0] is used universally by tasks in this file as a state for switches #define tState data[0] @@ -268,10 +276,14 @@ static void SetUpWarpExitTask(void) behavior = MapGridGetMetatileBehaviorAt(x, y); if (MetatileBehavior_IsDoor(behavior) == TRUE) func = Task_ExitDoor; + else if (MetatileBehavior_IsDirectionalStairWarp(behavior) == TRUE && !gExitStairsMovementDisabled) + func = Task_ExitStairs; else if (MetatileBehavior_IsNonAnimDoor(behavior) == TRUE) func = Task_ExitNonAnimDoor; else func = Task_ExitNonDoor; + + gExitStairsMovementDisabled = FALSE; CreateTask(func, 10); } @@ -1388,3 +1400,237 @@ void FieldCB_RushInjuredPokemonToCenter(void) taskId = CreateTask(Task_RushInjuredPokemonToCenter, 10); gTasks[taskId].tState = FRLG_WHITEOUT_ENTER_MSG_SCREEN; } + +static void GetStairsMovementDirection(u32 metatileBehavior, s16 *speedX, s16 *speedY) +{ + if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + { + *speedX = 16; + *speedY = -10; + } + else if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) + { + *speedX = -17; + *speedY = -10; + } + else if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) + { + *speedX = 17; + *speedY = 3; + } + else if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) + { + *speedX = -17; + *speedY = 3; + } + else + { + *speedX = 0; + *speedY = 0; + } +} + +static bool8 WaitStairExitMovementFinished(s16 *speedX, s16 *speedY, s16 *offsetX, s16 *offsetY, s16 *timer) +{ + struct Sprite *sprite = &gSprites[gPlayerAvatar.spriteId]; + if (*timer != 0) + { + *offsetX += *speedX; + *offsetY += *speedY; + sprite->x2 = *offsetX >> 5; + sprite->y2 = *offsetY >> 5; + (*timer)--; + return TRUE; + } + else + { + sprite->x2 = 0; + sprite->y2 = 0; + return FALSE; + } +} + +static void ExitStairsMovement(s16 *speedX, s16 *speedY, s16 *offsetX, s16 *offsetY, s16 *timer) +{ + s16 x, y; + u32 metatileBehavior; + s32 direction; + struct Sprite *sprite; + + PlayerGetDestCoords(&x, &y); + metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior) || MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + direction = DIR_WEST; + else + direction = DIR_EAST; + + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceSlowMovementAction(direction)); + GetStairsMovementDirection(metatileBehavior, speedX, speedY); + *offsetX = *speedX * 16; + *offsetY = *speedY * 16; + *timer = 16; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->x2 = *offsetX >> 5; + sprite->y2 = *offsetY >> 5; + *speedX *= -1; + *speedY *= -1; +} + +#define tState data[0] +#define tSpeedX data[1] +#define tSpeedY data[2] +#define tOffsetX data[3] +#define tOffsetY data[4] +#define tTimer data[5] + +static void Task_ExitStairs(u8 taskId) +{ + s16 * data = gTasks[taskId].data; + switch (tState) + { + default: + if (WaitForWeatherFadeIn() == TRUE) + { + CameraObjectReset(); + UnlockPlayerFieldControls(); + DestroyTask(taskId); + } + break; + case 0: + Overworld_PlaySpecialMapMusic(); + WarpFadeInScreen(); + LockPlayerFieldControls(); + ExitStairsMovement(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + tState++; + break; + case 1: + if (!WaitStairExitMovementFinished(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer)) + tState++; + break; + } +} + +static void ForceStairsMovement(u32 metatileBehavior, s16 *speedX, s16 *speedY) +{ + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); + GetStairsMovementDirection(metatileBehavior, speedX, speedY); +} +#undef tSpeedX +#undef tSpeedY +#undef tOffsetX +#undef tOffsetY +#undef tTimer + +#define tMetatileBehavior data[1] +#define tSpeedX data[2] +#define tSpeedY data[3] +#define tOffsetX data[4] +#define tOffsetY data[5] +#define tTimer data[6] +#define tDelay data[15] + +static void UpdateStairsMovement(s16 speedX, s16 speedY, s16 *offsetX, s16 *offsetY, s16 *timer) +{ + struct Sprite *playerSprite = &gSprites[gPlayerAvatar.spriteId]; + struct ObjectEvent *playerObjectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + + if (speedY > 0 || *timer > 6) + *offsetY += speedY; + + *offsetX += speedX; + (*timer)++; + playerSprite->x2 = *offsetX >> 5; + playerSprite->y2 = *offsetY >> 5; + if (playerObjectEvent->heldMovementFinished) + ObjectEventForceSetHeldMovement(playerObjectEvent, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); +} + +static void Task_StairWarp(u8 taskId) +{ + s16 * data = gTasks[taskId].data; + struct ObjectEvent *playerObjectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + struct Sprite *playerSprite = &gSprites[gPlayerAvatar.spriteId]; + + switch (tState) + { + case 0: + LockPlayerFieldControls(); + FreezeObjectEvents(); + CameraObjectFreeze(); + tState++; + break; + case 1: + if (!ObjectEventIsMovementOverridden(playerObjectEvent) || ObjectEventClearHeldMovementIfFinished(playerObjectEvent)) + { + if (tDelay != 0) + { + tDelay--; + } + else + { + TryFadeOutOldMapMusic(); + PlayRainStoppingSoundEffect(); + playerSprite->oam.priority = 1; + ForceStairsMovement(tMetatileBehavior, &tSpeedX, &tSpeedY); + PlaySE(SE_EXIT); + tState++; + } + } + break; + case 2: + UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + tDelay++; + if (tDelay >= 12) + { + WarpFadeOutScreen(); + tState++; + } + break; + case 3: + UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + if (!PaletteFadeActive() && BGMusicStopped()) + tState++; + break; + default: + gFieldCallback = FieldCB_DefaultWarpExit; + WarpIntoMap(); + SetMainCallback2(CB2_LoadMap); + DestroyTask(taskId); + break; + } +} + +void DoStairWarp(u16 metatileBehavior, u16 delay) +{ + u8 taskId = CreateTask(Task_StairWarp, 10); + gTasks[taskId].tMetatileBehavior = metatileBehavior; + gTasks[taskId].tDelay = delay; + Task_StairWarp(taskId); +} + +#undef tMetatileBehavior +#undef tSpeedX +#undef tSpeedY +#undef tOffsetX +#undef tOffsetY +#undef tTimer +#undef tDelay + +bool32 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection) +{ + if (playerDirection == DIR_WEST) + { + if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) + return TRUE; + } + else if (playerDirection == DIR_EAST) + { + if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) + return TRUE; + } + return FALSE; +} diff --git a/src/item_use.c b/src/item_use.c index fd74b7082b..d38c4b1f98 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1491,7 +1491,7 @@ void FieldUseFunc_VsSeeker(u8 taskId) SetUpItemUseOnFieldCallback(taskId); } else - DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].data[3]); + DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem); } void Task_ItemUse_CloseMessageBoxAndReturnToField_VsSeeker(u8 taskId) diff --git a/src/main.c b/src/main.c index 47907a0111..616c67800b 100644 --- a/src/main.c +++ b/src/main.c @@ -34,6 +34,7 @@ static void IntrDummy(void); // Defined in the linker script so that the test build can override it. extern void gInitialMainCB2(void); +extern void CB2_FlashNotDetectedScreen(void); const u8 gGameVersion = GAME_VERSION; @@ -114,7 +115,7 @@ void AgbMain() gSoftResetDisabled = FALSE; if (gFlashMemoryPresent != TRUE) - SetMainCallback2(NULL); + SetMainCallback2((SAVE_TYPE_ERROR_SCREEN) ? CB2_FlashNotDetectedScreen : NULL); gLinkTransferringData = FALSE; diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 5cc1f3cfd5..500d45e866 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -625,7 +625,7 @@ static void LoadMapNamePopUpWindowBg(void) switch (popUpThemeId) { // add additional gen 5-style pop-up themes as cases here - case MAPPOPUP_THEME_BW_DEFAULT: + default: // MAPPOPUP_THEME_BW_DEFAULT if (OW_POPUP_BW_COLOR == OW_POPUP_BW_COLOR_WHITE) LoadPalette(sMapPopUpTilesPalette_BW_White, BG_PLTT_ID(14), sizeof(sMapPopUpTilesPalette_BW_White)); else diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 7a447148e1..98914ae5e8 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1409,17 +1409,60 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) return FALSE; } -bool32 MetatileBehavior_IsSignpost(u32 metatileBehavior) +bool8 MetatileBehavior_IsDirectionalUpRightStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_UP_RIGHT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalUpLeftStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_UP_LEFT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalDownRightStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_DOWN_RIGHT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalDownLeftStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_DOWN_LEFT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_UP_RIGHT_STAIR_WARP + || metatileBehavior == MB_UP_LEFT_STAIR_WARP + || metatileBehavior == MB_DOWN_RIGHT_STAIR_WARP + || metatileBehavior == MB_DOWN_LEFT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSignpost(u32 metatileBehavior) { return (metatileBehavior == MB_SIGNPOST); } -bool32 MetatileBehavior_IsPokemonCenterSign(u32 metatileBehavior) +bool8 MetatileBehavior_IsPokemonCenterSign(u32 metatileBehavior) { return (metatileBehavior == MB_POKEMON_CENTER_SIGN); } -bool32 MetatileBehavior_IsPokeMartSign(u32 metatileBehavior) +bool8 MetatileBehavior_IsPokeMartSign(u32 metatileBehavior) { return (metatileBehavior == MB_POKEMART_SIGN); } diff --git a/src/overworld.c b/src/overworld.c index e104cbdcf0..8b06037d73 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -204,6 +204,7 @@ EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0 EWRAM_DATA static u16 sAmbientCrySpecies = 0; EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE; EWRAM_DATA struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4] = {0}; +EWRAM_DATA bool8 gExitStairsMovementDisabled = FALSE; static const struct WarpData sDummyWarpData = { @@ -1003,6 +1004,10 @@ static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStr return DIR_EAST; else if (MetatileBehavior_IsEastArrowWarp(metatileBehavior) == TRUE) return DIR_WEST; + else if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior) == TRUE || MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior) == TRUE) + return DIR_WEST; + else if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior) == TRUE || MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior) == TRUE) + return DIR_EAST; else if ((playerStruct->transitionFlags == PLAYER_AVATAR_FLAG_UNDERWATER && transitionFlags == PLAYER_AVATAR_FLAG_SURFING) || (playerStruct->transitionFlags == PLAYER_AVATAR_FLAG_SURFING && transitionFlags == PLAYER_AVATAR_FLAG_UNDERWATER)) return playerStruct->direction; @@ -1803,6 +1808,7 @@ void CB2_ContinueSavedGame(void) PlayTimeCounter_Start(); ScriptContext_Init(); UnlockPlayerFieldControls(); + gExitStairsMovementDisabled = TRUE; InitMatchCallCounters(); if (UseContinueGameWarp() == TRUE) { @@ -1888,6 +1894,7 @@ static bool32 LoadMapInStepsLink(u8 *state) (*state)++; break; case 1: + gExitStairsMovementDisabled = FALSE; LoadMapFromWarp(TRUE); (*state)++; break; diff --git a/src/party_menu.c b/src/party_menu.c index 5def34b3eb..85109415b2 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -32,7 +32,7 @@ #include "item.h" #include "item_menu.h" #include "item_use.h" -#include "level_caps.h" +#include "caps.h" #include "link.h" #include "link_rfu.h" #include "mail.h" @@ -4672,7 +4672,7 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) if (canHeal == TRUE) { if (hp == 0) - AnimatePartySlot(gPartyMenu.slotId, 1); + AnimatePartySlot(gPartyMenu.slotId, 1); PartyMenuModifyHP(taskId, gPartyMenu.slotId, 1, GetMonData(mon, MON_DATA_HP) - hp, Task_DisplayHPRestoredMessage); ResetHPTaskData(taskId, 0, hp); return; diff --git a/src/pokemon.c b/src/pokemon.c index faa1a65aef..3929303e70 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -19,7 +19,7 @@ #include "field_weather.h" #include "graphics.h" #include "item.h" -#include "level_caps.h" +#include "caps.h" #include "link.h" #include "main.h" #include "overworld.h" @@ -60,7 +60,6 @@ #include "constants/union_room.h" #include "constants/weather.h" #include "wild_encounter.h" -#include "ev_caps.h" #define FRIENDSHIP_EVO_THRESHOLD ((P_FRIENDSHIP_EVO_THRESHOLD >= GEN_9) ? 160 : 220) @@ -686,7 +685,7 @@ const struct NatureInfo gNaturesInfo[NUM_NATURES] = #elif P_LVL_UP_LEARNSETS >= GEN_8 #include "data/pokemon/level_up_learnsets/gen_8.h" // Sword/Shield #elif P_LVL_UP_LEARNSETS >= GEN_7 -#include "data/pokemon/level_up_learnsets/gen_7.h" // Ultra Sun/ Ultra Moon +#include "data/pokemon/level_up_learnsets/gen_7.h" // Ultra Sun/Ultra Moon #elif P_LVL_UP_LEARNSETS >= GEN_6 #include "data/pokemon/level_up_learnsets/gen_6.h" // Omega Ruby/Alpha Sapphire #elif P_LVL_UP_LEARNSETS >= GEN_5 @@ -3879,11 +3878,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // Ensure the increase does not exceed the max EV per stat (252) evCap = (itemEffect[10] & ITEM10_IS_VITAMIN) ? EV_ITEM_RAISE_LIMIT : MAX_PER_STAT_EVS; - + // Check if the per-stat limit is reached if (dataSigned >= evCap) return TRUE; // Prevents item use if the per-stat cap is already reached - + if (dataSigned + evChange > evCap) temp2 = evCap - dataSigned; else @@ -4068,11 +4067,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // Ensure the increase does not exceed the max EV per stat (252) evCap = (itemEffect[10] & ITEM10_IS_VITAMIN) ? EV_ITEM_RAISE_LIMIT : MAX_PER_STAT_EVS; - + // Check if the per-stat limit is reached if (dataSigned >= evCap) return TRUE; // Prevents item use if the per-stat cap is already reached - + if (dataSigned + evChange > evCap) temp2 = evCap - dataSigned; else diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index e9257debf2..9bd981facc 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -399,3 +399,55 @@ static bool8 WipeSectors(u32 sectorBits) else return TRUE; } + +void CB2_FlashNotDetectedScreen(void) +{ + static const struct WindowTemplate textWin[] = + { + { + .bg = 0, + .tilemapLeft = 3, + .tilemapTop = 2, + .width = 24, + .height = 16, + .paletteNum = 15, + .baseBlock = 1, + } + }; + + if (gMain.state) + return; + + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + DmaFill16(3, 0, VRAM, VRAM_SIZE); + DmaFill32(3, 0, OAM, OAM_SIZE); + DmaFill16(3, 0, PLTT, PLTT_SIZE); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); + LoadBgTiles(0, gTextWindowFrame1_Gfx, 0x120, 0x214); + DeactivateAllTextPrinters(); + ResetTasks(); + ResetPaletteFade(); + LoadPalette(gTextWindowFrame1_Pal, 0xE0, 0x20); + LoadPalette(gStandardMenuPalette, 0xF0, 0x20); + InitWindows(textWin); + DrawStdFrameWithCustomTileAndPalette(0, TRUE, 0x214, 0xE); + static const u8 saveFailedMessage[] =_( + "{COLOR RED}ERROR! {COLOR DARK_GRAY}Flash memory not detected!\n" + "\n" + "If playing on an emulator, set your\n" + "save type setting to\n" + "Flash 1Mb/128K and reload the ROM.\n" + "\n" + "If playing on hardware, your cart\n" + "does not have a working flash chip."); + SaveFailedScreenTextPrint(saveFailedMessage, 1, 0); + TransferPlttBuffer(); + *(u16*)PLTT = RGB(17, 18, 31); + ShowBg(0); + gMain.state++; +} diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c index 660a719c69..2132530958 100644 --- a/test/battle/ability/dancer.c +++ b/test/battle/ability/dancer.c @@ -145,3 +145,104 @@ SINGLE_BATTLE_TEST("Dancer-called attacks have their type updated") MESSAGE("It's super effective!"); } } + +DOUBLE_BATTLE_TEST("Dancer doesn't trigger on a snatched move") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_SNATCH].effect == EFFECT_SNATCH); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ORICORIO); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_SNATCH); MOVE(playerRight, MOVE_DRAGON_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SNATCH, opponentRight); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + NONE_OF { + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Dancer triggers on Instructed dance moves") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].instructBanned == FALSE); + ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ORICORIO); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_DRAGON_DANCE); MOVE(playerLeft, MOVE_INSTRUCT, target: playerRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + } +} + +DOUBLE_BATTLE_TEST("Dancer-called move doesn't update move to be Instructed") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_TACKLE].instructBanned == FALSE); + ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ORICORIO); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); MOVE(playerRight, MOVE_DRAGON_DANCE); MOVE(opponentRight, MOVE_INSTRUCT, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + } +} + +DOUBLE_BATTLE_TEST("Dancer doesn't call a move that didn't execute due to Powder") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FIERY_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_FIERY_DANCE].type == TYPE_FIRE); + PLAYER(SPECIES_VOLCARONA); + PLAYER(SPECIES_ORICORIO); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerLeft, MOVE_FIERY_DANCE, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIERY_DANCE, playerLeft); + HP_BAR(opponentLeft); + ABILITY_POPUP(playerRight, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIERY_DANCE, playerRight); + } + } +} diff --git a/test/battle/ability/tangling_hair.c b/test/battle/ability/tangling_hair.c index 0dbc0264ce..508678a037 100644 --- a/test/battle/ability/tangling_hair.c +++ b/test/battle/ability/tangling_hair.c @@ -50,10 +50,10 @@ SINGLE_BATTLE_TEST("Tangling Hair does not cause Rocky Helmet miss activation") } } -SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant") +SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant and keeps original attacker/target") { GIVEN { - PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); Item(ITEM_ROCKY_HELMET); } OPPONENT(SPECIES_PAWNIARD) { Ability(ABILITY_DEFIANT); } } WHEN { TURN { MOVE(opponent, MOVE_TACKLE); } @@ -64,5 +64,7 @@ SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant") MESSAGE("Foe Pawniard's Speed fell!"); ABILITY_POPUP(opponent, ABILITY_DEFIANT); MESSAGE("Foe Pawniard's Attack sharply rose!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Foe Pawniard was hurt by Dugtrio's Rocky Helmet!"); } } diff --git a/test/battle/ability/trace.c b/test/battle/ability/trace.c index acc49bcf13..3042f8e22b 100644 --- a/test/battle/ability/trace.c +++ b/test/battle/ability/trace.c @@ -80,6 +80,21 @@ SINGLE_BATTLE_TEST("Trace will copy an opponent's ability whenever it has the ch } } + +SINGLE_BATTLE_TEST("Trace copies opponent's Intimidate and triggers it immediately") +{ + GIVEN { + PLAYER(SPECIES_RALTS) { Ability(ABILITY_TRACE); } + OPPONENT(SPECIES_MASQUERAIN) { Ability(ABILITY_INTIMIDATE); } + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(player, ABILITY_TRACE); + ABILITY_POPUP(player, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + } +} + DOUBLE_BATTLE_TEST("Trace respects the turn order") { GIVEN { diff --git a/test/battle/ai/ai_switching.c b/test/battle/ai/ai_switching.c index b3927509f0..6fb9b499d9 100644 --- a/test/battle/ai/ai_switching.c +++ b/test/battle/ai/ai_switching.c @@ -360,7 +360,7 @@ AI_SINGLE_BATTLE_TEST("AI won't use trapping behaviour if player only has 1 mon AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if mon would be OKHO'd and they have a good switchin 50% of the time") { - PASSES_RANDOMLY(50, 100, RNG_AI_HASBADODDS); + PASSES_RANDOMLY(50, 100, RNG_AI_SWITCH_HASBADODDS); GIVEN { ASSUME(gSpeciesInfo[SPECIES_RHYDON].types[0] == TYPE_GROUND); ASSUME(gSpeciesInfo[SPECIES_PELIPPER].types[0] == TYPE_WATER); @@ -375,3 +375,50 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if mon would TURN { MOVE(player, MOVE_THUNDERBOLT) ; EXPECT_SWITCH(opponent, 1); } } } + +AI_SINGLE_BATTLE_TEST("Switch AI: AI will switch out if it can't deal damage to a mon with Wonder Guard 66% of the time") +{ + u32 aiOmniscientFlag = 0; + PARAMETRIZE { aiOmniscientFlag = 0; } + PARAMETRIZE { aiOmniscientFlag = AI_FLAG_OMNISCIENT; } + PASSES_RANDOMLY(66, 100, RNG_AI_SWITCH_WONDER_GUARD); + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[0] == TYPE_BUG); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[1] == TYPE_GHOST); + ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiOmniscientFlag); + PLAYER(SPECIES_SHEDINJA) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SHADOW_BALL); } + } WHEN { + if(aiOmniscientFlag == 0) { + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_MOVE(opponent, MOVE_TACKLE); } + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_SWITCH(opponent, 1); } + } + else { + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_SWITCH(opponent, 1); } + } + + } +} + +AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it can't deal damage to a mon with Wonder Guard 100% of the time") +{ + PASSES_RANDOMLY(100, 100, RNG_AI_SWITCH_WONDER_GUARD); + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[0] == TYPE_BUG); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[1] == TYPE_GHOST); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[0] == ABILITY_WONDER_GUARD); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[1] == ABILITY_NONE); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[2] == ABILITY_NONE); + ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); + PLAYER(SPECIES_SHEDINJA) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SHADOW_BALL); } + } WHEN { + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_SWITCH(opponent, 1); } + } +} diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index 2f2f406827..df19a1d0d6 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -234,3 +234,101 @@ SINGLE_BATTLE_TEST("Primal reversion happens immediately if it was brought in by EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); } } + + +DOUBLE_BATTLE_TEST("Primal reversion triggers for multiple battlers if multiple fainted the previous turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_CATERPIE) { HP(1); } + PLAYER(SPECIES_RESHIRAM); + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_EARTHQUAKE); + SEND_OUT(opponentRight, 3); + SEND_OUT(opponentLeft, 2); + SEND_OUT(playerRight, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, playerLeft); + ABILITY_POPUP(opponentLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(opponentRight, ABILITY_DESOLATE_LAND); + } +} + +DOUBLE_BATTLE_TEST("Primal reversion triggers for all battlers if multiple fainted the previous turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_CATERPIE) { HP(1); } + PLAYER(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_EXPLOSION); + SEND_OUT(opponentRight, 3); + SEND_OUT(opponentLeft, 2); + SEND_OUT(playerRight, 3); + SEND_OUT(playerLeft, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft); + ABILITY_POPUP(playerLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(playerRight, ABILITY_DESOLATE_LAND); + ABILITY_POPUP(opponentLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(opponentRight, ABILITY_DESOLATE_LAND); + } +} + +DOUBLE_BATTLE_TEST("Primal reversion and other switch-in effects trigger for all battlers if multiple fainted the previous turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); + ASSUME(gMovesInfo[MOVE_SPIKES].effect == EFFECT_SPIKES); + ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_CATERPIE) { HP(1); } + PLAYER(SPECIES_SCRAFTY) { Ability(ABILITY_INTIMIDATE); } + PLAYER(SPECIES_RESHIRAM); + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_STICKY_WEB); + MOVE(opponentLeft, MOVE_SPIKES); + MOVE(playerRight, MOVE_TOXIC_SPIKES); } + TURN { MOVE(playerLeft, MOVE_EXPLOSION); + SEND_OUT(opponentRight, 3); + SEND_OUT(opponentLeft, 2); + SEND_OUT(playerRight, 3); + SEND_OUT(playerLeft, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STICKY_WEB, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIKES, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC_SPIKES, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft); + ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE); + ABILITY_POPUP(playerRight, ABILITY_TURBOBLAZE); + ABILITY_POPUP(opponentLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(opponentRight, ABILITY_DESOLATE_LAND); + } THEN { + EXPECT_NE(playerLeft->hp, playerLeft->maxHP); + EXPECT_NE(playerRight->hp, playerRight->maxHP); + EXPECT_EQ(opponentLeft->status1, STATUS1_POISON); + EXPECT_EQ(opponentRight->status1, STATUS1_POISON); + EXPECT_EQ(opponentLeft->statStages[STAT_ATK], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(opponentRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(opponentLeft->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); + } +} diff --git a/test/battle/gimmick/zmove.c b/test/battle/gimmick/zmove.c index 51c6516106..4e6fc26cae 100644 --- a/test/battle/gimmick/zmove.c +++ b/test/battle/gimmick/zmove.c @@ -397,6 +397,60 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Sleep Talk turns Weather Ball into Breakneck Blit } } +SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves and deals 25% of maximum HP to the user") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FIRIUM_Z); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER, gimmick: GIMMICK_Z_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, player); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_INFERNO_OVERDRIVE, player); + } THEN { + EXPECT_MUL_EQ(player->maxHP, UQ_4_12(0.75), player->hp); + } +} + +DOUBLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves (from Z-Mirror Move)") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].type == TYPE_FLYING); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FLYINIUM_Z); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, MOVE_EMBER, target: playerLeft); MOVE(playerLeft, MOVE_MIRROR_MOVE, gimmick: GIMMICK_Z_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, playerLeft); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_INFERNO_OVERDRIVE, playerLeft); + } +} + +SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves but not boosts granted") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_WILL_O_WISP].type == TYPE_FIRE); + ASSUME(gMovesInfo[MOVE_WILL_O_WISP].zMove.effect == Z_EFFECT_ATK_UP_1); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FIRIUM_Z); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_WILL_O_WISP, gimmick: GIMMICK_Z_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, player); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, player); + } THEN { + EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + } +} + // Miscellaneous Interactions DOUBLE_BATTLE_TEST("(Z-MOVE) Instruct fails if the target last used a Z-Move") { diff --git a/test/battle/hold_effect/micle_berry.c b/test/battle/hold_effect/micle_berry.c index 2bc44c8069..87f6742609 100644 --- a/test/battle/hold_effect/micle_berry.c +++ b/test/battle/hold_effect/micle_berry.c @@ -64,3 +64,36 @@ SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2") ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBMISSION, player); } } + +SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move across turns") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ROCK_SLIDE].accuracy == 90); + PASSES_RANDOMLY(100, 100, RNG_ACCURACY); + PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(26); Item(ITEM_MICLE_BERRY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + TURN { MOVE(player, MOVE_ROCK_SLIDE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, player); + } +} + +SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move the same turn the berry was triggered") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ROCK_SLIDE].accuracy == 90); + PASSES_RANDOMLY(100, 100, RNG_ACCURACY); + PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(26); Item(ITEM_MICLE_BERRY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_ROCK_SLIDE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, player); + } +} diff --git a/test/battle/hold_effect/ogerpon_mask.c b/test/battle/hold_effect/ogerpon_mask.c new file mode 100644 index 0000000000..31fb0511f4 --- /dev/null +++ b/test/battle/hold_effect/ogerpon_mask.c @@ -0,0 +1,36 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gItemsInfo[ITEM_CORNERSTONE_MASK].holdEffect == HOLD_EFFECT_OGERPON_MASK); + ASSUME(gItemsInfo[ITEM_WELLSPRING_MASK].holdEffect == HOLD_EFFECT_OGERPON_MASK); + ASSUME(gItemsInfo[ITEM_HEARTHFLAME_MASK].holdEffect == HOLD_EFFECT_OGERPON_MASK); + ASSUME(gItemsInfo[ITEM_CORNERSTONE_MASK].holdEffectParam == 20); + ASSUME(gItemsInfo[ITEM_WELLSPRING_MASK].holdEffectParam == 20); + ASSUME(gItemsInfo[ITEM_HEARTHFLAME_MASK].holdEffectParam == 20); +} + +SINGLE_BATTLE_TEST("Ogerpon Masks increase the base power of moves by 20%", s16 damage) +{ + u32 species; + u32 item; + PARAMETRIZE { species = SPECIES_OGERPON_TEAL_MASK; item = ITEM_NONE; } + PARAMETRIZE { species = SPECIES_OGERPON_WELLSPRING_MASK; item = ITEM_CORNERSTONE_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_HEARTHFLAME_MASK; item = ITEM_WELLSPRING_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_CORNERSTONE_MASK; item = ITEM_HEARTHFLAME_MASK; } + + GIVEN { + ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + PLAYER(species) { Item(item); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.2), results[1].damage); + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.2), results[2].damage); + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.2), results[3].damage); + } +} diff --git a/test/battle/move_effect/after_you.c b/test/battle/move_effect/after_you.c index fa6e47e0e2..32ea44efb1 100644 --- a/test/battle/move_effect/after_you.c +++ b/test/battle/move_effect/after_you.c @@ -52,5 +52,82 @@ DOUBLE_BATTLE_TEST("After You does nothing if the target has already moved") } } -TO_DO_BATTLE_TEST("After You doesn't fail if the turner remains the same after After You (Gen8+)"); -TO_DO_BATTLE_TEST("After You ignores the effects of Quash"); +DOUBLE_BATTLE_TEST("After You calculates correct turn order if only one pokemon is left on the opposing side") +{ + GIVEN { + PLAYER(SPECIES_GRENINJA) { Speed(120); } + PLAYER(SPECIES_REGIROCK) { Speed(10); } + OPPONENT(SPECIES_PIDGEOT) { Speed(100); } + OPPONENT(SPECIES_DRAGONITE) { Speed(60); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_AFTER_YOU, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentLeft); + MOVE(opponentRight, MOVE_CELEBRATE); + } + TURN { + MOVE(playerLeft, MOVE_AFTER_YOU, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentRight); + MOVE(opponentRight, MOVE_CELEBRATE); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, playerLeft); + MESSAGE("Regirock took the kind offer!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentLeft); + MESSAGE("Foe Pidgeot fainted!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, playerLeft); + MESSAGE("Regirock took the kind offer!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + } +} + +DOUBLE_BATTLE_TEST("After You doesn't fail if the turn order remains the same after After You (Gen8+)") +{ + GIVEN { + ASSUME(B_AFTER_YOU_TURN_ORDER >= GEN_8); + PLAYER(SPECIES_WOBBUFFET) { Speed(4); } + PLAYER(SPECIES_WYNAUT) { Speed(1); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } + OPPONENT(SPECIES_WYNAUT) { Speed(3); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_CELEBRATE); + MOVE(playerRight, MOVE_CELEBRATE); + MOVE(opponentLeft, MOVE_CELEBRATE); + MOVE(opponentRight, MOVE_AFTER_YOU, target: opponentLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); + } +} + +DOUBLE_BATTLE_TEST("After You ignores the effects of Quash") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_QUASH].effect == EFFECT_QUASH); + PLAYER(SPECIES_WOBBUFFET) { Speed(4); } + PLAYER(SPECIES_WYNAUT) { Speed(1); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } + OPPONENT(SPECIES_WYNAUT) { Speed(3); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_QUASH, target: opponentLeft); + MOVE(playerRight, MOVE_CELEBRATE); + MOVE(opponentLeft, MOVE_CELEBRATE); + MOVE(opponentRight, MOVE_AFTER_YOU, target: opponentLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); + } +} diff --git a/test/battle/move_effect/destiny_bond.c b/test/battle/move_effect/destiny_bond.c new file mode 100644 index 0000000000..baba378f6b --- /dev/null +++ b/test/battle/move_effect/destiny_bond.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Destiny Bond faints the opposing mon if it fainted from the attack") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DESTINY_BOND); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DESTINY_BOND, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + MESSAGE("Wobbuffet took Foe Wobbuffet with it!"); + MESSAGE("Foe Wobbuffet fainted!"); + } +} diff --git a/test/battle/move_effect/dragon_darts.c b/test/battle/move_effect/dragon_darts.c index 8190f0f4bd..08913d6011 100644 --- a/test/battle/move_effect/dragon_darts.c +++ b/test/battle/move_effect/dragon_darts.c @@ -94,6 +94,83 @@ DOUBLE_BATTLE_TEST("Dragon Darts strikes the left ally twice if the target is a } } +DOUBLE_BATTLE_TEST("Dragon Darts strikes left ally twice if electrified and right ally has Volt Absorb") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + MESSAGE("Hit 2 time(s)!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Darts strikes right ally twice if electrified and left ally has Volt Absorb") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + MESSAGE("Hit 2 time(s)!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Darts strikes left ally twice if electrified and right ally has Motor Drive") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); }; + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + MESSAGE("Hit 2 time(s)!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Darts strikes right ally twice if electrified and left ally has Motor Drive") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + MESSAGE("Hit 2 time(s)!"); + } +} + + DOUBLE_BATTLE_TEST("Dragon Darts strikes the ally twice if the target is in a semi-invulnerable turn") { GIVEN { diff --git a/test/battle/move_effect/multi_hit.c b/test/battle/move_effect/multi_hit.c index df9cfea807..052226d1c8 100644 --- a/test/battle/move_effect/multi_hit.c +++ b/test/battle/move_effect/multi_hit.c @@ -160,6 +160,46 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after final } } +SINGLE_BATTLE_TEST("Scale Shot is immune to Fairy types and will end the move correctly") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].type == TYPE_DRAGON); + ASSUME(gSpeciesInfo[SPECIES_CLEFAIRY].types[0] == TYPE_FAIRY || gSpeciesInfo[SPECIES_CLEFAIRY].types[1] == TYPE_FAIRY); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_CLEFAIRY) { HP(1); } + } WHEN { + TURN { MOVE(player, MOVE_SCALE_SHOT); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + MESSAGE("It doesn't affect Foe Clefairy…"); + } +} + +DOUBLE_BATTLE_TEST("Scale Shot does not corrupt the next turn move used") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_SCALE_SHOT, target: opponentRight); SWITCH(playerLeft, 2); SEND_OUT(opponentRight, 2); } + TURN { MOVE(playerRight, MOVE_BULLDOZE); MOVE(playerLeft, MOVE_CELEBRATE); MOVE(opponentRight, MOVE_CELEBRATE); MOVE(opponentLeft, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, playerRight); + HP_BAR(opponentRight); + MESSAGE("Hit 1 time(s)!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLDOZE, playerRight); + HP_BAR(playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + } +} + SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn") { GIVEN { @@ -231,3 +271,28 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after killi MESSAGE("Bagon's Speed rose!"); } } + +SINGLE_BATTLE_TEST("Multi Hit moves will not disrupt Destiny Bond flag") +{ + u32 hp; + PARAMETRIZE { hp = 11; } + PARAMETRIZE { hp = 55; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(55); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DESTINY_BOND); MOVE(opponent, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DESTINY_BOND, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + if (hp == 55) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + } + MESSAGE("Wobbuffet took Foe Wobbuffet with it!"); + MESSAGE("Foe Wobbuffet fainted!"); + } +} diff --git a/test/battle/move_effect/pledge.c b/test/battle/move_effect/pledge.c index d2cc16aa47..2098217827 100644 --- a/test/battle/move_effect/pledge.c +++ b/test/battle/move_effect/pledge.c @@ -331,6 +331,51 @@ DOUBLE_BATTLE_TEST("Damage calculation: Combined pledge move") } } +DOUBLE_BATTLE_TEST("Pledge move combo interactions with Powder are correct") +{ + // Fire Pledge as the first move or Fire Pledge combo should fail + u32 moveLeft, moveRight, speedLeft, speedRight; + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_WATER_PLEDGE; speedLeft = 4; speedRight = 3; } // FAIL 1 + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_WATER_PLEDGE; speedLeft = 3; speedRight = 4; } + PARAMETRIZE { moveLeft = MOVE_WATER_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 4; speedRight = 3; } + PARAMETRIZE { moveLeft = MOVE_WATER_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 3; speedRight = 4; } + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_GRASS_PLEDGE; speedLeft = 4; speedRight = 3; } // FAIL 1 + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_GRASS_PLEDGE; speedLeft = 3; speedRight = 4; } // FAIL 2 + PARAMETRIZE { moveLeft = MOVE_GRASS_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 4; speedRight = 3; } + PARAMETRIZE { moveLeft = MOVE_GRASS_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 3; speedRight = 4; } // FAIL 2 + GIVEN { + ASSUME(gMovesInfo[MOVE_FIRE_PLEDGE].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Speed(speedLeft); } + PLAYER(SPECIES_WYNAUT) { Speed(speedRight); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } + OPPONENT(SPECIES_VIVILLON) { Speed(5); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerLeft, moveLeft, target: opponentLeft); MOVE(playerRight, moveRight, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + if (speedLeft > speedRight && moveLeft == MOVE_FIRE_PLEDGE) { // FAIL 1 + NOT ANIMATION(ANIM_TYPE_MOVE, moveLeft, playerLeft); + HP_BAR(playerLeft); + ANIMATION(ANIM_TYPE_MOVE, moveRight, playerRight); + } + else if (speedLeft > speedRight) { + NOT HP_BAR(playerLeft); + if (moveLeft == MOVE_GRASS_PLEDGE) + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerRight); + else + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerRight); + } + else if (moveLeft == MOVE_WATER_PLEDGE || moveRight == MOVE_WATER_PLEDGE) { + NOT HP_BAR(playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + } + else { // FAIL 2 + HP_BAR(playerLeft); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + } +} + DOUBLE_BATTLE_TEST("Pledge move combo fails if ally fails to act - Sleep Right") { u32 speedPLeft, speedPRight, speedOLeft, speedORight; diff --git a/test/battle/move_effect/powder.c b/test/battle/move_effect/powder.c new file mode 100644 index 0000000000..dbd1570e6c --- /dev/null +++ b/test/battle/move_effect/powder.c @@ -0,0 +1,295 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_POWDER].effect == EFFECT_POWDER); + ASSUME(gMovesInfo[MOVE_POWDER].powderMove == TRUE); + ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); +} + + +SINGLE_BATTLE_TEST("Powder blocks the target's Fire type moves and deals 25% of maximum HP to target") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_MUL_EQ(player->maxHP, UQ_4_12(0.75), player->hp); + } +} + +SINGLE_BATTLE_TEST("Powder blocks the target's Fire type moves and consumes PP") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_EMBER); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->pp[0], gMovesInfo[MOVE_EMBER].pp - 1); + } +} + +SINGLE_BATTLE_TEST("Powder only blocks the target's Fire type moves on the same turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); } + TURN { MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } THEN { + EXPECT_EQ(player->maxHP, player->hp); + } +} + +SINGLE_BATTLE_TEST("Powder doesn't damage target if it has Magic Guard") +{ + GIVEN { + PLAYER(SPECIES_ALAKAZAM) { Ability(ABILITY_MAGIC_GUARD); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->maxHP, player->hp); + } +} + +SINGLE_BATTLE_TEST("Powder doesn't damage target under heavy rain") +{ + GIVEN { + ASSUME(B_POWDER_RAIN >= GEN_7); + PLAYER(SPECIES_KYOGRE_PRIMAL) { Ability(ABILITY_PRIMORDIAL_SEA); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->maxHP, player->hp); + } +} + +DOUBLE_BATTLE_TEST("Powder blocks the target's Fire type moves even if it doesn't target Powder user") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerLeft, MOVE_EMBER, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, playerLeft); + HP_BAR(opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Powder fails if target is already affected by Powder") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, MOVE_POWDER, target: playerLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentLeft); + } +} + +SINGLE_BATTLE_TEST("Powder fails if the target is Grass type") +{ + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_VENUSAUR].types[0] == TYPE_GRASS || gSpeciesInfo[SPECIES_VENUSAUR].types[1] == TYPE_GRASS); + PLAYER(SPECIES_VENUSAUR); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } +} + +SINGLE_BATTLE_TEST("Powder fails if the target has Overcoat") +{ + GIVEN { + PLAYER(SPECIES_FORRETRESS) { Ability(ABILITY_OVERCOAT); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } +} + +DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it was given Grass type") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].effect == EFFECT_THIRD_TYPE); + ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].argument == TYPE_GRASS); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_TREVENANT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, MOVE_FORESTS_CURSE, target: playerLeft); MOVE(playerLeft, MOVE_EMBER, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FORESTS_CURSE, opponentLeft); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, playerLeft); + HP_BAR(opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it was given Overcoat") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DOODLE].effect == EFFECT_DOODLE); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_FORRETRESS) { Ability(ABILITY_OVERCOAT); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerRight, MOVE_DOODLE, target: opponentLeft); MOVE(playerLeft, MOVE_EMBER, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, playerLeft); + HP_BAR(opponentLeft); + } + } THEN { + EXPECT_EQ(playerLeft->ability, ABILITY_OVERCOAT); + } +} + +SINGLE_BATTLE_TEST("Powder prevents Protean from changing its user to Fire type") +{ + GIVEN { + PLAYER(SPECIES_GRENINJA) { Ability(ABILITY_PROTEAN); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ABILITY_POPUP(player, ABILITY_PROTEAN); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } +} + +SINGLE_BATTLE_TEST("Powder doesn't prevent a Fire move from thawing its user out") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].thawsUser); + ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_FLAME_WHEEL); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + MESSAGE("Wobbuffet was defrosted by Flame Wheel!"); + STATUS_ICON(player, none: TRUE); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLAME_WHEEL, player); + HP_BAR(opponent); + } + } +} + +SINGLE_BATTLE_TEST("Powder doesn't consume Berry from Fire type Natural Gift but prevents using the move") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_NATURAL_GIFT].effect == EFFECT_NATURAL_GIFT); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_CHERI_BERRY); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_NATURAL_GIFT); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_NATURAL_GIFT, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->item, ITEM_CHERI_BERRY); + } +} + +DOUBLE_BATTLE_TEST("Powder damages a target using Shell Trap even if it wasn't hit by a Physical move") +{ + u32 move; + PARAMETRIZE { move = MOVE_TACKLE; } + PARAMETRIZE { move = MOVE_EMBER; } + PARAMETRIZE { move = MOVE_TICKLE;} + GIVEN { + ASSUME(gMovesInfo[MOVE_SHELL_TRAP].effect == EFFECT_SHELL_TRAP); + ASSUME(gMovesInfo[MOVE_SHELL_TRAP].type == TYPE_FIRE); + ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(gMovesInfo[MOVE_EMBER].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(gMovesInfo[MOVE_TICKLE].category == DAMAGE_CATEGORY_STATUS); + ASSUME(gMovesInfo[MOVE_TICKLE].effect == EFFECT_TICKLE); + PLAYER(SPECIES_TURTONATOR); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(playerLeft, MOVE_SHELL_TRAP); MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, move, target: playerLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, move, opponentLeft); + if (move != MOVE_TICKLE) + HP_BAR(playerLeft); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + } + HP_BAR(playerLeft); + } +} diff --git a/test/battle/move_effect/protect.c b/test/battle/move_effect/protect.c index aca5ef859d..60b55ebb75 100644 --- a/test/battle/move_effect/protect.c +++ b/test/battle/move_effect/protect.c @@ -547,3 +547,22 @@ DOUBLE_BATTLE_TEST("Crafty Shield does not protect against moves that target all MESSAGE("Foe Sunflora's Defense rose!"); } } + +SINGLE_BATTLE_TEST("Spiky Shield does not damage users on Counter or Mirror Coat") +{ + u32 move; + PARAMETRIZE { move = MOVE_MIRROR_COAT; } + PARAMETRIZE { move = MOVE_COUNTER; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SPIKY_SHIELD); MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIKY_SHIELD, player); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(opponent); + } + } +} diff --git a/test/battle/move_effect/quash.c b/test/battle/move_effect/quash.c index fd2bd9d877..5500fcb33e 100644 --- a/test/battle/move_effect/quash.c +++ b/test/battle/move_effect/quash.c @@ -32,14 +32,102 @@ DOUBLE_BATTLE_TEST("Quash is not affected by dynamic speed") PLAYER(SPECIES_WOBBUFFET) { Speed(30); } OPPONENT(SPECIES_TORCHIC) { Speed(50); } OPPONENT(SPECIES_TREECKO) { Speed(40); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_QUASH, target: opponentLeft); + MOVE(opponentRight, MOVE_TAILWIND); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TAILWIND, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + } +} + +DOUBLE_BATTLE_TEST("Quash calculates correct turn order if only one pokemon is left on the opposing side") +{ + GIVEN { + PLAYER(SPECIES_GRENINJA) { Speed(120); } + PLAYER(SPECIES_REGIROCK) { Speed(100); } + OPPONENT(SPECIES_PIDGEOT) { Speed(10); } + OPPONENT(SPECIES_DRAGONITE) { Speed(60); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_QUASH, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentLeft); + MOVE(opponentRight, MOVE_CELEBRATE); + } + TURN { + MOVE(playerLeft, MOVE_QUASH, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentRight); + MOVE(opponentRight, MOVE_CELEBRATE); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentLeft); + MESSAGE("Foe Pidgeot fainted!"); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Quash-affected targets move from fastest to slowest (Gen 8+) or from first affected battler to last (Gen 7-)") +{ + u32 speedLeft, speedRight; + + PARAMETRIZE { speedLeft = 60; speedRight = 50; } + PARAMETRIZE { speedLeft = 50; speedRight = 60; } + GIVEN { + PLAYER(SPECIES_VOLBEAT) { Speed(10); Ability(ABILITY_PRANKSTER); } + PLAYER(SPECIES_WOBBUFFET) { Speed(70); } + OPPONENT(SPECIES_TORCHIC) { Speed(speedLeft); } + OPPONENT(SPECIES_TREECKO) { Speed(speedRight); } } WHEN { TURN { MOVE(playerLeft, MOVE_QUASH, target: opponentRight); + MOVE(playerRight, MOVE_QUASH, target: opponentLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerRight); + if (B_QUASH_TURN_ORDER < GEN_8) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + } + else if (speedLeft > speedRight) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + } + else { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Quash-affected mon that acted early via After You is not affected by dynamic speed") +{ + GIVEN { + ASSUME(B_RECALC_TURN_AFTER_ACTIONS >= GEN_8); + ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); + ASSUME(gMovesInfo[MOVE_AFTER_YOU].effect == EFFECT_AFTER_YOU); + PLAYER(SPECIES_VOLBEAT) { Speed(20); Ability(ABILITY_PRANKSTER); } + PLAYER(SPECIES_WOBBUFFET) { Speed(30); } + OPPONENT(SPECIES_TORCHIC) { Speed(10); } + OPPONENT(SPECIES_TREECKO) { Speed(40); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_QUASH, target: opponentLeft); + MOVE(opponentRight, MOVE_AFTER_YOU, target: opponentLeft); MOVE(opponentLeft, MOVE_TAILWIND); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, opponentRight); ANIMATION(ANIM_TYPE_MOVE, MOVE_TAILWIND, opponentLeft); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); // this is the relevant part, testing if quash affected battler becomes last to move causing playerRight to not move } } diff --git a/test/battle/move_effect/shell_trap.c b/test/battle/move_effect/shell_trap.c index cd63be2376..40febf040e 100644 --- a/test/battle/move_effect/shell_trap.c +++ b/test/battle/move_effect/shell_trap.c @@ -166,3 +166,35 @@ DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 3 a HP_BAR(opponentRight); } } + +DOUBLE_BATTLE_TEST("Shell Trap targets correctly if one of the opponents has fainted") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_GRENINJA) { Speed(60); } + PLAYER(SPECIES_TURTONATOR) { Speed(10); } + OPPONENT(SPECIES_BLASTOISE) { Speed(120); } + OPPONENT(SPECIES_SCIZOR) { Speed(100); } + } WHEN { + TURN { + MOVE(opponentLeft, MOVE_TACKLE, target: playerRight); + MOVE(playerRight, MOVE_SHELL_TRAP); + } + TURN { + MOVE(opponentLeft, MOVE_TACKLE, target: playerRight); + MOVE(playerRight, MOVE_SHELL_TRAP); + } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerRight); + MESSAGE("Foe Scizor fainted!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); + + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); + } +}