Document and match somne trainer card

This commit is contained in:
DizzyEggg
2019-01-19 23:04:33 +01:00
parent f06c0749bc
commit 576d1b3474
14 changed files with 519 additions and 926 deletions

View File

@@ -4271,46 +4271,46 @@ s8 GetSetPokedexFlag(u16 nationalDexNo, u8 caseID)
retVal = 0;
switch (caseID)
{
case FLAG_GET_SEEN:
if (gSaveBlock2Ptr->pokedex.seen[index] & mask)
case FLAG_GET_SEEN:
if (gSaveBlock2Ptr->pokedex.seen[index] & mask)
{
if ((gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask)
&& (gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask))
retVal = 1;
else
{
if ((gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask)
&& (gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask))
retVal = 1;
else
{
gSaveBlock2Ptr->pokedex.seen[index] &= ~mask;
gSaveBlock1Ptr->seen1[index] &= ~mask;
gSaveBlock1Ptr->seen2[index] &= ~mask;
retVal = 0;
}
gSaveBlock2Ptr->pokedex.seen[index] &= ~mask;
gSaveBlock1Ptr->seen1[index] &= ~mask;
gSaveBlock1Ptr->seen2[index] &= ~mask;
retVal = 0;
}
break;
case FLAG_GET_CAUGHT:
if (gSaveBlock2Ptr->pokedex.owned[index] & mask)
}
break;
case FLAG_GET_CAUGHT:
if (gSaveBlock2Ptr->pokedex.owned[index] & mask)
{
if ((gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock2Ptr->pokedex.seen[index] & mask)
&& (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask)
&& (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask))
retVal = 1;
else
{
if ((gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock2Ptr->pokedex.seen[index] & mask)
&& (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask)
&& (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask))
retVal = 1;
else
{
gSaveBlock2Ptr->pokedex.owned[index] &= ~mask;
gSaveBlock2Ptr->pokedex.seen[index] &= ~mask;
gSaveBlock1Ptr->seen1[index] &= ~mask;
gSaveBlock1Ptr->seen2[index] &= ~mask;
retVal = 0;
}
gSaveBlock2Ptr->pokedex.owned[index] &= ~mask;
gSaveBlock2Ptr->pokedex.seen[index] &= ~mask;
gSaveBlock1Ptr->seen1[index] &= ~mask;
gSaveBlock1Ptr->seen2[index] &= ~mask;
retVal = 0;
}
break;
case FLAG_SET_SEEN:
gSaveBlock2Ptr->pokedex.seen[index] |= mask;
gSaveBlock1Ptr->seen1[index] |= mask;
gSaveBlock1Ptr->seen2[index] |= mask;
break;
case FLAG_SET_CAUGHT:
gSaveBlock2Ptr->pokedex.owned[index] |= mask;
break;
}
break;
case FLAG_SET_SEEN:
gSaveBlock2Ptr->pokedex.seen[index] |= mask;
gSaveBlock1Ptr->seen1[index] |= mask;
gSaveBlock1Ptr->seen2[index] |= mask;
break;
case FLAG_SET_CAUGHT:
gSaveBlock2Ptr->pokedex.owned[index] |= mask;
break;
}
return retVal;
}
@@ -4324,14 +4324,14 @@ u16 GetNationalPokedexCount(u8 caseID)
{
switch (caseID)
{
case FLAG_GET_SEEN:
if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN))
count++;
break;
case FLAG_GET_CAUGHT:
if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
count++;
break;
case FLAG_GET_SEEN:
if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN))
count++;
break;
case FLAG_GET_CAUGHT:
if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT))
count++;
break;
}
}
return count;
@@ -4346,14 +4346,14 @@ u16 GetHoennPokedexCount(u8 caseID)
{
switch (caseID)
{
case FLAG_GET_SEEN:
if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_SEEN))
count++;
break;
case FLAG_GET_CAUGHT:
if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT))
count++;
break;
case FLAG_GET_SEEN:
if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_SEEN))
count++;
break;
case FLAG_GET_CAUGHT:
if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT))
count++;
break;
}
}
return count;
@@ -4381,7 +4381,7 @@ u16 sub_80C089C(u8 caseID)
return count;
}
bool16 sub_80C08E4(void)
bool16 HasAllHoennMons(void)
{
u16 i;

View File

@@ -128,18 +128,18 @@ void sub_80F88E8(void)
}
}
u8 sub_80F8940(void)
u8 CountPlayerContestPaintings(void)
{
int i;
u8 var0 = 0;
u8 count = 0;
for (i = 0; i < 5; i++)
{
if (gSaveBlock1Ptr->contestWinners[8 + i].species)
var0++;
count++;
}
return var0;
return count;
}
void sub_80F8970(void)

View File

@@ -422,16 +422,19 @@ static bool32 PrintStartMenuActions(s8 *pIndex, u32 count)
do
{
if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback) {
if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback)
{
PrintPlayerNameOnWindow(GetStartMenuWindowId(), sStartMenuItems[sCurrentStartMenuActions[index]].text, 8, (index << 4) + 9);
}
else {
else
{
StringExpandPlaceholders(gStringVar4, sStartMenuItems[sCurrentStartMenuActions[index]].text);
AddTextPrinterParameterized(GetStartMenuWindowId(), 1, gStringVar4, 8, (index << 4) + 9, 0xFF, NULL);
}
index++;
if (index >= sNumStartMenuActions) {
if (index >= sNumStartMenuActions)
{
*pIndex = index;
return TRUE;
}

File diff suppressed because it is too large Load Diff