Review pokemon storage system chaanges
This commit is contained in:
parent
ecee02816d
commit
1374c11a1c
3 changed files with 815 additions and 809 deletions
|
@ -4722,7 +4722,7 @@ u8 SendMonToPC(struct Pokemon* mon)
|
|||
|
||||
do
|
||||
{
|
||||
for (boxPos = 0; boxPos < 30; boxPos++)
|
||||
for (boxPos = 0; boxPos < IN_BOX_COUNT; boxPos++)
|
||||
{
|
||||
struct BoxPokemon* checkingMon = GetBoxedMonPtr(boxNo, boxPos);
|
||||
if (GetBoxMonData(checkingMon, MON_DATA_SPECIES, NULL) == SPECIES_NONE)
|
||||
|
@ -4739,7 +4739,7 @@ u8 SendMonToPC(struct Pokemon* mon)
|
|||
}
|
||||
|
||||
boxNo++;
|
||||
if (boxNo == 14)
|
||||
if (boxNo == TOTAL_BOXES_COUNT)
|
||||
boxNo = 0;
|
||||
} while (boxNo != StorageGetCurrentBox());
|
||||
|
||||
|
@ -4889,8 +4889,8 @@ bool8 IsPokemonStorageFull(void)
|
|||
{
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < 14; i++)
|
||||
for (j = 0; j < 30; j++)
|
||||
for (i = 0; i < TOTAL_BOXES_COUNT; i++)
|
||||
for (j = 0; j < IN_BOX_COUNT; j++)
|
||||
if (GetBoxMonDataAt(i, j, MON_DATA_SPECIES) == SPECIES_NONE)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -1123,7 +1123,7 @@ u16 sub_80D2E84(u16 species)
|
|||
else
|
||||
{
|
||||
if (species > (SPECIES_UNOWN_B - 1))
|
||||
species = 260;
|
||||
species = SPECIES_OLD_UNOWN_J; // That's an oddly specific species.
|
||||
return GetIconSpecies(species, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -426,6 +426,8 @@ enum
|
|||
#define TAG_PAL_DACE 0xDACE
|
||||
#define TAG_PAL_DAC7 0xDAC7
|
||||
#define TAG_PAL_DAC9 0xDAC9
|
||||
#define TAG_PAL_DAC0 0xDAC0
|
||||
#define TAG_PAL_DACB 0xDACB
|
||||
|
||||
#define TAG_TILE_WAVEFORM 0x5
|
||||
#define TAG_TILE_10 0x10
|
||||
|
@ -434,6 +436,10 @@ enum
|
|||
#define TAG_TILE_A 0xA
|
||||
#define TAG_TILE_3 0x3
|
||||
#define TAG_TILE_4 0x4
|
||||
#define TAG_TILE_12 0x12
|
||||
#define TAG_TILE_7 0x7
|
||||
#define TAG_TILE_0 0x0
|
||||
#define TAG_TILE_1 0x1
|
||||
|
||||
// IWRAM bss
|
||||
IWRAM_DATA static u32 gUnknown_03000F78[98];
|
||||
|
@ -1031,10 +1037,10 @@ static const union AnimCmd *const sSpriteAnimTable_85728AC[] =
|
|||
sSpriteAnim_857289C
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate gUnknown_085728BC =
|
||||
static const struct SpriteTemplate sSpriteTemplate_Waveform =
|
||||
{
|
||||
.tileTag = 5,
|
||||
.paletteTag = 0xDACA,
|
||||
.tileTag = TAG_TILE_WAVEFORM,
|
||||
.paletteTag = TAG_PAL_WAVEFORM,
|
||||
.oam = &sOamData_8572874,
|
||||
.anims = sSpriteAnimTable_85728AC,
|
||||
.images = NULL,
|
||||
|
@ -1045,8 +1051,8 @@ static const struct SpriteTemplate gUnknown_085728BC =
|
|||
static const struct OamData sOamData_85728EC;
|
||||
static const struct SpriteTemplate gUnknown_085728D4 =
|
||||
{
|
||||
.tileTag = 18,
|
||||
.paletteTag = 0xDAC0,
|
||||
.tileTag = TAG_TILE_12,
|
||||
.paletteTag = TAG_PAL_DAC0,
|
||||
.oam = &sOamData_85728EC,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
|
@ -1527,7 +1533,7 @@ static const union AnimCmd *const gSpriteAnimTable_83BB2E8[] =
|
|||
static const struct SpriteTemplate gUnknown_0857B0E0 =
|
||||
{
|
||||
6,
|
||||
0xDACA,
|
||||
TAG_PAL_WAVEFORM,
|
||||
&gOamData_83BB2D0,
|
||||
gSpriteAnimTable_83BB2E8,
|
||||
NULL,
|
||||
|
@ -2286,12 +2292,12 @@ static void Cb_InitPSS(u8 taskId)
|
|||
sub_80C7F4C();
|
||||
if (!sPSSData->isReshowingPSS)
|
||||
{
|
||||
BlendPalettes(0xFFFFFFFF, 0x10, 0);
|
||||
BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK);
|
||||
SetPSSCallback(Cb_ShowPSS);
|
||||
}
|
||||
else
|
||||
{
|
||||
BlendPalettes(0xFFFFFFFF, 0x10, 0);
|
||||
BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK);
|
||||
SetPSSCallback(Cb_ReshowPSS);
|
||||
}
|
||||
SetVBlankCallback(VblankCb_PSS);
|
||||
|
@ -3946,7 +3952,7 @@ static void sub_80CA1C4(void)
|
|||
LoadSpriteSheet(&sheet);
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&gUnknown_085728BC, i * 63 + 8, 9, 2);
|
||||
u8 spriteId = CreateSprite(&sSpriteTemplate_Waveform, i * 63 + 8, 9, 2);
|
||||
sPSSData->field_D98[i] = &gSprites[spriteId];
|
||||
}
|
||||
}
|
||||
|
@ -5497,7 +5503,7 @@ static void sub_80CCCFC(u8 boxId, s8 direction)
|
|||
{
|
||||
spriteSheet.tag = TAG_TILE_4;
|
||||
r8 = sPSSData->field_71C;
|
||||
template.tileTag = 4;
|
||||
template.tileTag = TAG_TILE_4;
|
||||
template.paletteTag = TAG_PAL_DAC9;
|
||||
}
|
||||
|
||||
|
@ -8429,7 +8435,7 @@ static void sub_80CFC14(void)
|
|||
|
||||
struct SpritePalette spritePalettes[] =
|
||||
{
|
||||
{gHandCursorPalette, 0xDAC7},
|
||||
{gHandCursorPalette, TAG_PAL_DAC7},
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -8476,8 +8482,8 @@ static const union AnimCmd *const sSpriteAnimTable_857BA40[] =
|
|||
|
||||
static const struct SpriteTemplate gSpriteTemplate_857BA50 =
|
||||
{
|
||||
.tileTag = 0,
|
||||
.paletteTag = 0xDACA,
|
||||
.tileTag = TAG_TILE_0,
|
||||
.paletteTag = TAG_PAL_WAVEFORM,
|
||||
.oam = &sOamData_857BA0C,
|
||||
.anims = sSpriteAnimTable_857BA40,
|
||||
.images = NULL,
|
||||
|
@ -8487,8 +8493,8 @@ static const struct SpriteTemplate gSpriteTemplate_857BA50 =
|
|||
|
||||
static const struct SpriteTemplate gSpriteTemplate_857BA68 =
|
||||
{
|
||||
.tileTag = 1,
|
||||
.paletteTag = 0xDACA,
|
||||
.tileTag = TAG_TILE_1,
|
||||
.paletteTag = TAG_PAL_WAVEFORM,
|
||||
.oam = &sOamData_857BA14,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
|
@ -8498,8 +8504,8 @@ static const struct SpriteTemplate gSpriteTemplate_857BA68 =
|
|||
|
||||
LoadSpriteSheets(spriteSheets);
|
||||
LoadSpritePalettes(spritePalettes);
|
||||
sPSSData->field_CD8[0] = IndexOfSpritePaletteTag(0xDACA);
|
||||
sPSSData->field_CD8[1] = IndexOfSpritePaletteTag(0xDAC7);
|
||||
sPSSData->field_CD8[0] = IndexOfSpritePaletteTag(TAG_PAL_WAVEFORM);
|
||||
sPSSData->field_CD8[1] = IndexOfSpritePaletteTag(TAG_PAL_DAC7);
|
||||
|
||||
sub_80CD444(sBoxCursorArea, sBoxCursorPosition, &x, &y);
|
||||
spriteId = CreateSprite(&gSpriteTemplate_857BA50, x, y, 6);
|
||||
|
@ -8842,7 +8848,7 @@ static bool8 sub_80D024C(void)
|
|||
SetBgAttribute(0, 4, 1);
|
||||
PutWindowTilemap(sPSSData->field_2200);
|
||||
CopyWindowToVram8Bit(sPSSData->field_2200, 3);
|
||||
BlendPalettes(0x3F00, 8, 0x7FFF);
|
||||
BlendPalettes(0x3F00, 8, RGB_WHITE);
|
||||
sub_80CFE54(2);
|
||||
SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR);
|
||||
sMoveMonsPtr->state++;
|
||||
|
@ -9375,8 +9381,8 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_857BC44[] =
|
|||
|
||||
static const struct SpriteTemplate gSpriteTemplate_857BC70 =
|
||||
{
|
||||
.tileTag = 7,
|
||||
.paletteTag = 0xdacb,
|
||||
.tileTag = TAG_TILE_7,
|
||||
.paletteTag = TAG_PAL_DACB,
|
||||
.oam = &sOamData_857BBA4,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
|
@ -9399,14 +9405,14 @@ static void sub_80D0C60(void)
|
|||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
spriteSheet.tag = 7 + i;
|
||||
spriteSheet.tag = TAG_TILE_7 + i;
|
||||
LoadCompressedSpriteSheet(&spriteSheet);
|
||||
sPSSData->field_2204[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0);
|
||||
sPSSData->field_2204[i].palIndex = AllocSpritePalette(0xDACB + i);
|
||||
sPSSData->field_2204[i].palIndex = AllocSpritePalette(TAG_PAL_DACB + i);
|
||||
sPSSData->field_2204[i].palIndex *= 16;
|
||||
sPSSData->field_2204[i].palIndex += 0x100;
|
||||
spriteTemplate.tileTag = 7 + i;
|
||||
spriteTemplate.paletteTag = 0xDACB + i;
|
||||
spriteTemplate.tileTag = TAG_TILE_7 + i;
|
||||
spriteTemplate.paletteTag = TAG_PAL_DACB + i;
|
||||
spriteId = CreateSprite(&spriteTemplate, 0, 0, 11);
|
||||
sPSSData->field_2204[i].sprite = &gSprites[spriteId];
|
||||
sPSSData->field_2204[i].sprite->invisible = TRUE;
|
||||
|
@ -10108,7 +10114,7 @@ u32 GetBoxMonLevelAt(u8 boxId, u8 boxPosition)
|
|||
{
|
||||
u32 lvl;
|
||||
|
||||
// LMAO. Obvious bug there.
|
||||
// BUG: Missed 'else' statement.
|
||||
if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT && GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES))
|
||||
lvl = GetLevelFromBoxMonExp(&gPokemonStoragePtr->boxes[boxId][boxPosition]);
|
||||
// else
|
||||
|
@ -10315,8 +10321,8 @@ void ResetWaldaWallpaper(void)
|
|||
gSaveBlock1Ptr->waldaPhrase.iconId = 0;
|
||||
gSaveBlock1Ptr->waldaPhrase.patternId = 0;
|
||||
gSaveBlock1Ptr->waldaPhrase.patternUnlocked = FALSE;
|
||||
gSaveBlock1Ptr->waldaPhrase.colors[0] = 0x7B35;
|
||||
gSaveBlock1Ptr->waldaPhrase.colors[1] = 0x6186;
|
||||
gSaveBlock1Ptr->waldaPhrase.colors[0] = RGB(21, 25, 30);
|
||||
gSaveBlock1Ptr->waldaPhrase.colors[1] = RGB(6, 12, 24);
|
||||
gSaveBlock1Ptr->waldaPhrase.text[0] = EOS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue