Cleaned up remaining Castform hack stuff (#3063)

* Removed gCastformFrontSpriteCoords

* Removed sCastformElevations and IsCastformForm

* Removed sCastformBackSpriteYCoords and castformPalette in BattleStruct

* Scrubbed unused BS commands

* Removed B_ANIM_CASTFORM_CHANGE and BattleForm constants

* Removed redundant function in Pokémon Debug menu

* Removed handling in animation scripts

* Removed gBattleMonForms

* Reduced MAX_MON_PIC_FRAMES to 2

* Removed Castform/Cherrim makefile stuff

* Fixed weather form change tests not checking species.

* Fixed Castform palettes after Lunos' PR
This commit is contained in:
Eduardo Quezada D'Ottone 2023-06-30 03:58:07 -04:00 committed by GitHub
parent ea7e6265dd
commit 81e59ace25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 225 additions and 395 deletions

View File

@ -1186,11 +1186,11 @@
.byte 0xe5 .byte 0xe5
.endm .endm
.macro doweatherformchangeanimation .macro unused3
.byte 0xe6 .byte 0xe6
.endm .endm
.macro tryweatherformdatachange .macro unused4
.byte 0xe7 .byte 0xe7
.endm .endm

View File

@ -910,7 +910,6 @@ gBattleAnims_StatusConditions::
.align 2 .align 2
gBattleAnims_General:: gBattleAnims_General::
.4byte General_WeatherFormChange @ B_ANIM_CASTFORM_CHANGE
.4byte General_StatsChange @ B_ANIM_STATS_CHANGE .4byte General_StatsChange @ B_ANIM_STATS_CHANGE
.4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE .4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE
.4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR .4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR
@ -24282,7 +24281,7 @@ Move_TRANSFORM:
monbg ANIM_ATTACKER monbg ANIM_ATTACKER
playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER
waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48 waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48
createvisualtask AnimTask_TransformMon, 2, 0, 0, 1 createvisualtask AnimTask_TransformMon, 2, 0, 1
waitforvisualfinish waitforvisualfinish
clearmonbg ANIM_ATTACKER clearmonbg ANIM_ATTACKER
end end
@ -26364,22 +26363,6 @@ Status_Nightmare:
Status_Powder: Status_Powder:
end end
General_WeatherFormChange:
createvisualtask AnimTask_IsMonInvisible, 2
jumpreteq TRUE, WeatherFormChangeSkipAnim
goto WeatherFormChangeContinue
WeatherFormChangeContinue:
monbg ANIM_ATTACKER
playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER
waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48
createvisualtask AnimTask_TransformMon, 2, 1, 0, 0
waitforvisualfinish
clearmonbg ANIM_ATTACKER
end
WeatherFormChangeSkipAnim:
createvisualtask AnimTask_CastformGfxDataChange, 2, 1
end
General_StatsChange: General_StatsChange:
createvisualtask AnimTask_StatsChange, 5 createvisualtask AnimTask_StatsChange, 5
waitforvisualfinish waitforvisualfinish
@ -26798,14 +26781,14 @@ General_WishHeal:
General_IllusionOff: General_IllusionOff:
monbg ANIM_TARGET monbg ANIM_TARGET
createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 createvisualtask AnimTask_TransformMon, 2, 1, 0
waitforvisualfinish waitforvisualfinish
clearmonbg ANIM_TARGET clearmonbg ANIM_TARGET
end end
General_FormChange: General_FormChange:
monbg ANIM_ATTACKER monbg ANIM_ATTACKER
createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 createvisualtask AnimTask_TransformMon, 2, 1, 0
waitforvisualfinish waitforvisualfinish
clearmonbg ANIM_ATTACKER clearmonbg ANIM_ATTACKER
end end
@ -26834,7 +26817,7 @@ General_MegaEvolution:
delay 20 delay 20
createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA
waitforvisualfinish waitforvisualfinish
createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 createvisualtask AnimTask_TransformMon, 2, 1, 0
createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA
createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14
waitforvisualfinish waitforvisualfinish
@ -26980,7 +26963,7 @@ General_PrimalReversion_Alpha:
delay 20 delay 20
createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA
waitforvisualfinish waitforvisualfinish
createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 createvisualtask AnimTask_TransformMon, 2, 1, 0
createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA
createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14
waitforvisualfinish waitforvisualfinish
@ -27007,7 +26990,7 @@ General_PrimalReversion_Omega:
delay 20 delay 20
createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA
waitforvisualfinish waitforvisualfinish
createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 createvisualtask AnimTask_TransformMon, 2, 1, 0
createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA
createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14
waitforvisualfinish waitforvisualfinish

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

View File

@ -1,6 +1,7 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
90 82 82 90 82 82
205 189 189 205 189 189
@ -12,7 +13,6 @@ JASC-PAL
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0
148 148 148 148 148 148
74 82 74 74 82 74
255 255 255 255 255 255

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 506 B

View File

@ -1,12 +1,12 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
57 65 90 57 65 90
98 115 189 98 115 189
115 139 213 115 139 213
148 180 205 148 180 205
0 0 0
205 238 246 205 238 246
180 197 222 180 197 222
139 205 222 139 205 222

View File

@ -1,12 +1,12 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
57 65 90 57 65 90
98 115 189 98 115 189
115 139 213 115 139 213
148 180 205 148 180 205
0 0 0
205 238 246 205 238 246
180 197 222 180 197 222
139 205 222 139 205 222

View File

@ -1,6 +1,7 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
98 90 90 98 90 90
205 164 189 205 164 189
@ -12,7 +13,6 @@ JASC-PAL
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0
148 148 148 148 148 148
74 82 74 74 82 74
255 255 255 255 255 255

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 B

After

Width:  |  Height:  |  Size: 665 B

View File

@ -1,12 +1,12 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
41 82 57 41 82 57
123 82 189 123 82 189
139 115 213 139 115 213
148 180 205 148 180 205
0 0 0
197 180 255 197 180 255
156 156 197 156 156 197
139 205 172 139 205 172

View File

@ -1,12 +1,12 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
41 82 57 41 82 57
123 82 189 123 82 189
139 115 213 139 115 213
148 180 205 148 180 205
0 0 0
197 180 255 197 180 255
156 156 197 156 156 197
139 205 172 139 205 172

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 607 B

View File

@ -1,6 +1,7 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
98 49 41 98 49 41
205 90 74 205 90 74
@ -13,7 +14,6 @@ JASC-PAL
213 131 74 213 131 74
148 90 65 148 90 65
213 205 230 213 205 230
0 0 0
90 90 82 90 90 82
255 255 255 255 255 255
24 24 24 24 24 24

View File

@ -1,6 +1,7 @@
JASC-PAL JASC-PAL
0100 0100
16 16
248 160 176
197 197 148 197 197 148
98 49 41 98 49 41
205 90 74 205 90 74
@ -13,7 +14,6 @@ JASC-PAL
213 131 74 213 131 74
148 90 65 148 90 65
213 205 230 213 205 230
0 0 0
90 90 82 90 90 82
255 255 255 255 255 255
24 24 24 24 24 24

View File

@ -1,5 +1,3 @@
CASTFORMGFXDIR := graphics/pokemon/castform
CHERRIMGFXDIR := graphics/pokemon/cherrim
TILESETGFXDIR := data/tilesets TILESETGFXDIR := data/tilesets
FONTGFXDIR := graphics/fonts FONTGFXDIR := graphics/fonts
INTERFACEGFXDIR := graphics/interface INTERFACEGFXDIR := graphics/interface
@ -27,60 +25,6 @@ SPINDAGFXDIR := graphics/spinda_spots
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy
contest_types := cool beauty cute smart tough contest_types := cool beauty cute smart tough
### Cherrim ###
$(CHERRIMGFXDIR)/front.4bpp: $(CHERRIMGFXDIR)/normal/front.4bpp \
$(CHERRIMGFXDIR)/sunshine/front.4bpp
@cat $^ >$@
$(CHERRIMGFXDIR)/back.4bpp: $(CHERRIMGFXDIR)/normal/back.4bpp \
$(CHERRIMGFXDIR)/sunshine/back.4bpp
@cat $^ >$@
$(CHERRIMGFXDIR)/anim_front.4bpp: $(CHERRIMGFXDIR)/normal/anim_front.4bpp \
$(CHERRIMGFXDIR)/sunshine/anim_front.4bpp
@cat $^ >$@
$(CHERRIMGFXDIR)/normal.gbapal: $(CHERRIMGFXDIR)/normal/normal.gbapal \
$(CHERRIMGFXDIR)/sunshine/normal.gbapal
@cat $^ >$@
$(CHERRIMGFXDIR)/shiny.gbapal: $(CHERRIMGFXDIR)/normal/shiny.gbapal \
$(CHERRIMGFXDIR)/sunshine/shiny.gbapal
@cat $^ >$@
### Castform ###
$(CASTFORMGFXDIR)/front.4bpp: $(CASTFORMGFXDIR)/normal/front.4bpp \
$(CASTFORMGFXDIR)/sunny/front.4bpp \
$(CASTFORMGFXDIR)/rainy/front.4bpp \
$(CASTFORMGFXDIR)/snowy/front.4bpp
@cat $^ >$@
$(CASTFORMGFXDIR)/back.4bpp: $(CASTFORMGFXDIR)/normal/back.4bpp \
$(CASTFORMGFXDIR)/sunny/back.4bpp \
$(CASTFORMGFXDIR)/rainy/back.4bpp \
$(CASTFORMGFXDIR)/snowy/back.4bpp
@cat $^ >$@
$(CASTFORMGFXDIR)/anim_front.4bpp: $(CASTFORMGFXDIR)/normal/anim_front.4bpp \
$(CASTFORMGFXDIR)/sunny/anim_front.4bpp \
$(CASTFORMGFXDIR)/rainy/anim_front.4bpp \
$(CASTFORMGFXDIR)/snowy/anim_front.4bpp
@cat $^ >$@
$(CASTFORMGFXDIR)/normal.gbapal: $(CASTFORMGFXDIR)/normal/normal.gbapal \
$(CASTFORMGFXDIR)/sunny/normal.gbapal \
$(CASTFORMGFXDIR)/rainy/normal.gbapal \
$(CASTFORMGFXDIR)/snowy/normal.gbapal
@cat $^ >$@
$(CASTFORMGFXDIR)/shiny.gbapal: $(CASTFORMGFXDIR)/normal/shiny.gbapal \
$(CASTFORMGFXDIR)/sunny/shiny.gbapal \
$(CASTFORMGFXDIR)/rainy/shiny.gbapal \
$(CASTFORMGFXDIR)/snowy/shiny.gbapal
@cat $^ >$@
### Tilesets ### ### Tilesets ###
$(TILESETGFXDIR)/secondary/petalburg/tiles.4bpp: %.4bpp: %.png $(TILESETGFXDIR)/secondary/petalburg/tiles.4bpp: %.4bpp: %.png

View File

@ -585,7 +585,6 @@ struct BattleStruct
u8 turnSideTracker; u8 turnSideTracker;
u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party. u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party.
u16 lastTakenMoveFrom[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT]; // a 2-D array [target][attacker] u16 lastTakenMoveFrom[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT]; // a 2-D array [target][attacker]
u16 castformPalette[NUM_CASTFORM_FORMS][16];
union { union {
struct LinkBattlerHeader linkBattlerHeader; struct LinkBattlerHeader linkBattlerHeader;
u32 battleVideo[2]; u32 battleVideo[2];
@ -988,7 +987,6 @@ extern struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData;
extern struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData; extern struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData;
extern u16 gBattleMovePower; extern u16 gBattleMovePower;
extern u16 gMoveToLearn; extern u16 gMoveToLearn;
extern u8 gBattleMonForms[MAX_BATTLERS_COUNT];
extern u32 gFieldStatuses; extern u32 gFieldStatuses;
extern struct FieldTimer gFieldTimers; extern struct FieldTimer gFieldTimers;
extern u8 gBattlerAbility; extern u8 gBattlerAbility;

View File

@ -23,7 +23,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId);
void ClearSpritesHealthboxAnimData(void); void ClearSpritesHealthboxAnimData(void);
void CopyAllBattleSpritesInvisibilities(void); void CopyAllBattleSpritesInvisibilities(void);
void CopyBattleSpriteInvisibility(u8 battlerId); void CopyBattleSpriteInvisibility(u8 battlerId);
void HandleSpeciesGfxDataChange(u8 attacker, u8 target, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality); void HandleSpeciesGfxDataChange(u8 attacker, u8 target, bool32 megaEvo, bool8 trackEnemyPersonality);
void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite); void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite);
void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId); void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId);
void TrySetBehindSubstituteSpriteBit(u8 battlerId, u16 move); void TrySetBehindSubstituteSpriteBit(u8 battlerId, u16 move);

