Merge branch '_RHH/master' into _RHH/upcoming

# Conflicts:
#	asm/macros/battle_anim_script.inc
#	data/battle_anim_scripts.s
#	include/constants/battle_anim.h
#	src/battle_anim.c
#	src/data/battle_anim.h
This commit is contained in:
Eduardo Quezada 2024-07-27 16:26:37 -04:00
commit 18aff2db3b
32 changed files with 230 additions and 73 deletions

View File

@ -33,27 +33,23 @@ WSL1 is the preferred terminal to build **pokeemerald Expansion**. The following
- Otherwise, **open WSL** and go to [Choosing where to store pokeemerald Expansion (WSL1)](#Choosing-where-to-store-pokeemerald-expansion-WSL1). - Otherwise, **open WSL** and go to [Choosing where to store pokeemerald Expansion (WSL1)](#Choosing-where-to-store-pokeemerald-expansion-WSL1).
### Installing WSL1 ### Installing WSL1
1. Open [Windows Powershell **as Administrator**](https://i.imgur.com/QKmVbP9.png), and run the following command (Right Click or Shift+Insert is paste in the Powershell). 1. Open [Windows Powershell **as Administrator**](https://i.imgur.com/QKmVbP9.png), and run the following commands (Right Click or Shift+Insert is paste in the Powershell).
```powershell ```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart wsl --install -d Ubuntu --enable-wsl1
``` ```
2. Once the process finishes, restart your machine. 2. Once the process finishes, restart your machine.
3. The next step is to choose and install a Linux distribution from the Microsoft Store. The following instructions will assume Ubuntu as the Linux distribution of choice. 3. Open Windows Powershell **as Administrator** again (after restarting), and run the following command to configure Ubuntu to use WSL1.
```powershell
wsl --set-version Ubuntu 1
```
<details> <details>
<summary><i>Note for advanced users...</i></summary> <summary><i>Note...</i></summary>
> You can pick a preferred Linux distribution, but setup instructions may differ. Debian should work with the given instructions, but has not been tested. > WSL may open automatically after restarting, but you can ignore it for now.
</details>
4. Open the [Microsoft Store Linux Selection](https://aka.ms/wslstore), click Ubuntu, then click Get, which will install the Ubuntu distribution.
<details>
<summary><i>Notes...</i></summary>
> Note 1: If a dialog pops up asking for you to sign into a Microsoft Account, then just close the dialog.
> Note 2: If the link does not work, then open the Microsoft Store manually, and search for the Ubuntu app (choose the one with no version number).
</details> </details>
### Setting up WSL1 ### Setting up WSL1

View File

@ -315,8 +315,14 @@
.Lsprite_\@_2: .Lsprite_\@_2:
.endm .endm
.macro createdragondartsprite anim_battler:req, subpriority_offset:req, argv:vararg .macro jumpifmovetypeequal type:req, jumpInstr:req
.byte 0x33 .byte 0x33
.byte \type
.4byte \jumpInstr
.endm
.macro createdragondartsprite anim_battler:req, subpriority_offset:req, argv:vararg
.byte 0x34
.if \anim_battler == ANIM_TARGET .if \anim_battler == ANIM_TARGET
.byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F) .byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F)
.else .else

View File

@ -16900,6 +16900,59 @@ ElectroShotUnleash:
blendoff blendoff
end end
Move_IVY_CUDGEL::
loadspritegfx ANIM_TAG_IVY_CUDGEL_GRASS
loadspritegfx ANIM_TAG_WOOD_HAMMER
loadspritegfx ANIM_TAG_WOOD_HAMMER_HAMMER
loadspritegfx ANIM_TAG_IMPACT
playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER
createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 4, 2, 4
jumpifmovetypeequal TYPE_FIRE, IvyCudgelFire
jumpifmovetypeequal TYPE_ROCK, IvyCudgelRock
jumpifmovetypeequal TYPE_WATER, IvyCudgelWater
createsprite gIvyCudgelSpriteTemplate, ANIM_TARGET, 2
delay 60
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 3, 0, 12, 4
delay 18
createvisualtask AnimTask_SquishTarget, 0x2
delay 6
call WoodHammerImpact
waitforvisualfinish
end
IvyCudgelFire:
loadspritegfx ANIM_TAG_IVY_CUDGEL_FIRE
createsprite gIvyCudgelFireSpriteTemplate, ANIM_TARGET, 2
delay 60
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 3, 0, 12, 4
delay 18
createvisualtask AnimTask_SquishTarget, 0x2
delay 6
call WoodHammerImpact
waitforvisualfinish
end
IvyCudgelRock:
loadspritegfx ANIM_TAG_IVY_CUDGEL_ROCK
createsprite gIvyCudgelRockSpriteTemplate, ANIM_TARGET, 2
delay 60
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 3, 0, 12, 4
delay 18
createvisualtask AnimTask_SquishTarget, 0x2
delay 6
call WoodHammerImpact
waitforvisualfinish
end
IvyCudgelWater:
loadspritegfx ANIM_TAG_IVY_CUDGEL_WATER
createsprite gIvyCudgelWaterSpriteTemplate, ANIM_TARGET, 2
delay 60
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 3, 0, 12, 4
delay 18
createvisualtask AnimTask_SquishTarget, 0x2
delay 6
call WoodHammerImpact
waitforvisualfinish
end
Move_SPICY_EXTRACT:: Move_SPICY_EXTRACT::
loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_SMALL_EMBER
loadspritegfx ANIM_TAG_POISON_BUBBLE loadspritegfx ANIM_TAG_POISON_BUBBLE
@ -16975,7 +17028,6 @@ Move_MAGICAL_TORQUE::
Move_PSYBLADE:: Move_PSYBLADE::
Move_BLOOD_MOON:: Move_BLOOD_MOON::
Move_MATCHA_GOTCHA:: Move_MATCHA_GOTCHA::
Move_IVY_CUDGEL::
Move_TERA_STARSTORM:: Move_TERA_STARSTORM::
Move_FICKLE_BEAM:: Move_FICKLE_BEAM::
Move_THUNDERCLAP:: Move_THUNDERCLAP::

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 B

After

Width:  |  Height:  |  Size: 962 B

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
15 15
148 209 161 148 209 161
0 0 0
42 44 41 42 44 41
21 158 7 21 158 7
0 0 0
74 76 73 74 76 73
25 27 24
61 113 53 61 113 53
25 27 24
109 99 108 109 99 108
133 139 139 133 139 139
53 134 168 53 134 168

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
15 15
148 209 161 148 209 161
0 0 0
42 44 41 42 44 41
21 158 7 21 158 7
0 0 0
74 76 73 74 76 73
25 27 24
61 113 53 61 113 53
25 27 24
109 99 108 109 99 108
133 139 139 133 139 139
53 134 168 53 134 168

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 999 B

After

Width:  |  Height:  |  Size: 958 B

View File

@ -2,18 +2,18 @@ JASC-PAL
0100 0100
16 16
148 210 164 148 210 164
156 153 172 0 0 0
131 28 24
49 133 172
213 230 246
41 44 41 41 44 41
16 157 0
230 60 49
57 113 49
49 133 172
131 28 24
213 230 246
255 198 74 255 198 74
172 105 32 172 105 32
16 157 0 156 153 172
57 113 49
49 190 230 49 190 230
0 0 0
164 52 49 164 52 49
74 76 74 74 76 74
189 137 90 189 137 90
230 60 49

View File

@ -2,18 +2,18 @@ JASC-PAL
0100 0100
16 16
148 210 164 148 210 164
156 153 172 0 0 0
131 28 24
49 133 172
213 230 246
41 44 41 41 44 41
16 157 0
230 60 49
57 113 49
49 133 172
131 28 24
213 230 246
255 198 74 255 198 74
124 162 56 124 162 56
16 157 0 156 153 172
57 113 49
49 190 230 49 190 230
0 0 0
164 52 49 164 52 49
74 76 74 74 76 74
189 137 90 189 137 90
230 60 49

View File

@ -2,17 +2,17 @@ JASC-PAL
0100 0100
15 15
148 209 161 148 209 161
42 44 41
0 1 0 0 1 0
27 70 15 42 44 41
0 164 153
17 106 68
21 158 7 21 158 7
27 70 15
61 113 53
17 106 68
83 133 90
74 76 73 74 76 73
61 97 53
175 216 159 175 216 159
251 253 250 251 253 250
139 99 57 139 99 57
0 164 153
120 81 39 120 81 39
219 157 92 219 157 92
83 133 90

View File

@ -2,17 +2,17 @@ JASC-PAL
0100 0100
15 15
148 209 161 148 209 161
42 44 41
0 1 0 0 1 0
27 70 15 42 44 41
0 164 153
17 106 68
21 158 7 21 158 7
27 70 15
61 113 53
17 106 68
83 133 90
74 76 73 74 76 73
61 97 53
175 216 159 175 216 159
251 253 250 251 253 250
139 99 57 139 99 57
0 164 153
124 162 56 124 162 56
219 157 92 219 157 92
83 133 90

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 960 B

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
16 16
148 209 161 148 209 161
0 0 0
42 44 41 42 44 41
21 158 7 21 158 7
74 76 73
0 0 0
61 113 53
11 64 121 11 64 121
61 113 53
74 76 73
15 90 170 15 90 170
0 126 229 0 126 229
53 134 168 53 134 168

View File

@ -2,12 +2,12 @@ JASC-PAL
0100 0100
16 16
148 209 161 148 209 161
0 0 0
42 44 41 42 44 41
21 158 7 21 158 7
74 76 73
0 0 0
61 113 53
11 64 121 11 64 121
61 113 53
74 76 73
15 90 170 15 90 170
0 126 229 0 126 229
53 134 168 53 134 168

View File

@ -155,7 +155,7 @@ bool32 TryChangeBattleWeather(u32 battler, u32 weatherEnumId, bool32 viaAbility)
u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 moveArg); u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 moveArg);
bool32 TryPrimalReversion(u32 battler); bool32 TryPrimalReversion(u32 battler);
bool32 IsNeutralizingGasOnField(void); bool32 IsNeutralizingGasOnField(void);
bool32 IsMoldBreakerTypeAbility(u32 ability); bool32 IsMoldBreakerTypeAbility(u32 battler, u32 ability);
u32 GetBattlerAbility(u32 battler); u32 GetBattlerAbility(u32 battler);
u32 IsAbilityOnSide(u32 battler, u32 ability); u32 IsAbilityOnSide(u32 battler, u32 ability);
u32 IsAbilityOnOpposingSide(u32 battler, u32 ability); u32 IsAbilityOnOpposingSide(u32 battler, u32 ability);

