mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-21 11:43:37 +01:00
Merge branch 'master' of https://github.com/DizzyEggg/pokeemerald into battle_engine_v2
This commit is contained in:
commit
88244463e9
@ -61,7 +61,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_241C03:: @ 8241C03
|
||||
setvar VAR_0x8005, 3
|
||||
special CallBattleTowerFunc
|
||||
setvar VAR_0x8004, 3
|
||||
special sub_813BF7C
|
||||
special Script_TryGainNewFanFromCounter
|
||||
goto BattleFrontier_BattleTowerBattleRoom_EventScript_2421B8
|
||||
|
||||
BattleFrontier_BattleTowerBattleRoom_EventScript_241C2F:: @ 8241C2F
|
||||
@ -161,7 +161,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_241DF6:: @ 8241DF6
|
||||
setvar VAR_0x8005, 3
|
||||
special CallBattleTowerFunc
|
||||
setvar VAR_0x8004, 3
|
||||
special sub_813BF7C
|
||||
special Script_TryGainNewFanFromCounter
|
||||
goto BattleFrontier_BattleTowerBattleRoom_EventScript_2421B8
|
||||
|
||||
BattleFrontier_BattleTowerBattleRoom_EventScript_241E22:: @ 8241E22
|
||||
|
@ -122,7 +122,7 @@ BattleFrontier_BattleTowerBattleRoom2_EventScript_24907E:: @ 824907E
|
||||
setvar VAR_0x8005, 3
|
||||
special CallBattleTowerFunc
|
||||
setvar VAR_0x8004, 3
|
||||
special sub_813BF7C
|
||||
special Script_TryGainNewFanFromCounter
|
||||
goto BattleFrontier_BattleTowerBattleRoom2_EventScript_2421B8
|
||||
|
||||
BattleFrontier_BattleTowerBattleRoom2_EventScript_2490AA:: @ 82490AA
|
||||
@ -239,7 +239,7 @@ BattleFrontier_BattleTowerBattleRoom2_EventScript_2492AF:: @ 82492AF
|
||||
setvar VAR_0x8005, 3
|
||||
special CallBattleTowerFunc
|
||||
setvar VAR_0x8004, 3
|
||||
special sub_813BF7C
|
||||
special Script_TryGainNewFanFromCounter
|
||||
goto BattleFrontier_BattleTowerBattleRoom2_EventScript_2421B8
|
||||
|
||||
BattleFrontier_BattleTowerBattleRoom2_EventScript_2492DB:: @ 82492DB
|
||||
|
@ -55,7 +55,7 @@ EverGrandeCity_DrakesRoom_EventScript_PostBattleSpeech:: @ 822871A
|
||||
|
||||
EverGrandeCity_DrakesRoom_EventScript_Defeated:: @ 8228724
|
||||
setvar VAR_0x8004, 0
|
||||
special sub_813BF7C
|
||||
special Script_TryGainNewFanFromCounter
|
||||
setflag FLAG_DEFEATED_ELITE_4_DRAKE
|
||||
call PokemonLeague_EliteFour_SetAdvanceToNextRoomMetatiles
|
||||
msgbox EverGrandeCity_DrakesRoom_Text_PostBattleSpeech, MSGBOX_DEFAULT
|
||||
|
@ -24,7 +24,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CA8E",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_Lass",
|
||||
"flag": "0"
|
||||
},
|
||||
{
|
||||
@ -37,7 +37,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CA17",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_Man",
|
||||
"flag": "0"
|
||||
},
|
||||
{
|
||||
@ -50,7 +50,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CB05",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanM",
|
||||
"flag": "0"
|
||||
},
|
||||
{
|
||||
@ -63,7 +63,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CB7C",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirl",
|
||||
"flag": "0"
|
||||
},
|
||||
{
|
||||
@ -76,7 +76,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CBF3",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoy",
|
||||
"flag": "FLAG_HIDE_FANCLUB_LITTLE_BOY"
|
||||
},
|
||||
{
|
||||
@ -89,7 +89,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CC55",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_Boy",
|
||||
"flag": "FLAG_HIDE_FANCLUB_BOY"
|
||||
},
|
||||
{
|
||||
@ -102,7 +102,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CCB7",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_Woman",
|
||||
"flag": "FLAG_HIDE_FANCLUB_LADY"
|
||||
},
|
||||
{
|
||||
@ -115,7 +115,7 @@
|
||||
"movement_range_y": 0,
|
||||
"trainer_type": "0",
|
||||
"trainer_sight_or_berry_tree_id": "0",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_21CD19",
|
||||
"script": "LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertF",
|
||||
"flag": "FLAG_HIDE_FANCLUB_OLD_LADY"
|
||||
},
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -174,14 +174,14 @@ gSpecials:: @ 81DBA64
|
||||
def_special GetFirstFreePokeblockSlot
|
||||
def_special DoBerryBlending
|
||||
def_special PlayRoulette
|
||||
def_special ShouldMoveLilycoveFanClubMember
|
||||
def_special GetNumMovedLilycoveFanClubMembers
|
||||
def_special BufferStreakTrainerText
|
||||
def_special sub_813BA30
|
||||
def_special UpdateMovedLilycoveFanClubMembers
|
||||
def_special sub_813BF60
|
||||
def_special IsFanClubMemberFanOfPlayer
|
||||
def_special GetNumFansOfPlayerInTrainerFanClub
|
||||
def_special BufferFanClubTrainerName
|
||||
def_special TryLoseFansFromPlayTimeAfterLinkBattle
|
||||
def_special TryLoseFansFromPlayTime
|
||||
def_special SetPlayerGotFirstFans
|
||||
def_special UpdateTrainerFanClubGameClear
|
||||
def_special sub_813BF7C
|
||||
def_special Script_TryGainNewFanFromCounter
|
||||
def_special RockSmashWildEncounter
|
||||
def_special GabbyAndTyGetBattleNum
|
||||
def_special GabbyAndTyAfterInterview
|
||||
@ -354,8 +354,8 @@ gSpecials:: @ 81DBA64
|
||||
def_special SetChampionSaveWarp
|
||||
def_special TryPutTreasureInvestigatorsOnAir
|
||||
def_special TryPutLotteryWinnerReportOnAir
|
||||
def_special sub_80EE72C
|
||||
def_special sub_80EE7C0
|
||||
def_special TrySetUpTrainerFanClubSpecial
|
||||
def_special ShouldHideFanClubInterviewer
|
||||
def_special ShowGlassWorkshopMenu
|
||||
def_special PutFanClubSpecialOnTheAir
|
||||
def_special IncrementDailyPlantedBerries
|
||||
|
@ -62,7 +62,17 @@
|
||||
#define DEPT_STORE_FLOORNUM_11F 14
|
||||
#define DEPT_STORE_FLOORNUM_ROOFTOP 15
|
||||
|
||||
// Pokemon Trainer Fan Club
|
||||
#define NUM_TRAINER_CLUB_MEMBERS 8
|
||||
// Lilycove Pokemon Trainer Fan Club
|
||||
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8
|
||||
|
||||
#define FANCLUB_GOT_FIRST_FANS 7
|
||||
#define FANCLUB_MEMBER1 8
|
||||
#define FANCLUB_MEMBER2 9
|
||||
#define FANCLUB_MEMBER3 10
|
||||
#define FANCLUB_MEMBER4 11
|
||||
#define FANCLUB_MEMBER5 12
|
||||
#define FANCLUB_MEMBER6 13
|
||||
#define FANCLUB_MEMBER7 14
|
||||
#define FANCLUB_MEMBER8 15
|
||||
|
||||
#endif // GUARD_CONSTANTS_FIELD_SPECIALS_H
|
||||
|
@ -79,8 +79,8 @@
|
||||
#define VAR_ALTERING_CAVE_WILD_SET 0x403E
|
||||
#define VAR_DISTRIBUTE_EON_TICKET 0x403F // This var is read and written, but is always zero. The only way to obtain the Eon Ticket in Emerald is via Record Mixing
|
||||
#define VAR_DAYS 0x4040
|
||||
#define VAR_FANCLUB_UNKNOWN_1 0x4041
|
||||
#define VAR_FANCLUB_UNKNOWN_2 0x4042
|
||||
#define VAR_FANCLUB_FAN_COUNTER 0x4041
|
||||
#define VAR_FANCLUB_LOSE_FAN_TIMER 0x4042
|
||||
#define VAR_DEPT_STORE_FLOOR 0x4043
|
||||
#define VAR_TRICK_HOUSE_LEVEL 0x4044
|
||||
#define VAR_POKELOT_PRIZE_ITEM 0x4045
|
||||
|
@ -8,7 +8,7 @@ u8 GetLeadMonIndex(void);
|
||||
u8 IsDestinationBoxFull(void);
|
||||
u16 GetPCBoxToSendMon(void);
|
||||
bool8 InMultiBattleRoom(void);
|
||||
void sub_813BF10(void);
|
||||
void UpdateTrainerFansAfterLinkBattle(void);
|
||||
void IncrementBirthIslandRockStepCount(void);
|
||||
bool8 UnusualWeatherHasExpired(void);
|
||||
bool8 ShouldDoBrailleRegicePuzzle(void);
|
||||
@ -21,7 +21,7 @@ bool32 CountSSTidalStep(u16 delta);
|
||||
u8 GetSSTidalLocation(s8 *mapGroup, s8 *mapNum, s16 *x, s16 *y);
|
||||
void ShowScrollableMultichoice(void);
|
||||
void FrontierGamblerSetWonOrLost(bool8 won);
|
||||
u8 sub_813BADC(u8 a0);
|
||||
u8 TryGainNewFanFromCounter(u8 incrementId);
|
||||
bool8 InPokemonCenter(void);
|
||||
void SetShoalItemFlag(u16 unused);
|
||||
void UpdateFrontierManiac(u16 daysSince);
|
||||
|
@ -14,7 +14,7 @@ void DoTVShow(void);
|
||||
void DoTVShowInSearchOfTrainers(void);
|
||||
void TryPutTreasureInvestigatorsOnAir(void);
|
||||
void TryPutLotteryWinnerReportOnAir(void);
|
||||
void sub_80EE72C(void);
|
||||
void TryPutTrainerFanClubOnAir(void);
|
||||
void IncrementDailyPlantedBerries(void);
|
||||
void IncrementDailyPickedBerries(void);
|
||||
void IncrementDailyBattlePoints(u16 delta);
|
||||
|
@ -970,7 +970,7 @@ void sub_80B360C(void)
|
||||
Overworld_ResetMapMusic();
|
||||
LoadPlayerParty();
|
||||
SavePlayerBag();
|
||||
sub_813BF10();
|
||||
UpdateTrainerFansAfterLinkBattle();
|
||||
|
||||
if (gSpecialVar_0x8004 == USING_SINGLE_BATTLE || gSpecialVar_0x8004 == USING_DOUBLE_BATTLE)
|
||||
{
|
||||
|
@ -356,7 +356,7 @@ static void sub_80F5CE4(u8 taskId)
|
||||
InterviewAfter();
|
||||
}
|
||||
|
||||
sub_813BADC(2);
|
||||
TryGainNewFanFromCounter(2);
|
||||
sub_80DEDA8(gSpecialVar_ContestRank);
|
||||
sub_80DEDA8(0xFE);
|
||||
gUnknown_02039F5C = 1;
|
||||
@ -411,7 +411,7 @@ static void sub_80F5CE4(u8 taskId)
|
||||
sub_80DEDA8(0xFE);
|
||||
gUnknown_02039F5C = 1;
|
||||
gUnknown_02039F5D = sub_80DEFA8(0xFE, 0);
|
||||
sub_813BADC(2);
|
||||
TryGainNewFanFromCounter(2);
|
||||
gTasks[taskId].func = sub_80F5F74;
|
||||
}
|
||||
}
|
||||
|
@ -92,9 +92,9 @@ extern const u16 gEventObjectPalette17[];
|
||||
extern const u16 gEventObjectPalette33[];
|
||||
extern const u16 gEventObjectPalette34[];
|
||||
|
||||
void UpdateMovedLilycoveFanClubMembers(void);
|
||||
void sub_813BF60(void);
|
||||
u16 GetNumMovedLilycoveFanClubMembers(void);
|
||||
void TryLoseFansFromPlayTime(void);
|
||||
void SetPlayerGotFirstFans(void);
|
||||
u16 GetNumFansOfPlayerInTrainerFanClub(void);
|
||||
|
||||
static void RecordCyclingRoadResults(u32, u8);
|
||||
static void LoadLinkPartnerEventObjectSpritePalette(u8 graphicsId, u8 localEventId, u8 paletteNum);
|
||||
@ -131,10 +131,10 @@ static void WaitForDeoxysRockMovement(u8 taskId);
|
||||
static void sub_813B57C(u8 taskId);
|
||||
static void Task_LoopWingFlapSE(u8 taskId);
|
||||
static void Task_CloseBattlePikeCurtain(u8 taskId);
|
||||
static u8 sub_813BF44(void);
|
||||
static void sub_813BD84(void);
|
||||
static u16 sub_813BB74(void);
|
||||
static void sub_813BE30(struct LinkBattleRecords *linkRecords, u8 a, u8 b);
|
||||
static u8 DidPlayerGetFirstFans(void);
|
||||
static void SetInitialFansOfPlayer(void);
|
||||
static u16 PlayerGainRandomTrainerFan(void);
|
||||
static void BufferFanClubTrainerName_(struct LinkBattleRecords *linkRecords, u8 a, u8 b);
|
||||
|
||||
void Special_ShowDiploma(void)
|
||||
{
|
||||
@ -4019,28 +4019,72 @@ bool8 InPokemonCenter(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Summary of the Lilycove Trainer Fan Club, because it's a little messy
|
||||
|
||||
## The Fan Club room itself
|
||||
There are initially 4 members of the Fan Club (+ an interviewer), none of whom are fans of the player
|
||||
After becoming the champion there will be 8 members of the Fan Club, 3 of whom are automatically fans of the player
|
||||
After this point, if a club member is a fan of the player they will sit at the front table and comment on the player
|
||||
If they are not fans of the player, they will sit at the far table and can make comments about a different trainer (see BufferFanClubTrainerName)
|
||||
|
||||
## Gaining/losing fans
|
||||
After every link battle the player will gain a fan if they won, or lose a fan if they lost
|
||||
If the player has at least 3 fans, this is the only way to gain fans
|
||||
If the player has fewer than 3 fans, they may also gain fans by completing certain tasks enough times (see TryGainNewFanFromCounter)
|
||||
If the player has at least 5 fans, they can lose a fan every 12 real-time hours, or more often if the timer variable is reset (see TryLoseFansFromPlayTime)
|
||||
If the player has only 1 fan left it cannot be lost
|
||||
|
||||
## Variables
|
||||
VAR_FANCLUB_FAN_COUNTER, a bitfield for tracking the fans
|
||||
Bits 1-7: Counter for when to add new fans
|
||||
Bit 8: Flag set after receiving the initial 3 fans
|
||||
Bits 9-16: Flags for each of the 8 club members, set to 1 when theyre a fan of the player and 0 when theyre not
|
||||
|
||||
VAR_FANCLUB_LOSE_FAN_TIMER, a timer for when to lose fans
|
||||
Compared against playTimeHours. When theyre equal, a fan is ready to be lost
|
||||
For every fan thats lost this way 12 hours are added to the timer
|
||||
|
||||
VAR_LILYCOVE_FAN_CLUB_STATE
|
||||
0: Player is not the champion yet
|
||||
1: Player is the champion, ready to meet their initial fans
|
||||
2: Player has met their initial fans
|
||||
*/
|
||||
|
||||
#define FANCLUB_BITFIELD (gSaveBlock1Ptr->vars[VAR_FANCLUB_FAN_COUNTER - VARS_START])
|
||||
#define FANCLUB_COUNTER 0x007F
|
||||
#define FANCLUB_FAN_FLAGS 0xFF80
|
||||
|
||||
#define GET_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD >> (flag) & 1)
|
||||
#define SET_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD |= 1 << (flag))
|
||||
#define FLIP_TRAINER_FAN_CLUB_FLAG(flag)(FANCLUB_BITFIELD ^= 1 << (flag))
|
||||
|
||||
#define GET_TRAINER_FAN_CLUB_COUNTER (FANCLUB_BITFIELD & FANCLUB_COUNTER)
|
||||
#define SET_TRAINER_FAN_CLUB_COUNTER(count) (FANCLUB_BITFIELD = (FANCLUB_BITFIELD & FANCLUB_FAN_FLAGS) | (count))
|
||||
#define INCR_TRAINER_FAN_CLUB_COUNTER(count)(FANCLUB_BITFIELD += (count))
|
||||
#define CLEAR_TRAINER_FAN_CLUB_COUNTER (FANCLUB_BITFIELD &= ~(FANCLUB_COUNTER))
|
||||
|
||||
void ResetFanClub(void)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] = 0;
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = 0;
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_FAN_COUNTER - VARS_START] = 0;
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_LOSE_FAN_TIMER - VARS_START] = 0;
|
||||
}
|
||||
|
||||
void sub_813BA30(void)
|
||||
void TryLoseFansFromPlayTimeAfterLinkBattle(void)
|
||||
{
|
||||
if (sub_813BF44() != 0)
|
||||
if (DidPlayerGetFirstFans())
|
||||
{
|
||||
UpdateMovedLilycoveFanClubMembers();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = gSaveBlock2Ptr->playTimeHours;
|
||||
TryLoseFansFromPlayTime();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_LOSE_FAN_TIMER - VARS_START] = gSaveBlock2Ptr->playTimeHours;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateTrainerFanClubGameClear(void)
|
||||
{
|
||||
if (!((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> 7) & 1))
|
||||
if (!GET_TRAINER_FAN_CLUB_FLAG(FANCLUB_GOT_FIRST_FANS))
|
||||
{
|
||||
sub_813BF60();
|
||||
sub_813BD84();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = gSaveBlock2Ptr->playTimeHours;
|
||||
SetPlayerGotFirstFans();
|
||||
SetInitialFansOfPlayer();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_LOSE_FAN_TIMER - VARS_START] = gSaveBlock2Ptr->playTimeHours;
|
||||
FlagClear(FLAG_HIDE_FANCLUB_OLD_LADY);
|
||||
FlagClear(FLAG_HIDE_FANCLUB_BOY);
|
||||
FlagClear(FLAG_HIDE_FANCLUB_LITTLE_BOY);
|
||||
@ -4050,192 +4094,216 @@ void UpdateTrainerFanClubGameClear(void)
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_813BADC(u8 a0)
|
||||
// If the player has < 3 fans, gain a new fan whenever the counter reaches 20+
|
||||
// Defeating Drake or participating in a Link Contest increments the counter by 2
|
||||
// Participating at Battle Tower or in a Secret Base battle increments the counter by 1
|
||||
u8 TryGainNewFanFromCounter(u8 incrementId)
|
||||
{
|
||||
static const u8 gUnknown_085B3470[] = { 2, 1, 2, 1 };
|
||||
static const u8 sCounterIncrements[] = { 2, 1, 2, 1 };
|
||||
|
||||
if (VarGet(VAR_LILYCOVE_FAN_CLUB_STATE) == 2)
|
||||
{
|
||||
if ((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] & 0x7F) + gUnknown_085B3470[a0] > 19)
|
||||
if (GET_TRAINER_FAN_CLUB_COUNTER + sCounterIncrements[incrementId] > 19)
|
||||
{
|
||||
if (GetNumMovedLilycoveFanClubMembers() < 3)
|
||||
if (GetNumFansOfPlayerInTrainerFanClub() < 3)
|
||||
{
|
||||
sub_813BB74();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] &= 0xFF80;
|
||||
PlayerGainRandomTrainerFan();
|
||||
CLEAR_TRAINER_FAN_CLUB_COUNTER;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] = (gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] & 0xFF80) | 0x14;
|
||||
SET_TRAINER_FAN_CLUB_COUNTER(20);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] += gUnknown_085B3470[a0];
|
||||
INCR_TRAINER_FAN_CLUB_COUNTER(sCounterIncrements[incrementId]);
|
||||
}
|
||||
}
|
||||
|
||||
return gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] & 0x7F;
|
||||
return GET_TRAINER_FAN_CLUB_COUNTER;
|
||||
}
|
||||
|
||||
static u16 sub_813BB74(void)
|
||||
|
||||
// Loop through the fan club members, and if theyre not a fan of the player there is a 50% chance for them to become a fan
|
||||
// Stops when a fan is gained
|
||||
// If no new fan was gained while looping, the last non-fan in the list becomes a fan
|
||||
// If all the members are already fans of the player then this redundantly sets the first fan in the list to be a fan
|
||||
static u16 PlayerGainRandomTrainerFan(void)
|
||||
{
|
||||
static const u8 gUnknown_085B3474[NUM_TRAINER_CLUB_MEMBERS] =
|
||||
static const u8 sFanClubMemberIds[NUM_TRAINER_FAN_CLUB_MEMBERS] =
|
||||
{
|
||||
8, 9, 10, 11, 12, 13, 14, 15
|
||||
FANCLUB_MEMBER1,
|
||||
FANCLUB_MEMBER2,
|
||||
FANCLUB_MEMBER3,
|
||||
FANCLUB_MEMBER4,
|
||||
FANCLUB_MEMBER5,
|
||||
FANCLUB_MEMBER6,
|
||||
FANCLUB_MEMBER7,
|
||||
FANCLUB_MEMBER8
|
||||
};
|
||||
|
||||
u8 i;
|
||||
u8 retVal = 0;
|
||||
u8 idx = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gUnknown_085B3474); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sFanClubMemberIds); i++)
|
||||
{
|
||||
if (!((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_085B3474[i]) & 1))
|
||||
if (!GET_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[i]))
|
||||
{
|
||||
retVal = i;
|
||||
if ((Random() & 1) != 0)
|
||||
idx = i;
|
||||
if (Random() & 1)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 1 << gUnknown_085B3474[retVal];
|
||||
return retVal;
|
||||
SET_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[idx]);
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 1 << gUnknown_085B3474[retVal];
|
||||
return retVal;
|
||||
SET_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[idx]);
|
||||
return idx;
|
||||
}
|
||||
|
||||
static u16 sub_813BC00(void)
|
||||
// Loops through the fan club members, and if theyre a fan of the player there is a 50% chance for them to stop being a fan
|
||||
// Stops if a fan is removed, or if the player has only one fan left
|
||||
// If no fan was lost while looping, the last current fan in the list will stop being a fan
|
||||
static u16 PlayerLoseRandomTrainerFan(void)
|
||||
{
|
||||
static const u8 gUnknown_085B347C[NUM_TRAINER_CLUB_MEMBERS] =
|
||||
static const u8 sFanClubMemberIds[NUM_TRAINER_FAN_CLUB_MEMBERS] =
|
||||
{
|
||||
8, 13, 14, 11, 10, 12, 15, 9
|
||||
FANCLUB_MEMBER1,
|
||||
FANCLUB_MEMBER6,
|
||||
FANCLUB_MEMBER7,
|
||||
FANCLUB_MEMBER4,
|
||||
FANCLUB_MEMBER3,
|
||||
FANCLUB_MEMBER5,
|
||||
FANCLUB_MEMBER8,
|
||||
FANCLUB_MEMBER2
|
||||
};
|
||||
|
||||
u8 i;
|
||||
u8 retVal = 0;
|
||||
u8 idx = 0;
|
||||
|
||||
if (GetNumMovedLilycoveFanClubMembers() == 1)
|
||||
if (GetNumFansOfPlayerInTrainerFanClub() == 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gUnknown_085B347C); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sFanClubMemberIds); i++)
|
||||
{
|
||||
if (((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_085B347C[i]) & 1) != 0)
|
||||
if (GET_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[i]))
|
||||
{
|
||||
retVal = i;
|
||||
if ((Random() & 1) != 0)
|
||||
idx = i;
|
||||
if (Random() & 1)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] ^= 1 << gUnknown_085B347C[retVal];
|
||||
return retVal;
|
||||
FLIP_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[idx]);
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_085B347C[retVal]) & 1))
|
||||
if (GET_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[idx]))
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] ^= 1 << gUnknown_085B347C[retVal];
|
||||
FLIP_TRAINER_FAN_CLUB_FLAG(sFanClubMemberIds[idx]);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
return idx;
|
||||
}
|
||||
|
||||
u16 GetNumMovedLilycoveFanClubMembers(void)
|
||||
u16 GetNumFansOfPlayerInTrainerFanClub(void)
|
||||
{
|
||||
u8 i;
|
||||
u8 retVal = 0;
|
||||
u8 numFans = 0;
|
||||
|
||||
for (i = 0; i < NUM_TRAINER_CLUB_MEMBERS; i++)
|
||||
for (i = 0; i < NUM_TRAINER_FAN_CLUB_MEMBERS; i++)
|
||||
{
|
||||
if (((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> (i + 8)) & 1) != 0)
|
||||
{
|
||||
retVal++;
|
||||
}
|
||||
if (GET_TRAINER_FAN_CLUB_FLAG(i + FANCLUB_MEMBER1))
|
||||
numFans++;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
return numFans;
|
||||
}
|
||||
|
||||
void UpdateMovedLilycoveFanClubMembers(void)
|
||||
// If the player has > 5 fans in the Trainer Fan Club, then lose 1 fan for every 12 hours since the last fan loss / timer reset
|
||||
void TryLoseFansFromPlayTime(void)
|
||||
{
|
||||
u8 i = 0;
|
||||
if (gSaveBlock2Ptr->playTimeHours < 999)
|
||||
{
|
||||
while (TRUE)
|
||||
{
|
||||
if (GetNumMovedLilycoveFanClubMembers() < 5)
|
||||
if (GetNumFansOfPlayerInTrainerFanClub() < 5)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] = gSaveBlock2Ptr->playTimeHours;
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_LOSE_FAN_TIMER - VARS_START] = gSaveBlock2Ptr->playTimeHours;
|
||||
break;
|
||||
}
|
||||
else if (i == NUM_TRAINER_CLUB_MEMBERS)
|
||||
else if (i == NUM_TRAINER_FAN_CLUB_MEMBERS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (gSaveBlock2Ptr->playTimeHours - gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] < 12)
|
||||
else if (gSaveBlock2Ptr->playTimeHours - gSaveBlock1Ptr->vars[VAR_FANCLUB_LOSE_FAN_TIMER - VARS_START] < 12)
|
||||
{
|
||||
return;
|
||||
}
|
||||
sub_813BC00();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_2 - VARS_START] += 12;
|
||||
PlayerLoseRandomTrainerFan();
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_LOSE_FAN_TIMER - VARS_START] += 12;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool8 ShouldMoveLilycoveFanClubMember(void)
|
||||
bool8 IsFanClubMemberFanOfPlayer(void)
|
||||
{
|
||||
return (gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gSpecialVar_0x8004) & 1;
|
||||
return GET_TRAINER_FAN_CLUB_FLAG(gSpecialVar_0x8004);
|
||||
}
|
||||
|
||||
static void sub_813BD84(void)
|
||||
static void SetInitialFansOfPlayer(void)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x2000;
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x100;
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x400;
|
||||
SET_TRAINER_FAN_CLUB_FLAG(FANCLUB_MEMBER6);
|
||||
SET_TRAINER_FAN_CLUB_FLAG(FANCLUB_MEMBER1);
|
||||
SET_TRAINER_FAN_CLUB_FLAG(FANCLUB_MEMBER3);
|
||||
}
|
||||
|
||||
void BufferStreakTrainerText(void)
|
||||
void BufferFanClubTrainerName(void)
|
||||
{
|
||||
u8 a = 0;
|
||||
u8 b = 0;
|
||||
u8 whichLinkTrainer = 0;
|
||||
u8 whichNPCTrainer = 0;
|
||||
switch (gSpecialVar_0x8004)
|
||||
{
|
||||
case 8:
|
||||
case FANCLUB_MEMBER1:
|
||||
break;
|
||||
case 9:
|
||||
case FANCLUB_MEMBER2:
|
||||
break;
|
||||
case 10:
|
||||
a = 0;
|
||||
b = 3;
|
||||
case FANCLUB_MEMBER3:
|
||||
whichLinkTrainer = 0;
|
||||
whichNPCTrainer = 3;
|
||||
break;
|
||||
case 11:
|
||||
a = 0;
|
||||
b = 1;
|
||||
case FANCLUB_MEMBER4:
|
||||
whichLinkTrainer = 0;
|
||||
whichNPCTrainer = 1;
|
||||
break;
|
||||
case 12:
|
||||
a = 1;
|
||||
b = 0;
|
||||
case FANCLUB_MEMBER5:
|
||||
whichLinkTrainer = 1;
|
||||
whichNPCTrainer = 0;
|
||||
break;
|
||||
case 13:
|
||||
a = 0;
|
||||
b = 4;
|
||||
case FANCLUB_MEMBER6:
|
||||
whichLinkTrainer = 0;
|
||||
whichNPCTrainer = 4;
|
||||
break;
|
||||
case 14:
|
||||
a = 1;
|
||||
b = 5;
|
||||
case FANCLUB_MEMBER7:
|
||||
whichLinkTrainer = 1;
|
||||
whichNPCTrainer = 5;
|
||||
break;
|
||||
case 15:
|
||||
case FANCLUB_MEMBER8:
|
||||
break;
|
||||
}
|
||||
sub_813BE30(&gSaveBlock1Ptr->linkBattleRecords, a, b);
|
||||
BufferFanClubTrainerName_(&gSaveBlock1Ptr->linkBattleRecords, whichLinkTrainer, whichNPCTrainer);
|
||||
}
|
||||
|
||||
static void sub_813BE30(struct LinkBattleRecords *linkRecords, u8 a, u8 b)
|
||||
static void BufferFanClubTrainerName_(struct LinkBattleRecords *linkRecords, u8 whichLinkTrainer, u8 whichNPCTrainer)
|
||||
{
|
||||
struct LinkBattleRecord *record = &linkRecords->entries[a];
|
||||
struct LinkBattleRecord *record = &linkRecords->entries[whichLinkTrainer];
|
||||
if (record->name[0] == EOS)
|
||||
{
|
||||
switch (b)
|
||||
switch (whichNPCTrainer)
|
||||
{
|
||||
case 0:
|
||||
StringCopy(gStringVar1, gText_Wallace);
|
||||
@ -4262,35 +4330,36 @@ static void sub_813BE30(struct LinkBattleRecords *linkRecords, u8 a, u8 b)
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCopyN(gStringVar1, record->name, 7);
|
||||
gStringVar1[7] = EOS;
|
||||
ConvertInternationalString(gStringVar1, linkRecords->languages[a]);
|
||||
StringCopyN(gStringVar1, record->name, PLAYER_NAME_LENGTH);
|
||||
gStringVar1[PLAYER_NAME_LENGTH] = EOS;
|
||||
ConvertInternationalString(gStringVar1, linkRecords->languages[whichLinkTrainer]);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BF10(void)
|
||||
void UpdateTrainerFansAfterLinkBattle(void)
|
||||
{
|
||||
if (VarGet(VAR_LILYCOVE_FAN_CLUB_STATE) == 2)
|
||||
{
|
||||
sub_813BA30();
|
||||
TryLoseFansFromPlayTimeAfterLinkBattle();
|
||||
if (gBattleOutcome == B_OUTCOME_WON)
|
||||
sub_813BB74();
|
||||
PlayerGainRandomTrainerFan();
|
||||
else
|
||||
sub_813BC00();
|
||||
PlayerLoseRandomTrainerFan();
|
||||
}
|
||||
}
|
||||
|
||||
static bool8 sub_813BF44(void)
|
||||
static bool8 DidPlayerGetFirstFans(void)
|
||||
{
|
||||
return (gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> 7) & 1;
|
||||
return GET_TRAINER_FAN_CLUB_FLAG(FANCLUB_GOT_FIRST_FANS);
|
||||
}
|
||||
|
||||
void sub_813BF60(void)
|
||||
void SetPlayerGotFirstFans(void)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] |= 0x80;
|
||||
SET_TRAINER_FAN_CLUB_FLAG(FANCLUB_GOT_FIRST_FANS);
|
||||
}
|
||||
|
||||
u8 sub_813BF7C(void)
|
||||
// return value is always ignored
|
||||
u8 Script_TryGainNewFanFromCounter(void)
|
||||
{
|
||||
return sub_813BADC(gSpecialVar_0x8004);
|
||||
return TryGainNewFanFromCounter(gSpecialVar_0x8004);
|
||||
}
|
||||
|
213
src/pokedex.c
213
src/pokedex.c
@ -140,7 +140,7 @@ void sub_80BB78C(u8);
|
||||
void sub_80BB7D4(u8);
|
||||
void sub_80BBA28(u8);
|
||||
void sub_80BBA78(u8);
|
||||
void sub_80BBBF4(u8);
|
||||
void LoadPageOnceMonFinishedMoving(u8);
|
||||
void sub_80BBC74(u8);
|
||||
void sub_80BBD1C(u8);
|
||||
void sub_80BBDE8(u8);
|
||||
@ -169,7 +169,7 @@ u8 sub_80BDA40(void);
|
||||
u16 GetPokemonSpriteToDisplay(u16);
|
||||
u32 sub_80BDACC(u16, s16, s16);
|
||||
static void CreateInterfaceSprites(u8);
|
||||
void sub_80BE470(struct Sprite *sprite);
|
||||
void MoveMonIntoPosition(struct Sprite *sprite);
|
||||
static void SpriteCB_Scrollbar(struct Sprite *sprite);
|
||||
void sub_80BE658(struct Sprite *sprite);
|
||||
void sub_80BE758(struct Sprite *sprite);
|
||||
@ -177,29 +177,29 @@ void sub_80BE780(struct Sprite *sprite);
|
||||
void sub_80BE44C(struct Sprite *sprite);
|
||||
void sub_80BE834(struct Sprite *sprite);
|
||||
void sub_80BE4E0(struct Sprite *sprite);
|
||||
u8 sub_80BE91C(struct PokedexListItem*, u8);
|
||||
u8 SetupInfoScreen(struct PokedexListItem*, u8 monSpriteId);
|
||||
bool8 sub_80BE9C4(u8);
|
||||
u8 sub_80BE9F8(struct PokedexListItem*, u8);
|
||||
void sub_80BEA24(u8);
|
||||
void sub_80BEDF4(u8);
|
||||
void sub_80BEFD0(u8);
|
||||
void sub_80BF038(u8);
|
||||
void sub_80BF070(u8);
|
||||
void sub_80BF0AC(u8);
|
||||
void LoadInfoScreen(u8);
|
||||
void ChangePokedexScreen(u8);
|
||||
void LoadSelectedScreen(u8);
|
||||
void BeginChangeInfoScreen(u8);
|
||||
void BeginReturnToPokedex(u8);
|
||||
void LoadAreaScreen(u8);
|
||||
void sub_80BF1B4(u8);
|
||||
void sub_80BF1EC(u8);
|
||||
void sub_80BF250(u8);
|
||||
void LoadCryScreen(u8);
|
||||
void sub_80BF5CC(u8);
|
||||
void sub_80BF790(u8);
|
||||
void sub_80BF7FC(u8);
|
||||
void sub_80BF82C(u8);
|
||||
void LoadSizeScreen(u8);
|
||||
void sub_80BFBB0(u8);
|
||||
void sub_80BFC78(u8);
|
||||
void sub_80BFCDC(u16);
|
||||
void sub_80BFCF4(u16);
|
||||
void sub_80BFD0C(u8, u16);
|
||||
void sub_80BFD7C(u8, u16);
|
||||
void sub_80BFE38(u8);
|
||||
static void Task_DisplayNewMonData(u8);
|
||||
void sub_80C0088(u8);
|
||||
void blockset_load_palette_to_gpu(u8);
|
||||
void sub_80C01CC(struct Sprite *sprite);
|
||||
@ -211,8 +211,8 @@ u8 sub_80C0B44(u8, u16, u8, u8);
|
||||
void sub_80C0D30(u8, u16);
|
||||
u16 sub_80C0EF8(u16, s16, s16, s8);
|
||||
u16 sub_80C0E0C(u8, u16, u16, u16);
|
||||
u8 sub_80C1258();
|
||||
void sub_80C12E0(u8);
|
||||
u8 LoadSearchMenu(void);
|
||||
void Task_LoadSearchMenu(u8);
|
||||
void sub_80C1570(u8);
|
||||
void sub_80C15B0(u8);
|
||||
void sub_80C16CC(u8);
|
||||
@ -717,7 +717,7 @@ static const struct SpritePalette sInterfaceSpritePalette[] =
|
||||
static const u8 gUnknown_0855D28C[] = {0x4, 0x8, 0x10, 0x20, 0x20};
|
||||
static const u8 gUnknown_0855D291[] = {0x8, 0x4, 0x2, 0x1, 0x1};
|
||||
|
||||
static const struct BgTemplate gBgTemplates_0855D298[] =
|
||||
static const struct BgTemplate sPokedex_BgTemplate[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
@ -782,7 +782,7 @@ ALIGNED(4) static const u8 gExpandedPlaceholder_PokedexDescription[] = _("");
|
||||
|
||||
static const u16 gUnknown_0856E610[] = INCBIN_U16("graphics/pokedex/black.gbapal");
|
||||
|
||||
static const struct BgTemplate gUnknown_0856E630[] =
|
||||
static const struct BgTemplate sInfoScreen_BgTemplate[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
@ -822,9 +822,14 @@ static const struct BgTemplate gUnknown_0856E630[] =
|
||||
}
|
||||
};
|
||||
|
||||
static const struct WindowTemplate gUnknown_0856E640[] =
|
||||
#define WIN_INFO 0
|
||||
#define WIN_FOOTPRINT 1
|
||||
#define WIN_CRY_WAVE 2
|
||||
#define WIN_VU_METER 3
|
||||
|
||||
static const struct WindowTemplate sInfoScreen_WindowTemplates[] =
|
||||
{
|
||||
{
|
||||
{ // WIN_INFO
|
||||
.bg = 2,
|
||||
.tilemapLeft = 0,
|
||||
.tilemapTop = 0,
|
||||
@ -833,7 +838,7 @@ static const struct WindowTemplate gUnknown_0856E640[] =
|
||||
.paletteNum = 0,
|
||||
.baseBlock = 0x0001,
|
||||
},
|
||||
{
|
||||
{ // WIN_FOOTPRINT
|
||||
.bg = 2,
|
||||
.tilemapLeft = 25,
|
||||
.tilemapTop = 8,
|
||||
@ -842,7 +847,7 @@ static const struct WindowTemplate gUnknown_0856E640[] =
|
||||
.paletteNum = 15,
|
||||
.baseBlock = 0x0281,
|
||||
},
|
||||
{
|
||||
{ // WIN_CRY_WAVE
|
||||
.bg = 0,
|
||||
.tilemapLeft = 0,
|
||||
.tilemapTop = 12,
|
||||
@ -851,7 +856,7 @@ static const struct WindowTemplate gUnknown_0856E640[] =
|
||||
.paletteNum = 8,
|
||||
.baseBlock = 0x0285,
|
||||
},
|
||||
{
|
||||
{ // WIN_VU_METER
|
||||
.bg = 2,
|
||||
.tilemapLeft = 18,
|
||||
.tilemapTop = 3,
|
||||
@ -863,7 +868,7 @@ static const struct WindowTemplate gUnknown_0856E640[] =
|
||||
DUMMY_WIN_TEMPLATE
|
||||
};
|
||||
|
||||
static const struct BgTemplate gUnknown_0856E668[] =
|
||||
static const struct BgTemplate sNewEntryInfoScreen_BgTemplate[] =
|
||||
{
|
||||
{
|
||||
.bg = 2,
|
||||
@ -885,9 +890,9 @@ static const struct BgTemplate gUnknown_0856E668[] =
|
||||
},
|
||||
};
|
||||
|
||||
static const struct WindowTemplate gUnknown_0856E670[] =
|
||||
static const struct WindowTemplate sNewEntryInfoScreen_WindowTemplates[] =
|
||||
{
|
||||
{
|
||||
{ // WIN_INFO
|
||||
.bg = 2,
|
||||
.tilemapLeft = 0,
|
||||
.tilemapTop = 0,
|
||||
@ -896,7 +901,7 @@ static const struct WindowTemplate gUnknown_0856E670[] =
|
||||
.paletteNum = 0,
|
||||
.baseBlock = 0x0001,
|
||||
},
|
||||
{
|
||||
{ // WIN_FOOTPRINT
|
||||
.bg = 2,
|
||||
.tilemapLeft = 25,
|
||||
.tilemapTop = 8,
|
||||
@ -1164,7 +1169,7 @@ static const struct UnknownStruct1 gUnknown_0856EFC8[] =
|
||||
{gDexModeOptions, 2, 3, 2},
|
||||
};
|
||||
|
||||
static const struct BgTemplate gUnknown_0856EFF8[] =
|
||||
static const struct BgTemplate sSearchMenu_BgTemplate[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
@ -1204,7 +1209,7 @@ static const struct BgTemplate gUnknown_0856EFF8[] =
|
||||
}
|
||||
};
|
||||
|
||||
static const struct WindowTemplate gUnknown_0856F008[] =
|
||||
static const struct WindowTemplate sSearchMenu_WindowTemplate[] =
|
||||
{
|
||||
{
|
||||
.bg = 2,
|
||||
@ -1397,8 +1402,8 @@ void sub_80BB7D4(u8 taskId)
|
||||
{
|
||||
sub_80BD8D0();
|
||||
BeginNormalPaletteFade(~(1 << (gSprites[sPokedexView->selectedMonSpriteId].oam.paletteNum + 16)), 0, 0, 0x10, RGB_BLACK);
|
||||
gSprites[sPokedexView->selectedMonSpriteId].callback = sub_80BE470;
|
||||
gTasks[taskId].func = sub_80BBBF4;
|
||||
gSprites[sPokedexView->selectedMonSpriteId].callback = MoveMonIntoPosition;
|
||||
gTasks[taskId].func = LoadPageOnceMonFinishedMoving;
|
||||
PlaySE(SE_PIN);
|
||||
sub_80BC890();
|
||||
}
|
||||
@ -1415,7 +1420,7 @@ void sub_80BB7D4(u8 taskId)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
|
||||
gTasks[taskId].data[0] = sub_80C1258();
|
||||
gTasks[taskId].data[0] = LoadSearchMenu();
|
||||
sPokedexView->unk64E = 0;
|
||||
sPokedexView->unk62A = sPokedexView->unk62C;
|
||||
sPokedexView->unk610 = sPokedexView->selectedPokemon;
|
||||
@ -1508,12 +1513,12 @@ void sub_80BBA78(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BBBF4(u8 taskId)
|
||||
void LoadPageOnceMonFinishedMoving(u8 taskId)
|
||||
{
|
||||
if (gSprites[sPokedexView->selectedMonSpriteId].pos1.x == 48 && gSprites[sPokedexView->selectedMonSpriteId].pos1.y == 56)
|
||||
{
|
||||
sPokedexView->unk64B = sPokedexView->unk64A;
|
||||
gTasks[taskId].data[0] = sub_80BE91C(&sPokedexView->pokedexList[sPokedexView->selectedPokemon], sPokedexView->selectedMonSpriteId);
|
||||
gTasks[taskId].data[0] = SetupInfoScreen(&sPokedexView->pokedexList[sPokedexView->selectedPokemon], sPokedexView->selectedMonSpriteId);
|
||||
gTasks[taskId].func = sub_80BBC74;
|
||||
}
|
||||
}
|
||||
@ -1597,7 +1602,7 @@ void sub_80BBEB8(u8 taskId)
|
||||
|
||||
sub_80BD8D0();
|
||||
a = (1 << (gSprites[sPokedexView->selectedMonSpriteId].oam.paletteNum + 16));
|
||||
gSprites[sPokedexView->selectedMonSpriteId].callback = sub_80BE470;
|
||||
gSprites[sPokedexView->selectedMonSpriteId].callback = MoveMonIntoPosition;
|
||||
BeginNormalPaletteFade(~a, 0, 0, 0x10, RGB_BLACK);
|
||||
gTasks[taskId].func = sub_80BC2D4;
|
||||
PlaySE(SE_PIN);
|
||||
@ -1614,7 +1619,7 @@ void sub_80BBEB8(u8 taskId)
|
||||
else if (gMain.newKeys & SELECT_BUTTON)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
|
||||
gTasks[taskId].data[0] = sub_80C1258();
|
||||
gTasks[taskId].data[0] = LoadSearchMenu();
|
||||
sPokedexView->unk64E = 0;
|
||||
gTasks[taskId].func = sub_80BBD1C;
|
||||
PlaySE(SE_PC_LOGIN);
|
||||
@ -1712,7 +1717,7 @@ void sub_80BC2D4(u8 taskId)
|
||||
if (gSprites[sPokedexView->selectedMonSpriteId].pos1.x == 48 && gSprites[sPokedexView->selectedMonSpriteId].pos1.y == 56)
|
||||
{
|
||||
sPokedexView->unk64B = sPokedexView->unk64A;
|
||||
gTasks[taskId].data[0] = sub_80BE91C(&sPokedexView->pokedexList[sPokedexView->selectedPokemon], sPokedexView->selectedMonSpriteId);
|
||||
gTasks[taskId].data[0] = SetupInfoScreen(&sPokedexView->pokedexList[sPokedexView->selectedPokemon], sPokedexView->selectedMonSpriteId);
|
||||
sPokedexView->selectedMonSpriteId = -1;
|
||||
gTasks[taskId].func = sub_80BC360;
|
||||
}
|
||||
@ -1774,7 +1779,7 @@ bool8 sub_80BC514(u8 a)
|
||||
sub_80C09B0(0);
|
||||
SetGpuReg(REG_OFFSET_BG2VOFS, sPokedexView->initialVOffset);
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gBgTemplates_0855D298, 4);
|
||||
InitBgsFromTemplates(0, sPokedex_BgTemplate, 4);
|
||||
SetBgTilemapBuffer(3, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(2, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(1, AllocZeroed(0x800));
|
||||
@ -2690,7 +2695,7 @@ void sub_80BE44C(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
//Move Pokemon into position for description page
|
||||
void sub_80BE470(struct Sprite *sprite)
|
||||
void MoveMonIntoPosition(struct Sprite *sprite)
|
||||
{
|
||||
sprite->oam.priority = 0;
|
||||
sprite->oam.affineMode = 0;
|
||||
@ -2860,25 +2865,27 @@ void sub_80BE8DC(const u8* str, u8 left, u8 top)
|
||||
AddTextPrinterParameterized4(0, 1, left, top, 0, 0, color, -1, str);
|
||||
}
|
||||
|
||||
u8 sub_80BE91C(struct PokedexListItem* item, u8 b)
|
||||
#define tMonSpriteId data[4]
|
||||
|
||||
u8 SetupInfoScreen(struct PokedexListItem* item, u8 monSpriteId)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
sPokedexListItem = item;
|
||||
taskId = CreateTask(sub_80BEA24, 0);
|
||||
taskId = CreateTask(LoadInfoScreen, 0);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = 1;
|
||||
gTasks[taskId].data[2] = 0;
|
||||
gTasks[taskId].data[3] = 0;
|
||||
gTasks[taskId].data[4] = b;
|
||||
gTasks[taskId].tMonSpriteId = monSpriteId;
|
||||
gTasks[taskId].data[5] = 255;
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_0856E630, 4);
|
||||
InitBgsFromTemplates(0, sInfoScreen_BgTemplate, 4);
|
||||
SetBgTilemapBuffer(3, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(2, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(1, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(0, AllocZeroed(0x800));
|
||||
InitWindows(gUnknown_0856E640);
|
||||
InitWindows(sInfoScreen_WindowTemplates);
|
||||
DeactivateAllTextPrinters();
|
||||
|
||||
return taskId;
|
||||
@ -2886,7 +2893,7 @@ u8 sub_80BE91C(struct PokedexListItem* item, u8 b)
|
||||
|
||||
bool8 sub_80BE9C4(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[0] == 0 && gTasks[taskId].func == sub_80BEDF4)
|
||||
if (gTasks[taskId].data[0] == 0 && gTasks[taskId].func == ChangePokedexScreen)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
@ -2902,7 +2909,7 @@ u8 sub_80BE9F8(struct PokedexListItem *item, u8 b)
|
||||
return b;
|
||||
}
|
||||
|
||||
void sub_80BEA24(u8 taskId)
|
||||
void LoadInfoScreen(u8 taskId)
|
||||
{
|
||||
switch (gMain.state)
|
||||
{
|
||||
@ -2956,8 +2963,8 @@ void sub_80BEA24(u8 taskId)
|
||||
case 5:
|
||||
if (gTasks[taskId].data[1] == 0)
|
||||
{
|
||||
gTasks[taskId].data[4] = (u16)CreateMonSpriteFromNationalDexNumber(sPokedexListItem->dexNum, 48, 56, 0);
|
||||
gSprites[gTasks[taskId].data[4]].oam.priority = 0;
|
||||
gTasks[taskId].tMonSpriteId = (u16)CreateMonSpriteFromNationalDexNumber(sPokedexListItem->dexNum, 48, 56, 0);
|
||||
gSprites[gTasks[taskId].tMonSpriteId].oam.priority = 0;
|
||||
}
|
||||
gMain.state++;
|
||||
break;
|
||||
@ -2968,7 +2975,7 @@ void sub_80BEA24(u8 taskId)
|
||||
if (gTasks[taskId].data[2] != 0)
|
||||
r3 = 0x14;
|
||||
if (gTasks[taskId].data[1] != 0)
|
||||
r3 |= (1 << (gSprites[gTasks[taskId].data[4]].oam.paletteNum + 16));
|
||||
r3 |= (1 << (gSprites[gTasks[taskId].tMonSpriteId].oam.paletteNum + 16));
|
||||
BeginNormalPaletteFade(~r3, 0, 16, 0, RGB_BLACK);
|
||||
SetVBlankCallback(gUnknown_030060B4);
|
||||
gMain.state++;
|
||||
@ -3009,7 +3016,7 @@ void sub_80BEA24(u8 taskId)
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[2] = 1;
|
||||
gTasks[taskId].data[3] = 1;
|
||||
gTasks[taskId].func = sub_80BEDF4;
|
||||
gTasks[taskId].func = ChangePokedexScreen;
|
||||
gMain.state = 0;
|
||||
break;
|
||||
}
|
||||
@ -3033,19 +3040,19 @@ void sub_80BEDB0(void)
|
||||
Free(r0);
|
||||
}
|
||||
|
||||
void sub_80BEDF4(u8 taskId)
|
||||
void ChangePokedexScreen(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[0] != 0)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
|
||||
gTasks[taskId].func = sub_80BF038;
|
||||
gTasks[taskId].func = BeginChangeInfoScreen;
|
||||
PlaySE(SE_Z_SCROLL);
|
||||
return;
|
||||
}
|
||||
if (gMain.newKeys & B_BUTTON)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
|
||||
gTasks[taskId].func = sub_80BF070;
|
||||
gTasks[taskId].func = BeginReturnToPokedex;
|
||||
PlaySE(SE_PC_OFF);
|
||||
return;
|
||||
}
|
||||
@ -3056,13 +3063,13 @@ void sub_80BEDF4(u8 taskId)
|
||||
case AREA_SCREEN:
|
||||
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 16, RGB_BLACK);
|
||||
sPokedexView->unk64E = 1;
|
||||
gTasks[taskId].func = sub_80BEFD0;
|
||||
gTasks[taskId].func = LoadSelectedScreen;
|
||||
PlaySE(SE_PIN);
|
||||
break;
|
||||
case CRY_SCREEN:
|
||||
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK);
|
||||
sPokedexView->unk64E = 2;
|
||||
gTasks[taskId].func = sub_80BEFD0;
|
||||
gTasks[taskId].func = LoadSelectedScreen;
|
||||
PlaySE(SE_PIN);
|
||||
break;
|
||||
case SIZE_SCREEN:
|
||||
@ -3074,13 +3081,13 @@ void sub_80BEDF4(u8 taskId)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK);
|
||||
sPokedexView->unk64E = 3;
|
||||
gTasks[taskId].func = sub_80BEFD0;
|
||||
gTasks[taskId].func = LoadSelectedScreen;
|
||||
PlaySE(SE_PIN);
|
||||
}
|
||||
break;
|
||||
case CANCEL_SCREEN:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
|
||||
gTasks[taskId].func = sub_80BF070;
|
||||
gTasks[taskId].func = BeginReturnToPokedex;
|
||||
PlaySE(SE_PC_OFF);
|
||||
break;
|
||||
}
|
||||
@ -3106,47 +3113,47 @@ void sub_80BEDF4(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BEFD0(u8 taskId)
|
||||
void LoadSelectedScreen(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]);
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].tMonSpriteId);
|
||||
switch (sPokedexView->unk64E)
|
||||
{
|
||||
case 1:
|
||||
default:
|
||||
gTasks[taskId].func = sub_80BF0AC;
|
||||
gTasks[taskId].func = LoadAreaScreen;
|
||||
break;
|
||||
case 2:
|
||||
gTasks[taskId].func = sub_80BF250;
|
||||
gTasks[taskId].func = LoadCryScreen;
|
||||
break;
|
||||
case 3:
|
||||
gTasks[taskId].func = sub_80BF82C;
|
||||
gTasks[taskId].func = LoadSizeScreen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BF038(u8 taskId)
|
||||
void BeginChangeInfoScreen(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]);
|
||||
gTasks[taskId].func = sub_80BEA24;
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].tMonSpriteId);
|
||||
gTasks[taskId].func = LoadInfoScreen;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BF070(u8 taskId)
|
||||
void BeginReturnToPokedex(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]);
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].tMonSpriteId);
|
||||
sub_80BEDB0();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BF0AC(u8 taskId)
|
||||
void LoadAreaScreen(u8 taskId)
|
||||
{
|
||||
switch (gMain.state)
|
||||
{
|
||||
@ -3193,16 +3200,16 @@ void sub_80BF1EC(u8 taskId)
|
||||
{
|
||||
case 1:
|
||||
default:
|
||||
gTasks[taskId].func = sub_80BEA24;
|
||||
gTasks[taskId].func = LoadInfoScreen;
|
||||
break;
|
||||
case 2:
|
||||
gTasks[taskId].func = sub_80BF250;
|
||||
gTasks[taskId].func = LoadCryScreen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BF250(u8 taskId)
|
||||
void LoadCryScreen(u8 taskId)
|
||||
{
|
||||
switch (gMain.state)
|
||||
{
|
||||
@ -3222,10 +3229,10 @@ void sub_80BF250(u8 taskId)
|
||||
case 1:
|
||||
DecompressAndLoadBgGfxUsingHeap(3, &gPokedexMenu_Gfx, 0x2000, 0, 0);
|
||||
CopyToBgTilemapBuffer(3, &gPokedexTilemap_CryScreen, 0, 0);
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(0));
|
||||
PutWindowTilemap(0);
|
||||
PutWindowTilemap(3);
|
||||
PutWindowTilemap(2);
|
||||
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
|
||||
PutWindowTilemap(WIN_INFO);
|
||||
PutWindowTilemap(WIN_VU_METER);
|
||||
PutWindowTilemap(WIN_CRY_WAVE);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 2:
|
||||
@ -3244,8 +3251,8 @@ void sub_80BF250(u8 taskId)
|
||||
gMain.state++;
|
||||
break;
|
||||
case 5:
|
||||
gTasks[taskId].data[4] = CreateMonSpriteFromNationalDexNumber(sPokedexListItem->dexNum, 48, 56, 0);
|
||||
gSprites[gTasks[taskId].data[4]].oam.priority = 0;
|
||||
gTasks[taskId].tMonSpriteId = CreateMonSpriteFromNationalDexNumber(sPokedexListItem->dexNum, 48, 56, 0);
|
||||
gSprites[gTasks[taskId].tMonSpriteId].oam.priority = 0;
|
||||
gDexCryScreenState = 0;
|
||||
gMain.state++;
|
||||
break;
|
||||
@ -3274,8 +3281,8 @@ void sub_80BF250(u8 taskId)
|
||||
spC.yPos = 3;
|
||||
if (sub_8145850(&spC, 3) != 0)
|
||||
gMain.state++;
|
||||
CopyWindowToVram(3, 2);
|
||||
CopyWindowToVram(0, 3);
|
||||
CopyWindowToVram(WIN_VU_METER, 2);
|
||||
CopyWindowToVram(WIN_INFO, 3);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
@ -3367,18 +3374,18 @@ void sub_80BF790(u8 taskId)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
sub_8145914();
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]);
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].tMonSpriteId);
|
||||
switch (sPokedexView->unk64E)
|
||||
{
|
||||
default:
|
||||
case 1:
|
||||
gTasks[taskId].func = sub_80BEA24;
|
||||
gTasks[taskId].func = LoadInfoScreen;
|
||||
break;
|
||||
case 2:
|
||||
gTasks[taskId].func = sub_80BF0AC;
|
||||
gTasks[taskId].func = LoadAreaScreen;
|
||||
break;
|
||||
case 3:
|
||||
gTasks[taskId].func = sub_80BF82C;
|
||||
gTasks[taskId].func = LoadSizeScreen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3395,7 +3402,7 @@ void sub_80BF7FC(u8 a)
|
||||
LoadPalette(&unk, 0x5D, 2);
|
||||
}
|
||||
|
||||
void sub_80BF82C(u8 taskId)
|
||||
void LoadSizeScreen(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
@ -3416,8 +3423,8 @@ void sub_80BF82C(u8 taskId)
|
||||
case 1:
|
||||
DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0);
|
||||
CopyToBgTilemapBuffer(3, gPokedexTilemap_SizeScreen, 0, 0);
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(0));
|
||||
PutWindowTilemap(0);
|
||||
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
|
||||
PutWindowTilemap(WIN_INFO);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 2:
|
||||
@ -3459,8 +3466,8 @@ void sub_80BF82C(u8 taskId)
|
||||
gSprites[spriteId].pos2.y = gPokedexEntries[sPokedexListItem->dexNum].pokemonOffset;
|
||||
SetOamMatrix(2, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale, 0, 0, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale);
|
||||
LoadPalette(gUnknown_0856E610, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20);
|
||||
gTasks[taskId].data[4] = spriteId;
|
||||
CopyWindowToVram(0, 3);
|
||||
gTasks[taskId].tMonSpriteId = spriteId;
|
||||
CopyWindowToVram(WIN_INFO, 3);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
@ -3516,16 +3523,16 @@ void sub_80BFC78(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]);
|
||||
FreeAndDestroyMonPicSprite(gTasks[taskId].tMonSpriteId);
|
||||
FreeAndDestroyTrainerPicSprite(gTasks[taskId].data[5]);
|
||||
switch (sPokedexView->unk64E)
|
||||
{
|
||||
default:
|
||||
case 1:
|
||||
gTasks[taskId].func = sub_80BEA24;
|
||||
gTasks[taskId].func = LoadInfoScreen;
|
||||
break;
|
||||
case 2:
|
||||
gTasks[taskId].func = sub_80BF250;
|
||||
gTasks[taskId].func = LoadCryScreen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3729,7 +3736,7 @@ _080BFDB4:\n\
|
||||
|
||||
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 b, u32 c)
|
||||
{
|
||||
u8 taskId = CreateTask(sub_80BFE38, 0);
|
||||
u8 taskId = CreateTask(Task_DisplayNewMonData, 0);
|
||||
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = dexNum;
|
||||
@ -3740,7 +3747,7 @@ u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 b, u32 c)
|
||||
return taskId;
|
||||
}
|
||||
|
||||
void sub_80BFE38(u8 taskId)
|
||||
static void Task_DisplayNewMonData(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
u16 dexNum = gTasks[taskId].data[1];
|
||||
@ -3755,10 +3762,10 @@ void sub_80BFE38(u8 taskId)
|
||||
SetVBlankCallback(NULL);
|
||||
sub_80C09B0(0x100);
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_0856E668, 2);
|
||||
InitBgsFromTemplates(0, sNewEntryInfoScreen_BgTemplate, 2);
|
||||
SetBgTilemapBuffer(3, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(2, AllocZeroed(0x800));
|
||||
InitWindows(gUnknown_0856E670);
|
||||
InitWindows(sNewEntryInfoScreen_WindowTemplates);
|
||||
DeactivateAllTextPrinters();
|
||||
gTasks[taskId].data[0] = 1;
|
||||
}
|
||||
@ -3766,11 +3773,11 @@ void sub_80BFE38(u8 taskId)
|
||||
case 1:
|
||||
DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0);
|
||||
CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0);
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(0));
|
||||
PutWindowTilemap(0);
|
||||
PutWindowTilemap(1);
|
||||
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
|
||||
PutWindowTilemap(WIN_INFO);
|
||||
PutWindowTilemap(WIN_FOOTPRINT);
|
||||
sub_80C0D30(1, gTasks[taskId].data[1]);
|
||||
CopyWindowToVram(1, 2);
|
||||
CopyWindowToVram(WIN_FOOTPRINT, 2);
|
||||
ResetPaletteFade();
|
||||
LoadPokedexBgPalette(0);
|
||||
gTasks[taskId].data[0]++;
|
||||
@ -3780,7 +3787,7 @@ void sub_80BFE38(u8 taskId)
|
||||
break;
|
||||
case 3:
|
||||
sub_80C020C(dexNum, IsNationalPokedexEnabled(), 1, 1);
|
||||
CopyWindowToVram(0, 3);
|
||||
CopyWindowToVram(WIN_INFO, 3);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
gTasks[taskId].data[0]++;
|
||||
@ -4764,9 +4771,9 @@ int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8
|
||||
return resultsCount;
|
||||
}
|
||||
|
||||
u8 sub_80C1258(void)
|
||||
u8 LoadSearchMenu(void)
|
||||
{
|
||||
return CreateTask(sub_80C12E0, 0);
|
||||
return CreateTask(Task_LoadSearchMenu, 0);
|
||||
}
|
||||
|
||||
void sub_80C1270(const u8 *str, u32 left, u32 top)
|
||||
@ -4784,7 +4791,7 @@ void sub_80C12B0(u32 x, u32 y, u32 width, u32 height)
|
||||
FillWindowPixelRect(0, PIXEL_FILL(0), x, y, width, height);
|
||||
}
|
||||
|
||||
void sub_80C12E0(u8 taskId)
|
||||
void Task_LoadSearchMenu(u8 taskId)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
@ -4797,12 +4804,12 @@ void sub_80C12E0(u8 taskId)
|
||||
sPokedexView->unk64A = 2;
|
||||
sub_80C09B0(0);
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_0856EFF8, 4);
|
||||
InitBgsFromTemplates(0, sSearchMenu_BgTemplate, 4);
|
||||
SetBgTilemapBuffer(3, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(2, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(1, AllocZeroed(0x800));
|
||||
SetBgTilemapBuffer(0, AllocZeroed(0x800));
|
||||
InitWindows(gUnknown_0856F008);
|
||||
InitWindows(sSearchMenu_WindowTemplate);
|
||||
DeactivateAllTextPrinters();
|
||||
PutWindowTilemap(0);
|
||||
DecompressAndLoadBgGfxUsingHeap(3, gPokedexSearchMenu_Gfx, 0x2000, 0, 0);
|
||||
|
@ -1117,7 +1117,7 @@ const u8 *GetSecretBaseTrainerLoseText(void)
|
||||
|
||||
void PrepSecretBaseBattleFlags(void)
|
||||
{
|
||||
sub_813BADC(1);
|
||||
TryGainNewFanFromCounter(1);
|
||||
gTrainerBattleOpponent_A = TRAINER_SECRET_BASE;
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_SECRET_BASE;
|
||||
}
|
||||
|
13
src/tv.c
13
src/tv.c
@ -2432,7 +2432,7 @@ u8 TV_MonDataIdxToRibbon(u8 monDataIdx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_80EE72C(void)
|
||||
void TrySetUpTrainerFanClubSpecial(void)
|
||||
{
|
||||
TVShow *show;
|
||||
|
||||
@ -2450,22 +2450,19 @@ void sub_80EE72C(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80EE7C0(void)
|
||||
bool8 ShouldHideFanClubInterviewer(void)
|
||||
{
|
||||
sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
|
||||
if (sCurTVShowSlot == -1)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_SPECIAL);
|
||||
if (gSpecialVar_Result == TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gSaveBlock1Ptr->linkBattleRecords.entries[0].name[0] == EOS)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user