View File

@ -423,16 +423,6 @@
#define B_WAIT_TIME_SHORT (B_WAIT_TIME_MULTIPLIER * 2) #define B_WAIT_TIME_SHORT (B_WAIT_TIME_MULTIPLIER * 2)
#define B_WAIT_TIME_SHORTEST (B_WAIT_TIME_MULTIPLIER) #define B_WAIT_TIME_SHORTEST (B_WAIT_TIME_MULTIPLIER)
#define CHERRIM_OVERCAST 0
#define CHERRIM_SUNSHINE 1
#define CASTFORM_NORMAL 0
#define CASTFORM_FIRE 1
#define CASTFORM_WATER 2
#define CASTFORM_ICE 3
#define NUM_CASTFORM_FORMS 4
#define CASTFORM_SUBSTITUTE (1 << 7)
#define FLEE_ITEM 1 #define FLEE_ITEM 1
#define FLEE_ABILITY 2 #define FLEE_ABILITY 2

View File

@ -510,44 +510,43 @@
#define BG_CHLOROBLAST 80 #define BG_CHLOROBLAST 80
// table ids for general animations (gBattleAnims_General) // table ids for general animations (gBattleAnims_General)
#define B_ANIM_CASTFORM_CHANGE 0 #define B_ANIM_STATS_CHANGE 0
#define B_ANIM_STATS_CHANGE 1 #define B_ANIM_SUBSTITUTE_FADE 1
#define B_ANIM_SUBSTITUTE_FADE 2 #define B_ANIM_SUBSTITUTE_APPEAR 2
#define B_ANIM_SUBSTITUTE_APPEAR 3 #define B_ANIM_POKEBLOCK_THROW 3
#define B_ANIM_POKEBLOCK_THROW 4 #define B_ANIM_ITEM_KNOCKOFF 4
#define B_ANIM_ITEM_KNOCKOFF 5 #define B_ANIM_TURN_TRAP 5
#define B_ANIM_TURN_TRAP 6 #define B_ANIM_HELD_ITEM_EFFECT 6
#define B_ANIM_HELD_ITEM_EFFECT 7 #define B_ANIM_SMOKEBALL_ESCAPE 7
#define B_ANIM_SMOKEBALL_ESCAPE 8 #define B_ANIM_HANGED_ON 8
#define B_ANIM_HANGED_ON 9 #define B_ANIM_RAIN_CONTINUES 9
#define B_ANIM_RAIN_CONTINUES 10 #define B_ANIM_SUN_CONTINUES 10
#define B_ANIM_SUN_CONTINUES 11 #define B_ANIM_SANDSTORM_CONTINUES 11
#define B_ANIM_SANDSTORM_CONTINUES 12 #define B_ANIM_HAIL_CONTINUES 12
#define B_ANIM_HAIL_CONTINUES 13 #define B_ANIM_LEECH_SEED_DRAIN 13
#define B_ANIM_LEECH_SEED_DRAIN 14 #define B_ANIM_MON_HIT 14
#define B_ANIM_MON_HIT 15 #define B_ANIM_ITEM_STEAL 15
#define B_ANIM_ITEM_STEAL 16 #define B_ANIM_SNATCH_MOVE 16
#define B_ANIM_SNATCH_MOVE 17 #define B_ANIM_FUTURE_SIGHT_HIT 17
#define B_ANIM_FUTURE_SIGHT_HIT 18 #define B_ANIM_DOOM_DESIRE_HIT 18
#define B_ANIM_DOOM_DESIRE_HIT 19 #define B_ANIM_FOCUS_PUNCH_SETUP 19
#define B_ANIM_FOCUS_PUNCH_SETUP 20 #define B_ANIM_INGRAIN_HEAL 20
#define B_ANIM_INGRAIN_HEAL 21 #define B_ANIM_WISH_HEAL 21
#define B_ANIM_WISH_HEAL 22 #define B_ANIM_MEGA_EVOLUTION 22
#define B_ANIM_MEGA_EVOLUTION 23 #define B_ANIM_ILLUSION_OFF 23
#define B_ANIM_ILLUSION_OFF 24 #define B_ANIM_FORM_CHANGE 24
#define B_ANIM_FORM_CHANGE 25 #define B_ANIM_SLIDE_OFFSCREEN 25 // for Emergency Exit
#define B_ANIM_SLIDE_OFFSCREEN 26 // for Emergency Exit #define B_ANIM_RESTORE_BG 26 // for Terrain Endings
#define B_ANIM_RESTORE_BG 27 // for Terrain Endings #define B_ANIM_TOTEM_FLARE 27 // Totem boosts aura flare
#define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare #define B_ANIM_GULP_MISSILE 28
#define B_ANIM_GULP_MISSILE 29 #define B_ANIM_STRONG_WINDS 29
#define B_ANIM_STRONG_WINDS 30 #define B_ANIM_PRIMAL_REVERSION 30
#define B_ANIM_PRIMAL_REVERSION 31 #define B_ANIM_AQUA_RING_HEAL 31
#define B_ANIM_AQUA_RING_HEAL 32 #define B_ANIM_BEAK_BLAST_SETUP 32
#define B_ANIM_BEAK_BLAST_SETUP 33 #define B_ANIM_SHELL_TRAP_SETUP 33
#define B_ANIM_SHELL_TRAP_SETUP 34 #define B_ANIM_ZMOVE_ACTIVATE 34 // Using Z Moves
#define B_ANIM_ZMOVE_ACTIVATE 35 // Using Z Moves #define B_ANIM_AFFECTION_HANGED_ON 35
#define B_ANIM_AFFECTION_HANGED_ON 36 #define B_ANIM_SNOW_CONTINUES 36
#define B_ANIM_SNOW_CONTINUES 37
// special animations table (gBattleAnims_Special) // special animations table (gBattleAnims_Special)
#define B_ANIM_LVL_UP 0 #define B_ANIM_LVL_UP 0

