Skip to content

Commit

Permalink
Merge branch '_RHH/master' into _RHH/upcoming
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
AsparagusEduardo committed Jul 27, 2024
2 parents bb47174 + 1cf2592 commit 18aff2d
Show file tree
Hide file tree
Showing 32 changed files with 225 additions and 68 deletions.
20 changes: 8 additions & 12 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

### 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
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.
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.
<details>
<summary><i>Note for advanced users...</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.
</details>
3. Open Windows Powershell **as Administrator** again (after restarting), and run the following command to configure Ubuntu to use WSL1.
4. Open the [Microsoft Store Linux Selection](https://aka.ms/wslstore), click Ubuntu, then click Get, which will install the Ubuntu distribution.
```powershell
wsl --set-version Ubuntu 1
```
<details>
<summary><i>Notes...</i></summary>
<summary><i>Note...</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).
> WSL may open automatically after restarting, but you can ignore it for now.
</details>
### Setting up WSL1
Expand Down
8 changes: 7 additions & 1 deletion asm/macros/battle_anim_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,14 @@
.Lsprite_\@_2:
.endm

.macro createdragondartsprite anim_battler:req, subpriority_offset:req, argv:vararg
.macro jumpifmovetypeequal type:req, jumpInstr:req
.byte 0x33
.byte \type
.4byte \jumpInstr
.endm

.macro createdragondartsprite anim_battler:req, subpriority_offset:req, argv:vararg
.byte 0x34
.if \anim_battler == ANIM_TARGET
.byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F)
.else
Expand Down
54 changes: 53 additions & 1 deletion data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -16900,6 +16900,59 @@ ElectroShotUnleash:
blendoff
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::
loadspritegfx ANIM_TAG_SMALL_EMBER
loadspritegfx ANIM_TAG_POISON_BUBBLE
Expand Down Expand Up @@ -16975,7 +17028,6 @@ Move_MAGICAL_TORQUE::
Move_PSYBLADE::
Move_BLOOD_MOON::
Move_MATCHA_GOTCHA::
Move_IVY_CUDGEL::
Move_TERA_STARSTORM::
Move_FICKLE_BEAM::
Move_THUNDERCLAP::
Expand Down
Binary file added graphics/battle_anims/sprites/cudgel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/ogerpon/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/ogerpon/cornerstone/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/ogerpon/cornerstone/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions graphics/pokemon/ogerpon/cornerstone/normal.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ JASC-PAL
0100
15
148 209 161
0 0 0
42 44 41
21 158 7
0 0 0
74 76 73
25 27 24
61 113 53
25 27 24
109 99 108
133 139 139
53 134 168
Expand Down
4 changes: 2 additions & 2 deletions graphics/pokemon/ogerpon/cornerstone/shiny.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ JASC-PAL
0100
15
148 209 161
0 0 0
42 44 41
21 158 7
0 0 0
74 76 73
25 27 24
61 113 53
25 27 24
109 99 108
133 139 139
53 134 168
Expand Down
Binary file modified graphics/pokemon/ogerpon/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/ogerpon/hearthflame/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/ogerpon/hearthflame/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions graphics/pokemon/ogerpon/hearthflame/normal.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ JASC-PAL
0100
16
148 210 164
156 153 172
131 28 24
0 0 0
41 44 41
16 157 0
230 60 49
57 113 49
49 133 172
131 28 24
213 230 246
41 44 41
255 198 74
172 105 32
16 157 0
57 113 49
156 153 172
49 190 230
0 0 0
164 52 49
74 76 74
189 137 90
230 60 49
14 changes: 7 additions & 7 deletions graphics/pokemon/ogerpon/hearthflame/shiny.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ JASC-PAL
0100
16
148 210 164
156 153 172
131 28 24
0 0 0
41 44 41
16 157 0
230 60 49
57 113 49
49 133 172
131 28 24
213 230 246
41 44 41
255 198 74
124 162 56
16 157 0
57 113 49
156 153 172
49 190 230
0 0 0
164 52 49
74 76 74
189 137 90
230 60 49
10 changes: 5 additions & 5 deletions graphics/pokemon/ogerpon/normal.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ JASC-PAL
0100
15
148 209 161
42 44 41
0 1 0
42 44 41
21 158 7
27 70 15
0 164 153
61 113 53
17 106 68
21 158 7
83 133 90
74 76 73
61 97 53
175 216 159
251 253 250
139 99 57
0 164 153
120 81 39
219 157 92
83 133 90
10 changes: 5 additions & 5 deletions graphics/pokemon/ogerpon/shiny.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ JASC-PAL
0100
15
148 209 161
42 44 41
0 1 0
42 44 41
21 158 7
27 70 15
0 164 153
61 113 53
17 106 68
21 158 7
83 133 90
74 76 73
61 97 53
175 216 159
251 253 250
139 99 57
0 164 153
124 162 56
219 157 92
83 133 90
Binary file modified graphics/pokemon/ogerpon/wellspring/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/ogerpon/wellspring/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions graphics/pokemon/ogerpon/wellspring/normal.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ JASC-PAL
0100
16
148 209 161
0 0 0
42 44 41
21 158 7
74 76 73
0 0 0
61 113 53
11 64 121
61 113 53
74 76 73
15 90 170
0 126 229
53 134 168
Expand Down
6 changes: 3 additions & 3 deletions graphics/pokemon/ogerpon/wellspring/shiny.pal
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ JASC-PAL
0100
16
148 209 161
0 0 0
42 44 41
21 158 7
74 76 73
0 0 0
61 113 53
11 64 121
61 113 53
74 76 73
15 90 170
0 126 229
53 134 168
Expand Down
2 changes: 1 addition & 1 deletion include/battle_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bool32 TryChangeBattleWeather(u32 battler, u32 weatherEnumId, bool32 viaAbility)
u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 moveArg);
bool32 TryPrimalReversion(u32 battler);
bool32 IsNeutralizingGasOnField(void);
bool32 IsMoldBreakerTypeAbility(u32 ability);
bool32 IsMoldBreakerTypeAbility(u32 battler, u32 ability);
u32 GetBattlerAbility(u32 battler);
u32 IsAbilityOnSide(u32 battler, u32 ability);
u32 IsAbilityOnOpposingSide(u32 battler, u32 ability);
Expand Down
10 changes: 7 additions & 3 deletions include/constants/battle_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,13 @@
#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_YELLOW (ANIM_SPRITES_START + 393)
#define ANIM_TAG_TERA_CRYSTAL (ANIM_SPRITES_START + 394)
#define ANIM_TAG_TERA_SHATTER (ANIM_SPRITES_START + 395)
#define ANIM_TAG_DREEPY_SHINY (ANIM_SPRITES_START + 396)
#define ANIM_TAG_IVY_CUDGEL_GRASS (ANIM_SPRITES_START + 394)
#define ANIM_TAG_IVY_CUDGEL_FIRE (ANIM_SPRITES_START + 395)
#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
#define ANIM_ATTACKER 0
Expand Down
1 change: 1 addition & 0 deletions include/constants/field_weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define NUM_FOG_DIAGONAL_SPRITES 20
#define NUM_SANDSTORM_SPRITES 20
#define NUM_SWIRL_SANDSTORM_SPRITES 5
#define NUM_SNOWFLAKE_SPRITES 16

// Controls how the weather should be changing the screen palettes.
#define WEATHER_PAL_STATE_CHANGING_WEATHER 0
Expand Down
5 changes: 5 additions & 0 deletions include/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -2873,6 +2873,11 @@ extern const u32 gBattleAnimSpriteGfx_SyrupShell[];
extern const u32 gBattleAnimSpriteGfx_SyrupSplat[];
extern const u32 gBattleAnimSpritePal_SyrupRed[];
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_Ghost[];
Expand Down
6 changes: 3 additions & 3 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ bool32 DoesBattlerIgnoreAbilityChecks(u32 atkAbility, u32 move)
if (AI_THINKING_STRUCT->aiFlags[sBattler_AI] & AI_FLAG_NEGATE_UNAWARE)
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 FALSE;
Expand Down Expand Up @@ -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)
{
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
|| DoesSubstituteBlockMove(battlerAtk, battlerDef, move)
|| AI_IsSlower(battlerAtk, battlerDef, move))) // Opponent goes first
Expand Down Expand Up @@ -2990,7 +2990,7 @@ bool32 ShouldFakeOut(u32 battlerAtk, u32 battlerDef, u32 move)
|| AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND
|| AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_COVERT_CLOAK
|| 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)))
return FALSE;

Expand Down
17 changes: 16 additions & 1 deletion src/battle_anim.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static void Cmd_stopsound(void);
static void Cmd_createvisualtaskontargets(void);
static void Cmd_createspriteontargets(void);
static void Cmd_createspriteontargets_onpos(void);
static void Cmd_jumpifmovetypeequal(void);
static void Cmd_createdragondartsprite(void);
static void RunAnimScriptCommand(void);
static void Task_UpdateMonBg(u8 taskId);
Expand Down Expand Up @@ -177,7 +178,8 @@ static void (* const sScriptCmdTable[])(void) =
Cmd_createvisualtaskontargets, // 0x30
Cmd_createspriteontargets, // 0x31
Cmd_createspriteontargets_onpos, // 0x32
Cmd_createdragondartsprite, // 0x33
Cmd_jumpifmovetypeequal, // 0x33
Cmd_createdragondartsprite, // 0x34
};

void ClearBattleAnimationVars(void)
Expand Down Expand Up @@ -2141,6 +2143,19 @@ static void Cmd_stopsound(void)
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)
{
s32 i;
Expand Down
Loading

0 comments on commit 18aff2d

Please sign in to comment.