diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 014a8bb7f..47dc8092a 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1186,11 +1186,11 @@ .byte 0xe5 .endm - .macro doweatherformchangeanimation + .macro unused3 .byte 0xe6 .endm - .macro tryweatherformdatachange + .macro unused4 .byte 0xe7 .endm diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index c32c6d203..7c995ef72 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -910,7 +910,6 @@ gBattleAnims_StatusConditions:: .align 2 gBattleAnims_General:: - .4byte General_WeatherFormChange @ B_ANIM_CASTFORM_CHANGE .4byte General_StatsChange @ B_ANIM_STATS_CHANGE .4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE .4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR @@ -24282,7 +24281,7 @@ Move_TRANSFORM: monbg ANIM_ATTACKER playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48 - createvisualtask AnimTask_TransformMon, 2, 0, 0, 1 + createvisualtask AnimTask_TransformMon, 2, 0, 1 waitforvisualfinish clearmonbg ANIM_ATTACKER end @@ -26364,22 +26363,6 @@ Status_Nightmare: Status_Powder: 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: createvisualtask AnimTask_StatsChange, 5 waitforvisualfinish @@ -26798,14 +26781,14 @@ General_WishHeal: General_IllusionOff: monbg ANIM_TARGET - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 waitforvisualfinish clearmonbg ANIM_TARGET end General_FormChange: monbg ANIM_ATTACKER - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 waitforvisualfinish clearmonbg ANIM_ATTACKER end @@ -26834,7 +26817,7 @@ General_MegaEvolution: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA 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_HorizontalShake, 5, 1, 5, 14 waitforvisualfinish @@ -26980,7 +26963,7 @@ General_PrimalReversion_Alpha: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA 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_HorizontalShake, 5, 1, 5, 14 waitforvisualfinish @@ -27007,7 +26990,7 @@ General_PrimalReversion_Omega: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA 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_HorizontalShake, 5, 1, 5, 14 waitforvisualfinish diff --git a/graphics/pokemon/castform/back.png b/graphics/pokemon/castform/back.png new file mode 100644 index 000000000..4a0a4f59d Binary files /dev/null and b/graphics/pokemon/castform/back.png differ diff --git a/graphics/pokemon/castform/front.png b/graphics/pokemon/castform/front.png new file mode 100644 index 000000000..c21ab589b Binary files /dev/null and b/graphics/pokemon/castform/front.png differ diff --git a/graphics/pokemon/castform/normal/normal.pal b/graphics/pokemon/castform/normal.pal similarity index 93% rename from graphics/pokemon/castform/normal/normal.pal rename to graphics/pokemon/castform/normal.pal index 3fe2b7692..c88edafd2 100644 --- a/graphics/pokemon/castform/normal/normal.pal +++ b/graphics/pokemon/castform/normal.pal @@ -1,6 +1,7 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 90 82 82 205 189 189 @@ -12,7 +13,6 @@ JASC-PAL 0 0 0 0 0 0 0 0 0 -0 0 0 148 148 148 74 82 74 255 255 255 diff --git a/graphics/pokemon/castform/normal/anim_front.png b/graphics/pokemon/castform/normal/anim_front.png deleted file mode 100644 index 9f1ac937a..000000000 Binary files a/graphics/pokemon/castform/normal/anim_front.png and /dev/null differ diff --git a/graphics/pokemon/castform/normal/back.png b/graphics/pokemon/castform/normal/back.png deleted file mode 100644 index 99a2bfef7..000000000 Binary files a/graphics/pokemon/castform/normal/back.png and /dev/null differ diff --git a/graphics/pokemon/castform/normal/front.png b/graphics/pokemon/castform/normal/front.png deleted file mode 100644 index d6a73c2c4..000000000 Binary files a/graphics/pokemon/castform/normal/front.png and /dev/null differ diff --git a/graphics/pokemon/castform/rainy/anim_front.png b/graphics/pokemon/castform/rainy/anim_front.png deleted file mode 100644 index 0c2e4e174..000000000 Binary files a/graphics/pokemon/castform/rainy/anim_front.png and /dev/null differ diff --git a/graphics/pokemon/castform/rainy/back.png b/graphics/pokemon/castform/rainy/back.png index 2763b51d9..bd7ac7d7c 100644 Binary files a/graphics/pokemon/castform/rainy/back.png and b/graphics/pokemon/castform/rainy/back.png differ diff --git a/graphics/pokemon/castform/rainy/front.png b/graphics/pokemon/castform/rainy/front.png index 0ee52a35a..acfcca96b 100644 Binary files a/graphics/pokemon/castform/rainy/front.png and b/graphics/pokemon/castform/rainy/front.png differ diff --git a/graphics/pokemon/castform/rainy/normal.pal b/graphics/pokemon/castform/rainy/normal.pal index 914cdac62..f844fdf1f 100644 --- a/graphics/pokemon/castform/rainy/normal.pal +++ b/graphics/pokemon/castform/rainy/normal.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 57 65 90 98 115 189 115 139 213 148 180 205 -0 0 0 205 238 246 180 197 222 139 205 222 diff --git a/graphics/pokemon/castform/rainy/shiny.pal b/graphics/pokemon/castform/rainy/shiny.pal index 914cdac62..f844fdf1f 100644 --- a/graphics/pokemon/castform/rainy/shiny.pal +++ b/graphics/pokemon/castform/rainy/shiny.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 57 65 90 98 115 189 115 139 213 148 180 205 -0 0 0 205 238 246 180 197 222 139 205 222 diff --git a/graphics/pokemon/castform/normal/shiny.pal b/graphics/pokemon/castform/shiny.pal similarity index 93% rename from graphics/pokemon/castform/normal/shiny.pal rename to graphics/pokemon/castform/shiny.pal index 2fa401dd6..4fc9b290d 100644 --- a/graphics/pokemon/castform/normal/shiny.pal +++ b/graphics/pokemon/castform/shiny.pal @@ -1,6 +1,7 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 98 90 90 205 164 189 @@ -12,7 +13,6 @@ JASC-PAL 0 0 0 0 0 0 0 0 0 -0 0 0 148 148 148 74 82 74 255 255 255 diff --git a/graphics/pokemon/castform/snowy/anim_front.png b/graphics/pokemon/castform/snowy/anim_front.png deleted file mode 100644 index 0bcfddc33..000000000 Binary files a/graphics/pokemon/castform/snowy/anim_front.png and /dev/null differ diff --git a/graphics/pokemon/castform/snowy/back.png b/graphics/pokemon/castform/snowy/back.png index 11281385a..6b8946b35 100644 Binary files a/graphics/pokemon/castform/snowy/back.png and b/graphics/pokemon/castform/snowy/back.png differ diff --git a/graphics/pokemon/castform/snowy/front.png b/graphics/pokemon/castform/snowy/front.png index e921cd1a6..54f338d1f 100644 Binary files a/graphics/pokemon/castform/snowy/front.png and b/graphics/pokemon/castform/snowy/front.png differ diff --git a/graphics/pokemon/castform/snowy/normal.pal b/graphics/pokemon/castform/snowy/normal.pal index d1c64ac75..e05641ab1 100644 --- a/graphics/pokemon/castform/snowy/normal.pal +++ b/graphics/pokemon/castform/snowy/normal.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 41 82 57 123 82 189 139 115 213 148 180 205 -0 0 0 197 180 255 156 156 197 139 205 172 diff --git a/graphics/pokemon/castform/snowy/shiny.pal b/graphics/pokemon/castform/snowy/shiny.pal index d1c64ac75..e05641ab1 100644 --- a/graphics/pokemon/castform/snowy/shiny.pal +++ b/graphics/pokemon/castform/snowy/shiny.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 41 82 57 123 82 189 139 115 213 148 180 205 -0 0 0 197 180 255 156 156 197 139 205 172 diff --git a/graphics/pokemon/castform/sunny/anim_front.png b/graphics/pokemon/castform/sunny/anim_front.png deleted file mode 100644 index b866e48c1..000000000 Binary files a/graphics/pokemon/castform/sunny/anim_front.png and /dev/null differ diff --git a/graphics/pokemon/castform/sunny/back.png b/graphics/pokemon/castform/sunny/back.png index d614e8f25..a3fa23260 100644 Binary files a/graphics/pokemon/castform/sunny/back.png and b/graphics/pokemon/castform/sunny/back.png differ diff --git a/graphics/pokemon/castform/sunny/front.png b/graphics/pokemon/castform/sunny/front.png index 3d97e3112..fe37e1867 100644 Binary files a/graphics/pokemon/castform/sunny/front.png and b/graphics/pokemon/castform/sunny/front.png differ diff --git a/graphics/pokemon/castform/sunny/normal.pal b/graphics/pokemon/castform/sunny/normal.pal index af0cfbb93..2468b2cfb 100644 --- a/graphics/pokemon/castform/sunny/normal.pal +++ b/graphics/pokemon/castform/sunny/normal.pal @@ -1,6 +1,7 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 98 49 41 205 90 74 @@ -13,7 +14,6 @@ JASC-PAL 213 131 74 148 90 65 213 205 230 -0 0 0 90 90 82 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/sunny/shiny.pal b/graphics/pokemon/castform/sunny/shiny.pal index af0cfbb93..2468b2cfb 100644 --- a/graphics/pokemon/castform/sunny/shiny.pal +++ b/graphics/pokemon/castform/sunny/shiny.pal @@ -1,6 +1,7 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 98 49 41 205 90 74 @@ -13,7 +14,6 @@ JASC-PAL 213 131 74 148 90 65 213 205 230 -0 0 0 90 90 82 255 255 255 24 24 24 diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index cfe5c6257..b565c0e91 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -1,5 +1,3 @@ -CASTFORMGFXDIR := graphics/pokemon/castform -CHERRIMGFXDIR := graphics/pokemon/cherrim TILESETGFXDIR := data/tilesets FONTGFXDIR := graphics/fonts 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 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 ### $(TILESETGFXDIR)/secondary/petalburg/tiles.4bpp: %.4bpp: %.png diff --git a/include/battle.h b/include/battle.h index 9cf4f100a..ca099379f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -585,7 +585,6 @@ struct BattleStruct u8 turnSideTracker; 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 castformPalette[NUM_CASTFORM_FORMS][16]; union { struct LinkBattlerHeader linkBattlerHeader; u32 battleVideo[2]; @@ -988,7 +987,6 @@ extern struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData; extern struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData; extern u16 gBattleMovePower; extern u16 gMoveToLearn; -extern u8 gBattleMonForms[MAX_BATTLERS_COUNT]; extern u32 gFieldStatuses; extern struct FieldTimer gFieldTimers; extern u8 gBattlerAbility; diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 9a0b79c31..0b1bd52fb 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -23,7 +23,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId); void ClearSpritesHealthboxAnimData(void); void CopyAllBattleSpritesInvisibilities(void); 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 LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId); void TrySetBehindSubstituteSpriteBit(u8 battlerId, u16 move); diff --git a/include/constants/battle.h b/include/constants/battle.h index cbc362861..c32af976c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -423,16 +423,6 @@ #define B_WAIT_TIME_SHORT (B_WAIT_TIME_MULTIPLIER * 2) #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_ABILITY 2 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 60e044130..01d4b6809 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -510,44 +510,43 @@ #define BG_CHLOROBLAST 80 // table ids for general animations (gBattleAnims_General) -#define B_ANIM_CASTFORM_CHANGE 0 -#define B_ANIM_STATS_CHANGE 1 -#define B_ANIM_SUBSTITUTE_FADE 2 -#define B_ANIM_SUBSTITUTE_APPEAR 3 -#define B_ANIM_POKEBLOCK_THROW 4 -#define B_ANIM_ITEM_KNOCKOFF 5 -#define B_ANIM_TURN_TRAP 6 -#define B_ANIM_HELD_ITEM_EFFECT 7 -#define B_ANIM_SMOKEBALL_ESCAPE 8 -#define B_ANIM_HANGED_ON 9 -#define B_ANIM_RAIN_CONTINUES 10 -#define B_ANIM_SUN_CONTINUES 11 -#define B_ANIM_SANDSTORM_CONTINUES 12 -#define B_ANIM_HAIL_CONTINUES 13 -#define B_ANIM_LEECH_SEED_DRAIN 14 -#define B_ANIM_MON_HIT 15 -#define B_ANIM_ITEM_STEAL 16 -#define B_ANIM_SNATCH_MOVE 17 -#define B_ANIM_FUTURE_SIGHT_HIT 18 -#define B_ANIM_DOOM_DESIRE_HIT 19 -#define B_ANIM_FOCUS_PUNCH_SETUP 20 -#define B_ANIM_INGRAIN_HEAL 21 -#define B_ANIM_WISH_HEAL 22 -#define B_ANIM_MEGA_EVOLUTION 23 -#define B_ANIM_ILLUSION_OFF 24 -#define B_ANIM_FORM_CHANGE 25 -#define B_ANIM_SLIDE_OFFSCREEN 26 // for Emergency Exit -#define B_ANIM_RESTORE_BG 27 // for Terrain Endings -#define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare -#define B_ANIM_GULP_MISSILE 29 -#define B_ANIM_STRONG_WINDS 30 -#define B_ANIM_PRIMAL_REVERSION 31 -#define B_ANIM_AQUA_RING_HEAL 32 -#define B_ANIM_BEAK_BLAST_SETUP 33 -#define B_ANIM_SHELL_TRAP_SETUP 34 -#define B_ANIM_ZMOVE_ACTIVATE 35 // Using Z Moves -#define B_ANIM_AFFECTION_HANGED_ON 36 -#define B_ANIM_SNOW_CONTINUES 37 +#define B_ANIM_STATS_CHANGE 0 +#define B_ANIM_SUBSTITUTE_FADE 1 +#define B_ANIM_SUBSTITUTE_APPEAR 2 +#define B_ANIM_POKEBLOCK_THROW 3 +#define B_ANIM_ITEM_KNOCKOFF 4 +#define B_ANIM_TURN_TRAP 5 +#define B_ANIM_HELD_ITEM_EFFECT 6 +#define B_ANIM_SMOKEBALL_ESCAPE 7 +#define B_ANIM_HANGED_ON 8 +#define B_ANIM_RAIN_CONTINUES 9 +#define B_ANIM_SUN_CONTINUES 10 +#define B_ANIM_SANDSTORM_CONTINUES 11 +#define B_ANIM_HAIL_CONTINUES 12 +#define B_ANIM_LEECH_SEED_DRAIN 13 +#define B_ANIM_MON_HIT 14 +#define B_ANIM_ITEM_STEAL 15 +#define B_ANIM_SNATCH_MOVE 16 +#define B_ANIM_FUTURE_SIGHT_HIT 17 +#define B_ANIM_DOOM_DESIRE_HIT 18 +#define B_ANIM_FOCUS_PUNCH_SETUP 19 +#define B_ANIM_INGRAIN_HEAL 20 +#define B_ANIM_WISH_HEAL 21 +#define B_ANIM_MEGA_EVOLUTION 22 +#define B_ANIM_ILLUSION_OFF 23 +#define B_ANIM_FORM_CHANGE 24 +#define B_ANIM_SLIDE_OFFSCREEN 25 // for Emergency Exit +#define B_ANIM_RESTORE_BG 26 // for Terrain Endings +#define B_ANIM_TOTEM_FLARE 27 // Totem boosts aura flare +#define B_ANIM_GULP_MISSILE 28 +#define B_ANIM_STRONG_WINDS 29 +#define B_ANIM_PRIMAL_REVERSION 30 +#define B_ANIM_AQUA_RING_HEAL 31 +#define B_ANIM_BEAK_BLAST_SETUP 32 +#define B_ANIM_SHELL_TRAP_SETUP 33 +#define B_ANIM_ZMOVE_ACTIVATE 34 // Using Z Moves +#define B_ANIM_AFFECTION_HANGED_ON 35 +#define B_ANIM_SNOW_CONTINUES 36 // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 510d48271..f8bb4ec8d 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -333,11 +333,10 @@ // Most pokemon have 2 frames (a default and an alternate for their animation). // There are 4 exceptions: -// - Castform has 4 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 // - 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_ATK_SIDE 1 diff --git a/include/pokemon.h b/include/pokemon.h index 2c32054c5..8368714f8 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -527,7 +527,6 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves); u8 GetNumberOfRelearnableMoves(struct Pokemon *mon); u16 SpeciesToPokedexNum(u16 species); bool32 IsSpeciesInHoennDex(u16 species); -void ClearBattleMonForms(void); u16 GetBattleBGM(void); void PlayBattleBGM(void); void PlayMapChosenOrBattleBGM(u16 songId); diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 9f110b958..3d89c3614 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2349,7 +2349,6 @@ void AnimTask_TransformMon(u8 taskId) gTasks[taskId].data[10] = gBattleAnimArgs[0]; gTasks[taskId].data[11] = gBattleAnimArgs[1]; - gTasks[taskId].data[12] = gBattleAnimArgs[2]; gTasks[taskId].data[0]++; break; case 1: @@ -2364,7 +2363,7 @@ void AnimTask_TransformMon(u8 taskId) } break; 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); if (IsContest()) @@ -2372,7 +2371,7 @@ void AnimTask_TransformMon(u8 taskId) else position = GetBattlerPosition(gBattleAnimAttacker); - src = gMonSpritesGfxPtr->sprites.ptr[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); + src = gMonSpritesGfxPtr->sprites.ptr[position]; dest = animBg.bgTiles; CpuCopy32(src, dest, MON_PIC_SIZE); LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); @@ -2449,12 +2448,6 @@ void AnimTask_IsMonInvisible(u8 taskId) DestroyAnimVisualTask(taskId); } -void AnimTask_CastformGfxDataChange(u8 taskId) -{ - HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE, FALSE, FALSE); - DestroyAnimVisualTask(taskId); -} - void AnimTask_MorningSunLightBeam(u8 taskId) { struct BattleAnimBgData animBg; diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index ca338791c..f2016dd5e 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -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) #define TAG_MOVE_EFFECT_MON_1 55125 #define TAG_MOVE_EFFECT_MON_2 55126 @@ -197,10 +171,6 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species) coordSpecies = GetUnownSpeciesId(personality); ret = gMonBackPicCoords[coordSpecies].y_offset; } - else if (species == SPECIES_CASTFORM) - { - ret = sCastformBackSpriteYCoords[gBattleMonForms[battlerId]]; - } else if (species > NUM_SPECIES) { ret = gMonBackPicCoords[0].y_offset; @@ -223,10 +193,6 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species) coordSpecies = GetUnownSpeciesId(personality); ret = gMonFrontPicCoords[coordSpecies].y_offset; } - else if (species == SPECIES_CASTFORM) - { - ret = gCastformFrontSpriteCoords[gBattleMonForms[battlerId]].y_offset; - } else if (species > NUM_SPECIES) { ret = gMonFrontPicCoords[0].y_offset; @@ -246,9 +212,7 @@ u8 GetBattlerElevation(u8 battlerId, u16 species) { if (!IsContest()) { - if (species == SPECIES_CASTFORM) - ret = sCastformElevations[gBattleMonForms[battlerId]]; - else if (species > NUM_SPECIES) + if (species > NUM_SPECIES) ret = gEnemyMonElevation[0]; else ret = gEnemyMonElevation[species]; @@ -1963,10 +1927,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId) else species = spriteInfo[battlerId].transformSpecies; - if (species == SPECIES_CASTFORM) - return sCastformBackSpriteYCoords[gBattleMonForms[battlerId]]; - else - return gMonBackPicCoords[species].y_offset; + return gMonBackPicCoords[species].y_offset; } else { @@ -1976,10 +1937,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId) else species = spriteInfo[battlerId].transformSpecies; - if (species == SPECIES_CASTFORM) - return sCastformElevations[gBattleMonForms[battlerId]]; - else - return gMonFrontPicCoords[species].y_offset; + return gMonFrontPicCoords[species].y_offset; } } } @@ -2201,10 +2159,6 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr) species = GetUnownSpeciesId(personality); coords = &gMonBackPicCoords[species]; } - else if (species == SPECIES_CASTFORM) - { - coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]]; - } else if (species <= SPECIES_EGG) { coords = &gMonBackPicCoords[species]; @@ -2263,10 +2217,6 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr) species = GetUnownSpeciesId(personality); coords = &gMonFrontPicCoords[species]; } - else if (species == SPECIES_CASTFORM) - { - coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]]; - } else if (species > NUM_SPECIES) { coords = &gMonFrontPicCoords[0]; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index b4936da5c..69e2f6bde 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1129,7 +1129,7 @@ static void LinkOpponentHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 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)); @@ -1169,7 +1169,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index d07a92e93..8684ba70e 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1025,7 +1025,7 @@ static void LinkPartnerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } @@ -1061,7 +1061,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index c3e4a9037..f316f19ea 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1160,7 +1160,7 @@ static void OpponentHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = species; 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)); @@ -1201,7 +1201,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index c88dbff78..6d2e03fd8 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2436,7 +2436,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index b94d5347a..3a4beeca9 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1213,7 +1213,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } @@ -1249,7 +1249,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index d1c60343a..283388fcf 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1118,7 +1118,7 @@ static void RecordedOpponentHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 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)); @@ -1155,7 +1155,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 46f3de4f1..86cb49198 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1101,7 +1101,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } @@ -1137,7 +1137,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index fa1fa00fb..00a825dba 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1474,7 +1474,7 @@ static void StartSendOutAnim(u8 battlerId) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; 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]].callback = SpriteCallbackDummy; gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); diff --git a/src/battle_controllers.c b/src/battle_controllers.c index d5d3e479e..d7ca18c6a 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -57,7 +57,6 @@ void SetUpBattleVarsAndBirchZigzagoon(void) HandleLinkBattleSetup(); gBattleControllerExecFlags = 0; ClearBattleAnimationVars(); - ClearBattleMonForms(); BattleAI_SetupItems(); BattleAI_SetupFlags(); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 5f168d88b..383ce16e6 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -434,12 +434,6 @@ bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattler, u8 atkBattler, u8 de { 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 && !ShouldAnimBeDoneRegardlessOfSubstitute(tableId)) { @@ -607,13 +601,6 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op LoadPalette(gDecompressionBuffer, paletteOffset, 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 if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) { @@ -860,7 +847,7 @@ void CopyBattleSpriteInvisibility(u8 battlerId) 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; const void *lzPaletteData, *src; @@ -930,54 +917,26 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo 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); - paletteOffset = OBJ_PLTT_ID(battlerAtk); - lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); - 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) + BlendPalette(paletteOffset, 16, 6, RGB_WHITE); + CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16)); + if (!IsContest()) { 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) @@ -1021,7 +980,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId) { BattleLoadSubstituteOrMonSpriteGfx(battlerId, loadMonSprite); - StartSpriteAnim(&gSprites[spriteId], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[spriteId], 0); if (!loadMonSprite) gSprites[spriteId].y = GetSubstituteSpriteDefault_Y(battlerId); @@ -1232,7 +1191,6 @@ void FillAroundBattleWindows(void) void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute) { gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies = SPECIES_NONE; - gBattleMonForms[battlerId] = 0; if (!dontClearSubstitute) ClearBehindSubstituteBit(battlerId); } diff --git a/src/battle_intro.c b/src/battle_intro.c index 78982ca4c..4ed12d636 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -589,7 +589,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8 int i, j; u8 battler = GetBattlerAtPosition(battlerPosition); 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); for (i = y; i < y + 8; i++) { diff --git a/src/battle_main.c b/src/battle_main.c index 7904ffdf8..186ae225a 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -234,7 +234,6 @@ EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData = EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData = NULL; // Never read EWRAM_DATA u16 gBattleMovePower = 0; EWRAM_DATA u16 gMoveToLearn = 0; -EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u32 gFieldStatuses = 0; EWRAM_DATA struct FieldTimer gFieldTimers = {0}; EWRAM_DATA u8 gBattlerAbility = 0; @@ -2784,7 +2783,6 @@ static void SpriteCB_Flicker(struct Sprite *sprite) #undef sDelay extern const struct MonCoords gMonFrontPicCoords[]; -extern const struct MonCoords gCastformFrontSpriteCoords[]; void SpriteCB_FaintOpponentMon(struct Sprite *sprite) { @@ -2805,10 +2803,6 @@ void SpriteCB_FaintOpponentMon(struct Sprite *sprite) species = GetUnownSpeciesId(personality); yOffset = gMonFrontPicCoords[species].y_offset; } - else if (species == SPECIES_CASTFORM) - { - yOffset = gCastformFrontSpriteCoords[gBattleMonForms[battler]].y_offset; - } else if (species > NUM_SPECIES) { 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. { - 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++) *(dst++) = 0; - StartSpriteAnim(sprite, gBattleMonForms[sprite->sBattler]); + StartSpriteAnim(sprite, 0); } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c4ea866df..0faeef28d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -585,8 +585,8 @@ static void Cmd_switchoutabilities(void); static void Cmd_jumpifhasnohp(void); static void Cmd_getsecretpowereffect(void); static void Cmd_pickup(void); -static void Cmd_doweatherformchangeanimation(void); -static void Cmd_tryweatherformdatachange(void); +static void Cmd_unused3(void); +static void Cmd_unused4(void); static void Cmd_settypebasedhalvers(void); static void Cmd_jumpifsubstituteblocks(void); static void Cmd_tryrecycleitem(void); @@ -844,8 +844,8 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_jumpifhasnohp, //0xE3 Cmd_getsecretpowereffect, //0xE4 Cmd_pickup, //0xE5 - Cmd_doweatherformchangeanimation, //0xE6 - Cmd_tryweatherformdatachange, //0xE7 + Cmd_unused3, //0xE6 + Cmd_unused4, //0xE7 Cmd_settypebasedhalvers, //0xE8 Cmd_jumpifsubstituteblocks, //0xE9 Cmd_tryrecycleitem, //0xEA @@ -15139,26 +15139,12 @@ static void Cmd_pickup(void) 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 diff --git a/src/contest.c b/src/contest.c index 55207eb3e..97797dbf7 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1189,7 +1189,6 @@ void CB2_StartContest(void) FreeAllSpritePalettes(); gReservedSpritePaletteCount = 4; eContestDebugMode = CONTEST_DEBUG_MODE_OFF; - ClearBattleMonForms(); InitContestResources(); gMain.state++; break; @@ -1778,8 +1777,6 @@ static void Task_DoAppeals(u8 taskId) } return; case APPEALSTATE_SLIDE_MON_IN: - for (i = 0; i < CONTESTANT_COUNT; i++) - gBattleMonForms[i] = 0; memset(gContestResources->moveAnim, 0, sizeof(*gContestResources->moveAnim)); SetMoveAnimAttackerData(eContest.currentContestant); spriteId = CreateContestantSprite( @@ -5312,8 +5309,6 @@ static void SetMoveSpecificAnimData(u8 contestant) memset(&gContestResources->moveAnim->species, 0, 20); ClearBattleAnimationVars(); - for (i = 0; i < CONTESTANT_COUNT; i++) - gBattleMonForms[i] = 0; switch (move) { case MOVE_CURSE: diff --git a/src/data.c b/src/data.c index 1ced9ce81..859209a93 100644 --- a/src/data.c +++ b/src/data.c @@ -279,24 +279,10 @@ static const union AnimCmd sAnim_MonPic_1[] = 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] = { sAnim_MonPic_0, sAnim_MonPic_1, - sAnim_MonPic_2, - sAnim_MonPic_3, }; #define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, MON_PIC_SIZE, SPECIES_##species} diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index ae93b05bc..c6d0d3bb5 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -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_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_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_Shuppet[] = INCBIN_U32("graphics/pokemon/shuppet/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_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_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_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/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_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_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/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/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_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"); @@ -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_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/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_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/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_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/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_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/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_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/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_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/shiny.gbapal.lz"); const u32 gMonShinyPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/shiny.gbapal.lz"); diff --git a/src/pokemon.c b/src/pokemon.c index 5cbdffb66..58252f5fe 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2314,6 +2314,9 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] = [SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, [SPECIES_MILOTIC - 1] = ANIM_CIRCULAR_STRETCH_TWICE, [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_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE, [SPECIES_BANETTE - 1] = ANIM_CIRCULAR_STRETCH_TWICE, @@ -7508,13 +7511,6 @@ bool32 IsSpeciesInHoennDex(u16 species) return TRUE; } -void ClearBattleMonForms(void) -{ - int i; - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - gBattleMonForms[i] = 0; -} - u16 GetBattleBGM(void) { if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index e0847233e..c9f6a0489 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -575,6 +575,9 @@ static const u8 sSpeciesToBackAnimSet[NUM_SPECIES] = [SPECIES_LAIRON] = BACK_ANIM_V_SHAKE, [SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW, [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_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_LILEEP] = BACK_ANIM_H_STRETCH, diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 2e9f04506..44ee5b9e6 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -45,8 +45,6 @@ extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; extern const struct SpritePalette sSpritePalettes_HealthBoxHealthBar[2]; 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]; static const u16 sBgColor[] = {RGB_WHITE}; @@ -732,53 +730,11 @@ static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bo 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) { u16 species = data->currentmonId; data->constSpriteValues.frontPicCoords = gMonFrontPicCoords[species].y_offset; - data->constSpriteValues.frontElevation = GetElevationValue(species); + data->constSpriteValues.frontElevation = gEnemyMonElevation[species]; 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; //Elevation - offset -= GetElevationValue(species) + offset_elevation; + offset -= gEnemyMonElevation[species] + offset_elevation; //Main position y = offset + sBattlerCoords[0][1].y; @@ -830,7 +786,7 @@ static void LoadAndCreateEnemyShadowSpriteCustom(struct PokemonDebugMenu *data, { u8 x, y; bool8 invisible = FALSE; - if (gEnemyMonElevation[species] == 0 && !IsCastformForm(species)) + if (gEnemyMonElevation[species] == 0) invisible = TRUE; LoadCompressedSpriteSheet(&gSpriteSheet_EnemyShadow); LoadSpritePalette(&sSpritePalettes_HealthBoxHealthBar[0]); diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index b24db3f87..51f9b9d8a 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -230,9 +230,7 @@ static void CreateBattlerSprite(u8 battler) gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); - if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM) - gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM]; + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 0); } 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[2] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); - if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM) - gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM]; + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 0); } gSprites[gBattlerSpriteIds[battler]].invisible = gBattleSpritesDataPtr->battlerData[battler].invisible; diff --git a/test/ability_flower_gift.c b/test/ability_flower_gift.c index 560706af4..58d4bf2e1 100644 --- a/test/ability_flower_gift.c +++ b/test/ability_flower_gift.c @@ -12,6 +12,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim in harsh sunlight") ABILITY_POPUP(player, ABILITY_FLOWER_GIFT); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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 ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Cherrim transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CHERRIM); } } diff --git a/test/ability_forecast.c b/test/ability_forecast.c index 696c0383a..d2d36c1ab 100644 --- a/test/ability_forecast.c +++ b/test/ability_forecast.c @@ -17,6 +17,20 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an opponent's m ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponentRight); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM); } } SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") { + KNOWN_FAILING; GIVEN { PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); } OPPONENT(SPECIES_WOBBUFFET); @@ -181,7 +274,6 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") } WHEN { TURN { MOVE(player, MOVE_RAIN_DANCE); } TURN { SWITCH(opponent, 1); } - TURN { MOVE(opponent, MOVE_CELEBRATE, megaEvolve: TRUE); } } SCENE { // transforms 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); 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 ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM); } }