View File

@ -333,11 +333,10 @@
// Most pokemon have 2 frames (a default and an alternate for their animation). // Most pokemon have 2 frames (a default and an alternate for their animation).
// There are 4 exceptions: // There are 4 exceptions:
// - Castform has 4 frames, 1 for each form
// - Deoxys has 2 frames, 1 for each form // - Deoxys has 2 frames, 1 for each form
// - Spinda has 1 frame, presumably to avoid the work of animating its spots // - Spinda has 1 frame, presumably to avoid the work of animating its spots
// - Unown has 1 frame, presumably to avoid the work of animating all 28 of its forms // - Unown has 1 frame, presumably to avoid the work of animating all 28 of its forms
#define MAX_MON_PIC_FRAMES 4 #define MAX_MON_PIC_FRAMES 2
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0 #define BATTLE_ALIVE_EXCEPT_ACTIVE 0
#define BATTLE_ALIVE_ATK_SIDE 1 #define BATTLE_ALIVE_ATK_SIDE 1

View File

@ -527,7 +527,6 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon); u8 GetNumberOfRelearnableMoves(struct Pokemon *mon);
u16 SpeciesToPokedexNum(u16 species); u16 SpeciesToPokedexNum(u16 species);
bool32 IsSpeciesInHoennDex(u16 species); bool32 IsSpeciesInHoennDex(u16 species);
void ClearBattleMonForms(void);
u16 GetBattleBGM(void); u16 GetBattleBGM(void);
void PlayBattleBGM(void); void PlayBattleBGM(void);
void PlayMapChosenOrBattleBGM(u16 songId); void PlayMapChosenOrBattleBGM(u16 songId);

View File