View File

@ -405,9 +405,13 @@
#define ANIM_TAG_SYRUP_SHELL_YELLOW (ANIM_SPRITES_START + 391) #define ANIM_TAG_SYRUP_SHELL_YELLOW (ANIM_SPRITES_START + 391)
#define ANIM_TAG_SYRUP_SPLAT_RED (ANIM_SPRITES_START + 392) #define ANIM_TAG_SYRUP_SPLAT_RED (ANIM_SPRITES_START + 392)
#define ANIM_TAG_SYRUP_SPLAT_YELLOW (ANIM_SPRITES_START + 393) #define ANIM_TAG_SYRUP_SPLAT_YELLOW (ANIM_SPRITES_START + 393)
#define ANIM_TAG_TERA_CRYSTAL (ANIM_SPRITES_START + 394) #define ANIM_TAG_IVY_CUDGEL_GRASS (ANIM_SPRITES_START + 394)
#define ANIM_TAG_TERA_SHATTER (ANIM_SPRITES_START + 395) #define ANIM_TAG_IVY_CUDGEL_FIRE (ANIM_SPRITES_START + 395)
#define ANIM_TAG_DREEPY_SHINY (ANIM_SPRITES_START + 396) #define ANIM_TAG_IVY_CUDGEL_ROCK (ANIM_SPRITES_START + 396)
#define ANIM_TAG_IVY_CUDGEL_WATER (ANIM_SPRITES_START + 397)
#define ANIM_TAG_TERA_CRYSTAL (ANIM_SPRITES_START + 398)
#define ANIM_TAG_TERA_SHATTER (ANIM_SPRITES_START + 399)
#define ANIM_TAG_DREEPY_SHINY (ANIM_SPRITES_START + 400)
// battlers // battlers
#define ANIM_ATTACKER 0 #define ANIM_ATTACKER 0

