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_GARBODOR_GIGANTAMAX 1307
|
||||||
#define SPECIES_STUNFISK_GALARIAN 1308
|
#define SPECIES_STUNFISK_GALARIAN 1308
|
||||||
#define SPECIES_MELMETAL_GIGANTAMAX 1309
|
#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
|
#define SPECIES_SLOWPOKE_GALARIAN 1310
|
||||||
// The Isle of Armor (New Species)
|
// The Isle of Armor (New Species)
|
||||||
#define SPECIES_KUBFU 1311
|
#define SPECIES_KUBFU 1311
|
||||||
|
|
|
@ -359,7 +359,7 @@ struct BaseStats
|
||||||
u8 iconPalIndexFemale;
|
u8 iconPalIndexFemale;
|
||||||
const u8 *const footprint;
|
const u8 *const footprint;
|
||||||
// Animation Data
|
// Animation Data
|
||||||
const union AnimCmd *const *frontAnim;
|
const union AnimCmd *const *frontAnimFrames;
|
||||||
u8 frontAnimDelay;
|
u8 frontAnimDelay;
|
||||||
u8 frontAnimId;
|
u8 frontAnimId;
|
||||||
u8 backAnimId;
|
u8 backAnimId;
|
||||||
|
|
|
@ -928,7 +928,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
||||||
|
|
||||||
if (targetSpecies == SPECIES_CASTFORM || targetSpecies == SPECIES_CHERRIM)
|
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);
|
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
|
||||||
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32);
|
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,32 +2,68 @@
|
||||||
// 255 (MON_GENDERLESS) is reserved for genderless Pokémon.
|
// 255 (MON_GENDERLESS) is reserved for genderless Pokémon.
|
||||||
#define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100))
|
#define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100))
|
||||||
|
|
||||||
// Macros to allow editing every form at once
|
|
||||||
#define FLIP 0
|
#define FLIP 0
|
||||||
#define NO_FLIP 1
|
#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[] =
|
const struct BaseStats gBaseStats[] =
|
||||||
{
|
{
|
||||||
[SPECIES_NONE] =
|
[SPECIES_NONE] =
|
||||||
{
|
{
|
||||||
.categoryName = _("Unknown"),
|
DEX_TEXT(Dummy, "Unknown"),
|
||||||
.description = gDummyPokedexText,
|
DEX_SCALE(256, 0, 256, 0),
|
||||||
.pokemonScale = 256,
|
HEIGHT_WEIGHT(0, 0),
|
||||||
.pokemonOffset = 0,
|
LEARNSETS(Bulbasaur),
|
||||||
.trainerScale = 256,
|
FRONT_SPRITE(QuestionMark, 40, 40, 12, 0),
|
||||||
.trainerOffset = 0,
|
BACK_SPRITE (QuestionMark, 40, 40, 12),
|
||||||
.footprint = gMonFootprint_Bulbasaur,
|
PALETTES(QuestionMark),
|
||||||
.levelUpLearnset = sBulbasaurLevelUpLearnset,
|
ICON(QuestionMark, 0),
|
||||||
.teachableLearnset = sBulbasaurTeachableLearnset,
|
FOOTPRINT(Bulbasaur),
|
||||||
.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,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
[SPECIES_BULBASAUR] =
|
[SPECIES_BULBASAUR] =
|
||||||
|
@ -54,30 +90,16 @@ const struct BaseStats gBaseStats[] =
|
||||||
.bodyColor = BODY_COLOR_GREEN,
|
.bodyColor = BODY_COLOR_GREEN,
|
||||||
.noFlip = FALSE,
|
.noFlip = FALSE,
|
||||||
.natDexNum = NATIONAL_DEX_BULBASAUR,
|
.natDexNum = NATIONAL_DEX_BULBASAUR,
|
||||||
.categoryName = _("Seed"),
|
DEX_TEXT(Bulbasaur, "Seed"),
|
||||||
.height = 7,
|
DEX_SCALE(356, 17, 256, 0),
|
||||||
.weight = 69,
|
HEIGHT_WEIGHT(7, 69),
|
||||||
.description = gBulbasaurPokedexText,
|
LEARNSETS(Bulbasaur),
|
||||||
.pokemonScale = 356,
|
FRONT_SPRITE(Bulbasaur, 40, 40, 13, 0),
|
||||||
.pokemonOffset = 17,
|
BACK_SPRITE (Bulbasaur, 56, 40, 12),
|
||||||
.trainerScale = 256,
|
PALETTES(Bulbasaur),
|
||||||
.trainerOffset = 0,
|
ICON(Bulbasaur, 4),
|
||||||
.levelUpLearnset = sBulbasaurLevelUpLearnset,
|
FOOTPRINT(Bulbasaur),
|
||||||
.teachableLearnset = sBulbasaurTeachableLearnset,
|
ANIMATIONS(BULBASAUR, 0, ANIM_V_JUMPS_H_JUMPS, BACK_ANIM_DIP_RIGHT_SIDE),
|
||||||
.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,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
[SPECIES_IVYSAUR] =
|
[SPECIES_IVYSAUR] =
|
||||||
|
|
|
@ -1308,7 +1308,7 @@ const struct CompressedSpriteSheet gMonFrontPicTableFemale[] =
|
||||||
#if P_GEN_6_POKEMON == TRUE
|
#if P_GEN_6_POKEMON == TRUE
|
||||||
SPECIES_SPRITE(PYROAR, gMonFrontPic_PyroarF),
|
SPECIES_SPRITE(PYROAR, gMonFrontPic_PyroarF),
|
||||||
#endif
|
#endif
|
||||||
#if P_GEN_7_POKEMON == TRUE
|
#if P_GEN_8_POKEMON == TRUE
|
||||||
SPECIES_SPRITE(BASCULEGION, gMonFrontPic_QuestionMark), //gMonFrontPic_BasculegionF),
|
SPECIES_SPRITE(BASCULEGION, gMonFrontPic_QuestionMark), //gMonFrontPic_BasculegionF),
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -4444,9 +4444,9 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition)
|
||||||
if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT)
|
if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT)
|
||||||
gMultiuseSpriteTemplate.anims = gAnims_MonPic;
|
gMultiuseSpriteTemplate.anims = gAnims_MonPic;
|
||||||
else if (speciesTag > SPECIES_SHINY_TAG)
|
else if (speciesTag > SPECIES_SHINY_TAG)
|
||||||
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag - SPECIES_SHINY_TAG].frontAnim;
|
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag - SPECIES_SHINY_TAG].frontAnimFrames;
|
||||||
else
|
else
|
||||||
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag].frontAnim;
|
gMultiuseSpriteTemplate.anims = gBaseStats[speciesTag].frontAnimFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerPicId, u8 battlerPosition)
|
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerPicId, u8 battlerPosition)
|
||||||
|
|
|
@ -232,7 +232,7 @@ static void CreateBattlerSprite(u8 battler)
|
||||||
|
|
||||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]);
|
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]);
|
||||||
if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM)
|
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)
|
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]);
|
StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]);
|
||||||
if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM)
|
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;
|
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;
|
images[j].size = MON_PIC_SIZE;
|
||||||
}
|
}
|
||||||
sCreatingSpriteTemplate.tileTag = TAG_NONE;
|
sCreatingSpriteTemplate.tileTag = TAG_NONE;
|
||||||
sCreatingSpriteTemplate.anims = gBaseStats[species].frontAnim;
|
sCreatingSpriteTemplate.anims = gBaseStats[species].frontAnimFrames;
|
||||||
sCreatingSpriteTemplate.images = images;
|
sCreatingSpriteTemplate.images = images;
|
||||||
if (type == MON_PIC_AFFINE_FRONT)
|
if (type == MON_PIC_AFFINE_FRONT)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue