diff options
author | GriffinR <griffin.richards@comcast.net> | 2019-11-17 17:34:11 -0500 |
---|---|---|
committer | huderlem <huderlem@gmail.com> | 2019-11-20 09:08:24 -0600 |
commit | 5c5c1836bbfb5bb98b11f60fdefe39773d1a9015 (patch) | |
tree | 45c056ff93ca2b79971bd61544a6f8f1a12ed418 | |
parent | c455fcfa5992d657fde4ee66b827fd4c4f9fb5e6 (diff) |
Document Trainer Fan Club
-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 | 500 | ||||
-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/cable_club.c | 2 | ||||
-rw-r--r-- | src/contest_link_80F57C4.c | 4 | ||||
-rw-r--r-- | src/field_specials.c | 291 | ||||
-rw-r--r-- | src/secret_base.c | 2 | ||||
-rw-r--r-- | src/tv.c | 13 |
15 files changed, 480 insertions, 400 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..f373b72a4 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,437 +63,439 @@ 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 + 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_21D12A, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D094, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA70:: @ 821CA70 +LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyFan:: @ 821CA70 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D0BB, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA7A:: @ 821CA7A +LilycoveCity_PokemonTrainerFanClub_EventScript_ManOnlyNonFan:: @ 821CA7A msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D1B5, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CA84:: @ 821CA84 +LilycoveCity_PokemonTrainerFanClub_EventScript_ManPlayerNotChampion:: @ 821CA84 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D20C, 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 + 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_21D347, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D2A6, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CAE7:: @ 821CAE7 +LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyFan:: @ 821CAE7 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D2CE, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CAF1:: @ 821CAF1 +LilycoveCity_PokemonTrainerFanClub_EventScript_LassOnlyNonFan:: @ 821CAF1 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D377, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CAFB:: @ 821CAFB +LilycoveCity_PokemonTrainerFanClub_EventScript_LassPlayerNotChampion:: @ 821CAFB msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D3EE, 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 + 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_21D52E, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D438, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB5E:: @ 821CB5E +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyFan:: @ 821CB5E msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D4A3, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB68:: @ 821CB68 +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMOnlyNonFan:: @ 821CB68 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D5DC, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CB72:: @ 821CB72 +LilycoveCity_PokemonTrainerFanClub_EventScript_PokefanMPlayerNotChampion:: @ 821CB72 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D69C, 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 + 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_21D822, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D751, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBD5:: @ 821CBD5 +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyFan:: @ 821CBD5 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D79B, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBDF:: @ 821CBDF +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlOnlyNonFan:: @ 821CBDF msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D857, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CBE9:: @ 821CBE9 +LilycoveCity_PokemonTrainerFanClub_EventScript_LittleGirlPlayerNotChampion:: @ 821CBE9 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D8C4, 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 + 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_21D9D1, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D921, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC41:: @ 821CC41 +LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyFan:: @ 821CC41 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21D96A, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CC4B:: @ 821CC4B +LilycoveCity_PokemonTrainerFanClub_EventScript_NinjaBoyOnlyNonFan:: @ 821CC4B msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DA0D, 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 + 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_21DB69, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DA73, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CCA3:: @ 821CCA3 +LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyFan:: @ 821CCA3 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DAF5, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CCAD:: @ 821CCAD +LilycoveCity_PokemonTrainerFanClub_EventScript_BoyOnlyNonFan:: @ 821CCAD msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DBFB, 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 + 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_21DD36, 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 + goto_if_eq LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyFan msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DC68, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD05:: @ 821CD05 +LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyFan:: @ 821CD05 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DCD6, MSGBOX_DEFAULT release end -LilycoveCity_PokemonTrainerFanClub_EventScript_21CD0F:: @ 821CD0F +LilycoveCity_PokemonTrainerFanClub_EventScript_WomanOnlyNonFan:: @ 821CD0F msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DDCE, 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 + 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_21DEFF, 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 +LilycoveCity_PokemonTrainerFanClub_EventScript_ExpertFOnlyNonFan:: @ 821CD71 msgbox LilycoveCity_PokemonTrainerFanClub_Text_21DF51, MSGBOX_DEFAULT release end @@ -509,8 +513,8 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_Interview:: @ 821CD90 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 +533,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 +543,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 +558,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 +578,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 +588,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 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..e96bb53bf 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 // First 7 bits are a counter for adding new fans, bit 8 is a flag set after first gaining fans, and bits 9-16 are flags set for each of the 8 fans when they like the player +#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/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_specials.c b/src/field_specials.c index 57e0d087a..3ab45cd75 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) + + ## 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/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; } |