View File

@ -8,6 +8,7 @@
#define NUM_FOG_DIAGONAL_SPRITES 20 #define NUM_FOG_DIAGONAL_SPRITES 20
#define NUM_SANDSTORM_SPRITES 20 #define NUM_SANDSTORM_SPRITES 20
#define NUM_SWIRL_SANDSTORM_SPRITES 5 #define NUM_SWIRL_SANDSTORM_SPRITES 5
#define NUM_SNOWFLAKE_SPRITES 16
// Controls how the weather should be changing the screen palettes. // Controls how the weather should be changing the screen palettes.
#define WEATHER_PAL_STATE_CHANGING_WEATHER 0 #define WEATHER_PAL_STATE_CHANGING_WEATHER 0

View File

@ -2873,6 +2873,11 @@ extern const u32 gBattleAnimSpriteGfx_SyrupShell[];
extern const u32 gBattleAnimSpriteGfx_SyrupSplat[]; extern const u32 gBattleAnimSpriteGfx_SyrupSplat[];
extern const u32 gBattleAnimSpritePal_SyrupRed[]; extern const u32 gBattleAnimSpritePal_SyrupRed[];
extern const u32 gBattleAnimSpritePal_SyrupYellow[]; extern const u32 gBattleAnimSpritePal_SyrupYellow[];
extern const u32 gBattleAnimSpriteGfx_IvyCudgel[];
extern const u32 gBattleAnimSpritePal_IvyCudgelGrass[];
extern const u32 gBattleAnimSpritePal_IvyCudgelFire[];
extern const u32 gBattleAnimSpritePal_IvyCudgelRock[];
extern const u32 gBattleAnimSpritePal_IvyCudgelWater[];
extern const u32 gBattleAnimBgImage_Dark[]; extern const u32 gBattleAnimBgImage_Dark[];
extern const u32 gBattleAnimBgImage_Ghost[]; extern const u32 gBattleAnimBgImage_Ghost[];

View File

@ -1353,7 +1353,7 @@ bool32 DoesBattlerIgnoreAbilityChecks(u32 atkAbility, u32 move)
if (AI_THINKING_STRUCT->aiFlags[sBattler_AI] & AI_FLAG_NEGATE_UNAWARE) if (AI_THINKING_STRUCT->aiFlags[sBattler_AI] & AI_FLAG_NEGATE_UNAWARE)
return FALSE; // AI handicap flag: doesn't understand ability suppression concept return FALSE; // AI handicap flag: doesn't understand ability suppression concept
if (IsMoldBreakerTypeAbility(atkAbility) || gMovesInfo[move].ignoresTargetAbility) if (IsMoldBreakerTypeAbility(sBattler_AI, atkAbility) || gMovesInfo[move].ignoresTargetAbility)
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -2947,7 +2947,7 @@ bool32 AI_CanBeInfatuated(u32 battlerAtk, u32 battlerDef, u32 defAbility)
u32 ShouldTryToFlinch(u32 battlerAtk, u32 battlerDef, u32 atkAbility, u32 defAbility, u32 move) u32 ShouldTryToFlinch(u32 battlerAtk, u32 battlerDef, u32 atkAbility, u32 defAbility, u32 move)
{ {
if (((!IsMoldBreakerTypeAbility(AI_DATA->abilities[battlerAtk]) && (defAbility == ABILITY_SHIELD_DUST || defAbility == ABILITY_INNER_FOCUS)) if (((!IsMoldBreakerTypeAbility(battlerAtk, AI_DATA->abilities[battlerAtk]) && (defAbility == ABILITY_SHIELD_DUST || defAbility == ABILITY_INNER_FOCUS))
|| AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|| AI_IsSlower(battlerAtk, battlerDef, move))) // Opponent goes first || AI_IsSlower(battlerAtk, battlerDef, move))) // Opponent goes first
@ -2990,7 +2990,7 @@ bool32 ShouldFakeOut(u32 battlerAtk, u32 battlerDef, u32 move)
|| AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND
|| AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|| (!IsMoldBreakerTypeAbility(AI_DATA->abilities[battlerAtk]) || (!IsMoldBreakerTypeAbility(battlerAtk, AI_DATA->abilities[battlerAtk])
&& (AI_DATA->abilities[battlerDef] == ABILITY_SHIELD_DUST || AI_DATA->abilities[battlerDef] == ABILITY_INNER_FOCUS))) && (AI_DATA->abilities[battlerDef] == ABILITY_SHIELD_DUST || AI_DATA->abilities[battlerDef] == ABILITY_INNER_FOCUS)))
return FALSE; return FALSE;

View File

@ -85,6 +85,7 @@ static void Cmd_stopsound(void);
static void Cmd_createvisualtaskontargets(void); static void Cmd_createvisualtaskontargets(void);
static void Cmd_createspriteontargets(void); static void Cmd_createspriteontargets(void);
static void Cmd_createspriteontargets_onpos(void); static void Cmd_createspriteontargets_onpos(void);
static void Cmd_jumpifmovetypeequal(void);
static void Cmd_createdragondartsprite(void); static void Cmd_createdragondartsprite(void);
static void RunAnimScriptCommand(void); static void RunAnimScriptCommand(void);
static void Task_UpdateMonBg(u8 taskId); static void Task_UpdateMonBg(u8 taskId);
@ -177,7 +178,8 @@ static void (* const sScriptCmdTable[])(void) =
Cmd_createvisualtaskontargets, // 0x30 Cmd_createvisualtaskontargets, // 0x30
Cmd_createspriteontargets, // 0x31 Cmd_createspriteontargets, // 0x31
Cmd_createspriteontargets_onpos, // 0x32 Cmd_createspriteontargets_onpos, // 0x32
Cmd_createdragondartsprite, // 0x33 Cmd_jumpifmovetypeequal, // 0x33
Cmd_createdragondartsprite, // 0x34
}; };
void ClearBattleAnimationVars(void) void ClearBattleAnimationVars(void)
@ -2141,6 +2143,19 @@ static void Cmd_stopsound(void)
sBattleAnimScriptPtr++; sBattleAnimScriptPtr++;
} }
static void Cmd_jumpifmovetypeequal(void)
{
u8 moveType;
const u8 *type = sBattleAnimScriptPtr + 1;
sBattleAnimScriptPtr += 2;
GET_MOVE_TYPE(gCurrentMove, moveType);
if (*type != moveType)
sBattleAnimScriptPtr += 4;
else
sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr);
}
static void Cmd_createdragondartsprite(void) static void Cmd_createdragondartsprite(void)
{ {
s32 i; s32 i;

View File

@ -2958,6 +2958,50 @@ const struct SpriteTemplate gWoodHammerHammerSpriteTemplate =
.callback = AnimWoodHammerHammer, .callback = AnimWoodHammerHammer,
}; };
const struct SpriteTemplate gIvyCudgelSpriteTemplate =
{
.tileTag = ANIM_TAG_IVY_CUDGEL_GRASS,
.paletteTag = ANIM_TAG_IVY_CUDGEL_GRASS,
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gWoodHammerHammerAffineAnims,
.callback = AnimWoodHammerHammer,
};
const struct SpriteTemplate gIvyCudgelFireSpriteTemplate =
{
.tileTag = ANIM_TAG_IVY_CUDGEL_GRASS,
.paletteTag = ANIM_TAG_IVY_CUDGEL_FIRE,
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gWoodHammerHammerAffineAnims,
.callback = AnimWoodHammerHammer,
};
const struct SpriteTemplate gIvyCudgelRockSpriteTemplate =
{
.tileTag = ANIM_TAG_IVY_CUDGEL_GRASS,
.paletteTag = ANIM_TAG_IVY_CUDGEL_ROCK,
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gWoodHammerHammerAffineAnims,
.callback = AnimWoodHammerHammer,
};
const struct SpriteTemplate gIvyCudgelWaterSpriteTemplate =
{
.tileTag = ANIM_TAG_IVY_CUDGEL_GRASS,
.paletteTag = ANIM_TAG_IVY_CUDGEL_WATER,
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gWoodHammerHammerAffineAnims,
.callback = AnimWoodHammerHammer,
};
const struct SpriteTemplate gJudgmentGrayOutwardSpikesTemplate = const struct SpriteTemplate gJudgmentGrayOutwardSpikesTemplate =
{ {
.tileTag = ANIM_TAG_GREEN_SPIKE, .tileTag = ANIM_TAG_GREEN_SPIKE,

View File

@ -6358,23 +6358,41 @@ bool32 IsNeutralizingGasOnField(void)
return FALSE; return FALSE;
} }
bool32 IsMoldBreakerTypeAbility(u32 ability) bool32 IsMoldBreakerTypeAbility(u32 battler, u32 ability)
{ {
if (gStatuses3[battler] & STATUS3_GASTRO_ACID)
return FALSE;
return (ability == ABILITY_MOLD_BREAKER || ability == ABILITY_TERAVOLT || ability == ABILITY_TURBOBLAZE return (ability == ABILITY_MOLD_BREAKER || ability == ABILITY_TERAVOLT || ability == ABILITY_TURBOBLAZE
|| (ability == ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gCurrentMove))); || (ability == ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gCurrentMove)));
} }
static inline bool32 CanBreakThroughAbility(u32 battlerAtk, u32 battlerDef, u32 ability)
{
return ((IsMoldBreakerTypeAbility(battlerAtk, ability) || gMovesInfo[gCurrentMove].ignoresTargetAbility)
&& battlerDef != battlerAtk
&& gAbilitiesInfo[gBattleMons[battlerDef].ability].breakable
&& gBattlerByTurnOrder[gCurrentTurnActionNumber] == battlerAtk
&& gActionsByTurnOrder[gCurrentTurnActionNumber] == B_ACTION_USE_MOVE
&& gCurrentTurnActionNumber < gBattlersCount);
}
u32 GetBattlerAbility(u32 battler) u32 GetBattlerAbility(u32 battler)
{ {
bool32 noAbilityShield = GetBattlerHoldEffectIgnoreAbility(battler, TRUE) != HOLD_EFFECT_ABILITY_SHIELD; bool32 noAbilityShield = GetBattlerHoldEffectIgnoreAbility(battler, TRUE) != HOLD_EFFECT_ABILITY_SHIELD;
bool32 abilityCantBeSuppressed = gAbilitiesInfo[gBattleMons[battler].ability].cantBeSuppressed;
if (gAbilitiesInfo[gBattleMons[battler].ability].cantBeSuppressed) if (abilityCantBeSuppressed)
{ {
// Edge case: pokemon under the effect of gastro acid transforms into a pokemon with Comatose (Todo: verify how other unsuppressable abilities behave) // Edge case: pokemon under the effect of gastro acid transforms into a pokemon with Comatose (Todo: verify how other unsuppressable abilities behave)
if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED if (gBattleMons[battler].status2 & STATUS2_TRANSFORMED
&& gStatuses3[battler] & STATUS3_GASTRO_ACID && gStatuses3[battler] & STATUS3_GASTRO_ACID
&& gBattleMons[battler].ability == ABILITY_COMATOSE) && gBattleMons[battler].ability == ABILITY_COMATOSE)
return ABILITY_NONE; return ABILITY_NONE;
if (noAbilityShield && CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability))
return ABILITY_NONE;
return gBattleMons[battler].ability; return gBattleMons[battler].ability;
} }
@ -6386,15 +6404,7 @@ u32 GetBattlerAbility(u32 battler)
&& noAbilityShield) && noAbilityShield)
return ABILITY_NONE; return ABILITY_NONE;
if (((IsMoldBreakerTypeAbility(gBattleMons[gBattlerAttacker].ability) if (noAbilityShield && CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability))
&& !(gStatuses3[gBattlerAttacker] & STATUS3_GASTRO_ACID))
|| gMovesInfo[gCurrentMove].ignoresTargetAbility)
&& battler != gBattlerAttacker
&& gAbilitiesInfo[gBattleMons[battler].ability].breakable
&& noAbilityShield
&& gBattlerByTurnOrder[gCurrentTurnActionNumber] == gBattlerAttacker
&& gActionsByTurnOrder[gCurrentTurnActionNumber] == B_ACTION_USE_MOVE
&& gCurrentTurnActionNumber < gBattlersCount)
return ABILITY_NONE; return ABILITY_NONE;
return gBattleMons[battler].ability; return gBattleMons[battler].ability;