@ -2349,7 +2349,6 @@ void AnimTask_TransformMon(u8 taskId)
gTasks[taskId].data[10] = gBattleAnimArgs[0]; gTasks[taskId].data[10] = gBattleAnimArgs[0];
gTasks[taskId].data[11] = gBattleAnimArgs[1]; gTasks[taskId].data[11] = gBattleAnimArgs[1];
gTasks[taskId].data[12] = gBattleAnimArgs[2];
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
case 1: case 1:
@ -2364,7 +2363,7 @@ void AnimTask_TransformMon(u8 taskId)
} }
break; break;
case 2: case 2:
HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gTasks[taskId].data[11], gTasks[taskId].data[12]); HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gTasks[taskId].data[11]);
GetBgDataForTransform(&animBg, gBattleAnimAttacker); GetBgDataForTransform(&animBg, gBattleAnimAttacker);
if (IsContest()) if (IsContest())
@ -2372,7 +2371,7 @@ void AnimTask_TransformMon(u8 taskId)
else else
position = GetBattlerPosition(gBattleAnimAttacker); position = GetBattlerPosition(gBattleAnimAttacker);
src = gMonSpritesGfxPtr->sprites.ptr[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); src = gMonSpritesGfxPtr->sprites.ptr[position];
dest = animBg.bgTiles; dest = animBg.bgTiles;
CpuCopy32(src, dest, MON_PIC_SIZE); CpuCopy32(src, dest, MON_PIC_SIZE);
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);
@ -2449,12 +2448,6 @@ void AnimTask_IsMonInvisible(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void AnimTask_CastformGfxDataChange(u8 taskId)
{
HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE, FALSE, FALSE);
DestroyAnimVisualTask(taskId);
}
void AnimTask_MorningSunLightBeam(u8 taskId) void AnimTask_MorningSunLightBeam(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;

View File

@ -52,32 +52,6 @@ const struct UCoords8 sBattlerCoords[][MAX_BATTLERS_COUNT] =
}, },
}; };
// One entry for each of the four Castform forms.
const struct MonCoords gCastformFrontSpriteCoords[NUM_CASTFORM_FORMS] =
{
[CASTFORM_NORMAL] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 17 },
[CASTFORM_FIRE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 },
[CASTFORM_WATER] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 },
[CASTFORM_ICE] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 },
};
const u8 sCastformElevations[NUM_CASTFORM_FORMS] =
{
[CASTFORM_NORMAL] = 13,
[CASTFORM_FIRE] = 14,
[CASTFORM_WATER] = 13,
[CASTFORM_ICE] = 13,
};
// Y position of the backsprite for each of the four Castform forms.
static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] =
{
[CASTFORM_NORMAL] = 0,
[CASTFORM_FIRE] = 0,
[CASTFORM_WATER] = 0,
[CASTFORM_ICE] = 0,
};
// Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch) // Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch)
#define TAG_MOVE_EFFECT_MON_1 55125 #define TAG_MOVE_EFFECT_MON_1 55125
#define TAG_MOVE_EFFECT_MON_2 55126 #define TAG_MOVE_EFFECT_MON_2 55126
@ -197,10 +171,6 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species)
coordSpecies = GetUnownSpeciesId(personality); coordSpecies = GetUnownSpeciesId(personality);
ret = gMonBackPicCoords[coordSpecies].y_offset; ret = gMonBackPicCoords[coordSpecies].y_offset;
} }
else if (species == SPECIES_CASTFORM)
{
ret = sCastformBackSpriteYCoords[gBattleMonForms[battlerId]];
}
else if (species > NUM_SPECIES) else if (species > NUM_SPECIES)
{ {
ret = gMonBackPicCoords[0].y_offset; ret = gMonBackPicCoords[0].y_offset;
@ -223,10 +193,6 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species)
coordSpecies = GetUnownSpeciesId(personality); coordSpecies = GetUnownSpeciesId(personality);
ret = gMonFrontPicCoords[coordSpecies].y_offset; ret = gMonFrontPicCoords[coordSpecies].y_offset;
} }
else if (species == SPECIES_CASTFORM)
{
ret = gCastformFrontSpriteCoords[gBattleMonForms[battlerId]].y_offset;
}
else if (species > NUM_SPECIES) else if (species > NUM_SPECIES)
{ {
ret = gMonFrontPicCoords[0].y_offset; ret = gMonFrontPicCoords[0].y_offset;
@ -246,9 +212,7 @@ u8 GetBattlerElevation(u8 battlerId, u16 species)
{ {
if (!IsContest()) if (!IsContest())
{ {
if (species == SPECIES_CASTFORM) if (species > NUM_SPECIES)
ret = sCastformElevations[gBattleMonForms[battlerId]];
else if (species > NUM_SPECIES)
ret = gEnemyMonElevation[0]; ret = gEnemyMonElevation[0];
else else
ret = gEnemyMonElevation[species]; ret = gEnemyMonElevation[species];
@ -1963,10 +1927,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId)
else else
species = spriteInfo[battlerId].transformSpecies; species = spriteInfo[battlerId].transformSpecies;
if (species == SPECIES_CASTFORM) return gMonBackPicCoords[species].y_offset;
return sCastformBackSpriteYCoords[gBattleMonForms[battlerId]];
else
return gMonBackPicCoords[species].y_offset;
} }
else else
{ {
@ -1976,10 +1937,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId)
else else
species = spriteInfo[battlerId].transformSpecies; species = spriteInfo[battlerId].transformSpecies;
if (species == SPECIES_CASTFORM) return gMonFrontPicCoords[species].y_offset;
return sCastformElevations[gBattleMonForms[battlerId]];
else
return gMonFrontPicCoords[species].y_offset;
} }
} }
} }
@ -2201,10 +2159,6 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
species = GetUnownSpeciesId(personality); species = GetUnownSpeciesId(personality);
coords = &gMonBackPicCoords[species]; coords = &gMonBackPicCoords[species];
} }
else if (species == SPECIES_CASTFORM)
{
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
}
else if (species <= SPECIES_EGG) else if (species <= SPECIES_EGG)
{ {
coords = &gMonBackPicCoords[species]; coords = &gMonBackPicCoords[species];
@ -2263,10 +2217,6 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
species = GetUnownSpeciesId(personality); species = GetUnownSpeciesId(personality);
coords = &gMonFrontPicCoords[species]; coords = &gMonFrontPicCoords[species];
} }
else if (species == SPECIES_CASTFORM)
{
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
}
else if (species > NUM_SPECIES) else if (species > NUM_SPECIES)
{ {
coords = &gMonFrontPicCoords[0]; coords = &gMonFrontPicCoords[0];

View File

@ -1129,7 +1129,7 @@ static void LinkOpponentHandleLoadMonSprite(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
@ -1169,7 +1169,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -1025,7 +1025,7 @@ static void LinkPartnerHandleLoadMonSprite(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad;
} }
@ -1061,7 +1061,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -1160,7 +1160,7 @@ static void OpponentHandleLoadMonSprite(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = species; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = species;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
@ -1201,7 +1201,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -2436,7 +2436,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -1213,7 +1213,7 @@ static void PlayerPartnerHandleLoadMonSprite(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad;
} }
@ -1249,7 +1249,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -1118,7 +1118,7 @@ static void RecordedOpponentHandleLoadMonSprite(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
@ -1155,7 +1155,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -1101,7 +1101,7 @@ static void RecordedPlayerHandleLoadMonSprite(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad;
} }
@ -1137,7 +1137,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;

View File

@ -1474,7 +1474,7 @@ static void StartSendOutAnim(u8 battlerId)
gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species;
gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId;
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0);
gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE;
gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy;
gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT);

View File

@ -57,7 +57,6 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
HandleLinkBattleSetup(); HandleLinkBattleSetup();
gBattleControllerExecFlags = 0; gBattleControllerExecFlags = 0;
ClearBattleAnimationVars(); ClearBattleAnimationVars();
ClearBattleMonForms();
BattleAI_SetupItems(); BattleAI_SetupItems();
BattleAI_SetupFlags(); BattleAI_SetupFlags();

View File

