diff options
author | Melody <melody@pallet.town> | 2018-12-21 20:28:24 -0500 |
---|---|---|
committer | Melody <melody@pallet.town> | 2018-12-21 20:28:24 -0500 |
commit | ac2e4adf2da2f30a741556e20e5bc9a494997581 (patch) | |
tree | 1a05a202cfece044d546094581d8463a9b6e452c /data/maps/Route104/scripts.inc | |
parent | 87fd6b8dc21b37b656f16e3f11832c6951328750 (diff) |
improve goto_if macros
Diffstat (limited to 'data/maps/Route104/scripts.inc')
-rw-r--r-- | data/maps/Route104/scripts.inc | 99 |
1 files changed, 39 insertions, 60 deletions
diff --git a/data/maps/Route104/scripts.inc b/data/maps/Route104/scripts.inc index c6f019edb..c2862514e 100644 --- a/data/maps/Route104/scripts.inc +++ b/data/maps/Route104/scripts.inc @@ -19,10 +19,8 @@ Route104_MapScript1_1ECC4E: @ 81ECC4E end Route104_EventScript_1ECC5E:: @ 81ECC5E - checkflag FLAG_0x07F - goto_if 0, Route104_EventScript_1ECC74 - checkflag FLAG_BADGE03_GET - goto_if 0, Route104_EventScript_1ECC74 + goto_if_unset FLAG_0x07F, Route104_EventScript_1ECC74 + goto_if_unset FLAG_BADGE03_GET, Route104_EventScript_1ECC74 clearflag FLAG_HIDE_ROUTE_104_WHITE_HERB_FLORIST return @@ -32,11 +30,9 @@ Route104_EventScript_1ECC74:: @ 81ECC74 Route104_EventScript_1ECC78:: @ 81ECC78 compare VAR_0x408E, 1 - goto_if 4, Route104_EventScript_1ECC9D - checkflag FLAG_0x120 - goto_eq Route104_EventScript_1ECC9D - checkflag FLAG_0x07C - goto_if 0, Route104_EventScript_1ECC9D + goto_if_ge Route104_EventScript_1ECC9D + goto_if_set FLAG_0x120, Route104_EventScript_1ECC9D + goto_if_unset FLAG_0x07C, Route104_EventScript_1ECC9D setobjectxyperm 34, 17, 52 return @@ -77,9 +73,9 @@ Route104_EventScript_1ECCB3:: @ 81ECCB3 Route104_EventScript_1ECD11:: @ 81ECD11 checkplayergender compare VAR_RESULT, 0 - goto_eq Route104_EventScript_1ECD29 + goto_if_eq Route104_EventScript_1ECD29 compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ECD2E + goto_if_eq Route104_EventScript_1ECD2E return Route104_EventScript_1ECD29:: @ 81ECD29 @@ -93,16 +89,14 @@ Route104_EventScript_1ECD2E:: @ 81ECD2E Route104_EventScript_1ECD33:: @ 81ECD33 checkplayergender compare VAR_RESULT, 0 - goto_eq Route104_EventScript_1ECD4B + goto_if_eq Route104_EventScript_1ECD4B compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ECE6F + goto_if_eq Route104_EventScript_1ECE6F end Route104_EventScript_1ECD4B:: @ 81ECD4B - checkflag FLAG_0x07D - goto_eq Route104_EventScript_1ECE1C - checkflag FLAG_0x07C - goto_eq Route104_EventScript_1ECDD0 + goto_if_set FLAG_0x07D, Route104_EventScript_1ECE1C + goto_if_set FLAG_0x07C, Route104_EventScript_1ECDD0 setflag FLAG_0x07C msgbox Route104_Text_1EDBFF, MSGBOX_DEFAULT closemessage @@ -123,7 +117,7 @@ Route104_EventScript_1ECD4B:: @ 81ECD4B moveobjectoffscreen 34 msgbox Route104_Text_1EDCED, MSGBOX_YESNO compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ECDED + goto_if_eq Route104_EventScript_1ECDED msgbox Route104_Text_1EDD2A, MSGBOX_DEFAULT call Route104_EventScript_1ECE31 releaseall @@ -146,7 +140,7 @@ Route104_Movement_1ECDCD: @ 81ECDCD Route104_EventScript_1ECDD0:: @ 81ECDD0 msgbox Route104_Text_1EDD9F, MSGBOX_YESNO compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ECDED + goto_if_eq Route104_EventScript_1ECDED msgbox Route104_Text_1EDD2A, MSGBOX_DEFAULT releaseall end @@ -190,10 +184,8 @@ Route104_EventScript_1ECE5C:: @ 81ECE5C end Route104_EventScript_1ECE6F:: @ 81ECE6F - checkflag FLAG_0x07D - goto_eq Route104_EventScript_1ECF38 - checkflag FLAG_0x07C - goto_eq Route104_EventScript_1ECEEC + goto_if_set FLAG_0x07D, Route104_EventScript_1ECF38 + goto_if_set FLAG_0x07C, Route104_EventScript_1ECEEC setflag FLAG_0x07C msgbox Route104_Text_1EDF04, MSGBOX_DEFAULT closemessage @@ -214,7 +206,7 @@ Route104_EventScript_1ECE6F:: @ 81ECE6F moveobjectoffscreen 34 msgbox Route104_Text_1EE009, MSGBOX_YESNO compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ECF09 + goto_if_eq Route104_EventScript_1ECF09 msgbox Route104_Text_1EE04D, MSGBOX_DEFAULT call Route104_EventScript_1ECE31 releaseall @@ -223,7 +215,7 @@ Route104_EventScript_1ECE6F:: @ 81ECE6F Route104_EventScript_1ECEEC:: @ 81ECEEC msgbox Route104_Text_1EE094, MSGBOX_YESNO compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ECF09 + goto_if_eq Route104_EventScript_1ECF09 msgbox Route104_Text_1EE04D, MSGBOX_DEFAULT releaseall end @@ -274,12 +266,11 @@ Route104_Movement_1ECF8A: @ 81ECF8A Route104_EventScript_1ECF8C:: @ 81ECF8C lock faceplayer - checkflag FLAG_0x0F6 - goto_eq Route104_EventScript_1ECFC3 + goto_if_set FLAG_0x0F6, Route104_EventScript_1ECFC3 msgbox Route104_Text_2A6D86, MSGBOX_DEFAULT giveitem_std ITEM_CHESTO_BERRY compare VAR_RESULT, 0 - goto_eq Route104_EventScript_272054 + goto_if_eq Route104_EventScript_272054 setflag FLAG_0x0F6 msgbox Route104_Text_2A6E32, MSGBOX_DEFAULT release @@ -293,12 +284,11 @@ Route104_EventScript_1ECFC3:: @ 81ECFC3 Route104_EventScript_1ECFCD:: @ 81ECFCD lock faceplayer - checkflag FLAG_0x117 - goto_eq Route104_EventScript_1ECFFC + goto_if_set FLAG_0x117, Route104_EventScript_1ECFFC msgbox Route104_Text_1ED96A, MSGBOX_DEFAULT giveitem_std ITEM_WHITE_HERB compare VAR_RESULT, 0 - goto_eq Route104_EventScript_272054 + goto_if_eq Route104_EventScript_272054 setflag FLAG_0x117 release end @@ -347,12 +337,11 @@ Route104_EventScript_1ED04E:: @ 81ED04E Route104_EventScript_1ED057:: @ 81ED057 lock faceplayer - checkflag FLAG_0x106 - goto_eq Route104_EventScript_1ED086 + goto_if_set FLAG_0x106, Route104_EventScript_1ED086 msgbox Route104_Text_1ED838, MSGBOX_DEFAULT giveitem_std ITEM_TM09 compare VAR_RESULT, 0 - goto_eq Route104_EventScript_272054 + goto_if_eq Route104_EventScript_272054 setflag FLAG_0x106 release end @@ -376,10 +365,8 @@ Route104_EventScript_1ED099:: @ 81ED099 waitmovement 0 hideobjectat 255, MAP_ROUTE104 call Route104_EventScript_2720A0 - checkflag FLAG_0x132 - goto_eq Route104_EventScript_1ED0D9 - checkflag FLAG_0x132 - goto_if 0, Route104_EventScript_1ED0EF + goto_if_set FLAG_0x132, Route104_EventScript_1ED0D9 + goto_if_unset FLAG_0x132, Route104_EventScript_1ED0EF end Route104_EventScript_1ED0D9:: @ 81ED0D9 @@ -431,10 +418,8 @@ Route104_EventScript_1ED139:: @ 81ED139 resetobjectpriority 2, MAP_DEWFORD_TOWN moveobjectoffscreen 2 setvar VAR_0x408E, 0 - checkflag FLAG_0x0BD - goto_if 0, Route104_EventScript_1ED1B4 - checkflag FLAG_0x0BD - goto_eq Route104_EventScript_1ED1BE + goto_if_unset FLAG_0x0BD, Route104_EventScript_1ED1B4 + goto_if_set FLAG_0x0BD, Route104_EventScript_1ED1BE end Route104_EventScript_1ED1B4:: @ 81ED1B4 @@ -884,11 +869,11 @@ Route104_EventScript_1ED38D:: @ 81ED38D trainerbattle_single TRAINER_HALEY_1, Route104_Text_29563A, Route104_Text_29566F, Route104_EventScript_1ED3CE specialvar VAR_RESULT, ShouldTryRematchBattle compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ED424 + goto_if_eq Route104_EventScript_1ED424 setvar VAR_0x8004, 604 specialvar VAR_RESULT, sub_813B4E0 compare VAR_RESULT, 0 - goto_eq Route104_EventScript_1ED3F8 + goto_if_eq Route104_EventScript_1ED3F8 msgbox Route104_Text_295689, MSGBOX_DEFAULT release end @@ -896,8 +881,7 @@ Route104_EventScript_1ED38D:: @ 81ED38D Route104_EventScript_1ED3CE:: @ 81ED3CE special sub_80B4808 waitmovement 0 - checkflag FLAG_HAS_MATCH_CALL - goto_eq Route104_EventScript_1ED3DF + goto_if_set FLAG_HAS_MATCH_CALL, Route104_EventScript_1ED3DF release end @@ -908,8 +892,7 @@ Route104_EventScript_1ED3DF:: @ 81ED3DF end Route104_EventScript_1ED3F8:: @ 81ED3F8 - checkflag FLAG_HAS_MATCH_CALL - goto_eq Route104_EventScript_1ED40B + goto_if_set FLAG_HAS_MATCH_CALL, Route104_EventScript_1ED40B msgbox Route104_Text_295689, MSGBOX_DEFAULT release end @@ -929,11 +912,11 @@ Route104_EventScript_1ED43B:: @ 81ED43B trainerbattle_single TRAINER_WINSTON_1, Route104_Text_295870, Route104_Text_2958AD, Route104_EventScript_1ED47C specialvar VAR_RESULT, ShouldTryRematchBattle compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ED4D2 + goto_if_eq Route104_EventScript_1ED4D2 setvar VAR_0x8004, 136 specialvar VAR_RESULT, sub_813B4E0 compare VAR_RESULT, 0 - goto_eq Route104_EventScript_1ED4A6 + goto_if_eq Route104_EventScript_1ED4A6 msgbox Route104_Text_2958C1, MSGBOX_DEFAULT release end @@ -941,8 +924,7 @@ Route104_EventScript_1ED43B:: @ 81ED43B Route104_EventScript_1ED47C:: @ 81ED47C special sub_80B4808 waitmovement 0 - checkflag FLAG_HAS_MATCH_CALL - goto_eq Route104_EventScript_1ED48D + goto_if_set FLAG_HAS_MATCH_CALL, Route104_EventScript_1ED48D release end @@ -953,8 +935,7 @@ Route104_EventScript_1ED48D:: @ 81ED48D end Route104_EventScript_1ED4A6:: @ 81ED4A6 - checkflag FLAG_HAS_MATCH_CALL - goto_eq Route104_EventScript_1ED4B9 + goto_if_set FLAG_HAS_MATCH_CALL, Route104_EventScript_1ED4B9 msgbox Route104_Text_2958C1, MSGBOX_DEFAULT release end @@ -974,11 +955,11 @@ Route104_EventScript_1ED4E9:: @ 81ED4E9 trainerbattle_single TRAINER_CINDY_1, Route104_Text_295A7E, Route104_Text_295ABB, Route104_EventScript_1ED52A specialvar VAR_RESULT, ShouldTryRematchBattle compare VAR_RESULT, 1 - goto_eq Route104_EventScript_1ED580 + goto_if_eq Route104_EventScript_1ED580 setvar VAR_0x8004, 114 specialvar VAR_RESULT, sub_813B4E0 compare VAR_RESULT, 0 - goto_eq Route104_EventScript_1ED554 + goto_if_eq Route104_EventScript_1ED554 msgbox Route104_Text_295AC3, MSGBOX_DEFAULT release end @@ -986,8 +967,7 @@ Route104_EventScript_1ED4E9:: @ 81ED4E9 Route104_EventScript_1ED52A:: @ 81ED52A special sub_80B4808 waitmovement 0 - checkflag FLAG_HAS_MATCH_CALL - goto_eq Route104_EventScript_1ED53B + goto_if_set FLAG_HAS_MATCH_CALL, Route104_EventScript_1ED53B release end @@ -998,8 +978,7 @@ Route104_EventScript_1ED53B:: @ 81ED53B end Route104_EventScript_1ED554:: @ 81ED554 - checkflag FLAG_HAS_MATCH_CALL - goto_eq Route104_EventScript_1ED567 + goto_if_set FLAG_HAS_MATCH_CALL, Route104_EventScript_1ED567 msgbox Route104_Text_295AC3, MSGBOX_DEFAULT release end |