View File

@ -1454,6 +1454,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
{gBattleAnimSpriteGfx_SyrupShell, 0x2000, ANIM_TAG_SYRUP_SHELL_YELLOW}, {gBattleAnimSpriteGfx_SyrupShell, 0x2000, ANIM_TAG_SYRUP_SHELL_YELLOW},
{gBattleAnimSpriteGfx_SyrupSplat, 0x400, ANIM_TAG_SYRUP_SPLAT_RED}, {gBattleAnimSpriteGfx_SyrupSplat, 0x400, ANIM_TAG_SYRUP_SPLAT_RED},
{gBattleAnimSpriteGfx_SyrupSplat, 0x400, ANIM_TAG_SYRUP_SPLAT_YELLOW}, {gBattleAnimSpriteGfx_SyrupSplat, 0x400, ANIM_TAG_SYRUP_SPLAT_YELLOW},
{gBattleAnimSpriteGfx_IvyCudgel, 0x800, ANIM_TAG_IVY_CUDGEL_GRASS},
{gBattleAnimSpriteGfx_TeraCrystal, 0x800, ANIM_TAG_TERA_CRYSTAL}, {gBattleAnimSpriteGfx_TeraCrystal, 0x800, ANIM_TAG_TERA_CRYSTAL},
{gBattleAnimSpriteGfx_TeraShatter, 0x0180, ANIM_TAG_TERA_SHATTER}, {gBattleAnimSpriteGfx_TeraShatter, 0x0180, ANIM_TAG_TERA_SHATTER},
{gBattleAnimSpriteGfx_DreepyMissile, 0x200, ANIM_TAG_DREEPY_SHINY}, {gBattleAnimSpriteGfx_DreepyMissile, 0x200, ANIM_TAG_DREEPY_SHINY},
@ -1912,6 +1913,10 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
{gBattleAnimSpritePal_SyrupYellow, ANIM_TAG_SYRUP_SHELL_YELLOW}, {gBattleAnimSpritePal_SyrupYellow, ANIM_TAG_SYRUP_SHELL_YELLOW},
{gBattleAnimSpritePal_SyrupRed, ANIM_TAG_SYRUP_SPLAT_RED}, {gBattleAnimSpritePal_SyrupRed, ANIM_TAG_SYRUP_SPLAT_RED},
{gBattleAnimSpritePal_SyrupYellow, ANIM_TAG_SYRUP_SPLAT_YELLOW}, {gBattleAnimSpritePal_SyrupYellow, ANIM_TAG_SYRUP_SPLAT_YELLOW},
{gBattleAnimSpritePal_IvyCudgelGrass, ANIM_TAG_IVY_CUDGEL_GRASS},
{gBattleAnimSpritePal_IvyCudgelFire, ANIM_TAG_IVY_CUDGEL_FIRE},
{gBattleAnimSpritePal_IvyCudgelRock, ANIM_TAG_IVY_CUDGEL_ROCK},
{gBattleAnimSpritePal_IvyCudgelWater, ANIM_TAG_IVY_CUDGEL_WATER},
{gBattleAnimSpritePal_TeraCrystal, ANIM_TAG_TERA_CRYSTAL}, {gBattleAnimSpritePal_TeraCrystal, ANIM_TAG_TERA_CRYSTAL},
{gBattleAnimSpritePal_TeraShatter, ANIM_TAG_TERA_SHATTER}, {gBattleAnimSpritePal_TeraShatter, ANIM_TAG_TERA_SHATTER},
{gBattleAnimSpritePal_DreepyMissileShiny, ANIM_TAG_DREEPY_SHINY}, {gBattleAnimSpritePal_DreepyMissileShiny, ANIM_TAG_DREEPY_SHINY},

