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

@ -209,13 +209,13 @@ _080C4B6C:
ldrb r0, [r0, 0x8] ldrb r0, [r0, 0x8]
cmp r0, 0 cmp r0, 0
bne _080C4B80 bne _080C4B80
bl sub_80C34B0 bl PrintStringsOnCardPage2
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _080C4BF6 bne _080C4BF6
b _080C4C08 b _080C4C08
_080C4B80: _080C4B80:
bl sub_80C3438 bl PrintAllOnCardPage1
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _080C4BF6 bne _080C4BF6

View File

@ -157,7 +157,7 @@ LilycoveCity_EventScript_1E2D11:: @ 81E2D11
LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A
lockall lockall
specialvar VAR_0x8004, sub_80F8940 specialvar VAR_0x8004, CountPlayerContestPaintings
switch VAR_0x8004 switch VAR_0x8004
case 0, LilycoveCity_EventScript_1E2D3A case 0, LilycoveCity_EventScript_1E2D3A
msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT

View File

@ -100,7 +100,7 @@ LilycoveCity_ContestLobby_EventScript_21A314:: @ 821A314
return return
LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360 LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360
specialvar VAR_0x8004, sub_80F8940 specialvar VAR_0x8004, CountPlayerContestPaintings
switch VAR_0x8004 switch VAR_0x8004
case 1, LilycoveCity_ContestLobby_EventScript_21A3A2 case 1, LilycoveCity_ContestLobby_EventScript_21A3A2
case 2, LilycoveCity_ContestLobby_EventScript_21A3A6 case 2, LilycoveCity_ContestLobby_EventScript_21A3A6

View File

@ -6,7 +6,7 @@ LilycoveCity_CoveLilyMotel_2F_EventScript_2186D3:: @ 82186D3
faceplayer faceplayer
call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9 call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9
call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F
specialvar VAR_RESULT, sub_80C08E4 specialvar VAR_RESULT, HasAllHoennMons
compare VAR_RESULT, 1 compare VAR_RESULT, 1
goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702 goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702
release release

View File

@ -92,7 +92,7 @@ LilycoveCity_LilycoveMuseum_2F_Movement_219863: @ 8219863
LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866 LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866
lockall lockall
goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921 goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921
specialvar VAR_0x8004, sub_80F8940 specialvar VAR_0x8004, CountPlayerContestPaintings
switch VAR_0x8004 switch VAR_0x8004
case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA
case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA

View File

@ -16,7 +16,7 @@ LittlerootTown_ProfessorBirchsLab_MapScript1_1F9CA1: @ 81F9CA1
end end
LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD
specialvar VAR_RESULT, sub_80C08E4 specialvar VAR_RESULT, HasAllHoennMons
compare VAR_RESULT, 1 compare VAR_RESULT, 1
goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9 goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9
setobjectmovementtype 3, 3 setobjectmovementtype 3, 3

View File

@ -148,7 +148,7 @@ gSpecials:: @ 81DBA64
def_special sub_80F88E8 def_special sub_80F88E8
def_special sub_80F88DC def_special sub_80F88DC
def_special sub_80F8864 def_special sub_80F8864
def_special sub_80F8940 def_special CountPlayerContestPaintings
def_special ShowContestWinner def_special ShowContestWinner
def_special MauvilleGymSpecial2 def_special MauvilleGymSpecial2
def_special MauvilleGymSpecial1 def_special MauvilleGymSpecial1
@ -345,7 +345,7 @@ gSpecials:: @ 81DBA64
def_special sub_80B05B4 def_special sub_80B05B4
def_special SetPacifidlogTMReceivedDay def_special SetPacifidlogTMReceivedDay
def_special GetDaysUntilPacifidlogTMAvailable def_special GetDaysUntilPacifidlogTMAvailable
def_special sub_80C08E4 def_special HasAllHoennMons
def_special MonOTNameMatchesPlayer def_special MonOTNameMatchesPlayer
def_special BufferLottoTicketNumber def_special BufferLottoTicketNumber
def_special sub_81653CC def_special sub_81653CC

View File

@ -41,5 +41,6 @@ u16 GetHoennPokedexCount(u8);
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality); u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16); u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
bool16 HasAllHoennMons(void);
#endif // GUARD_POKEDEX_H #endif // GUARD_POKEDEX_H

View File

@ -4,5 +4,6 @@
u16 sub_80F903C(void); u16 sub_80F903C(void);
void ReducePlayerPartyToSelectedMons(void); void ReducePlayerPartyToSelectedMons(void);
void HealPlayerParty(void); void HealPlayerParty(void);
u8 CountPlayerContestPaintings(void);
#endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H #endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H

View File

@ -6,27 +6,27 @@ struct TrainerCard
/*0x00*/ u8 gender; /*0x00*/ u8 gender;
/*0x01*/ u8 stars; /*0x01*/ u8 stars;
/*0x02*/ bool8 hasPokedex; /*0x02*/ bool8 hasPokedex;
/*0x03*/ bool8 var_3; /*0x03*/ bool8 caughtAllHoenn;
/*0x04*/ bool8 var_4; /*0x04*/ bool8 hasAllPaintings;
/*0x05*/ u8 var_5; /*0x05*/ u8 var_5;
/*0x06*/ u16 firstHallOfFameA; /*0x06*/ u16 hofDebutHours;
/*0x08*/ u16 firstHallOfFameB; /*0x08*/ u16 hofDebutMinutes;
/*0x0A*/ u16 firstHallOfFameC; /*0x0A*/ u16 hofDebutSeconds;
/*0x0C*/ u16 pokedexCaught; /*0x0C*/ u16 caughtMonsCount;
/*0x0E*/ u16 trainerId; /*0x0E*/ u16 trainerId;
/*0x10*/ u16 playTimeHours; /*0x10*/ u16 playTimeHours;
/*0x12*/ u16 playTimeMinutes; /*0x12*/ u16 playTimeMinutes;
/*0x14*/ u16 linkBattleWins; /*0x14*/ u16 linkBattleWins;
/*0x16*/ u16 linkBattleLosses; /*0x16*/ u16 linkBattleLosses;
/*0x18*/ u16 battleTowerWins; /*0x18*/ u16 battleTowerWins;
/*0x1A*/ u16 battleTowerLosses; /*0x1A*/ u16 battleTowerLosses; // wrong name
/*0x1C*/ u16 contestsWithFriends; /*0x1C*/ u16 contestsWithFriends;
/*0x1E*/ u16 pokeblocksWithFriends; /*0x1E*/ u16 pokeblocksWithFriends;
/*0x20*/ u16 pokemonTrades; /*0x20*/ u16 pokemonTrades;
/*0x22*/ u16 var_22; /*0x22*/ u16 var_22;
/*0x24*/ u32 money; /*0x24*/ u32 money;
/*0x28*/ u16 var_28[4]; /*0x28*/ u16 var_28[4];
/*0x30*/ u8 playerName[8]; /*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x38*/ u8 var_38; /*0x38*/ u8 var_38;
/*0x39*/ u8 var_39; /*0x39*/ u8 var_39;
/*0x3A*/ u16 var_3A; /*0x3A*/ u16 var_3A;
@ -43,7 +43,6 @@ struct TrainerCard
/*0x62*/ u16 var_62; /*0x62*/ u16 var_62;
}; };
extern struct TrainerCard gTrainerCards[4]; extern struct TrainerCard gTrainerCards[4];
void sub_80C3120(struct TrainerCard *arg0, u16 *src, u8 gameVersion); void sub_80C3120(struct TrainerCard *arg0, u16 *src, u8 gameVersion);

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff