mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-28 04:34:28 +01:00
added gender based sprites, added textbox line, adjusted sprite offset to match line
This commit is contained in:
parent
6c520659aa
commit
b0f8408fb6
@ -21,6 +21,7 @@ void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffe
|
|||||||
void DecompressPicFromTableGender(void* buffer, s32 species, u32 personality);
|
void DecompressPicFromTableGender(void* buffer, s32 species, u32 personality);
|
||||||
|
|
||||||
void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality);
|
void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality);
|
||||||
|
void HandleLoadSpecialPokePicCustom(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFemale);
|
||||||
|
|
||||||
void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic);
|
void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic);
|
||||||
|
|
||||||
|
@ -113,6 +113,43 @@ void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32
|
|||||||
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void LoadSpecialPokePicCustom(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic, bool8 isFemale)
|
||||||
|
{
|
||||||
|
if (species == SPECIES_UNOWN)
|
||||||
|
{
|
||||||
|
u32 id = GetUnownSpeciesId(personality);
|
||||||
|
|
||||||
|
if (!isFrontPic)
|
||||||
|
LZ77UnCompWram(gMonBackPicTable[id].data, dest);
|
||||||
|
else
|
||||||
|
LZ77UnCompWram(gMonFrontPicTable[id].data, dest);
|
||||||
|
}
|
||||||
|
else if (species > NUM_SPECIES) // is species unknown? draw the ? icon
|
||||||
|
LZ77UnCompWram(gMonFrontPicTable[0].data, dest);
|
||||||
|
else if (SpeciesHasGenderDifference[species] && isFemale)
|
||||||
|
{
|
||||||
|
if (isFrontPic)
|
||||||
|
LZ77UnCompWram(gMonFrontPicTableFemale[species].data, dest);
|
||||||
|
else
|
||||||
|
LZ77UnCompWram(gMonBackPicTableFemale[species].data, dest);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LZ77UnCompWram(src->data, dest);
|
||||||
|
|
||||||
|
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
||||||
|
}
|
||||||
|
void HandleLoadSpecialPokePicCustom(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFemale)
|
||||||
|
{
|
||||||
|
bool8 isFrontPic;
|
||||||
|
|
||||||
|
if (src == &gMonFrontPicTable[species])
|
||||||
|
isFrontPic = TRUE; // frontPic
|
||||||
|
else
|
||||||
|
isFrontPic = FALSE; // backPic
|
||||||
|
|
||||||
|
LoadSpecialPokePicCustom(src, dest, species, personality, isFrontPic, isFemale);
|
||||||
|
}
|
||||||
|
|
||||||
void Unused_LZDecompressWramIndirect(const void **src, void *dest)
|
void Unused_LZDecompressWramIndirect(const void **src, void *dest)
|
||||||
{
|
{
|
||||||
LZ77UnCompWram(*src, dest);
|
LZ77UnCompWram(*src, dest);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//Credits: Gamer2020, AsparagusEduardo
|
//Credits: Gamer2020, AsparagusEduardo
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "battle.h"
|
#include "battle.h"
|
||||||
|
#include "battle_anim.h"
|
||||||
#include "bg.h"
|
#include "bg.h"
|
||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
#include "constants/songs.h"
|
#include "constants/songs.h"
|
||||||
@ -47,6 +48,11 @@
|
|||||||
#define MODIFY_DIGITS_ARROW1_Y 12
|
#define MODIFY_DIGITS_ARROW1_Y 12
|
||||||
#define MODIFY_DIGITS_ARROW2_Y 36
|
#define MODIFY_DIGITS_ARROW2_Y 36
|
||||||
|
|
||||||
|
#define GENDER_MALE 0
|
||||||
|
#define GENDER_FEMALE 1
|
||||||
|
#define MON_PIC_BACK 0
|
||||||
|
#define MON_PIC_FRONT 1
|
||||||
|
|
||||||
static const u16 sBgColor[] = {RGB_WHITE};
|
static const u16 sBgColor[] = {RGB_WHITE};
|
||||||
|
|
||||||
//Structs
|
//Structs
|
||||||
@ -71,12 +77,15 @@ struct PokemonDebugMenu
|
|||||||
u8 frontspriteId;
|
u8 frontspriteId;
|
||||||
u8 backspriteId;
|
u8 backspriteId;
|
||||||
u8 iconspriteId;
|
u8 iconspriteId;
|
||||||
u8 isshiny;
|
bool8 isShiny;
|
||||||
|
u8 gender;
|
||||||
struct PokemonDebugModifyArrows modifyArrows;
|
struct PokemonDebugModifyArrows modifyArrows;
|
||||||
u8 modifyWindowId;
|
u8 modifyWindowId;
|
||||||
|
u8 messageBoxWindowId;
|
||||||
};
|
};
|
||||||
|
|
||||||
//WindowTemplates
|
//WindowTemplates
|
||||||
|
/*
|
||||||
static const struct WindowTemplate sCurrentTitleTemplate =
|
static const struct WindowTemplate sCurrentTitleTemplate =
|
||||||
{
|
{
|
||||||
.bg = 0,
|
.bg = 0,
|
||||||
@ -87,6 +96,7 @@ static const struct WindowTemplate sCurrentTitleTemplate =
|
|||||||
.paletteNum = 0xF,
|
.paletteNum = 0xF,
|
||||||
.baseBlock = 0x200
|
.baseBlock = 0x200
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
static const struct WindowTemplate sDebugPokemonInstructionsTemplate =
|
static const struct WindowTemplate sDebugPokemonInstructionsTemplate =
|
||||||
{
|
{
|
||||||
@ -110,6 +120,17 @@ static const struct WindowTemplate sModifyWindowTemplate =
|
|||||||
.baseBlock = 0x200
|
.baseBlock = 0x200
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct WindowTemplate sPokemonDebugMsgBoxWindowTemplate =
|
||||||
|
{
|
||||||
|
.bg = 0,
|
||||||
|
.tilemapLeft = 3,
|
||||||
|
.tilemapTop = 14,
|
||||||
|
.width = 11,
|
||||||
|
.height = 1,
|
||||||
|
.paletteNum = 0,
|
||||||
|
.baseBlock = 0x100
|
||||||
|
};
|
||||||
|
|
||||||
//Function declarations
|
//Function declarations
|
||||||
static void PrintDigitChars(struct PokemonDebugMenu *data);
|
static void PrintDigitChars(struct PokemonDebugMenu *data);
|
||||||
static void SetUpModifyArrows(struct PokemonDebugMenu *data);
|
static void SetUpModifyArrows(struct PokemonDebugMenu *data);
|
||||||
@ -143,6 +164,7 @@ static void PadString(const u8 *src, u8 *dst)
|
|||||||
dst[i] = EOS;
|
dst[i] = EOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
static void PrintOnCurrentMonWindow(u8 windowId, u16 monId)
|
static void PrintOnCurrentMonWindow(u8 windowId, u16 monId)
|
||||||
{
|
{
|
||||||
u8 text[POKEMON_NAME_LENGTH + 10];
|
u8 text[POKEMON_NAME_LENGTH + 10];
|
||||||
@ -160,6 +182,7 @@ static void PrintOnCurrentMonWindow(u8 windowId, u16 monId)
|
|||||||
AddTextPrinterParameterized(windowId, 1, text, 0, 0, 0, NULL);
|
AddTextPrinterParameterized(windowId, 1, text, 0, 0, 0, NULL);
|
||||||
CopyWindowToVram(windowId, 3);
|
CopyWindowToVram(windowId, 3);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
static void PrintInstructionsOnWindow(u8 windowId)
|
static void PrintInstructionsOnWindow(u8 windowId)
|
||||||
{
|
{
|
||||||
@ -193,16 +216,26 @@ static void SetStructPtr(u8 taskId, void *ptr)
|
|||||||
static void PrintDigitChars(struct PokemonDebugMenu *data)
|
static void PrintDigitChars(struct PokemonDebugMenu *data)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
|
u16 species = data->modifyArrows.currValue;
|
||||||
u8 text[MODIFY_DIGITS_MAX + POKEMON_NAME_LENGTH + 4];
|
u8 text[MODIFY_DIGITS_MAX + POKEMON_NAME_LENGTH + 4];
|
||||||
|
|
||||||
for (i = 0; i < data->modifyArrows.maxDigits; i++)
|
for (i = 0; i < data->modifyArrows.maxDigits; i++)
|
||||||
text[i] = data->modifyArrows.charDigits[i];
|
text[i] = data->modifyArrows.charDigits[i];
|
||||||
|
|
||||||
text[i] = CHAR_SPACE;
|
text[i++] = CHAR_SPACE;
|
||||||
text[i + 1] = CHAR_HYPHEN;
|
text[i++] = CHAR_HYPHEN;
|
||||||
text[i + 2] = CHAR_SPACE;
|
|
||||||
|
|
||||||
StringCopy(&text[i + 3], gSpeciesNames[data->modifyArrows.currValue]);
|
if (SpeciesHasGenderDifference[species])
|
||||||
|
{
|
||||||
|
if (data->gender == GENDER_MALE)
|
||||||
|
text[i++] = CHAR_MALE;
|
||||||
|
else
|
||||||
|
text[i++] = CHAR_FEMALE;
|
||||||
|
text[i++] = CHAR_HYPHEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
text[i++] = CHAR_SPACE;
|
||||||
|
StringCopy(&text[i], gSpeciesNames[species]);
|
||||||
|
|
||||||
FillWindowPixelBuffer(data->modifyWindowId, 0x11);
|
FillWindowPixelBuffer(data->modifyWindowId, 0x11);
|
||||||
AddTextPrinterParameterized(data->modifyWindowId, 1, text, 3, 0, 0, NULL);
|
AddTextPrinterParameterized(data->modifyWindowId, 1, text, 3, 0, 0, NULL);
|
||||||
@ -342,6 +375,215 @@ static void UpdateBattlerValue(struct PokemonDebugMenu *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Sprite functions
|
||||||
|
static const struct CompressedSpritePalette *GetMonSpritePalStructCustom(u16 species, u8 gender, bool8 isShiny)
|
||||||
|
{
|
||||||
|
if (isShiny)
|
||||||
|
{
|
||||||
|
if (SpeciesHasGenderDifference[species] && gender == GENDER_FEMALE)
|
||||||
|
return &gMonShinyPaletteTableFemale[species];
|
||||||
|
else
|
||||||
|
return &gMonShinyPaletteTable[species];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SpeciesHasGenderDifference[species] && gender == GENDER_FEMALE)
|
||||||
|
return &gMonPaletteTableFemale[species];
|
||||||
|
else
|
||||||
|
return &gMonPaletteTable[species];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// One entry for each of the four Castform forms.
|
||||||
|
extern const struct MonCoords gCastformFrontSpriteCoords[];
|
||||||
|
static const u8 sCastformElevations[] =
|
||||||
|
{
|
||||||
|
13, // NORMAL
|
||||||
|
14, // SUN
|
||||||
|
13, // RAIN
|
||||||
|
13, // HAIL
|
||||||
|
};
|
||||||
|
// Const rom data
|
||||||
|
static const struct UCoords8 sBattlerCoords[][4] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{ 72, 80 },
|
||||||
|
{ 176, 40 },
|
||||||
|
{ 48, 40 },
|
||||||
|
{ 112, 80 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ 32, 80 },
|
||||||
|
{ 200, 40 },
|
||||||
|
{ 90, 88 },
|
||||||
|
{ 152, 32 },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
static u8 GetBattlerYDeltaCustom(u8 pic_type, u16 species)
|
||||||
|
{
|
||||||
|
u32 personality;
|
||||||
|
u8 ret;
|
||||||
|
u16 coordSpecies;
|
||||||
|
|
||||||
|
if (pic_type == MON_PIC_BACK)
|
||||||
|
{
|
||||||
|
if (species == SPECIES_UNOWN)
|
||||||
|
{
|
||||||
|
//coordSpecies = GetUnownSpeciesId(personality);
|
||||||
|
//ret = gMonBackPicCoords[coordSpecies].y_offset;
|
||||||
|
}
|
||||||
|
else if (species == SPECIES_CASTFORM)
|
||||||
|
ret = 0; //sCastformBackSpriteYCoords[0]]; //all of them are 0???
|
||||||
|
else if (species > NUM_SPECIES)
|
||||||
|
ret = gMonBackPicCoords[0].y_offset;
|
||||||
|
else
|
||||||
|
ret = gMonBackPicCoords[species].y_offset;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (species == SPECIES_UNOWN)
|
||||||
|
{
|
||||||
|
//coordSpecies = GetUnownSpeciesId(personality);
|
||||||
|
//ret = gMonFrontPicCoords[coordSpecies].y_offset;
|
||||||
|
}
|
||||||
|
else if (species == SPECIES_CASTFORM)
|
||||||
|
ret = gCastformFrontSpriteCoords[0].y_offset;
|
||||||
|
else if (species > NUM_SPECIES)
|
||||||
|
ret = gMonFrontPicCoords[0].y_offset;
|
||||||
|
else
|
||||||
|
ret = gMonFrontPicCoords[species].y_offset;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
static u8 GetBattlerElevationCustom(u8 pic_type, u16 species)
|
||||||
|
{
|
||||||
|
u8 ret = 0;
|
||||||
|
if (pic_type == MON_PIC_FRONT)
|
||||||
|
{
|
||||||
|
if (species == SPECIES_CASTFORM)
|
||||||
|
ret = sCastformElevations[0];
|
||||||
|
else if (species > NUM_SPECIES)
|
||||||
|
ret = gEnemyMonElevation[0];
|
||||||
|
else
|
||||||
|
ret = gEnemyMonElevation[species];
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
u8 GetBattlerSpriteFinal_YCustom(u8 pic_type, u16 species, bool8 a3)
|
||||||
|
{
|
||||||
|
u16 offset;
|
||||||
|
u8 y;
|
||||||
|
|
||||||
|
if (pic_type == MON_PIC_BACK)
|
||||||
|
offset = GetBattlerYDeltaCustom(pic_type, species);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
offset = GetBattlerYDeltaCustom(pic_type, species);
|
||||||
|
offset -= GetBattlerElevationCustom(pic_type, species);
|
||||||
|
}
|
||||||
|
y = offset + sBattlerCoords[0][pic_type].y;
|
||||||
|
if (a3)
|
||||||
|
{
|
||||||
|
if (pic_type == MON_PIC_BACK)
|
||||||
|
y += 8;
|
||||||
|
if (y > 104)
|
||||||
|
y = 104;
|
||||||
|
}
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
static u8 GetBattlerSpriteCoordCustom(u16 species, u8 pic_type, u8 coordType)
|
||||||
|
{
|
||||||
|
u8 retVal;
|
||||||
|
|
||||||
|
switch (coordType)
|
||||||
|
{
|
||||||
|
case BATTLER_COORD_X:
|
||||||
|
case BATTLER_COORD_X_2:
|
||||||
|
retVal = sBattlerCoords[0][pic_type].x;
|
||||||
|
break;
|
||||||
|
case BATTLER_COORD_Y:
|
||||||
|
retVal = sBattlerCoords[0][pic_type].y;
|
||||||
|
break;
|
||||||
|
case BATTLER_COORD_Y_PIC_OFFSET:
|
||||||
|
retVal = GetBattlerSpriteFinal_YCustom(pic_type, species, TRUE);
|
||||||
|
break;
|
||||||
|
case BATTLER_COORD_Y_PIC_OFFSET_DEFAULT:
|
||||||
|
retVal = GetBattlerSpriteFinal_YCustom(pic_type, species, FALSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
static s16 GetBattlerSpriteCoordAttrCustom(u16 species, u8 pic_type, u8 attr, bool8 transformSpecies)
|
||||||
|
{
|
||||||
|
u32 personality;
|
||||||
|
int ret = 0;
|
||||||
|
const struct MonCoords *coords;
|
||||||
|
|
||||||
|
|
||||||
|
if (pic_type == MON_PIC_BACK)
|
||||||
|
{
|
||||||
|
if (!transformSpecies)
|
||||||
|
//personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PERSONALITY);
|
||||||
|
else
|
||||||
|
//personality = gTransformedPersonalities[battlerId];
|
||||||
|
|
||||||
|
if (species == SPECIES_UNOWN)
|
||||||
|
{
|
||||||
|
//species = GetUnownSpeciesId(personality);
|
||||||
|
coords = &gMonBackPicCoords[species];
|
||||||
|
}
|
||||||
|
else if (species > NUM_SPECIES)
|
||||||
|
coords = &gMonBackPicCoords[0];
|
||||||
|
else
|
||||||
|
coords = &gMonBackPicCoords[species];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!transformSpecies)
|
||||||
|
//personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PERSONALITY);
|
||||||
|
else
|
||||||
|
//personality = gTransformedPersonalities[battlerId];
|
||||||
|
|
||||||
|
if (species == SPECIES_UNOWN)
|
||||||
|
{
|
||||||
|
//species = GetUnownSpeciesId(personality);
|
||||||
|
coords = &gMonFrontPicCoords[species];
|
||||||
|
}
|
||||||
|
else if (species == SPECIES_CASTFORM)
|
||||||
|
coords = &gCastformFrontSpriteCoords[0];
|
||||||
|
else if (species > NUM_SPECIES)
|
||||||
|
coords = &gMonFrontPicCoords[0];
|
||||||
|
else
|
||||||
|
coords = &gMonFrontPicCoords[species];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
switch (attr)
|
||||||
|
{
|
||||||
|
case BATTLER_COORD_ATTR_HEIGHT:
|
||||||
|
return (coords->size & 0xf) * 8;
|
||||||
|
case BATTLER_COORD_ATTR_WIDTH:
|
||||||
|
return (coords->size >> 4) * 8;
|
||||||
|
case BATTLER_COORD_ATTR_LEFT:
|
||||||
|
return GetBattlerSpriteCoordCustom(species, pic_type, BATTLER_COORD_X_2) - ((coords->size >> 4) * 4);
|
||||||
|
case BATTLER_COORD_ATTR_RIGHT:
|
||||||
|
return GetBattlerSpriteCoordCustom(species, pic_type, BATTLER_COORD_X_2) + ((coords->size >> 4) * 4);
|
||||||
|
case BATTLER_COORD_ATTR_TOP:
|
||||||
|
return GetBattlerSpriteCoordCustom(species, pic_type, BATTLER_COORD_Y_PIC_OFFSET) - ((coords->size & 0xf) * 4);
|
||||||
|
case BATTLER_COORD_ATTR_BOTTOM:
|
||||||
|
return GetBattlerSpriteCoordCustom(species, pic_type, BATTLER_COORD_Y_PIC_OFFSET) + ((coords->size & 0xf) * 4);
|
||||||
|
case BATTLER_COORD_ATTR_RAW_BOTTOM:
|
||||||
|
ret = GetBattlerSpriteCoordCustom(species, pic_type, BATTLER_COORD_Y) + 31;
|
||||||
|
return ret - coords->y_offset;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
// Main functions
|
// Main functions
|
||||||
void CB2_Debug_Pokemon(void)
|
void CB2_Debug_Pokemon(void)
|
||||||
@ -349,6 +591,8 @@ void CB2_Debug_Pokemon(void)
|
|||||||
u8 taskId;
|
u8 taskId;
|
||||||
const struct CompressedSpritePalette *palette;
|
const struct CompressedSpritePalette *palette;
|
||||||
struct PokemonDebugMenu *data;
|
struct PokemonDebugMenu *data;
|
||||||
|
s16 offset_x, offset_y;
|
||||||
|
u16 species;
|
||||||
|
|
||||||
switch (gMain.state)
|
switch (gMain.state)
|
||||||
{
|
{
|
||||||
@ -390,35 +634,41 @@ void CB2_Debug_Pokemon(void)
|
|||||||
SetStructPtr(taskId, data);
|
SetStructPtr(taskId, data);
|
||||||
|
|
||||||
data->currentmonId = 1;
|
data->currentmonId = 1;
|
||||||
//data->currentmonWindowId = AddWindow(&sCurrentTitleTemplate);
|
species = data->currentmonId;
|
||||||
|
/*
|
||||||
|
data->currentmonWindowId = AddWindow(&sCurrentTitleTemplate);
|
||||||
PutWindowTilemap(data->currentmonWindowId);
|
PutWindowTilemap(data->currentmonWindowId);
|
||||||
PrintOnCurrentMonWindow(data->currentmonWindowId, data->currentmonId);
|
PrintOnCurrentMonWindow(data->currentmonWindowId, data->currentmonId);
|
||||||
|
*/
|
||||||
|
|
||||||
data->InstructionsWindowId = AddWindow(&sDebugPokemonInstructionsTemplate);
|
data->InstructionsWindowId = AddWindow(&sDebugPokemonInstructionsTemplate);
|
||||||
PutWindowTilemap(data->InstructionsWindowId);
|
PutWindowTilemap(data->InstructionsWindowId);
|
||||||
PrintInstructionsOnWindow(data->InstructionsWindowId);
|
PrintInstructionsOnWindow(data->InstructionsWindowId);
|
||||||
|
|
||||||
HandleLoadSpecialPokePic(&gMonFrontPicTable[data->currentmonId], gMonSpritesGfxPtr->sprites.ptr[1], data->currentmonId, 0);
|
HandleLoadSpecialPokePicCustom(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, 0, data->gender);
|
||||||
data->isshiny = DEBUG_MON_NORMAL;
|
data->isShiny = FALSE;
|
||||||
palette = GetMonSpritePalStructFromOtIdPersonality(data->currentmonId, 0, data->isshiny);
|
data->gender = GENDER_MALE;
|
||||||
|
palette = GetMonSpritePalStructCustom(species, data->gender, data->isShiny);
|
||||||
LoadCompressedSpritePalette(palette);
|
LoadCompressedSpritePalette(palette);
|
||||||
SetMultiuseSpriteTemplateToPokemon(data->currentmonId, 1);
|
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||||
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
||||||
data->frontspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_X + 32, DEBUG_MON_Y + 40, 0);
|
data->frontspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_X + 32, DEBUG_MON_Y + 40, 0);
|
||||||
gSprites[data->frontspriteId].callback = SpriteCallbackDummy;
|
gSprites[data->frontspriteId].callback = SpriteCallbackDummy;
|
||||||
gSprites[data->frontspriteId].oam.priority = 0;
|
gSprites[data->frontspriteId].oam.priority = 0;
|
||||||
|
|
||||||
HandleLoadSpecialPokePic(&gMonBackPicTable[data->currentmonId], gMonSpritesGfxPtr->sprites.ptr[2], data->currentmonId, 0);
|
HandleLoadSpecialPokePicCustom(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[2], species, 0, data->gender);
|
||||||
palette = GetMonSpritePalStructFromOtIdPersonality(data->currentmonId, 0, data->isshiny);
|
palette = GetMonSpritePalStructCustom(species, data->gender, data->isShiny);
|
||||||
LoadCompressedSpritePalette(palette);
|
LoadCompressedSpritePalette(palette);
|
||||||
SetMultiuseSpriteTemplateToPokemon(data->currentmonId, 2);
|
SetMultiuseSpriteTemplateToPokemon(species, 2);
|
||||||
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
||||||
data->backspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_BACK_X + 32, DEBUG_MON_BACK_Y + 40, 0);
|
//offset_y = GetBattlerSpriteCoordAttrCustom(species, MON_PIC_BACK, BATTLER_COORD_ATTR_BOTTOM, FALSE);
|
||||||
|
offset_y = gMonBackPicCoords[species].y_offset;
|
||||||
|
data->backspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_BACK_X + 32, DEBUG_MON_BACK_Y + 30 + offset_y, 0);
|
||||||
gSprites[data->backspriteId].callback = SpriteCallbackDummy;
|
gSprites[data->backspriteId].callback = SpriteCallbackDummy;
|
||||||
gSprites[data->backspriteId].oam.priority = 0;
|
gSprites[data->backspriteId].oam.priority = 0;
|
||||||
|
|
||||||
//Icon Sprite
|
//Icon Sprite
|
||||||
data->iconspriteId = CreateMonIcon(data->currentmonId, SpriteCB_MonIcon, DEBUG_ICON_X + 32, DEBUG_ICON_Y + 40, 4, data->isshiny);
|
data->iconspriteId = CreateMonIcon(species, SpriteCB_MonIcon, DEBUG_ICON_X + 32, DEBUG_ICON_Y + 40, 4, data->isShiny);
|
||||||
gSprites[data->iconspriteId].oam.priority = 0;
|
gSprites[data->iconspriteId].oam.priority = 0;
|
||||||
|
|
||||||
//Modify Arrows
|
//Modify Arrows
|
||||||
@ -427,6 +677,13 @@ void CB2_Debug_Pokemon(void)
|
|||||||
CopyWindowToVram(data->modifyWindowId, 3);
|
CopyWindowToVram(data->modifyWindowId, 3);
|
||||||
SetUpModifyArrows(data);
|
SetUpModifyArrows(data);
|
||||||
PrintDigitChars(data);
|
PrintDigitChars(data);
|
||||||
|
|
||||||
|
//MessageBox line
|
||||||
|
data->messageBoxWindowId = AddWindow(&sPokemonDebugMsgBoxWindowTemplate);
|
||||||
|
PutWindowTilemap(data->messageBoxWindowId);
|
||||||
|
CopyWindowToVram(data->messageBoxWindowId, 3);
|
||||||
|
FillWindowPixelRect(data->messageBoxWindowId, PIXEL_FILL(0x1), 0, 0, 90, 4);
|
||||||
|
|
||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
@ -503,15 +760,11 @@ static void Handle_Input_Debug_Pokemon(u8 taskId)
|
|||||||
}
|
}
|
||||||
else if (JOY_NEW(A_BUTTON))
|
else if (JOY_NEW(A_BUTTON))
|
||||||
{
|
{
|
||||||
if( data->isshiny == 9)
|
data->isShiny = !data->isShiny;
|
||||||
{
|
|
||||||
data->isshiny = DEBUG_MON_SHINY;
|
if(data->isShiny)
|
||||||
PlaySE(SE_SHINY);
|
PlaySE(SE_SHINY);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data->isshiny = DEBUG_MON_NORMAL;
|
|
||||||
}
|
|
||||||
ReloadPokemonSprites(data);
|
ReloadPokemonSprites(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -525,10 +778,22 @@ static void Handle_Input_Debug_Pokemon(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlayCryInternal(data->currentmonId, 0, 120, 10, 0);
|
PlayCryInternal(data->currentmonId, 0, 120, 10, 0);
|
||||||
}
|
}
|
||||||
|
else if (JOY_NEW(SELECT_BUTTON) && SpeciesHasGenderDifference[data->currentmonId])
|
||||||
|
{
|
||||||
|
if (data->gender == GENDER_MALE)
|
||||||
|
data->gender = GENDER_FEMALE;
|
||||||
|
else
|
||||||
|
data->gender = GENDER_MALE;
|
||||||
|
PrintDigitChars(data);
|
||||||
|
UpdateBattlerValue(data);
|
||||||
|
ReloadPokemonSprites(data);
|
||||||
|
while (!(gMain.intrCheck & INTR_FLAG_VBLANK));
|
||||||
|
}
|
||||||
else if (JOY_NEW(DPAD_DOWN)) // || gMain.heldKeys & DPAD_DOWN)
|
else if (JOY_NEW(DPAD_DOWN)) // || gMain.heldKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
if (TryMoveDigit(&data->modifyArrows, FALSE))
|
if (TryMoveDigit(&data->modifyArrows, FALSE))
|
||||||
{
|
{
|
||||||
|
data->gender = GENDER_MALE;
|
||||||
PrintDigitChars(data);
|
PrintDigitChars(data);
|
||||||
UpdateBattlerValue(data);
|
UpdateBattlerValue(data);
|
||||||
ReloadPokemonSprites(data);
|
ReloadPokemonSprites(data);
|
||||||
@ -542,6 +807,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (TryMoveDigit(&data->modifyArrows, TRUE))
|
if (TryMoveDigit(&data->modifyArrows, TRUE))
|
||||||
{
|
{
|
||||||
|
data->gender = GENDER_MALE;
|
||||||
PrintDigitChars(data);
|
PrintDigitChars(data);
|
||||||
UpdateBattlerValue(data);
|
UpdateBattlerValue(data);
|
||||||
ReloadPokemonSprites(data);
|
ReloadPokemonSprites(data);
|
||||||
@ -572,6 +838,9 @@ static void Handle_Input_Debug_Pokemon(u8 taskId)
|
|||||||
|
|
||||||
static void ReloadPokemonSprites(struct PokemonDebugMenu *data)
|
static void ReloadPokemonSprites(struct PokemonDebugMenu *data)
|
||||||
{
|
{
|
||||||
|
s16 offset_x = 0;
|
||||||
|
s16 offset_y = 0;
|
||||||
|
u16 species = data->currentmonId;
|
||||||
const struct CompressedSpritePalette *palette;
|
const struct CompressedSpritePalette *palette;
|
||||||
|
|
||||||
DestroySprite(&gSprites[data->frontspriteId]);
|
DestroySprite(&gSprites[data->frontspriteId]);
|
||||||
@ -590,26 +859,28 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data)
|
|||||||
|
|
||||||
LoadMonIconPalettes();
|
LoadMonIconPalettes();
|
||||||
|
|
||||||
HandleLoadSpecialPokePic(&gMonFrontPicTable[data->currentmonId], gMonSpritesGfxPtr->sprites.ptr[1], data->currentmonId, 0);
|
HandleLoadSpecialPokePicCustom(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, 0, data->gender);
|
||||||
palette = GetMonSpritePalStructFromOtIdPersonality(data->currentmonId, 0, data->isshiny);
|
palette = GetMonSpritePalStructCustom(species, data->gender, data->isShiny);
|
||||||
LoadCompressedSpritePalette(palette);
|
LoadCompressedSpritePalette(palette);
|
||||||
SetMultiuseSpriteTemplateToPokemon(data->currentmonId, 1);
|
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||||
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
||||||
data->frontspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_X + 32, DEBUG_MON_Y + 40, 0);
|
data->frontspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_X + 32, DEBUG_MON_Y + 40, 0);
|
||||||
gSprites[data->frontspriteId].callback = SpriteCallbackDummy;
|
gSprites[data->frontspriteId].callback = SpriteCallbackDummy;
|
||||||
gSprites[data->frontspriteId].oam.priority = 0;
|
gSprites[data->frontspriteId].oam.priority = 0;
|
||||||
|
|
||||||
HandleLoadSpecialPokePic(&gMonBackPicTable[data->currentmonId], gMonSpritesGfxPtr->sprites.ptr[2], data->currentmonId, 0);
|
HandleLoadSpecialPokePicCustom(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[2], species, 0, data->gender);
|
||||||
palette = GetMonSpritePalStructFromOtIdPersonality(data->currentmonId, 0, data->isshiny);
|
palette = GetMonSpritePalStructCustom(species, data->gender, data->isShiny);
|
||||||
LoadCompressedSpritePalette(palette);
|
LoadCompressedSpritePalette(palette);
|
||||||
SetMultiuseSpriteTemplateToPokemon(data->currentmonId, 2);
|
SetMultiuseSpriteTemplateToPokemon(species, 2);
|
||||||
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
||||||
data->backspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_BACK_X + 32, DEBUG_MON_BACK_Y + 40, 0);
|
//offset_y = GetBattlerSpriteCoordAttrCustom(species, MON_PIC_BACK, BATTLER_COORD_ATTR_BOTTOM, FALSE);
|
||||||
|
offset_y = gMonBackPicCoords[species].y_offset;
|
||||||
|
data->backspriteId = CreateSprite(&gMultiuseSpriteTemplate, DEBUG_MON_BACK_X + 32, DEBUG_MON_BACK_Y + 30 + offset_y, 0);
|
||||||
gSprites[data->backspriteId].callback = SpriteCallbackDummy;
|
gSprites[data->backspriteId].callback = SpriteCallbackDummy;
|
||||||
gSprites[data->backspriteId].oam.priority = 0;
|
gSprites[data->backspriteId].oam.priority = 0;
|
||||||
|
|
||||||
//Icon Sprite
|
//Icon Sprite
|
||||||
data->iconspriteId = CreateMonIcon(data->currentmonId, SpriteCB_MonIcon, DEBUG_ICON_X + 32, DEBUG_ICON_Y + 40, 4, data->isshiny);
|
data->iconspriteId = CreateMonIcon(species, SpriteCB_MonIcon, DEBUG_ICON_X + 32, DEBUG_ICON_Y + 40, 4, data->isShiny);
|
||||||
gSprites[data->iconspriteId].oam.priority = 0;
|
gSprites[data->iconspriteId].oam.priority = 0;
|
||||||
|
|
||||||
//Modify Arrows
|
//Modify Arrows
|
||||||
|
Loading…
Reference in New Issue
Block a user