Macros
This commit is contained in:
parent
ffdb18cfdd
commit
8fc6cf7a14
8 changed files with 74 additions and 52 deletions
|
@ -1382,7 +1382,7 @@
|
|||
#define SPECIES_GARBODOR_GIGANTAMAX 1307
|
||||
#define SPECIES_STUNFISK_GALARIAN 1308
|
||||
#define SPECIES_MELMETAL_GIGANTAMAX 1309
|
||||
// Sword and Shield -24.-24.-25 (New Forms)
|
||||
// Sword and Shield 1.0.0 (New Forms)
|
||||
#define SPECIES_SLOWPOKE_GALARIAN 1310
|
||||
// The Isle of Armor (New Species)
|
||||
#define SPECIES_KUBFU 1311
|
||||
|
|
|
@ -359,7 +359,7 @@ struct BaseStats
|
|||
u8 iconPalIndexFemale;
|
||||
const u8 *const footprint;
|
||||
// Animation Data
|
||||
const union AnimCmd *const *frontAnim;
|
||||
const union AnimCmd *const *frontAnimFrames;
|
||||
u8 frontAnimDelay;
|
||||
u8 frontAnimId;
|
||||
u8 backAnimId;
|
||||
|
|
|
@ -928,7 +928,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
|||
|
||||
if (targetSpecies == SPECIES_CASTFORM || targetSpecies == SPECIES_CHERRIM)
|
||||
{
|
||||
gSprites[gBattlerSpriteIds[battlerAtk]].anims = gBaseStats[targetSpecies].frontAnim;
|
||||
gSprites[gBattlerSpriteIds[battlerAtk]].anims = gBaseStats[targetSpecies].frontAnimFrames;
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
|
||||
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32);
|
||||
}
|
||||
|
|
|
@ -2,32 +2,68 @@
|
|||
// 255 (MON_GENDERLESS) is reserved for genderless Pokémon.
|
||||
#define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100))
|
||||
|
||||
// Macros to allow editing every form at once
|
||||
#define FLIP 0
|
||||
#define NO_FLIP 1
|
||||
|
||||
#define DEX_TEXT(name, category) \
|
||||
.description = g##name##PokedexText, \
|
||||
.categoryName = _(category)
|
||||
|
||||
#define HEIGHT_WEIGHT(ht, wt) \
|
||||
.height = ht, \
|
||||
.weight = wt
|
||||
|
||||
#define DEX_SCALE(mon_scale, mon_offset, trainer_scale, trainer_offset) \
|
||||
.pokemonScale = mon_scale, \
|
||||
.pokemonOffset = mon_offset, \
|
||||
.trainerScale = trainer_scale, \
|
||||
.trainerOffset = trainer_offset
|
||||
|
||||
#define LEARNSETS(name) \
|
||||
.levelUpLearnset = s##name##LevelUpLearnset, \
|
||||
.teachableLearnset = s##name##TeachableLearnset
|
||||
|
||||
#define FRONT_SPRITE(name, width, height, y_offset, elevation) \
|
||||
.frontPic = gMonFrontPic_##name, \
|
||||
.frontPicSize = MON_COORDS_SIZE(width,height), \
|
||||
.frontPicYOffset = y_offset, \
|
||||
.enemyMonElevation = elevation
|
||||
|
||||
#define BACK_SPRITE(name, width, height, y_offset)\
|
||||
.backPic = gMonBackPic_##name, \
|
||||
.backPicSize = MON_COORDS_SIZE(width,height), \
|
||||
.backPicYOffset = y_offset
|
||||
|
||||
#define PALETTES(name) \
|
||||
.palette = gMonPalette_##name, \
|
||||
.shinyPalette = gMonShinyPalette_##name
|
||||
|
||||
#define ICON(name, palId) \
|
||||
.iconSprite = gMonIcon_##name, \
|
||||
.iconPalIndex = palId
|
||||
|
||||
#define FOOTPRINT(name) \
|
||||
.footprint = gMonFootprint_##name
|
||||
|
||||
#define ANIMATIONS(frames, delay, frontId, backId) \
|
||||
.frontAnimFrames = sAnims_##frames, \
|
||||
.frontAnimDelay = delay, \
|
||||
.frontAnimId = frontId, \
|
||||
.backAnimId = backId
|
||||
|
||||
const struct BaseStats gBaseStats[] =
|
||||
{
|
||||
[SPECIES_NONE] =
|
||||
{
|
||||
.categoryName = _("Unknown"),
|
||||
.description = gDummyPokedexText,
|
||||
.pokemonScale = 256,
|
||||
.pokemonOffset = 0,
|
||||
.trainerScale = 256,
|
||||
.trainerOffset = 0,
|
||||
.footprint = gMonFootprint_Bulbasaur,
|
||||
.levelUpLearnset = sBulbasaurLevelUpLearnset,
|
||||
.teachableLearnset = sBulbasaurTeachableLearnset,
|
||||
.frontPic = gMonFrontPic_QuestionMark,
|
||||
.frontPicSize = MON_COORDS_SIZE(40, 40),
|
||||
.frontPicYOffset = 12,
|
||||
.palette = gMonPalette_QuestionMark,
|
||||
.backPic = gMonBackPic_QuestionMark,
|
||||
.backPicSize = MON_COORDS_SIZE(40, 40),
|
||||
.backPicYOffset = 12,
|
||||
.shinyPalette = gMonShinyPalette_QuestionMark,
|
||||
.iconSprite = gMonIcon_QuestionMark,
|
||||
DEX_TEXT(Dummy, "Unknown"),
|
||||
DEX_SCALE(256, 0, 256, 0),
|
||||
HEIGHT_WEIGHT(0, 0),
|
||||
LEARNSETS(Bulbasaur),
|
||||
FRONT_SPRITE(QuestionMark, 40, 40, 12, 0),
|
||||
BACK_SPRITE (QuestionMark, 40, 40, 12),
|
||||
PALETTES(QuestionMark),
|
||||
ICON(QuestionMark, 0),
|
||||
FOOTPRINT(Bulbasaur),
|
||||
},
|
||||
|
||||
[SPECIES_BULBASAUR] =
|
||||
|
@ -54,30 +90,16 @@ const struct BaseStats gBaseStats[] =
|
|||
.bodyColor = BODY_COLOR_GREEN,
|
||||
.noFlip = FALSE,
|
||||
.natDexNum = NATIONAL_DEX_BULBASAUR,
|
||||
.categoryName = _("Seed"),
|
||||
.height = 7,
|
||||
.weight = 69,
|
||||
.description = gBulbasaurPokedexText,
|
||||
.pokemonScale = 356,
|
||||
.pokemonOffset = 17,
|
||||
.trainerScale = 256,
|
||||
.trainerOffset = 0,
|
||||
.levelUpLearnset = sBulbasaurLevelUpLearnset,
|
||||
.teachableLearnset = sBulbasaurTeachableLearnset,
|
||||
.frontPic = gMonFrontPic_Bulbasaur,
|
||||
.frontPicSize = MON_COORDS_SIZE(40, 40),
|
||||
.frontPicYOffset = 13 ,
|
||||
.palette = gMonPalette_Bulbasaur,
|
||||
.backPic = gMonBackPic_Bulbasaur,
|
||||
.backPicSize = MON_COORDS_SIZE(56, 40),
|
||||
.backPicYOffset = 13,
|
||||
.shinyPalette = gMonShinyPalette_Bulbasaur,
|
||||
.iconSprite = gMonIcon_Bulbasaur,
|
||||
.iconPalIndex = 4,
|
||||
.footprint = gMonFootprint_Bulbasaur,
|
||||
.frontAnim = sAnims_BULBASAUR,
|
||||
.frontAnimId = ANIM_V_JUMPS_H_JUMPS,
|
||||
.backAnimId = BACK_ANIM_DIP_RIGHT_SIDE,
|
||||
DEX_TEXT(Bulbasaur, "Seed"),
|
||||
DEX_SCALE(356, 17, 256, 0),
|
||||
HEIGHT_WEIGHT(7, 69),
|
||||
LEARNSETS(Bulbasaur),
|
||||
FRONT_SPRITE(Bulbasaur, 40, 40, 13, 0),
|
||||
BACK_SPRITE (Bulbasaur, 56, 40, 12),
|
||||
PALETTES(Bulbasaur),
|
||||
ICON(Bulbasaur, 4),
|
||||
FOOTPRINT(Bulbasaur),
|
||||
ANIMATIONS(BULBASAUR, 0, ANIM_V_JUMPS_H_JUMPS, BACK_ANIM_DIP_RIGHT_SIDE),
|
||||
},
|
||||
|
||||
[SPECIES_IVYSAUR] =
|
||||
|
|
|
@ -1308,7 +1308,7 @@ const struct CompressedSpriteSheet gMonFrontPicTableFemale[] =
|
|||
#if P_GEN_6_POKEMON == TRUE
|
||||
SPECIES_SPRITE(PYROAR, gMonFrontPic_PyroarF),
|
||||
#endif
|
||||
#if P_GEN_7_POKEMON == TRUE
|
||||
#if P_GEN_8_POKEMON == TRUE
|
||||
SPECIES_SPRITE(BASCULEGION, gMonFrontPic_QuestionMark), //gMonFrontPic_BasculegionF),
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -4444,9 +4444,9 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition)
|
|||
if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT)
|
||||
gMultiuseSpriteTemplate.anims = gAnims_MonPic;
|
||||
else if (speciesTag > SPECIES_SHINY_TAG)
|
||||
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag - SPECIES_SHINY_TAG].frontAnim;
|
||||
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag - SPECIES_SHINY_TAG].frontAnimFrames;
|
||||
else
|
||||
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag].frontAnim;
|
||||
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag].frontAnimFrames;
|
||||
}
|
||||
|
||||
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerPicId, u8 battlerPosition)
|
||||
|
|
|
@ -232,7 +232,7 @@ static void CreateBattlerSprite(u8 battler)
|
|||
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]);
|
||||
if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM)
|
||||
gSprites[gBattlerSpriteIds[battler]].anims = gBaseStats[SPECIES_CASTFORM].frontAnim;
|
||||
gSprites[gBattlerSpriteIds[battler]].anims = gBaseStats[SPECIES_CASTFORM].frontAnimFrames;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && battler == B_POSITION_PLAYER_LEFT)
|
||||
{
|
||||
|
@ -268,7 +268,7 @@ static void CreateBattlerSprite(u8 battler)
|
|||
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]);
|
||||
if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM)
|
||||
gSprites[gBattlerSpriteIds[battler]].anims = gBaseStats[SPECIES_CASTFORM].frontAnim;
|
||||
gSprites[gBattlerSpriteIds[battler]].anims = gBaseStats[SPECIES_CASTFORM].frontAnimFrames;
|
||||
}
|
||||
|
||||
gSprites[gBattlerSpriteIds[battler]].invisible = gBattleSpritesDataPtr->battlerData[battler].invisible;
|
||||
|
|
|
@ -223,7 +223,7 @@ u16 CreateMonPicSprite_Affine(u16 species, u32 otId, u32 personality, u8 flags,
|
|||
images[j].size = MON_PIC_SIZE;
|
||||
}
|
||||
sCreatingSpriteTemplate.tileTag = TAG_NONE;
|
||||
sCreatingSpriteTemplate.anims = gBaseStats[species].frontAnim;
|
||||
sCreatingSpriteTemplate.anims = gBaseStats[species].frontAnimFrames;
|
||||
sCreatingSpriteTemplate.images = images;
|
||||
if (type == MON_PIC_AFFINE_FRONT)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue