Reformat compare + goto_if/call_if to single statements

This commit is contained in:
GriffinR
2021-11-18 23:06:30 -05:00
parent c57efdba5d
commit e66ea0cb99
293 changed files with 2990 additions and 5978 deletions
+40 -80
View File
@@ -18,8 +18,7 @@ LilycoveCity_ContestLobby_OnTransition:
LilycoveCity_ContestLobby_EventScript_TryShowBlendMaster::
getpokenewsactive POKENEWS_BLENDMASTER
compare VAR_RESULT, TRUE
goto_if_eq LilycoveCity_ContestLobby_EventScript_ShowBlendMaster
goto_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_ShowBlendMaster
clearflag FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT
setflag FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER
return
@@ -52,10 +51,8 @@ LilycoveCity_ContestLobby_EventScript_ContestArtist::
showcontestpainting CONTEST_WINNER_ARTIST
lockall
msgbox LilycoveCity_ContestLobby_Text_ShouldITakePaintingToMuseum, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum
compare VAR_RESULT, NO
goto_if_eq LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePainting
goto_if_eq VAR_RESULT, YES, LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum
goto_if_eq VAR_RESULT, NO, LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePainting
releaseall
end
@@ -65,8 +62,7 @@ LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum::
special SaveMuseumContestPainting
setvar VAR_LILYCOVE_CONTEST_LOBBY_STATE, 0
specialvar VAR_RESULT, GiveMonArtistRibbon
compare VAR_RESULT, TRUE
call_if_eq LilycoveCity_ContestLobby_EventScript_ReceivedArtistRibbon
call_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_ReceivedArtistRibbon
applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistExit
waitmovement 0
removeobject LOCALID_ARTIST
@@ -77,8 +73,7 @@ LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum::
LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePainting::
msgbox LilycoveCity_ContestLobby_Text_TakeHomeButIdLikeToTakeToMuseum, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum
goto_if_eq VAR_RESULT, YES, LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum
msgbox LilycoveCity_ContestLobby_Text_FineThatsTheWayItIs, MSGBOX_DEFAULT
closemessage
applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistExit
@@ -225,10 +220,8 @@ LilycoveCity_ContestLobby_EventScript_LinkContestArtist::
fadescreen FADE_TO_BLACK
showcontestpainting CONTEST_WINNER_ARTIST
msgbox LilycoveCity_ContestLobby_Text_ShouldITakePaintingToMuseum, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink
compare VAR_RESULT, NO
goto_if_eq LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePaintingLink
goto_if_eq VAR_RESULT, YES, LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink
goto_if_eq VAR_RESULT, NO, LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePaintingLink
end
LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink::
@@ -237,8 +230,7 @@ LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink::
special SaveMuseumContestPainting
setvar VAR_LILYCOVE_CONTEST_LOBBY_STATE, 0
specialvar VAR_RESULT, GiveMonArtistRibbon
compare VAR_RESULT, TRUE
call_if_eq LilycoveCity_ContestLobby_EventScript_ReceivedLinkArtistRibbon
call_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_ReceivedLinkArtistRibbon
applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistExit
waitmovement 0
removeobject LOCALID_ARTIST_LINK
@@ -249,8 +241,7 @@ LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink::
LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePaintingLink::
msgbox LilycoveCity_ContestLobby_Text_TakeHomeButIdLikeToTakeToMuseum, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink
goto_if_eq VAR_RESULT, YES, LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink
msgbox LilycoveCity_ContestLobby_Text_FineThatsTheWayItIs, MSGBOX_DEFAULT
closemessage
applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistExit
@@ -327,8 +318,7 @@ LilycoveCity_ContestLobby_Movement_LinkArtistReturnToPlayer:
LilycoveCity_ContestLobby_EventScript_ContestReceptionist::
special ClearLinkContestFlags
specialvar VAR_RESULT, IsContestDebugActive @ Always FALSE
compare VAR_RESULT, TRUE
goto_if_eq LilycoveCity_ContestLobby_EventScript_SetDebug
goto_if_eq VAR_RESULT, TRUE, LilycoveCity_ContestLobby_EventScript_SetDebug
call LilycoveCity_ContestLobby_EventScript_SpeakToContestReceptionist
call LilycoveCity_ContestLobby_EventScript_LeadToContestHall
special SetContestTrainerGfxIds
@@ -648,11 +638,9 @@ LilycoveCity_ContestLobby_EventScript_AskEnterLinkContest::
LilycoveCity_ContestLobby_EventScript_TryEnterLinkContest::
msgbox LilycoveCity_ContestLobby_Text_ProgressWillBeSaved, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkContest
goto_if_eq VAR_RESULT, NO, LilycoveCity_ContestLobby_EventScript_CancelLinkContest
call Common_EventScript_SaveGame
compare VAR_RESULT, FALSE
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkContest
goto_if_eq VAR_RESULT, FALSE, LilycoveCity_ContestLobby_EventScript_CancelLinkContest
message LilycoveCity_ContestLobby_Text_WhichContestMode
waitmessage
specialvar VAR_TEMP_D, IsWirelessAdapterConnected
@@ -671,8 +659,7 @@ LilycoveCity_ContestLobby_EventScript_EmeraldMode::
LilycoveCity_ContestLobby_EventScript_GlobalMode::
setvar VAR_TEMP_C, 1
compare VAR_TEMP_D, 1
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkNoWirelessGMode
goto_if_eq VAR_TEMP_D, 1, LilycoveCity_ContestLobby_EventScript_CancelLinkNoWirelessGMode
goto LilycoveCity_ContestLobby_EventScript_ChooseLinkContestType
end
@@ -724,19 +711,13 @@ LilycoveCity_ContestLobby_EventScript_ChooseLinkContestMon::
msgbox LilycoveCity_ContestLobby_Text_EnterWhichPokemon3, MSGBOX_DEFAULT
setvar VAR_CONTEST_RANK, 0
choosecontestmon
compare VAR_0x8004, PARTY_NOTHING_CHOSEN
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkContest
goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, LilycoveCity_ContestLobby_EventScript_CancelLinkContest
special TryEnterContestMon
compare VAR_RESULT, CANT_ENTER_CONTEST
goto_if_eq LilycoveCity_ContestLobby_EventScript_LinkCantEnterLowRank
compare VAR_RESULT, CAN_ENTER_CONTEST_EQUAL_RANK
goto_if_eq LilycoveCity_ContestLobby_EventScript_EnterMonForLinkContest
compare VAR_RESULT, CAN_ENTER_CONTEST_HIGH_RANK
goto_if_eq LilycoveCity_ContestLobby_EventScript_EnterMonForLinkContest
compare VAR_RESULT, CANT_ENTER_CONTEST_EGG
goto_if_eq LilycoveCity_ContestLobby_EventScript_LinkCantEnterEgg
compare VAR_RESULT, CANT_ENTER_CONTEST_FAINTED
goto_if_eq LilycoveCity_ContestLobby_EventScript_LinkCantEnterFainted
goto_if_eq VAR_RESULT, CANT_ENTER_CONTEST, LilycoveCity_ContestLobby_EventScript_LinkCantEnterLowRank
goto_if_eq VAR_RESULT, CAN_ENTER_CONTEST_EQUAL_RANK, LilycoveCity_ContestLobby_EventScript_EnterMonForLinkContest
goto_if_eq VAR_RESULT, CAN_ENTER_CONTEST_HIGH_RANK, LilycoveCity_ContestLobby_EventScript_EnterMonForLinkContest
goto_if_eq VAR_RESULT, CANT_ENTER_CONTEST_EGG, LilycoveCity_ContestLobby_EventScript_LinkCantEnterEgg
goto_if_eq VAR_RESULT, CANT_ENTER_CONTEST_FAINTED, LilycoveCity_ContestLobby_EventScript_LinkCantEnterFainted
end
LilycoveCity_ContestLobby_EventScript_LinkCantEnterLowRank::
@@ -760,29 +741,19 @@ LilycoveCity_ContestLobby_EventScript_EnterMonForLinkContest::
end
LilycoveCity_ContestLobby_EventScript_TrySetUpLinkContest::
compare VAR_TEMP_D, 1
goto_if_eq LilycoveCity_ContestLobby_EventScript_SetLinkGroupType
compare VAR_TEMP_D, 2
goto_if_ge LilycoveCity_ContestLobby_EventScript_CancelLinkContest
goto_if_eq VAR_TEMP_D, 1, LilycoveCity_ContestLobby_EventScript_SetLinkGroupType
goto_if_ge VAR_TEMP_D, 2, LilycoveCity_ContestLobby_EventScript_CancelLinkContest
message LilycoveCity_ContestLobby_Text_PleaseWaitBButtonCancel
waitmessage
copyvar VAR_0x8004, VAR_RESULT
compare VAR_TEMP_C, 0
call_if_eq LilycoveCity_ContestLobby_EventScript_TryLinkEMode
compare VAR_TEMP_C, 1
call_if_eq LilycoveCity_ContestLobby_EventScript_TryLinkGMode
compare VAR_TEMP_C, 2
goto_if_ge LilycoveCity_ContestLobby_EventScript_CancelLinkContest
compare VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices
compare VAR_RESULT, LINKUP_DIFF_SELECTIONS
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices
compare VAR_RESULT, LINKUP_FAILED
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkContest
compare VAR_RESULT, LINKUP_CONNECTION_ERROR
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkError
compare VAR_RESULT, LINKUP_FAILED_CONTEST_GMODE
goto_if_eq LilycoveCity_ContestLobby_EventScript_CancelLinkModeDifference
call_if_eq VAR_TEMP_C, 0, LilycoveCity_ContestLobby_EventScript_TryLinkEMode
call_if_eq VAR_TEMP_C, 1, LilycoveCity_ContestLobby_EventScript_TryLinkGMode
goto_if_ge VAR_TEMP_C, 2, LilycoveCity_ContestLobby_EventScript_CancelLinkContest
goto_if_eq VAR_RESULT, LINKUP_WRONG_NUM_PLAYERS, LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices
goto_if_eq VAR_RESULT, LINKUP_DIFF_SELECTIONS, LilycoveCity_ContestLobby_EventScript_CancelLinkDifferentChoices
goto_if_eq VAR_RESULT, LINKUP_FAILED, LilycoveCity_ContestLobby_EventScript_CancelLinkContest
goto_if_eq VAR_RESULT, LINKUP_CONNECTION_ERROR, LilycoveCity_ContestLobby_EventScript_CancelLinkError
goto_if_eq VAR_RESULT, LINKUP_FAILED_CONTEST_GMODE, LilycoveCity_ContestLobby_EventScript_CancelLinkModeDifference
messageinstant LilycoveCity_ContestLobby_Text_Transmitting
contestlinktransfer
switch VAR_0x8004
@@ -849,16 +820,11 @@ LilycoveCity_ContestLobby_EventScript_StartLinkContest::
end
LilycoveCity_ContestLobby_EventScript_SetLinkGroupType::
compare VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_COOL
call_if_eq LilycoveCity_ContestLobby_EventScript_SetLinkGroupCoolContest
compare VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_BEAUTY
call_if_eq LilycoveCity_ContestLobby_EventScript_SetLinkGroupBeautyContest
compare VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_CUTE
call_if_eq LilycoveCity_ContestLobby_EventScript_SetLinkGroupCuteContest
compare VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_SMART
call_if_eq LilycoveCity_ContestLobby_EventScript_SetLinkGroupSmartContest
compare VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_TOUGH
call_if_eq LilycoveCity_ContestLobby_EventScript_SetLinkGroupToughContest
call_if_eq VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_COOL, LilycoveCity_ContestLobby_EventScript_SetLinkGroupCoolContest
call_if_eq VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_BEAUTY, LilycoveCity_ContestLobby_EventScript_SetLinkGroupBeautyContest
call_if_eq VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_CUTE, LilycoveCity_ContestLobby_EventScript_SetLinkGroupCuteContest
call_if_eq VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_SMART, LilycoveCity_ContestLobby_EventScript_SetLinkGroupSmartContest
call_if_eq VAR_CONTEST_CATEGORY, CONTEST_CATEGORY_TOUGH, LilycoveCity_ContestLobby_EventScript_SetLinkGroupToughContest
goto LilycoveCity_ContestLobby_EventScript_DecideLinkLeader
end
@@ -895,23 +861,17 @@ LilycoveCity_ContestLobby_EventScript_DecideLinkLeader::
LilycoveCity_ContestLobby_EventScript_TryLeadGroup::
call LilycoveCity_ContestLobby_EventScript_TryBecomeLinkLeader
compare VAR_RESULT, LINKUP_SUCCESS
goto_if_eq LilycoveCity_ContestLobby_EventScript_LinkLeaderDecided
compare VAR_RESULT, LINKUP_FAILED
goto_if_eq LilycoveCity_ContestLobby_EventScript_DecideLinkLeader
compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN
goto_if_eq LilycoveCity_ContestLobby_EventScript_TryLeadGroup
goto_if_eq VAR_RESULT, LINKUP_SUCCESS, LilycoveCity_ContestLobby_EventScript_LinkLeaderDecided
goto_if_eq VAR_RESULT, LINKUP_FAILED, LilycoveCity_ContestLobby_EventScript_DecideLinkLeader
goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, LilycoveCity_ContestLobby_EventScript_TryLeadGroup
release
end
LilycoveCity_ContestLobby_EventScript_TryJoinGroup::
call LilycoveCity_ContestLobby_EventScript_TryJoinLinkGroup
compare VAR_RESULT, LINKUP_SUCCESS
goto_if_eq LilycoveCity_ContestLobby_EventScript_LinkLeaderDecided
compare VAR_RESULT, LINKUP_FAILED
goto_if_eq LilycoveCity_ContestLobby_EventScript_DecideLinkLeader
compare VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN
goto_if_eq LilycoveCity_ContestLobby_EventScript_TryJoinGroup
goto_if_eq VAR_RESULT, LINKUP_SUCCESS, LilycoveCity_ContestLobby_EventScript_LinkLeaderDecided
goto_if_eq VAR_RESULT, LINKUP_FAILED, LilycoveCity_ContestLobby_EventScript_DecideLinkLeader
goto_if_eq VAR_RESULT, LINKUP_RETRY_ROLE_ASSIGN, LilycoveCity_ContestLobby_EventScript_TryJoinGroup
release
end