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

View File

@@ -17,8 +17,7 @@ MauvilleCity_GameCorner_EventScript_CoinsClerk::
faceplayer
msgbox MauvilleCity_GameCorner_Text_ThisIsMauvilleGameCorner, MSGBOX_DEFAULT
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NeedCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NeedCoinCase
message MauvilleCity_GameCorner_Text_WereYouLookingForCoins
waitmessage
showmoneybox 0, 0
@@ -44,11 +43,9 @@ MauvilleCity_GameCorner_EventScript_ChooseCoinsDefault500::
MauvilleCity_GameCorner_EventScript_Buy50Coins::
checkcoins VAR_TEMP_1
compare VAR_TEMP_1, (MAX_COINS + 1 - 50)
goto_if_ge MauvilleCity_GameCorner_EventScript_NoRoomForCoins
goto_if_ge VAR_TEMP_1, (MAX_COINS + 1 - 50), MauvilleCity_GameCorner_EventScript_NoRoomForCoins
checkmoney COINS_PRICE_50
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NotEnoughMoney
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NotEnoughMoney
addcoins 50
removemoney COINS_PRICE_50
updatemoneybox
@@ -62,11 +59,9 @@ MauvilleCity_GameCorner_EventScript_Buy50Coins::
MauvilleCity_GameCorner_EventScript_Buy500Coins::
checkcoins VAR_TEMP_1
compare VAR_TEMP_1, (MAX_COINS + 1 - 500)
goto_if_ge MauvilleCity_GameCorner_EventScript_NoRoomForCoins
goto_if_ge VAR_TEMP_1, (MAX_COINS + 1 - 500), MauvilleCity_GameCorner_EventScript_NoRoomForCoins
checkmoney COINS_PRICE_500
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NotEnoughMoney
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NotEnoughMoney
addcoins 500
removemoney COINS_PRICE_500
updatemoneybox
@@ -109,8 +104,7 @@ MauvilleCity_GameCorner_EventScript_PrizeCornerDolls::
faceplayer
msgbox MauvilleCity_GameCorner_Text_ExchangeCoinsForPrizes, MSGBOX_DEFAULT
checkitem ITEM_COIN_CASE
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_GameCorner_EventScript_ChooseDollPrizeMessage
goto_if_eq VAR_RESULT, TRUE, MauvilleCity_GameCorner_EventScript_ChooseDollPrizeMessage
release
end
@@ -153,8 +147,7 @@ MauvilleCity_GameCorner_EventScript_MudkipDoll::
MauvilleCity_GameCorner_EventScript_ConfirmDollPrize::
msgbox MauvilleCity_GameCorner_Text_SoYourChoiceIsX, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_GameCorner_EventScript_CancelDollSelect
goto_if_eq VAR_RESULT, NO, MauvilleCity_GameCorner_EventScript_CancelDollSelect
switch VAR_TEMP_1
case 1, MauvilleCity_GameCorner_EventScript_BuyTreeckoDoll
case 2, MauvilleCity_GameCorner_EventScript_BuyTorchicDoll
@@ -163,12 +156,10 @@ MauvilleCity_GameCorner_EventScript_ConfirmDollPrize::
MauvilleCity_GameCorner_EventScript_BuyTreeckoDoll::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, DOLL_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForDoll
goto_if_lt VAR_TEMP_2, DOLL_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForDoll
bufferdecorationname STR_VAR_2, DECOR_TREECKO_DOLL
checkdecorspace DECOR_TREECKO_DOLL
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForDoll
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForDoll
removecoins DOLL_COINS
adddecoration DECOR_TREECKO_DOLL
updatecoinsbox 1, 1
@@ -179,12 +170,10 @@ MauvilleCity_GameCorner_EventScript_BuyTreeckoDoll::
MauvilleCity_GameCorner_EventScript_BuyTorchicDoll::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, DOLL_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForDoll
goto_if_lt VAR_TEMP_2, DOLL_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForDoll
bufferdecorationname STR_VAR_2, DECOR_TORCHIC_DOLL
checkdecorspace DECOR_TORCHIC_DOLL
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForDoll
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForDoll
removecoins DOLL_COINS
adddecoration DECOR_TORCHIC_DOLL
updatecoinsbox 1, 1
@@ -195,12 +184,10 @@ MauvilleCity_GameCorner_EventScript_BuyTorchicDoll::
MauvilleCity_GameCorner_EventScript_BuyMudkipDoll::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, DOLL_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForDoll
goto_if_lt VAR_TEMP_2, DOLL_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForDoll
bufferdecorationname STR_VAR_2, DECOR_MUDKIP_DOLL
checkdecorspace DECOR_MUDKIP_DOLL
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForDoll
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForDoll
removecoins DOLL_COINS
adddecoration DECOR_MUDKIP_DOLL
updatecoinsbox 1, 1
@@ -230,8 +217,7 @@ MauvilleCity_GameCorner_EventScript_PrizeCornerTMs::
faceplayer
msgbox MauvilleCity_GameCorner_Text_ExchangeCoinsForPrizes, MSGBOX_DEFAULT
checkitem ITEM_COIN_CASE
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_GameCorner_EventScript_ChooseTMPrizeMessage
goto_if_eq VAR_RESULT, TRUE, MauvilleCity_GameCorner_EventScript_ChooseTMPrizeMessage
release
end
@@ -292,8 +278,7 @@ MauvilleCity_GameCorner_EventScript_TM13::
MauvilleCity_GameCorner_EventScript_ConfirmTMPrize::
special BufferTMHMMoveName
msgbox MauvilleCity_GameCorner_Text_SoYourChoiceIsTheTMX, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_GameCorner_EventScript_CancelTMSelect
goto_if_eq VAR_RESULT, NO, MauvilleCity_GameCorner_EventScript_CancelTMSelect
switch VAR_TEMP_1
case 1, MauvilleCity_GameCorner_EventScript_BuyTM32
case 2, MauvilleCity_GameCorner_EventScript_BuyTM29
@@ -304,11 +289,9 @@ MauvilleCity_GameCorner_EventScript_ConfirmTMPrize::
MauvilleCity_GameCorner_EventScript_BuyTM32::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, TM32_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
goto_if_lt VAR_TEMP_2, TM32_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
checkitemspace ITEM_TM32
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForTM
removecoins TM32_COINS
additem ITEM_TM32
updatecoinsbox 1, 1
@@ -319,11 +302,9 @@ MauvilleCity_GameCorner_EventScript_BuyTM32::
MauvilleCity_GameCorner_EventScript_BuyTM29::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, TM29_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
goto_if_lt VAR_TEMP_2, TM29_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
checkitemspace ITEM_TM29
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForTM
removecoins TM29_COINS
additem ITEM_TM29
updatecoinsbox 1, 1
@@ -334,11 +315,9 @@ MauvilleCity_GameCorner_EventScript_BuyTM29::
MauvilleCity_GameCorner_EventScript_BuyTM35::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, TM35_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
goto_if_lt VAR_TEMP_2, TM35_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
checkitemspace ITEM_TM35
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForTM
removecoins TM35_COINS
additem ITEM_TM35
updatecoinsbox 1, 1
@@ -349,11 +328,9 @@ MauvilleCity_GameCorner_EventScript_BuyTM35::
MauvilleCity_GameCorner_EventScript_BuyTM24::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, TM24_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
goto_if_lt VAR_TEMP_2, TM24_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
checkitemspace ITEM_TM24
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForTM
removecoins TM24_COINS
additem ITEM_TM24
updatecoinsbox 1, 1
@@ -364,11 +341,9 @@ MauvilleCity_GameCorner_EventScript_BuyTM24::
MauvilleCity_GameCorner_EventScript_BuyTM13::
checkcoins VAR_TEMP_2
compare VAR_TEMP_2, TM13_COINS
goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
goto_if_lt VAR_TEMP_2, TM13_COINS, MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
checkitemspace ITEM_TM13
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForTM
removecoins TM13_COINS
additem ITEM_TM13
updatecoinsbox 1, 1
@@ -406,8 +381,7 @@ MauvilleCity_GameCorner_EventScript_Girl::
faceplayer
goto_if_set FLAG_RECEIVED_STARTER_DOLL, MauvilleCity_GameCorner_EventScript_ReceivedStarterDoll
msgbox MauvilleCity_GameCorner_Text_GotTwoOfSameDollWantOne, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq MauvilleCity_GameCorner_EventScript_DeclineStarterDoll
goto_if_eq VAR_RESULT, NO, MauvilleCity_GameCorner_EventScript_DeclineStarterDoll
switch VAR_STARTER_MON
case 0, MauvilleCity_GameCorner_EventScript_GiveTreeckoDoll
case 1, MauvilleCity_GameCorner_EventScript_GiveTorchicDoll
@@ -417,8 +391,7 @@ MauvilleCity_GameCorner_EventScript_Girl::
MauvilleCity_GameCorner_EventScript_GiveTreeckoDoll::
bufferdecorationname STR_VAR_2, DECOR_TREECKO_DOLL
checkdecorspace DECOR_TREECKO_DOLL
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForStarterDoll
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForStarterDoll
msgbox MauvilleCity_GameCorner_Text_HereYouGo2, MSGBOX_DEFAULT
givedecoration DECOR_TREECKO_DOLL
setflag FLAG_RECEIVED_STARTER_DOLL
@@ -428,8 +401,7 @@ MauvilleCity_GameCorner_EventScript_GiveTreeckoDoll::
MauvilleCity_GameCorner_EventScript_GiveTorchicDoll::
bufferdecorationname STR_VAR_2, DECOR_TORCHIC_DOLL
checkdecorspace DECOR_TORCHIC_DOLL
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForStarterDoll
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForStarterDoll
msgbox MauvilleCity_GameCorner_Text_HereYouGo2, MSGBOX_DEFAULT
givedecoration DECOR_TORCHIC_DOLL
setflag FLAG_RECEIVED_STARTER_DOLL
@@ -439,8 +411,7 @@ MauvilleCity_GameCorner_EventScript_GiveTorchicDoll::
MauvilleCity_GameCorner_EventScript_GiveMudkipDoll::
bufferdecorationname STR_VAR_2, DECOR_MUDKIP_DOLL
checkdecorspace DECOR_MUDKIP_DOLL
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForStarterDoll
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoRoomForStarterDoll
msgbox MauvilleCity_GameCorner_Text_HereYouGo2, MSGBOX_DEFAULT
givedecoration DECOR_MUDKIP_DOLL
setflag FLAG_RECEIVED_STARTER_DOLL
@@ -467,8 +438,7 @@ MauvilleCity_GameCorner_EventScript_PokefanM::
lock
faceplayer
checkitem ITEM_COIN_CASE
compare VAR_RESULT, TRUE
goto_if_eq MauvilleCity_GameCorner_EventScript_TryGive20Coins
goto_if_eq VAR_RESULT, TRUE, MauvilleCity_GameCorner_EventScript_TryGive20Coins
msgbox MauvilleCity_GameCorner_Text_NeedCoinCaseGoNextDoor, MSGBOX_DEFAULT
goto MauvilleCity_GameCorner_EventScript_NPCReturnToSlots
end
@@ -476,8 +446,7 @@ MauvilleCity_GameCorner_EventScript_PokefanM::
MauvilleCity_GameCorner_EventScript_TryGive20Coins::
goto_if_set FLAG_RECEIVED_20_COINS, MauvilleCity_GameCorner_EventScript_PokefanMNormal
checkcoins VAR_TEMP_1
compare VAR_TEMP_1, 1 @ Only give 20 coins if player has no coins
goto_if_ge MauvilleCity_GameCorner_EventScript_PokefanMNormal
goto_if_ge VAR_TEMP_1, 1, MauvilleCity_GameCorner_EventScript_PokefanMNormal @ Only give 20 coins if player has no coins
setflag FLAG_RECEIVED_20_COINS
addcoins 20
msgbox MauvilleCity_GameCorner_Text_LuckOnlyLastSoLongTakeCoins, MSGBOX_DEFAULT
@@ -535,8 +504,7 @@ MauvilleCity_GameCorner_EventScript_Woman::
MauvilleCity_GameCorner_EventScript_SlotMachine0::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 0
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -546,8 +514,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine0::
MauvilleCity_GameCorner_EventScript_SlotMachine1::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 1
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -557,8 +524,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine1::
MauvilleCity_GameCorner_EventScript_SlotMachine2::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 2
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -568,8 +534,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine2::
MauvilleCity_GameCorner_EventScript_SlotMachine3::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 3
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -579,8 +544,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine3::
MauvilleCity_GameCorner_EventScript_SlotMachine4::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 4
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -590,8 +554,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine4::
MauvilleCity_GameCorner_EventScript_SlotMachine5::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 5
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -601,8 +564,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine5::
MauvilleCity_GameCorner_EventScript_SlotMachine6::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 6
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -612,8 +574,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine6::
MauvilleCity_GameCorner_EventScript_SlotMachine7::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 7
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -623,8 +584,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine7::
MauvilleCity_GameCorner_EventScript_SlotMachine8::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 8
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -634,8 +594,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine8::
MauvilleCity_GameCorner_EventScript_SlotMachine9::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 9
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -645,8 +604,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine9::
MauvilleCity_GameCorner_EventScript_SlotMachine10::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 10
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT
@@ -656,8 +614,7 @@ MauvilleCity_GameCorner_EventScript_SlotMachine10::
MauvilleCity_GameCorner_EventScript_SlotMachine11::
lockall
checkitem ITEM_COIN_CASE
compare VAR_RESULT, FALSE
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
goto_if_eq VAR_RESULT, FALSE, MauvilleCity_GameCorner_EventScript_NoCoinCase
setvar VAR_0x8004, 11
specialvar VAR_RESULT, GetSlotMachineId
playslotmachine VAR_RESULT