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/battle_script.inc b/asm/macros/battle_script.inc index 5982716bc9..d45487e644 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1351,7 +1351,6 @@ .4byte \func .endm -@ callnative macros .macro savetarget callnative BS_SaveTarget .endm @@ -1727,6 +1726,11 @@ .4byte \failInstr .endm + .macro jumpifcommanderactive jumpInstr:req + callnative BS_JumpIfCommanderActive + .4byte \jumpInstr + .endm + @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 00f892abb2..c9c7f25581 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2107,15 +2107,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 296de004ac..98ac1bfda7 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -691,6 +691,32 @@ gBattleAnimMove_LuckyChant:: end gBattleAnimMove_MeFirst:: + loadspritegfx ANIM_TAG_ORBS + loadspritegfx ANIM_TAG_FINGER + loadspritegfx ANIM_TAG_THOUGHT_BUBBLE + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_ORBS, 0, 12, 12, 0x7FAF + setalpha 11, 5 + monbg_static ANIM_DEF_PARTNER + splitbgprio_all + createsprite gThoughtBubbleSpriteTemplate, ANIM_ATTACKER, 11, 0, 100 + playsewithpan SE_M_METRONOME, SOUND_PAN_ATTACKER + delay 6 + createsprite gMetronomeFingerSpriteTemplate, ANIM_ATTACKER, 12, 0 + delay 24 + loopsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER, 22, 3 + waitforvisualfinish + panse SE_M_MINIMIZE, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0 + createvisualtask AnimTask_ShrinkTargetCopy, 5, 128, 24 + delay 15 + createsprite gMimicOrbSpriteTemplate, ANIM_TARGET, 2, -12, 24 + delay 10 + setarg 7, 0xFFFF + waitforvisualfinish + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 11, RGB_WHITE + waitforvisualfinish + clearmonbg_static ANIM_DEF_PARTNER + blendoff end gBattleAnimMove_Copycat:: @@ -1092,8 +1118,8 @@ gBattleAnimMove_ForcePalm:: end gBattleAnimMove_AuraSphere:: - loadspritegfx ANIM_TAG_METEOR - loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_IMPACT_2 + loadspritegfx ANIM_TAG_LEER monbg ANIM_ATK_PARTNER splitbgprio ANIM_ATTACKER setalpha 12, 8 @@ -3600,17 +3626,18 @@ gBattleAnimMove_DarkVoid:: waitbgfadein createvisualtask AnimTask_DestinyBondWhiteShadow, 5, 0, 0x30 loopsewithpan SE_M_CONFUSE_RAY, SOUND_PAN_ATTACKER, 5, 2 - delay 0x30 - createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xfd00, 0x15, 0, 0x70 @Last is speed - createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0xfd00, 0x15, 0, 0x70 @Last is speed - delay 0x40 + delay 48 + createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, -768, 21, 0, 112 @Last is duration + createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, -768, 21, 0, 112 @Last is duration + delay 64 invisible ANIM_TARGET invisible ANIM_DEF_PARTNER - createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, 1, 0, 0x20, 0x3c + createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0, 32, 60 + createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_DEF_PARTNER, 0, 32, 60 waitforvisualfinish createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0, 16 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0, 16 - delay 0x20 + delay 32 call UnsetPsychicBg visible ANIM_TARGET visible ANIM_DEF_PARTNER @@ -9827,27 +9854,25 @@ gBattleAnimMove_BanefulBunker:: gBattleAnimMove_SpiritShackle:: loadspritegfx ANIM_TAG_SPIRIT_ARROW @Arrow - loadspritegfx ANIM_TAG_CHAIN_LINK @Chain - monbg ANIM_DEF_PARTNER - splitbgprio ANIM_TARGET - setalpha 12, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x10, 0x0 - waitforvisualfinish + loadspritegfx ANIM_TAG_PURPLE_CHAIN + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_PURPLE_CHAIN, 0, 9, 9, RGB_BLACK + monbg ANIM_TARGET playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER - createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, 0x10, 0x0, 0x0, 0x0, 0xf - delay 0x8 + createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, 16, 0, 0, 0, 15 + delay 8 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 10, 1 waitforvisualfinish - loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 0x1c, 0x2 - createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0xfff0 - delay 0x4 - createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0x0 - delay 0x4 - createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0x10 + loopsewithpan SE_M_SCRATCH, SOUND_PAN_TARGET, 6, 2 + createsprite gChainBindingSpriteTemplate, ANIM_TARGET, 4, 0, 16, 0, 1 + delay 7 + createsprite gChainBindingSpriteTemplate, ANIM_TARGET, 2, 0, 8, 1, 1 + delay 3 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 + delay 20 + setarg 7, 0xFFFF + playsewithpan SE_M_BIND, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x0, 0x0 - waitforvisualfinish - clearmonbg ANIM_DEF_PARTNER + clearmonbg ANIM_TARGET blendoff end @@ -12621,43 +12646,385 @@ PhotonGeyserBeam: return gBattleAnimMove_ZippyZap:: - end @to do: + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_SPARK_2 + monbg ANIM_ATK_PARTNER + setalpha 12, 8 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 2 @electric circle + waitforvisualfinish + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 + createvisualtask AnimTask_TraceMonBlended, 2, 0, 4, 7, 3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + delay 4 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 0, 0, ANIM_TARGET, 1 + call ElectricityEffect + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + blendoff + waitforvisualfinish + end gBattleAnimMove_SplishySplash:: - end @to do: + loadspritegfx ANIM_TAG_SPARK_2 + createvisualtask AnimTask_CreateSurfWave, 2, ANIM_SURF_PAL_SURF + delay 24 + panse SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 + waitforvisualfinish + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 10, 1 + call ElectricityEffect + end gBattleAnimMove_FloatyFall:: - end @to do: + loadspritegfx ANIM_TAG_ROUND_SHADOW + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_ROUND_SHADOW, 0, 12, 12, RGB_YELLOW + monbg ANIM_DEF_PARTNER + setalpha 12, 8 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + createsprite gFlyBallUpSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 13, 336 + waitforvisualfinish + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + createsprite gFlyBallAttackSpriteTemplate, ANIM_ATTACKER, 2, 20, FALSE + delay 20 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 8, 1 + playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + blendoff + waitforvisualfinish + end gBattleAnimMove_PikaPapow:: - end @to do: + createvisualtask AnimTask_GetReturnPowerLevel, 2 + delay 2 + jumpreteq 0, gBattleAnimMove_ThunderShock + jumpreteq 1, gBattleAnimMove_ShockWave + jumpreteq 2, gBattleAnimMove_Thunderbolt + jumpreteq 3, gBattleAnimMove_Thunder gBattleAnimMove_BouncyBubble:: - end @to do: + loadspritegfx ANIM_TAG_BUBBLE + loadspritegfx ANIM_TAG_SMALL_BUBBLES + loadspritegfx ANIM_TAG_ORBS + loadspritegfx ANIM_TAG_BLUE_STAR + loadspritegfx ANIM_TAG_IMPACT + monbg ANIM_TARGET + splitbgprio ANIM_TARGET + setalpha 12, 8 + delay 1 + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 12, RGB(13, 12, 31) + waitforvisualfinish + playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 + delay 2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 + waitforvisualfinish + call WaterBubblesEffectLong + call GigaDrainAbsorbEffect + waitforvisualfinish + delay 15 + call HealingEffect + waitforvisualfinish + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 12, 0, RGB(13, 12, 31) + waitforvisualfinish + clearmonbg ANIM_TARGET + blendoff + end gBattleAnimMove_BuzzyBuzz:: - end @to do: + loadspritegfx ANIM_TAG_ELECTRIC_ORBS + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_SPARK + loadspritegfx ANIM_TAG_LIGHTNING + loadspritegfx ANIM_TAG_SHOCK_3 + loadspritegfx ANIM_TAG_SPARK_2 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK + waitforvisualfinish + createsprite gSpriteTemplate_SpiritBreakChargeBall, ANIM_TARGET, 1, ANIM_TARGET + delay 10 + createvisualtask AnimTask_ElectricBolt, 5, 24, -52, 0 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 7 + createvisualtask AnimTask_ElectricBolt, 5, -24, -52, 0 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 7 + createvisualtask AnimTask_ElectricBolt, 5, 0, -60, 1 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 9 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 0, 13, RGB_BLACK + waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 13, 0, RGB_BLACK + waitforvisualfinish + delay 20 + waitplaysewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET, 19 + call ElectricityEffect + waitforvisualfinish + delay 20 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK + waitforvisualfinish + end gBattleAnimMove_SizzlySlide:: - end @to do: + loadspritegfx ANIM_TAG_SMALL_EMBER + loadspritegfx ANIM_TAG_IMPACT + monbg ANIM_ATK_PARTNER + setalpha 12, 8 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 0 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 4 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 8 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 12 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 16 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 20 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 24 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + waitforvisualfinish + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 + createvisualtask AnimTask_TraceMonBlended, 2, 0, 4, 7, 3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + delay 4 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 0, 0, ANIM_TARGET, 1 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_TARGET, RGB_RED, 12, 1, 1 + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + call FireSpreadEffect + delay 7 + createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 9 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + end gBattleAnimMove_GlitzyGlow:: - end @to do: + loadspritegfx ANIM_TAG_THIN_RING @hypervoice ring + loadspritegfx ANIM_TAG_SPARK_2 @yellow color + loadspritegfx ANIM_TAG_WATER_ORB @blue color + loadspritegfx ANIM_TAG_POISON_BUBBLE @violet color + loadspritegfx ANIM_TAG_SMALL_EMBER @flame wheel particle + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_CIRCLE_OF_LIGHT, 0, 12, 12, 0x289F + monbg ANIM_DEF_PARTNER + splitbgprio_foes ANIM_TARGET + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 0, 12, 0 @Darken + playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER + createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 0, 0 + delay 18 + panse SE_M_SCREECH, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 + createsprite gSynchronoiseVioletRingTemplate, ANIM_ATTACKER, 0, 25, 0, 0, 0, 0, 0, 1 + delay 1 + createsprite gSynchronoiseBlueRingTemplate, ANIM_ATTACKER, 0, 25, 0, 0, 0, 0, 0, 1 + delay 1 + createsprite gSynchronoiseYellowRingTemplate, ANIM_ATTACKER, 0, 25, 0, 0, 0, 0, 0, 1 + delay 36 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 6, 1 + createvisualtask AnimTask_ShakeBattleTerrain, 2, 1, 0, 6, 1 + waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 12, 0, 0 @Darken + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + blendoff + delay 1 + unloadspritegfx ANIM_TAG_THIN_RING @hypervoice ring + unloadspritegfx ANIM_TAG_SPARK_2 @yellow color + unloadspritegfx ANIM_TAG_WATER_ORB @blue color + unloadspritegfx ANIM_TAG_POISON_BUBBLE @violet color + unloadspritegfx ANIM_TAG_SMALL_EMBER @flame wheel particle + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + waitforvisualfinish + goto gBattleAnimMove_LightScreen gBattleAnimMove_BaddyBad:: - end @to do: + loadspritegfx ANIM_TAG_STRAIGHT_BEAM + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_STRAIGHT_BEAM, 0, 14, 14, RGB_BLACK + monbg ANIM_ATTACKER + splitbgprio ANIM_ATTACKER + playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER + fadetobg BG_DARK + waitbgfadein + delay 10 + playsewithpan SE_M_LEER, SOUND_PAN_ATTACKER + createvisualtask AnimTask_NightShadeClone, 5, 133 + delay 10 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 6, 0, 16, RGB_BLACK + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 4, 0, 96, 1 + panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 + call PhotonGeyserBeam + waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 16, 0, RGB_BLACK + waitforvisualfinish + delay 1 + restorebg + waitbgfadein + waitforvisualfinish + clearmonbg ANIM_ATTACKER + unloadspritegfx ANIM_TAG_STRAIGHT_BEAM + waitforvisualfinish + goto gBattleAnimMove_Reflect gBattleAnimMove_SappySeed:: - end @to do: + loadspritegfx ANIM_TAG_SPROUT + loadspritegfx ANIM_TAG_SEED + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_TARGET + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 40, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -20, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -30, ANIM_TARGET, 1 + delay 2 + call FullBeanstalk + call FallingSeeds + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + waitforvisualfinish + end +FullBeanstalk: + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -30, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -40, ANIM_TARGET, 1 + delay 2 + return +FallingSeeds: + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -20, 0, -10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 28, 0, 10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -10, 0, -5, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 10, 0, 6, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 24, 0, 10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -32, 0, -10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -20, 0, -10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 30, 0, 10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + return gBattleAnimMove_FreezyFrost:: - end @to do: + loadspritegfx ANIM_TAG_ICICLE_SPEAR + loadspritegfx ANIM_TAG_ICE_SPIKES + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_ICICLE_SPEAR, 0, 0, 12, RGB_BLACK + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_ICE_SPIKES, 0, 0, 12, RGB_BLACK + waitforvisualfinish + call FreezyFrostHitEffect + call FreezyFrostHitEffect + call FreezyFrostHitEffect + call FreezyFrostHitEffect + waitforvisualfinish + call IceSpikesEffectLong + waitforvisualfinish + end +FreezyFrostHitEffect: + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, -4, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 4109, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 4, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, -16, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + return gBattleAnimMove_SparklySwirl:: - end @to do: + loadspritegfx ANIM_TAG_GUST + loadspritegfx ANIM_TAG_PINK_PETAL + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_GUST, 0, 15, 15, RGB(31, 21, 21) + monbg ANIM_DEF_PARTNER + splitbgprio ANIM_TARGET + playsewithpan SE_M_GUST, SOUND_PAN_TARGET + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 + call HurricaneGust + call PinkPetalVortex + call HurricaneGust + call PinkPetalVortex + call HurricaneGust + call PinkPetalVortex + waitforvisualfinish + stopsound + clearmonbg ANIM_TARGET + end +PinkPetalVortex: + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 28, 528, 30, 13, 50, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 32, 480, 20, 16, -46, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 33, 576, 20, 8, 42, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 31, 400, 25, 11, -42, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 28, 512, 25, 16, 46, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 33, 464, 30, 15, -50, 1 + delay 2 + return gBattleAnimMove_VeeveeVolley:: - end @to do: + createvisualtask AnimTask_GetReturnPowerLevel, 2 + delay 2 + jumpreteq 0, gBattleAnimMove_Tackle + jumpreteq 1, gBattleAnimMove_Headbutt + jumpreteq 2, gBattleAnimMove_TakeDown + jumpreteq 3, gBattleAnimMove_DoubleEdge gBattleAnimMove_DoubleIronBash:: loadspritegfx ANIM_TAG_GUST @@ -13004,6 +13371,9 @@ gBattleAnimMove_ClangorousSoul:: createsprite gClangorousSoulRedFistTemplate, ANIM_ATTACKER, 2, 0x10, 0, 0, 0, 10, ANIM_ATTACKER, ANIM_LEFT_FIST, 1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish + unloadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + unloadspritegfx ANIM_TAG_SPARKLE_2 @stars + waitforvisualfinish loadspritegfx ANIM_TAG_THIN_RING @ring playsewithpan SE_SHINY, SOUND_PAN_ATTACKER createsprite gClangorousSoulRedRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0 @@ -13104,8 +13474,31 @@ gBattleAnimMove_DrumBeating:: blendoff end -gBattleAnimMove_SnapTrap:: @ placeholder - goto gBattleAnimMove_Bite +gBattleAnimMove_SnapTrap:: + loadspritegfx ANIM_TAG_LEAF @leaves + loadspritegfx ANIM_TAG_FLOWER @flowers + loadspritegfx ANIM_TAG_SHARP_TEETH + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_SHARP_TEETH, 0, 10, 10, 0x0688 + monbg ANIM_TARGET + setalpha 12, 8 + playsewithpan SE_M_BITE, SOUND_PAN_TARGET + createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0, -32, 0, 0, 819, 10 + createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0, 32, 4, 0, -819, 10 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + delay 10 + playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 192, 176, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, -192, 240, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 192, -160, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, -192, -112, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 160, 48, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, -224, -32, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 112, -128, 40 + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + end gBattleAnimMove_PyroBall:: loadspritegfx ANIM_TAG_FLAT_ROCK @@ -14848,7 +15241,44 @@ gBattleAnimMove_GlacialLance:: gBattleAnimMove_AstralBarrage:: - goto gBattleAnimMove_ShadowBall + loadspritegfx ANIM_TAG_FLAT_ROCK + loadspritegfx ANIM_TAG_ICE_CRYSTALS + loadspritegfx ANIM_TAG_GHOSTLY_SPIRIT + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_FLAT_ROCK, 0x0, 0xA, 0xA, RGB(2, 1, 4) + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_ICE_CRYSTALS, 0x0, 0xA, 0xA, RGB(2, 1, 4) + monbg ANIM_ATK_PARTNER + splitbgprio ANIM_ATTACKER + setalpha 12, 8 + fadetobg BG_GHOST + waitbgfadein + createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 4, 1, 180, 1 + createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 20, 0, 5 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 200, 96, 1, 120 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 20, 248, 4, 112 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 130, 160, 2, 104 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 160, 192, 0, 96 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 60, 288, 3, 88 + delay 74 + panse SE_M_BLIZZARD, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 + call BlizzardIceCrystals + call BlizzardIceCrystals + playsewithpan SE_M_BLIZZARD2, SOUND_PAN_TARGET + waitforvisualfinish + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET + createspriteontargets gCurseGhostSpriteTemplate, ANIM_TARGET, 3, 2, 8, -5, ANIM_TARGET, 0 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 8, 0, 16, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 8, 0, 16, 1 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + restorebg + waitbgfadein + blendoff + delay 1 + end @Credits to Skeli @@ -14995,8 +15425,9 @@ gBattleAnimMove_SpringtideStorm:: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_RED_HEART playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x6, 0x0, 0xB, 0x7ADF + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 2, 6, 0, 11, 0x7ADF call HurricaneGustCentered call SpringtideStormHeartSwirl call HurricaneGustCentered @@ -15565,8 +15996,9 @@ gBattleAnimMove_BleakwindStorm:: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_ICE_CRYSTALS playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x7FFF + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 4, 0, 11, 0x7FFF call HurricaneGustCentered call BleakwindStormIceSwirl call HurricaneGustCentered @@ -15581,7 +16013,7 @@ gBattleAnimMove_BleakwindStorm:: call BleakwindStormIceSwirl waitforvisualfinish stopsound - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x7FFF + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 1, 11, 0, 0x7FFF waitforvisualfinish end BleakwindStormIceSwirl: @@ -15605,11 +16037,12 @@ gBattleAnimMove_WildboltStorm:: loadspritegfx ANIM_TAG_SPARK_2 fadetobg BG_MAX_LIGHTNING waitbgfadeout - createvisualtask AnimTask_StartSlidingBg, 0x5, 0xff00, 0x0, 0x1, 0xffff + createvisualtask AnimTask_StartSlidingBg, 5, -256, 0, 1, 0xffff waitbgfadein playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x07FE + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 4, 0, 11, 0x07FE call HurricaneGustCentered call WildboltStormSparkSwirl call HurricaneGustCentered @@ -15624,7 +16057,7 @@ gBattleAnimMove_WildboltStorm:: call WildboltStormSparkSwirl waitforvisualfinish stopsound - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x07FE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 1, 11, 0, 0x07FE call UnsetPsychicBg waitforvisualfinish end @@ -15650,8 +16083,9 @@ gBattleAnimMove_SandsearStorm:: loadspritegfx ANIM_TAG_SMALL_EMBER createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_GUST, 0x0, 0xA, 0xA, 0x190B playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x1F + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 4, 0, 11, 0x1F call HurricaneGustCentered call SandsearStormFireSpin call HurricaneGustCentered @@ -15666,7 +16100,7 @@ gBattleAnimMove_SandsearStorm:: call SandsearStormFireSpin waitforvisualfinish stopsound - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x1F + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 1, 11, 0, 0x1F waitforvisualfinish end @@ -15997,7 +16431,30 @@ ChillyReceptionSnowballs: return gBattleAnimMove_BurningBulwark:: - goto gBattleAnimMove_Protect + loadspritegfx ANIM_TAG_PROTECT @protect + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + monbg ANIM_ATK_PARTNER + splitbgprio ANIM_ATTACKER + waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER 16 + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_PROTECT, 0, 13, 13, 0x015B + createsprite gProtectSpriteTemplate, ANIM_ATTACKER, 2, 24, 0, 90 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 0 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 4 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 8 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 12 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 16 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 20 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 24 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_ATTACKER, RGB_RED, 10, 0, 2 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + end gBattleAnimMove_AlluringVoice:: loadspritegfx ANIM_TAG_THIN_RING @@ -27667,8 +28124,8 @@ Status_Thunder_Cage: @ TODO goto gBattleAnimMove_ThunderCage -Status_Snap_Trap: @ placeholder - goto gBattleAnimMove_Bite +Status_Snap_Trap: + goto gBattleAnimMove_SnapTrap Status_SandTomb: loadspritegfx ANIM_TAG_MUD_SAND @@ -27994,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 @@ -28185,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 @@ -28212,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 @@ -28248,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 @@ -33004,6 +33461,9 @@ gBattleAnimMove_ClangorousSoulblaze:: createsprite gClangorousSoulRedFistTemplate, ANIM_ATTACKER, 2, 0x10, 0x0, 0x0, 0x0, 0xa, ANIM_ATTACKER, ANIM_LEFT_FIST, 0x1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish + unloadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + unloadspritegfx ANIM_TAG_SPARKLE_2 @stars + waitforvisualfinish loadspritegfx ANIM_TAG_THIN_RING @ring playsewithpan SE_SHINY, SOUND_PAN_ATTACKER createsprite gClangorousSoulRedRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9af9d7fd27..05eb64d15a 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3265,6 +3265,7 @@ BattleScript_EffectRoar:: attackstring ppreduce jumpifroarfails BattleScript_ButItFailed + jumpifcommanderactive BattleScript_ButItFailed jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_ButItFailed jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted @@ -3279,51 +3280,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 @@ -4724,6 +4691,9 @@ BattleScript_ButItFailed:: resultmessage waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_RestoreAttackerButItFailed: + restoreattacker + goto BattleScript_ButItFailed BattleScript_NotAffected:: pause B_WAIT_TIME_SHORT @@ -6460,12 +6430,14 @@ BattleScript_SeedSowerActivates:: return BattleScript_AngerShellActivates:: + saveattacker + copybyte gBattlerAttacker, gBattlerTarget call BattleScript_AbilityPopUp jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_AngerShellTryDef jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_AngerShellTryDef - jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_ButItFailed + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_RestoreAttackerButItFailed BattleScript_AngerShellTryDef:: setbyte sSTAT_ANIM_PLAYED, FALSE modifybattlerstatstage BS_ATTACKER, STAT_DEF, DECREASE, 1, BattleScript_AngerShellTrySpDef, ANIM_ON @@ -6479,6 +6451,7 @@ BattleScript_AngerShellTrySpAtk: BattleScript_AngerShellTrySpeed: modifybattlerstatstage BS_ATTACKER, STAT_SPEED, INCREASE, 1, BattleScript_AngerShellRet, ANIM_ON BattleScript_AngerShellRet: + restoreattacker return BattleScript_WindPowerActivates:: @@ -6995,12 +6968,12 @@ BattleScript_WishMegaEvolution:: BattleScript_PrimalReversion:: call BattleScript_PrimalReversionRet - end2 + end3 BattleScript_PrimalReversionRestoreAttacker:: call BattleScript_PrimalReversionRet copybyte gBattlerAttacker, sSAVED_BATTLER - end2 + end3 BattleScript_PrimalReversionRet:: flushtextbox @@ -7709,15 +7682,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:: @@ -8040,11 +8009,52 @@ BattleScript_CostarActivates:: BattleScript_ZeroToHeroActivates:: pause B_WAIT_TIME_SHORT - call BattleScript_AbilityPopUp + call BattleScript_AbilityPopUpScripting printstring STRINGID_ZEROTOHEROTRANSFORMATION waitmessage B_WAIT_TIME_LONG end3 +BattleScript_CommanderActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUpScripting + printstring STRINGID_COMMANDERACTIVATES + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderAtkIncrease: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPATK | BIT_SPDEF | BIT_SPEED, STAT_CHANGE_BY_TWO + setstatchanger STAT_ATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderDefIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderDefIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderDefIncrease: + setstatchanger STAT_DEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderSpAtkIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderSpAtkIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderSpAtkIncrease: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderSpDefIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderSpDefIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderSpDefIncrease: + setstatchanger STAT_SPDEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderSpeedIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderSpeedIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderSpeedIncrease: + setstatchanger STAT_SPEED, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderEnd + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderEnd: + restoreattacker + end3 + BattleScript_HospitalityActivates:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -9404,6 +9414,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 @@ -9555,6 +9575,14 @@ BattleScript_StickyBarbTransfer:: removeitem BS_TARGET return +BattleScript_RedCardActivationNoSwitch:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_REDCARDACTIVATE + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + restoretarget + return + BattleScript_RedCardActivates:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT printstring STRINGID_REDCARDACTIVATE @@ -10035,7 +10063,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/event_scripts.s b/data/event_scripts.s index 9514621b10..1bbb166154 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -724,6 +724,11 @@ EventScript_BackupMrBrineyLocation:: .include "data/scripts/rival_graphics.inc" .include "data/scripts/set_gym_trainers.inc" +EventScript_CancelMessageBox:: + special UseBlankMessageToCancelPokemonPic + release + end + Common_EventScript_ShowBagIsFull:: msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT release @@ -1143,6 +1148,5 @@ EventScript_VsSeekerChargingDone:: .include "data/scripts/trainer_hill.inc" .include "data/scripts/test_signpost.inc" .include "data/scripts/follower.inc" - .include "data/text/frontier_brain.inc" .include "data/text/save.inc" .include "data/text/birch_speech.inc" diff --git a/data/specials.inc b/data/specials.inc index f02497d603..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 @@ -554,3 +553,4 @@ gSpecials:: def_special Script_GetChosenMonDefensiveEVs def_special Script_GetChosenMonOffensiveIVs def_special Script_GetChosenMonDefensiveIVs + def_special UseBlankMessageToCancelPokemonPic diff --git a/data/text/frontier_brain.inc b/data/text/frontier_brain.inc deleted file mode 100644 index 1292f2a564..0000000000 --- a/data/text/frontier_brain.inc +++ /dev/null @@ -1,108 +0,0 @@ -@ Battle Tower -gText_AnabelWonSilver:: - .string "It's very disappointing…$" - -gText_AnabelDefeatSilver:: - .string "Okay, I understand…$" - -gText_AnabelWonGold:: - .string "I'm terribly sorry…$" - -gText_AnabelDefeatGold:: - .string "Thank you…$" - -@ Battle Dome -gText_TuckerWonSilver:: - .string "Ahahaha! Aren't you embarrassed?\n" - .string "Everyone's watching!$" - -gText_TuckerDefeatSilver:: - .string "Grr…\n" - .string "What the…$" - -gText_TuckerWonGold:: - .string "My DOME ACE title isn't just for show!$" - -gText_TuckerDefeatGold:: - .string "Ahahaha!\n" - .string "You're inspiring!$" - -@ Battle Factory -gText_NolandWonSilver:: - .string "Way to work!\n" - .string "That was a good lesson, eh?$" - -gText_NolandDefeatSilver:: - .string "Good job!\n" - .string "You know what you're doing!$" - -gText_NolandWonGold:: - .string "Hey, hey, hey!\n" - .string "You're finished already?$" - -gText_NolandDefeatGold:: - .string "What happened here?$" - -@ Battle Pike -gText_LucyWonSilver:: - .string "Humph…$" - -gText_LucyDefeatSilver:: - .string "Urk…$" - -gText_LucyWonGold:: - .string "Hah!$" - -gText_LucyDefeatGold:: - .string "Darn!$" - -@ Battle Arena -gText_GretaWonSilver:: - .string "Oh, come on!\n" - .string "You have to try harder than that!$" - -gText_GretaDefeatSilver:: - .string "No way!\n" - .string "Good job!$" - -gText_GretaWonGold:: - .string "Heheh!\n" - .string "What did you expect?$" - -gText_GretaDefeatGold:: - .string "Huh?\n" - .string "Are you serious?!$" - -@ Battle Palace -gText_SpenserWonSilver:: - .string "Your POKéMON are wimpy because\n" - .string "you're wimpy as a TRAINER!$" - -gText_SpenserDefeatSilver:: - .string "Ah…\n" - .string "Now this is something else…$" - -gText_SpenserWonGold:: - .string "Gwahahaha!\n" - .string "My brethren, we have nothing to fear!$" - -gText_SpenserDefeatGold:: - .string "Gwah!\n" - .string "Hahahaha!$" - -@ Battle Pyramid -gText_BrandonWonSilver:: - .string "Hey! What's wrong with you!\n" - .string "Let's see some effort! Get up!$" - -gText_BrandonDefeatSilver:: - .string "That's it! You've done great!\n" - .string "You've worked hard for this!$" - -gText_BrandonWonGold:: - .string "Hey! Don't you give up now!\n" - .string "Get up! Don't lose faith in yourself!$" - -gText_BrandonDefeatGold:: - .string "That's it! You've done it!\n" - .string "You kept working for this!$" 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/gflib/text.c b/gflib/text.c index 59c6e3f4e8..e2adba1cdb 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -932,8 +932,9 @@ bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) { struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields); - if (subStruct->autoScrollDelay == 49) + if (subStruct->autoScrollDelay == NUM_FRAMES_AUTO_SCROLL_DELAY) { + subStruct->autoScrollDelay = 0; return TRUE; } else @@ -943,21 +944,29 @@ bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) } } +void SetResultWithButtonPress(bool32 *result) +{ + if (JOY_NEW(A_BUTTON | B_BUTTON)) + { + *result = TRUE; + PlaySE(SE_SELECT); + } +} + bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter) { bool32 result = FALSE; - if (gTextFlags.autoScroll != 0) + if (gTextFlags.autoScroll != 0 || AUTO_SCROLL_TEXT) { result = TextPrinterWaitAutoMode(textPrinter); + + if (AUTO_SCROLL_TEXT) + SetResultWithButtonPress(&result); } else { TextPrinterDrawDownArrow(textPrinter); - if (JOY_NEW(A_BUTTON | B_BUTTON)) - { - result = TRUE; - PlaySE(SE_SELECT); - } + SetResultWithButtonPress(&result); } return result; } @@ -965,17 +974,16 @@ bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter) bool32 TextPrinterWait(struct TextPrinter *textPrinter) { bool32 result = FALSE; - if (gTextFlags.autoScroll != 0) + if (gTextFlags.autoScroll != 0 || AUTO_SCROLL_TEXT) { result = TextPrinterWaitAutoMode(textPrinter); + + if (AUTO_SCROLL_TEXT) + SetResultWithButtonPress(&result); } else { - if (JOY_NEW(A_BUTTON | B_BUTTON)) - { - result = TRUE; - PlaySE(SE_SELECT); - } + SetResultWithButtonPress(&result); } return result; } diff --git a/graphics/battle_anims/sprites/spirit_shackle_arrow.png b/graphics/battle_anims/sprites/spirit_shackle_arrow.png index ff86f33d21..cc520e6b5d 100644 Binary files a/graphics/battle_anims/sprites/spirit_shackle_arrow.png and b/graphics/battle_anims/sprites/spirit_shackle_arrow.png differ 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/graphics/text_window/signpost.bin b/graphics/text_window/signpost.bin new file mode 100644 index 0000000000..6358e199db Binary files /dev/null and b/graphics/text_window/signpost.bin differ diff --git a/graphics/text_window/signpost.png b/graphics/text_window/signpost.png new file mode 100644 index 0000000000..45ab7c6764 Binary files /dev/null and b/graphics/text_window/signpost.png differ diff --git a/include/battle.h b/include/battle.h index 66f8531ae7..16df7c500a 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; @@ -201,10 +201,13 @@ struct ProtectStruct u16 eatMirrorHerb:1; u16 activateOpportunist:2; // 2 - to copy stats. 1 - stats copied (do not repeat). 0 - no stats to copy u16 usedAllySwitch:1; + u16 padding:2; + // End of 16-bit bitfield u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; + }; struct SpecialStatus @@ -366,11 +369,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 +772,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 @@ -816,9 +821,14 @@ struct BattleStruct u8 boosterEnergyActivates; u8 distortedTypeMatchups; u8 categoryOverride; // for Z-Moves and Max Moves + u8 commandingDondozo; + u16 commanderActive[NUM_BATTLE_SIDES]; u32 stellarBoostFlags[NUM_BATTLE_SIDES]; // stored as a bitfield of flags for all types for each side u8 fickleBeamBoosted:1; u8 obedienceResult:3; + u8 padding:4; + u8 usedEjectItem; + u8 usedMicleBerry; }; // The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider, @@ -1153,11 +1163,10 @@ static inline u32 GetBattlerSide(u32 battler) return GetBattlerPosition(battler) & BIT_SIDE; } -static inline struct Pokemon* GetBattlerData(u32 battlerId) +static inline struct Pokemon* GetPartyBattlerData(u32 battler) { - u32 index = gBattlerPartyIndexes[battlerId]; - - return (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) ? &gEnemyParty[index] : &gPlayerParty[index]; + u32 index = gBattlerPartyIndexes[battler]; + return (GetBattlerSide(battler) == B_SIDE_OPPONENT) ? &gEnemyParty[index] : &gPlayerParty[index]; } static inline struct Pokemon *GetSideParty(u32 side) @@ -1176,3 +1185,4 @@ static inline bool32 IsDoubleBattle(void) } #endif // GUARD_BATTLE_H + diff --git a/include/battle_anim.h b/include/battle_anim.h index 351dbbd454..71f494c87b 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -557,4 +557,7 @@ void CoreEnforcerLoadBeamTarget(struct Sprite *sprite); void SpriteCB_RandomCentredHits(struct Sprite *sprite); void InitSpritePosToAnimTargetsCentre(struct Sprite *sprite, bool32 respectMonPicOffsets); +// battle_anim_bug.c +void AnimTranslateStinger(struct Sprite *sprite); + #endif // GUARD_BATTLE_ANIM_H diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 4f1593d4d8..7326647d41 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -57,6 +57,8 @@ bool32 IsMoveNotAllowedInSkyBattles(u32 move); bool32 DoSwitchInAbilities(u32 battlerId); u8 GetFirstFaintedPartyIndex(u8 battlerId); bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler); +void SaveBattlerTarget(u32 battler); +void SaveBattlerAttacker(u32 battler); extern void (* const gBattleScriptingCommandsTable[])(void); extern const struct StatFractions gAccuracyStageRatios[]; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index fb1e72af24..9e2fb84485 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[]; @@ -412,6 +412,7 @@ extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; extern const u8 BattleScript_Pickpocket[]; extern const u8 BattleScript_StickyBarbTransfer[]; extern const u8 BattleScript_AttackerItemStatRaise[]; +extern const u8 BattleScript_RedCardActivationNoSwitch[]; extern const u8 BattleScript_RedCardActivates[]; extern const u8 BattleScript_EjectButtonActivates[]; extern const u8 BattleScript_EjectPackActivate_Ret[]; @@ -459,6 +460,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[]; @@ -476,6 +478,7 @@ extern const u8 BattleScript_CudChewActivates[]; extern const u8 BattleScript_SupremeOverlordActivates[]; extern const u8 BattleScript_CostarActivates[]; extern const u8 BattleScript_ZeroToHeroActivates[]; +extern const u8 BattleScript_CommanderActivates[]; extern const u8 BattleScript_HospitalityActivates[]; extern const u8 BattleScript_ToxicDebrisActivates[]; extern const u8 BattleScript_EarthEaterActivates[]; 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 dc39f4919a..cff1432bb7 100644 --- a/include/config/general.h +++ b/include/config/general.h @@ -72,6 +72,9 @@ #define SUMMARY_SCREEN_NATURE_COLORS TRUE // If TRUE, nature-based stat boosts and reductions will be red and blue in the summary screen. #define HQ_RANDOM TRUE // If TRUE, replaces the default RNG with an implementation of SFC32 RNG. May break code that relies on RNG. #define COMPETITIVE_PARTY_SYNTAX TRUE // If TRUE, parties are defined in "competitive syntax". +#define AUTO_SCROLL_TEXT FALSE // If TRUE, text will automatically scroll to the next line after NUM_FRAMES_AUTO_SCROLL_DELAY. Players can still press A_BUTTON or B_BUTTON to scroll on their own. +#define NUM_FRAMES_AUTO_SCROLL_DELAY 49 + // Measurement system constants to be used for UNITS #define UNITS_IMPERIAL 0 // Inches, feet, pounds @@ -83,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 cebbe5b34b..3298a03209 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,6 +3,8 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. +#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost, as seen in FRLG. +#define SLOW_MOVEMENT_ON_STAIRS FALSE // If enabled, the player will move slower up/down stairs like in FR // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. @@ -50,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 @@ -86,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/battle.h b/include/constants/battle.h index f9800ef4b3..560448159a 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -166,7 +166,7 @@ #define STATUS3_YAWN_TURN(num) (((num) << 11) & STATUS3_YAWN) #define STATUS3_IMPRISONED_OTHERS (1 << 13) #define STATUS3_GRUDGE (1 << 14) -#define STATUS3___UNUSED (1 << 15) +#define STATUS3_COMMANDER (1 << 15) #define STATUS3_GASTRO_ACID (1 << 16) #define STATUS3_EMBARGO (1 << 17) #define STATUS3_UNDERWATER (1 << 18) @@ -183,7 +183,8 @@ #define STATUS3_LASER_FOCUS (1 << 29) #define STATUS3_POWER_TRICK (1 << 30) #define STATUS3_SKY_DROPPED (1 << 31) // Target of Sky Drop -#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE) +#define STATUS3_SEMI_INVULNERABLE_NO_COMMANDER (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE) // Exception for Transform / Imposter +#define STATUS3_SEMI_INVULNERABLE (STATUS3_SEMI_INVULNERABLE_NO_COMMANDER | STATUS3_COMMANDER) #define STATUS4_ELECTRIFIED (1 << 0) #define STATUS4_MUD_SPORT (1 << 1) // Only used if B_SPORT_TURNS < GEN_6 @@ -401,8 +402,9 @@ #define MOVE_EFFECT_SECRET_POWER 77 #define MOVE_EFFECT_PSYCHIC_NOISE 78 #define MOVE_EFFECT_TERA_BLAST 79 +#define MOVE_EFFECT_ORDER_UP 80 -#define NUM_MOVE_EFFECTS 80 +#define NUM_MOVE_EFFECTS 81 #define MOVE_EFFECT_AFFECTS_USER 0x2000 #define MOVE_EFFECT_CERTAIN 0x4000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 5da278110f..770e773f80 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -354,6 +354,7 @@ enum { EFFECT_DRAGON_DARTS, EFFECT_GUARDIAN_OF_ALOLA, EFFECT_SHELL_SIDE_ARM, + EFFECT_ORDER_UP, NUM_BATTLE_MOVE_EFFECTS, }; diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 9fbb70a223..08c80248fe 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -712,8 +712,9 @@ #define STRINGID_FOGLIFTED 710 #define STRINGID_PKMNMADESHELLGLEAM 711 #define STRINGID_FICKLEBEAMDOUBLED 712 +#define STRINGID_COMMANDERACTIVATES 713 -#define BATTLESTRINGS_COUNT 713 +#define BATTLESTRINGS_COUNT 714 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index e7641f9826..650a6a2357 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -247,6 +247,10 @@ #define MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK 0x9F #define MOVEMENT_ACTION_EXIT_POKEBALL 0xA0 #define MOVEMENT_ACTION_ENTER_POKEBALL 0xA1 +#define MOVEMENT_ACTION_RUN_DOWN_SLOW 0xA2 // slow running for rocky stairs +#define MOVEMENT_ACTION_RUN_UP_SLOW 0xA3 +#define MOVEMENT_ACTION_RUN_LEFT_SLOW 0xA4 +#define MOVEMENT_ACTION_RUN_RIGHT_SLOW 0xA5 #define MOVEMENT_ACTION_STEP_END 0xFE #define MOVEMENT_ACTION_NONE 0xFF diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 5dc652d44a..4c71eff6d2 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -282,6 +282,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 1f6d4e87cb..f5a8f38506 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -30,9 +30,9 @@ #define MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2 0x1A #define MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B #define MB_SHOAL_CAVE_ENTRANCE 0x1C -#define MB_UNUSED_1D 0x1D -#define MB_UNUSED_1E 0x1E -#define MB_UNUSED_1F 0x1F +#define MB_SIGNPOST 0x1D +#define MB_POKEMON_CENTER_SIGN 0x1E +#define MB_POKEMART_SIGN 0x1F #define MB_ICE 0x20 #define MB_SAND 0x21 #define MB_SEAWEED 0x22 @@ -74,13 +74,13 @@ #define MB_SLIDE_NORTH 0x46 #define MB_SLIDE_SOUTH 0x47 #define MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48 -#define MB_UNUSED_49 0x49 -#define MB_UNUSED_4A 0x4A -#define MB_UNUSED_4B 0x4B -#define MB_UNUSED_4C 0x4C -#define MB_UNUSED_4D 0x4D -#define MB_UNUSED_4E 0x4E -#define MB_UNUSED_4F 0x4F +#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE 0x49 +#define MB_SIDEWAYS_STAIRS_LEFT_SIDE 0x4A +#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP 0x4B +#define MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP 0x4C +#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM 0x4D +#define MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM 0x4E +#define MB_ROCK_STAIRS 0x4F #define MB_EASTWARD_CURRENT 0x50 #define MB_WESTWARD_CURRENT 0x51 #define MB_NORTHWARD_CURRENT 0x52 @@ -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 fdc8db48b7..ee95429599 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[]; @@ -313,7 +314,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 *); @@ -336,14 +337,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 *); @@ -488,6 +487,15 @@ void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible); bool32 IsVirtualObjectInvisible(u8 virtualObjId); void SetVirtualObjectSpriteAnim(u8 virtualObjId, u8 animNum); bool32 IsVirtualObjectAnimating(u8 virtualObjId); +u8 GetObjectEventIdByLocalId(u8 localId); +bool32 IsFollowerVisible(void); + +// run slow +u8 GetPlayerRunSlowMovementAction(u32); +//sideways stairs +u8 GetSidewaysStairsToRightDirection(s16, s16, u8); +u8 GetSidewaysStairsToLeftDirection(s16, s16, u8); +u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 currentBehavior, u8 nextBehavior, u8 collision); bool8 MovementAction_EmoteX_Step0(struct ObjectEvent *, struct Sprite *); bool8 MovementAction_EmoteDoubleExclamationMark_Step0(struct ObjectEvent *, struct Sprite *); diff --git a/include/event_scripts.h b/include/event_scripts.h index 7c35e991c2..91846f8ce4 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -649,4 +649,8 @@ extern const u8 EventScript_VsSeekerChargingDone[]; extern const u8 Common_Movement_FollowerSafeStart[]; extern const u8 Common_Movement_FollowerSafeEnd[]; +extern const u8 EventScript_CancelMessageBox[]; +extern const u8 Common_EventScript_ShowPokemonCenterSign[]; +extern const u8 Common_EventScript_ShowPokemartSign[]; + #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index b259eb53c1..da23fe4336 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -34,5 +34,9 @@ u8 TrySetDiveWarp(void); const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatileBehavior, u8 direction); const u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position); void ClearPoisonStepCounter(void); +void CancelSignPostMessageBox(struct FieldInput *input); + +#define NOT_SIGNPOST 0 +#define WALK_AWAY_SIGNPOST_FRAMES 6 #endif // GUARD_FIELDCONTROLAVATAR_H diff --git a/include/field_message_box.h b/include/field_message_box.h index 34b3324e72..810ac0fc20 100644 --- a/include/field_message_box.h +++ b/include/field_message_box.h @@ -19,4 +19,6 @@ u8 GetFieldMessageBoxMode(void); void StopFieldMessage(void); void InitFieldMessageBox(void); +extern u8 gWalkAwayFromSignpostTimer; + #endif // GUARD_FIELD_MESSAGE_BOX_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index caf28afb87..12de71be8f 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -64,5 +64,9 @@ bool32 IsPlayerSpinExitActive(void); void SetPlayerInvisibility(bool8 invisible); u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void StartFishing(u8 rod); +bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction); +//sideways stairs +u8 GetRightSideStairsDirection(u8 direction); +u8 GetLeftSideStairsDirection(u8 direction); #endif // GUARD_FIELD_PLAYER_AVATAR_H 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 36abeeb2a2..af20bbd3ac 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -220,7 +220,8 @@ struct ObjectEvent /*0x1D*/ u8 trainerRange_berryTreeId; /*0x1E*/ u8 currentMetatileBehavior; /*0x1F*/ u8 previousMetatileBehavior; - /*0x20*/ u8 previousMovementDirection; + /*0x20*/ u8 previousMovementDirection:4; + u8 directionOverwrite:4; /*0x21*/ u8 directionSequenceIndex; /*0x22*/ u8 playerCopyableMovement; // COPY_MOVE_* /*0x23*/ u8 spriteId; @@ -300,6 +301,9 @@ enum COLLISION_ISOLATED_HORIZONTAL_RAIL, COLLISION_VERTICAL_RAIL, COLLISION_HORIZONTAL_RAIL, + COLLISION_STAIR_WARP, + COLLISION_SIDEWAYS_STAIRS_TO_RIGHT, + COLLISION_SIDEWAYS_STAIRS_TO_LEFT }; // player running states diff --git a/include/graphics.h b/include/graphics.h index 0ea07557d5..e11acf8978 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2,6 +2,7 @@ #define GUARD_GRAPHICS_H // overworld +extern const u32 gSignpostWindow_Gfx[]; extern const u32 gMessageBox_Gfx[]; extern const u16 gMessageBox_Pal[]; diff --git a/include/menu.h b/include/menu.h index fac4ef1b65..d2190fb854 100644 --- a/include/menu.h +++ b/include/menu.h @@ -5,6 +5,12 @@ #include "text.h" #include "window.h" +#define DLG_WINDOW_PALETTE_NUM 15 +#define DLG_WINDOW_BASE_TILE_NUM 0x200 +#define STD_WINDOW_PALETTE_NUM 14 +#define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) +#define STD_WINDOW_BASE_TILE_NUM 0x214 + #define MENU_NOTHING_CHOSEN -2 #define MENU_B_PRESSED -1 diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index c2d0d23ee3..58eb83ea7b 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -148,5 +148,22 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); +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); +bool8 MetatileBehavior_IsSidewaysStairsRightSideTop(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsLeftSideTop(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsRightSideBottom(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsLeftSideBottom(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior); #endif // GUARD_METATILE_BEHAVIOR_H diff --git a/include/overworld.h b/include/overworld.h index 2e6bb8a922..49f75e64ec 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -60,6 +60,7 @@ extern void (*gFieldCallback)(void); extern bool8 (*gFieldCallback2)(void); extern u8 gLocalLinkPlayerId; extern u8 gFieldLinkPlayerCount; +extern bool8 gExitStairsMovementDisabled; extern u8 gTimeOfDay; extern u16 gTimeUpdateCounter; 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/include/script.h b/include/script.h index 4dc30ca74c..1f3c4f7afb 100644 --- a/include/script.h +++ b/include/script.h @@ -63,4 +63,7 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize); // srccmd.h void SetMovingNpcId(u16 npcId); +extern u8 gMsgIsSignPost; +extern u8 gMsgBoxIsCancelable; + #endif // GUARD_SCRIPT_H diff --git a/include/strings.h b/include/strings.h index 041f43d05b..84f87ff491 100644 --- a/include/strings.h +++ b/include/strings.h @@ -62,15 +62,6 @@ extern const u8 gText_MultiLink[]; extern const u8 gText_Single[]; extern const u8 gText_Double[]; -extern const u8 gText_Spicy[]; -extern const u8 gText_Dry[]; -extern const u8 gText_Sweet[]; -extern const u8 gText_Bitter[]; -extern const u8 gText_Sour[]; - -extern const u8 gText_StowCase[]; -extern const u8 gText_LvVar1[]; - extern const u8 gText_Spicy2[]; extern const u8 gText_Dry2[]; extern const u8 gText_Sweet2[]; @@ -117,9 +108,6 @@ extern const u8 gText_NoDecorationsInUse[]; extern const u8 gText_Exit[]; extern const u8 gText_Cancel[]; -extern const u8 gText_ThrowAwayVar1[]; -extern const u8 gText_Var1ThrownAway[]; - extern const u8 gText_Color161Shadow161[]; extern const u8 gText_GoBackPrevMenu[]; extern const u8 gText_CantPlaceInRoom[]; @@ -184,25 +172,6 @@ extern const u8 gText_Coins[]; extern const u8 gText_Silver[]; extern const u8 gText_Gold[]; -extern const u8 gText_Var1AteTheVar2[]; -extern const u8 gText_Var1HappilyAteVar2[]; -extern const u8 gText_Var1DisdainfullyAteVar2[]; - -extern const u8 gText_RedPokeblock[]; -extern const u8 gText_BluePokeblock[]; -extern const u8 gText_PinkPokeblock[]; -extern const u8 gText_GreenPokeblock[]; -extern const u8 gText_YellowPokeblock[]; -extern const u8 gText_PurplePokeblock[]; -extern const u8 gText_IndigoPokeblock[]; -extern const u8 gText_BrownPokeblock[]; -extern const u8 gText_LiteBluePokeblock[]; -extern const u8 gText_OlivePokeblock[]; -extern const u8 gText_GrayPokeblock[]; -extern const u8 gText_BlackPokeblock[]; -extern const u8 gText_WhitePokeblock[]; -extern const u8 gText_GoldPokeblock[]; - extern const u8 gMenuText_Use[]; extern const u8 gMenuText_Toss[]; extern const u8 gMenuText_Give[]; @@ -334,19 +303,6 @@ extern const u8 gText_LoadingEvent[]; extern const u8 gText_DontRemoveCableTurnOff[]; extern const u8 gText_LinkStandby2[]; -// berry tag screen text -extern const u8 gBerryFirmnessString_VerySoft[]; -extern const u8 gBerryFirmnessString_Soft[]; -extern const u8 gBerryFirmnessString_Hard[]; -extern const u8 gBerryFirmnessString_VeryHard[]; -extern const u8 gBerryFirmnessString_SuperHard[]; -extern const u8 gText_BerryTag[]; -extern const u8 gText_NumberVar1Var2[]; -extern const u8 gText_SizeSlash[]; -extern const u8 gText_Var1DotVar2[]; -extern const u8 gText_ThreeMarks[]; -extern const u8 gText_FirmSlash[]; - // item menu screen text extern const u8 gText_CloseBag[]; extern const u8 gText_NumberItem_HM[]; @@ -1263,36 +1219,6 @@ extern const u8 gText_FrontierFacilityRoomsCleared[]; extern const u8 gText_FrontierFacilityKOsStreak[]; extern const u8 gText_FrontierFacilityFloorsCleared[]; -// Frontier Brain -extern const u8 gText_AnabelWonSilver[]; -extern const u8 gText_TuckerWonSilver[]; -extern const u8 gText_SpenserWonSilver[]; -extern const u8 gText_GretaWonSilver[]; -extern const u8 gText_NolandWonSilver[]; -extern const u8 gText_LucyWonSilver[]; -extern const u8 gText_BrandonWonSilver[]; -extern const u8 gText_AnabelDefeatSilver[]; -extern const u8 gText_TuckerDefeatSilver[]; -extern const u8 gText_SpenserDefeatSilver[]; -extern const u8 gText_GretaDefeatSilver[]; -extern const u8 gText_NolandDefeatSilver[]; -extern const u8 gText_LucyDefeatSilver[]; -extern const u8 gText_BrandonDefeatSilver[]; -extern const u8 gText_AnabelWonGold[]; -extern const u8 gText_TuckerWonGold[]; -extern const u8 gText_SpenserWonGold[]; -extern const u8 gText_GretaWonGold[]; -extern const u8 gText_NolandWonGold[]; -extern const u8 gText_LucyWonGold[]; -extern const u8 gText_BrandonWonGold[]; -extern const u8 gText_AnabelDefeatGold[]; -extern const u8 gText_TuckerDefeatGold[]; -extern const u8 gText_SpenserDefeatGold[]; -extern const u8 gText_GretaDefeatGold[]; -extern const u8 gText_NolandDefeatGold[]; -extern const u8 gText_LucyDefeatGold[]; -extern const u8 gText_BrandonDefeatGold[]; - // Battle Tower. extern const u8 BattleFrontier_BattleTowerMultiPartnerRoom_Text_Apprentice1Intro[]; extern const u8 BattleFrontier_BattleTowerMultiPartnerRoom_Text_Apprentice1Mon1[]; diff --git a/include/text_window.h b/include/text_window.h index aa7798c358..a292d1309e 100644 --- a/include/text_window.h +++ b/include/text_window.h @@ -14,6 +14,7 @@ extern const u16 gTextWindowFrame1_Pal[]; const struct TilesPal *GetWindowFrameTilesPal(u8 id); void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset); +void LoadSignBoxGfx(u8 windowId, u16 destOffset, u8 palOffset); void LoadWindowGfx(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset); void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset); void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset); @@ -23,5 +24,6 @@ void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum); void rbox_fill_rectangle(u8 windowId); const u16 *GetTextWindowPalette(u8 id); const u16 *GetOverworldTextboxPalettePtr(void); +void LoadSignPostWindowFrameGfx(void); #endif // GUARD_TEXT_WINDOW_H 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..e686b52071 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; } @@ -835,6 +835,9 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IsTwoTurnNotSemiInvulnerableMove(battlerAtk, move) && CanTargetFaintAi(battlerDef, battlerAtk)) RETURN_SCORE_MINUS(10); + if (gBattleStruct->commandingDondozo & (1u << battlerDef)) + RETURN_SCORE_MINUS(20); + // check if negates type switch (effectiveness) { @@ -3679,7 +3682,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 +4093,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 b087cf3939..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; @@ -1609,8 +1609,8 @@ static u32 GetSwitchinHitsToKO(s32 damageTaken, u32 battler) u16 maxHP = AI_DATA->switchinCandidate.battleMon.maxHP, item = AI_DATA->switchinCandidate.battleMon.item, heldItemEffect = ItemId_GetHoldEffect(item); u8 weatherDuration = gWishFutureKnock.weatherDuration, holdEffectParam = ItemId_GetHoldEffectParam(item); u32 opposingBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(battler))); - u32 opposingAbility = gBattleMons[opposingBattler].ability; - bool32 usedSingleUseHealingItem = FALSE; + u32 opposingAbility = gBattleMons[opposingBattler].ability, ability = AI_DATA->switchinCandidate.battleMon.ability; + bool32 usedSingleUseHealingItem = FALSE, opponentCanBreakMold = IsMoldBreakerTypeAbility(opposingBattler, opposingAbility); s32 currentHP = startingHP; // No damage being dealt @@ -1631,6 +1631,10 @@ static u32 GetSwitchinHitsToKO(s32 damageTaken, u32 battler) // Take attack damage for the turn currentHP = currentHP - damageTaken; + // One shot prevention effects + if (damageTaken >= maxHP && currentHP == maxHP && (heldItemEffect == HOLD_EFFECT_FOCUS_SASH || (!opponentCanBreakMold && B_STURDY >= GEN_5 && ability == ABILITY_STURDY))) + currentHP = 1; + // If mon is still alive, apply weather impact first, as it might KO the mon before it can heal with its item (order is weather -> item -> status) if (currentHP != 0) currentHP = currentHP - weatherImpact; @@ -1693,6 +1697,10 @@ static u32 GetSwitchinHitsToKO(s32 damageTaken, u32 battler) hitsToKO++; } + // Disguise will always add an extra hit to KO + if (opponentCanBreakMold && AI_DATA->switchinCandidate.battleMon.species == SPECIES_MIMIKYU_DISGUISED) + hitsToKO++; + // If mon had a hypothetical status from TSpikes, clear it if (AI_DATA->switchinCandidate.hypotheticalStatus == TRUE) { diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 5fabe7c134..05dbbe916a 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -412,6 +412,9 @@ bool32 IsDamageMoveUnusable(u32 move, u32 battlerAtk, u32 battlerDef) if (battlerDef == BATTLE_PARTNER(battlerAtk)) battlerDefAbility = aiData->abilities[battlerDef]; + if (gBattleStruct->commandingDondozo & (1u << battlerDef)) + return TRUE; + switch (battlerDefAbility) { case ABILITY_LIGHTNING_ROD: @@ -1113,6 +1116,26 @@ s32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler, u32 moveConsidered) return AI_IS_SLOWER; } +static bool32 CanEndureHit(u32 battler, u32 battlerTarget, u32 move) +{ + if (!BATTLER_MAX_HP(battlerTarget) || gMovesInfo[move].effect == EFFECT_MULTI_HIT) + return FALSE; + if (gMovesInfo[move].strikeCount > 1 && !(gMovesInfo[move].effect == EFFECT_DRAGON_DARTS && IsValidDoubleBattle(battlerTarget))) + return FALSE; + if (AI_DATA->holdEffects[battlerTarget] == HOLD_EFFECT_FOCUS_SASH) + return TRUE; + + if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battler], move)) + { + if (B_STURDY >= GEN_5 && AI_DATA->abilities[battlerTarget] == ABILITY_STURDY) + return TRUE; + if (gBattleMons[battlerTarget].species == SPECIES_MIMIKYU_DISGUISED) + return TRUE; + } + + return FALSE; +} + // Check if target has means to faint ai mon. bool32 CanTargetFaintAi(u32 battlerDef, u32 battlerAtk) { @@ -1123,7 +1146,8 @@ bool32 CanTargetFaintAi(u32 battlerDef, u32 battlerAtk) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !(unusable & (1u << i)) - && AI_DATA->simulatedDmg[battlerDef][battlerAtk][i].expected >= gBattleMons[battlerAtk].hp) + && AI_DATA->simulatedDmg[battlerDef][battlerAtk][i].expected >= gBattleMons[battlerAtk].hp + && !CanEndureHit(battlerDef, battlerAtk, moves[i])) { return TRUE; } @@ -1210,7 +1234,13 @@ bool32 CanAIFaintTarget(u32 battlerAtk, u32 battlerDef, u32 numHits) dmg *= numHits; if (gBattleMons[battlerDef].hp <= dmg) - return TRUE; + { + if (numHits > 1) + return TRUE; + + if (!CanEndureHit(battlerAtk, battlerDef, moves[i])) + return TRUE; + } } } @@ -1481,6 +1511,8 @@ bool32 IsSemiInvulnerable(u32 battlerDef, u32 move) { if (gStatuses3[battlerDef] & STATUS3_PHANTOM_FORCE) return TRUE; + else if (gBattleStruct->commandingDondozo & (1u << battlerDef)) + return TRUE; else if (!gMovesInfo[move].damagesAirborne && gStatuses3[battlerDef] & STATUS3_ON_AIR) return TRUE; else if (!gMovesInfo[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER) @@ -1922,13 +1954,14 @@ bool32 ShouldLowerEvasion(u32 battlerAtk, u32 battlerDef, u32 defAbility) bool32 CanIndexMoveFaintTarget(u32 battlerAtk, u32 battlerDef, u32 index, u32 numHits) { s32 dmg; + u16 *moves = gBattleMons[battlerAtk].moves; if (numHits) dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][index].expected * numHits; else dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][index].minimum; - if (gBattleMons[battlerDef].hp <= dmg) + if (gBattleMons[battlerDef].hp <= dmg && !CanEndureHit(battlerAtk, battlerDef, moves[index])) return TRUE; return FALSE; } @@ -2671,10 +2704,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)) @@ -2699,7 +2730,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 @@ -2714,7 +2745,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 @@ -2785,7 +2816,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_bug.c b/src/battle_anim_bug.c index 65bfcba2e1..e897290768 100644 --- a/src/battle_anim_bug.c +++ b/src/battle_anim_bug.c @@ -11,7 +11,6 @@ static void AnimTranslateWebThread_Step(struct Sprite *); static void AnimStringWrap(struct Sprite *); static void AnimSpiderWeb_Step(struct Sprite *); static void AnimSpiderWeb_End(struct Sprite *); -static void AnimTranslateStinger(struct Sprite *); static void AnimTailGlowOrb(struct Sprite *); static const union AffineAnimCmd sAffineAnim_MegahornHorn_0[] = @@ -371,7 +370,7 @@ static void AnimSpiderWeb_End(struct Sprite *sprite) // arg 2: target x pixel offset // arg 3: target y pixel offset // arg 4: duration -static void AnimTranslateStinger(struct Sprite *sprite) +void AnimTranslateStinger(struct Sprite *sprite) { s16 lVarX, lVarY; u16 rot; diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 69b9d0760e..50fd34921f 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -5495,8 +5495,8 @@ static void AnimMilkBottle_Step2(struct Sprite *sprite, int unk1, int unk2) void AnimGrantingStars(struct Sprite *sprite) { - if (!gBattleAnimArgs[2]) - SetSpriteCoordsToAnimAttackerCoords(sprite); + if (!InitSpritePosToAnimBattler(gBattleAnimArgs[2], sprite, FALSE)) + return; SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->y += gBattleAnimArgs[1]; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index ed2e7457f6..1530fa37a5 100644 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1281,6 +1281,17 @@ const struct SpriteTemplate gTeraCrystalSpreadSpriteTemplate = .callback = AnimTask_TeraCrystalShatter, }; +const struct SpriteTemplate gPinkPetalVortexTemplate = +{ + .tileTag = ANIM_TAG_PINK_PETAL, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSweetScentPetalAnimCmdTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; + // Task data for AnimTask_TeraCrystalShatter #define tCounter data[0] #define tDX data[6] @@ -2378,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_anim_fight.c b/src/battle_anim_fight.c index e150a2a57d..ed18e89f9b 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -414,9 +414,9 @@ const struct SpriteTemplate gPalmSpriteTemplate = const struct SpriteTemplate gAuraSphereBlast = { - .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, - .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, - .oam = &gOamData_AffineOff_ObjNormal_64x64, + .tileTag = ANIM_TAG_IMPACT_2, + .paletteTag = ANIM_TAG_IMPACT_2, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 1fd587fa4c..7d21624495 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -359,7 +359,10 @@ const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = // same as AnimEllipticalGust but centered on targets static void AnimEllipticalGustCentered(struct Sprite *sprite) { - InitSpritePosToAnimTargetsCentre(sprite, FALSE); + if (IsDoubleBattle()) + InitSpritePosToAnimTargetsCentre(sprite, FALSE); + else + InitSpritePosToAnimTarget(sprite, FALSE); sprite->y += 20; sprite->data[1] = 191; sprite->callback = AnimEllipticalGust_Step; diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c index 051524a689..04fd111a84 100644 --- a/src/battle_anim_mon_movement.c +++ b/src/battle_anim_mon_movement.c @@ -487,11 +487,7 @@ static void ReverseVerticalDipDirection(struct Sprite *sprite) // arg 2: duration static void SlideMonToOriginalPos(struct Sprite *sprite) { - u32 monSpriteId; - if (!gBattleAnimArgs[0]) - monSpriteId = gBattlerSpriteIds[gBattleAnimAttacker]; - else - monSpriteId = gBattlerSpriteIds[gBattleAnimTarget]; + u32 monSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gSprites[monSpriteId].x + gSprites[monSpriteId].x2; @@ -554,15 +550,9 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite) // arg 4: duration static void SlideMonToOffset(struct Sprite *sprite) { - u8 battler; - u8 monSpriteId; - if (!gBattleAnimArgs[0]) - battler = gBattleAnimAttacker; - else - battler = gBattleAnimTarget; + u8 monSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - monSpriteId = gBattlerSpriteIds[battler]; - if (GetBattlerSide(battler) != B_SIDE_PLAYER) + if (GetBattlerSide(gBattleAnimArgs[0]) != B_SIDE_PLAYER) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; if (gBattleAnimArgs[3] == 1) diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index e0b4820409..dec12e0dc6 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -116,11 +116,7 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType) } else { - if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - + mon = GetPartyBattlerData(battlerId); illusionMon = GetIllusionMonPtr(battlerId); if (illusionMon != NULL) mon = illusionMon; diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 4cadfaaffd..50bb83305f 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -99,7 +99,6 @@ static void SpriteCB_GlacialLance_Step1(struct Sprite* sprite); static void SpriteCB_GlacialLance_Step2(struct Sprite* sprite); static void SpriteCB_GlacialLance(struct Sprite* sprite); static void SpriteCB_TripleArrowKick(struct Sprite* sprite); -static void AnimMakingItRain(struct Sprite *sprite); // const data // general @@ -2176,18 +2175,7 @@ const struct SpriteTemplate gSpiritShackleArrowTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimSonicBoomProjectile -}; - -const struct SpriteTemplate gSpiritShackleChainTemplate = -{ - .tileTag = ANIM_TAG_CHAIN_LINK, - .paletteTag = ANIM_TAG_CHAIN_LINK, - .oam = &gOamData_AffineOff_ObjNormal_32x16, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimThunderWave + .callback = AnimTranslateStinger }; //darkest lariat @@ -7235,18 +7223,6 @@ const struct SpriteTemplate gBitterBladeImpactTemplate = .callback = AnimClawSlash }; -// Make It Rain -const struct SpriteTemplate gMakingItRainTemplate = -{ - .tileTag = ANIM_TAG_COIN, - .paletteTag = ANIM_TAG_COIN, - .oam = &gOamData_AffineNormal_ObjNormal_16x16, - .anims = gCoinAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimMakingItRain, -}; - const struct SpriteTemplate gRedExplosionSpriteTemplate = { .tileTag = ANIM_TAG_RED_EXPLOSION, @@ -7280,6 +7256,39 @@ const struct SpriteTemplate gMoonUpSpriteTemplate = .callback = AnimWeatherBallUp, }; +const union AnimCmd gSproutAnimCmds[] = +{ + ANIMCMD_FRAME(96, 5), + ANIMCMD_END, +}; + +const union AnimCmd *const gSproutAnimTable[] = +{ + gSproutAnimCmds, +}; + +const struct SpriteTemplate gSproutGrowSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPROUT, + .paletteTag = ANIM_TAG_SPROUT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gSproutAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos, +}; + +const struct SpriteTemplate gFreezyFrostRisingSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ICICLE_SPEAR, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_GeyserTarget +}; + // functions //general void AnimTask_IsTargetPartner(u8 taskId) @@ -9266,26 +9275,6 @@ void AnimTask_StickySyrup(u8 taskId) DestroyAnimVisualTask(taskId); } -static void AnimMakingItRain(struct Sprite *sprite) -{ - if (gBattleAnimArgs[3] != 0) - SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &sprite->x, &sprite->y); //coin shower on target - - sprite->x += gBattleAnimArgs[0]; - sprite->y += 14; - StartSpriteAnim(sprite, gBattleAnimArgs[1]); - AnimateSprite(sprite); - sprite->data[0] = 0; - sprite->data[1] = 0; - sprite->data[2] = 4; - sprite->data[3] = 16; - sprite->data[4] = -70; - sprite->data[5] = gBattleAnimArgs[2]; - StoreSpriteCallbackInData6(sprite, AnimFallingRock_Step); - sprite->callback = TranslateSpriteInEllipse; - sprite->callback(sprite); -} - void AnimTask_RandomBool(u8 taskId) { if (RandomPercentage(RNG_NONE, 50)) diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index 5aa14ffa34..b6239ca063 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -349,6 +349,28 @@ const struct SpriteTemplate gSeedFlareGreenWavesTemplate = .callback = AnimFlyingSandCrescent }; +const struct SpriteTemplate gMakingItRainTemplate = +{ + .tileTag = ANIM_TAG_COIN, + .paletteTag = ANIM_TAG_COIN, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gCoinAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFallingRock, +}; + +const struct SpriteTemplate gFallingSeedSpriteTemplate = +{ + .tileTag = ANIM_TAG_SEED, + .paletteTag = ANIM_TAG_SEED, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFallingRock, +}; + static void AnimStealthRock(struct Sprite *sprite) { s16 x, y; @@ -456,7 +478,14 @@ void AnimRockFragment(struct Sprite *sprite) // Swirls particle in vortex. Used for moves like Fire Spin or Sand Tomb void AnimParticleInVortex(struct Sprite *sprite) { - InitSpritePosToAnimBattler(gBattleAnimArgs[6], sprite, FALSE); + if (IsDoubleBattle() //got a little lazy here will fix later + && (gAnimMoveIndex == MOVE_BLEAKWIND_STORM + || gAnimMoveIndex == MOVE_SANDSEAR_STORM + || gAnimMoveIndex == MOVE_SPRINGTIDE_STORM + || gAnimMoveIndex == MOVE_WILDBOLT_STORM)) + InitSpritePosToAnimTargetsCentre(sprite, FALSE); + else + InitSpritePosToAnimTarget(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[4]; 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 b088aa73ba..b03ef194f0 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -2269,14 +2269,9 @@ static void UpdateMonData(struct BattleDebugMenu *data) { if (data->battlerWasChanged[i]) { - struct Pokemon *mon; + struct Pokemon *mon = GetPartyBattlerData(i); struct BattlePokemon *battleMon = &gBattleMons[i]; - if (GetBattlerSide(i) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[i]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[i]]; - SetMonData(mon, MON_DATA_HELD_ITEM, &battleMon->item); SetMonData(mon, MON_DATA_STATUS, &battleMon->status1); SetMonData(mon, MON_DATA_HP, &battleMon->hp); @@ -2435,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, @@ -2585,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 a4c55ce9b5..d30d7a927f 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" @@ -304,7 +305,7 @@ static const s8 sCenterToCornerVecXs[8] ={-32, -16, -16, -32, -32}; // extra args are money and ball #define TRAINER_CLASS(trainerClass, trainerName, ...) \ - [TRAINER_CLASS_##trainerClass] = \ + [trainerClass] = \ { \ .name = _(trainerName), \ .money = DEFAULT(5, __VA_ARGS__), \ @@ -313,72 +314,72 @@ static const s8 sCenterToCornerVecXs[8] ={-32, -16, -16, -32, -32}; const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] = { - TRAINER_CLASS(PKMN_TRAINER_1, "{PKMN} TRAINER"), - TRAINER_CLASS(PKMN_TRAINER_2, "{PKMN} TRAINER"), - TRAINER_CLASS(HIKER, "HIKER", 10), - TRAINER_CLASS(TEAM_AQUA, "TEAM AQUA"), - TRAINER_CLASS(PKMN_BREEDER, "{PKMN} BREEDER", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_HEAL_BALL : ITEM_FRIEND_BALL), - TRAINER_CLASS(COOLTRAINER, "COOLTRAINER", 12, ITEM_ULTRA_BALL), - TRAINER_CLASS(BIRD_KEEPER, "BIRD KEEPER", 8), - TRAINER_CLASS(COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL), - TRAINER_CLASS(SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL), - TRAINER_CLASS(TEAM_MAGMA, "TEAM MAGMA"), - TRAINER_CLASS(EXPERT, "EXPERT", 10), - TRAINER_CLASS(AQUA_ADMIN, "AQUA ADMIN", 10), - TRAINER_CLASS(BLACK_BELT, "BLACK BELT", 8, ITEM_ULTRA_BALL), - TRAINER_CLASS(AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL), - TRAINER_CLASS(HEX_MANIAC, "HEX MANIAC", 6), - TRAINER_CLASS(AROMA_LADY, "AROMA LADY", 10), - TRAINER_CLASS(RUIN_MANIAC, "RUIN MANIAC", 15), - TRAINER_CLASS(INTERVIEWER, "INTERVIEWER", 12), - TRAINER_CLASS(TUBER_F, "TUBER", 1), - TRAINER_CLASS(TUBER_M, "TUBER", 1), - TRAINER_CLASS(LADY, "LADY", 50), - TRAINER_CLASS(BEAUTY, "BEAUTY", 20), - TRAINER_CLASS(RICH_BOY, "RICH BOY", 50), - TRAINER_CLASS(POKEMANIAC, "POKéMANIAC", 15), - TRAINER_CLASS(GUITARIST, "GUITARIST", 8), - TRAINER_CLASS(KINDLER, "KINDLER", 8), - TRAINER_CLASS(CAMPER, "CAMPER", 4), - TRAINER_CLASS(PICNICKER, "PICNICKER", 4), - TRAINER_CLASS(BUG_MANIAC, "BUG MANIAC", 15), - TRAINER_CLASS(PSYCHIC, "PSYCHIC", 6), - TRAINER_CLASS(GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL), - TRAINER_CLASS(ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL), - TRAINER_CLASS(LEADER, "LEADER", 25), - TRAINER_CLASS(SCHOOL_KID, "SCHOOL KID"), - TRAINER_CLASS(SR_AND_JR, "SR. AND JR.", 4), - TRAINER_CLASS(WINSTRATE, "WINSTRATE", 10), - TRAINER_CLASS(POKEFAN, "POKéFAN", 20), - TRAINER_CLASS(YOUNGSTER, "YOUNGSTER", 4), - TRAINER_CLASS(CHAMPION, "CHAMPION", 50), - TRAINER_CLASS(FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_DIVE_BALL : ITEM_LURE_BALL), - TRAINER_CLASS(TRIATHLETE, "TRIATHLETE", 10), - TRAINER_CLASS(DRAGON_TAMER, "DRAGON TAMER", 12), - TRAINER_CLASS(NINJA_BOY, "NINJA BOY", 3), - TRAINER_CLASS(BATTLE_GIRL, "BATTLE GIRL", 6), - TRAINER_CLASS(PARASOL_LADY, "PARASOL LADY", 10), - TRAINER_CLASS(SWIMMER_F, "SWIMMER♀", 2, ITEM_DIVE_BALL), - TRAINER_CLASS(TWINS, "TWINS", 3), - TRAINER_CLASS(SAILOR, "SAILOR", 8), - TRAINER_CLASS(COOLTRAINER_2, "COOLTRAINER", 5, ITEM_ULTRA_BALL), - TRAINER_CLASS(MAGMA_ADMIN, "MAGMA ADMIN", 10), - TRAINER_CLASS(RIVAL, "{PKMN} TRAINER", 15), - TRAINER_CLASS(BUG_CATCHER, "BUG CATCHER", 4), - TRAINER_CLASS(PKMN_RANGER, "{PKMN} RANGER", 12), - TRAINER_CLASS(MAGMA_LEADER, "MAGMA LEADER", 20, ITEM_MASTER_BALL), - TRAINER_CLASS(LASS, "LASS", 4), - TRAINER_CLASS(YOUNG_COUPLE, "YOUNG COUPLE", 8), - TRAINER_CLASS(OLD_COUPLE, "OLD COUPLE", 10), - TRAINER_CLASS(SIS_AND_BRO, "SIS AND BRO", 3), - TRAINER_CLASS(SALON_MAIDEN, "SALON MAIDEN"), - TRAINER_CLASS(DOME_ACE, "DOME ACE"), - TRAINER_CLASS(PALACE_MAVEN, "PALACE MAVEN"), - TRAINER_CLASS(ARENA_TYCOON, "ARENA TYCOON"), - TRAINER_CLASS(FACTORY_HEAD, "FACTORY HEAD"), - TRAINER_CLASS(PIKE_QUEEN, "PIKE QUEEN"), - TRAINER_CLASS(PYRAMID_KING, "PYRAMID KING"), - TRAINER_CLASS(RS_PROTAG, "{PKMN} TRAINER"), + TRAINER_CLASS(TRAINER_CLASS_PKMN_TRAINER_1, "{PKMN} TRAINER"), + TRAINER_CLASS(TRAINER_CLASS_PKMN_TRAINER_2, "{PKMN} TRAINER"), + TRAINER_CLASS(TRAINER_CLASS_HIKER, "HIKER", 10), + TRAINER_CLASS(TRAINER_CLASS_TEAM_AQUA, "TEAM AQUA"), + TRAINER_CLASS(TRAINER_CLASS_PKMN_BREEDER, "{PKMN} BREEDER", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_HEAL_BALL : ITEM_FRIEND_BALL), + TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER, "COOLTRAINER", 12, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_BIRD_KEEPER, "BIRD KEEPER", 8), + TRAINER_CLASS(TRAINER_CLASS_COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL), + TRAINER_CLASS(TRAINER_CLASS_SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL), + TRAINER_CLASS(TRAINER_CLASS_TEAM_MAGMA, "TEAM MAGMA"), + TRAINER_CLASS(TRAINER_CLASS_EXPERT, "EXPERT", 10), + TRAINER_CLASS(TRAINER_CLASS_AQUA_ADMIN, "AQUA ADMIN", 10), + TRAINER_CLASS(TRAINER_CLASS_BLACK_BELT, "BLACK BELT", 8, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL), + TRAINER_CLASS(TRAINER_CLASS_HEX_MANIAC, "HEX MANIAC", 6), + TRAINER_CLASS(TRAINER_CLASS_AROMA_LADY, "AROMA LADY", 10), + TRAINER_CLASS(TRAINER_CLASS_RUIN_MANIAC, "RUIN MANIAC", 15), + TRAINER_CLASS(TRAINER_CLASS_INTERVIEWER, "INTERVIEWER", 12), + TRAINER_CLASS(TRAINER_CLASS_TUBER_F, "TUBER", 1), + TRAINER_CLASS(TRAINER_CLASS_TUBER_M, "TUBER", 1), + TRAINER_CLASS(TRAINER_CLASS_LADY, "LADY", 50), + TRAINER_CLASS(TRAINER_CLASS_BEAUTY, "BEAUTY", 20), + TRAINER_CLASS(TRAINER_CLASS_RICH_BOY, "RICH BOY", 50), + TRAINER_CLASS(TRAINER_CLASS_POKEMANIAC, "POKéMANIAC", 15), + TRAINER_CLASS(TRAINER_CLASS_GUITARIST, "GUITARIST", 8), + TRAINER_CLASS(TRAINER_CLASS_KINDLER, "KINDLER", 8), + TRAINER_CLASS(TRAINER_CLASS_CAMPER, "CAMPER", 4), + TRAINER_CLASS(TRAINER_CLASS_PICNICKER, "PICNICKER", 4), + TRAINER_CLASS(TRAINER_CLASS_BUG_MANIAC, "BUG MANIAC", 15), + TRAINER_CLASS(TRAINER_CLASS_PSYCHIC, "PSYCHIC", 6), + TRAINER_CLASS(TRAINER_CLASS_GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL), + TRAINER_CLASS(TRAINER_CLASS_ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_LEADER, "LEADER", 25), + TRAINER_CLASS(TRAINER_CLASS_SCHOOL_KID, "SCHOOL KID"), + TRAINER_CLASS(TRAINER_CLASS_SR_AND_JR, "SR. AND JR.", 4), + TRAINER_CLASS(TRAINER_CLASS_WINSTRATE, "WINSTRATE", 10), + TRAINER_CLASS(TRAINER_CLASS_POKEFAN, "POKéFAN", 20), + TRAINER_CLASS(TRAINER_CLASS_YOUNGSTER, "YOUNGSTER", 4), + TRAINER_CLASS(TRAINER_CLASS_CHAMPION, "CHAMPION", 50), + TRAINER_CLASS(TRAINER_CLASS_FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_DIVE_BALL : ITEM_LURE_BALL), + TRAINER_CLASS(TRAINER_CLASS_TRIATHLETE, "TRIATHLETE", 10), + TRAINER_CLASS(TRAINER_CLASS_DRAGON_TAMER, "DRAGON TAMER", 12), + TRAINER_CLASS(TRAINER_CLASS_NINJA_BOY, "NINJA BOY", 3), + TRAINER_CLASS(TRAINER_CLASS_BATTLE_GIRL, "BATTLE GIRL", 6), + TRAINER_CLASS(TRAINER_CLASS_PARASOL_LADY, "PARASOL LADY", 10), + TRAINER_CLASS(TRAINER_CLASS_SWIMMER_F, "SWIMMER♀", 2, ITEM_DIVE_BALL), + TRAINER_CLASS(TRAINER_CLASS_TWINS, "TWINS", 3), + TRAINER_CLASS(TRAINER_CLASS_SAILOR, "SAILOR", 8), + TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER_2, "COOLTRAINER", 5, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_MAGMA_ADMIN, "MAGMA ADMIN", 10), + TRAINER_CLASS(TRAINER_CLASS_RIVAL, "{PKMN} TRAINER", 15), + TRAINER_CLASS(TRAINER_CLASS_BUG_CATCHER, "BUG CATCHER", 4), + TRAINER_CLASS(TRAINER_CLASS_PKMN_RANGER, "{PKMN} RANGER", 12), + TRAINER_CLASS(TRAINER_CLASS_MAGMA_LEADER, "MAGMA LEADER", 20, ITEM_MASTER_BALL), + TRAINER_CLASS(TRAINER_CLASS_LASS, "LASS", 4), + TRAINER_CLASS(TRAINER_CLASS_YOUNG_COUPLE, "YOUNG COUPLE", 8), + TRAINER_CLASS(TRAINER_CLASS_OLD_COUPLE, "OLD COUPLE", 10), + TRAINER_CLASS(TRAINER_CLASS_SIS_AND_BRO, "SIS AND BRO", 3), + TRAINER_CLASS(TRAINER_CLASS_SALON_MAIDEN, "SALON MAIDEN"), + TRAINER_CLASS(TRAINER_CLASS_DOME_ACE, "DOME ACE"), + TRAINER_CLASS(TRAINER_CLASS_PALACE_MAVEN, "PALACE MAVEN"), + TRAINER_CLASS(TRAINER_CLASS_ARENA_TYCOON, "ARENA TYCOON"), + TRAINER_CLASS(TRAINER_CLASS_FACTORY_HEAD, "FACTORY HEAD"), + TRAINER_CLASS(TRAINER_CLASS_PIKE_QUEEN, "PIKE QUEEN"), + TRAINER_CLASS(TRAINER_CLASS_PYRAMID_KING, "PYRAMID KING"), + TRAINER_CLASS(TRAINER_CLASS_RS_PROTAG, "{PKMN} TRAINER"), }; static void (* const sTurnActionsFuncsTable[])(void) = @@ -3342,6 +3343,16 @@ const u8* FaintClearSetData(u32 battler) gBattleStruct->palaceFlags &= ~(1u << battler); gBattleStruct->boosterEnergyActivates &= ~(1u << battler); + if (gBattleStruct->commanderActive[battler] != SPECIES_NONE) + { + u32 partner = BATTLE_PARTNER(battler); + if (IsBattlerAlive(partner)) + { + BtlController_EmitSpriteInvisibility(partner, BUFFER_A, FALSE); + MarkBattlerForControllerExec(partner); + } + } + for (i = 0; i < ARRAY_COUNT(gSideTimers); i++) { // User of sticky web fainted, so reset the stored battler ID @@ -4177,6 +4188,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 @@ -4191,7 +4204,7 @@ static void HandleTurnActionSelectionState(void) || gBattleStruct->absentBattlerFlags & (1u << GetBattlerAtPosition(BATTLE_PARTNER(position))) || gBattleCommunication[GetBattlerAtPosition(BATTLE_PARTNER(position))] == STATE_WAIT_ACTION_CONFIRMED) { - if (gBattleStruct->absentBattlerFlags & (1u << battler)) + if ((gBattleStruct->absentBattlerFlags & (1u << battler)) || (gBattleStruct->commandingDondozo & (1u << battler))) { gChosenActionByBattler[battler] = B_ACTION_NOTHING_FAINTED; if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) @@ -5113,6 +5126,9 @@ static void TurnValuesCleanUp(bool8 var0) if (gDisableStructs[i].substituteHP == 0) gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE; + if (!(gStatuses3[i] & STATUS3_COMMANDER)) + gBattleStruct->commandingDondozo &= ~(1u << i); + gSpecialStatuses[i].parentalBondState = PARENTAL_BOND_OFF; } @@ -5121,6 +5137,7 @@ static void TurnValuesCleanUp(bool8 var0) gSideTimers[B_SIDE_PLAYER].followmeTimer = 0; gSideTimers[B_SIDE_OPPONENT].followmeTimer = 0; + gBattleStruct->usedEjectItem = 0; gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceller } @@ -5184,15 +5201,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; } @@ -6010,30 +6027,27 @@ void SetTypeBeforeUsingMove(u32 move, u32 battler) gBattleStruct->dynamicMoveType = TYPE_ELECTRIC | F_DYNAMIC_TYPE_SET; // Check if a gem should activate. - moveType = GetMoveType(move); - if (holdEffect == HOLD_EFFECT_GEMS - && moveType == ItemId_GetSecondaryId(heldItem)) + if (holdEffect == HOLD_EFFECT_GEMS && GetMoveType(move) == ItemId_GetSecondaryId(heldItem)) { gSpecialStatuses[battler].gemParam = GetBattlerHoldEffectParam(battler); gSpecialStatuses[battler].gemBoost = TRUE; } } -// 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_message.c b/src/battle_message.c index 7c009f5a73..d90113b5ea 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -830,7 +830,8 @@ static const u8 sText_TargetIsBeingSaltCured[] = _("{B_DEF_NAME_WITH_PREFIX} is static const u8 sText_TargetIsHurtBySaltCure[] = _("{B_DEF_NAME_WITH_PREFIX} is hurt by {B_BUFF1}!"); static const u8 sText_TargetCoveredInStickyCandySyrup[] = _("{B_DEF_NAME_WITH_PREFIX} got covered\nin sticky syrup!"); static const u8 sText_PkmnTellChillingReceptionJoke[] = _("{B_ATK_NAME_WITH_PREFIX} is preparing to tell a\nchillingly bad joke!"); -static const u8 sText_ZeroToHeroTransformation[] = _("{B_ATK_NAME_WITH_PREFIX} underwent a heroic\ntransformation!"); +static const u8 sText_ZeroToHeroTransformation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} underwent a heroic\ntransformation!"); +static const u8 sText_CommanderActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} was swallowed by Dondozo\nand became Dondozo's commander!"); static const u8 sText_TheTwoMovesBecomeOne[] = _("The two moves become one!\nIt's a combined move!{PAUSE 16}"); static const u8 sText_ARainbowAppearedOnSide[] = _("A rainbow appeared in the sky\non {B_ATK_TEAM2} team's side!"); static const u8 sText_TheRainbowDisappeared[] = _("The rainbow on {B_ATK_TEAM2}\nside disappeared!"); @@ -869,6 +870,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ARAINBOWAPPEAREDONSIDE - BATTLESTRINGS_TABLE_START] = sText_ARainbowAppearedOnSide, [STRINGID_THETWOMOVESBECOMEONE - BATTLESTRINGS_TABLE_START] = sText_TheTwoMovesBecomeOne, [STRINGID_ZEROTOHEROTRANSFORMATION - BATTLESTRINGS_TABLE_START] = sText_ZeroToHeroTransformation, + [STRINGID_COMMANDERACTIVATES - BATTLESTRINGS_TABLE_START] = sText_CommanderActivates, [STRINGID_PKMNTELLCHILLINGRECEPTIONJOKE - BATTLESTRINGS_TABLE_START] = sText_PkmnTellChillingReceptionJoke, [STRINGID_MOVEBLOCKEDBYDYNAMAX - BATTLESTRINGS_TABLE_START] = sText_MoveBlockedByDynamax, [STRINGID_TARGETISHURTBYSALTCURE - BATTLESTRINGS_TABLE_START] = sText_TargetIsHurtBySaltCure, @@ -3091,14 +3093,9 @@ static const u8 *TryGetStatusString(u8 *src) static void GetBattlerNick(u32 battler, u8 *dst) { - struct Pokemon *mon, *illusionMon; + struct Pokemon *illusionMon = GetIllusionMonPtr(battler); + struct Pokemon *mon = GetPartyBattlerData(battler); - if (GetBattlerSide(battler) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[battler]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[battler]]; - - illusionMon = GetIllusionMonPtr(battler); if (illusionMon != NULL) mon = illusionMon; GetMonData(mon, MON_DATA_NICKNAME, dst); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 76c39377a1..897bf1dab3 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" @@ -337,8 +337,6 @@ static bool8 CanBurnHitThaw(u16 move); static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent); static void TryUpdateEvolutionTracker(u32 evolutionMethod, u32 upAmount, u16 usedMove); static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u8 *failInstr, u16 move); -static void SaveBattlerAttacker(u32 battler); -static void SaveBattlerTarget(u32 battler); static void Cmd_attackcanceler(void); static void Cmd_accuracycheck(void); @@ -1197,6 +1195,13 @@ static void Cmd_attackcanceler(void) u16 attackerAbility = GetBattlerAbility(gBattlerAttacker); u32 moveType = GetMoveType(gCurrentMove); + if (gBattleStruct->usedEjectItem & (1u << gBattlerAttacker)) + { + gBattleStruct->usedEjectItem = 0; + gCurrentActionFuncId = B_ACTION_TRY_FINISH; + return; + } + // Weight-based moves are blocked by Dynamax. if ((GetActiveGimmick(gBattlerTarget) == GIMMICK_DYNAMAX) && IsMoveBlockedByDynamax(gCurrentMove)) { @@ -1401,6 +1406,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; @@ -1515,14 +1521,17 @@ static bool32 AccuracyCalcHelper(u16 move) return TRUE; } // If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits. - else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) + else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD + && !(gStatuses3[gBattlerTarget] & STATUS3_COMMANDER) + && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) { if (!JumpIfMoveFailed(7, move)) RecordAbilityBattle(gBattlerAttacker, ABILITY_NO_GUARD); return TRUE; } // If the target has the ability No Guard and they aren't involved in a Sky Drop or the current move isn't Sky Drop, move hits. - else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) + else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD + && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) { if (!JumpIfMoveFailed(7, move)) RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD); @@ -1530,8 +1539,8 @@ static bool32 AccuracyCalcHelper(u16 move) } // If the target is under the effects of Telekinesis, and the move isn't a OH-KO move, move hits. else if (gStatuses3[gBattlerTarget] & STATUS3_TELEKINESIS - && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) - && gMovesInfo[move].effect != EFFECT_OHKO) + && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) + && gMovesInfo[move].effect != EFFECT_OHKO) { JumpIfMoveFailed(7, move); return TRUE; @@ -1543,10 +1552,11 @@ static bool32 AccuracyCalcHelper(u16 move) return TRUE; } - if ((gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) - || ((gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) && !(gMovesInfo[move].damagesAirborne || gMovesInfo[move].damagesAirborneDoubleDamage)) - || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) && !gMovesInfo[move].damagesUnderground) - || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) && !gMovesInfo[move].damagesUnderwater)) + if ((gStatuses3[gBattlerTarget] & STATUS3_COMMANDER) + || (gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) + || ((gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) && !(gMovesInfo[move].damagesAirborne || gMovesInfo[move].damagesAirborneDoubleDamage)) + || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) && !gMovesInfo[move].damagesUnderground) + || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) && !gMovesInfo[move].damagesUnderwater)) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); @@ -1689,9 +1699,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 @@ -1948,6 +1957,79 @@ s32 CalcCritChanceStage(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordA u32 holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); return CalcCritChanceStageArgs(battlerAtk, battlerDef, move, recordAbility, abilityAtk, abilityDef, holdEffectAtk); } + +// Bulbapedia: https://bulbapedia.bulbagarden.net/wiki/Critical_hit#Generation_I +// Crit chance = Threshold / 256, Threshold maximum of 255 +// Threshold = Base Speed / 2 +// High crit move = 8 * (Base Speed / 2) +// Focus Energy = 4 * (Base Speed / 2) +s32 CalcCritChanceStageGen1(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbility) +{ + // Vanilla + u32 focusEnergyScaler = 4; + u32 highCritRatioScaler = 8; + + // Not vanilla + u32 superLuckScaler = 4; + u32 scopeLensScaler = 4; + u32 luckyPunchScaler = 8; + u32 farfetchedLeekScaler = 8; + + s32 critChance = 0; + s32 moveCritStage = gMovesInfo[gCurrentMove].criticalHitStage; + s32 bonusCritStage = gBattleStruct->bonusCritStages[gBattlerAttacker]; // G-Max Chi Strike + u32 abilityAtk = GetBattlerAbility(gBattlerAttacker); + u32 abilityDef = GetBattlerAbility(gBattlerTarget); + u32 holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); + u16 baseSpeed = gSpeciesInfo[gBattleMons[battlerAtk].species].baseSpeed; + + critChance = baseSpeed / 2; + + // Crit scaling + if (moveCritStage > 0) + critChance = critChance * highCritRatioScaler * moveCritStage; + + if (bonusCritStage > 0) + critChance = critChance * bonusCritStage; + + if ((gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY_ANY) != 0) + critChance = critChance * focusEnergyScaler; + + if (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS) + critChance = critChance * scopeLensScaler; + + if (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY) + critChance = critChance * luckyPunchScaler; + + if (BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)) + critChance = critChance * farfetchedLeekScaler; + + if (abilityAtk == ABILITY_SUPER_LUCK) + critChance = critChance * superLuckScaler; + + if (critChance > 255) + critChance = 255; + + // Prevented crits + if (gSideStatuses[battlerDef] & SIDE_STATUS_LUCKY_CHANT) + critChance = -1; + else if (abilityDef == ABILITY_BATTLE_ARMOR || abilityDef == ABILITY_SHELL_ARMOR) + { + if (recordAbility) + RecordAbilityBattle(battlerDef, abilityDef); + critChance = -1; + } + + // Guaranteed crits + else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS + || gMovesInfo[move].alwaysCriticalHit == TRUE + || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) + { + critChance = -2; + } + + return critChance; +} #undef BENEFITS_FROM_LEEK s32 GetCritHitOdds(s32 critChanceIndex) @@ -1963,7 +2045,13 @@ static void Cmd_critcalc(void) CMD_ARGS(); u16 partySlot; - s32 critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); + s32 critChance; + + if (B_CRIT_CHANCE == GEN_1) + critChance = CalcCritChanceStageGen1(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); + else + critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); + gPotentialItemEffectBattler = gBattlerAttacker; if (gBattleTypeFlags & (BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FIRST_BATTLE)) @@ -1973,7 +2061,18 @@ static void Cmd_critcalc(void) else if (critChance == -2) gIsCriticalHit = TRUE; else - gIsCriticalHit = RandomChance(RNG_CRITICAL_HIT, 1, sCriticalHitOdds[critChance]); + { + if (B_CRIT_CHANCE == GEN_1) + { + u8 critRoll = RandomUniform(RNG_CRITICAL_HIT, 1, 256); + if (critRoll <= critChance) + gIsCriticalHit = 1; + else + gIsCriticalHit = 0; + } + else + gIsCriticalHit = RandomChance(RNG_CRITICAL_HIT, 1, sCriticalHitOdds[critChance]); + } // Counter for EVO_CRITICAL_HITS. partySlot = gBattlerPartyIndexes[gBattlerAttacker]; @@ -2853,9 +2952,10 @@ void SetMoveEffect(bool32 primary, bool32 certain) INCREMENT_RESET_RETURN if (!(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) - && !primary - && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING) + && TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) + && !(gMovesInfo[gCurrentMove].effect == EFFECT_ORDER_UP && gBattleStruct->commanderActive[gBattlerAttacker]) + && !primary + && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING) INCREMENT_RESET_RETURN if (!IsBattlerAlive(gEffectBattler) && !activateAfterFaint) @@ -3829,6 +3929,43 @@ void SetMoveEffect(bool32 primary, bool32 certain) gBattlescriptCurrInstr = BattleScript_LowerAtkSpAtk; } break; + case MOVE_EFFECT_ORDER_UP: + { + u32 stat = 0; + bool32 commanderAffected = TRUE; + switch (gBattleStruct->commanderActive[gEffectBattler]) + { + case SPECIES_TATSUGIRI_CURLY: + stat = STAT_ATK; + break; + case SPECIES_TATSUGIRI_DROOPY: + stat = STAT_DEF; + break; + case SPECIES_TATSUGIRI_STRETCHY: + stat = STAT_SPEED; + break; + default: + commanderAffected = FALSE; + break; + } + if (!commanderAffected + || NoAliveMonsForEitherParty() + || ChangeStatBuffs(SET_STAT_BUFF_VALUE(1), + stat, + affectsUser | STAT_CHANGE_UPDATE_MOVE_EFFECT, + 0) == STAT_CHANGE_DIDNT_WORK) + { + gBattlescriptCurrInstr++; + } + else + { + gBattleScripting.animArg1 = gBattleScripting.moveEffect & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + gBattleScripting.animArg2 = 0; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_StatUp; + } + } + break; } } } @@ -4675,7 +4812,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; } @@ -5391,17 +5529,17 @@ static bool32 TryKnockOffBattleScript(u32 battlerDef) static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent) { - u32 i; - for (i = 0; i < MAX_BATTLERS_COUNT; i++) + u32 battler; + for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) { - if (i != gBattlerAttacker - && !(excludeCurrent && i == gBattlerTarget) - && IsBattlerAlive(i) - && !(gBattleStruct->targetsDone[gBattlerAttacker] & (1u << i)) - && (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) - break; + if (battler != gBattlerAttacker + && !(excludeCurrent && battler == gBattlerTarget) + && IsBattlerAlive(battler) + && !(gBattleStruct->targetsDone[gBattlerAttacker] & (1u << battler)) + && (GetBattlerSide(battler) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) + break; } - return i; + return battler; } static void Cmd_moveend(void) @@ -5437,7 +5575,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 +6159,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 @@ -6154,6 +6292,7 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection effect = TRUE; BattleScriptPushCursor(); + gBattleStruct->usedEjectItem |= 1u << battler; if (ejectButtonBattlers & (1u << battler)) { gBattlescriptCurrInstr = BattleScript_EjectButtonActivates; @@ -6223,8 +6362,15 @@ static void Cmd_moveend(void) if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE) gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_RedCardActivates; - gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE) + { + gBattlescriptCurrInstr = BattleScript_RedCardActivationNoSwitch; + } + else + { + gBattlescriptCurrInstr = BattleScript_RedCardActivates; + gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + } effect = TRUE; break; // Only fastest red card activates } @@ -6276,22 +6422,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 +6452,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; } @@ -6388,8 +6533,6 @@ static void Cmd_moveend(void) && (gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE) != STATUS2_LOCK_CONFUSE_TURN(1)) // And won't end this turn CancelMultiTurnMoves(gBattlerAttacker); // Cancel it - - if (gBattleStruct->savedAttackerCount > 0) { // #if TESTING @@ -6406,7 +6549,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 +6564,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) @@ -6434,6 +6578,18 @@ static void Cmd_moveend(void) if (B_CHARGE <= GEN_8 || moveType == TYPE_ELECTRIC) gStatuses3[gBattlerAttacker] &= ~(STATUS3_CHARGED_UP); memset(gQueuedStatBoosts, 0, sizeof(gQueuedStatBoosts)); + + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleStruct->commanderActive[i] != SPECIES_NONE && !IsBattlerAlive(i)) + { + u32 partner = BATTLE_PARTNER(i); + gBattleStruct->commanderActive[i] = SPECIES_NONE; + if (IsBattlerAlive(partner)) + gStatuses3[partner] &= ~STATUS3_COMMANDER; + } + } + gBattleScripting.moveendState++; break; case MOVEEND_COUNT: @@ -7334,6 +7490,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler) switch (GetBattlerAbility(i)) { case ABILITY_TRACE: + case ABILITY_COMMANDER: if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, i, 0, 0, 0)) return TRUE; break; @@ -8637,6 +8794,10 @@ static void RemoveAllTerrains(void) BattleScriptPushCursor(); \ gBattlescriptCurrInstr = battlescript; \ } \ + else \ + { \ + gBattlerAttacker = saveBattler; \ + } \ return TRUE; \ } \ } @@ -8651,9 +8812,9 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear) struct SideTimer *sideTimer = &gSideTimers[i]; u32 *sideStatuses = &gSideStatuses[i]; - gBattlerAttacker = i; // For correct battle string. Ally's / Foe's if (GetBattlerSide(battlerAtk) != i) { + gBattlerAttacker = i; // For correct battle string. Ally's / Foe's DEFOG_CLEAR(SIDE_STATUS_REFLECT, reflectTimer, BattleScript_SideStatusWoreOffReturn, MOVE_REFLECT); DEFOG_CLEAR(SIDE_STATUS_LIGHTSCREEN, lightscreenTimer, BattleScript_SideStatusWoreOffReturn, MOVE_LIGHT_SCREEN); DEFOG_CLEAR(SIDE_STATUS_MIST, mistTimer, BattleScript_SideStatusWoreOffReturn, MOVE_MIST); @@ -8662,6 +8823,7 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear) } if (B_DEFOG_EFFECT_CLEARING >= GEN_6) { + gBattlerAttacker = i; // For correct battle string. Ally's / Foe's DEFOG_CLEAR(SIDE_STATUS_SPIKES, spikesAmount, BattleScript_SpikesDefog, 0); DEFOG_CLEAR(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, BattleScript_StealthRockDefog, 0); DEFOG_CLEAR(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, BattleScript_ToxicSpikesDefog, 0); @@ -8922,29 +9084,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; } @@ -9872,10 +10045,7 @@ static void Cmd_various(void) case VARIOUS_HANDLE_FORM_CHANGE: { VARIOUS_ARGS(u8 case_); - if (GetBattlerSide(battler) == B_SIDE_OPPONENT) - mon = &gEnemyParty[gBattlerPartyIndexes[battler]]; - else - mon = &gPlayerParty[gBattlerPartyIndexes[battler]]; + mon = GetPartyBattlerData(battler); // Change species. if (cmd->case_ == 0) @@ -11401,7 +11571,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; @@ -11417,14 +11587,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; } @@ -12455,7 +12633,7 @@ static void Cmd_transformdataexecution(void) gBattlescriptCurrInstr = cmd->nextInstr; if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED || gBattleStruct->illusion[gBattlerTarget].on - || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) + || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE_NO_COMMANDER) { gMoveResultFlags |= MOVE_RESULT_FAILED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORM_FAILED; @@ -13245,7 +13423,8 @@ static void Cmd_trysetperishsong(void) { if (gStatuses3[i] & STATUS3_PERISH_SONG || GetBattlerAbility(i) == ABILITY_SOUNDPROOF - || BlocksPrankster(gCurrentMove, gBattlerAttacker, i, TRUE)) + || BlocksPrankster(gCurrentMove, gBattlerAttacker, i, TRUE) + || gStatuses3[i] & STATUS3_COMMANDER) { notAffectedCount++; } @@ -15655,7 +15834,7 @@ static void Cmd_callnative(void) // Callnative Funcs -static void SaveBattlerTarget(u32 battler) +void SaveBattlerTarget(u32 battler) { if (gBattleStruct->savedTargetCount < NELEMS(gBattleStruct->savedBattlerTarget)) gBattleStruct->savedBattlerTarget[gBattleStruct->savedTargetCount++] = battler; @@ -15663,7 +15842,7 @@ static void SaveBattlerTarget(u32 battler) DebugPrintfLevel(MGBA_LOG_WARN, "Attempting to exceed savedBattlerTarget array size!"); } -static void SaveBattlerAttacker(u32 battler) +void SaveBattlerAttacker(u32 battler) { if (gBattleStruct->savedAttackerCount < NELEMS(gBattleStruct->savedBattlerAttacker)) gBattleStruct->savedBattlerAttacker[gBattleStruct->savedAttackerCount++] = battler; @@ -16057,7 +16236,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; @@ -16974,7 +17153,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)) @@ -16985,20 +17164,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; } @@ -17234,3 +17411,15 @@ void BS_TryRevivalBlessing(void) MarkBattlerForControllerExec(gBattlerAttacker); } } + +void BS_JumpIfCommanderActive(void) +{ + NATIVE_ARGS(const u8 *jumpInstr); + + if (gBattleStruct->commanderActive[gBattlerTarget] != SPECIES_NONE) + gBattlescriptCurrInstr = cmd->jumpInstr; + else if (gStatuses3[gBattlerTarget] & STATUS3_COMMANDER) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} diff --git a/src/battle_tv.c b/src/battle_tv.c index 24d573d0bf..22e5ab1c31 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -338,17 +338,8 @@ void BattleTv_SetDataBasedOnString(u16 stringId) defSide = GetBattlerSide(gBattlerTarget); effSide = GetBattlerSide(gEffectBattler); scriptingSide = GetBattlerSide(gBattleMsgDataPtr->scrActive); - - if (atkSide == B_SIDE_PLAYER) - atkMon = &gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]; - else - atkMon = &gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]]; - - if (defSide == B_SIDE_PLAYER) - defMon = &gPlayerParty[gBattlerPartyIndexes[gBattlerTarget]]; - else - defMon = &gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]; - + atkMon = GetPartyBattlerData(gBattlerAttacker); + defMon = GetPartyBattlerData(gBattlerTarget); moveSlot = GetBattlerMoveSlotId(gBattlerAttacker, gBattleMsgDataPtr->currentMove); if (moveSlot >= MAX_MON_MOVES && IsNotSpecialBattleString(stringId) && stringId > BATTLESTRINGS_TABLE_START) diff --git a/src/battle_util.c b/src/battle_util.c index 035a2c981c..e32e21cf2a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -130,7 +130,9 @@ void HandleAction_UseMove(void) u16 moveTarget; gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; - if (gBattleStruct->absentBattlerFlags & (1u << gBattlerAttacker) || !IsBattlerAlive(gBattlerAttacker)) + if (gBattleStruct->absentBattlerFlags & (1u << gBattlerAttacker) + || gBattleStruct->commandingDondozo & (1u << gBattlerAttacker) + || !IsBattlerAlive(gBattlerAttacker)) { gCurrentActionFuncId = B_ACTION_FINISHED; return; @@ -3557,11 +3559,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 +3602,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) { @@ -4096,7 +4115,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 u32 moveType, move; u32 side; u32 i, j; - u32 partner; + u32 partner = 0; struct Pokemon *mon; if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) @@ -4350,13 +4369,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 +4391,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) @@ -4391,7 +4406,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !(gBattleMons[BATTLE_OPPOSITE(battler)].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE)) && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) && !(gBattleStruct->illusion[BATTLE_OPPOSITE(battler)].on) - && !(gStatuses3[BATTLE_OPPOSITE(battler)] & STATUS3_SEMI_INVULNERABLE)) + && !(gStatuses3[BATTLE_OPPOSITE(battler)] & STATUS3_SEMI_INVULNERABLE_NO_COMMANDER)) { gBattlerAttacker = battler; gBattlerTarget = BATTLE_OPPOSITE(battler); @@ -4894,7 +4909,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !(gBattleStruct->transformZeroToHero[side] & (1u << gBattlerPartyIndexes[battler]))) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; - gBattlerAttacker = battler; gBattleStruct->transformZeroToHero[side] |= 1u << gBattlerPartyIndexes[battler]; BattleScriptPushCursorAndCallback(BattleScript_ZeroToHeroActivates); effect++; @@ -4967,6 +4981,28 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 effect++; } break; + case ABILITY_COMMANDER: + partner = BATTLE_PARTNER(battler); + if (!gSpecialStatuses[battler].switchInAbilityDone + && gBattleStruct->commanderActive[partner] == SPECIES_NONE + && gBattleMons[partner].species == SPECIES_DONDOZO + && GET_BASE_SPECIES_ID(GetMonData(GetPartyBattlerData(battler), MON_DATA_SPECIES)) == SPECIES_TATSUGIRI) + { + SaveBattlerAttacker(gBattlerAttacker); + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + gBattlerAttacker = partner; + gBattleStruct->commandingDondozo |= 1u << battler; + gBattleStruct->commanderActive[partner] = gBattleMons[battler].species; + gStatuses3[battler] |= STATUS3_COMMANDER; + if (gBattleMons[battler].status2 & STATUS2_CONFUSION + && !(gStatuses4[battler] & STATUS4_INFINITE_CONFUSION)) + gBattleMons[battler].status2 -= STATUS2_CONFUSION_TURN(1); + BtlController_EmitSpriteInvisibility(battler, BUFFER_A, TRUE); + MarkBattlerForControllerExec(battler); + BattleScriptPushCursorAndCallback(BattleScript_CommanderActivates); + effect++; + } + break; } break; case ABILITYEFFECT_ENDTURN: @@ -5196,7 +5232,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; @@ -5936,7 +5971,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && HadMoreThanHalfHpNowDoesnt(gBattlerTarget) && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))) { - gBattlerAttacker = gBattlerTarget; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_AngerShellActivates; effect++; @@ -6057,7 +6091,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 @@ -6371,14 +6404,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; } @@ -6509,7 +6542,9 @@ u32 IsAbilityPreventingEscape(u32 battler) bool32 CanBattlerEscape(u32 battler) // no ability check { - if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_SHED_SHELL) + if (gBattleStruct->commanderActive[battler] != SPECIES_NONE) + return FALSE; + else if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_SHED_SHELL) return TRUE; else if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) return TRUE; @@ -6808,8 +6843,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); @@ -8542,13 +8576,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)) @@ -8689,7 +8719,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)) @@ -9437,6 +9467,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. @@ -11786,18 +11820,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/berry_tag_screen.c b/src/berry_tag_screen.c index c6eb731845..fcd322ce33 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -143,11 +143,12 @@ static const struct WindowTemplate sWindowTemplates[] = static const u8 *const sBerryFirmnessStrings[] = { - gBerryFirmnessString_VerySoft, - gBerryFirmnessString_Soft, - gBerryFirmnessString_Hard, - gBerryFirmnessString_VeryHard, - gBerryFirmnessString_SuperHard + [BERRY_FIRMNESS_UNKNOWN] = COMPOUND_STRING("???"), + [BERRY_FIRMNESS_VERY_SOFT] = COMPOUND_STRING("Very soft"), + [BERRY_FIRMNESS_SOFT] = COMPOUND_STRING("Soft"), + [BERRY_FIRMNESS_HARD] = COMPOUND_STRING("Hard"), + [BERRY_FIRMNESS_VERY_HARD] = COMPOUND_STRING("Very hard"), + [BERRY_FIRMNESS_SUPER_HARD] = COMPOUND_STRING("Super hard") }; // this file's functions @@ -172,6 +173,13 @@ static void Task_DisplayAnotherBerry(u8 taskId); static void TryChangeDisplayedBerry(u8 taskId, s8 toMove); static void HandleBagCursorPositionChange(s8 toMove); +static const u8 sText_SizeSlash[] = _("SIZE /"); +static const u8 sText_FirmSlash[] = _("FIRM /"); +static const u8 sText_Var1DotVar2[] = _("{STR_VAR_1}.{STR_VAR_2}”"); +static const u8 sText_NumberVar1Var2[] = _("{NO}{STR_VAR_1} {STR_VAR_2}"); +static const u8 sText_BerryTag[] = _("BERRY TAG"); +static const u8 sText_ThreeMarks[] = _("???"); + // code void DoBerryTagScreen(void) { @@ -386,7 +394,7 @@ static void AddBerryTagTextToBg0(void) { memcpy(GetBgTilemapBuffer(0), sBerryTag->tilemapBuffers[2], sizeof(sBerryTag->tilemapBuffers[2])); FillWindowPixelBuffer(WIN_BERRY_TAG, PIXEL_FILL(15)); - PrintTextInBerryTagScreen(WIN_BERRY_TAG, gText_BerryTag, GetStringCenterAlignXOffset(FONT_NORMAL, gText_BerryTag, 0x40), 1, 0, 1); + PrintTextInBerryTagScreen(WIN_BERRY_TAG, sText_BerryTag, GetStringCenterAlignXOffset(FONT_NORMAL, sText_BerryTag, 0x40), 1, 0, 1); PutWindowTilemap(WIN_BERRY_TAG); ScheduleBgCopyTilemapToVram(0); } @@ -405,14 +413,14 @@ static void PrintBerryNumberAndName(void) const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); ConvertIntToDecimalStringN(gStringVar1, sBerryTag->berryId, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopy(gStringVar2, berry->name); - StringExpandPlaceholders(gStringVar4, gText_NumberVar1Var2); + StringExpandPlaceholders(gStringVar4, sText_NumberVar1Var2); PrintTextInBerryTagScreen(WIN_BERRY_NAME, gStringVar4, 0, 1, 0, 0); } static void PrintBerrySize(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_SizeSlash, 0, 1, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_SizeSlash, 0, 1, TEXT_SKIP_DRAW, NULL); if (berry->size != 0) { u32 inches, fraction; @@ -425,23 +433,23 @@ static void PrintBerrySize(void) ConvertIntToDecimalStringN(gStringVar1, inches, STR_CONV_MODE_LEFT_ALIGN, 2); ConvertIntToDecimalStringN(gStringVar2, fraction, STR_CONV_MODE_LEFT_ALIGN, 2); - StringExpandPlaceholders(gStringVar4, gText_Var1DotVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1DotVar2); AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gStringVar4, 0x28, 1, 0, NULL); } else { - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_ThreeMarks, 0x28, 1, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_ThreeMarks, 0x28, 1, 0, NULL); } } static void PrintBerryFirmness(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_FirmSlash, 0, 0x11, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_FirmSlash, 0, 0x11, TEXT_SKIP_DRAW, NULL); if (berry->firmness != 0) - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sBerryFirmnessStrings[berry->firmness - 1], 0x28, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sBerryFirmnessStrings[berry->firmness], 0x28, 0x11, 0, NULL); else - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_ThreeMarks, 0x28, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_ThreeMarks, 0x28, 0x11, 0, NULL); } static void PrintBerryDescription1(void) diff --git a/src/bike.c b/src/bike.c index de150dae4b..427dfdfcf2 100644 --- a/src/bike.c +++ b/src/bike.c @@ -142,6 +142,19 @@ static u8 GetMachBikeTransition(u8 *dirTraveling) { // if the dir updated before this function, get the relevent new direction to check later. u8 direction = GetPlayerMovementDirection(); + + // fix direction when moving on sideways stairs + switch (direction) + { + case DIR_SOUTHWEST: + case DIR_NORTHWEST: + direction = DIR_WEST; + break; + case DIR_SOUTHEAST: + case DIR_NORTHEAST: + direction = DIR_EAST; + break; + } // is the player standing still? if (*dirTraveling == 0) @@ -234,6 +247,9 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) else { // we did not hit anything that can slow us down, so perform the advancement callback depending on the bikeFrameCounter and try to increase the mach bike's speed. + if (ObjectMovingOnRockStairs(playerObjEvent, direction) && gPlayerAvatar.bikeFrameCounter > 1) + gPlayerAvatar.bikeFrameCounter--; + sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); gPlayerAvatar.bikeSpeed = gPlayerAvatar.bikeFrameCounter + (gPlayerAvatar.bikeFrameCounter >> 1); // same as dividing by 2, but compiler is insistent on >> 1 if (gPlayerAvatar.bikeFrameCounter < 2) // do not go faster than the last element in the mach bike array @@ -368,6 +384,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 struct ObjectEvent *playerObjEvent; direction = GetPlayerMovementDirection(); + playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; gPlayerAvatar.runningState = NOT_MOVING; @@ -563,7 +580,10 @@ static void AcroBikeTransition_Moving(u8 direction) } else { - PlayerRideWaterCurrent(direction); + if (ObjectMovingOnRockStairs(playerObjEvent, direction)) + PlayerWalkFast(direction); + else + PlayerRideWaterCurrent(direction); } } @@ -696,6 +716,7 @@ static void AcroBikeTransition_WheelieMoving(u8 direction) } return; } + PlayerWheelieMove(direction); gPlayerAvatar.runningState = MOVING; } @@ -730,6 +751,7 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction) } return; } + PlayerPopWheelieWhileMoving(direction); gPlayerAvatar.runningState = MOVING; } @@ -753,6 +775,7 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction) PlayerEndWheelie(direction); return; } + PlayerEndWheelieWhileMoving(direction); } 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/abilities.h b/src/data/abilities.h index 7c67f2da17..30a34ffe90 100644 --- a/src/data/abilities.h +++ b/src/data/abilities.h @@ -2141,6 +2141,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] = .cantBeSwapped = TRUE, .cantBeTraced = TRUE, .cantBeSuppressed = TRUE, + .cantBeOverwritten = TRUE, }, [ABILITY_ELECTROMORPHOSIS] = diff --git a/src/data/battle_move_effects.h b/src/data/battle_move_effects.h index ead7cee6f1..776563bbec 100644 --- a/src/data/battle_move_effects.h +++ b/src/data/battle_move_effects.h @@ -2255,4 +2255,10 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = .battleScript = BattleScript_EffectHit, .battleTvScore = 0, // TODO: Assign points }, + + [EFFECT_ORDER_UP] = + { + .battleScript = BattleScript_EffectHit, + .battleTvScore = 0, // TODO: Assign points + }, }; 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/graphics/trainers.h b/src/data/graphics/trainers.h index 2a7baf1bc8..613e5fcb14 100644 --- a/src/data/graphics/trainers.h +++ b/src/data/graphics/trainers.h @@ -297,110 +297,110 @@ const u32 gTrainerBackPicPalette_Leaf[] = INCBIN_U32("graphics/trainers/back_pic // gTrainerFrontPic/gTrainerPalette pointers, (e.g "gTrainerFrontPic_Hiker" and "gTrainerPalette_Hiker"). // The last three parameters control the X and Y coordinates and rotation of the mugshot on the screen. // They default to 0, 0, and 0x200 which are default values used by the majority of the game's trainer sprites. -#define TRAINER_SPRITE(trainerPic, file, ...) \ - [TRAINER_PIC_##trainerPic] = \ - { \ - .frontPic = {gTrainerFrontPic_##file, TRAINER_PIC_SIZE, TRAINER_PIC_##trainerPic},\ - .palette = {gTrainerPalette_##file, TRAINER_PIC_##trainerPic}, \ - .mugshotCoords = {DEFAULT(0, __VA_ARGS__), DEFAULT_2(0, __VA_ARGS__)}, \ - .mugshotRotation = DEFAULT_3(0x200, __VA_ARGS__), \ +#define TRAINER_SPRITE(trainerPic, picFile, paletteFile, ...) \ + [trainerPic] = \ + { \ + .frontPic = {picFile, TRAINER_PIC_SIZE, trainerPic}, \ + .palette = {paletteFile, trainerPic}, \ + .mugshotCoords = {DEFAULT(0, __VA_ARGS__), DEFAULT_2(0, __VA_ARGS__)}, \ + .mugshotRotation = DEFAULT_3(0x200, __VA_ARGS__), \ } const struct TrainerSprite gTrainerSprites[] = { - TRAINER_SPRITE(HIKER, Hiker), - TRAINER_SPRITE(AQUA_GRUNT_M, AquaGruntM), - TRAINER_SPRITE(POKEMON_BREEDER_F, PokemonBreederF), - TRAINER_SPRITE(COOLTRAINER_M, CoolTrainerM), - TRAINER_SPRITE(BIRD_KEEPER, BirdKeeper), - TRAINER_SPRITE(COLLECTOR, Collector), - TRAINER_SPRITE(AQUA_GRUNT_F, AquaGruntF), - TRAINER_SPRITE(SWIMMER_M, SwimmerM), - TRAINER_SPRITE(MAGMA_GRUNT_M, MagmaGruntM), - TRAINER_SPRITE(EXPERT_M, ExpertM), - TRAINER_SPRITE(AQUA_ADMIN_M, AquaAdminM), - TRAINER_SPRITE(BLACK_BELT, BlackBelt), - TRAINER_SPRITE(AQUA_ADMIN_F, AquaAdminF), - TRAINER_SPRITE(AQUA_LEADER_ARCHIE, AquaLeaderArchie), - TRAINER_SPRITE(HEX_MANIAC, HexManiac), - TRAINER_SPRITE(AROMA_LADY, AromaLady), - TRAINER_SPRITE(RUIN_MANIAC, RuinManiac), - TRAINER_SPRITE(INTERVIEWER, Interviewer), - TRAINER_SPRITE(TUBER_F, TuberF), - TRAINER_SPRITE(TUBER_M, TuberM), - TRAINER_SPRITE(COOLTRAINER_F, CoolTrainerF), - TRAINER_SPRITE(LADY, Lady), - TRAINER_SPRITE(BEAUTY, Beauty), - TRAINER_SPRITE(RICH_BOY, RichBoy), - TRAINER_SPRITE(EXPERT_F, ExpertF), - TRAINER_SPRITE(POKEMANIAC, Pokemaniac), - TRAINER_SPRITE(MAGMA_GRUNT_F, MagmaGruntF), - TRAINER_SPRITE(GUITARIST, Guitarist), - TRAINER_SPRITE(KINDLER, Kindler), - TRAINER_SPRITE(CAMPER, Camper), - TRAINER_SPRITE(PICNICKER, Picnicker), - TRAINER_SPRITE(BUG_MANIAC, BugManiac), - TRAINER_SPRITE(POKEMON_BREEDER_M, PokemonBreederM), - TRAINER_SPRITE(PSYCHIC_M, PsychicM), - TRAINER_SPRITE(PSYCHIC_F, PsychicF), - TRAINER_SPRITE(GENTLEMAN, Gentleman), - TRAINER_SPRITE(ELITE_FOUR_SIDNEY, EliteFourSidney), - TRAINER_SPRITE(ELITE_FOUR_PHOEBE, EliteFourPhoebe), - TRAINER_SPRITE(ELITE_FOUR_GLACIA, EliteFourGlacia, -4, 4, 0x1B0), - TRAINER_SPRITE(ELITE_FOUR_DRAKE, EliteFourDrake, 0, 5, 0x1A0), - TRAINER_SPRITE(LEADER_ROXANNE, LeaderRoxanne), - TRAINER_SPRITE(LEADER_BRAWLY, LeaderBrawly), - TRAINER_SPRITE(LEADER_WATTSON, LeaderWattson), - TRAINER_SPRITE(LEADER_FLANNERY, LeaderFlannery), - TRAINER_SPRITE(LEADER_NORMAN, LeaderNorman), - TRAINER_SPRITE(LEADER_WINONA, LeaderWinona), - TRAINER_SPRITE(LEADER_TATE_AND_LIZA, LeaderTateAndLiza), - TRAINER_SPRITE(LEADER_JUAN, LeaderJuan), - TRAINER_SPRITE(SCHOOL_KID_M, SchoolKidM), - TRAINER_SPRITE(SCHOOL_KID_F, SchoolKidF), - TRAINER_SPRITE(SR_AND_JR, SrAndJr), - TRAINER_SPRITE(POKEFAN_M, PokefanM), - TRAINER_SPRITE(POKEFAN_F, PokefanF), - TRAINER_SPRITE(YOUNGSTER, Youngster), - TRAINER_SPRITE(CHAMPION_WALLACE, ChampionWallace, -8, 7, 0x188), - TRAINER_SPRITE(FISHERMAN, Fisherman), - TRAINER_SPRITE(CYCLING_TRIATHLETE_M, CyclingTriathleteM), - TRAINER_SPRITE(CYCLING_TRIATHLETE_F, CyclingTriathleteF), - TRAINER_SPRITE(RUNNING_TRIATHLETE_M, RunningTriathleteM), - TRAINER_SPRITE(RUNNING_TRIATHLETE_F, RunningTriathleteF), - TRAINER_SPRITE(SWIMMING_TRIATHLETE_M, SwimmingTriathleteM), - TRAINER_SPRITE(SWIMMING_TRIATHLETE_F, SwimmingTriathleteF), - TRAINER_SPRITE(DRAGON_TAMER, DragonTamer), - TRAINER_SPRITE(NINJA_BOY, NinjaBoy), - TRAINER_SPRITE(BATTLE_GIRL, BattleGirl), - TRAINER_SPRITE(PARASOL_LADY, ParasolLady), - TRAINER_SPRITE(SWIMMER_F, SwimmerF), - TRAINER_SPRITE(TWINS, Twins), - TRAINER_SPRITE(SAILOR, Sailor), - TRAINER_SPRITE(MAGMA_ADMIN, MagmaAdmin), - TRAINER_SPRITE(WALLY, Wally), - TRAINER_SPRITE(BRENDAN, Brendan), - TRAINER_SPRITE(MAY, May), - TRAINER_SPRITE(BUG_CATCHER, BugCatcher), - TRAINER_SPRITE(POKEMON_RANGER_M, PokemonRangerM), - TRAINER_SPRITE(POKEMON_RANGER_F, PokemonRangerF), - TRAINER_SPRITE(MAGMA_LEADER_MAXIE, MagmaLeaderMaxie), - TRAINER_SPRITE(LASS, Lass), - TRAINER_SPRITE(YOUNG_COUPLE, YoungCouple), - TRAINER_SPRITE(OLD_COUPLE, OldCouple), - TRAINER_SPRITE(SIS_AND_BRO, SisAndBro), - TRAINER_SPRITE(STEVEN, Steven, 0, 7, 0x188), - TRAINER_SPRITE(SALON_MAIDEN_ANABEL, SalonMaidenAnabel), - TRAINER_SPRITE(DOME_ACE_TUCKER, DomeAceTucker), - TRAINER_SPRITE(PALACE_MAVEN_SPENSER, PalaceMavenSpenser), - TRAINER_SPRITE(ARENA_TYCOON_GRETA, ArenaTycoonGreta), - TRAINER_SPRITE(FACTORY_HEAD_NOLAND, FactoryHeadNoland), - TRAINER_SPRITE(PIKE_QUEEN_LUCY, PikeQueenLucy), - TRAINER_SPRITE(PYRAMID_KING_BRANDON, PyramidKingBrandon), - TRAINER_SPRITE(RED, Red), - TRAINER_SPRITE(LEAF, Leaf), - TRAINER_SPRITE(RS_BRENDAN, RubySapphireBrendan), - TRAINER_SPRITE(RS_MAY, RubySapphireMay), + TRAINER_SPRITE(TRAINER_PIC_HIKER, gTrainerFrontPic_Hiker, gTrainerPalette_Hiker), + TRAINER_SPRITE(TRAINER_PIC_AQUA_GRUNT_M, gTrainerFrontPic_AquaGruntM, gTrainerPalette_AquaGruntM), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_BREEDER_F, gTrainerFrontPic_PokemonBreederF, gTrainerPalette_PokemonBreederF), + TRAINER_SPRITE(TRAINER_PIC_COOLTRAINER_M, gTrainerFrontPic_CoolTrainerM, gTrainerPalette_CoolTrainerM), + TRAINER_SPRITE(TRAINER_PIC_BIRD_KEEPER, gTrainerFrontPic_BirdKeeper, gTrainerPalette_BirdKeeper), + TRAINER_SPRITE(TRAINER_PIC_COLLECTOR, gTrainerFrontPic_Collector, gTrainerPalette_Collector), + TRAINER_SPRITE(TRAINER_PIC_AQUA_GRUNT_F, gTrainerFrontPic_AquaGruntF, gTrainerPalette_AquaGruntF), + TRAINER_SPRITE(TRAINER_PIC_SWIMMER_M, gTrainerFrontPic_SwimmerM, gTrainerPalette_SwimmerM), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_GRUNT_M, gTrainerFrontPic_MagmaGruntM, gTrainerPalette_MagmaGruntM), + TRAINER_SPRITE(TRAINER_PIC_EXPERT_M, gTrainerFrontPic_ExpertM, gTrainerPalette_ExpertM), + TRAINER_SPRITE(TRAINER_PIC_AQUA_ADMIN_M, gTrainerFrontPic_AquaAdminM, gTrainerPalette_AquaAdminM), + TRAINER_SPRITE(TRAINER_PIC_BLACK_BELT, gTrainerFrontPic_BlackBelt, gTrainerPalette_BlackBelt), + TRAINER_SPRITE(TRAINER_PIC_AQUA_ADMIN_F, gTrainerFrontPic_AquaAdminF, gTrainerPalette_AquaAdminF), + TRAINER_SPRITE(TRAINER_PIC_AQUA_LEADER_ARCHIE, gTrainerFrontPic_AquaLeaderArchie, gTrainerPalette_AquaLeaderArchie), + TRAINER_SPRITE(TRAINER_PIC_HEX_MANIAC, gTrainerFrontPic_HexManiac, gTrainerPalette_HexManiac), + TRAINER_SPRITE(TRAINER_PIC_AROMA_LADY, gTrainerFrontPic_AromaLady, gTrainerPalette_AromaLady), + TRAINER_SPRITE(TRAINER_PIC_RUIN_MANIAC, gTrainerFrontPic_RuinManiac, gTrainerPalette_RuinManiac), + TRAINER_SPRITE(TRAINER_PIC_INTERVIEWER, gTrainerFrontPic_Interviewer, gTrainerPalette_Interviewer), + TRAINER_SPRITE(TRAINER_PIC_TUBER_F, gTrainerFrontPic_TuberF, gTrainerPalette_TuberF), + TRAINER_SPRITE(TRAINER_PIC_TUBER_M, gTrainerFrontPic_TuberM, gTrainerPalette_TuberM), + TRAINER_SPRITE(TRAINER_PIC_COOLTRAINER_F, gTrainerFrontPic_CoolTrainerF, gTrainerPalette_CoolTrainerF), + TRAINER_SPRITE(TRAINER_PIC_LADY, gTrainerFrontPic_Lady, gTrainerPalette_Lady), + TRAINER_SPRITE(TRAINER_PIC_BEAUTY, gTrainerFrontPic_Beauty, gTrainerPalette_Beauty), + TRAINER_SPRITE(TRAINER_PIC_RICH_BOY, gTrainerFrontPic_RichBoy, gTrainerPalette_RichBoy), + TRAINER_SPRITE(TRAINER_PIC_EXPERT_F, gTrainerFrontPic_ExpertF, gTrainerPalette_ExpertF), + TRAINER_SPRITE(TRAINER_PIC_POKEMANIAC, gTrainerFrontPic_Pokemaniac, gTrainerPalette_Pokemaniac), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_GRUNT_F, gTrainerFrontPic_MagmaGruntF, gTrainerPalette_MagmaGruntF), + TRAINER_SPRITE(TRAINER_PIC_GUITARIST, gTrainerFrontPic_Guitarist, gTrainerPalette_Guitarist), + TRAINER_SPRITE(TRAINER_PIC_KINDLER, gTrainerFrontPic_Kindler, gTrainerPalette_Kindler), + TRAINER_SPRITE(TRAINER_PIC_CAMPER, gTrainerFrontPic_Camper, gTrainerPalette_Camper), + TRAINER_SPRITE(TRAINER_PIC_PICNICKER, gTrainerFrontPic_Picnicker, gTrainerPalette_Picnicker), + TRAINER_SPRITE(TRAINER_PIC_BUG_MANIAC, gTrainerFrontPic_BugManiac, gTrainerPalette_BugManiac), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_BREEDER_M, gTrainerFrontPic_PokemonBreederM, gTrainerPalette_PokemonBreederM), + TRAINER_SPRITE(TRAINER_PIC_PSYCHIC_M, gTrainerFrontPic_PsychicM, gTrainerPalette_PsychicM), + TRAINER_SPRITE(TRAINER_PIC_PSYCHIC_F, gTrainerFrontPic_PsychicF, gTrainerPalette_PsychicF), + TRAINER_SPRITE(TRAINER_PIC_GENTLEMAN, gTrainerFrontPic_Gentleman, gTrainerPalette_Gentleman), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_SIDNEY, gTrainerFrontPic_EliteFourSidney, gTrainerPalette_EliteFourSidney), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_PHOEBE, gTrainerFrontPic_EliteFourPhoebe, gTrainerPalette_EliteFourPhoebe), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_GLACIA, gTrainerFrontPic_EliteFourGlacia, gTrainerPalette_EliteFourGlacia, -4, 4, 0x1B0), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_DRAKE, gTrainerFrontPic_EliteFourDrake, gTrainerPalette_EliteFourDrake, 0, 5, 0x1A0), + TRAINER_SPRITE(TRAINER_PIC_LEADER_ROXANNE, gTrainerFrontPic_LeaderRoxanne, gTrainerPalette_LeaderRoxanne), + TRAINER_SPRITE(TRAINER_PIC_LEADER_BRAWLY, gTrainerFrontPic_LeaderBrawly, gTrainerPalette_LeaderBrawly), + TRAINER_SPRITE(TRAINER_PIC_LEADER_WATTSON, gTrainerFrontPic_LeaderWattson, gTrainerPalette_LeaderWattson), + TRAINER_SPRITE(TRAINER_PIC_LEADER_FLANNERY, gTrainerFrontPic_LeaderFlannery, gTrainerPalette_LeaderFlannery), + TRAINER_SPRITE(TRAINER_PIC_LEADER_NORMAN, gTrainerFrontPic_LeaderNorman, gTrainerPalette_LeaderNorman), + TRAINER_SPRITE(TRAINER_PIC_LEADER_WINONA, gTrainerFrontPic_LeaderWinona, gTrainerPalette_LeaderWinona), + TRAINER_SPRITE(TRAINER_PIC_LEADER_TATE_AND_LIZA, gTrainerFrontPic_LeaderTateAndLiza, gTrainerPalette_LeaderTateAndLiza), + TRAINER_SPRITE(TRAINER_PIC_LEADER_JUAN, gTrainerFrontPic_LeaderJuan, gTrainerPalette_LeaderJuan), + TRAINER_SPRITE(TRAINER_PIC_SCHOOL_KID_M, gTrainerFrontPic_SchoolKidM, gTrainerPalette_SchoolKidM), + TRAINER_SPRITE(TRAINER_PIC_SCHOOL_KID_F, gTrainerFrontPic_SchoolKidF, gTrainerPalette_SchoolKidF), + TRAINER_SPRITE(TRAINER_PIC_SR_AND_JR, gTrainerFrontPic_SrAndJr, gTrainerPalette_SrAndJr), + TRAINER_SPRITE(TRAINER_PIC_POKEFAN_M, gTrainerFrontPic_PokefanM, gTrainerPalette_PokefanM), + TRAINER_SPRITE(TRAINER_PIC_POKEFAN_F, gTrainerFrontPic_PokefanF, gTrainerPalette_PokefanF), + TRAINER_SPRITE(TRAINER_PIC_YOUNGSTER, gTrainerFrontPic_Youngster, gTrainerPalette_Youngster), + TRAINER_SPRITE(TRAINER_PIC_CHAMPION_WALLACE, gTrainerFrontPic_ChampionWallace, gTrainerPalette_ChampionWallace, -8, 7, 0x188), + TRAINER_SPRITE(TRAINER_PIC_FISHERMAN, gTrainerFrontPic_Fisherman, gTrainerPalette_Fisherman), + TRAINER_SPRITE(TRAINER_PIC_CYCLING_TRIATHLETE_M, gTrainerFrontPic_CyclingTriathleteM, gTrainerPalette_CyclingTriathleteM), + TRAINER_SPRITE(TRAINER_PIC_CYCLING_TRIATHLETE_F, gTrainerFrontPic_CyclingTriathleteF, gTrainerPalette_CyclingTriathleteF), + TRAINER_SPRITE(TRAINER_PIC_RUNNING_TRIATHLETE_M, gTrainerFrontPic_RunningTriathleteM, gTrainerPalette_RunningTriathleteM), + TRAINER_SPRITE(TRAINER_PIC_RUNNING_TRIATHLETE_F, gTrainerFrontPic_RunningTriathleteF, gTrainerPalette_RunningTriathleteF), + TRAINER_SPRITE(TRAINER_PIC_SWIMMING_TRIATHLETE_M, gTrainerFrontPic_SwimmingTriathleteM, gTrainerPalette_SwimmingTriathleteM), + TRAINER_SPRITE(TRAINER_PIC_SWIMMING_TRIATHLETE_F, gTrainerFrontPic_SwimmingTriathleteF, gTrainerPalette_SwimmingTriathleteF), + TRAINER_SPRITE(TRAINER_PIC_DRAGON_TAMER, gTrainerFrontPic_DragonTamer, gTrainerPalette_DragonTamer), + TRAINER_SPRITE(TRAINER_PIC_NINJA_BOY, gTrainerFrontPic_NinjaBoy, gTrainerPalette_NinjaBoy), + TRAINER_SPRITE(TRAINER_PIC_BATTLE_GIRL, gTrainerFrontPic_BattleGirl, gTrainerPalette_BattleGirl), + TRAINER_SPRITE(TRAINER_PIC_PARASOL_LADY, gTrainerFrontPic_ParasolLady, gTrainerPalette_ParasolLady), + TRAINER_SPRITE(TRAINER_PIC_SWIMMER_F, gTrainerFrontPic_SwimmerF, gTrainerPalette_SwimmerF), + TRAINER_SPRITE(TRAINER_PIC_TWINS, gTrainerFrontPic_Twins, gTrainerPalette_Twins), + TRAINER_SPRITE(TRAINER_PIC_SAILOR, gTrainerFrontPic_Sailor, gTrainerPalette_Sailor), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_ADMIN, gTrainerFrontPic_MagmaAdmin, gTrainerPalette_MagmaAdmin), + TRAINER_SPRITE(TRAINER_PIC_WALLY, gTrainerFrontPic_Wally, gTrainerPalette_Wally), + TRAINER_SPRITE(TRAINER_PIC_BRENDAN, gTrainerFrontPic_Brendan, gTrainerPalette_Brendan), + TRAINER_SPRITE(TRAINER_PIC_MAY, gTrainerFrontPic_May, gTrainerPalette_May), + TRAINER_SPRITE(TRAINER_PIC_BUG_CATCHER, gTrainerFrontPic_BugCatcher, gTrainerPalette_BugCatcher), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_RANGER_M, gTrainerFrontPic_PokemonRangerM, gTrainerPalette_PokemonRangerM), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_RANGER_F, gTrainerFrontPic_PokemonRangerF, gTrainerPalette_PokemonRangerF), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_LEADER_MAXIE, gTrainerFrontPic_MagmaLeaderMaxie, gTrainerPalette_MagmaLeaderMaxie), + TRAINER_SPRITE(TRAINER_PIC_LASS, gTrainerFrontPic_Lass, gTrainerPalette_Lass), + TRAINER_SPRITE(TRAINER_PIC_YOUNG_COUPLE, gTrainerFrontPic_YoungCouple, gTrainerPalette_YoungCouple), + TRAINER_SPRITE(TRAINER_PIC_OLD_COUPLE, gTrainerFrontPic_OldCouple, gTrainerPalette_OldCouple), + TRAINER_SPRITE(TRAINER_PIC_SIS_AND_BRO, gTrainerFrontPic_SisAndBro, gTrainerPalette_SisAndBro), + TRAINER_SPRITE(TRAINER_PIC_STEVEN, gTrainerFrontPic_Steven, gTrainerPalette_Steven, 0, 7, 0x188), + TRAINER_SPRITE(TRAINER_PIC_SALON_MAIDEN_ANABEL, gTrainerFrontPic_SalonMaidenAnabel, gTrainerPalette_SalonMaidenAnabel), + TRAINER_SPRITE(TRAINER_PIC_DOME_ACE_TUCKER, gTrainerFrontPic_DomeAceTucker, gTrainerPalette_DomeAceTucker), + TRAINER_SPRITE(TRAINER_PIC_PALACE_MAVEN_SPENSER, gTrainerFrontPic_PalaceMavenSpenser, gTrainerPalette_PalaceMavenSpenser), + TRAINER_SPRITE(TRAINER_PIC_ARENA_TYCOON_GRETA, gTrainerFrontPic_ArenaTycoonGreta, gTrainerPalette_ArenaTycoonGreta), + TRAINER_SPRITE(TRAINER_PIC_FACTORY_HEAD_NOLAND, gTrainerFrontPic_FactoryHeadNoland, gTrainerPalette_FactoryHeadNoland), + TRAINER_SPRITE(TRAINER_PIC_PIKE_QUEEN_LUCY, gTrainerFrontPic_PikeQueenLucy, gTrainerPalette_PikeQueenLucy), + TRAINER_SPRITE(TRAINER_PIC_PYRAMID_KING_BRANDON, gTrainerFrontPic_PyramidKingBrandon, gTrainerPalette_PyramidKingBrandon), + TRAINER_SPRITE(TRAINER_PIC_RED, gTrainerFrontPic_Red, gTrainerPalette_Red), + TRAINER_SPRITE(TRAINER_PIC_LEAF, gTrainerFrontPic_Leaf, gTrainerPalette_Leaf), + TRAINER_SPRITE(TRAINER_PIC_RS_BRENDAN, gTrainerFrontPic_RubySapphireBrendan, gTrainerPalette_RubySapphireBrendan), + TRAINER_SPRITE(TRAINER_PIC_RS_MAY, gTrainerFrontPic_RubySapphireMay, gTrainerPalette_RubySapphireMay), }; static const union AnimCmd sAnimCmd_Hoenn[] = @@ -526,23 +526,23 @@ const struct SpriteFrameImage gTrainerBackPicTable_Steven[] = // .backPic goes functionally unused, since none of these pics are compressed // and the place they would get extracted to gets overwritten later anyway // the casts are so they'll play nice with the strict struct definition -#define TRAINER_BACK_SPRITE(trainerPic, yOffset, sprite, pal, anim) \ - [TRAINER_BACK_PIC_##trainerPic] = \ - { \ - .coordinates = {.size = 8, .y_offset = yOffset}, \ - .backPic = {(const u32 *)gTrainerBackPic_##sprite, TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_##sprite), TRAINER_BACK_PIC_##trainerPic}, \ - .palette = {gTrainer##pal, TRAINER_BACK_PIC_##trainerPic}, \ - .animation = sBackAnims_##anim, \ +#define TRAINER_BACK_SPRITE(trainerPic, yOffset, sprite, table, pal, anim) \ + [trainerPic] = \ + { \ + .coordinates = {.size = 8, .y_offset = yOffset}, \ + .backPic = {(const u32 *)sprite, TRAINER_PIC_SIZE * ARRAY_COUNT(table), trainerPic}, \ + .palette = {pal, trainerPic}, \ + .animation = anim, \ } const struct TrainerBacksprite gTrainerBacksprites[] = { - TRAINER_BACK_SPRITE(BRENDAN, 4, Brendan, Palette_Brendan, Hoenn), - TRAINER_BACK_SPRITE(MAY, 4, May, Palette_May, Hoenn), - TRAINER_BACK_SPRITE(RED, 5, Red, BackPicPalette_Red, Kanto), - TRAINER_BACK_SPRITE(LEAF, 5, Leaf, BackPicPalette_Leaf, Kanto), - TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_BRENDAN, 4, RubySapphireBrendan, Palette_RubySapphireBrendan, Hoenn), - TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_MAY, 4, RubySapphireMay, Palette_RubySapphireMay, Hoenn), - TRAINER_BACK_SPRITE(WALLY, 4, Wally, Palette_Wally, Hoenn), - TRAINER_BACK_SPRITE(STEVEN, 4, Steven, Palette_Steven, Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_BRENDAN, 4, gTrainerBackPic_Brendan, gTrainerBackPicTable_Brendan, gTrainerPalette_Brendan, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_MAY, 4, gTrainerBackPic_May, gTrainerBackPicTable_May, gTrainerPalette_May, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_RED, 5, gTrainerBackPic_Red, gTrainerBackPicTable_Red, gTrainerBackPicPalette_Red, sBackAnims_Kanto), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_LEAF, 5, gTrainerBackPic_Leaf, gTrainerBackPicTable_Leaf, gTrainerBackPicPalette_Leaf, sBackAnims_Kanto), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN, 4, gTrainerBackPic_RubySapphireBrendan, gTrainerBackPicTable_RubySapphireBrendan, gTrainerPalette_RubySapphireBrendan, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY, 4, gTrainerBackPic_RubySapphireMay, gTrainerBackPicTable_RubySapphireMay, gTrainerPalette_RubySapphireMay, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_WALLY, 4, gTrainerBackPic_Wally, gTrainerBackPicTable_Wally, gTrainerPalette_Wally, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_STEVEN, 4, gTrainerBackPic_Steven, gTrainerBackPicTable_Steven, gTrainerPalette_Steven, sBackAnims_Hoenn), }; 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..0d754f479d 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, @@ -19320,7 +19325,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Boosts a user's stats\n" "depending on Tatsugiri."), - .effect = EFFECT_PLACEHOLDER, // EFFECT_ORDER_UP + .effect = EFFECT_ORDER_UP, .power = 80, .type = TYPE_DRAGON, .accuracy = 100, @@ -19330,6 +19335,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .category = DAMAGE_CATEGORY_PHYSICAL, .mirrorMoveBanned = TRUE, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ORDER_UP, + .self = TRUE, + .chance = 100, + }), .battleAnimScript = gBattleAnimMove_OrderUp, }, diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index a605b3f0b2..dda5ff3991 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -266,6 +266,11 @@ u8 MovementAction_FlyUp_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_Fly_Finish(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FlyDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FlyDown_Step1(struct ObjectEvent *, struct Sprite *); +u8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite); u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FaceUp[])(struct ObjectEvent *, struct Sprite *); @@ -429,6 +434,10 @@ u8 (*const gMovementActionFuncs_FlyUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_EmoteX[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *); u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) = { [MOVEMENT_ACTION_FACE_DOWN] = gMovementActionFuncs_FaceDown, @@ -593,6 +602,10 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) [MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK] = gMovementActionFuncs_EmoteDoubleExclMark, [MOVEMENT_ACTION_EXIT_POKEBALL] = gMovementActionFuncs_ExitPokeball, [MOVEMENT_ACTION_ENTER_POKEBALL] = gMovementActionFuncs_EnterPokeball, + [MOVEMENT_ACTION_RUN_DOWN_SLOW] = gMovementActionFuncs_RunDownSlow, + [MOVEMENT_ACTION_RUN_UP_SLOW] = gMovementActionFuncs_RunUpSlow, + [MOVEMENT_ACTION_RUN_LEFT_SLOW] = gMovementActionFuncs_RunLeftSlow, + [MOVEMENT_ACTION_RUN_RIGHT_SLOW] = gMovementActionFuncs_RunRightSlow, }; u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *) = { @@ -1554,3 +1567,27 @@ u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, str MovementAction_EmoteDoubleExclamationMark_Step0, MovementAction_Finish, }; + +u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowDown_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowUp_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowLeft_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowRight_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; 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 122f774ebf..213c888f77 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -50,6 +50,7 @@ #include "constants/region_map_sections.h" #include "constants/songs.h" #include "constants/species.h" +#include "constants/metatile_behaviors.h" #include "constants/trainer_types.h" #include "constants/union_room.h" #include "constants/weather.h" @@ -112,6 +113,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); @@ -158,7 +160,6 @@ static void ApplyLevitateMovement(u8); static bool8 MovementType_Disguise_Callback(struct ObjectEvent *, struct Sprite *); static bool8 MovementType_Buried_Callback(struct ObjectEvent *, struct Sprite *); static void CreateReflectionEffectSprites(void); -static u8 GetObjectEventIdByLocalId(u8); static u8 GetObjectEventIdByLocalIdAndMapInternal(u8, u8, u8); static bool8 GetAvailableObjectEventId(u16, u8, u8, u8 *); static void SetObjectEventDynamicGraphicsId(struct ObjectEvent *); @@ -208,6 +209,8 @@ static void CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(u16 graphics static const struct SpriteFrameImage sPicTable_PechaBerryTree[]; +static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction); + const u8 gReflectionEffectPaletteMap[16] = { [PALSLOT_PLAYER] = PALSLOT_PLAYER_REFLECTION, [PALSLOT_PLAYER_REFLECTION] = PALSLOT_PLAYER_REFLECTION, @@ -748,10 +751,10 @@ static const u8 sFaceDirectionAnimNums[] = { [DIR_NORTH] = ANIM_STD_FACE_NORTH, [DIR_WEST] = ANIM_STD_FACE_WEST, [DIR_EAST] = ANIM_STD_FACE_EAST, - [DIR_SOUTHWEST] = ANIM_STD_FACE_SOUTH, - [DIR_SOUTHEAST] = ANIM_STD_FACE_SOUTH, - [DIR_NORTHWEST] = ANIM_STD_FACE_NORTH, - [DIR_NORTHEAST] = ANIM_STD_FACE_NORTH, + [DIR_SOUTHWEST] = ANIM_STD_FACE_WEST, + [DIR_SOUTHEAST] = ANIM_STD_FACE_EAST, + [DIR_NORTHWEST] = ANIM_STD_FACE_WEST, + [DIR_NORTHEAST] = ANIM_STD_FACE_EAST, }; static const u8 sMoveDirectionAnimNums[] = { [DIR_NONE] = ANIM_STD_GO_SOUTH, @@ -759,10 +762,10 @@ static const u8 sMoveDirectionAnimNums[] = { [DIR_NORTH] = ANIM_STD_GO_NORTH, [DIR_WEST] = ANIM_STD_GO_WEST, [DIR_EAST] = ANIM_STD_GO_EAST, - [DIR_SOUTHWEST] = ANIM_STD_GO_SOUTH, - [DIR_SOUTHEAST] = ANIM_STD_GO_SOUTH, - [DIR_NORTHWEST] = ANIM_STD_GO_NORTH, - [DIR_NORTHEAST] = ANIM_STD_GO_NORTH, + [DIR_SOUTHWEST] = ANIM_STD_GO_WEST, + [DIR_SOUTHEAST] = ANIM_STD_GO_EAST, + [DIR_NORTHWEST] = ANIM_STD_GO_WEST, + [DIR_NORTHEAST] = ANIM_STD_GO_EAST, }; static const u8 sMoveDirectionFastAnimNums[] = { [DIR_NONE] = ANIM_STD_GO_FAST_SOUTH, @@ -770,10 +773,10 @@ static const u8 sMoveDirectionFastAnimNums[] = { [DIR_NORTH] = ANIM_STD_GO_FAST_NORTH, [DIR_WEST] = ANIM_STD_GO_FAST_WEST, [DIR_EAST] = ANIM_STD_GO_FAST_EAST, - [DIR_SOUTHWEST] = ANIM_STD_GO_FAST_SOUTH, - [DIR_SOUTHEAST] = ANIM_STD_GO_FAST_SOUTH, - [DIR_NORTHWEST] = ANIM_STD_GO_FAST_NORTH, - [DIR_NORTHEAST] = ANIM_STD_GO_FAST_NORTH, + [DIR_SOUTHWEST] = ANIM_STD_GO_FAST_WEST, + [DIR_SOUTHEAST] = ANIM_STD_GO_FAST_EAST, + [DIR_NORTHWEST] = ANIM_STD_GO_FAST_WEST, + [DIR_NORTHEAST] = ANIM_STD_GO_FAST_EAST, }; static const u8 sMoveDirectionFasterAnimNums[] = { [DIR_NONE] = ANIM_STD_GO_FASTER_SOUTH, @@ -781,10 +784,10 @@ static const u8 sMoveDirectionFasterAnimNums[] = { [DIR_NORTH] = ANIM_STD_GO_FASTER_NORTH, [DIR_WEST] = ANIM_STD_GO_FASTER_WEST, [DIR_EAST] = ANIM_STD_GO_FASTER_EAST, - [DIR_SOUTHWEST] = ANIM_STD_GO_FASTER_SOUTH, - [DIR_SOUTHEAST] = ANIM_STD_GO_FASTER_SOUTH, - [DIR_NORTHWEST] = ANIM_STD_GO_FASTER_NORTH, - [DIR_NORTHEAST] = ANIM_STD_GO_FASTER_NORTH, + [DIR_SOUTHWEST] = ANIM_STD_GO_FASTER_WEST, + [DIR_SOUTHEAST] = ANIM_STD_GO_FASTER_EAST, + [DIR_NORTHWEST] = ANIM_STD_GO_FASTER_WEST, + [DIR_NORTHEAST] = ANIM_STD_GO_FASTER_EAST, }; static const u8 sMoveDirectionFastestAnimNums[] = { [DIR_NONE] = ANIM_STD_GO_FASTEST_SOUTH, @@ -792,10 +795,10 @@ static const u8 sMoveDirectionFastestAnimNums[] = { [DIR_NORTH] = ANIM_STD_GO_FASTEST_NORTH, [DIR_WEST] = ANIM_STD_GO_FASTEST_WEST, [DIR_EAST] = ANIM_STD_GO_FASTEST_EAST, - [DIR_SOUTHWEST] = ANIM_STD_GO_FASTEST_SOUTH, - [DIR_SOUTHEAST] = ANIM_STD_GO_FASTEST_SOUTH, - [DIR_NORTHWEST] = ANIM_STD_GO_FASTEST_NORTH, - [DIR_NORTHEAST] = ANIM_STD_GO_FASTEST_NORTH, + [DIR_SOUTHWEST] = ANIM_STD_GO_FASTEST_WEST, + [DIR_SOUTHEAST] = ANIM_STD_GO_FASTEST_EAST, + [DIR_NORTHWEST] = ANIM_STD_GO_FASTEST_WEST, + [DIR_NORTHEAST] = ANIM_STD_GO_FASTEST_EAST, }; static const u8 sJumpSpecialDirectionAnimNums[] = { // used for jumping onto surf mon [DIR_NONE] = ANIM_GET_ON_OFF_POKEMON_SOUTH, @@ -814,10 +817,10 @@ static const u8 sAcroWheelieDirectionAnimNums[] = { [DIR_NORTH] = ANIM_BUNNY_HOP_BACK_WHEEL_NORTH, [DIR_WEST] = ANIM_BUNNY_HOP_BACK_WHEEL_WEST, [DIR_EAST] = ANIM_BUNNY_HOP_BACK_WHEEL_EAST, - [DIR_SOUTHWEST] = ANIM_BUNNY_HOP_BACK_WHEEL_SOUTH, - [DIR_SOUTHEAST] = ANIM_BUNNY_HOP_BACK_WHEEL_SOUTH, - [DIR_NORTHWEST] = ANIM_BUNNY_HOP_BACK_WHEEL_NORTH, - [DIR_NORTHEAST] = ANIM_BUNNY_HOP_BACK_WHEEL_NORTH, + [DIR_SOUTHWEST] = ANIM_BUNNY_HOP_BACK_WHEEL_WEST, + [DIR_SOUTHEAST] = ANIM_BUNNY_HOP_BACK_WHEEL_EAST, + [DIR_NORTHWEST] = ANIM_BUNNY_HOP_BACK_WHEEL_WEST, + [DIR_NORTHEAST] = ANIM_BUNNY_HOP_BACK_WHEEL_EAST, }; static const u8 sAcroUnusedDirectionAnimNums[] = { [DIR_NONE] = ANIM_BUNNY_HOP_FRONT_WHEEL_SOUTH, @@ -836,10 +839,10 @@ static const u8 sAcroEndWheelieDirectionAnimNums[] = { [DIR_NORTH] = ANIM_STANDING_WHEELIE_BACK_WHEEL_NORTH, [DIR_WEST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_WEST, [DIR_EAST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_EAST, - [DIR_SOUTHWEST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_SOUTH, - [DIR_SOUTHEAST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_SOUTH, - [DIR_NORTHWEST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_NORTH, - [DIR_NORTHEAST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_NORTH, + [DIR_SOUTHWEST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_WEST, + [DIR_SOUTHEAST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_EAST, + [DIR_NORTHWEST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_WEST, + [DIR_NORTHEAST] = ANIM_STANDING_WHEELIE_BACK_WHEEL_EAST, }; static const u8 sAcroUnusedActionDirectionAnimNums[] = { [DIR_NONE] = ANIM_STANDING_WHEELIE_FRONT_WHEEL_SOUTH, @@ -858,10 +861,10 @@ static const u8 sAcroWheeliePedalDirectionAnimNums[] = { [DIR_NORTH] = ANIM_MOVING_WHEELIE_NORTH, [DIR_WEST] = ANIM_MOVING_WHEELIE_WEST, [DIR_EAST] = ANIM_MOVING_WHEELIE_EAST, - [DIR_SOUTHWEST] = ANIM_MOVING_WHEELIE_SOUTH, - [DIR_SOUTHEAST] = ANIM_MOVING_WHEELIE_SOUTH, - [DIR_NORTHWEST] = ANIM_MOVING_WHEELIE_NORTH, - [DIR_NORTHEAST] = ANIM_MOVING_WHEELIE_NORTH, + [DIR_SOUTHWEST] = ANIM_MOVING_WHEELIE_WEST, + [DIR_SOUTHEAST] = ANIM_MOVING_WHEELIE_EAST, + [DIR_NORTHWEST] = ANIM_MOVING_WHEELIE_WEST, + [DIR_NORTHEAST] = ANIM_MOVING_WHEELIE_EAST, }; static const u8 sFishingDirectionAnimNums[] = { [DIR_NONE] = ANIM_TAKE_OUT_ROD_SOUTH, @@ -902,10 +905,10 @@ static const u8 sRunningDirectionAnimNums[] = { [DIR_NORTH] = ANIM_RUN_NORTH, [DIR_WEST] = ANIM_RUN_WEST, [DIR_EAST] = ANIM_RUN_EAST, - [DIR_SOUTHWEST] = ANIM_RUN_SOUTH, - [DIR_SOUTHEAST] = ANIM_RUN_SOUTH, - [DIR_NORTHWEST] = ANIM_RUN_NORTH, - [DIR_NORTHEAST] = ANIM_RUN_NORTH, + [DIR_SOUTHWEST] = ANIM_RUN_WEST, + [DIR_SOUTHEAST] = ANIM_RUN_EAST, + [DIR_NORTHWEST] = ANIM_RUN_WEST, + [DIR_NORTHEAST] = ANIM_RUN_EAST, }; const u8 gTrainerFacingDirectionMovementTypes[] = { @@ -943,64 +946,72 @@ static const struct Coords16 sDirectionToVectors[] = { {-1, 1}, { 1, 1}, {-1, -1}, - { 1, -1} + { 1, -1}, + {-2, 1}, + { 2, 1}, + {-2, -1}, + { 2, -1} }; const u8 gFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_FACE_DOWN, - MOVEMENT_ACTION_FACE_DOWN, - MOVEMENT_ACTION_FACE_UP, - MOVEMENT_ACTION_FACE_LEFT, - MOVEMENT_ACTION_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_FACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_FACE_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_FACE_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_FACE_RIGHT }; const u8 gWalkSlowMovementActions[] = { - MOVEMENT_ACTION_WALK_SLOW_DOWN, - MOVEMENT_ACTION_WALK_SLOW_DOWN, - MOVEMENT_ACTION_WALK_SLOW_UP, - MOVEMENT_ACTION_WALK_SLOW_LEFT, - MOVEMENT_ACTION_WALK_SLOW_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_SLOW_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_SLOW_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_SLOW_RIGHT, }; const u8 gWalkNormalMovementActions[] = { - MOVEMENT_ACTION_WALK_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_NORMAL_UP, - MOVEMENT_ACTION_WALK_NORMAL_LEFT, - MOVEMENT_ACTION_WALK_NORMAL_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_NORMAL_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_NORMAL_RIGHT, }; const u8 gWalkFastMovementActions[] = { - MOVEMENT_ACTION_WALK_FAST_DOWN, - MOVEMENT_ACTION_WALK_FAST_DOWN, - MOVEMENT_ACTION_WALK_FAST_UP, - MOVEMENT_ACTION_WALK_FAST_LEFT, - MOVEMENT_ACTION_WALK_FAST_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_FAST_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_FAST_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_FAST_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_FAST_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_FAST_RIGHT, }; const u8 gRideWaterCurrentMovementActions[] = { - MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, + [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, }; const u8 gWalkFasterMovementActions[] = { - MOVEMENT_ACTION_WALK_FASTER_DOWN, - MOVEMENT_ACTION_WALK_FASTER_DOWN, - MOVEMENT_ACTION_WALK_FASTER_UP, - MOVEMENT_ACTION_WALK_FASTER_LEFT, - MOVEMENT_ACTION_WALK_FASTER_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_FASTER_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_FASTER_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_FASTER_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_FASTER_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_FASTER_RIGHT, }; const u8 gSlideMovementActions[] = { - MOVEMENT_ACTION_SLIDE_DOWN, - MOVEMENT_ACTION_SLIDE_DOWN, - MOVEMENT_ACTION_SLIDE_UP, - MOVEMENT_ACTION_SLIDE_LEFT, - MOVEMENT_ACTION_SLIDE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_SLIDE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_SLIDE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_SLIDE_UP, + [DIR_WEST] = MOVEMENT_ACTION_SLIDE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_SLIDE_RIGHT, }; const u8 gPlayerRunMovementActions[] = { - MOVEMENT_ACTION_PLAYER_RUN_DOWN, - MOVEMENT_ACTION_PLAYER_RUN_DOWN, - MOVEMENT_ACTION_PLAYER_RUN_UP, - MOVEMENT_ACTION_PLAYER_RUN_LEFT, - MOVEMENT_ACTION_PLAYER_RUN_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_PLAYER_RUN_UP, + [DIR_WEST] = MOVEMENT_ACTION_PLAYER_RUN_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_PLAYER_RUN_RIGHT, }; const u8 gJump2MovementActions[] = { MOVEMENT_ACTION_JUMP_2_DOWN, @@ -1038,102 +1049,170 @@ const u8 gJumpSpecialMovementActions[] = { MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT, }; const u8 gWalkInPlaceSlowMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT }; const u8 gWalkInPlaceNormalMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT }; const u8 gWalkInPlaceFastMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT }; const u8 gWalkInPlaceFasterMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT }; const u8 gAcroWheelieFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT }; const u8 gAcroPopWheelieFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, }; const u8 gAcroEndWheelieFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, }; const u8 gAcroWheelieHopFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, }; const u8 gAcroWheelieHopDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, }; const u8 gAcroWheelieJumpDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, }; const u8 gAcroWheelieInPlaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, }; const u8 gAcroPopWheelieMoveDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, }; const u8 gAcroWheelieMoveDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, }; const u8 gAcroEndWheelieMoveDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, +}; +// run slow +const u8 gRunSlowMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_SOUTH] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_WEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, + [DIR_EAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, + [DIR_NORTHWEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, + [DIR_NORTHEAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, }; static const u8 sOppositeDirections[] = { @@ -1302,7 +1381,7 @@ static u8 GetObjectEventIdByLocalIdAndMapInternal(u8 localId, u8 mapNum, u8 mapG return OBJECT_EVENTS_COUNT; } -static u8 GetObjectEventIdByLocalId(u8 localId) +u8 GetObjectEventIdByLocalId(u8 localId) { u8 i; for (i = 0; i < OBJECT_EVENTS_COUNT; i++) @@ -1331,7 +1410,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; @@ -1611,6 +1690,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) { @@ -1648,7 +1733,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) { @@ -2170,7 +2255,7 @@ void RemoveFollowingPokemon(void) } // Determine whether follower *should* be visible -static bool32 IsFollowerVisible(void) +bool32 IsFollowerVisible(void) { return !(TestPlayerAvatarFlags(FOLLOWER_INVISIBLE_FLAGS) || MetatileBehavior_IsSurfableWaterOrUnderwater(gObjectEvents[gPlayerAvatar.objectEventId].previousMetatileBehavior) @@ -3629,13 +3714,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; } @@ -3961,16 +4053,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; @@ -4029,16 +4111,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; @@ -5511,7 +5583,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; } @@ -5520,17 +5592,12 @@ bool8 MovementType_FollowPlayer_Active(struct ObjectEvent *objectEvent, struct S bool8 MovementType_FollowPlayer_Moving(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - #ifdef MB_SIDEWAYS_STAIRS_RIGHT_SIDE // Copied from ObjectEventExecSingleMovementAction if (gMovementActionFuncs[objectEvent->movementActionId][sprite->sActionFuncId](objectEvent, sprite)) { objectEvent->movementActionId = MOVEMENT_ACTION_NONE; sprite->sActionFuncId = 0; - #else - if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) - { - #endif - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; if (sprite->sTypeFuncId) // restore nonzero state sprite->sTypeFuncId = 1; } @@ -5543,25 +5610,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; } @@ -5573,10 +5650,8 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri s16 y; s16 targetX; s16 targetY; - #ifdef MB_SIDEWAYS_STAIRS_RIGHT_SIDE u32 playerAction = gObjectEvents[gPlayerAvatar.objectEventId].movementActionId; - #endif - + targetX = gObjectEvents[gPlayerAvatar.objectEventId].previousCoords.x; targetY = gObjectEvents[gPlayerAvatar.objectEventId].previousCoords.y; x = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x; @@ -5600,7 +5675,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; @@ -5615,12 +5690,12 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri // Follow player direction = GetDirectionToFace(x, y, targetX, targetY); MoveCoords(direction, &x, &y); - #ifdef MB_SIDEWAYS_STAIRS_RIGHT_SIDE // https://github.com/ghoulslash/pokeemerald/tree/sideways_stairs GetCollisionAtCoords(objectEvent, x, y, direction); // Sets directionOverwrite for stairs 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 @@ -5647,7 +5722,6 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri } } sprite->sActionFuncId = 0; - #else if (GetLedgeJumpDirection(x, y, direction) != DIR_NONE) { // InitJumpRegular will set the proper speed @@ -5669,8 +5743,7 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri if (OW_FOLLOWERS_BOBBING == TRUE) sprite->y2 = -1; } - #endif - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; return TRUE; } @@ -5844,6 +5917,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; } @@ -6112,7 +6192,7 @@ u8 GetTrainerFacingDirectionMovementType(u8 direction) return gTrainerFacingDirectionMovementTypes[direction]; } -static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) +u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) { s16 x = objectEvent->currentCoords.x; s16 y = objectEvent->currentCoords.y; @@ -6120,18 +6200,56 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) return GetCollisionAtCoords(objectEvent, x, y, direction); } -u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) +u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 currentBehavior, u8 nextBehavior, u8 collision) { - u8 direction = dir; - -#if OW_FLAG_NO_COLLISION != 0 - if (FlagGet(OW_FLAG_NO_COLLISION)) - return COLLISION_NONE; -#endif + if ((dir == DIR_SOUTH || dir == DIR_NORTH) && collision != COLLISION_NONE) + return collision; + + // cant descend stairs into water + if (MetatileBehavior_IsSurfableFishableWater(nextBehavior)) + return collision; + + if (MetatileBehavior_IsSidewaysStairsLeftSide(nextBehavior)) + { + //moving ONTO left side stair + if (dir == DIR_WEST && currentBehavior != nextBehavior) + return collision; //moving onto top part of left-stair going left, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; // move diagonally + } + else if (MetatileBehavior_IsSidewaysStairsRightSide(nextBehavior)) + { + //moving ONTO right side stair + if (dir == DIR_EAST && currentBehavior != nextBehavior) + return collision; //moving onto top part of right-stair going right, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; + } + else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currentBehavior)) + { + //moving OFF of any left side stair + if (dir == DIR_WEST && nextBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; //moving off of left stairs onto non-stair -> move diagonal + else + return collision; //moving off of left side stair to east -> move east + } + else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currentBehavior)) + { + //moving OFF of any right side stair + if (dir == DIR_EAST && nextBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; //moving off right stair onto non-stair -> move diagonal + else + return collision; + } + + return collision; +} +static u8 GetVanillaCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) +{ if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) return COLLISION_OUTSIDE_RANGE; - else if (MapGridGetCollisionAt(x, y) || GetMapBorderIdAt(x, y) == CONNECTION_INVALID || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction)) + else if (MapGridGetCollisionAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction)) return COLLISION_IMPASSABLE; else if (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction)) return COLLISION_IMPASSABLE; @@ -6139,9 +6257,94 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) return COLLISION_ELEVATION_MISMATCH; else if (DoesObjectCollideWithObjectAt(objectEvent, x, y)) return COLLISION_OBJECT_EVENT; + return COLLISION_NONE; } +static bool8 ObjectEventOnLeftSideStair(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) +{ + switch (direction) + { + case DIR_EAST: + MoveCoords(DIR_NORTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + case DIR_WEST: + MoveCoords(DIR_SOUTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + default: + return FALSE; //north/south taken care of in GetVanillaCollision + } +} + +static bool8 ObjectEventOnRightSideStair(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) +{ + switch (direction) + { + case DIR_EAST: + MoveCoords(DIR_SOUTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + case DIR_WEST: + MoveCoords(DIR_NORTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + default: + return FALSE; //north/south taken care of in GetVanillaCollision + } +} + +u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) +{ + u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y); + u8 nextBehavior = MapGridGetMetatileBehaviorAt(x, y); + u8 collision; + + #if OW_FLAG_NO_COLLISION != 0 + if (FlagGet(OW_FLAG_NO_COLLISION)) + return COLLISION_NONE; + #endif + + objectEvent->directionOverwrite = DIR_NONE; + + //sideways stairs checks + if (MetatileBehavior_IsSidewaysStairsLeftSideTop(nextBehavior) && dir == DIR_EAST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from regular ground -> nope + else if (MetatileBehavior_IsSidewaysStairsRightSideTop(nextBehavior) && dir == DIR_WEST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from regular ground -> nope + else if (MetatileBehavior_IsSidewaysStairsRightSideBottom(nextBehavior) && (dir == DIR_EAST || dir == DIR_SOUTH)) + return COLLISION_IMPASSABLE; //moving into right-side bottom edge from regular ground -> nah + else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(nextBehavior) && (dir == DIR_WEST || dir == DIR_SOUTH)) + return COLLISION_IMPASSABLE; //moving onto left-side bottom edge from regular ground -> nah + else if ((MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) + && dir == DIR_NORTH) + return COLLISION_IMPASSABLE; //trying to move north off of top-most tile onto same level doesn't work + else if (!(MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) + && dir == DIR_SOUTH && (MetatileBehavior_IsSidewaysStairsLeftSideTop(nextBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(nextBehavior))) + return COLLISION_IMPASSABLE; //trying to move south onto top stair tile at same level from non-stair -> no + else if (!(MetatileBehavior_IsSidewaysStairsLeftSideBottom(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(currentBehavior)) + && dir == DIR_NORTH && (MetatileBehavior_IsSidewaysStairsLeftSideBottom(nextBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(nextBehavior))) + return COLLISION_IMPASSABLE; //trying to move north onto top stair tile at same level from non-stair -> no + + // regular checks + collision = GetVanillaCollision(objectEvent, x, y, dir); + + //sideways stairs direction change checks + collision = GetSidewaysStairsCollision(objectEvent, dir, currentBehavior, nextBehavior, collision); + switch (collision) + { + case COLLISION_SIDEWAYS_STAIRS_TO_LEFT: + if (ObjectEventOnLeftSideStair(objectEvent, x, y, dir)) + return COLLISION_OBJECT_EVENT; + objectEvent->directionOverwrite = GetLeftSideStairsDirection(dir); + return COLLISION_NONE; + case COLLISION_SIDEWAYS_STAIRS_TO_RIGHT: + if (ObjectEventOnRightSideStair(objectEvent, x, y, dir)) + return COLLISION_OBJECT_EVENT; + objectEvent->directionOverwrite = GetRightSideStairsDirection(dir); + return COLLISION_NONE; + } + + return collision; +} + u8 GetCollisionFlagsAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) { u8 flags = 0; @@ -6205,6 +6408,7 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *objectEvent, s16 curObject = &gObjectEvents[i]; if (curObject->active && (curObject->movementType != MOVEMENT_TYPE_FOLLOW_PLAYER || objectEvent != &gObjectEvents[gPlayerAvatar.objectEventId]) && curObject != objectEvent) { + // check for collision if curObject is active, not the object in question, and not exempt from collisions if ((curObject->currentCoords.x == x && curObject->currentCoords.y == y) || (curObject->previousCoords.x == x && curObject->previousCoords.y == y)) { if (AreElevationsCompatible(objectEvent->currentElevation, curObject->currentElevation)) @@ -6341,10 +6545,35 @@ bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *objectEvent) return FALSE; } +static u8 TryUpdateMovementActionOnStairs(struct ObjectEvent *objectEvent, u8 movementActionId) +{ + if (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER) + return movementActionId; // handled separately + + if (!ObjectMovingOnRockStairs(objectEvent, objectEvent->movementDirection)) + return movementActionId; + + switch (movementActionId) + { + case MOVEMENT_ACTION_WALK_NORMAL_DOWN: + return MOVEMENT_ACTION_WALK_SLOW_DOWN; + case MOVEMENT_ACTION_WALK_NORMAL_UP: + return MOVEMENT_ACTION_WALK_SLOW_UP; + case MOVEMENT_ACTION_WALK_NORMAL_LEFT: + return MOVEMENT_ACTION_WALK_SLOW_LEFT; + case MOVEMENT_ACTION_WALK_NORMAL_RIGHT: + return MOVEMENT_ACTION_WALK_SLOW_RIGHT; + default: + return movementActionId; + } +} + bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementActionId) { if (ObjectEventIsMovementOverridden(objectEvent)) return TRUE; + + movementActionId = TryUpdateMovementActionOnStairs(objectEvent, movementActionId); UnfreezeObjectEvent(objectEvent); objectEvent->movementActionId = movementActionId; @@ -6356,6 +6585,7 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct void ObjectEventForceSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementActionId) { + movementActionId = TryUpdateMovementActionOnStairs(objectEvent, movementActionId); ObjectEventClearHeldMovementIfActive(objectEvent); ObjectEventSetHeldMovement(objectEvent, movementActionId); } @@ -6395,7 +6625,7 @@ u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *objectEvent) u8 ObjectEventGetHeldMovementActionId(struct ObjectEvent *objectEvent) { if (objectEvent->heldMovementActive) - return objectEvent->movementActionId; + return TryUpdateMovementActionOnStairs(objectEvent, objectEvent->movementActionId); return MOVEMENT_ACTION_NONE; } @@ -6424,12 +6654,13 @@ u8 name(u32 idx)\ u8 animIds[sizeof(table)];\ direction = idx;\ memcpy(animIds, (table), sizeof(table));\ - if (direction > DIR_EAST) direction = 0;\ + if (direction > sizeof(table)) direction = 0;\ return animIds[direction];\ } dirn_to_anim(GetFaceDirectionMovementAction, gFaceDirectionMovementActions); dirn_to_anim(GetWalkSlowMovementAction, gWalkSlowMovementActions); +dirn_to_anim(GetPlayerRunSlowMovementAction, gRunSlowMovementActions); dirn_to_anim(GetWalkNormalMovementAction, gWalkNormalMovementActions); dirn_to_anim(GetWalkFastMovementAction, gWalkFastMovementActions); dirn_to_anim(GetRideWaterCurrentMovementAction, gRideWaterCurrentMovementActions); @@ -6498,12 +6729,14 @@ static u32 GetCopyDirection(u8 copyInitDir, u32 playerInitDir, u32 playerMoveDir static void ObjectEventExecHeldMovementAction(struct ObjectEvent *objectEvent, struct Sprite *sprite) { + objectEvent->movementActionId = TryUpdateMovementActionOnStairs(objectEvent, objectEvent->movementActionId); if (gMovementActionFuncs[objectEvent->movementActionId][sprite->sActionFuncId](objectEvent, sprite)) objectEvent->heldMovementFinished = TRUE; } static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent, struct Sprite *sprite) { + objectEvent->movementActionId = TryUpdateMovementActionOnStairs(objectEvent, objectEvent->movementActionId); if (gMovementActionFuncs[objectEvent->movementActionId][sprite->sActionFuncId](objectEvent, sprite)) { objectEvent->movementActionId = MOVEMENT_ACTION_NONE; @@ -6515,7 +6748,7 @@ static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent static void ObjectEventSetSingleMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animId) { - objectEvent->movementActionId = animId; + objectEvent->movementActionId = TryUpdateMovementActionOnStairs(objectEvent, animId); sprite->sActionFuncId = 0; } @@ -6731,7 +6964,10 @@ bool8 MovementAction_WalkSlowUp_Step1(struct ObjectEvent *objectEvent, struct Sp bool8 MovementAction_WalkSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitWalkSlow(objectEvent, sprite, DIR_WEST); + if (objectEvent->directionOverwrite) + InitWalkSlow(objectEvent, sprite, objectEvent->directionOverwrite); + else + InitWalkSlow(objectEvent, sprite, DIR_WEST); return MovementAction_WalkSlowLeft_Step1(objectEvent, sprite); } @@ -6747,7 +6983,10 @@ bool8 MovementAction_WalkSlowLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitWalkSlow(objectEvent, sprite, DIR_EAST); + if (objectEvent->directionOverwrite) + InitWalkSlow(objectEvent, sprite, objectEvent->directionOverwrite); + else + InitWalkSlow(objectEvent, sprite, DIR_EAST); return MovementAction_WalkSlowRight_Step1(objectEvent, sprite); } @@ -6859,7 +7098,10 @@ bool8 MovementAction_WalkNormalUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkNormalLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_NORMAL); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_NORMAL); + else + InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_NORMAL); return MovementAction_WalkNormalLeft_Step1(objectEvent, sprite); } @@ -6875,7 +7117,10 @@ bool8 MovementAction_WalkNormalLeft_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkNormalRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_NORMAL); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_NORMAL); + else + InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_NORMAL); return MovementAction_WalkNormalRight_Step1(objectEvent, sprite); } @@ -7153,7 +7398,10 @@ bool8 MovementAction_WalkFastUp_Step1(struct ObjectEvent *objectEvent, struct Sp bool8 MovementAction_WalkFastLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_1); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FAST_1); + else + InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_1); return MovementAction_WalkFastLeft_Step1(objectEvent, sprite); } @@ -7169,7 +7417,10 @@ bool8 MovementAction_WalkFastLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFastRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_1); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FAST_1); + else + InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_1); return MovementAction_WalkFastRight_Step1(objectEvent, sprite); } @@ -7503,13 +7754,19 @@ bool8 MovementAction_WalkInPlaceFasterUp_Step0(struct ObjectEvent *objectEvent, bool8 MovementAction_WalkInPlaceFasterLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + if (objectEvent->directionOverwrite) + InitMoveInPlace(objectEvent, sprite, objectEvent->directionOverwrite, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + else + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFasterRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); + if (objectEvent->directionOverwrite) + InitMoveInPlace(objectEvent, sprite, objectEvent->directionOverwrite, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); + else + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } @@ -7547,7 +7804,10 @@ bool8 MovementAction_RideWaterCurrentUp_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_2); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FAST_2); + else + InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FAST_2); return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); } @@ -7563,7 +7823,10 @@ bool8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_2); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FAST_2); + else + InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FAST_2); return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); } @@ -7611,7 +7874,10 @@ bool8 MovementAction_WalkFasterUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFasterLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FASTER); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FASTER); + else + InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FASTER); return MovementAction_WalkFasterLeft_Step1(objectEvent, sprite); } @@ -7627,7 +7893,10 @@ bool8 MovementAction_WalkFasterLeft_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkFasterRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FASTER); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FASTER); + else + InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FASTER); return MovementAction_WalkFasterRight_Step1(objectEvent, sprite); } @@ -7675,7 +7944,10 @@ bool8 MovementAction_SlideUp_Step1(struct ObjectEvent *objectEvent, struct Sprit bool8 MovementAction_SlideLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FASTEST); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FASTEST); + else + InitMovementNormal(objectEvent, sprite, DIR_WEST, MOVE_SPEED_FASTEST); return MovementAction_SlideLeft_Step1(objectEvent, sprite); } @@ -7691,7 +7963,10 @@ bool8 MovementAction_SlideLeft_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_SlideRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FASTEST); + if (objectEvent->directionOverwrite) + InitMovementNormal(objectEvent, sprite, objectEvent->directionOverwrite, MOVE_SPEED_FASTEST); + else + InitMovementNormal(objectEvent, sprite, DIR_EAST, MOVE_SPEED_FASTEST); return MovementAction_SlideRight_Step1(objectEvent, sprite); } @@ -7739,7 +8014,10 @@ bool8 MovementAction_PlayerRunUp_Step1(struct ObjectEvent *objectEvent, struct S bool8 MovementAction_PlayerRunLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - StartRunningAnim(objectEvent, sprite, DIR_WEST); + if (objectEvent->directionOverwrite) + StartRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartRunningAnim(objectEvent, sprite, DIR_WEST); return MovementAction_PlayerRunLeft_Step1(objectEvent, sprite); } @@ -7755,7 +8033,10 @@ bool8 MovementAction_PlayerRunLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_PlayerRunRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - StartRunningAnim(objectEvent, sprite, DIR_EAST); + if (objectEvent->directionOverwrite) + StartRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartRunningAnim(objectEvent, sprite, DIR_EAST); return MovementAction_PlayerRunRight_Step1(objectEvent, sprite); } @@ -8642,7 +8923,10 @@ bool8 MovementAction_AcroWheelieHopUp_Step1(struct ObjectEvent *objectEvent, str bool8 MovementAction_AcroWheelieHopLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, JUMP_DISTANCE_NORMAL, JUMP_TYPE_LOW); + if (objectEvent->directionOverwrite) + InitAcroWheelieJump(objectEvent, sprite, objectEvent->directionOverwrite, JUMP_DISTANCE_NORMAL, JUMP_TYPE_LOW); + else + InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, JUMP_DISTANCE_NORMAL, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopLeft_Step1(objectEvent, sprite); } @@ -8659,7 +8943,10 @@ bool8 MovementAction_AcroWheelieHopLeft_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, JUMP_DISTANCE_NORMAL, JUMP_TYPE_LOW); + if (objectEvent->directionOverwrite) + InitAcroWheelieJump(objectEvent, sprite, objectEvent->directionOverwrite, JUMP_DISTANCE_NORMAL, JUMP_TYPE_LOW); + else + InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, JUMP_DISTANCE_NORMAL, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopRight_Step1(objectEvent, sprite); } @@ -8710,7 +8997,10 @@ bool8 MovementAction_AcroWheelieJumpUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieJumpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, JUMP_DISTANCE_FAR, JUMP_TYPE_HIGH); + if (objectEvent->directionOverwrite) + InitAcroWheelieJump(objectEvent, sprite, objectEvent->directionOverwrite, JUMP_DISTANCE_FAR, JUMP_TYPE_HIGH); + else + InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, JUMP_DISTANCE_FAR, JUMP_TYPE_HIGH); return MovementAction_AcroWheelieJumpLeft_Step1(objectEvent, sprite); } @@ -8727,7 +9017,10 @@ bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, JUMP_DISTANCE_FAR, JUMP_TYPE_HIGH); + if (objectEvent->directionOverwrite) + InitAcroWheelieJump(objectEvent, sprite, objectEvent->directionOverwrite, JUMP_DISTANCE_FAR, JUMP_TYPE_HIGH); + else + InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, JUMP_DISTANCE_FAR, JUMP_TYPE_HIGH); return MovementAction_AcroWheelieJumpRight_Step1(objectEvent, sprite); } @@ -8756,13 +9049,19 @@ bool8 MovementAction_AcroWheelieInPlaceUp_Step0(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieInPlaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); + if (objectEvent->directionOverwrite) + InitMoveInPlace(objectEvent, sprite, objectEvent->directionOverwrite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->directionOverwrite), 8); + else + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); + if (objectEvent->directionOverwrite) + InitMoveInPlace(objectEvent, sprite, objectEvent->directionOverwrite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->directionOverwrite), 8); + else + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } @@ -8807,7 +9106,10 @@ bool8 MovementAction_AcroPopWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroPopWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroPopWheelie(objectEvent, sprite, DIR_WEST, 1); + if (objectEvent->directionOverwrite) + InitAcroPopWheelie(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + InitAcroPopWheelie(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroPopWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -8823,7 +9125,10 @@ bool8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroPopWheelie(objectEvent, sprite, DIR_EAST, 1); + if (objectEvent->directionOverwrite) + InitAcroPopWheelie(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + InitAcroPopWheelie(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroPopWheelieMoveRight_Step1(objectEvent, sprite); } @@ -8877,7 +9182,10 @@ bool8 MovementAction_AcroWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroWheelieMove(objectEvent, sprite, DIR_WEST, 1); + if (objectEvent->directionOverwrite) + InitAcroWheelieMove(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + InitAcroWheelieMove(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -8893,7 +9201,10 @@ bool8 MovementAction_AcroWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroWheelieMove(objectEvent, sprite, DIR_EAST, 1); + if (objectEvent->directionOverwrite) + InitAcroWheelieMove(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + InitAcroWheelieMove(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroWheelieMoveRight_Step1(objectEvent, sprite); } @@ -8948,7 +9259,10 @@ bool8 MovementAction_AcroEndWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroEndWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroEndWheelie(objectEvent, sprite, DIR_WEST, 1); + if (objectEvent->directionOverwrite) + InitAcroEndWheelie(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + InitAcroEndWheelie(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroEndWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -8964,7 +9278,10 @@ bool8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - InitAcroEndWheelie(objectEvent, sprite, DIR_EAST, 1); + if (objectEvent->directionOverwrite) + InitAcroEndWheelie(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + InitAcroEndWheelie(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroEndWheelieMoveRight_Step1(objectEvent, sprite); } @@ -9168,6 +9485,9 @@ static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent *objEve static void GetGroundEffectFlags_Tracks(struct ObjectEvent *objEvent, u32 *flags) { + if (objEvent->directionOverwrite) + return; + if (MetatileBehavior_IsDeepSand(objEvent->previousMetatileBehavior)) *flags |= GROUND_EFFECT_FLAG_DEEP_SAND; else if (MetatileBehavior_IsSandOrDeepSand(objEvent->previousMetatileBehavior) @@ -9668,12 +9988,13 @@ static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, st if (objEvent->currentCoords.x != objEvent->previousCoords.x || objEvent->currentCoords.y != objEvent->previousCoords.y) { + u8 movementDir = (objEvent->previousMovementDirection > DIR_EAST) ? (objEvent->previousMovementDirection - DIR_EAST) : objEvent->previousMovementDirection; gFieldEffectArguments[0] = objEvent->previousCoords.x; gFieldEffectArguments[1] = objEvent->previousCoords.y; gFieldEffectArguments[2] = 149; gFieldEffectArguments[3] = 2; gFieldEffectArguments[4] = - bikeTireTracks_Transitions[objEvent->previousMovementDirection][objEvent->facingDirection - 5]; + bikeTireTracks_Transitions[movementDir][objEvent->facingDirection - 5]; FieldEffectStart(FLDEFF_BIKE_TIRE_TRACKS); } } @@ -10335,15 +10656,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) @@ -10824,3 +11148,50 @@ void GetDaycareGraphics(struct ScriptContext *ctx) } gSpecialVar_Result = i; } + +// running slow +static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +{ + InitNpcForWalkSlow(objectEvent, sprite, direction); + SetStepAnimHandleAlternation(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection)); +} + +bool8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTH); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + StartSlowRunningAnim(objectEvent, sprite, DIR_NORTH); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (objectEvent->directionOverwrite) + StartSlowRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartSlowRunningAnim(objectEvent, sprite, DIR_WEST); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (objectEvent->directionOverwrite) + StartSlowRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartSlowRunningAnim(objectEvent, sprite, DIR_EAST); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (UpdateMovementNormal(objectEvent, sprite)) + { + sprite->sActionFuncId = 2; + return TRUE; + } + return FALSE; +} diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 9452e1273e..51952c3627 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -10,6 +10,7 @@ #include "event_scripts.h" #include "fieldmap.h" #include "field_control_avatar.h" +#include "field_message_box.h" #include "field_player_avatar.h" #include "field_poison.h" #include "field_screen_effect.h" @@ -34,6 +35,7 @@ #include "constants/event_objects.h" #include "constants/field_poison.h" #include "constants/map_types.h" +#include "constants/metatile_behaviors.h" #include "constants/songs.h" #include "constants/trainer_hill.h" @@ -73,6 +75,11 @@ static void UpdateFollowerStepCounter(void); #if OW_POISON_DAMAGE < GEN_5 static bool8 UpdatePoisonStepCounter(void); #endif // OW_POISON_DAMAGE +static bool32 TrySetUpWalkIntoSignpostScript(struct MapPosition * position, u32 metatileBehavior, u32 playerDirection); +static void SetMsgSignPostAndVarFacing(u32 playerDirection); +static void SetUpWalkIntoSignScript(const u8 *script, u32 playerDirection); +static u32 GetFacingSignpostType(u16 metatileBehvaior, u32 direction); +static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition * position); void FieldClearPlayerInput(struct FieldInput *input) { @@ -154,6 +161,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) gSpecialVar_LastTalked = 0; gSelectedObjectEvent = 0; + gMsgIsSignPost = FALSE; playerDirection = GetPlayerFacingDirection(); GetPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); @@ -173,6 +181,17 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (TryStartStepBasedScript(&position, metatileBehavior, playerDirection) == TRUE) return TRUE; } + + if ((input->checkStandardWildEncounter) && ((input->dpadDirection == 0) || input->dpadDirection == playerDirection)) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } + if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; if (input->heldDirection && input->dpadDirection == playerDirection) @@ -183,6 +202,10 @@ int ProcessPlayerFieldInput(struct FieldInput *input) GetInFrontOfPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + + if (input->heldDirection && (input->dpadDirection == playerDirection) && (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)) + return TRUE; + if (input->pressedAButton && TryStartInteractionScript(&position, metatileBehavior, playerDirection) == TRUE) return TRUE; @@ -309,8 +332,39 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8 { u8 objectEventId; const u8 *script; - - objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation); + s16 currX = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x; + s16 currY = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y; + u8 currBehavior = MapGridGetMetatileBehaviorAt(currX, currY); + + switch (direction) + { + case DIR_EAST: + if (MetatileBehavior_IsSidewaysStairsLeftSideAny(metatileBehavior)) + // sideways stairs left-side to your right -> check northeast + objectEventId = GetObjectEventIdByPosition(currX + 1, currY - 1, position->elevation); + else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currBehavior)) + // on top of right-side stairs -> check southeast + objectEventId = GetObjectEventIdByPosition(currX + 1, currY + 1, position->elevation); + else + // check in front of player + objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation); + break; + case DIR_WEST: + if (MetatileBehavior_IsSidewaysStairsRightSideAny(metatileBehavior)) + // facing sideways stairs right side -> check northwest + objectEventId = GetObjectEventIdByPosition(currX - 1, currY - 1, position->elevation); + else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currBehavior)) + // on top of left-side stairs -> check southwest + objectEventId = GetObjectEventIdByPosition(currX - 1, currY + 1, position->elevation); + else + // check in front of player + objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation); + break; + default: + objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation); + break; + } + if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER) { if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE) @@ -344,6 +398,9 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position if (bgEvent->bgUnion.script == NULL) return EventScript_TestSignpostMsg; + if (GetFacingSignpostType(metatileBehavior, direction) != NOT_SIGNPOST) + SetMsgSignPostAndVarFacing(direction); + switch (bgEvent->kind) { case BG_EVENT_PLAYER_FACING_ANY: @@ -726,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; } @@ -1053,3 +1132,113 @@ int SetCableClubWarp(void) SetupWarp(&gMapHeader, GetWarpEventAtMapPosition(&gMapHeader, &position), &position); return 0; } + +static bool32 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u32 metatileBehavior, u32 playerDirection) +{ + const u8 *script; + + if ((JOY_HELD(DPAD_LEFT | DPAD_RIGHT)) || (playerDirection != DIR_NORTH)) + return FALSE; + + switch (GetFacingSignpostType(metatileBehavior, playerDirection)) + { + case MB_POKEMON_CENTER_SIGN: + SetUpWalkIntoSignScript(Common_EventScript_ShowPokemonCenterSign, playerDirection); + return TRUE; + case MB_POKEMART_SIGN: + SetUpWalkIntoSignScript(Common_EventScript_ShowPokemartSign, playerDirection); + return TRUE; + case MB_SIGNPOST: + script = GetSignpostScriptAtMapPosition(position); + if (script == NULL) + return FALSE; + SetUpWalkIntoSignScript(script, playerDirection); + return TRUE; + default: + return FALSE; + } +} + +static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection) +{ + if (MetatileBehavior_IsPokemonCenterSign(metatileBehavior) == TRUE) + return MB_POKEMON_CENTER_SIGN; + if (MetatileBehavior_IsPokeMartSign(metatileBehavior) == TRUE) + return MB_POKEMART_SIGN; + if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) + return MB_SIGNPOST; + + return NOT_SIGNPOST; +} + +static void SetMsgSignPostAndVarFacing(u32 playerDirection) +{ + gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; + gMsgBoxIsCancelable = TRUE; + gMsgIsSignPost = TRUE; + gSpecialVar_Facing = playerDirection; +} + +static void SetUpWalkIntoSignScript(const u8 *script, u32 playerDirection) +{ + ScriptContext_SetupScript(script); + SetMsgSignPostAndVarFacing(playerDirection); +} + +static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) +{ + const struct BgEvent *event = GetBackgroundEventAtPosition(&gMapHeader, position->x - 7, position->y - 7, position->elevation); + if (event == NULL) + return NULL; + if (event->bgUnion.script != NULL) + return event->bgUnion.script; + return EventScript_TestSignpostMsg; +} + +static void Task_OpenStartMenu(u8 taskId) +{ + if (ArePlayerFieldControlsLocked()) + return; + + PlaySE(SE_WIN_OPEN); + ShowStartMenu(); + DestroyTask(taskId); +} + +bool32 IsDpadPushedToTurnOrMovePlayer(struct FieldInput *input) +{ + return (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection); +} + +void CancelSignPostMessageBox(struct FieldInput *input) +{ + if (!ScriptContext_IsEnabled()) + return; + + if (gWalkAwayFromSignpostTimer) + { + gWalkAwayFromSignpostTimer--; + return; + } + + if (!gMsgBoxIsCancelable) + return; + + if (IsDpadPushedToTurnOrMovePlayer(input)) + { + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); + return; + } + + if (!input->pressedStartButton) + return; + + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); + + if (FuncIsActiveTask(Task_OpenStartMenu)) + return; + + CreateTask(Task_OpenStartMenu, 8); +} diff --git a/src/field_message_box.c b/src/field_message_box.c index b797e1d353..47c728f74d 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -5,8 +5,11 @@ #include "text.h" #include "match_call.h" #include "field_message_box.h" +#include "text_window.h" +#include "script.h" static EWRAM_DATA u8 sFieldMessageBoxMode = 0; +EWRAM_DATA u8 gWalkAwayFromSignpostTimer = 0; static void ExpandStringAndStartDrawFieldMessage(const u8 *, bool32); static void StartDrawFieldMessage(void); @@ -29,7 +32,12 @@ static void Task_DrawFieldMessage(u8 taskId) switch (task->tState) { case 0: - LoadMessageBoxAndBorderGfx(); + if (gMsgIsSignPost) + LoadSignPostWindowFrameGfx(); + else + LoadMessageBoxAndBorderGfx(); + task->tState++; + break; task->tState++; break; case 1: diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 0b30a1d7bb..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" @@ -92,6 +93,8 @@ static bool8 PlayerAnimIsMultiFrameStationaryAndStateNotTurning(void); static bool8 PlayerIsAnimActive(void); static bool8 PlayerCheckIfAnimFinishedOrInactive(void); +static void PlayerWalkSlow(u8 direction); +static void PlayerRunSlow(u8 direction); static void PlayerRun(u8); static void PlayerNotOnBikeCollide(u8); static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8); @@ -456,7 +459,22 @@ static bool8 ForcedMovement_None(void) static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8)) { struct PlayerAvatar *playerAvatar = &gPlayerAvatar; - u8 collision = CheckForPlayerAvatarCollision(direction); + u8 collision; + + // Check for sideways stairs onto ice movement. + switch (direction) + { + case DIR_NORTHWEST: + case DIR_SOUTHWEST: + direction = DIR_WEST; + break; + case DIR_NORTHEAST: + case DIR_SOUTHEAST: + direction = DIR_EAST; + break; + } + + collision = CheckForPlayerAvatarCollision(direction); playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE; if (collision) @@ -634,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; @@ -653,13 +675,20 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_UNDERWATER) && (heldKeys & B_BUTTON) && FlagGet(FLAG_SYS_B_DASH) && IsRunningDisallowed(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) == 0) { - PlayerRun(direction); + if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction)) + PlayerRunSlow(direction); + else + PlayerRun(direction); + gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH; return; } else { - PlayerWalkNormal(direction); + if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction)) + PlayerWalkSlow(direction); + else + PlayerWalkNormal(direction); } } @@ -670,6 +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)); } @@ -688,6 +720,7 @@ static u8 CheckForPlayerAvatarStaticCollision(u8 direction) u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior) { u8 collision = GetCollisionAtCoords(objectEvent, x, y, direction); + if (collision == COLLISION_ELEVATION_MISMATCH && CanStopSurfing(x, y, direction)) return COLLISION_STOP_SURFING; @@ -705,6 +738,7 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u return COLLISION_ROTATING_GATE; CheckAcroBikeCollision(x, y, metatileBehavior, &collision); } + return collision; } @@ -967,6 +1001,17 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement) } } +// slow +static void PlayerWalkSlow(u8 direction) +{ + PlayerSetAnimId(GetWalkSlowMovementAction(direction), 2); +} +static void PlayerRunSlow(u8 direction) +{ + PlayerSetAnimId(GetPlayerRunSlowMovementAction(direction), 2); +} + +// normal speed (1 speed) void PlayerWalkNormal(u8 direction) { PlayerSetAnimId(GetWalkNormalMovementAction(direction), COPY_MOVE_WALK); @@ -1628,7 +1673,7 @@ static void CreateStopSurfingTask(u8 direction) LockPlayerFieldControls(); Overworld_ClearSavedMusic(); Overworld_ChangeMusicToDefault(); - gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_SURFING; + gPlayerAvatar.flags ^= PLAYER_AVATAR_FLAG_SURFING; gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_ON_FOOT; gPlayerAvatar.preventStep = TRUE; taskId = CreateTask(Task_StopSurfingInit, 0xFF); @@ -2422,3 +2467,69 @@ static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *delayTimer) *delayTimer = 0; return sSpinDirections[object->facingDirection]; } + +//sideways stairs +u8 GetRightSideStairsDirection(u8 direction) +{ + switch (direction) + { + case DIR_WEST: + return DIR_NORTHWEST; + case DIR_EAST: + return DIR_SOUTHEAST; + default: + if (direction > DIR_EAST) + direction -= DIR_EAST; + return direction; + } +} + +u8 GetLeftSideStairsDirection(u8 direction) +{ + switch (direction) + { + case DIR_WEST: + return DIR_SOUTHWEST; + case DIR_EAST: + return DIR_NORTHEAST; + default: + if (direction > DIR_EAST) + direction -= DIR_EAST; + return direction; + } +} + +bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction) +{ + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + s16 x = objectEvent->currentCoords.x; + s16 y = objectEvent->currentCoords.y; + + // TODO followers on sideways stairs + if (IsFollowerVisible() && GetFollowerObject() != NULL && (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER)) + return FALSE; + + switch (direction) + { + case DIR_NORTH: + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x,y)); + case DIR_SOUTH: + MoveCoords(DIR_SOUTH, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x,y)); + case DIR_WEST: + case DIR_EAST: + case DIR_NORTHEAST: + case DIR_NORTHWEST: + case DIR_SOUTHWEST: + case DIR_SOUTHEAST: + // directionOverwrite is only used for sideways stairs motion + if (objectEvent->directionOverwrite) + return TRUE; + default: + return FALSE; + } + #else + return FALSE; + #endif +} + diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index fa4a4e8276..6642e474e0 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); } @@ -1390,3 +1402,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/field_specials.c b/src/field_specials.c index a31b02dd48..3c47a414c9 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4278,3 +4278,10 @@ void PreparePartyForSkyBattle(void) VarSet(B_VAR_SKY_BATTLE,participatingPokemonSlot); CompactPartySlots(); } + +void UseBlankMessageToCancelPokemonPic(void) +{ + u8 t = EOS; + AddTextPrinterParameterized(0, FONT_NORMAL, &t, 0, 1, 0, NULL); + ScriptMenu_HidePokemonPic(); +} diff --git a/src/frontier_util.c b/src/frontier_util.c index b9d4f29e32..4424676644 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -94,71 +94,155 @@ static void ShowPyramidResultsWindow(void); static void ShowLinkContestResultsWindow(void); static void CopyFrontierBrainText(bool8 playerWonText); -#define FRONTIER_BRAIN_SPRITES(Brain) \ - .trainerId = TRAINER_##Brain, \ - .objEventGfx = OBJ_EVENT_GFX_##Brain - -#define FRONTIER_BRAIN_TEXTS(Brain) \ - .lostTexts = {gText_##Brain##DefeatSilver, gText_##Brain##DefeatGold}, \ - .wonTexts = {gText_##Brain##WonSilver, gText_##Brain##WonGold} - // battledBit: Flags to change the conversation when the Frontier Brain is encountered for a battle // First bit is has battled them before and not won yet, second bit is has battled them and won (obtained a Symbol) const struct FrontierBrain gFrontierBrainInfo[NUM_FRONTIER_FACILITIES] = { [FRONTIER_FACILITY_TOWER] = { - FRONTIER_BRAIN_SPRITES(ANABEL), + .trainerId = TRAINER_ANABEL, + .objEventGfx = OBJ_EVENT_GFX_ANABEL, .isFemale = TRUE, - FRONTIER_BRAIN_TEXTS(Anabel), + .lostTexts = { + COMPOUND_STRING("Okay, I understand…"), //Silver + COMPOUND_STRING("Thank you…") //Gold + }, + .wonTexts = { + COMPOUND_STRING("It's very disappointing…"), //Silver + COMPOUND_STRING("I'm terribly sorry…") //Gold + }, .battledBit = {1 << 0, 1 << 1}, .streakAppearances = {35, 70, 35, 1}, }, [FRONTIER_FACILITY_DOME] = { - FRONTIER_BRAIN_SPRITES(TUCKER), + .trainerId = TRAINER_TUCKER, + .objEventGfx = OBJ_EVENT_GFX_TUCKER, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Tucker), + .lostTexts = { + COMPOUND_STRING( + "Grr…\n" + "What the…"), //Silver + COMPOUND_STRING( + "Ahahaha!\n" + "You're inspiring!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Ahahaha! Aren't you embarrassed?\n" + "Everyone's watching!"), //Silver + COMPOUND_STRING("My DOME ACE title isn't just for show!") //Gold + }, .battledBit = {1 << 2, 1 << 3}, .streakAppearances = {1, 2, 5, 0}, }, [FRONTIER_FACILITY_PALACE] = { - FRONTIER_BRAIN_SPRITES(SPENSER), + .trainerId = TRAINER_SPENSER, + .objEventGfx = OBJ_EVENT_GFX_SPENSER, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Spenser), + .lostTexts = { + COMPOUND_STRING( + "Ah…\n" + "Now this is something else…"), //Silver + COMPOUND_STRING( + "Gwah!\n" + "Hahahaha!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Your POKéMON are wimpy because\n" + "you're wimpy as a TRAINER!"), //Silver + COMPOUND_STRING( + "Gwahahaha!\n" + "My brethren, we have nothing to fear!") //Gold + }, .battledBit = {1 << 4, 1 << 5}, .streakAppearances = {21, 42, 21, 1}, }, [FRONTIER_FACILITY_ARENA] = { - FRONTIER_BRAIN_SPRITES(GRETA), + .trainerId = TRAINER_GRETA, + .objEventGfx = OBJ_EVENT_GFX_GRETA, .isFemale = TRUE, - FRONTIER_BRAIN_TEXTS(Greta), + .lostTexts = { + COMPOUND_STRING( + "No way!\n" + "Good job!"), //Silver + COMPOUND_STRING( + "Huh?\n" + "Are you serious?!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Oh, come on!\n" + "You have to try harder than that!"), //Silver + COMPOUND_STRING( + "Heheh!\n" + "What did you expect?") //Gold + }, .battledBit = {1 << 6, 1 << 7}, .streakAppearances = {28, 56, 28, 1}, }, [FRONTIER_FACILITY_FACTORY] = { - FRONTIER_BRAIN_SPRITES(NOLAND), + .trainerId = TRAINER_NOLAND, + .objEventGfx = OBJ_EVENT_GFX_NOLAND, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Noland), + .lostTexts = { + COMPOUND_STRING( + "Good job!\n" + "You know what you're doing!"), //Silver + COMPOUND_STRING("What happened here?") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Way to work!\n" + "That was a good lesson, eh?"), //Silver + COMPOUND_STRING( + "Hey, hey, hey!\n" + "You're finished already?") //Gold + }, .battledBit = {1 << 8, 1 << 9}, .streakAppearances = {21, 42, 21, 1}, }, [FRONTIER_FACILITY_PIKE] = { - FRONTIER_BRAIN_SPRITES(LUCY), + .trainerId = TRAINER_LUCY, + .objEventGfx = OBJ_EVENT_GFX_LUCY, .isFemale = TRUE, - FRONTIER_BRAIN_TEXTS(Lucy), + .lostTexts = { + COMPOUND_STRING("Urk…"), //Silver + COMPOUND_STRING("Darn!") //Gold + }, + .wonTexts = { + COMPOUND_STRING("Humph…"), //Silver + COMPOUND_STRING("Hah!") //Gold + }, .battledBit = {1 << 10, 1 << 11}, .streakAppearances = {28, 140, 56, 1}, }, [FRONTIER_FACILITY_PYRAMID] = { - FRONTIER_BRAIN_SPRITES(BRANDON), + .trainerId = TRAINER_BRANDON, + .objEventGfx = OBJ_EVENT_GFX_BRANDON, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Brandon), + .lostTexts = { + COMPOUND_STRING( + "That's it! You've done great!\n" + "You've worked hard for this!"), //Silver + COMPOUND_STRING( + "That's it! You've done it!\n" + "You kept working for this!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Hey! What's wrong with you!\n" + "Let's see some effort! Get up!"), //Silver + COMPOUND_STRING( + "Hey! Don't you give up now!\n" + "Get up! Don't lose faith in yourself!") //Gold + }, .battledBit = {1 << 12, 1 << 13}, .streakAppearances = {21, 70, 35, 0}, }, diff --git a/src/graphics.c b/src/graphics.c index d0c664d394..3bb97835d2 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2026,6 +2026,7 @@ const u16 gTradeMenuMonBox_Tilemap[] = INCBIN_U16("graphics/trade/menu_mon_box.b const u16 gMessageBox_Pal[] = INCBIN_U16("graphics/text_window/message_box.gbapal"); const u8 gMessageBox_Gfx[] = INCBIN_U8("graphics/text_window/message_box.4bpp"); +const u8 gSignpostWindow_Gfx[] = INCBIN_U8("graphics/text_window/signpost.4bpp"); const u32 gWallpaperIcon_Cross[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/cross.4bpp.lz"); const u32 gWallpaperIcon_Bolt[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/bolt.4bpp.lz"); 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 3af55ee4cd..fe10073fc8 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -633,7 +633,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/menu.c b/src/menu.c index ff1970c3f1..d9b331a8b2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -17,18 +17,13 @@ #include "sound.h" #include "string_util.h" #include "strings.h" +#include "script.h" #include "task.h" #include "text_window.h" #include "window.h" #include "config/overworld.h" #include "constants/songs.h" -#define DLG_WINDOW_PALETTE_NUM 15 -#define DLG_WINDOW_BASE_TILE_NUM 0x200 -#define STD_WINDOW_PALETTE_NUM 14 -#define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) -#define STD_WINDOW_BASE_TILE_NUM 0x214 - struct MenuInfoIcon { u8 width; @@ -54,6 +49,8 @@ struct Menu static u16 AddWindowParameterized(u8, u8, u8, u8, u8, u8, u16); static void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8); +static void WindowFunc_DrawSignFrame(u8, u8, u8, u8, u8, u8); +static inline void *GetWindowFunc_DialogueFrame(void); static void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8); @@ -220,9 +217,123 @@ void LoadMessageBoxAndBorderGfx(void) LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); } +void LoadSignPostWindowFrameGfx(void) +{ + Menu_LoadStdPal(); + LoadSignBoxGfx(0, DLG_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM)); + LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); +} + +static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +{ + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 0, + tilemapLeft - 2, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 1, + tilemapLeft - 1, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 2, + tilemapLeft - 2, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 3, + tilemapLeft - 1, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft - 2, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft - 1, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 4, + tilemapLeft, + tilemapTop - 1, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft + 27, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft + 26, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 2), + tilemapLeft + 27, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3), + tilemapLeft + 26, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), + tilemapLeft + 27, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1)), + tilemapLeft + 26, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), + tilemapLeft, + tilemapTop + 4, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); +} + +static inline void *GetWindowFunc_DialogueFrame(void) +{ + return (gMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); +} + void DrawDialogueFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, WindowFunc_DrawDialogueFrame); + CallWindowFunction(windowId, GetWindowFunc_DialogueFrame()); FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 924428aea4..98914ae5e8 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -8,123 +8,131 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = { - [MB_NORMAL] = TILE_FLAG_UNUSED, - [MB_TALL_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_LONG_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS, - [MB_DEEP_SAND] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_SHORT_GRASS] = TILE_FLAG_UNUSED, - [MB_CAVE] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_UNUSED, - [MB_NO_RUNNING] = TILE_FLAG_UNUSED, - [MB_INDOOR_ENCOUNTER] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_MOUNTAIN_TOP] = TILE_FLAG_UNUSED, - [MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_UNUSED, - [MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_UNUSED, - [MB_MT_PYRE_HOLE] = TILE_FLAG_UNUSED, - [MB_POND_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_INTERIOR_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_WATERFALL] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_OCEAN_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_PUDDLE] = TILE_FLAG_UNUSED, - [MB_SHALLOW_WATER] = TILE_FLAG_UNUSED, - [MB_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_UNUSED, - [MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_UNUSED, - [MB_ICE] = TILE_FLAG_UNUSED, - [MB_SAND] = TILE_FLAG_UNUSED, - [MB_SEAWEED] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_UNUSED_23] = TILE_FLAG_UNUSED, - [MB_ASHGRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_FOOTPRINTS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_THIN_ICE] = TILE_FLAG_UNUSED, - [MB_CRACKED_ICE] = TILE_FLAG_UNUSED, - [MB_HOT_SPRINGS] = TILE_FLAG_UNUSED, - [MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_UNUSED, - [MB_SEAWEED_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_EAST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_WEST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_NORTH] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTH] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_UNUSED, - [MB_JUMP_NORTHEAST] = TILE_FLAG_UNUSED, - [MB_JUMP_NORTHWEST] = TILE_FLAG_UNUSED, - [MB_JUMP_SOUTHEAST] = TILE_FLAG_UNUSED, - [MB_JUMP_SOUTHWEST] = TILE_FLAG_UNUSED, - [MB_WALK_EAST] = TILE_FLAG_UNUSED, - [MB_WALK_WEST] = TILE_FLAG_UNUSED, - [MB_WALK_NORTH] = TILE_FLAG_UNUSED, - [MB_WALK_SOUTH] = TILE_FLAG_UNUSED, - [MB_SLIDE_EAST] = TILE_FLAG_UNUSED, - [MB_SLIDE_WEST] = TILE_FLAG_UNUSED, - [MB_SLIDE_NORTH] = TILE_FLAG_UNUSED, - [MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED, - [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED, - [MB_UNUSED_49] = TILE_FLAG_UNUSED, - [MB_UNUSED_4A] = TILE_FLAG_UNUSED, - [MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_SOUTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_NON_ANIMATED_DOOR] = TILE_FLAG_UNUSED, - [MB_LADDER] = TILE_FLAG_UNUSED, - [MB_EAST_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_WEST_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_NORTH_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_UNUSED, - [MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_UNUSED, - [MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_UNUSED, - [MB_ANIMATED_DOOR] = TILE_FLAG_UNUSED, - [MB_UP_ESCALATOR] = TILE_FLAG_UNUSED, - [MB_DOWN_ESCALATOR] = TILE_FLAG_UNUSED, - [MB_WATER_DOOR] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_DEEP_SOUTH_WARP] = TILE_FLAG_UNUSED, - [MB_UNUSED_6F] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_UNUSED, - [MB_FORTREE_BRIDGE] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_UNUSED, - [MB_UNUSED_BRIDGE] = TILE_FLAG_UNUSED, - [MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_SCENERY] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_UNUSED, - [MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_BALLOON] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_HOLE] = TILE_FLAG_UNUSED, - [MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_UNUSED, - [MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_UNUSED, - [MB_MUDDY_SLOPE] = TILE_FLAG_UNUSED, - [MB_BUMPY_SLOPE] = TILE_FLAG_UNUSED, - [MB_CRACKED_FLOOR] = TILE_FLAG_UNUSED, - [MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_UNUSED, - [MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, - [MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED, - [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, + [MB_NORMAL] = TILE_FLAG_UNUSED, + [MB_TALL_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_LONG_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS, + [MB_DEEP_SAND] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_SHORT_GRASS] = TILE_FLAG_UNUSED, + [MB_CAVE] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_UNUSED, + [MB_NO_RUNNING] = TILE_FLAG_UNUSED, + [MB_INDOOR_ENCOUNTER] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_MOUNTAIN_TOP] = TILE_FLAG_UNUSED, + [MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_UNUSED, + [MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_UNUSED, + [MB_MT_PYRE_HOLE] = TILE_FLAG_UNUSED, + [MB_POND_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_INTERIOR_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_WATERFALL] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_OCEAN_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_PUDDLE] = TILE_FLAG_UNUSED, + [MB_SHALLOW_WATER] = TILE_FLAG_UNUSED, + [MB_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_UNUSED, + [MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_UNUSED, + [MB_ICE] = TILE_FLAG_UNUSED, + [MB_SAND] = TILE_FLAG_UNUSED, + [MB_SEAWEED] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_UNUSED_23] = TILE_FLAG_UNUSED, + [MB_ASHGRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_FOOTPRINTS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_THIN_ICE] = TILE_FLAG_UNUSED, + [MB_CRACKED_ICE] = TILE_FLAG_UNUSED, + [MB_HOT_SPRINGS] = TILE_FLAG_UNUSED, + [MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_UNUSED, + [MB_SEAWEED_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_EAST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_WEST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_NORTH] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTH] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_UNUSED, + [MB_JUMP_NORTHEAST] = TILE_FLAG_UNUSED, + [MB_JUMP_NORTHWEST] = TILE_FLAG_UNUSED, + [MB_JUMP_SOUTHEAST] = TILE_FLAG_UNUSED, + [MB_JUMP_SOUTHWEST] = TILE_FLAG_UNUSED, + [MB_WALK_EAST] = TILE_FLAG_UNUSED, + [MB_WALK_WEST] = TILE_FLAG_UNUSED, + [MB_WALK_NORTH] = TILE_FLAG_UNUSED, + [MB_WALK_SOUTH] = TILE_FLAG_UNUSED, + [MB_SLIDE_EAST] = TILE_FLAG_UNUSED, + [MB_SLIDE_WEST] = TILE_FLAG_UNUSED, + [MB_SLIDE_NORTH] = TILE_FLAG_UNUSED, + [MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED, + [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED, + [MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_SOUTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_NON_ANIMATED_DOOR] = TILE_FLAG_UNUSED, + [MB_LADDER] = TILE_FLAG_UNUSED, + [MB_EAST_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_WEST_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_NORTH_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_UNUSED, + [MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_UNUSED, + [MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_UNUSED, + [MB_ANIMATED_DOOR] = TILE_FLAG_UNUSED, + [MB_UP_ESCALATOR] = TILE_FLAG_UNUSED, + [MB_DOWN_ESCALATOR] = TILE_FLAG_UNUSED, + [MB_WATER_DOOR] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_DEEP_SOUTH_WARP] = TILE_FLAG_UNUSED, + [MB_UNUSED_6F] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_UNUSED, + [MB_FORTREE_BRIDGE] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_UNUSED, + [MB_UNUSED_BRIDGE] = TILE_FLAG_UNUSED, + [MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_SCENERY] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_UNUSED, + [MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_BALLOON] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_HOLE] = TILE_FLAG_UNUSED, + [MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_UNUSED, + [MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_UNUSED, + [MB_MUDDY_SLOPE] = TILE_FLAG_UNUSED, + [MB_BUMPY_SLOPE] = TILE_FLAG_UNUSED, + [MB_CRACKED_FLOOR] = TILE_FLAG_UNUSED, + [MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_UNUSED, + [MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, + [MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED, + [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, + [MB_SIGNPOST] = TILE_FLAG_UNUSED, + [MB_POKEMON_CENTER_SIGN] = TILE_FLAG_UNUSED, + [MB_POKEMART_SIGN] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_LEFT_SIDE] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM] = TILE_FLAG_UNUSED, + [MB_ROCK_STAIRS] = TILE_FLAG_UNUSED, }; bool8 MetatileBehavior_IsATile(u8 metatileBehavior) @@ -1400,3 +1408,137 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) else return FALSE; } + +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); +} + +bool8 MetatileBehavior_IsPokemonCenterSign(u32 metatileBehavior) +{ + return (metatileBehavior == MB_POKEMON_CENTER_SIGN); +} + +bool8 MetatileBehavior_IsPokeMartSign(u32 metatileBehavior) +{ + return (metatileBehavior == MB_POKEMART_SIGN); +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSideTop(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSideTop(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSideBottom(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSideBottom(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE + || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM + || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE + || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM + || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior) +{ + if (metatileBehavior == MB_ROCK_STAIRS) + return TRUE; + else + return FALSE; +} diff --git a/src/overworld.c b/src/overworld.c index dc802c95bc..afc3c76e8e 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -212,6 +212,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 = { @@ -1008,6 +1009,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; @@ -1508,6 +1513,7 @@ static void DoCB1_Overworld(u16 newKeys, u16 heldKeys) UpdatePlayerAvatarTransitionState(); FieldClearPlayerInput(&inputStruct); FieldGetPlayerInput(&inputStruct, newKeys, heldKeys); + CancelSignPostMessageBox(&inputStruct); if (!ArePlayerFieldControlsLocked()) { if (ProcessPlayerFieldInput(&inputStruct) == 1) @@ -1975,6 +1981,7 @@ void CB2_ContinueSavedGame(void) PlayTimeCounter_Start(); ScriptContext_Init(); UnlockPlayerFieldControls(); + gExitStairsMovementDisabled = TRUE; InitMatchCallCounters(); if (UseContinueGameWarp() == TRUE) { @@ -2060,6 +2067,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/pokeball.c b/src/pokeball.c index 914455af5a..21557d973a 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1571,12 +1571,8 @@ void FreeBallGfx(u8 ballId) static u16 GetBattlerPokeballItemId(u8 battlerId) { - struct Pokemon *mon, *illusionMon; - - if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; + struct Pokemon *illusionMon; + struct Pokemon *mon = GetPartyBattlerData(battlerId); illusionMon = GetIllusionMonPtr(battlerId); if (illusionMon != NULL) diff --git a/src/pokeblock.c b/src/pokeblock.c index e01e821f7e..b68fe16ce3 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -130,6 +130,11 @@ static void ReturnToPokeblockCaseOnField(void); static void CreateTossPokeblockYesNoMenu(u8); static void TossPokeblock(u8); +static const u8 sText_StowCase[] = _("Stow CASE."); +static const u8 sText_LvVar1[] = _("{LV}{STR_VAR_1}"); +static const u8 sText_ThrowAwayVar1[] = _("Throw away this\n{STR_VAR_1}?"); +static const u8 sText_Var1ThrownAway[] = _("The {STR_VAR_1}\nwas thrown away."); + EWRAM_DATA static struct PokeblockSavedData sSavedPokeblockData = {0}; EWRAM_DATA static struct PokeblockMenuStruct *sPokeblockMenu = NULL; @@ -197,20 +202,20 @@ static const struct BgTemplate sBgTemplatesForPokeblockMenu[] = const u8 *const gPokeblockNames[] = { [PBLOCK_CLR_NONE] = NULL, - [PBLOCK_CLR_RED] = gText_RedPokeblock, - [PBLOCK_CLR_BLUE] = gText_BluePokeblock, - [PBLOCK_CLR_PINK] = gText_PinkPokeblock, - [PBLOCK_CLR_GREEN] = gText_GreenPokeblock, - [PBLOCK_CLR_YELLOW] = gText_YellowPokeblock, - [PBLOCK_CLR_PURPLE] = gText_PurplePokeblock, - [PBLOCK_CLR_INDIGO] = gText_IndigoPokeblock, - [PBLOCK_CLR_BROWN] = gText_BrownPokeblock, - [PBLOCK_CLR_LITE_BLUE] = gText_LiteBluePokeblock, - [PBLOCK_CLR_OLIVE] = gText_OlivePokeblock, - [PBLOCK_CLR_GRAY] = gText_GrayPokeblock, - [PBLOCK_CLR_BLACK] = gText_BlackPokeblock, - [PBLOCK_CLR_WHITE] = gText_WhitePokeblock, - [PBLOCK_CLR_GOLD] = gText_GoldPokeblock + [PBLOCK_CLR_RED] = COMPOUND_STRING("RED {POKEBLOCK}"), + [PBLOCK_CLR_BLUE] = COMPOUND_STRING("BLUE {POKEBLOCK}"), + [PBLOCK_CLR_PINK] = COMPOUND_STRING("PINK {POKEBLOCK}"), + [PBLOCK_CLR_GREEN] = COMPOUND_STRING("GREEN {POKEBLOCK}"), + [PBLOCK_CLR_YELLOW] = COMPOUND_STRING("YELLOW {POKEBLOCK}"), + [PBLOCK_CLR_PURPLE] = COMPOUND_STRING("PURPLE {POKEBLOCK}"), + [PBLOCK_CLR_INDIGO] = COMPOUND_STRING("INDIGO {POKEBLOCK}"), + [PBLOCK_CLR_BROWN] = COMPOUND_STRING("BROWN {POKEBLOCK}"), + [PBLOCK_CLR_LITE_BLUE] = COMPOUND_STRING("LITEBLUE {POKEBLOCK}"), + [PBLOCK_CLR_OLIVE] = COMPOUND_STRING("OLIVE {POKEBLOCK}"), + [PBLOCK_CLR_GRAY] = COMPOUND_STRING("GRAY {POKEBLOCK}"), + [PBLOCK_CLR_BLACK] = COMPOUND_STRING("BLACK {POKEBLOCK}"), + [PBLOCK_CLR_WHITE] = COMPOUND_STRING("WHITE {POKEBLOCK}"), + [PBLOCK_CLR_GOLD] = COMPOUND_STRING("GOLD {POKEBLOCK}") }; static const struct MenuAction sPokeblockMenuActions[] = @@ -702,11 +707,11 @@ static void DrawPokeblockMenuTitleText(void) const u8 *itemName = ItemId_GetName(ITEM_POKEBLOCK_CASE); PrintOnPokeblockWindow(WIN_TITLE, itemName, GetStringCenterAlignXOffset(FONT_NORMAL, itemName, 0x48)); - PrintOnPokeblockWindow(WIN_SPICY, gText_Spicy, 0); - PrintOnPokeblockWindow(WIN_DRY, gText_Dry, 0); - PrintOnPokeblockWindow(WIN_SWEET, gText_Sweet, 0); - PrintOnPokeblockWindow(WIN_BITTER, gText_Bitter, 0); - PrintOnPokeblockWindow(WIN_SOUR, gText_Sour, 0); + PrintOnPokeblockWindow(WIN_SPICY, COMPOUND_STRING("SPICY"), 0); + PrintOnPokeblockWindow(WIN_DRY, COMPOUND_STRING("DRY"), 0); + PrintOnPokeblockWindow(WIN_SWEET, COMPOUND_STRING("SWEET"), 0); + PrintOnPokeblockWindow(WIN_BITTER, COMPOUND_STRING("BITTER"), 0); + PrintOnPokeblockWindow(WIN_SOUR, COMPOUND_STRING("SOUR"), 0); for (i = 0; i < WIN_ACTIONS_TALL; i++) PutWindowTilemap(i); @@ -723,7 +728,7 @@ static void UpdatePokeblockList(void) sPokeblockMenu->items[i].id = i; } - StringCopy(sPokeblockMenu->menuItemsStrings[i], gText_StowCase); + StringCopy(sPokeblockMenu->menuItemsStrings[i], sText_StowCase); sPokeblockMenu->items[i].name = sPokeblockMenu->menuItemsStrings[i]; sPokeblockMenu->items[i].id = LIST_CANCEL; @@ -744,7 +749,7 @@ static void PutPokeblockListMenuString(u8 *dst, u16 pkblId) *(txtPtr++) = CHAR_BLOCK_1; ConvertIntToDecimalStringN(gStringVar1, GetHighestPokeblocksFlavorLevel(pkblock), STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(txtPtr, gText_LvVar1); + StringExpandPlaceholders(txtPtr, sText_LvVar1); } static void MovePokeblockMenuCursor(s32 pkblId, bool8 onInit, struct ListMenu *list) @@ -1203,7 +1208,7 @@ static void PokeblockAction_Toss(u8 taskId) ClearStdWindowAndFrameToTransparent(tWindowId, FALSE); StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1Ptr->pokeblocks[gSpecialVar_ItemId].color]); - StringExpandPlaceholders(gStringVar4, gText_ThrowAwayVar1); + StringExpandPlaceholders(gStringVar4, sText_ThrowAwayVar1); DisplayMessageAndContinueTask(taskId, WIN_TOSS_MSG, 10, 13, FONT_NORMAL, GetPlayerTextSpeedDelay(), gStringVar4, CreateTossPokeblockYesNoMenu); } @@ -1214,7 +1219,7 @@ static void CreateTossPokeblockYesNoMenu(u8 taskId) static void TossedPokeblockMessage(u8 taskId) { - StringExpandPlaceholders(gStringVar4, gText_Var1ThrownAway); + StringExpandPlaceholders(gStringVar4, sText_Var1ThrownAway); DisplayMessageAndContinueTask(taskId, WIN_TOSS_MSG, 10, 13, FONT_NORMAL, GetPlayerTextSpeedDelay(), gStringVar4, TossPokeblock); } diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index f31896a4cb..f79f35a781 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -96,6 +96,10 @@ static u8 CreatePokeblockCaseSpriteForFeeding(void); static u8 CreateMonSprite(struct Pokemon *); static void SpriteCB_ThrownPokeblock(struct Sprite *); +static const u8 sText_Var1AteTheVar2[] = _("{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_Var1HappilyAteVar2[] = _("{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_Var1DisdainfullyAteVar2[] = _("{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); + EWRAM_DATA static struct PokeblockFeed *sPokeblockFeed = NULL; EWRAM_DATA static struct CompressedSpritePalette sPokeblockSpritePal = {0}; @@ -792,11 +796,11 @@ static void Task_PrintAtePokeblockMessage(u8 taskId) PokeblockCopyName(pokeblock, gStringVar2); if (gPokeblockGain == 0) - StringExpandPlaceholders(gStringVar4, gText_Var1AteTheVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1AteTheVar2); else if (gPokeblockGain > 0) - StringExpandPlaceholders(gStringVar4, gText_Var1HappilyAteVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1HappilyAteVar2); else - StringExpandPlaceholders(gStringVar4, gText_Var1DisdainfullyAteVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1DisdainfullyAteVar2); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); diff --git a/src/pokemon.c b/src/pokemon.c index d76d1df58c..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 @@ -1800,29 +1799,19 @@ void CalculateMonStats(struct Pokemon *mon) CALC_STAT(baseSpAttack, spAttackIV, spAttackEV, STAT_SPATK, MON_DATA_SPATK) CALC_STAT(baseSpDefense, spDefenseIV, spDefenseEV, STAT_SPDEF, MON_DATA_SPDEF) - if (species == SPECIES_SHEDINJA) - { - if (currentHP != 0 || oldMaxHP == 0) - currentHP = 1; - else - return; - } - else - { - if (currentHP == 0 && oldMaxHP == 0) - currentHP = newMaxHP; - else if (currentHP != 0) - { - if (newMaxHP > oldMaxHP) - currentHP += newMaxHP - oldMaxHP; - if (currentHP <= 0) - currentHP = 1; - if (currentHP > newMaxHP) - currentHP = newMaxHP; - } - else - return; - } + // Since a pokemon's maxHP data could either not have + // been initialized at this point or this pokemon is + // just fainted, the check for oldMaxHP is important. + if (currentHP == 0 && oldMaxHP != 0) + return; + + // Only add to currentHP if newMaxHP went up. + if (newMaxHP > oldMaxHP) + currentHP += newMaxHP - oldMaxHP; + + // Ensure currentHP does not surpass newMaxHP. + if (currentHP > newMaxHP) + currentHP = newMaxHP; SetMonData(mon, MON_DATA_HP, ¤tHP); } @@ -3889,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 @@ -4078,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/pokemon_storage_system.c b/src/pokemon_storage_system.c index 54fee9e77a..ef0c644c7d 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -8054,15 +8054,15 @@ static const u8 *const sMenuTexts[] = [MENU_CANCEL] = COMPOUND_STRING("CANCEL"), [MENU_STORE] = COMPOUND_STRING("STORE"), [MENU_WITHDRAW] = COMPOUND_STRING("WITHDRAW"), - [MENU_MOVE] = COMPOUND_STRING("SHIFT"), - [MENU_SHIFT] = COMPOUND_STRING("MOVE"), + [MENU_MOVE] = COMPOUND_STRING("MOVE"), + [MENU_SHIFT] = COMPOUND_STRING("SHIFT"), [MENU_PLACE] = COMPOUND_STRING("PLACE"), [MENU_SUMMARY] = COMPOUND_STRING("SUMMARY"), [MENU_RELEASE] = COMPOUND_STRING("RELEASE"), [MENU_MARK] = COMPOUND_STRING("MARK"), - [MENU_JUMP] = COMPOUND_STRING("NAME"), - [MENU_WALLPAPER] = COMPOUND_STRING("JUMP"), - [MENU_NAME] = COMPOUND_STRING("WALLPAPER"), + [MENU_JUMP] = COMPOUND_STRING("JUMP"), + [MENU_WALLPAPER] = COMPOUND_STRING("WALLPAPER"), + [MENU_NAME] = COMPOUND_STRING("NAME"), [MENU_TAKE] = COMPOUND_STRING("TAKE"), [MENU_GIVE] = gPCText_Give, [MENU_GIVE_2] = gPCText_Give, 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/src/scrcmd.c b/src/scrcmd.c index f2660be65b..05402c5192 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1019,6 +1019,8 @@ bool8 ScrCmd_applymovement(struct ScriptContext *ctx) ClearObjectEventMovement(objEvent, &gSprites[objEvent->spriteId]); gSprites[objEvent->spriteId].animCmdIndex = 0; // Reset start frame of animation } + + gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE; ScriptMovement_StartObjectMovementScript(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, movementScript); sMovingNpcId = localId; objEvent = GetFollowerObject(); @@ -1043,6 +1045,7 @@ bool8 ScrCmd_applymovementat(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); + gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE; ScriptMovement_StartObjectMovementScript(localId, mapNum, mapGroup, movementScript); sMovingNpcId = localId; return FALSE; @@ -1301,6 +1304,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); + gMsgBoxIsCancelable = FALSE; return FALSE; } @@ -1319,6 +1323,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); + gMsgBoxIsCancelable = FALSE; return FALSE; } diff --git a/src/script.c b/src/script.c index 718592691b..e6e2aa264d 100644 --- a/src/script.c +++ b/src/script.c @@ -5,6 +5,7 @@ #include "util.h" #include "constants/event_objects.h" #include "constants/map_scripts.h" +#include "field_message_box.h" #define RAM_SCRIPT_MAGIC 51 @@ -26,6 +27,8 @@ static u8 sGlobalScriptContextStatus; static struct ScriptContext sGlobalScriptContext; static struct ScriptContext sImmediateScriptContext; static bool8 sLockFieldControls; +EWRAM_DATA u8 gMsgIsSignPost = FALSE; +EWRAM_DATA u8 gMsgBoxIsCancelable = FALSE; extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTableEnd[]; diff --git a/src/strings.c b/src/strings.c index 6009dbf5e6..3f21f86c47 100644 --- a/src/strings.c +++ b/src/strings.c @@ -141,7 +141,6 @@ const u8 gText_Store[] = _("STORE"); const u8 gMenuText_Check[] = _("CHECK"); const u8 gText_None[] = _("NONE"); const u8 gMenuText_Deselect[] = _("DESELECT"); -const u8 gText_ThreeMarks[] = _("???"); const u8 gText_FiveMarks[] = _("?????"); const u8 gText_Slash[] = _("/"); const u8 gText_OneDash[] = _("-"); @@ -224,64 +223,19 @@ const u8 *const gPyramidBagMenu_ReturnToStrings[] = }; const u8 gText_ReturnToVar1[] = _("Return to\n{STR_VAR_1}."); -const u8 gText_ItemsPocket[] = _("ITEMS"); -const u8 gText_PokeBallsPocket[] = _("POKé BALLS"); -const u8 gText_TMHMPocket[] = _("TMs & HMs"); -const u8 gText_BerriesPocket[] = _("BERRIES"); -const u8 gText_KeyItemsPocket[] = _("KEY ITEMS"); const u8 *const gPocketNamesStringsTable[] = { - [ITEMS_POCKET] = gText_ItemsPocket, - [BALLS_POCKET] = gText_PokeBallsPocket, - [TMHM_POCKET] = gText_TMHMPocket, - [BERRIES_POCKET] = gText_BerriesPocket, - [KEYITEMS_POCKET] = gText_KeyItemsPocket + [ITEMS_POCKET] = COMPOUND_STRING("ITEMS"), + [BALLS_POCKET] = COMPOUND_STRING("POKé BALLS"), + [TMHM_POCKET] = COMPOUND_STRING("TMs & HMs"), + [BERRIES_POCKET] = COMPOUND_STRING("BERRIES"), + [KEYITEMS_POCKET] = COMPOUND_STRING("KEY ITEMS") }; const u8 gText_NumberItem_TMBerry[] = _("{NO}{STR_VAR_1}{CLEAR 0x07}{STR_VAR_2}"); const u8 gText_NumberItem_HM[] = _("{CLEAR_TO 0x11}{STR_VAR_1}{CLEAR 0x05}{STR_VAR_2}"); -const u8 gText_SizeSlash[] = _("SIZE /"); -const u8 gText_FirmSlash[] = _("FIRM /"); -const u8 gText_Var1DotVar2[] = _("{STR_VAR_1}.{STR_VAR_2}”"); -// Berry firmness strings -const u8 gBerryFirmnessString_VerySoft[] = _("Very soft"); -const u8 gBerryFirmnessString_Soft[] = _("Soft"); -const u8 gBerryFirmnessString_Hard[] = _("Hard"); -const u8 gBerryFirmnessString_VeryHard[] = _("Very hard"); -const u8 gBerryFirmnessString_SuperHard[] = _("Super hard"); - -const u8 gText_NumberVar1Var2[] = _("{NO}{STR_VAR_1} {STR_VAR_2}"); -const u8 gText_BerryTag[] = _("BERRY TAG"); -const u8 gText_RedPokeblock[] = _("RED {POKEBLOCK}"); -const u8 gText_BluePokeblock[] = _("BLUE {POKEBLOCK}"); -const u8 gText_PinkPokeblock[] = _("PINK {POKEBLOCK}"); -const u8 gText_GreenPokeblock[] = _("GREEN {POKEBLOCK}"); -const u8 gText_YellowPokeblock[] = _("YELLOW {POKEBLOCK}"); -const u8 gText_PurplePokeblock[] = _("PURPLE {POKEBLOCK}"); -const u8 gText_IndigoPokeblock[] = _("INDIGO {POKEBLOCK}"); -const u8 gText_BrownPokeblock[] = _("BROWN {POKEBLOCK}"); -const u8 gText_LiteBluePokeblock[] = _("LITEBLUE {POKEBLOCK}"); -const u8 gText_OlivePokeblock[] = _("OLIVE {POKEBLOCK}"); -const u8 gText_GrayPokeblock[] = _("GRAY {POKEBLOCK}"); -const u8 gText_BlackPokeblock[] = _("BLACK {POKEBLOCK}"); -const u8 gText_WhitePokeblock[] = _("WHITE {POKEBLOCK}"); -const u8 gText_GoldPokeblock[] = _("GOLD {POKEBLOCK}"); -const u8 gText_Spicy[] = _("SPICY"); -const u8 gText_Dry[] = _("DRY"); -const u8 gText_Sweet[] = _("SWEET"); -const u8 gText_Bitter[] = _("BITTER"); -const u8 gText_Sour[] = _("SOUR"); -const u8 gText_Tasty[] = _("TASTY"); // Unused -const u8 gText_Feel[] = _("FEEL"); // Unused -const u8 gText_StowCase[] = _("Stow CASE."); -const u8 gText_LvVar1[] = _("{LV}{STR_VAR_1}"); -const u8 gText_ThrowAwayVar1[] = _("Throw away this\n{STR_VAR_1}?"); -const u8 gText_Var1ThrownAway[] = _("The {STR_VAR_1}\nwas thrown away."); -const u8 gText_Var1AteTheVar2[] = _("{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); -const u8 gText_Var1HappilyAteVar2[] = _("{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); -const u8 gText_Var1DisdainfullyAteVar2[] = _("{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); const u8 gText_ShopBuy[] = _("BUY"); const u8 gText_ShopSell[] = _("SELL"); const u8 gText_ShopQuit[] = _("QUIT"); diff --git a/src/text_window.c b/src/text_window.c index df06837299..efd087977e 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -5,6 +5,7 @@ #include "palette.h" #include "bg.h" #include "graphics.h" +#include "menu.h" const u8 gTextWindowFrame1_Gfx[] = INCBIN_U8("graphics/text_window/1.4bpp"); static const u8 sTextWindowFrame2_Gfx[] = INCBIN_U8("graphics/text_window/2.4bpp"); @@ -96,6 +97,12 @@ void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) LoadPalette(GetOverworldTextboxPalettePtr(), palOffset, PLTT_SIZE_4BPP); } +void LoadSignBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) +{ + LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gSignpostWindow_Gfx, 0x1C0, destOffset); + LoadPalette(GetTextWindowPalette(1), palOffset, PLTT_SIZE_4BPP); +} + void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset) { LoadUserWindowBorderGfx(windowId, destOffset, palOffset); diff --git a/src/type_icons.c b/src/type_icons.c index 361312ab91..41fa102bb9 100644 --- a/src/type_icons.c +++ b/src/type_icons.c @@ -291,7 +291,7 @@ static bool32 UseDoubleBattleCoords(u32 position) static u32 GetMonPublicType(u32 battlerId, u32 typeNum) { - struct Pokemon* mon = GetBattlerData(battlerId); + struct Pokemon* mon = GetPartyBattlerData(battlerId); u32 monSpecies = GetMonData(mon,MON_DATA_SPECIES,NULL); struct Pokemon* monIllusion; u32 illusionSpecies; diff --git a/test/battle/ability/commander.c b/test/battle/ability/commander.c new file mode 100644 index 0000000000..af02f971a3 --- /dev/null +++ b/test/battle/ability/commander.c @@ -0,0 +1,423 @@ +#include "global.h" +#include "test/battle.h" + +DOUBLE_BATTLE_TEST("Commander will activate once Dondozo switches in") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { SWITCH(playerLeft, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + } +} + +DOUBLE_BATTLE_TEST("Commander increases all stats by 2 stages once it is triggered") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Dondozo's Attack sharply rose!"); + MESSAGE("Dondozo's Defense sharply rose!"); + MESSAGE("Dondozo's Sp. Atk sharply rose!"); + MESSAGE("Dondozo's Sp. Def sharply rose!"); + MESSAGE("Dondozo's Speed sharply rose!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri avoids moves targetted towards it") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); MOVE(opponentRight, MOVE_POUND, target: playerRight); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Foe Wobbuffet's attack missed!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POUND, opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri will still take residual damage from a field effect while inside Dondozo") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_TYRANITAR) { Ability(ABILITY_SAND_STREAM); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ABILITY_POPUP(opponentLeft, ABILITY_SAND_STREAM); + MESSAGE("Dondozo is buffeted by the sandstorm!"); + MESSAGE("Tatsugiri is buffeted by the sandstorm!"); + MESSAGE("Foe Wobbuffet is buffeted by the sandstorm!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri will still take poison damage if while inside Dondozo") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); Status1(STATUS1_POISON); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Tatsugiri is hurt by poison!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri still avoids moves even when the attacker has No Guard") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_MACHAMP) { Ability(ABILITY_NO_GUARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Foe Machamp's attack missed!"); + } +} + +DOUBLE_BATTLE_TEST("Commander cannot affect a Dondozo that was previously affected by Commander until it faints and revived") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { HP(1); Ability(ABILITY_COMMANDER); Status1(STATUS1_POISON); } + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_CELEBRATE); SWITCH(playerLeft, 2); SEND_OUT(playerLeft, 3); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Tatsugiri is hurt by poison!"); + NONE_OF { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + } + } +} + +DOUBLE_BATTLE_TEST("Commander prevents Whirlwind from working against Dondozo or Tatsugiri while it's active") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_WHIRLWIND, target: playerLeft); } + TURN { MOVE(opponentRight, MOVE_WHIRLWIND, target: playerRight); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Foe Wobbuffet used Whirlwind!"); + MESSAGE("But it failed!"); + MESSAGE("Foe Wobbuffet used Whirlwind!"); + MESSAGE("But it failed!"); + } +} + +DOUBLE_BATTLE_TEST("Commander prevents Red Card from working while Commander is active") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft); + } THEN { + EXPECT(opponentLeft->item == ITEM_NONE); + EXPECT(playerRight->species == SPECIES_DONDOZO); + } + +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri is not damaged by a double target move if Dondozo faints") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_DONDOZO) { HP(1); }; + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_SURF); SEND_OUT(playerLeft, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + HP_BAR(playerLeft); + MESSAGE("Dondozo fainted!"); + NOT HP_BAR(playerRight); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri takes no damage from multi-target damaging moves") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_SURF); MOVE(opponentRight, MOVE_SURF); SWITCH(playerLeft, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + HP_BAR(playerLeft); + NOT HP_BAR(playerRight); + HP_BAR(opponentRight); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentRight); + HP_BAR(playerLeft); + HP_BAR(opponentLeft); + NOT HP_BAR(playerRight); + } +} + +DOUBLE_BATTLE_TEST("Commander doesn't prevent Transform from working on a Commander Tatsugiri") +{ + GIVEN { + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_TRANSFORM, target: playerRight); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TRANSFORM, opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander doesn't prevent Imposter from working on a Commander Tatsugiri") +{ + GIVEN { + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_DITTO) { Ability(ABILITY_IMPOSTER); } + } WHEN { + TURN { } + TURN { SWITCH(opponentRight, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ABILITY_POPUP(opponentRight, ABILITY_IMPOSTER); + MESSAGE("Foe Ditto transformed into Tatsugiri using Imposter!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri is still affected by Haze while controlling Dondozo") +{ + GIVEN { + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_PERISH_SONG); } + TURN {} + TURN {} + TURN {} + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_PERISH_SONG, opponentLeft); + MESSAGE("All affected POKéMON will faint in three turns!"); + MESSAGE("Dondozo's PERISH count fell to 0!"); + MESSAGE("Dondozo fainted!"); + MESSAGE("Foe Wobbuffet's PERISH count fell to 0!"); + MESSAGE("Foe Wobbuffet fainted!"); + NONE_OF { + MESSAGE("Tatsugiri's PERISH count fell to 0!"); + MESSAGE("Tatsugiri fainted!"); + } + MESSAGE("Foe Wynaut's PERISH count fell to 0!"); + MESSAGE("Foe Wynaut fainted!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri is still affected by Haze while controlling Dondozo") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_SWORDS_DANCE); } + TURN { SWITCH(playerLeft, 2); MOVE(opponentRight, MOVE_HAZE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SWORDS_DANCE, playerRight); + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HAZE, opponentRight); + } THEN { + EXPECT_EQ(playerRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE); + } +} + +DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Left Slot)") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_TACKLE, target: opponentLeft); } + TURN { SWITCH(playerLeft, 2); MOVE(opponentLeft, MOVE_SURF); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + HP_BAR(playerLeft); + MESSAGE("Foe Wobbuffet's attack missed!"); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Right Slot)") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_TACKLE, target: opponentLeft); } + TURN { SWITCH(playerRight, 2); MOVE(opponentLeft, MOVE_SURF); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Foe Wobbuffet's attack missed!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + HP_BAR(playerRight); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri does not attack if Dondozo faints the same turn it's switched in") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { + SWITCH(playerLeft, 2); + MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); + MOVE(opponentRight, MOVE_TACKLE, target: playerRight); + MOVE(playerRight, MOVE_CELEBRATE); + SEND_OUT(playerLeft, 0); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + HP_BAR(playerLeft); + MESSAGE("Dondozo fainted!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + HP_BAR(playerRight); + NOT MESSAGE("Tatsugiri used Celebrate!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri does not get hit by Dragon Darts when a commanded Dondozo faints") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO) { HP(1); } + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { SWITCH(playerLeft, 2); MOVE(opponentRight, MOVE_DRAGON_DARTS, target: playerRight); SEND_OUT(playerRight, 0); } + } SCENE { + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, opponentRight); + MESSAGE("Dondozo fainted!"); + NOT HP_BAR(playerLeft); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri does not get hit by Dragon Darts when commanding Dondozo") +{ + bool32 targetPlayerRight; + PARAMETRIZE { targetPlayerRight = TRUE; } + PARAMETRIZE { targetPlayerRight = FALSE; } + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + if (targetPlayerRight == TRUE) + TURN { MOVE(opponentRight, MOVE_DRAGON_DARTS, target: playerRight); } + else + TURN { MOVE(opponentRight, MOVE_DRAGON_DARTS, target: playerLeft); } + } SCENE { + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, opponentRight); + HP_BAR(playerRight); + NOT HP_BAR(playerLeft); + HP_BAR(playerRight); + NOT HP_BAR(playerLeft); + } +} 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/eject_button.c b/test/battle/hold_effect/eject_button.c index da358c2aa9..f53a270d82 100644 --- a/test/battle/hold_effect/eject_button.c +++ b/test/battle/hold_effect/eject_button.c @@ -208,3 +208,27 @@ SINGLE_BATTLE_TEST("Eject Button is not triggered after High Jump Kick crash dam } } } + +DOUBLE_BATTLE_TEST("Eject Button activation will not trigger an attack from the incoming mon") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Speed(10); Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_WOBBUFFET) { Speed(100); Item(ITEM_EJECT_BUTTON); } + PLAYER(SPECIES_DONDOZO) { Speed(20); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(50); Item(ITEM_EJECT_PACK); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(10); } + OPPONENT(SPECIES_WYNAUT) { Speed(1); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_MAKE_IT_RAIN); SEND_OUT(playerRight, 2); SEND_OUT(opponentRight, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_MAKE_IT_RAIN, opponentRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight); + MESSAGE("Wobbuffet is switched out with the Eject Button!"); + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft); + MESSAGE("Wobbuffet is switched out with the Eject Pack!"); + } + } +} 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/defog.c b/test/battle/move_effect/defog.c index 80d500d2ee..ab6d647a97 100644 --- a/test/battle/move_effect/defog.c +++ b/test/battle/move_effect/defog.c @@ -383,3 +383,21 @@ DOUBLE_BATTLE_TEST("Defog lowers evasiveness by 1 and removes everything it can" } } } + +SINGLE_BATTLE_TEST("Defog is used on the correct side if opposing mon is behind a substitute with Screen up") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_LIGHT_SCREEN); } + TURN { MOVE(opponent, MOVE_SUBSTITUTE); MOVE(player, MOVE_DEFOG); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_LIGHT_SCREEN, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBSTITUTE, opponent); + MESSAGE("Wobbuffet used Defog!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DEFOG, player); + MESSAGE("Foe Wobbuffet's evasiveness fell!"); + MESSAGE("Foe's Light Screen wore off!"); + } +} 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); + } +} diff --git a/test/battle/move_effect_secondary/order_up.c b/test/battle/move_effect_secondary/order_up.c new file mode 100644 index 0000000000..ea1980062c --- /dev/null +++ b/test/battle/move_effect_secondary/order_up.c @@ -0,0 +1,172 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_ORDER_UP].additionalEffects[0].moveEffect == MOVE_EFFECT_ORDER_UP); +} + +DOUBLE_BATTLE_TEST("Order Up increases a stat based on Tatsugiri's form") +{ + u32 species = 0; + PARAMETRIZE { species = SPECIES_TATSUGIRI_CURLY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_DROOPY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_STRETCHY; } + + GIVEN { + PLAYER(species) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VOLBEAT) { Ability(ABILITY_PRANKSTER); }; + } WHEN { + TURN { MOVE(opponentRight, MOVE_HAZE); MOVE(playerRight, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HAZE, opponentRight); // Remove previous stat boosts + ANIMATION(ANIM_TYPE_MOVE, MOVE_ORDER_UP, playerRight); + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + MESSAGE("Dondozo's Attack rose!"); + break; + case SPECIES_TATSUGIRI_DROOPY: + MESSAGE("Dondozo's Defense rose!"); + break; + case SPECIES_TATSUGIRI_STRETCHY: + MESSAGE("Dondozo's Speed rose!"); + break; + } + } THEN { + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + EXPECT_EQ(playerRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_DROOPY: + EXPECT_EQ(playerRight->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_STRETCHY: + EXPECT_EQ(playerRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 1); + break; + } + } +} + +DOUBLE_BATTLE_TEST("Order Up increases a stat based on Tatsugiri's form even if Tatsugiri fainted inside Dondozo") +{ + u32 species = 0; + PARAMETRIZE { species = SPECIES_TATSUGIRI_CURLY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_DROOPY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_STRETCHY; } + + GIVEN { + PLAYER(species) { HP(1); Status1(STATUS1_POISON); Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VOLBEAT) { Ability(ABILITY_PRANKSTER); }; + } WHEN { + TURN { } + TURN { MOVE(opponentRight, MOVE_HAZE); MOVE(playerRight, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Tatsugiri is hurt by poison!"); + MESSAGE("Tatsugiri fainted!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HAZE, opponentRight); // Remove previous stat boosts + ANIMATION(ANIM_TYPE_MOVE, MOVE_ORDER_UP, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + MESSAGE("Dondozo's Attack rose!"); + break; + case SPECIES_TATSUGIRI_DROOPY: + MESSAGE("Dondozo's Defense rose!"); + break; + case SPECIES_TATSUGIRI_STRETCHY: + MESSAGE("Dondozo's Speed rose!"); + break; + } + } THEN { + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + EXPECT_EQ(playerRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_DROOPY: + EXPECT_EQ(playerRight->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_STRETCHY: + EXPECT_EQ(playerRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 1); + break; + } + } +} + +DOUBLE_BATTLE_TEST("Order up does not boosts any stats if Dondozo is not affected by Commander") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + } +} + +DOUBLE_BATTLE_TEST("Order Up is boosted by Sheer Force without removing the stat boosting effect") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + PLAYER(SPECIES_DONDOZO) { Speed(10); } + PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } + OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_ENTRAINMENT, target: playerLeft); MOVE(playerLeft, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + MESSAGE("Foe Tauros used Entrainment!"); + MESSAGE("Dondozo acquired Sheer Force!"); + MESSAGE("Dondozo used Order Up!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + } +} +DOUBLE_BATTLE_TEST("Order Up is always boosted by Sheer Force", s16 damage) +{ + u32 move; + u32 ability; + PARAMETRIZE(move = MOVE_CELEBRATE, ability = ABILITY_STORM_DRAIN); + PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_STORM_DRAIN); + PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_COMMANDER); + + GIVEN { + ASSUME(gMovesInfo[MOVE_HAZE].effect == EFFECT_HAZE); + ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + PLAYER(SPECIES_DONDOZO) { Speed(10); } + PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); Ability(ability); } + OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(22); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_HAZE); + MOVE(opponentLeft, move, target: playerLeft); + MOVE(playerLeft, MOVE_ORDER_UP, target: opponentRight); } + } SCENE { + MESSAGE("Foe Wobbuffet used Haze!"); + if (move == MOVE_ENTRAINMENT) + { + MESSAGE("Foe Tauros used Entrainment!"); + MESSAGE("Dondozo acquired Sheer Force!"); + } + MESSAGE("Dondozo used Order Up!"); + HP_BAR(opponentRight, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.3), results[1].damage); + EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.3), results[2].damage); + } +}