@ -434,12 +434,6 @@ bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattler, u8 atkBattler, u8 de
{ {
u8 taskId; u8 taskId;
if (tableId == B_ANIM_CASTFORM_CHANGE && (argument & CASTFORM_SUBSTITUTE))
{
// If Castform is behind substitute, set the new form but skip the animation
gBattleMonForms[activeBattler] = (argument & ~CASTFORM_SUBSTITUTE);
return TRUE;
}
if (gBattleSpritesDataPtr->battlerData[activeBattler].behindSubstitute if (gBattleSpritesDataPtr->battlerData[activeBattler].behindSubstitute
&& !ShouldAnimBeDoneRegardlessOfSubstitute(tableId)) && !ShouldAnimBeDoneRegardlessOfSubstitute(tableId))
{ {
@ -607,13 +601,6 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP); LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
LoadPalette(gDecompressionBuffer, BG_PLTT_ID(8) + BG_PLTT_ID(battlerId), PLTT_SIZE_4BPP); LoadPalette(gDecompressionBuffer, BG_PLTT_ID(8) + BG_PLTT_ID(battlerId), PLTT_SIZE_4BPP);
if (species == SPECIES_CASTFORM || species == SPECIES_CHERRIM)
{
paletteOffset = OBJ_PLTT_ID(battlerId);
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, PLTT_SIZE_4BPP);
}
// transform's pink color // transform's pink color
if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE)
{ {
@ -860,7 +847,7 @@ void CopyBattleSpriteInvisibility(u8 battlerId)
gBattleSpritesDataPtr->battlerData[battlerId].invisible = gSprites[gBattlerSpriteIds[battlerId]].invisible; gBattleSpritesDataPtr->battlerData[battlerId].invisible = gSprites[gBattlerSpriteIds[battlerId]].invisible;
} }
void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality) void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bool8 trackEnemyPersonality)
{ {
u32 personalityValue, otId, position, paletteOffset, targetSpecies; u32 personalityValue, otId, position, paletteOffset, targetSpecies;
const void *lzPaletteData, *src; const void *lzPaletteData, *src;
@ -930,54 +917,26 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
gTransformedPersonalities[battlerAtk]); gTransformedPersonalities[battlerAtk]);
} }
} }
src = gMonSpritesGfxPtr->sprites.ptr[position];
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
DmaCopy32(3, src, dst, MON_PIC_SIZE);
paletteOffset = OBJ_PLTT_ID(battlerAtk);
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
if (castform) if (!megaEvo)
{ {
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleSpritesDataPtr->animationData->animArg); BlendPalette(paletteOffset, 16, 6, RGB_WHITE);
paletteOffset = OBJ_PLTT_ID(battlerAtk); CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16));
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); if (!IsContest())
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
LoadPalette(gBattleStruct->castformPalette[gBattleSpritesDataPtr->animationData->animArg], paletteOffset, PLTT_SIZE_4BPP);
gBattleMonForms[battlerAtk] = gBattleSpritesDataPtr->animationData->animArg;
if (gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies != SPECIES_NONE)
{
BlendPalette(paletteOffset, 16, 6, RGB_WHITE);
CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16));
}
gSprites[gBattlerSpriteIds[battlerAtk]].y = GetBattlerSpriteDefault_Y(battlerAtk);
}
else
{
src = gMonSpritesGfxPtr->sprites.ptr[position];
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
DmaCopy32(3, src, dst, MON_PIC_SIZE);
paletteOffset = OBJ_PLTT_ID(battlerAtk);
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
if (targetSpecies == SPECIES_CASTFORM || targetSpecies == SPECIES_CHERRIM)
{
gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies];
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, PLTT_SIZE_4BPP);
}
if (!megaEvo)
{
BlendPalette(paletteOffset, 16, 6, RGB_WHITE);
CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16));
}
if (!IsContest() && !megaEvo)
{ {
gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies = targetSpecies; gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies = targetSpecies;
gBattleMonForms[battlerAtk] = gBattleMonForms[battlerDef];
} }
gSprites[gBattlerSpriteIds[battlerAtk]].y = GetBattlerSpriteDefault_Y(battlerAtk);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleMonForms[battlerAtk]);
} }
gSprites[gBattlerSpriteIds[battlerAtk]].y = GetBattlerSpriteDefault_Y(battlerAtk);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], 0);
} }
void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
@ -1021,7 +980,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId) void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId)
{ {
BattleLoadSubstituteOrMonSpriteGfx(battlerId, loadMonSprite); BattleLoadSubstituteOrMonSpriteGfx(battlerId, loadMonSprite);
StartSpriteAnim(&gSprites[spriteId], gBattleMonForms[battlerId]); StartSpriteAnim(&gSprites[spriteId], 0);
if (!loadMonSprite) if (!loadMonSprite)
gSprites[spriteId].y = GetSubstituteSpriteDefault_Y(battlerId); gSprites[spriteId].y = GetSubstituteSpriteDefault_Y(battlerId);
@ -1232,7 +1191,6 @@ void FillAroundBattleWindows(void)
void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute) void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute)
{ {
gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies = SPECIES_NONE; gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies = SPECIES_NONE;
gBattleMonForms[battlerId] = 0;
if (!dontClearSubstitute) if (!dontClearSubstitute)
ClearBehindSubstituteBit(battlerId); ClearBehindSubstituteBit(battlerId);
} }

View File

@ -589,7 +589,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8
int i, j; int i, j;
u8 battler = GetBattlerAtPosition(battlerPosition); u8 battler = GetBattlerAtPosition(battlerPosition);
int offset = tilesOffset; int offset = tilesOffset;
CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition] + BG_SCREEN_SIZE * gBattleMonForms[battler], tiles, BG_SCREEN_SIZE); CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition], tiles, BG_SCREEN_SIZE);
LoadBgTiles(bgId, tiles, 0x1000, tilesOffset); LoadBgTiles(bgId, tiles, 0x1000, tilesOffset);
for (i = y; i < y + 8; i++) for (i = y; i < y + 8; i++)
{ {

View File

@ -234,7 +234,6 @@ EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData =
EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData = NULL; // Never read EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData = NULL; // Never read
EWRAM_DATA u16 gBattleMovePower = 0; EWRAM_DATA u16 gBattleMovePower = 0;
EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u16 gMoveToLearn = 0;
EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA u32 gFieldStatuses = 0; EWRAM_DATA u32 gFieldStatuses = 0;
EWRAM_DATA struct FieldTimer gFieldTimers = {0}; EWRAM_DATA struct FieldTimer gFieldTimers = {0};
EWRAM_DATA u8 gBattlerAbility = 0; EWRAM_DATA u8 gBattlerAbility = 0;
@ -2784,7 +2783,6 @@ static void SpriteCB_Flicker(struct Sprite *sprite)
#undef sDelay #undef sDelay
extern const struct MonCoords gMonFrontPicCoords[]; extern const struct MonCoords gMonFrontPicCoords[];
extern const struct MonCoords gCastformFrontSpriteCoords[];
void SpriteCB_FaintOpponentMon(struct Sprite *sprite) void SpriteCB_FaintOpponentMon(struct Sprite *sprite)
{ {
@ -2805,10 +2803,6 @@ void SpriteCB_FaintOpponentMon(struct Sprite *sprite)
species = GetUnownSpeciesId(personality); species = GetUnownSpeciesId(personality);
yOffset = gMonFrontPicCoords[species].y_offset; yOffset = gMonFrontPicCoords[species].y_offset;
} }
else if (species == SPECIES_CASTFORM)
{
yOffset = gCastformFrontSpriteCoords[gBattleMonForms[battler]].y_offset;
}
else if (species > NUM_SPECIES) else if (species > NUM_SPECIES)
{ {
yOffset = gMonFrontPicCoords[SPECIES_NONE].y_offset; yOffset = gMonFrontPicCoords[SPECIES_NONE].y_offset;
@ -2838,12 +2832,12 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
} }
else // Erase bottom part of the sprite to create a smooth illusion of mon falling down. else // Erase bottom part of the sprite to create a smooth illusion of mon falling down.
{ {
u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8); u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (sprite->data[3] << 8);
for (i = 0; i < 0x100; i++) for (i = 0; i < 0x100; i++)
*(dst++) = 0; *(dst++) = 0;
StartSpriteAnim(sprite, gBattleMonForms[sprite->sBattler]); StartSpriteAnim(sprite, 0);
} }
} }
} }

View File

@ -585,8 +585,8 @@ static void Cmd_switchoutabilities(void);
static void Cmd_jumpifhasnohp(void); static void Cmd_jumpifhasnohp(void);
static void Cmd_getsecretpowereffect(void); static void Cmd_getsecretpowereffect(void);
static void Cmd_pickup(void); static void Cmd_pickup(void);
static void Cmd_doweatherformchangeanimation(void); static void Cmd_unused3(void);
static void Cmd_tryweatherformdatachange(void); static void Cmd_unused4(void);
static void Cmd_settypebasedhalvers(void); static void Cmd_settypebasedhalvers(void);
static void Cmd_jumpifsubstituteblocks(void); static void Cmd_jumpifsubstituteblocks(void);
static void Cmd_tryrecycleitem(void); static void Cmd_tryrecycleitem(void);
@ -844,8 +844,8 @@ void (* const gBattleScriptingCommandsTable[])(void) =
Cmd_jumpifhasnohp, //0xE3 Cmd_jumpifhasnohp, //0xE3
Cmd_getsecretpowereffect, //0xE4 Cmd_getsecretpowereffect, //0xE4
Cmd_pickup, //0xE5 Cmd_pickup, //0xE5
Cmd_doweatherformchangeanimation, //0xE6 Cmd_unused3, //0xE6
Cmd_tryweatherformdatachange, //0xE7 Cmd_unused4, //0xE7
Cmd_settypebasedhalvers, //0xE8 Cmd_settypebasedhalvers, //0xE8
Cmd_jumpifsubstituteblocks, //0xE9 Cmd_jumpifsubstituteblocks, //0xE9
Cmd_tryrecycleitem, //0xEA Cmd_tryrecycleitem, //0xEA
@ -15139,26 +15139,12 @@ static void Cmd_pickup(void)
gBattlescriptCurrInstr = cmd->nextInstr; gBattlescriptCurrInstr = cmd->nextInstr;
} }
static void Cmd_doweatherformchangeanimation(void) static void Cmd_unused3(void)
{ {
CMD_ARGS();
gActiveBattler = gBattleScripting.battler;
if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE)
*(&gBattleStruct->formToChangeInto) |= CASTFORM_SUBSTITUTE;
BtlController_EmitBattleAnimation(BUFFER_A, B_ANIM_CASTFORM_CHANGE, gBattleStruct->formToChangeInto);
MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr = cmd->nextInstr;
} }
static void Cmd_tryweatherformdatachange(void) static void Cmd_unused4(void)
{ {
CMD_ARGS();
// removed in favor of new form system
} }
// Water and Mud Sport // Water and Mud Sport

