goto_if_eq and switch/case in scripts

This commit is contained in:
PikalaxALT
2019-05-16 13:30:03 -04:00
parent 006881415d
commit a2d1b854d6
150 changed files with 999 additions and 1231 deletions
@@ -7,10 +7,10 @@ CinnabarIsland_PokemonLab_ExperimentRoom_EventScript_16E401:: @ 816E401
setvar VAR_0x8008, 8
call EventScript_1A8CAD
checkflag FLAG_0x276
goto_if 1, EventScript_16E473
goto_if_eq EventScript_16E473
msgbox gUnknown_81A597B, MSGBOX_YESNO
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E45B
goto_if_eq EventScript_16E45B
call EventScript_1A8CBD
compare_var_to_value VAR_0x8004, 6
goto_if 4, EventScript_16E45B
@@ -46,20 +46,20 @@ CinnabarIsland_PokemonLab_ExperimentRoom_EventScript_16E47D:: @ 816E47D
checkflag FLAG_0x2EE
call_if 1, EventScript_16E8A1
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E897
goto_if_eq EventScript_16E897
compare_var_to_value VAR_0x406A, 2
goto_if 1, EventScript_16E736
goto_if_eq EventScript_16E736
compare_var_to_value VAR_0x406A, 1
goto_if 1, EventScript_16E72C
goto_if_eq EventScript_16E72C
call EventScript_16E4EC
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E544
goto_if_eq EventScript_16E544
call EventScript_16E504
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E586
goto_if_eq EventScript_16E586
call EventScript_16E51C
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E5C8
goto_if_eq EventScript_16E5C8
msgbox gUnknown_819A282
goto EventScript_16E53A
end
@@ -68,7 +68,7 @@ EventScript_16E4EC:: @ 816E4EC
checkflag FLAG_0x273
goto_if 0, EventScript_16E534
checkflag FLAG_0x2ED
goto_if 1, EventScript_16E534
goto_if_eq EventScript_16E534
setvar VAR_RESULT, 1
return
@@ -76,7 +76,7 @@ EventScript_16E504:: @ 816E504
checkflag FLAG_0x272
goto_if 0, EventScript_16E534
checkflag FLAG_0x2EC
goto_if 1, EventScript_16E534
goto_if_eq EventScript_16E534
setvar VAR_RESULT, 1
return
@@ -84,7 +84,7 @@ EventScript_16E51C:: @ 816E51C
checkflag FLAG_0x25E
goto_if 0, EventScript_16E534
checkflag FLAG_0x2EE
goto_if 1, EventScript_16E534
goto_if_eq EventScript_16E534
setvar VAR_RESULT, 1
return
@@ -102,15 +102,12 @@ EventScript_16E544:: @ 816E544
waitmessage
call EventScript_16E51C
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E5FA
goto_if_eq EventScript_16E5FA
multichoice 0, 0, 21, 0
copyvar VAR_0x8000, VAR_RESULT
compare_var_to_value VAR_0x8000, 0
goto_if 1, EventScript_16E668
compare_var_to_value VAR_0x8000, 1
goto_if 1, EventScript_16E53A
compare_var_to_value VAR_0x8000, 127
goto_if 1, EventScript_16E53A
switch VAR_RESULT
case 0, EventScript_16E668
case 1, EventScript_16E53A
case 127, EventScript_16E53A
end
EventScript_16E586:: @ 816E586
@@ -118,54 +115,40 @@ EventScript_16E586:: @ 816E586
waitmessage
call EventScript_16E51C
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E631
goto_if_eq EventScript_16E631
multichoice 0, 0, 22, 0
copyvar VAR_0x8000, VAR_RESULT
compare_var_to_value VAR_0x8000, 0
goto_if 1, EventScript_16E6A6
compare_var_to_value VAR_0x8000, 1
goto_if 1, EventScript_16E53A
compare_var_to_value VAR_0x8000, 127
goto_if 1, EventScript_16E53A
switch VAR_RESULT
case 0, EventScript_16E6A6
case 1, EventScript_16E53A
case 127, EventScript_16E53A
end
EventScript_16E5C8:: @ 816E5C8
message Text_19A282
waitmessage
multichoice 0, 0, 23, 0
copyvar VAR_0x8000, VAR_RESULT
compare_var_to_value VAR_0x8000, 0
goto_if 1, EventScript_16E6E4
compare_var_to_value VAR_0x8000, 1
goto_if 1, EventScript_16E53A
compare_var_to_value VAR_0x8000, 127
goto_if 1, EventScript_16E53A
switch VAR_RESULT
case 0, EventScript_16E6E4
case 1, EventScript_16E53A
case 127, EventScript_16E53A
end
EventScript_16E5FA:: @ 816E5FA
multichoice 0, 0, 24, 0
copyvar VAR_0x8000, VAR_RESULT
compare_var_to_value VAR_0x8000, 0
goto_if 1, EventScript_16E668
compare_var_to_value VAR_0x8000, 1
goto_if 1, EventScript_16E6E4
compare_var_to_value VAR_0x8000, 2
goto_if 1, EventScript_16E53A
compare_var_to_value VAR_0x8000, 127
goto_if 1, EventScript_16E53A
switch VAR_RESULT
case 0, EventScript_16E668
case 1, EventScript_16E6E4
case 2, EventScript_16E53A
case 127, EventScript_16E53A
end
EventScript_16E631:: @ 816E631
multichoice 0, 0, 25, 0
copyvar VAR_0x8000, VAR_RESULT
compare_var_to_value VAR_0x8000, 0
goto_if 1, EventScript_16E6A6
compare_var_to_value VAR_0x8000, 1
goto_if 1, EventScript_16E6E4
compare_var_to_value VAR_0x8000, 2
goto_if 1, EventScript_16E53A
compare_var_to_value VAR_0x8000, 127
goto_if 1, EventScript_16E53A
switch VAR_RESULT
case 0, EventScript_16E6A6
case 1, EventScript_16E6E4
case 2, EventScript_16E53A
case 127, EventScript_16E53A
end
EventScript_16E668:: @ 816E668
@@ -173,7 +156,7 @@ EventScript_16E668:: @ 816E668
getitemname 1, ITEM_HELIX_FOSSIL
msgbox gUnknown_819A3D4, MSGBOX_YESNO
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E722
goto_if_eq EventScript_16E722
msgbox gUnknown_819A45D
textcolor 0
removeitem ITEM_HELIX_FOSSIL, 1
@@ -188,7 +171,7 @@ EventScript_16E6A6:: @ 816E6A6
getitemname 1, ITEM_DOME_FOSSIL
msgbox gUnknown_819A3D4, MSGBOX_YESNO
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E722
goto_if_eq EventScript_16E722
msgbox gUnknown_819A45D
textcolor 0
removeitem ITEM_DOME_FOSSIL, 1
@@ -203,7 +186,7 @@ EventScript_16E6E4:: @ 816E6E4
getitemname 1, ITEM_OLD_AMBER
msgbox gUnknown_819A3D4, MSGBOX_YESNO
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E722
goto_if_eq EventScript_16E722
msgbox gUnknown_819A45D
textcolor 0
removeitem ITEM_OLD_AMBER, 1
@@ -225,11 +208,11 @@ EventScript_16E72C:: @ 816E72C
EventScript_16E736:: @ 816E736
compare_var_to_value VAR_0x4069, 1
goto_if 1, EventScript_16E758
goto_if_eq EventScript_16E758
compare_var_to_value VAR_0x4069, 2
goto_if 1, EventScript_16E79D
goto_if_eq EventScript_16E79D
compare_var_to_value VAR_0x4069, 3
goto_if 1, EventScript_16E7E2
goto_if_eq EventScript_16E7E2
end
EventScript_16E758:: @ 816E758
@@ -238,12 +221,12 @@ EventScript_16E758:: @ 816E758
msgbox gUnknown_819A34F
givemon SPECIES_OMANYTE, 5, ITEM_NONE, 0, 0, 0
compare_var_to_value VAR_RESULT, 2
goto_if 1, EventScript_1A927C
goto_if_eq EventScript_1A927C
setflag FLAG_0x2ED
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E827
goto_if_eq EventScript_16E827
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E85B
goto_if_eq EventScript_16E85B
end
EventScript_16E79D:: @ 816E79D
@@ -252,12 +235,12 @@ EventScript_16E79D:: @ 816E79D
msgbox gUnknown_819A34F
givemon SPECIES_KABUTO, 5, ITEM_NONE, 0, 0, 0
compare_var_to_value VAR_RESULT, 2
goto_if 1, EventScript_1A927C
goto_if_eq EventScript_1A927C
setflag FLAG_0x2EC
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E827
goto_if_eq EventScript_16E827
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E85B
goto_if_eq EventScript_16E85B
end
EventScript_16E7E2:: @ 816E7E2
@@ -266,12 +249,12 @@ EventScript_16E7E2:: @ 816E7E2
msgbox gUnknown_819A34F
givemon SPECIES_AERODACTYL, 5, ITEM_NONE, 0, 0, 0
compare_var_to_value VAR_RESULT, 2
goto_if 1, EventScript_1A927C
goto_if_eq EventScript_1A927C
setflag FLAG_0x2EE
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E827
goto_if_eq EventScript_16E827
compare_var_to_value VAR_RESULT, 1
goto_if 1, EventScript_16E85B
goto_if_eq EventScript_16E85B
end
EventScript_16E827:: @ 816E827
@@ -283,7 +266,7 @@ EventScript_16E827:: @ 816E827
setvar VAR_0x406A, 0
msgbox gUnknown_81A56A7, MSGBOX_YESNO
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E895
goto_if_eq EventScript_16E895
call EventScript_1A8C27
call EventScript_1A74EB
goto EventScript_16E895
@@ -298,7 +281,7 @@ EventScript_16E85B:: @ 816E85B
setvar VAR_0x406A, 0
msgbox gUnknown_81A56A7, MSGBOX_YESNO
compare_var_to_value VAR_RESULT, 0
goto_if 1, EventScript_16E88A
goto_if_eq EventScript_16E88A
call EventScript_1A8C33
goto EventScript_16E88A
end
@@ -319,9 +302,9 @@ EventScript_16E897:: @ 816E897
EventScript_16E8A1:: @ 816E8A1
checkflag FLAG_0x273
goto_if 1, EventScript_16E8B9
goto_if_eq EventScript_16E8B9
checkflag FLAG_0x272
goto_if 1, EventScript_16E8C8
goto_if_eq EventScript_16E8C8
goto EventScript_16E534
end