View File

@ -771,7 +771,7 @@ void Snow_InitVars(void)
gWeatherPtr->weatherGfxLoaded = FALSE; gWeatherPtr->weatherGfxLoaded = FALSE;
gWeatherPtr->targetColorMapIndex = 0; gWeatherPtr->targetColorMapIndex = 0;
gWeatherPtr->colorMapStepDelay = 20; gWeatherPtr->colorMapStepDelay = 20;
gWeatherPtr->targetSnowflakeSpriteCount = 16; gWeatherPtr->targetSnowflakeSpriteCount = NUM_SNOWFLAKE_SPRITES;
gWeatherPtr->snowflakeVisibleCounter = 0; gWeatherPtr->snowflakeVisibleCounter = 0;
} }

View File

@ -465,6 +465,12 @@ const u32 gBattleAnimSpriteGfx_SyrupSplat[] = INCBIN_U32("graphics/battle_anims/
const u32 gBattleAnimSpritePal_SyrupRed[] = INCBIN_U32("graphics/battle_anims/sprites/syrup_red.gbapal.lz"); const u32 gBattleAnimSpritePal_SyrupRed[] = INCBIN_U32("graphics/battle_anims/sprites/syrup_red.gbapal.lz");
const u32 gBattleAnimSpritePal_SyrupYellow[] = INCBIN_U32("graphics/battle_anims/sprites/syrup_yellow.gbapal.lz"); const u32 gBattleAnimSpritePal_SyrupYellow[] = INCBIN_U32("graphics/battle_anims/sprites/syrup_yellow.gbapal.lz");
const u32 gBattleAnimSpriteGfx_IvyCudgel[] = INCBIN_U32("graphics/battle_anims/sprites/cudgel.4bpp.lz");
const u32 gBattleAnimSpritePal_IvyCudgelGrass[] = INCBIN_U32("graphics/pokemon/ogerpon/normal.gbapal.lz");
const u32 gBattleAnimSpritePal_IvyCudgelFire[] = INCBIN_U32("graphics/pokemon/ogerpon/hearthflame/normal.gbapal.lz");
const u32 gBattleAnimSpritePal_IvyCudgelRock[] = INCBIN_U32("graphics/pokemon/ogerpon/cornerstone/normal.gbapal.lz");
const u32 gBattleAnimSpritePal_IvyCudgelWater[] = INCBIN_U32("graphics/pokemon/ogerpon/wellspring/normal.gbapal.lz");
// old battle interface data, unused // old battle interface data, unused
const u32 gOldBattleInterfaceGfx[] = INCBIN_U32("graphics/unused/obi1.4bpp.lz"); const u32 gOldBattleInterfaceGfx[] = INCBIN_U32("graphics/unused/obi1.4bpp.lz");

View File

@ -121,3 +121,16 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu takes damage from Rough Skin without break
EXPECT_EQ(player->species, SPECIES_MIMIKYU_DISGUISED); EXPECT_EQ(player->species, SPECIES_MIMIKYU_DISGUISED);
} }
} }
SINGLE_BATTLE_TEST("Disguised Mimikyu is ignored by Mold Breaker")
{
GIVEN {
PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); }
OPPONENT(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); }
} WHEN {
TURN { MOVE(opponent, MOVE_AERIAL_ACE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_AERIAL_ACE, opponent);
NOT ABILITY_POPUP(player, ABILITY_DISGUISE);
}
}