View File

@ -1189,7 +1189,6 @@ void CB2_StartContest(void)
FreeAllSpritePalettes(); FreeAllSpritePalettes();
gReservedSpritePaletteCount = 4; gReservedSpritePaletteCount = 4;
eContestDebugMode = CONTEST_DEBUG_MODE_OFF; eContestDebugMode = CONTEST_DEBUG_MODE_OFF;
ClearBattleMonForms();
InitContestResources(); InitContestResources();
gMain.state++; gMain.state++;
break; break;
@ -1778,8 +1777,6 @@ static void Task_DoAppeals(u8 taskId)
} }
return; return;
case APPEALSTATE_SLIDE_MON_IN: case APPEALSTATE_SLIDE_MON_IN:
for (i = 0; i < CONTESTANT_COUNT; i++)
gBattleMonForms[i] = 0;
memset(gContestResources->moveAnim, 0, sizeof(*gContestResources->moveAnim)); memset(gContestResources->moveAnim, 0, sizeof(*gContestResources->moveAnim));
SetMoveAnimAttackerData(eContest.currentContestant); SetMoveAnimAttackerData(eContest.currentContestant);
spriteId = CreateContestantSprite( spriteId = CreateContestantSprite(
@ -5312,8 +5309,6 @@ static void SetMoveSpecificAnimData(u8 contestant)
memset(&gContestResources->moveAnim->species, 0, 20); memset(&gContestResources->moveAnim->species, 0, 20);
ClearBattleAnimationVars(); ClearBattleAnimationVars();
for (i = 0; i < CONTESTANT_COUNT; i++)
gBattleMonForms[i] = 0;
switch (move) switch (move)
{ {
case MOVE_CURSE: case MOVE_CURSE:

View File

@ -279,24 +279,10 @@ static const union AnimCmd sAnim_MonPic_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd sAnim_MonPic_2[] =
{
ANIMCMD_FRAME(2, 0),
ANIMCMD_END,
};
static const union AnimCmd sAnim_MonPic_3[] =
{
ANIMCMD_FRAME(3, 0),
ANIMCMD_END,
};
const union AnimCmd *const gAnims_MonPic[MAX_MON_PIC_FRAMES] = const union AnimCmd *const gAnims_MonPic[MAX_MON_PIC_FRAMES] =
{ {
sAnim_MonPic_0, sAnim_MonPic_0,
sAnim_MonPic_1, sAnim_MonPic_1,
sAnim_MonPic_2,
sAnim_MonPic_3,
}; };
#define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, MON_PIC_SIZE, SPECIES_##species} #define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, MON_PIC_SIZE, SPECIES_##species}

View File

@ -378,7 +378,7 @@ const u32 gMonFrontPic_Anorith[] = INCBIN_U32("graphics/pokemon/anorith/anim_fro
const u32 gMonFrontPic_Armaldo[] = INCBIN_U32("graphics/pokemon/armaldo/anim_front.4bpp.lz"); const u32 gMonFrontPic_Armaldo[] = INCBIN_U32("graphics/pokemon/armaldo/anim_front.4bpp.lz");
const u32 gMonFrontPic_Feebas[] = INCBIN_U32("graphics/pokemon/feebas/anim_front.4bpp.lz"); const u32 gMonFrontPic_Feebas[] = INCBIN_U32("graphics/pokemon/feebas/anim_front.4bpp.lz");
const u32 gMonFrontPic_Milotic[] = INCBIN_U32("graphics/pokemon/milotic/anim_front.4bpp.lz"); const u32 gMonFrontPic_Milotic[] = INCBIN_U32("graphics/pokemon/milotic/anim_front.4bpp.lz");
const u32 gMonFrontPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/anim_front.4bpp.lz"); const u32 gMonFrontPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/front.4bpp.lz");
const u32 gMonFrontPic_Kecleon[] = INCBIN_U32("graphics/pokemon/kecleon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Kecleon[] = INCBIN_U32("graphics/pokemon/kecleon/anim_front.4bpp.lz");
const u32 gMonFrontPic_Shuppet[] = INCBIN_U32("graphics/pokemon/shuppet/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shuppet[] = INCBIN_U32("graphics/pokemon/shuppet/anim_front.4bpp.lz");
const u32 gMonFrontPic_Banette[] = INCBIN_U32("graphics/pokemon/banette/anim_front.4bpp.lz"); const u32 gMonFrontPic_Banette[] = INCBIN_U32("graphics/pokemon/banette/anim_front.4bpp.lz");
@ -456,7 +456,7 @@ const u32 gMonFrontPic_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/anim
const u32 gMonFrontPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/anim_front.4bpp.lz"); const u32 gMonFrontPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/anim_front.4bpp.lz");
const u32 gMonFrontPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/anim_front.4bpp.lz"); const u32 gMonFrontPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/anim_front.4bpp.lz");
const u32 gMonFrontPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/anim_front.4bpp.lz"); const u32 gMonFrontPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/anim_front.4bpp.lz");
const u32 gMonFrontPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/anim_front.4bpp.lz"); const u32 gMonFrontPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/anim_front.4bpp.lz");
const u32 gMonFrontPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/anim_front.4bpp.lz");
const u32 gMonFrontPic_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/anim_front.4bpp.lz");
const u32 gMonFrontPic_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/anim_front.4bpp.lz"); const u32 gMonFrontPic_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/anim_front.4bpp.lz");
@ -1117,9 +1117,9 @@ const u32 gMonFrontPic_UnownY[] = INCBIN_U32("graphics/pokemon/unown/y/anim_fron
const u32 gMonFrontPic_UnownZ[] = INCBIN_U32("graphics/pokemon/unown/z/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownZ[] = INCBIN_U32("graphics/pokemon/unown/z/anim_front.4bpp.lz");
const u32 gMonFrontPic_UnownExclamationMark[] = INCBIN_U32("graphics/pokemon/unown/exclamation_mark/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownExclamationMark[] = INCBIN_U32("graphics/pokemon/unown/exclamation_mark/anim_front.4bpp.lz");
const u32 gMonFrontPic_UnownQuestionMark[] = INCBIN_U32("graphics/pokemon/unown/question_mark/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownQuestionMark[] = INCBIN_U32("graphics/pokemon/unown/question_mark/anim_front.4bpp.lz");
const u32 gMonFrontPic_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/anim_front.4bpp.lz"); const u32 gMonFrontPic_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/front.4bpp.lz");
const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/anim_front.4bpp.lz"); const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/front.4bpp.lz");
const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/anim_front.4bpp.lz"); const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/front.4bpp.lz");
const u32 gMonFrontPic_DeoxysAttack[] = INCBIN_U32("graphics/pokemon/deoxys/attack/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysAttack[] = INCBIN_U32("graphics/pokemon/deoxys/attack/anim_front.4bpp.lz");
const u32 gMonFrontPic_DeoxysDefense[] = INCBIN_U32("graphics/pokemon/deoxys/defense/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysDefense[] = INCBIN_U32("graphics/pokemon/deoxys/defense/anim_front.4bpp.lz");
const u32 gMonFrontPic_DeoxysSpeed[] = INCBIN_U32("graphics/pokemon/deoxys/speed/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysSpeed[] = INCBIN_U32("graphics/pokemon/deoxys/speed/anim_front.4bpp.lz");
@ -1695,7 +1695,7 @@ const u32 gMonBackPic_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/back.
const u32 gMonBackPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/back.4bpp.lz"); const u32 gMonBackPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/back.4bpp.lz");
const u32 gMonBackPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/back.4bpp.lz"); const u32 gMonBackPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/back.4bpp.lz");
const u32 gMonBackPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/back.4bpp.lz"); const u32 gMonBackPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/back.4bpp.lz");
const u32 gMonBackPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/back.4bpp.lz"); const u32 gMonBackPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/back.4bpp.lz");
const u32 gMonBackPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/back.4bpp.lz"); const u32 gMonBackPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/back.4bpp.lz");
const u32 gMonBackPic_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/back.4bpp.lz"); const u32 gMonBackPic_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/back.4bpp.lz");
const u32 gMonBackPic_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/back.4bpp.lz"); const u32 gMonBackPic_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/back.4bpp.lz");
@ -2903,7 +2903,7 @@ const u32 gMonPalette_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/norma
const u32 gMonPalette_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/normal.gbapal.lz"); const u32 gMonPalette_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/normal.gbapal.lz");
const u32 gMonPalette_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/normal.gbapal.lz"); const u32 gMonPalette_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/normal.gbapal.lz");
const u32 gMonPalette_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/normal.gbapal.lz"); const u32 gMonPalette_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/normal.gbapal.lz");
const u32 gMonPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal.gbapal.lz"); const u32 gMonPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/normal.gbapal.lz");
const u32 gMonPalette_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/normal.gbapal.lz"); const u32 gMonPalette_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/normal.gbapal.lz");
const u32 gMonPalette_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/normal.gbapal.lz"); const u32 gMonPalette_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/normal.gbapal.lz");
const u32 gMonPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/normal.gbapal.lz"); const u32 gMonPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/normal.gbapal.lz");
@ -4136,7 +4136,7 @@ const u32 gMonShinyPalette_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/
const u32 gMonShinyPalette_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/shiny.gbapal.lz"); const u32 gMonShinyPalette_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/shiny.gbapal.lz");
const u32 gMonShinyPalette_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/shiny.gbapal.lz"); const u32 gMonShinyPalette_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/shiny.gbapal.lz");
const u32 gMonShinyPalette_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/shiny.gbapal.lz"); const u32 gMonShinyPalette_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/shiny.gbapal.lz");
const u32 gMonShinyPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/shiny.gbapal.lz"); const u32 gMonShinyPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/shiny.gbapal.lz");
const u32 gMonShinyPalette_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/shiny.gbapal.lz"); const u32 gMonShinyPalette_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/shiny.gbapal.lz");
const u32 gMonShinyPalette_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/shiny.gbapal.lz"); const u32 gMonShinyPalette_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/shiny.gbapal.lz");
const u32 gMonShinyPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/shiny.gbapal.lz"); const u32 gMonShinyPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/shiny.gbapal.lz");

