Document and match somne trainer card
This commit is contained in:
parent
f06c0749bc
commit
576d1b3474
14 changed files with 519 additions and 926 deletions
|
@ -209,13 +209,13 @@ _080C4B6C:
|
|||
ldrb r0, [r0, 0x8]
|
||||
cmp r0, 0
|
||||
bne _080C4B80
|
||||
bl sub_80C34B0
|
||||
bl PrintStringsOnCardPage2
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080C4BF6
|
||||
b _080C4C08
|
||||
_080C4B80:
|
||||
bl sub_80C3438
|
||||
bl PrintAllOnCardPage1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080C4BF6
|
||||
|
|
|
@ -157,7 +157,7 @@ LilycoveCity_EventScript_1E2D11:: @ 81E2D11
|
|||
|
||||
LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A
|
||||
lockall
|
||||
specialvar VAR_0x8004, sub_80F8940
|
||||
specialvar VAR_0x8004, CountPlayerContestPaintings
|
||||
switch VAR_0x8004
|
||||
case 0, LilycoveCity_EventScript_1E2D3A
|
||||
msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT
|
||||
|
|
|
@ -100,7 +100,7 @@ LilycoveCity_ContestLobby_EventScript_21A314:: @ 821A314
|
|||
return
|
||||
|
||||
LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360
|
||||
specialvar VAR_0x8004, sub_80F8940
|
||||
specialvar VAR_0x8004, CountPlayerContestPaintings
|
||||
switch VAR_0x8004
|
||||
case 1, LilycoveCity_ContestLobby_EventScript_21A3A2
|
||||
case 2, LilycoveCity_ContestLobby_EventScript_21A3A6
|
||||
|
|
|
@ -6,7 +6,7 @@ LilycoveCity_CoveLilyMotel_2F_EventScript_2186D3:: @ 82186D3
|
|||
faceplayer
|
||||
call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9
|
||||
call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F
|
||||
specialvar VAR_RESULT, sub_80C08E4
|
||||
specialvar VAR_RESULT, HasAllHoennMons
|
||||
compare VAR_RESULT, 1
|
||||
goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702
|
||||
release
|
||||
|
|
|
@ -92,7 +92,7 @@ LilycoveCity_LilycoveMuseum_2F_Movement_219863: @ 8219863
|
|||
LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866
|
||||
lockall
|
||||
goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921
|
||||
specialvar VAR_0x8004, sub_80F8940
|
||||
specialvar VAR_0x8004, CountPlayerContestPaintings
|
||||
switch VAR_0x8004
|
||||
case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA
|
||||
case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA
|
||||
|
|
|
@ -16,7 +16,7 @@ LittlerootTown_ProfessorBirchsLab_MapScript1_1F9CA1: @ 81F9CA1
|
|||
end
|
||||
|
||||
LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD
|
||||
specialvar VAR_RESULT, sub_80C08E4
|
||||
specialvar VAR_RESULT, HasAllHoennMons
|
||||
compare VAR_RESULT, 1
|
||||
goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9
|
||||
setobjectmovementtype 3, 3
|
||||
|
|
|
@ -148,7 +148,7 @@ gSpecials:: @ 81DBA64
|
|||
def_special sub_80F88E8
|
||||
def_special sub_80F88DC
|
||||
def_special sub_80F8864
|
||||
def_special sub_80F8940
|
||||
def_special CountPlayerContestPaintings
|
||||
def_special ShowContestWinner
|
||||
def_special MauvilleGymSpecial2
|
||||
def_special MauvilleGymSpecial1
|
||||
|
@ -345,7 +345,7 @@ gSpecials:: @ 81DBA64
|
|||
def_special sub_80B05B4
|
||||
def_special SetPacifidlogTMReceivedDay
|
||||
def_special GetDaysUntilPacifidlogTMAvailable
|
||||
def_special sub_80C08E4
|
||||
def_special HasAllHoennMons
|
||||
def_special MonOTNameMatchesPlayer
|
||||
def_special BufferLottoTicketNumber
|
||||
def_special sub_81653CC
|
||||
|
|
|
@ -41,5 +41,6 @@ u16 GetHoennPokedexCount(u8);
|
|||
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
|
||||
s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
|
||||
u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
|
||||
bool16 HasAllHoennMons(void);
|
||||
|
||||
#endif // GUARD_POKEDEX_H
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
u16 sub_80F903C(void);
|
||||
void ReducePlayerPartyToSelectedMons(void);
|
||||
void HealPlayerParty(void);
|
||||
u8 CountPlayerContestPaintings(void);
|
||||
|
||||
#endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H
|
||||
|
|
|
@ -6,27 +6,27 @@ struct TrainerCard
|
|||
/*0x00*/ u8 gender;
|
||||
/*0x01*/ u8 stars;
|
||||
/*0x02*/ bool8 hasPokedex;
|
||||
/*0x03*/ bool8 var_3;
|
||||
/*0x04*/ bool8 var_4;
|
||||
/*0x03*/ bool8 caughtAllHoenn;
|
||||
/*0x04*/ bool8 hasAllPaintings;
|
||||
/*0x05*/ u8 var_5;
|
||||
/*0x06*/ u16 firstHallOfFameA;
|
||||
/*0x08*/ u16 firstHallOfFameB;
|
||||
/*0x0A*/ u16 firstHallOfFameC;
|
||||
/*0x0C*/ u16 pokedexCaught;
|
||||
/*0x06*/ u16 hofDebutHours;
|
||||
/*0x08*/ u16 hofDebutMinutes;
|
||||
/*0x0A*/ u16 hofDebutSeconds;
|
||||
/*0x0C*/ u16 caughtMonsCount;
|
||||
/*0x0E*/ u16 trainerId;
|
||||
/*0x10*/ u16 playTimeHours;
|
||||
/*0x12*/ u16 playTimeMinutes;
|
||||
/*0x14*/ u16 linkBattleWins;
|
||||
/*0x16*/ u16 linkBattleLosses;
|
||||
/*0x18*/ u16 battleTowerWins;
|
||||
/*0x1A*/ u16 battleTowerLosses;
|
||||
/*0x1A*/ u16 battleTowerLosses; // wrong name
|
||||
/*0x1C*/ u16 contestsWithFriends;
|
||||
/*0x1E*/ u16 pokeblocksWithFriends;
|
||||
/*0x20*/ u16 pokemonTrades;
|
||||
/*0x22*/ u16 var_22;
|
||||
/*0x24*/ u32 money;
|
||||
/*0x28*/ u16 var_28[4];
|
||||
/*0x30*/ u8 playerName[8];
|
||||
/*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x38*/ u8 var_38;
|
||||
/*0x39*/ u8 var_39;
|
||||
/*0x3A*/ u16 var_3A;
|
||||
|
@ -43,7 +43,6 @@ struct TrainerCard
|
|||
/*0x62*/ u16 var_62;
|
||||
};
|
||||
|
||||
|
||||
extern struct TrainerCard gTrainerCards[4];
|
||||
|
||||
void sub_80C3120(struct TrainerCard *arg0, u16 *src, u8 gameVersion);
|
||||
|
|
106
src/pokedex.c
106
src/pokedex.c
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
1285
src/trainer_card.c
1285
src/trainer_card.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue