diff options
-rw-r--r-- | data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc | 4 | ||||
-rw-r--r-- | data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc | 4 | ||||
-rw-r--r-- | data/maps/EverGrandeCity_DrakesRoom/scripts.inc | 2 | ||||
-rw-r--r-- | data/maps/LilycoveCity_PokemonTrainerFanClub/map.json | 16 | ||||
-rw-r--r-- | data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc | 638 | ||||
-rw-r--r-- | data/specials.inc | 18 | ||||
-rw-r--r-- | include/constants/field_specials.h | 14 | ||||
-rw-r--r-- | include/constants/vars.h | 4 | ||||
-rw-r--r-- | include/field_specials.h | 4 | ||||
-rw-r--r-- | include/tv.h | 2 | ||||
-rw-r--r-- | src/battle_script_commands.c | 4 | ||||
-rw-r--r-- | src/cable_club.c | 2 | ||||
-rw-r--r-- | src/contest_link_80F57C4.c | 4 | ||||
-rw-r--r-- | src/field_control_avatar.c | 7 | ||||
-rw-r--r-- | src/field_specials.c | 291 | ||||
-rw-r--r-- | src/pokedex.c | 213 | ||||
-rw-r--r-- | src/pokemon.c | 2 | ||||
-rw-r--r-- | src/secret_base.c | 2 | ||||
-rw-r--r-- | src/tv.c | 13 |
19 files changed, 667 insertions, 577 deletions
diff --git a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc index f2971d3a1..e305260df 100644 --- a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc @@ -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 diff --git a/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc b/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc index e280edbe7..f447434f1 100644 --- a/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerBattleRoom2/scripts.inc @@ -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 diff --git a/data/maps/EverGrandeCity_DrakesRoom/scripts.inc b/data/maps/EverGrandeCity_DrakesRoom/scripts.inc index e2623e28c..139154fa9 100644 --- a/data/maps/EverGrandeCity_DrakesRoom/scripts.inc +++ b/data/maps/EverGrandeCity_DrakesRoom/scripts.inc @@ -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 diff --git a/data/maps/LilycoveCity_PokemonTrainerFanClub/map.json b/data/maps/LilycoveCity_PokemonTrainerFanClub/map.json index 2f1de5b03..f918c86ec 100644 --- a/data/maps/LilycoveCity_PokemonTrainerFanClub/map.json +++ b/data/maps/LilycoveCity_PokemonTrainerFanClub/map.json @@ -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" }, { diff --git a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc index 3645d5cab..039fb6413 100644 --- a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc +++ b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc @@ -3,32 +3,34 @@ LilycoveCity_PokemonTrainerFanClub_MapScripts:: @ 821C785 map_script MAP_SCRIPT_ON_TRANSITION, LilycoveCity_PokemonTrainerFanClub_OnTransition .byte 0 + @ See field_specials.c for a breakdown of the Fan Club and its variables + LilycoveCity_PokemonTrainerFanClub_OnFrame: @ 821C790 - map_script_2 VAR_LILYCOVE_FAN_CLUB_STATE, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_21C79A + map_script_2 VAR_LILYCOVE_FAN_CLUB_STATE, 1, LilycoveCity_PokemonTrainerFanClub_EventScript_MeetFirstFans .2byte 0 -LilycoveCity_PokemonTrainerFanClub_EventScript_21C79A:: @ 821C79A +LilycoveCity_PokemonTrainerFanClub_EventScript_MeetFirstFans:: @ 821C79A lockall applymovement 1, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox LilycoveCity_PokemonTrainerFanClub_Text_OhWowItsPlayer, MSGBOX_DEFAULT - applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_21C7FD - applymovement 2, LilycoveCity_PokemonTrainerFanClub_Movement_21C7F5 + applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlWatchPlayer + applymovement 2, LilycoveCity_PokemonTrainerFanClub_Movement_FanApproachPlayer waitmovement 0 applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox LilycoveCity_PokemonTrainerFanClub_Text_HeardAboutYouImYourFan, MSGBOX_DEFAULT - applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_21C804 + applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlMoveCloserToPlayer waitmovement 0 applymovement EVENT_OBJ_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_21C807 + applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlHideFromPlayer waitmovement 0 setvar VAR_LILYCOVE_FAN_CLUB_STATE, 2 releaseall end -LilycoveCity_PokemonTrainerFanClub_Movement_21C7F5: @ 821C7F5 +LilycoveCity_PokemonTrainerFanClub_Movement_FanApproachPlayer: @ 821C7F5 delay_8 walk_in_place_fastest_down walk_down @@ -38,7 +40,7 @@ LilycoveCity_PokemonTrainerFanClub_Movement_21C7F5: @ 821C7F5 walk_left step_end -LilycoveCity_PokemonTrainerFanClub_Movement_21C7FD: @ 821C7FD +LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlWatchPlayer: @ 821C7FD walk_fast_left walk_fast_left walk_fast_down @@ -47,12 +49,12 @@ LilycoveCity_PokemonTrainerFanClub_Movement_21C7FD: @ 821C7FD walk_fast_down step_end -LilycoveCity_PokemonTrainerFanClub_Movement_21C804: @ 821C804 +LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlMoveCloserToPlayer: @ 821C804 walk_down walk_in_place_fastest_right step_end -LilycoveCity_PokemonTrainerFanClub_Movement_21C807: @ 821C807 +LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlHideFromPlayer: @ 821C807 jump_in_place_right walk_fast_up walk_fast_up @@ -61,438 +63,440 @@ LilycoveCity_PokemonTrainerFanClub_Movement_21C807: @ 821C807 step_end LilycoveCity_PokemonTrainerFanClub_OnTransition: @ 821C80D - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C8DA + call LilycoveCity_PokemonTrainerFanClub_EventScript_HideOrShowInterviewer compare VAR_LILYCOVE_FAN_CLUB_STATE, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9F8 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_SetFanMemberPositionsForFirstFanMeeting compare VAR_LILYCOVE_FAN_CLUB_STATE, 2 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C829 - end - -LilycoveCity_PokemonTrainerFanClub_EventScript_21C829:: @ 821C829 - special UpdateMovedLilycoveFanClubMembers - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C8F5 - setvar VAR_0x8004, 8 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9B8 - setvar VAR_0x8004, 9 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9C0 - setvar VAR_0x8004, 10 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9C8 - setvar VAR_0x8004, 11 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9D0 - setvar VAR_0x8004, 12 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9D8 - setvar VAR_0x8004, 13 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9E0 - setvar VAR_0x8004, 14 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9E8 - setvar VAR_0x8004, 15 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9F0 - end - -LilycoveCity_PokemonTrainerFanClub_EventScript_21C8DA:: @ 821C8DA - specialvar VAR_RESULT, sub_80EE7C0 - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C8F1 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_UpdateFanMemberPositions + end + +LilycoveCity_PokemonTrainerFanClub_EventScript_UpdateFanMemberPositions:: @ 821C829 + special TryLoseFansFromPlayTime + call LilycoveCity_PokemonTrainerFanClub_EventScript_CheckSetUpTVShow + setvar VAR_0x8004, FANCLUB_MEMBER1 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember1ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER2 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember2ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER3 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember3ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER4 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember4ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER5 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember5ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER6 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember6ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER7 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember7ToFarTable + setvar VAR_0x8004, FANCLUB_MEMBER8 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember8ToFarTable + end + +LilycoveCity_PokemonTrainerFanClub_EventScript_HideOrShowInterviewer:: @ 821C8DA + specialvar VAR_RESULT, ShouldHideFanClubInterviewer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_HideInterviewer clearflag FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER clearflag FLAG_FAN_CLUB_STRENGTH_SHARED return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C8F1:: @ 821C8F1 +LilycoveCity_PokemonTrainerFanClub_EventScript_HideInterviewer:: @ 821C8F1 setflag FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C8F5:: @ 821C8F5 - setvar VAR_0x8005, NUM_TRAINER_CLUB_MEMBERS - setvar VAR_0x8004, 8 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 9 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 10 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 11 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 12 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 13 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 14 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE - setvar VAR_0x8004, 15 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 0 - call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE +@ Set up the fan club TV show, if the player has at least 5 fans in the club +@ Rather than counting up, 1 is subtracted from the total for each member not a fan of the players +LilycoveCity_PokemonTrainerFanClub_EventScript_CheckSetUpTVShow:: @ 821C8F5 + setvar VAR_0x8005, NUM_TRAINER_FAN_CLUB_MEMBERS + setvar VAR_0x8004, FANCLUB_MEMBER1 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER2 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER3 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER4 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER5 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER6 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER7 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan + setvar VAR_0x8004, FANCLUB_MEMBER8 + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, FALSE + call_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan compare VAR_0x8005, 5 - goto_if_ge LilycoveCity_PokemonTrainerFanClub_EventScript_21C9B4 + goto_if_ge LilycoveCity_PokemonTrainerFanClub_EventScript_TrySetUpTVShow return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9AE:: @ 821C9AE +LilycoveCity_PokemonTrainerFanClub_EventScript_CountNotPlayersFan:: @ 821C9AE subvar VAR_0x8005, 1 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9B4:: @ 821C9B4 - special sub_80EE72C +LilycoveCity_PokemonTrainerFanClub_EventScript_TrySetUpTVShow:: @ 821C9B4 + special TrySetUpTrainerFanClubSpecial return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9B8:: @ 821C9B8 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember1ToFarTable:: @ 821C9B8 setobjectxyperm 1, 7, 5 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9C0:: @ 821C9C0 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember2ToFarTable:: @ 821C9C0 setobjectxyperm 3, 3, 4 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9C8:: @ 821C9C8 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember3ToFarTable:: @ 821C9C8 setobjectxyperm 4, 7, 2 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9D0:: @ 821C9D0 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember4ToFarTable:: @ 821C9D0 setobjectxyperm 5, 5, 5 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9D8:: @ 821C9D8 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember5ToFarTable:: @ 821C9D8 setobjectxyperm 6, 5, 2 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9E0:: @ 821C9E0 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember6ToFarTable:: @ 821C9E0 setobjectxyperm 2, 8, 4 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9E8:: @ 821C9E8 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember7ToFarTable:: @ 821C9E8 setobjectxyperm 7, 3, 3 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9F0:: @ 821C9F0 +LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember8ToFarTable:: @ 821C9F0 setobjectxyperm 8, 8, 3 return -LilycoveCity_PokemonTrainerFanClub_EventScript_21C9F8:: @ 821C9F8 - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C8F5 - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C9C0 - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C9D0 - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C9D8 - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C9E8 - call LilycoveCity_PokemonTrainerFanClub_EventScript_21C9F0 +LilycoveCity_PokemonTrainerFanClub_EventScript_SetFanMemberPositionsForFirstFanMeeting:: @ 821C9F8 + call LilycoveCity_PokemonTrainerFanClub_EventScript_CheckSetUpTVShow + call LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember2ToFarTable + call LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember4ToFarTable + call LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember5ToFarTable + call LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember7ToFarTable + call LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember8ToFarTable end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA17:: @ 821CA17 +LilycoveCity_PokemonTrainerFanClub_EventScript_Man:: @ 821CA17 lock faceplayer - setvar VAR_0x8004, 13 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER6 + special BufferFanClubTrainerName compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CA84 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CA56 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CA7A - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D12A, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayerNotChampion + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainersPowerIsOutOfTheOrdinary, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA56:: @ 821CA56 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayersFan:: @ 821CA56 + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CA70 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D094, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YoureOneWeWantToWin, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA70:: @ 821CA70 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D0BB, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyFan:: @ 821CA70 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_OthersDontKnowYoureTheBest, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA7A:: @ 821CA7A - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D1B5, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyNonFan:: @ 821CA7A + msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsBestNoOneWantsToListen, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA84:: @ 821CA84 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D20C, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayerNotChampion:: @ 821CA84 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_HearingAboutToughNewTrainer, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA8E:: @ 821CA8E +LilycoveCity_PokemonTrainerFanClub_EventScript_Lass:: @ 821CA8E lock faceplayer - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CAFB - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CACD - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CAF1 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D347, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayerNotChampion + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_ICantHelpLikingBrawly, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CACD:: @ 821CACD - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayersFan:: @ 821CACD + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CAE7 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D2A6, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_ImPullingForYou, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CAE7:: @ 821CAE7 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D2CE, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyFan:: @ 821CAE7 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_BrawlyNoImYourFan, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CAF1:: @ 821CAF1 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D377, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyNonFan:: @ 821CAF1 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_NobodyUnderstandsBrawly, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CAFB:: @ 821CAFB - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D3EE, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayerNotChampion:: @ 821CAFB + msgbox LilycoveCity_PokemonTrainerFanClub_Text_MyFavoriteTrainerIsBrawly, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB05:: @ 821CB05 +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanM:: @ 821CB05 lock faceplayer - setvar VAR_0x8004, 9 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER2 + special BufferFanClubTrainerName compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CB72 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CB44 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CB68 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D52E, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayerNotChampion + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_LongWayToGoComparedToNorman, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB44:: @ 821CB44 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayersFan:: @ 821CB44 + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CB5E - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D438, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouveSurpassedYourFather, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB5E:: @ 821CB5E - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D4A3, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyFan:: @ 821CB5E + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YourFatherNeverGaveUpSoKeepOnBattling, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB68:: @ 821CB68 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D5DC, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyNonFan:: @ 821CB68 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouAndNormanAreDifferent, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB72:: @ 821CB72 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D69C, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayerNotChampion:: @ 821CB72 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_WeDiscussStrongestTrainers, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB7C:: @ 821CB7C +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirl:: @ 821CB7C lock faceplayer - setvar VAR_0x8004, 10 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER3 + special BufferFanClubTrainerName compare VAR_LILYCOVE_FAN_CLUB_STATE, 0 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CBE9 - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CBBB - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CBDF - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D822, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayerNotChampion + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_EveryoneThinksTrainerIsCool, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBBB:: @ 821CBBB - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayersFan:: @ 821CBBB + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CBD5 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D751, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_OhWoweeItsPlayer, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBD5:: @ 821CBD5 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D79B, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyFan:: @ 821CBD5 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_AlwaysCheerForYou, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBDF:: @ 821CBDF - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D857, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyNonFan:: @ 821CBDF + msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsReallyCoolItsJustMe, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBE9:: @ 821CBE9 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D8C4, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayerNotChampion:: @ 821CBE9 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_WishThereWasTrainerLikeThat, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBF3:: @ 821CBF3 +LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoy:: @ 821CBF3 lock faceplayer - setvar VAR_0x8004, 11 - special BufferStreakTrainerText - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CC27 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CC4B - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D9D1, MSGBOX_DEFAULT + setvar VAR_0x8004, FANCLUB_MEMBER4 + special BufferFanClubTrainerName + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsWickedlyCool, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC27:: @ 821CC27 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyPlayersFan:: @ 821CC27 + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CC41 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D921, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_WantToBeStrongLikeYou, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC41:: @ 821CC41 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D96A, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyFan:: @ 821CC41 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_OnlyOneWhoCheersForYou, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC4B:: @ 821CC4B - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DA0D, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyNonFan:: @ 821CC4B + msgbox LilycoveCity_PokemonTrainerFanClub_Text_NeverGoingToStopBeingTrainersFan, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC55:: @ 821CC55 +LilycoveCity_PokemonTrainerFanClub_EventScript_Boy:: @ 821CC55 lock faceplayer - setvar VAR_0x8004, 12 - special BufferStreakTrainerText - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CC89 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CCAD - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DB69, MSGBOX_DEFAULT + setvar VAR_0x8004, FANCLUB_MEMBER5 + special BufferFanClubTrainerName + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_ThinkTrainerIsNumberOne, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC89:: @ 821CC89 - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_BoyPlayersFan:: @ 821CC89 + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CCA3 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DA73, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YoureAmazingAfterAll, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CCA3:: @ 821CCA3 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DAF5, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyFan:: @ 821CCA3 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_ImInYourCorner, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CCAD:: @ 821CCAD - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DBFB, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyNonFan:: @ 821CCAD + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YoureMaybeStrongerThanTrainer, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CCB7:: @ 821CCB7 +LilycoveCity_PokemonTrainerFanClub_EventScript_Woman:: @ 821CCB7 lock faceplayer - setvar VAR_0x8004, 14 - special BufferStreakTrainerText - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember - compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CCEB - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CD0F - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DD36, MSGBOX_DEFAULT + setvar VAR_0x8004, FANCLUB_MEMBER7 + special BufferFanClubTrainerName + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer + compare VAR_RESULT, TRUE + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsStandout, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CCEB:: @ 821CCEB - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_WomanPlayersFan:: @ 821CCEB + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CD05 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DC68, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouChangedMyMind, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD05:: @ 821CD05 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DCD6, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyFan:: @ 821CD05 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouBattleAttractivelyInToughSituation, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD0F:: @ 821CD0F - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DDCE, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyNonFan:: @ 821CD0F + msgbox LilycoveCity_PokemonTrainerFanClub_Text_NoOneCanKnockYouButTrainerStronger, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD19:: @ 821CD19 +LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertF:: @ 821CD19 lock faceplayer - setvar VAR_0x8004, 15 - special BufferStreakTrainerText - specialvar VAR_RESULT, ShouldMoveLilycoveFanClubMember + setvar VAR_0x8004, FANCLUB_MEMBER8 + special BufferFanClubTrainerName + specialvar VAR_RESULT, IsFanClubMemberFanOfPlayer compare VAR_RESULT, TRUE - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CD4D - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers - compare VAR_RESULT, 7 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_21CD71 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DEFF, MSGBOX_DEFAULT + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFPlayersFan + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub + compare VAR_RESULT, (NUM_TRAINER_FAN_CLUB_MEMBERS - 1) + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyNonFan + msgbox LilycoveCity_PokemonTrainerFanClub_Text_HaventRealizedPotential, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD4D:: @ 821CD4D - specialvar VAR_RESULT, GetNumMovedLilycoveFanClubMembers +LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFPlayersFan:: @ 821CD4D + specialvar VAR_RESULT, GetNumFansOfPlayerInTrainerFanClub compare VAR_RESULT, 1 - goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_OnlyFan + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouImpressive, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_OnlyFan:: @ 821CD67 +LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyFan:: @ 821CD67 msgbox LilycoveCity_PokemonTrainerFanClub_Text_OnlyIRecognizeYourTrueWorth, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD71:: @ 821CD71 - msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DF51, MSGBOX_DEFAULT +LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyNonFan:: @ 821CD71 + msgbox LilycoveCity_PokemonTrainerFanClub_Text_YourePowerfulButNotTrueStrength, MSGBOX_DEFAULT release end @@ -503,14 +507,16 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Interviewer:: @ 821CD7B goto_if_unset FLAG_FAN_CLUB_STRENGTH_SHARED, LilycoveCity_PokemonTrainerFanClub_EventScript_Interview end +@ The interviewer doesnt count as an individual fan club member +@ Instead they always ask about whoever the Lass would be interested in, if not the player LilycoveCity_PokemonTrainerFanClub_EventScript_Interview:: @ 821CD90 setvar VAR_0x8005, TVSHOW_FAN_CLUB_SPECIAL special InterviewBefore compare VAR_RESULT, TRUE goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_AlreadyInterviewed2 copyvar VAR_0x800A, VAR_0x8006 - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_Text_WhatsYourOpinionOfTrainer, MSGBOX_DEFAULT setvar VAR_0x8004, EASY_CHAT_TYPE_FAN_QUESTION copyvar VAR_0x8005, VAR_0x800A @@ -529,8 +535,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_SubmitOpinion:: @ 821CDE0 end LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion:: @ 821CDEE - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_Text_HaveYouForgottenTrainer, MSGBOX_YESNO compare VAR_RESULT, YES goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ForgetTrainer @@ -539,8 +545,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_CancelGiveOpinion:: @ 821CDEE end LilycoveCity_PokemonTrainerFanClub_EventScript_AskForOpinion:: @ 821CE15 - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_Text_WhatsYourOpinionOfTrainer2, MSGBOX_DEFAULT setvar VAR_0x8004, EASY_CHAT_TYPE_FAN_QUESTION copyvar VAR_0x8005, VAR_0x800A @@ -554,19 +560,19 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_AskForOpinion:: @ 821CE15 end LilycoveCity_PokemonTrainerFanClub_EventScript_RateTrainer:: @ 821CE4D - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName message LilycoveCity_PokemonTrainerFanClub_Text_HowStrongRateTrainer waitmessage setvar VAR_0x8004, SCROLL_MULTI_POKEMON_FAN_CLUB_RATER special ShowScrollableMultichoice waitstate - setvar VAR_0x8004, 8 + setvar VAR_0x8004, FANCLUB_MEMBER1 switch VAR_RESULT case 11, LilycoveCity_PokemonTrainerFanClub_EventScript_CancelRateTrainer case MULTI_B_PRESSED, LilycoveCity_PokemonTrainerFanClub_EventScript_CancelRateTrainer - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName copyvar VAR_0x8006, VAR_0x800A copyvar VAR_0x8005, VAR_RESULT special PutFanClubSpecialOnTheAir @@ -574,8 +580,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_RateTrainer:: @ 821CE4D end LilycoveCity_PokemonTrainerFanClub_EventScript_CancelRateTrainer:: @ 821CE9F - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_Text_HaveYouForgottenTrainer2, MSGBOX_YESNO compare VAR_RESULT, YES goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ForgetTrainer @@ -584,23 +590,23 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_CancelRateTrainer:: @ 821CE9F end LilycoveCity_PokemonTrainerFanClub_EventScript_ForgetTrainer:: @ 821CEC6 - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_Text_YouShouldMeetTrainer, MSGBOX_DEFAULT release end LilycoveCity_PokemonTrainerFanClub_EventScript_CompleteInterview:: @ 821CED8 - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_Text_ThankYouIllShareThisInfo, MSGBOX_DEFAULT setflag FLAG_FAN_CLUB_STRENGTH_SHARED release end LilycoveCity_PokemonTrainerFanClub_EventScript_AlreadyInterviewed:: @ 821CEED - setvar VAR_0x8004, 8 - special BufferStreakTrainerText + setvar VAR_0x8004, FANCLUB_MEMBER1 + special BufferFanClubTrainerName msgbox LilycoveCity_PokemonTrainerFanClub_HopeYouCatchTVSpecial, MSGBOX_DEFAULT release end @@ -629,29 +635,29 @@ LilycoveCity_PokemonTrainerFanClub_Text_HeardAboutYouImYourFan: @ 821CF12 .string "Remember, I'm cheering for you,\n" .string "{PLAYER}!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D094: @ 821D094 +LilycoveCity_PokemonTrainerFanClub_Text_YoureOneWeWantToWin: @ 821D094 .string "Yo, {PLAYER}!\n" .string "You're the one we want to win!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D0BB: @ 821D0BB +LilycoveCity_PokemonTrainerFanClub_Text_OthersDontKnowYoureTheBest: @ 821D0BB .string "The others, they don't know that\n" .string "you're the best of the best!\p" .string "Isn't that right, {PLAYER}?\n" .string "Show them you've got guts!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D12A: @ 821D12A +LilycoveCity_PokemonTrainerFanClub_Text_TrainersPowerIsOutOfTheOrdinary: @ 821D12A .string "I hate to say this, but the TRAINER\n" .string "everybody's talking about is\l" .string "{STR_VAR_1}, no question about it!\p" .string "That TRAINER's power…\n" .string "It's out of the ordinary.$" -LilycoveCity_PokemonTrainerFanClub_Text_21D1B5: @ 821D1B5 +LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsBestNoOneWantsToListen: @ 821D1B5 .string "Darn it… I've been telling people\n" .string "that {STR_VAR_1} is the best now…\p" .string "But no one wants to listen…$" -LilycoveCity_PokemonTrainerFanClub_Text_21D20C: @ 821D20C +LilycoveCity_PokemonTrainerFanClub_Text_HearingAboutToughNewTrainer: @ 821D20C .string "I've been hearing things about\n" .string "a tough new TRAINER.\p" .string "This TRAINER's supposed to be beating\n" @@ -659,13 +665,13 @@ LilycoveCity_PokemonTrainerFanClub_Text_21D20C: @ 821D20C .string "Do you know anything about this\n" .string "new TRAINER?$" -LilycoveCity_PokemonTrainerFanClub_Text_21D2A6: @ 821D2A6 +LilycoveCity_PokemonTrainerFanClub_Text_ImPullingForYou: @ 821D2A6 .string "Oh!\n" .string "{PLAYER}!\p" .string "Go for it!\n" .string "I'm pulling for you!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D2CE: @ 821D2CE +LilycoveCity_PokemonTrainerFanClub_Text_BrawlyNoImYourFan: @ 821D2CE .string "Sigh…\n" .string "BRAWLY…\p" .string "Oh, no! Wait!\n" @@ -674,36 +680,36 @@ LilycoveCity_PokemonTrainerFanClub_Text_21D2CE: @ 821D2CE .string "So make me proud!\n" .string "Go for it!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D347: @ 821D347 +LilycoveCity_PokemonTrainerFanClub_Text_ICantHelpLikingBrawly: @ 821D347 .string "I can't help it, I can only get to\n" .string "like BRAWLY…$" -LilycoveCity_PokemonTrainerFanClub_Text_21D377: @ 821D377 +LilycoveCity_PokemonTrainerFanClub_Text_NobodyUnderstandsBrawly: @ 821D377 .string "Nobody understands the charm of\n" .string "BRAWLY…\p" .string "I don't care!\p" .string "Even if I'm the only one, I'm going\n" .string "to keep cheering for BRAWLY!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D3EE: @ 821D3EE +LilycoveCity_PokemonTrainerFanClub_Text_MyFavoriteTrainerIsBrawly: @ 821D3EE .string "Whatever anyone says, my favorite\n" .string "TRAINER is DEWFORD's GYM LEADER\l" .string "BRAWLY!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D438: @ 821D438 +LilycoveCity_PokemonTrainerFanClub_Text_YouveSurpassedYourFather: @ 821D438 .string "You've surpassed your own father in\n" .string "every regard!\p" .string "I'm telling you, so there's no question\n" .string "about it at all!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D4A3: @ 821D4A3 +LilycoveCity_PokemonTrainerFanClub_Text_YourFatherNeverGaveUpSoKeepOnBattling: @ 821D4A3 .string "Even when things turned bleak,\n" .string "your father never gave up.\p" .string "This I know to be true.\p" .string "You never give up even if you lose!\n" .string "So keep on battling!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D52E: @ 821D52E +LilycoveCity_PokemonTrainerFanClub_Text_LongWayToGoComparedToNorman: @ 821D52E .string "NORMAN battled with more power,\n" .string "charisma, and showmanship than you.\p" .string "Even though people may say that\n" @@ -711,7 +717,7 @@ LilycoveCity_PokemonTrainerFanClub_Text_21D52E: @ 821D52E .string "You've still got a long way to go\n" .string "compared to your father.$" -LilycoveCity_PokemonTrainerFanClub_Text_21D5DC: @ 821D5DC +LilycoveCity_PokemonTrainerFanClub_Text_YouAndNormanAreDifferent: @ 821D5DC .string "You're beginning to get the same\n" .string "air of awe NORMAN exudes.\p" .string "But there's something conclusively\n" @@ -719,7 +725,7 @@ LilycoveCity_PokemonTrainerFanClub_Text_21D5DC: @ 821D5DC .string "I can't tell you what that is.\n" .string "You'll have to find it yourself.$" -LilycoveCity_PokemonTrainerFanClub_Text_21D69C: @ 821D69C +LilycoveCity_PokemonTrainerFanClub_Text_WeDiscussStrongestTrainers: @ 821D69C .string "Everyone here, we're all huge fans\n" .string "of POKéMON battles.\p" .string "We discuss who we consider to be\n" @@ -727,12 +733,12 @@ LilycoveCity_PokemonTrainerFanClub_Text_21D69C: @ 821D69C .string "If you were to become famous,\n" .string "we might even become your fans!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D751: @ 821D751 +LilycoveCity_PokemonTrainerFanClub_Text_OhWoweeItsPlayer: @ 821D751 .string "Oh, woweee! It's {PLAYER}!\n" .string "For real, too!\p" .string "Please, shake my hand, shake my hand!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D79B: @ 821D79B +LilycoveCity_PokemonTrainerFanClub_Text_AlwaysCheerForYou: @ 821D79B .string "I'll always cheer for you, {PLAYER}!\n" .string "Always, always!\p" .string "I don't want to see you lose ever,\n" @@ -740,60 +746,60 @@ LilycoveCity_PokemonTrainerFanClub_Text_21D79B: @ 821D79B .string "Because I know you're really,\n" .string "really strong, {PLAYER}!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D822: @ 821D822 +LilycoveCity_PokemonTrainerFanClub_Text_EveryoneThinksTrainerIsCool: @ 821D822 .string "{STR_VAR_1} is really cool…\p" .string "Everyone thinks so, right, right?$" -LilycoveCity_PokemonTrainerFanClub_Text_21D857: @ 821D857 +LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsReallyCoolItsJustMe: @ 821D857 .string "{STR_VAR_1} really is cool, don't\n" .string "you think so?\p" .string "Even if it's just me, I'm going to keep\n" .string "cheering my favorite TRAINER.$" -LilycoveCity_PokemonTrainerFanClub_Text_21D8C4: @ 821D8C4 +LilycoveCity_PokemonTrainerFanClub_Text_WishThereWasTrainerLikeThat: @ 821D8C4 .string "My favorite TRAINER is…\p" .string "Cool…\p" .string "Strong…\p" .string "And really nice…\p" .string "I wish there was a TRAINER like that…$" -LilycoveCity_PokemonTrainerFanClub_Text_21D921: @ 821D921 +LilycoveCity_PokemonTrainerFanClub_Text_WantToBeStrongLikeYou: @ 821D921 .string "Whoa! It's {PLAYER}!\n" .string "Wicked!\p" .string "When I grow up, I want to be strong\n" .string "like you, {PLAYER}!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D96A: @ 821D96A +LilycoveCity_PokemonTrainerFanClub_Text_OnlyOneWhoCheersForYou: @ 821D96A .string "Even if I'm the only one…\p" .string "You'll always be the only one\n" .string "I cheer for, {PLAYER}!\p" .string "Because I believe in you, {PLAYER}!$" -LilycoveCity_PokemonTrainerFanClub_Text_21D9D1: @ 821D9D1 +LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsWickedlyCool: @ 821D9D1 .string "{STR_VAR_1} is so wickedly cool…\n" .string "I want to shake hands with my hero.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DA0D: @ 821DA0D +LilycoveCity_PokemonTrainerFanClub_Text_NeverGoingToStopBeingTrainersFan: @ 821DA0D .string "Even if I'm the only one…\p" .string "I'm never going to stop being\n" .string "{STR_VAR_1}'s fan!\p" .string "Because I've heard, {STR_VAR_1}\n" .string "never loses!$" -LilycoveCity_PokemonTrainerFanClub_Text_21DA73: @ 821DA73 +LilycoveCity_PokemonTrainerFanClub_Text_YoureAmazingAfterAll: @ 821DA73 .string "{PLAYER}!\n" .string "You are amazing after all!\p" .string "Ever since I set eyes on you,\n" .string "I knew that you were great.\p" .string "It looks like my eyes didn't deceive me.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DAF5: @ 821DAF5 +LilycoveCity_PokemonTrainerFanClub_Text_ImInYourCorner: @ 821DAF5 .string "Who cares about the others.\n" .string "I'm in your corner!\p" .string "You don't need to worry. Just get\n" .string "out there and battle like always.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DB69: @ 821DB69 +LilycoveCity_PokemonTrainerFanClub_Text_ThinkTrainerIsNumberOne: @ 821DB69 .string "You're a pretty decent TRAINER,\n" .string "I think.\p" .string "But I also think that {STR_VAR_1}\n" @@ -801,32 +807,32 @@ LilycoveCity_PokemonTrainerFanClub_Text_21DB69: @ 821DB69 .string "That's just my opinion.\n" .string "Don't worry about it too much.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DBFB: @ 821DBFB +LilycoveCity_PokemonTrainerFanClub_Text_YoureMaybeStrongerThanTrainer: @ 821DBFB .string "Wow, you really are strong.\n" .string "Maybe even stronger than {STR_VAR_1}.\p" .string "But {STR_VAR_1} needs me.\p" .string "If I don't cheer for {STR_VAR_1},\n" .string "who will?$" -LilycoveCity_PokemonTrainerFanClub_Text_21DC68: @ 821DC68 +LilycoveCity_PokemonTrainerFanClub_Text_YouChangedMyMind: @ 821DC68 .string "You've changed my mind!\n" .string "You are strong, aren't you?\p" .string "I'd like you to tell me how you managed\n" .string "to get so strong!$" -LilycoveCity_PokemonTrainerFanClub_Text_21DCD6: @ 821DCD6 +LilycoveCity_PokemonTrainerFanClub_Text_YouBattleAttractivelyInToughSituation: @ 821DCD6 .string "The tougher the situation, the more\n" .string "attractively you battle.\p" .string "I can't wait for your next battle!$" -LilycoveCity_PokemonTrainerFanClub_Text_21DD36: @ 821DD36 +LilycoveCity_PokemonTrainerFanClub_Text_TrainerIsStandout: @ 821DD36 .string "Among the recently hot TRAINERS,\n" .string "{STR_VAR_1} is the standout.\p" .string "That toughness, it's simply not normal.\p" .string "You're doing okay, but you're not in\n" .string "the same class as {STR_VAR_1}.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DDCE: @ 821DDCE +LilycoveCity_PokemonTrainerFanClub_Text_NoOneCanKnockYouButTrainerStronger: @ 821DDCE .string "You are really popular…\p" .string "You're strong, and you're caring to\n" .string "POKéMON. No one can knock you.\p" @@ -844,13 +850,13 @@ LilycoveCity_PokemonTrainerFanClub_Text_OnlyIRecognizeYourTrueWorth: @ 821DE83 .string "The others I doubt will understand\n" .string "the hidden power that beats within.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DEFF: @ 821DEFF +LilycoveCity_PokemonTrainerFanClub_Text_HaventRealizedPotential: @ 821DEFF .string "Yes, I see strength in your eyes.\p" .string "But!\p" .string "You still haven't realized your\n" .string "potential.$" -LilycoveCity_PokemonTrainerFanClub_Text_21DF51: @ 821DF51 +LilycoveCity_PokemonTrainerFanClub_Text_YourePowerfulButNotTrueStrength: @ 821DF51 .string "It is true that you are tremendously\n" .string "powerful.\p" .string "But!\n" diff --git a/data/specials.inc b/data/specials.inc index bfc88f619..4b23995f2 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -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 diff --git a/include/constants/field_specials.h b/include/constants/field_specials.h index 81c173f75..5dde18058 100644 --- a/include/constants/field_specials.h +++ b/include/constants/field_specials.h @@ -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 diff --git a/include/constants/vars.h b/include/constants/vars.h index c2865a37a..d39323831 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.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 diff --git a/include/field_specials.h b/include/field_specials.h index 3529290a6..a4d53a9a6 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -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); diff --git a/include/tv.h b/include/tv.h index 8b37116de..4027c3c0f 100644 --- a/include/tv.h +++ b/include/tv.h @@ -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); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 33c5f661b..eab7b7d04 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4555,7 +4555,7 @@ static void Cmd_moveend(void) case MOVEEND_CHOICE_MOVE: // update choice band move if (gHitMarker & HITMARKER_OBEYS && holdEffectAtk == HOLD_EFFECT_CHOICE_BAND - && gChosenMove != MOVE_STRUGGLE + && gChosenMove != MOVE_STRUGGLE && (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF)) { if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED)) @@ -7826,7 +7826,7 @@ static void Cmd_weatherdamage(void) gBattleMoveDamage = 0; } } - if (gBattleWeather & WEATHER_HAIL) + if (gBattleWeather & WEATHER_HAIL_ANY) { if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE) && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND) diff --git a/src/cable_club.c b/src/cable_club.c index ab61d65a9..b1675030b 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -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) { diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index 4e4b8afed..872aed14e 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -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; } } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 41b7a4dbf..8b4c7380c 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -30,6 +30,7 @@ #include "wild_encounter.h" #include "constants/bg_event_constants.h" #include "constants/event_objects.h" +#include "constants/field_poison.h" #include "constants/map_types.h" #include "constants/maps.h" #include "constants/songs.h" @@ -647,11 +648,11 @@ static bool8 UpdatePoisonStepCounter(void) { switch (DoPoisonFieldEffect()) { - case 0: + case FLDPSN_NONE: return FALSE; - case 1: + case FLDPSN_PSN: return FALSE; - case 2: + case FLDPSN_FNT: return TRUE; } } diff --git a/src/field_specials.c b/src/field_specials.c index 57e0d087a..830c2246d 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -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); } diff --git a/src/pokedex.c b/src/pokedex.c index 0b04ae3b9..2aa5e30ea 100644 --- a/src/pokedex.c +++ b/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); diff --git a/src/pokemon.c b/src/pokemon.c index 4d14e61c2..376f400e6 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3271,7 +3271,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de } // any weather except sun weakens solar beam - if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL)) && gCurrentMove == MOVE_SOLAR_BEAM) + if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL_ANY)) && gCurrentMove == MOVE_SOLAR_BEAM) damage /= 2; // sunny diff --git a/src/secret_base.c b/src/secret_base.c index 76dbe7668..b9826a257 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -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; } @@ -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; } |