View File

@ -2314,6 +2314,9 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] =
[SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, [SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW,
[SPECIES_MILOTIC - 1] = ANIM_CIRCULAR_STRETCH_TWICE, [SPECIES_MILOTIC - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
[SPECIES_CASTFORM - 1] = ANIM_H_SLIDE_WOBBLE, [SPECIES_CASTFORM - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_CASTFORM_SUNNY - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_CASTFORM_RAINY - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_CASTFORM_SNOWY - 1] = ANIM_H_SLIDE_WOBBLE,
[SPECIES_KECLEON - 1] = ANIM_FLICKER_INCREASING, [SPECIES_KECLEON - 1] = ANIM_FLICKER_INCREASING,
[SPECIES_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE, [SPECIES_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_BANETTE - 1] = ANIM_CIRCULAR_STRETCH_TWICE, [SPECIES_BANETTE - 1] = ANIM_CIRCULAR_STRETCH_TWICE,
@ -7508,13 +7511,6 @@ bool32 IsSpeciesInHoennDex(u16 species)
return TRUE; return TRUE;
} }
void ClearBattleMonForms(void)
{
int i;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
gBattleMonForms[i] = 0;
}
u16 GetBattleBGM(void) u16 GetBattleBGM(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON)

View File

@ -575,6 +575,9 @@ static const u8 sSpeciesToBackAnimSet[NUM_SPECIES] =
[SPECIES_LAIRON] = BACK_ANIM_V_SHAKE, [SPECIES_LAIRON] = BACK_ANIM_V_SHAKE,
[SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW, [SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW,
[SPECIES_CASTFORM] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_CASTFORM] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_CASTFORM_SUNNY] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_CASTFORM_RAINY] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_CASTFORM_SNOWY] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_VOLBEAT] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_VOLBEAT] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC,
[SPECIES_LILEEP] = BACK_ANIM_H_STRETCH, [SPECIES_LILEEP] = BACK_ANIM_H_STRETCH,

View File

@ -45,8 +45,6 @@ extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow;
extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow;
extern const struct SpritePalette sSpritePalettes_HealthBoxHealthBar[2]; extern const struct SpritePalette sSpritePalettes_HealthBoxHealthBar[2];
extern const struct UCoords8 sBattlerCoords[][MAX_BATTLERS_COUNT] ; extern const struct UCoords8 sBattlerCoords[][MAX_BATTLERS_COUNT] ;
extern const struct MonCoords gCastformFrontSpriteCoords[NUM_CASTFORM_FORMS];
extern const u8 sCastformElevations[NUM_CASTFORM_FORMS];
extern const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1]; extern const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1];
static const u16 sBgColor[] = {RGB_WHITE}; static const u16 sBgColor[] = {RGB_WHITE};
@ -732,53 +730,11 @@ static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bo
LoadPalette(gDecompressionBuffer, 0x80 + battlerId * 16, 0x20); LoadPalette(gDecompressionBuffer, 0x80 + battlerId * 16, 0x20);
} }
static bool8 IsCastformForm(species)
{
if (species == SPECIES_CASTFORM_SUNNY || species == SPECIES_CASTFORM_RAINY || species == SPECIES_CASTFORM_SNOWY)
return TRUE;
return FALSE;
}
static u8 GetCastformYCustom(species)
{
u8 ret;
switch (species)
{
case SPECIES_CASTFORM:
ret = gCastformFrontSpriteCoords[CASTFORM_NORMAL].y_offset;
break;
case SPECIES_CASTFORM_SUNNY:
ret = gCastformFrontSpriteCoords[CASTFORM_FIRE].y_offset;
break;
case SPECIES_CASTFORM_RAINY:
ret = gCastformFrontSpriteCoords[CASTFORM_WATER].y_offset;
break;
case SPECIES_CASTFORM_SNOWY:
ret = gCastformFrontSpriteCoords[CASTFORM_ICE].y_offset;
break;
}
return ret;
}
static u8 GetElevationValue(u16 species)
{
u8 val;
if (species == SPECIES_CASTFORM)
val = sCastformElevations[0];
else if (IsCastformForm(species))
val = sCastformElevations[species - SPECIES_CASTFORM_SUNNY + 1];
else
val = gEnemyMonElevation[species];
return val;
}
static void SetConstSpriteValues(struct PokemonDebugMenu *data) static void SetConstSpriteValues(struct PokemonDebugMenu *data)
{ {
u16 species = data->currentmonId; u16 species = data->currentmonId;
data->constSpriteValues.frontPicCoords = gMonFrontPicCoords[species].y_offset; data->constSpriteValues.frontPicCoords = gMonFrontPicCoords[species].y_offset;
data->constSpriteValues.frontElevation = GetElevationValue(species); data->constSpriteValues.frontElevation = gEnemyMonElevation[species];
data->constSpriteValues.backPicCoords = gMonBackPicCoords[species].y_offset; data->constSpriteValues.backPicCoords = gMonBackPicCoords[species].y_offset;
} }
@ -798,7 +754,7 @@ static u8 GetBattlerSpriteFinal_YCustom(u16 species, s8 offset_picCoords, s8 off
offset = gMonFrontPicCoords[species].y_offset + offset_picCoords; offset = gMonFrontPicCoords[species].y_offset + offset_picCoords;
//Elevation //Elevation
offset -= GetElevationValue(species) + offset_elevation; offset -= gEnemyMonElevation[species] + offset_elevation;
//Main position //Main position
y = offset + sBattlerCoords[0][1].y; y = offset + sBattlerCoords[0][1].y;
@ -830,7 +786,7 @@ static void LoadAndCreateEnemyShadowSpriteCustom(struct PokemonDebugMenu *data,
{ {
u8 x, y; u8 x, y;
bool8 invisible = FALSE; bool8 invisible = FALSE;
if (gEnemyMonElevation[species] == 0 && !IsCastformForm(species)) if (gEnemyMonElevation[species] == 0)
invisible = TRUE; invisible = TRUE;
LoadCompressedSpriteSheet(&gSpriteSheet_EnemyShadow); LoadCompressedSpriteSheet(&gSpriteSheet_EnemyShadow);
LoadSpritePalette(&sSpritePalettes_HealthBoxHealthBar[0]); LoadSpritePalette(&sSpritePalettes_HealthBoxHealthBar[0]);

View File

@ -230,9 +230,7 @@ static void CreateBattlerSprite(u8 battler)
gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[0] = battler;
gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 0);
if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM)
gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM];
} }
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && battler == B_POSITION_PLAYER_LEFT) else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && battler == B_POSITION_PLAYER_LEFT)
{ {
@ -268,9 +266,7 @@ static void CreateBattlerSprite(u8 battler)
gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[0] = battler;
gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 0);
if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM)
gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM];
} }
gSprites[gBattlerSpriteIds[battler]].invisible = gBattleSpritesDataPtr->battlerData[battler].invisible; gSprites[gBattlerSpriteIds[battler]].invisible = gBattleSpritesDataPtr->battlerData[battler].invisible;

View File

@ -12,6 +12,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim in harsh sunlight")
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT); ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Cherrim transformed!"); MESSAGE("Cherrim transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CHERRIM_SUNSHINE);
} }
} }
@ -32,6 +34,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when weather c
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT); ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Cherrim transformed!"); MESSAGE("Cherrim transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CHERRIM);
} }
} }
@ -52,6 +56,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when its abili
// back to normal // back to normal
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Cherrim transformed!"); MESSAGE("Cherrim transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CHERRIM);
} }
} }

View File

@ -17,6 +17,20 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an opponent's m
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
switch (move)
{
case MOVE_SUNNY_DAY:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY);
break;
case MOVE_RAIN_DANCE:
EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY);
break;
case MOVE_HAIL:
case MOVE_SNOWSCAPE:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SNOWY);
break;
}
} }
} }
@ -36,6 +50,20 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from its own move")
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
switch (move)
{
case MOVE_SUNNY_DAY:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY);
break;
case MOVE_RAIN_DANCE:
EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY);
break;
case MOVE_HAIL:
case MOVE_SNOWSCAPE:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SNOWY);
break;
}
} }
} }
@ -57,6 +85,20 @@ DOUBLE_BATTLE_TEST("Forecast transforms Castform in weather from a partner's mov
ABILITY_POPUP(playerLeft, ABILITY_FORECAST); ABILITY_POPUP(playerLeft, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
switch (move)
{
case MOVE_SUNNY_DAY:
EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SUNNY);
break;
case MOVE_RAIN_DANCE:
EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_RAINY);
break;
case MOVE_HAIL:
case MOVE_SNOWSCAPE:
EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SNOWY);
break;
}
} }
} }
@ -87,6 +129,29 @@ DOUBLE_BATTLE_TEST("Forecast transforms all Castforms present in weather")
ABILITY_POPUP(opponentRight, ABILITY_FORECAST); ABILITY_POPUP(opponentRight, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponentRight); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponentRight);
MESSAGE("Foe Castform transformed!"); MESSAGE("Foe Castform transformed!");
} THEN {
switch (move)
{
case MOVE_SUNNY_DAY:
EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SUNNY);
EXPECT_EQ(playerRight->species, SPECIES_CASTFORM_SUNNY);
EXPECT_EQ(opponentLeft->species, SPECIES_CASTFORM_SUNNY);
EXPECT_EQ(opponentRight->species, SPECIES_CASTFORM_SUNNY);
break;
case MOVE_RAIN_DANCE:
EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_RAINY);
EXPECT_EQ(playerRight->species, SPECIES_CASTFORM_RAINY);
EXPECT_EQ(opponentLeft->species, SPECIES_CASTFORM_RAINY);
EXPECT_EQ(opponentRight->species, SPECIES_CASTFORM_RAINY);
break;
case MOVE_HAIL:
case MOVE_SNOWSCAPE:
EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SNOWY);
EXPECT_EQ(playerRight->species, SPECIES_CASTFORM_SNOWY);
EXPECT_EQ(opponentLeft->species, SPECIES_CASTFORM_SNOWY);
EXPECT_EQ(opponentRight->species, SPECIES_CASTFORM_SNOWY);
break;
}
} }
} }
@ -106,6 +171,19 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an ability")
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
switch (ability)
{
case ABILITY_DROUGHT:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY);
break;
case ABILITY_DRIZZLE:
EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY);
break;
case ABILITY_SNOW_WARNING:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SNOWY);
break;
}
} }
} }
@ -125,6 +203,16 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in primal weather")
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
switch (ability)
{
case ABILITY_DESOLATE_LAND:
EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY);
break;
case ABILITY_PRIMORDIAL_SEA:
EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY);
break;
}
} }
} }
@ -149,6 +237,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when weather exp
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CASTFORM);
} }
} }
@ -169,11 +259,14 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when Sandstorm i
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CASTFORM);
} }
} }
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
{ {
KNOWN_FAILING;
GIVEN { GIVEN {
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); } PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); }
OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET);
@ -181,7 +274,6 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
} WHEN { } WHEN {
TURN { MOVE(player, MOVE_RAIN_DANCE); } TURN { MOVE(player, MOVE_RAIN_DANCE); }
TURN { SWITCH(opponent, 1); } TURN { SWITCH(opponent, 1); }
TURN { MOVE(opponent, MOVE_CELEBRATE, megaEvolve: TRUE); }
} SCENE { } SCENE {
// transforms // transforms
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
@ -192,6 +284,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CASTFORM);
} }
} }
@ -211,6 +305,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform on switch-in")
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY);
} }
} }
@ -231,6 +327,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform when weather changes")
ABILITY_POPUP(player, ABILITY_FORECAST); ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY);
} }
} }
@ -251,5 +349,7 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when its ability
// back to normal // back to normal
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!"); MESSAGE("Castform transformed!");
} THEN {
EXPECT_EQ(player->species, SPECIES_CASTFORM);
} }
} }